[asterisk-users] Count Available Queue members

Alex Balashov abalashov at evaristesys.com
Sat Jul 18 10:36:54 CDT 2009


Gabriel Ortiz Lour wrote:

>   Someone know how can I check for available members on a queue Before I 
> queue the call, so I can do something else with it? Note that is not the 
> case for joinempty

It's going to take some sort of hack, since there appears to be no 
dialplan app to do this succinctly.

One option is to call an AGI script that in turn runs:

    asterisk -rx 'queue show your-queue-name' |
        egrep 'SIP\/.+ \(Not in use\)' | wc -l

It can set a channel variable and you can then evaluate its value in the 
dial plan with GotoIf().

Another, more sophisticated option is to have a piece of middleware that 
keeps track of when agents are connected to a caller via listening to 
the Asterisk manager interface, or by reading the queue log.  It can 
then be queried via FastAGI.

Really, there should be a dialplan app for this.  Feature request?

-- 
Alex Balashov
Evariste Systems
Web     : http://www.evaristesys.com/
Tel     : (+1) (678) 954-0670
Direct  : (+1) (678) 954-0671



More information about the asterisk-users mailing list