Detecting available, but busy agents in a queue?


I have the following requirement and can’t figure out how to go about setting it up:

We have a department (2 people/2 phones). These people are not at their desks all the time and the time they are at their desk is not predictable - so no time condition solution here. We would like to setup the following:

  1. When a call comes in, both phones are rung. If no answer at either, they go to voice mail after an acceptable delay (say 30 secs). Easy enough: Ring Group. Already done.

  2. However, when either person is at their desk and on the phone, we would like any subsequent calls that come in, to go to a queue that rings these two phones. This way, if only 1 person is at their desk, a caller does NOT go to VM, but instead, is queued for the department. Having the users log in/out of the queue is not an option either, as these people are busy, come and go often and cannot be expected to remember to log in/out all the time.

I’m basically looking for a function that is the opposite of the FirstNotOnPhone Ring Strategy or Skip Busy Agent in Queues, where we could change the call flow based on ANY extension in a list being detected as in-use.

How would we set this up? I’ve played with all the Ring Strategy’s in both Ring Groups and Queues and have had no success…



Actually, I want callers to wait in queue when at least one person is around to take calls, otherwise, I don’t want to waste the callers time and I want to send them to VM.

Again, this is not a call center. Callers are not expecting to be answered by an agent all the time, as a matter of fact, the lines really aren’t that busy (that’s why this is not a dedicated call center!) but, there are times that someone is around to take calls and there are even fewer times, when more than one call comes in at the same time - in this case, the new setup caters to the application perfectly! If call taker = available then send them to phone/queues. if not, ring the phones for 30 secs then send them VM. So, to answer your last questions, this is exactly what happens after hours (end of shift) - calls go to VM. Almost like an automatic presence detection algorithm!



Glad you got it working.

It wouldn’t make any sense for the caller to wait 5 minutes in a queue when no one is around or if both employees are on the phone.

I do know that the queue features a fail over destination and you can set the wait time to 30 seconds and send to VM if no response.

What are you doing at the end of the shift? They don’t ever login to the phone so the phones ring afterhours for 30 seconds before going to vm?

Hi Asterisk21st;

I’m not sure I understand your suggestion. The problem I’m trying to solve is to determine IF someone is on the phone, and if so, I should route the call to a queue instead of a Ring Group that terminates with VM after 30 secs.

My scenario is this: If someone calls and no one is available to take the call, I want it to route to VM in 30 secs. However, is someone is on the phone, that means he/she is available for more calls, and thus any subsequent calls that come in should get queued, allowing the caller to wait up to, say 5 mins before going to VM.

The problem with what I’ve tried (and I believe, you suggest) is that there is no way to adjust the wait time (30 secs vs 5 mins) a caller waits before going to VM based on ‘agent’ availability. (I know I use the word agent and that queues may imply a call center, but in most small companies, employees multi-task and may not always be available to answer phones!)

My Solution:

I have come up a solution using an agi script. After getting some inspiration from a script I found here:

I made a script that is called via the Dialplan Injection module:

I pass in two destination contexts (with extensions, one for a Ring Group the other for a Queue) along with a list of extensions to test ExtensionState on. If ANY extension reports either 1-in use, 2-busy or 16-on hold, I assume that a human is manning one of my phones in the list and I route the call to the queue. If ExtensionState returns anything else for the extension list, I route the call to the ring group.

The Ring Group rings the phones for 30 secs, then goes to VM. The Queue rings the phones and holds the caller for a longer period of time (as set in the queue options) giving me the desired behaviour of holding callers for longer when humans are available to answer phones, while still being able to send callers to VM when no one is around!

It would be nice to see this sort of functionality built into FPBX’s UI. I’m sure this feature would be beneficial for many users, not just me!



So the way I see it, a ring all strategy is not even needed. Have the queue ring these two phones in a liner manner and whoever is not at the desk will roll it to the next phone. if that person is not at the desk, it goes to voicemail. (rings both extensions and goes to VM)
IF one person is at their desk and one phone call comes in, they take it; if another calls in, send to the queue for a little bit (maybe even with an announcement that they are next) but if no one answers, it goes to voicemail.

Put the two devices/extensions in the queue as static and they won’t have to login/out.