[asterisk-users] limit concurrent calls on trunk supporting multiple DID

C. Chad Wallace cwallace at lodgingcompany.com
Thu Sep 17 19:11:14 CDT 2009


At 7:16 AM on 17 Sep 2009, Patrick wrote:

> I've one SIP trunk that support multiple DID. Only the trunk is
> documented in sip.conf (called DID is taken from the sip-header in
> real time).
> I would like to limit the number of simultaneous calls on each DID. Is
> there a way to achieve this ?

I think you could use GROUP() and GROUPCOUNT() for that.  I do that for
Queue calls currently, so each agent only gets one call at a time.  It
would go something like this (entirely untested):

[incoming]
exten => _X.,1,Set(DID=${EXTEN})
exten => _X.,n,GotoIf($[GROUP_COUNT(${DID})=0]?accept)
exten => _X.,n,Busy()

exten => _X.,n(accept),Set(GROUP()=${DID})
; Now let the call through as usual...
exten => _X.,n,Goto(mainmenu,s,1)

That puts each call into a group named by the DID, and returns Busy
if there is another call on the same DID.

-- 

C. Chad Wallace, B.Sc.
The Lodging Company
http://www.skihills.com/
OpenPGP Public Key ID: 0x262208A0

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20090917/d414b9a8/attachment.pgp 


More information about the asterisk-users mailing list