[Asterisk-Users] Fail over using CHANAVAIL

Andrew Kohlsmith akohlsmith-asterisk at benshaw.com
Mon Jan 23 07:15:47 MST 2006


On Sunday 22 January 2006 14:11, Chris Mason wrote:
> I am trying to construct a macro for long distance dialling. I have two
> internet feeds, I have all routes including Teliax on Internet A and a
> static route to Voxee on Internet B. I thought I could use the dialplan
> entry below which uses the ChanIsAvail() command to check the
> connection, but this returns the provider but not the username, so I
> don't understand how to use this for real applications to determine IAX2
> availability. The only way I can see to use it is to only specify one
> channel and test it, jumping to n+101 if it isn't.

That is pretty much how I do things.  I use qualify for my SIP and IAX2 
connections and then basically do something like this:

In my nufone-dial macro():
exten => s,n,Dial(IAX2/benshaw at nufone-1/${ARG1},,go)
exten => s,n,Goto(dial-${DIALSTATUS},1)

exten => dial-CANCEL,1,Hangup
exten => dial-ANSWER,1,Hangup
exten => dial-NOANSWER,1,Hangup
exten => dial-BUSY,1,Busy
exten => dial-CONGESTION,1,Congestion
exten => dial-CHANUNAVAIL,1,Macro(asterlink-dial,${ARG1},${ARG2})

And then the asterlink-dial macro is almost identical, except CHANUNAVAIL 
calls the pri-dial macro, which I use as a last-effort attempt to get a call 
out, as it's my most expensive route.

-A.



More information about the asterisk-users mailing list