[asterisk-users] SIP Load Balancing

Barry Miller asterisk-users at notanet.net
Thu Oct 28 13:36:46 CDT 2010


On Thu, Oct 28, 2010 at 11:08:12AM -0400, Tim King wrote:
> I have a very simple setup with two SIP routes to my carrier. I need to have
> every other phone call placed to that carrier go to a different address.
> 
> This is what I need the call flow to look like. I have spent many hours
> searching and have not found a working example.
> Call1  exten => NXXNXXXXX,2,Dial(SIP/${DIALEDNUM}@2.4.6.8<DIALEDNUM%7D at 2.4.6.8>
> )
> Call2  exten => NXXNXXXXX,2,Dial(SIP/${DIALEDNUM}@1.2.3.4<DIALEDNUM%7D at 1.2.3.4>
> )
> Call3  exten => NXXNXXXXX,2,Dial(SIP/${DIALEDNUM}@2.4.6.8<DIALEDNUM%7D at 2.4.6.8>
> )
> Call4  exten => NXXNXXXXX,2,Dial(SIP/${DIALEDNUM}@1.2.3.4<DIALEDNUM%7D at 1.2.3.4>
> )
> Call5  exten => NXXNXXXXX,2,Dial(SIP/${DIALEDNUM}@2.4.6.8<DIALEDNUM%7D at 2.4.6.8>
> )
> Call6  exten => NXXNXXXXX,2,Dial(SIP/${DIALEDNUM}@1.2.3.4<DIALEDNUM%7D at 1.2.3.4>
> )
> Call7  exten => NXXNXXXXX,2,Dial(SIP/${DIALEDNUM}@2.4.6.8<DIALEDNUM%7D at 2.4.6.8>
> )
> Call8  exten => NXXNXXXXX,2,Dial(SIP/${DIALEDNUM}@1.2.3.4<DIALEDNUM%7D at 1.2.3.4>
> )
> ..........................

If your goal is really load balancing, not just alternating between
providers, you might look at the GROUP* functions.  Otherwise, if you
hit a stretch where you have, e.g., several even-numbered calls of long
duration mixed with short odd-numbered calls, most of your traffic will
wind up on the same route.

-- 
Barry



More information about the asterisk-users mailing list