[Asterisk-Users] Half Solved - Fail over to Pri on VoIP connection failure

Cavanna, Richard RCavanna at sychip.com
Fri Feb 10 08:04:10 MST 2006


I want to say thanks to everyone for the help so far.  I figured out a
way to modify some AAH code that worked for me (well sort of).  The line
I modified is s,14 in macro-dialout-trunk. Then I just added a variable
and passed it from 9_outside.


I just have one last problem.  This waits for an answer not ringing.  So
if the called party has a long ring to voice mail the call is dropped
and goes out the PRI.  

Does anyone know of a way to listen for ringing on an IAX2 channel?

[9_outside]
exten => _9Z.,1,Macro(dialout-trunk,"trunk-number-here",${EXTEN:1},,20)
exten => _9Z.,2,Macro(dialout-trunk,"trunk-number-here",${,${EXTEN:1},)
exten => _9Z.,3,Macro(outisbusy)	; No available circuits


[macro-dialout-trunk]
exten => s,1,GotoIf($[foo${ARG3} = foo]?3:2))	; arg3 is pattern
password
exten => s,2,Authenticate(${ARG3})
exten => s,3,Macro(user-callerid)
exten => s,4,Macro(record-enable,${CALLERIDNUM},OUT)
exten => s,5,Macro(outbound-callerid,${ARG1})
exten => s,6,SetGroup(OUT_${ARG1})
exten => s,7,CheckGroup(${OUTMAXCHANS_${ARG1}})
; if we've used up the max channels, continue at (n+101)
exten => s,8,SetVar(DIAL_NUMBER=${ARG2})
exten => s,9,SetVar(DIAL_TRUNK=${ARG1})
exten => s,10,AGI(fixlocalprefix) ; this sets DIAL_NUMBER to the proper
dial string for this trunk
exten => s,11,SetVar(OUTNUM=${OUTPREFIX_${ARG1}}${DIAL_NUMBER})  ;
OUTNUM is the final dial number
exten => s,12,Cut(custom=OUT_${ARG1},:,1)  ; Custom trunks are prefixed
with "AMP:"
exten => s,13,GotoIf($[${custom} = AMP]?16)
;exten => s,14,Dial(${OUT_${ARG1}}/${OUTNUM})  ; Regular Trunk Dial
exten => s,14,Dial(${OUT_${ARG1}}/${OUTNUM},${ARG4})  ; Regular Trunk
Dial w/ timeout
exten => s,15,NoOp(HANGUPCAUSE is ${HANGUPCAUSE} and DIALSTATUS is
${DIALSTATUS})
exten => s,16,Goto(s-${DIALSTATUS},1)



Thanks,



More information about the asterisk-users mailing list