Creating an alert when a call has been on hold in Queue


Here’s what I am trying to do:
My manager wants an alert when a call has been holding in one of our Queues for more than 17secs. Towards this end, he purchased a Telstrobe, a flashing light that gets attached to a phone cord, and blinks when that line rings. We would like this light to start blinking when a call has been on hold for 17+ seconds. I believe I am going to somehow have to pull the hold time through the AMI, as once a call goes into a Queue in Asterisk, there seems to be no way in the dialplan to get information about the call.

I’ve been playing around with the AMI, trying to find a set of commands / actions to let me get the information I need. So far, it looks like QueueStatus is a good starting point, as if I can monitor for just QueueEntry events, I should be able to retrieve the wait times.

So, my question is, is there a way to “filter” for certain “event types” within the AMI, or will I need to have whatever script I come up with filter for the events I need?

As for the flashing light, that should be the easy part, when the script spots a 17+ second hold time, it will simply call an extension, which is connected to the light.

Thank you,
Jason A.


With FOP2 and the original FOP what can make a webpage load, this could be a php script that orignates your call to the light.


All of the Queue Tracking and Reporting packages have this functionality [usually driving web pages rather than flashing lights]. The trick is to be able to look for calls entering the queue but which have not yet been either connected to an agent or abandoned. The easiest way to do this is not through AMI since you are looking for “an event that has not happened” but rather to set up a polling routine against the queue_log. This gets even easier if you have the queue_log in a database table rather than a giant text file, since then you just have to run a query every XX seconds looking for calls that have “ENTERQUEUE” but without a “CONNECT” or “ABANDON” associated with them. This is the basic underlying logic to programs like QueueMetrics call center management programs.