Hey all!
I am looking to configure my system such that only two total calls can be active on all extensions, including park extensions, at any given time. If there are already two calls then new calls go to the queue and stay there until one is freed up.
The tricky part is that we have seven phones in the queue and we would like all calls to be immediately available on any of them. So calls will keep ringing the phones even if two of the agents are busy.
I have this pretty silly unfinished custom application for sending calls to the queue when there are two or more active:
[call-count]
exten => s,1,Set(calls=${SHELL(asterisk -rx 'core show calls' | grep 'active call' | cut -f1 -d' ' | tr -d '\n')})
exten => s,n,Set(queuec=${SHELL(asterisk -rx 'queue show 630' | head -n1 | cut -f3 -d' ' | tr -d '\n')})
exten => s,n,GotoIf($[${calls} - ${queuec} > 1]?:busy)
Then I can make this application the inbound route destination and the sole queue agent. The problem with that though is that calls will just continuously leave the queue and lose their place in line.
Another idea might be to run a cron job every 10 seconds or so that checks the call count and pauses/unpauses members based on that number.
Just wondering if anyone has a less janky idea for this? Also if you can think of something similar but not quite this functionality let me know! Just looking for ideas. The biggest hurdle I am trying to avoid is having to manually unpause extensions.
Thank you!