[Asterisk-Users] Newbie needs help

Chad Scott chad at idworld.net
Sat Jun 26 20:52:13 MST 2004

I've been banging my head on a brick wall for about an hour now trying 
to understand why the following doesn't work (which is even provided as 
an example in the distribution!).

The goal is to create a voicemail-only extension not associated with a 
phone.  I'd rather not have an extension dedicated to VoicemailMain(), 
so I would like the user to be able to hit '*' during the introductory 
message and be prompted for a password.

For whatever reason, this doesn't work as expected.  The first section, 
macro-stdexten, is what is provided in the distribution.  It defines 
exten => a,1,VoicemailMain(${ARG1}), which should match the return 
extension from Voicemail() if the user presses '*'.  Neither this nor 
my "vmonly" macro do this properly.  The '*' key instead does nothing.

Am I not understanding macros properly?


; Standard extension macro:
;   ${ARG1} - Extension  (we could have used ${MACRO_EXTEN} here as well
;   ${ARG2} - Device(s) to ring
exten => s,1,Dial(${ARG2},20)                                   ; Ring 
the interface, 20 seconds maximum
exten => s,2,Goto(s-${DIALSTATUS})                              ; Jump 

exten => s-NOANSWER,1,Voicemail(u${ARG1})               ; If 
unavailable, send to voicemail w/ unavail announce
exten => s-NOANSWER,2,Goto(default,s,1)                 ; If they press 
#, return to start

exten => s-BUSY,1,Voicemail(b${ARG1})                   ; If busy, send 
to voicemail w/ busy announce
exten => s-BUSY,2,Goto(default,s,1)                             ; If 
they press #, return to start

exten => s-.,1,Goto(s-NOANSWER,1)                               ; Treat 
anything else as no answer

exten => a,1,VoicemailMain(${ARG1})                             ; If 
they press *, send the user into VoicemailMain

exten => s,1,Voicemail(${ARG1})
exten => s,2,Hangup

exten => a,1,VoicemailMain(${ARG1})

More information about the asterisk-users mailing list