Dialout when someone leaves a message

Hi, I have been experimenting with asterisk calling out to a mobile when someone leaves a voicemail message. This is what I have so far:

First I set the variable VM in my normal dialplan, then when a hangup is received:

exten => h,1,GotoIf($[ "${VM}" = "mbox" ]?dialoutvm) exten => h,n,Hangup() exten => h,n(dialoutvm),Dial(SIP/0123123@draytel,15) exten => h,n,VoicemailMain(sdave@default) exten => h,n,Hangup()

This works as far as dialing out, but as soon as the call is answered asterisk hangs up and doesn’t execute the voicemailmain part. So is what I’m attempting actually possible at all?


Instead of Dial, try the Originate application. That’ll allow you to connect the called party directly to the Voicemail application.

Thanks, that did the trick.

good stuff. Interesting idea. Definitely applicable.

Actualy I’ve now changed it to play a ‘you have messages’ message and hangup. I’m wondering what would happen if for some reason the mobile number went to voicemail. I expect both voicemail apps to talk to each other and for me to get a huge bill.

Presumably, the mobile company has some sort of timeout built in to cut you off eventually? Like a maximum message duration?

The option you can use during the Dial is the L option:

wiki.asterisk.org/wiki/display/ … ation_Dial