Thank you for your suggestion
Actually they ask me to limit the number of simultaneous calls per trunk
In practice, if we limit 4 outgoing calls and incoming simultaneous total may not exceed 4
I do not know there is a way
There are no /incoming/ limits in the settings of trunks or inbound routes, that I can see… but you can probably use a queue (capacity 4, with queue-no-answer option set, and MOH set to ‘ring’) per incoming trunk, to that effect (set queue failover destination to terminate/hang up, not VM)
And if you made a contest only for the outgoing and incoming trunk and says that in that context can make up to 10 simultaneous calls?
If it were possible I could say how many contemporary lines are used …
; Here I am limiting to 100 max concurrent calls thru 'this trunk
context = FromServer2Trunk
; Call From This trunk lands to [FromServer2Trunk] context
This looks a lot like the trunk configuration - can you add the call-limit to your peer config?
Also see the help text on the Maximum Channels option of the trunk, may be what you want. (controls maximum number of outbound channels (simultaneous calls) etc…)
If that works, then you probably don’t need to limit it by the queue.
However having (a) queue(s) helps if you have calls ringing in simultaneously.
It is in fact
Today I can not find it I think …
But I hope to do it soon
Just tested will give information on this post
In addition there is a way more complex motion but I’m catching a glimpse as the most powerful human … In practice by creating groups coninvolti in the rule of limitation:
#vi extensions.conf #Asterisk Dialplan on Server1 [FromServer2Trunk] exten => _X., 1, Verbose (1 ***** Server2 dialing $ {EXTEN} *******) same => n, Set (GROUP () = server2Trunkgroup) same => n, Verbose (1 **** Number of concurrent calls are $ {GROUP_COUNT (server2Trunkgroup)}) same => n, GotoIf ($ [$ {GROUP_COUNT (server2Trunkgroup)}> 100]? 999) same => n, Dial (SIP / telco / $ {EXTEN}) same => 999, Verbose (1 *** Number of concurrent calls are $ {GROUP_COUNT (server2Trunkgroup)} over limit) same => n, Set (DIALSTATUS = CHANUNAVAIL)
I am sorry I can not speak Asterisk …
also your snippet got mangled.
, I too only just catch the gist of it… so it could work maybe, but I probably wouldn’t go on editing extensions.conf to add this (as a reload of FreePBX will erase this), but rather to extensions(something)_custom.conf and call that context from a custom destination ?