Group_count to limit incoming calls

Whta’s wrong in this configuration?
I need to add this row “include => from-trunk” at the end of custom context [from-incoming-custom]?


Asterisk 11.10.0

-Peer details

exten => s,1,Set(GROUP()=limit)
exten => s,n,Set(COUNT=${GROUP_COUNT(limit)})
exten => s,n,NoOp(There are ${COUNT} incoming calls.)
exten => s,n,GotoIf($[${COUNT} > 1]?denied:continue)
exten => s,n(denied),NoOp(There are too many calls up already. Hang up.)
exten => s,n,HangUp()
exten => s,n(continue),Goto(from-trunk,${EXTEN},1)
;include => from-trunk

1 Like

An incoming call to FreePBX will not arrive with an exten of ‘s’, unless the call has no DID, it will arrive with an exten set to the DID. Try swapping ‘_.’ in place of the ‘s’ and it will likely work the way you expect.

Thanks, now is working!

1 Like

and if you do hungup, I wanted to turn the call in a queue?