Not getting to correct VM from outside


I recently setup Asterisk and have it working with a SIP hard phone and a couple of SIP softphones … although I am still playing with things, overall everything is working fine.

One strange thing I can’t figure out. I have VM setup for all 3 extensions. If I dial from extension to extension I get the VM for the destination extension. If I dial in from the PSTN (I have inbound calls routed to an extension) the proper phone rings, but when I don’t answer it gets a generic message asking for a voice message… I leave VM and have no idea where it is actually going.

Anybody have a thought why I am not just getting to the voice mailbox for the extension that is ringing?

Thanks /lss


We could all guess but you would benefit more by posting relevant info from your extensions.conf and/or posting the output of the CLI during the call.


Of course, you are right … sorry about that. I think these are the relevant sections (been spending a fair amount of timing learning to read this stuff):

exten => s,1,SetVar(intype=${INCOMING})
exten => s,2,Cut(intype=intype,-,1)
exten => s,3,GotoIf($[${intype} = EXT]?4:5) ; If INCOMING starts with EXT, then assume its an extension
exten => s,4,Goto(ext-local,${INCOMING:4},1)
exten => s,5,GotoIf($[${intype} = GRP]?6:7) ; If INCOMING starts with GRP, then assume its a ring group
exten => s,6,Goto(ext-group,${INCOMING:4},1)
exten => s,7,GotoIf($[${intype} = QUE]?8:11) ;queue
exten => s,8,Answer ; answer call before queue
exten => s,9,Wait(1)
exten => s,10,Goto(ext-queues,${INCOMING:4},1)
exten => s,11,Answer ; answer call before auto attendant
exten => s,12,Wait(1)
exten => s,13,Goto(${INCOMING},s,1) ; not EXT or GR1 - it’s an auto attendant
exten => h,1,Hangup

include => ext-local-custom
exten => 200,1,Macro(exten-vm,200,200)
exten => ${VM_PREFIX}200,1,Macro(vm,200)
exten => 200,hint,SIP/200
exten => 250,1,Macro(exten-vm,250,250)
exten => ${VM_PREFIX}250,1,Macro(vm,250)
exten => 250,hint,SIP/250
exten => 251,1,Macro(exten-vm,251,251)
exten => ${VM_PREFIX}251,1,Macro(vm,251)
exten => 251,hint,SIP/251

; Ring an extension, if the extension is busy or there is no answer send it
; to voicemail
exten => s,1,Macro(user-callerid)
exten => s,2,Setvar(FROMCONTEXT=exten-vm)
exten => s,3,Macro(record-enable,${ARG2},IN)
exten => s,4,Macro(dial,${RINGTIMER},${DIAL_OPTIONS},${ARG2})
exten => s,5,GotoIf($[${CHANNEL:0:5} = Local]?s-${DIALSTATUS},1) ; if the channel is Local, then do not go to voicemail. This is primarily to avoid vm for call-forwarded extensions in ring groups
exten => s,6,GotoIf($[${ARG1} = novm]?s-${DIALSTATUS},1) ; no voicemail in use for this extension
exten => s,7,NoOp(Sending to Voicemail box ${ARG2})
exten => s,8,Macro(vm,${ARG1},${DIALSTATUS})
exten => s-BUSY,1,NoOp(Extension is reporting BUSY and has no Voicemail)
exten => s-BUSY,2,Busy()
exten => s-BUSY,3,Wait(60)
exten => s-BUSY,4,NoOp()
exten => _s-.,1,Congestion()


Actually the problem is different than i thought … by trying 7777 which goes directly to [from-pstn] the right things happen.

It appears that the problem is that the incoming call isn’t being recognized as being from a defined trunk (Broadvoice) … so it is not going to the [from-pstn] context.

Gotta go track that one down.

So … never mind