Dialplan help for voicemail retrieval

i have a hand built asterisk box built, centos 5.4 asterisk 1.4.29 and can not figure out how to send the extension number to exten=>voicemailmain() so that the end user does not have to enter there mailbox number and password. when in the cli i can see that when the end user dials *97 the call is npa-nxxxxxx-00000x as the pattern match, asterisk gives this :
– Executing [*97@residential:1] VoiceMailMain(“SIP/16023549108-00000001”, " ") in new stack
– <SIP/16023549108-00000001> Playing ‘vm-login’ (language ‘en’)
[Jan 28 16:35:12] WARNING[18793]: app_voicemail.c:7276 vm_authenticate: Couldn’t read username

my dialplan is:
exten => *97,1,VoicemailMain(${ARG2})

i am very new to creating dialplan by hand, and could use some guidance in how to either trunicate the number or some way to id the caller.

thanks

Take a look on this Macro.

Try this…

Replace 6 with you code (*97) The important part is ${CALLERID(num)} If you have a voicemail.conf context other than default put that after the “@”.

Good Luck!!

thanks so much guys the exten=>_*97,1,VoiceMailMain(${CALLERID(num)}@default) did the trick once i changed the “phones” to default.

Good to hear. By default it will look in the default :wink: voicemail.conf context. So you could even take that “@default” part off.