<div>Dear Michiel,</div>
<div>&nbsp;</div>
<div>Would you be kind enough to put more light on RAND stuff. How you do the load balancing.</div>
<div>&nbsp;</div>
<div>Regards,</div>
<div>&nbsp;</div>
<div>Umair Bari<br><br>&nbsp;</div>
<div><span class="gmail_quote">On 2/4/06, <b class="gmail_sendername">Michiel van Baak</b> &lt;<a href="mailto:michiel@vanbaak.info">michiel@vanbaak.info</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">On 04:47, Sat 04 Feb 06, Joseph Tanner wrote:<br>&gt; This is probably a stupid question, but how do you specify multiple
<br>&gt; fallovers?&nbsp;&nbsp;I.e., if provider1 is not reachable/busy, try provider2.<br>&gt; If provider2 is down, try provider3.&nbsp;&nbsp;If provider3 is down...etc.&nbsp;&nbsp;I<br>&gt; understand how to do it the old way, just keep adding 101 to the
<br>&gt; extension.&nbsp;&nbsp;What would you add to a NOANSWER extension though?&nbsp;&nbsp;I<br>&gt; guess you could send it to a different context, then you could use<br>&gt; another NOANSWER, but I like keeping things short and easy.<br>
<br>[snip]<br><br>&gt; &gt; [macro-safedial]<br>&gt; &gt; ;exten = s,1,Dial(${ARG1},${ARG2},g,${ARG4})<br>&gt; &gt; exten = s,1,Dial(${ARG1},${ARG2},${ARG3},${ARG4})<br>&gt; &gt; exten = s,2,Goto(s-${DIALSTATUS},1)<br>&gt; &gt; exten = s-CANCEL,1,Hangup
<br>&gt; &gt; exten = s-NOANSWER,1,GotoIf($[&quot;${DIALEDTIME}&quot; = &quot;0&quot;]?3)<br>&gt; &gt; exten = s-NOANSWER,2,Hangup<br>&gt; &gt; exten = s-NOANSWER,3,Verbose(1,Need failover for &quot;${ARG1}&quot;)<br>&gt; &gt; exten = s-BUSY,1,Busy
<br>&gt; &gt; exten = s-CHANUNAVAIL,1,Verbose(1,Need failover for &quot;${ARG1}&quot;)<br>&gt; &gt; exten = s-CONGESTION,1,Congestion<br>&gt; &gt; exten = _s-.,1,Congestion<br>&gt; &gt; exten = s-,1,Congestion<br><br>I have this macro too in my 
extensions.conf<br>Later in the dialplan I use:<br><br>[outgoing-speakup]<br>;dutch telephone nrs.<br>exten =&gt; _0XXXXXXXXX,1,Set(CDR(ACCOUNTCODE)=outgoing-speakup)<br>exten =&gt; _0XXXXXXXXX,2,Set(CALLERID(all)=XXXXXXXXX)
<br>exten =&gt; _0XXXXXXXXX,3,Macro(safedial,${IAXTRUNK_SPEAKUP01}/31${EXTEN:1},50,Tr)<br>exten =&gt; _0XXXXXXXXX,4,Macro(safedial,${IAXTRUNK_SPEAKUP02}/31${EXTEN:1},50,Tr)<br>exten =&gt; _0XXXXXXXXX,5,Macro(safedial,${ZAPTRUNK}/${EXTEN},50,Tr)
<br>exten =&gt; _0XXXXXXXXX,6,Congestion()<br><br>Works like a charm.<br><br>In my production environment I actually load balance calls<br>using RAND so both IAXTRUNK_SPEAKUP01 and IAXTRUNK_SPEAKUP02<br>get an equal load of calls, but that's not relevant to your
<br>question :)<br><br>--<br>Michiel van Baak<br><a href="http://michiel.vanbaak.info">http://michiel.vanbaak.info</a><br><a href="mailto:michiel@vanbaak.info">michiel@vanbaak.info</a><br>GnuPG key: <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&amp;search=0x7E0B9A2D">
http://pgp.mit.edu:11371/pks/lookup?op=get&amp;search=0x7E0B9A2D</a><br><br>&quot;Why is it drug addicts and computer afficionados are both called users?&quot;<br><br>_______________________________________________<br>--Bandwidth and Colocation provided by 
<a href="http://Easynews.com">Easynews.com</a> --<br><br>Asterisk-Users mailing list<br>To UNSUBSCRIBE or update options visit:<br>&nbsp;&nbsp;<a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users
</a><br></blockquote></div><br>