[Asterisk-Users] Fail over using CHANAVAIL

Chris Mason lists at masonc.com
Sun Jan 22 12:11:39 MST 2006


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.

[globals]
TELIAX=username1 at teliax
VOXEE=username2 at voxee

[macro-longdistance]
;
; Standard extension macro:
;   ${ARG1} - Number to dial
;
exten => s,1,SetCallerID("NetConcept"<1234567890>|a)
exten => s,2,ChanIsAvail(IAX2/${TELIAX}&IAX2/${VOXEE})
exten => s,2,Read(${AVAILCHAN})
exten => s,3,Cut(C=AVAILCHAN,,1)
exten => s,4,NoOp(AVAILCHAN= ${C})
exten => s,5,Dial(${C}/${ARG1},60,tr)

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




More information about the asterisk-users mailing list