Hello everyone,
I’m currently reviewing a step in a customer’s asterisk configuration. The customer would like to set a limit on maximum active calls, based on how many receptionist (Agents) are in the office. Each receptionist/Agent has got its own phone and a unique SIP extension assigned.
Right now, in the extensions.conf file, I’m running this block of code:
exten => 1,3,Set(GROUP()=chiam_in)
exten => 1,4,Verbose(1,**** Numero chiamate ${GROUP_COUNT(chiam_in)})
exten => 1,5,GotoIf($[${GROUP_COUNT(chiam_in)} >12]?3,1)
exten => 1,6,WaitExten(2)
exten => 1,7,Queue(Segreteria,t,,,600)
exten => 1,8,Background(/var/lib/asterisk/sounds/it/custom/BusyOperators)
exten => 1,9,Hangup()
exten => 2,1,Answer
exten => 2,2,Dial(SIP/301&SIP/422&SIP/423&SIP/425&SIP/426&SIP/490&SIP/497&SIP/498&SIP/499,30,tTr)
exten => 2,3,Background(/var/lib/asterisk/sounds/it/custom/out-of-working-time)
exten => 2,4,Hangup()
exten =>3,1,Verbose(1,***LIMIT EXCEEDED ${GROUP_COUNT(server2Trunkgroup)})
exten =>3,2,Background(/var/lib/asterisk/sounds/it/custom/BusyOperators)
exten =>3,3,Set(DIALSTATUS=CHANUNAVAIL)
With the help of the customer, we would like to dynamically change that limit that is currently set on 12.
We elaborated a formula that fits his desire, which I’m trying to translate in my code this way:
exten => 1,5,GotoIf($[${GROUP_COUNT(chiam_in)} > (K * NumberOfAgents)]?3,1)
where K is a number which is (“the number of calls in the queue we decide we want for each agent” + 1).
Also, we would like to call a function to get the “NumberOfAgents” currently working from Asterisk, is there such function?
Is this thing feasible?