Asterisk voicemail callmanager integration

I’m using asterisk as voicemail to callmanager. I’ve followed the tutorial at voip-info.org and got it working with mwi and all.

The big difference I’m dealing with is that I have one voicemail box for every phone (they all share the same vm). So instead of a vm box for each extension I hard code the vm number in asterisk so that no matter who call what number they go to that vm.

My last problem is getting the voicemail button on the phone to get the user into checking the vm NOT leaving a vm. The callmanager vm pilot is 5700. From my example below you can see i’ve hard coded so that when 5700 is called it goes to Voicemail(5700,u) to leave a vm.
I’ve created a 3900 extension they can call to check the vm.
From the commented out section I tried to get working the example where if they called from an internal phone it would take them to VoiceMailMain but it isn’t working. It ALWAYS goes to VoiceMailMain when I have that section in and comment out my other one.

exten => 5700,1,Voicemail(5700,u) ; Right to voicemail
exten => 5700,2,PlayBack(vm-goodbye)
exten => 5700,3,HangUp()
exten => 3900,1,VoicemailMain(5700)
;exten => 5700,1,GotoIf($"${CALLERID(rdnis)}" = “”?400)
;exten => 5700,3,Congestion
;exten => 5700,103,103,Voicemail(5700,u)
;exten => 5700,104,Playback(vm-goodbye)
;exten => 5700,105,Hangup
;exten => 5700,400,VoicemailMain(5700)

Any ideas of how i can get the 5700 to go to voicemailmain only when they call from an internal phone which would always be extension “8700” from inside.

contexts

any way you can elaborate?

the “internal” calls come from callmanger sip trunk. not from configured asterisk extensions as there are none except for the vm and one that handles mwi.

You’ll have to parse the caller ID and use that to select a context.

hi,

I got an issue on using asterisk as voicemail for call manager. I followed step by step the instructions on the voip-info.org site, but i still don’t resolve that issue. The MWI is not working and i can’t leave a voicemail to cisco extension user. The voicemail pilot number is 8888 and from cisco when i press the message button i have access to my mailbox. But when another user from asterisk call a cisco user after a few seconds i should have a prompt tells me “the person at the extension 1 0 0 3 is not available…please leave your message after the tone”. Instead of getting that, the prompt asks me to enter my mailbox and password.

Any idea ???