I’m running Asterisk 1.2.7 and using the following dialplan code in an attempt to control the number of simultaneous calls that can come in at one time. I like to be able to change this limit on the fly by simply editing the GROUP_COUNT line and reloading.
This seems to work, but only some of the time. Other times the limit seems to have no effect. Can anyone shed light on why that might be, suggest how to diagnose or maybe offer an alternate solution?
[incoming_exgn]
exten => 8001111111,1,Goto(iax_limit,s,1)
exten => 8001112222,1,Goto(iax_limit,s,1)
[iax_limit]
;check if limit is exceeded
exten => s,1,Set(GROUP()=exgn)
exten => s,2,GotoIf($[${GROUP_COUNT()} > 3]?333
exten => s,3, ring phones…
; Play busy and hangup if incoming limit is exceeded
exten => s,333,Answer
exten => s,334,Playtones(busy)
exten => s,335,Wait(5)
exten => s,336,Hangup