Hello everybody. I have a provider that has 3 asterisk boxes which I must balance my calls against. At the moment, I route different destinations to different boxes but this causes lots of problems. Without resorting to OpenSER or other proxies (as my provider also uses IAX), is there a way I can load balance outgoing channels in Asterisk? For example an IAX peer like: [iax_provider] type=peer username=myprovider host=xxx.xxx.xxx.10 host=xxx.xxx.xxx.11 host=xxx.xxx.xxx.12 secret=verysecret disalow=all allow=g729 Is there any way I can balance calls between all of the hosts in the providers description? In fact, if I set the dialplan like: exten => _X.,n,Dial(IAX2/iax_provider/${EXTEN} what IP addres will receive the call? host 10, 11 or 12? I know DAHDI can balance outgoing calls between the E1's of the span using DAHDI/r0/ instead of DAHDI/g0. Is there any way of doing this for other channels? Thanks! Alex
On Mon, 22 Feb 2010, Alejandro Recarey wrote:> I have a provider that has 3 asterisk boxes which I must balance my > calls against. At the moment, I route different destinations to > different boxes but this causes lots of problems.[snip]> Is there any way I can balance calls between all of the hosts in the > providers description?Name the provider hosts something like isp0, isp1, and isp2. Then in extensions.conf, use something like: dial(iax2/isp${MATH(${EPOCH}%3):0:1}/${EXTEN}) -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000
On Mon, 22 Feb 2010, Steve Edwards wrote:> dial(iax2/isp${MATH(${EPOCH}%3):0:1}/${EXTEN})Improving on myself... Using the "decimal" portion of UNIQUEID (the number of channels created by this instance of Asterisk) would be better than EPOCH. -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000