Having Dial() detect cell phone voicemail

I have an asterisk server running freepbx, with a few extensions and an IAX2 trunk provided by my VOIP service provider. Everything is working pretty good.

I have a custom extension that does some specialized stuff. It calls a few AGI scripts, dials out to an extension, and then has special behavior depending on if someone picked up on the other line or not. Specifically, the user is presented with more options if there was nobody picking up on the other side.

Right now the custom extension dials out Local/7300, which works fine.

I also wanted to have it dial out my cell phone. So I added “IAX2/netvoice/1234321234” to the dial() command. It calls my cellphone nicely. Excellent.

But my cell phone picks up the call and sends it to my cellphone’s voicemail. So asterisk thinks I picked up the call, when really it was just my answering machine.

Is there anyway to detect and suppress the voicemail from my cell phone?

Attached is relevant parts of my extensions_custom.conf:


Answer the call

exten => 2000,1,Answer
exten => 2000,n,Playback(custom/please_wait_for_assistant)
exten => 2000,n,AGI(KCS-callin1|param1|param2)

Turn on call recording

exten => 2000,n,MixMonitor(/tmp/call555.wav)

Transfer call

exten => 2000,n,Dial(Local/7300&IAX2/netvoice/1234321234,30,rig)

Behavior depending on if transfer was successful or not

exten => 2000,n,GotoIf($["${DIALSTATUS}" = “ANSWER”]?finished:failed)
exten => 2000,n(failed),Goto(kcs-callback-ask,6001,1)
exten => 2000,n(finished),AGI(KCS-callout|${NEWPBXCALLID}|param2)
exten => 2000,n,Playback(custom/thank_you_for_using_us)
exten => 2000,n,Playback(custom/you_can_callback_anytime)
exten => 2000,n,Playback(custom/goodbye)
exten => 2000,n,Hangup

Have you looked at the Follow Me with Confirm functions?


Nice, that’s exactly what I needed!

I guess I just needed to know what it was called. Thanks!

Okay, so one more problem.

I setup followme in freepbx, and if I actually dial extention 7300 from x-lite, it works perfectly.

However, in my custom extension, when I dial:

exten => 2000,n,Dial(SIP/7300,30,rig)

It doesn’t do the follow-me, it just dials the extension normally. How can I run the followme from a custom extension?

Have you tried putting a # at the end of your extension? Meaning:

exten => 2000,n,Dial(SIP/7300#,30,rig)

In FreePBX, there is a tooltip that pops up if you mouse over the “Extension list” that says if the # does not follow the extension, it will not go to follow-me, and that putting a # at the end is needed to have it go to follow-me or queues, etc.

frosty555, try this:

exten => 2000,n,Dial(Local/[email protected],30,rig)