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