[SOLVED] Can't transfer directly to voicemail

We have Asterisk 11.22.0 working fine with Digium D45 and D70 phones (configured without DPMA…XML directly). However, when trying to transfer to voicemail, it just rings the extension.

I’ve tried to create the contacts XML, upload that to the phones, and use those to select transfer to voicemail. However, even that doesn’t work. It always just rings then eventually drops to voicemail as usual.

I didn’t think this was an important feature until I learned the owner always forwards his desk phone to his cell phone, and sometimes wants the receptionist to put a caller into his voicemail. The way I’m setup now, this is impossible.

Any tips on how to troubleshoot or solve would be greatly appreciated. I’m not sure what else to try. Thank you!

https://wiki.asterisk.org/wiki/display/DIGIUM/Smart+BLF#SmartBLF-SendtoVM

may be of some assistance.

When you’re transferring to voicemail, you need an contact w/ some kind of action for dialing voicemail rather than them regularly, and you need a way to affect that action.

So I updated my old code:

exten => _XXXX,1,noop(Dialing 4 digit exten)
exten => _XXXX,n,Goto(default,${EXTEN},1)

To have the redirects of the sample provided:

exten => _XXXX,1,noop(Dialing 4 digit exten)
exten => _XXXX,n,GotoIf($["${REDIRECTING(reason)}" == “send_to_vm” | “${PJSIP_HEADER(read,X-Digium-Call-Feature)}” == “feature_send_to_vm”]?4digitvm:4digitnotvm)
exten => _XXXX,n(4digitnotvm),Goto(default,${EXTEN},1)
exten => _XXXX,n,Hangup()
exten => _XXXX,n(4digitvm),Voicemail(${EXTEN},u)
exten => _XXXX,n,Hangup()

And now extensions don’t work and I get an error that “PJSIP_HEADER not registered”. Searching online suggests the PJSIP isn’t supported in Asterisk 11, only in Asterisk 13.

ERROR[9519][C-000000b6]: pbx.c:4360 ast_func_read: Function PJSIP_HEADER not registered

Any thoughts?

I was able to get it working by turning on sip debugging and looking at the SIP header variables it’s using. Then used “SIP_HEADER()” function to extract those. A little tweaking and it works (labels can’t begin with a number). Here is the dialplan now:

exten => _XXXX,1,noop(Dialing 4 digit exten)
exten => _XXXX,n,GotoIf($["${SIP_HEADER(X-Digium-Call-Feature)}" == “feature_send_to_vm”]?fourdigitvm:fourdigitnotvm)
exten => _XXXX,n(fourdigitnotvm),Goto(default,${EXTEN},1)
exten => _XXXX,n,Hangup()
exten => _XXXX,n(fourdigitvm),Voicemail(${EXTEN},u)
exten => _XXXX,n,Hangup()

Thank you.