[asterisk-users] dealing with blind transfers to invalid extensions

Doug Lytle support at drdos.info
Mon Oct 30 18:24:55 MST 2006


Jeronimo Romero wrote:
> Running Asterisk 1.2.8  kernel  2.6.13.4-1. 
> Everything in my dialplan seems to be working well except for one
> problem. 
> When calls are blind transferred to an invalid extension I would like
> the call to go to the operator on ext 1000?
>   

I do the following:


[direct-to-voicemail]

; **************************************************
; Allow anybody to send a call directly to voicemail
; by pre-pending a 0 to the destination extension.
; Checks to see if voice mail box exists, if not
; Tells the callee that no such vm box exists and
; then transfers them to the operator
; **************************************************

exten => _04XXX,1,Set(_direct_vm=${EXTEN:1})
exten => _04XXX,2,MailboxExists(${direct_vm}@sip)
exten => _04XXX,3,Goto(s-${VMBOXEXISTSSTATUS},1)

exten => s-FAILED,1,SayDigits(${direct_vm})
exten => s-FAILED,2,Playback(vm-nobox)
exten => s-FAILED,3,Playback(pbx-transfer)
exten => s-FAILED,4,Goto(incoming,s,1)

exten => s-SUCCESS,1,Set(CALLBACK=${DB(vmcallback/${direct_vm})})
exten => s-SUCCESS,2,GotoIf($["${CALLBACK}" = 
"YES"]?s-SUCCESS,3:s-SUCCESS,4)
exten => s-SUCCESS,3,System(/usr/local/bin/vm-callout.sh ${direct_vm})
exten => s-SUCCESS,4,Voicemail(u${direct_vm}@sip)
exten => s-SUCCESS,5,Hangup()

Doug

-- Ben Franklin quote: "Those who would give up Essential Liberty to 
purchase a little Temporary Safety, deserve neither Liberty nor Safety."



More information about the asterisk-users mailing list