Limiting inbound (origination) calls

(HawkEye) #1

Was under the impression from the tool-tip in trunks for the field ‘Maximum Channels’ the number entered would limit the inbound calls using the context from-trunk-trunk-name in Trunk Sip Settings. Currently the Maximum Channels is set to 5 but as shown below, its not working.
CLI> core show channels
11 active channels
9 active calls

Is there any way to limit the number of concurrent inbound calls?

(Tom Ray) #2

Did you change the context= setting to that context?


try core show channels verbose , Asterisk is a B2BUA so all calls will have at least an A and a B channel,so 9 ‘active calls’ will probably have less than your ‘maximum channel’ count

(Lorne Gaetz) #4

Controls the maximum number of outbound channels (simultaneous calls) that can be used on this trunk. Inbound calls are not counted against the maximum. Leave blank to specify no maximum.

Emphasis added.

The max channels field in the trunk config is only to limit outbound channels, and the limit can either include inbound channels or not.

(HawkEye) #5

It was set already to context=from-trunk-sip-trunkname

(Tom Ray) #6

And it is the only inbound trunk? There arent other trunks accepting inbound calls?

(HawkEye) #7

Yes its the only trunk.

(Tom Ray) #8

Then we need to see debugs of inbound calls not being counted.

(HawkEye) #9

Hi Dicko,
core show channels indicated 9 active calls. Queue show queue# showed 8 calls holding and one active call. But the max channels is set to 5. For now I have limited max callers in queue but will have to fix the failover to be more gentle than it is right now.

I thought (incorrectly?) max channels = max calls (in+out) provided the sip trunk setting context is set.

(Tom Ray) #10

Are there things like voicemail or other features being used. Because 9 calls and 11 active channels is sounding more like 2 two channel calls and 7 one channel calls.

(HawkEye) #11

Inbound route => queue. Failover => hangup Got to change that hangup… to abrupt. No voicemail or other goodies.


Perhaps use GROUP_COUNT for inbound calls?

(Tom Ray) #13

Show a debug of this failing to track inbound calls.


This is how I do it, modify to suit your needs:

same => n,Noop(--------- Inbound call limiter check ---------)
same => n,Set(GROUP()=call_count)
same => n,Noop(----------------------------------------------)
same => n,Noop(Configured Call Limit: 50 )
same => n,Noop(Current number of calls, inc this call: : ${GROUP_COUNT(call_count)})
same => n,Noop(----------------------------------------------)
same => n,GotoIf($[${GROUP_COUNT(call_count)} > 50 ]?hangup())
same => n,Noop(---- Inbound call limiter check : PASS -------)
same => n,Noop(----------------------------------------------)

(Itzik) #15

It’s strongly recommended NOT to use that, rather use from-pstn-xyz.



If the OP decides to use the code, they can modify it as they see fit

(Itzik) #17