[asterisk-users] realtime queue callers

Vieri rentorbuy at yahoo.com
Mon Apr 28 12:34:44 CDT 2008


How can I get a list of the callers within a specific
queue at any given moment?

I need to get the caller IDs of all active calls in a
queue then send them out via a udp socket to a
listening application on the network (the only data I
need to send are two fields: current timestamp and
caller id of active queue calls).

I have almost all the elements to do this except the
best method to retrieve "all active caller ids from a
given queue". I was wondering if someone already did
this.

I tried writing a script on the server which connects
to the Manager API and receives queue events. I'm
basically using the AgentCalled event but it seems
clumsy to efficiently detect when the call has ended
(connect or abandon) and thus update the remote UDP
listening app.

I also tried another way by guessing which calls are
active via tailing and grepping
/var/log/asterisk/queue_log.

Finally, a third script method tried parsing the
output of "show queue XXXX" right after "Callers:".
Maybe this is all I really need for my purposes
(although less efficient and less "real-time" than the
queue events method because I would need to
periodically poll the whole queue statistics) but I
only get the originating channel and the wait time. I
would require correlating the data to the caller's ID.

Has anyone already done something similar?
A simple example/script/suggestion would be greatly
appreciated.

Thanks,

Vieri



      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ



More information about the asterisk-users mailing list