I was trying to set up a dynamic route using a guide I believe from @lgaetz (I wish I saved the link, but he referenced it recently). Essentially here is what I am trying to accomplish:
Caller (whether from the public or internal) calls our helpdesk queue number:
–if they are the only caller (all agent(s) available to take call), send call straight to the queue and be done
–if there is at least one other caller (looking at the ${QUEUE_WAITING_COUNT} variable):
----send call to an IVR that says "all agents are busy, press 1 to continue holding, or 2 to leave a voicemail
I do have an inbound route set for the helpdesk queue number to go to the dynamic route:
I also have it go to the dynamic route if calling from the inside:
exten => 5555,1,GoSub(dynroute-2,1,1)
same => n,Hangup()
It works as expected for the first caller - if I make a test call and the queue is empty. Then I add another call in, so the wait count will be 1, that’s fine. When I add a third call in however, it doesn’t go to the IVR. It just goes to the queue announcement saying they are second in line, then plays music on hold.
I confirmed the variable after I put the second call in is greater than 0 (I call 222 to get that value)
– Executing [222@from-internal:1] NoOp(“PJSIP/3717-00000054”, “Count=1”) in new stack
– Executing [222@from-internal:2] Hangup(“PJSIP/3717-00000054”, “”) in new stack
I am not sure if I set the dynamic route up incorrectly or not. Here’s what I have:
How I understand it, that value will be either 0 for false (0 calls waiting), or 1 for one or more waiting. Then I’m using that on the match - 0 waiting will just send straight to the queue, while 1 or more waiting will go to the IVR.
Here is a pastebin of the 3rd call. I can see it in there hitting the dynamic route (dynroute-2), but it seems to drop off there?