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:
[abc-newcall]
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