Capture Agent Login/Logout event


We’re using Asterisk with freepbx

We would like to launch an external command or AGI script (undecided yet) upon queue agent’s login/logout.

How do we capture that event and use it?

I saw that there’s a macro running when an agent logs in. Should we manipulate it (where are the macros located?) or is there a way to do it in parallel/separately?

Thank you in advance,



It seems that realtime queue_log is the way to go, but it’s not installed automatically on AsteriskNOW with FreePBX.

Can anyone guide us on how to install it?