I’ve applied the “cisco usecallmanager” patch and am trying to get the following to work, which is basically what allows extensions to be called and unanswered calls are sent to voicemail depending on the status of the line:
[call-extension]
exten => _X.,1,Set(PEERNAME=${EXTEN})
; By manually checking for call-forwarding, the call can be forwarded even if the phone is unregistered
same => next,Set(CALLFORWARD=${SIPPEER(${PEERNAME},forward)})
same => next,GotoIf($[${LEN(${CALLFORWARD})} != 0]?forward,1)
; Phones can be made to play a different ring using the Alert-Info header, see Ring Tones for examples
same => next,ExecIf($[${LEN(${ALERT_INFO})} != 0]?SIPAddHeader(Alert-Info: <${ALERT_INFO}>))
same => next,Dial(SIP/${PEERNAME},15)
same => next,Goto(${TOLOWER(${DIALSTATUS})},1)
exten => congestion,1,Goto(noanswer,1)
exten => chanunavail,1,Goto(noanswer,1)
exten => noanswer,1,Set(GREETING=u)
same => next,Goto(leave-voicemail,${EXTEN},1)
exten => busy,1,Set(GREETING=b)
same => next,Goto(leave-voicemail,${EXTEN},1)
exten => forward,SIPAddHeader(Diversion: “${SIPPEER(${PEERNAME},callerid_name)}” sip:${SIPPEER(${PEERNAME},callerid_num)}@localhost;screen=yes;privacy=o$
same => Goto(phones,${CALLFORWARD},1)
[leave-voicemail]
exten => _X.,1,Set(MAILBOX=${SIPPEER(${EXTEN},mailbox)})
same => next,Answer()
same => next,Wait(0.5)
same => next,VoiceMail(${MAILBOX},${GREETING})
same => next,Hangup(normal_clearing)
When attempting to dial extension 100 and leave a voicemail, this error comes up and the voicemail greeting never comes on:
“…sent to invalid extension noanswer in context leave-voicemail, but no invalid handler”
That makes sense because there is no extension “noanswer” in the “leave-voicemail” context.
The only question is, why does it think it is trying to leave a voicemail at extension “noanswer” and not extension 100 like it should?
This seems to be the line causing the problem:
exten => noanswer,1,Set(GREETING=u)
same => next,Goto(leave-voicemail,${EXTEN},1)
This code is straight off of the site for the Cisco Callmanager patch.
Any help is appreciated. Thanks.