[*] Catching all result codes (finally solved the mystery)

John Lange john.lange at open-it.ca
Wed Mar 2 12:29:54 CST 2005


Further to the question I asked at last night's meeting regarding
allowing for all status and return codes from an attempted dial; and
acting on Bill's suggestion to take a closer look at the samples I
devised the following dialplan taken almost exactly from the examples.

[macro-stdexten]
exten => s,1,Dial(${ARG1},20)
exten => s,2,Goto(s-${DIALSTATUS},1)
exten => s-NOANSWER,1,Voicemail(u${MACRO_EXTEN})
exten => s-NOANSWER,2,Goto(default,s,1)
exten => s-BUSY,1,Voicemail(b${MACRO_EXTEN})
exten => s-BUSY,2,Goto(default,s,1)
exten => s-.,1,Goto(s-NOANSWER,1) ; everything else is treated as no answer
exten => a,1,VoicemailMain(${ARG1}) ; If they press *, send the user into VoicemailMain

-----

This does _NOT_ work!

I banged my head against the wall for quite some time before the obvious
error in the asterisk examples revealed itself. This line:

exten => s-.,1,Goto(s-NOANSWER,1)

is supposed to match all patters starting with "s-", but patterns must
start with an underscore! The line should be:

exten => _s-.,1,Goto(s-NOANSWER,1)

Hope this helps someone.

-- 
John Lange




More information about the Asterisk mailing list