Group_count to limit incoming calls


(Ricardo diberi) #1

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

Thanks

FreePBX 2.10.1.19
Asterisk 11.10.0

Trunks
-Peer details
–context=from-incoming-custom

/etc/asterisk/extensions_custom.conf
[from-incoming-custom]
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


Limiting inbound (origination) calls
(Lorne Gaetz) #2

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.


(Ricardo diberi) #3

Thanks, now is working!


(Claudio Pelosi) #4

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