[asterisk-users] Asterisk send calls to SIP Trunks with Round Robin Call Distribution
JR Richardson
jmr.richardson at gmail.com
Mon Apr 5 14:18:31 CDT 2010
>> I have a special requirement that insist an Asterisk server, 1.6.1.x, is
>> used.? I will have 2 SIP trunks coming into the server and I will have
>> to send calls to these SIP trunks with a round robin distribution
>> pattern.? I was thinking of using a group count function, if call count
>> is even send call to SIP Trunk 1, if call count is odd, send call to SIP
>> Trunk 2.
>
> The "decimal" portion of ${UNIQUEID} is incremented every time Asterisk
> creates a channel. Applying your even/odd logic to this should work fine.
>
Thanks Steve, works great:
exten => _X.,1,Set(uniqueidcut=${CUT(CDR(uniqueid),.,2)})
exten => _X.,n,Set(result=${MATH(${uniqueidcut}%2)})
exten => _X.,n,GotoIf($[${result} > 0 ]?siptrunk1,1:siptrunk2,1)
Thanks.
JR
--
JR Richardson
Engineering for the Masses
More information about the asterisk-users
mailing list