Checking status of a queue


I’ve been digging around a bit and can’t seem to find an easy way to do this. Basically I want to know via dialplan the status of a queue before inserting a call. This way I can redirect the call without actually inserting in the queue. The call flow I’m looking for is

  1. Inbound call
  2. if agent in queue can take call immediately add to queue
  3. if agent in queue cannot immediately take call send to destination that does various things
  4. After caller completes the various things insert caller into queue.

Basically I’m stuck on 2 and 3 since I can’t find an Asterisk dialplan function that returns the agent availability of a queue. I can’t use the queue options to not allow people to join when unavailable in the first step since I want them to be able to join when unavailable after they jump through my hoops.


You can find out available agents via AMI.