[Asterisk-Users] exten statement execution order
David L. West
nntp at deskoptional.com
Tue May 9 21:12:01 MST 2006
In the following macro, a call is dialed and control branches according
to DIALSTATUS, much like the default std-exten macro. What I'm trying
to figure out is how to regain control when the call is answered.
; Standard extension logic
[macro-stdexten]
; ${ARG1}=Extension ${ARG2}=Device(s) to ring
exten => s,1,NoOp(stdexten ${EXTEN})
exten => s,n,Set(cname=${CALLERID(number)}@asterisk.deskoptional.com)
exten => s,n,Set(CALLERID(number)=${cname})
exten => s,n,Macro(psa-predial)
exten => s,n,Dial(${ARG2},20,tTwW)
exten => s,n,Set(savestatus=${DIALSTATUS})
exten => s,n,Macro(psa-postdial)
exten =>
s,n,Goto(s-${savestatus},1);ANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER
exten => s-ANSWER,1,NoOp(call was answered!!!!!)
exten => s-CHANUNAVAIL,1,VoiceMail(u${ARG1})
exten => s-CONGESTION,1,VoiceMail(u${ARG1})
exten => s-NOANSWER,1,Voicemail(u${ARG1})
exten => s-BUSY,1,Voicemail(b${ARG1})
exten => s,200,NoOp(DONE WITH MACRO)
In all cases but "ANSWER", the psa-postdial macro executes. Can somebody
help me understand the
flow of operations here? The s-ANSWER line never gets called either.
I'm digging around on www.voip-info, but hoping some kind sould here will
set me on the right path.
More information about the asterisk-users
mailing list