I have built a macro that performs a centrex transfer on the current zap channel, and I need to monitor the end status of that transfer - such as ringing, busy - etc via DIALSTATUS, but since I cannot perform the transfer on the current channel using DIAL, asterisk does not provide a DIALSTATUS.
Does anyone know of a way to perform a centrex transfer of an incoming call using a DIAL commmand, or other means of monitoring the status of the transfer - ie did it ring busy?, if so, send it somewhere else. Everything works as long as the other end answers, but asterisk has no idea if it does or doesnt.
I transfer the current call to an extension that sends an outside number to my macro like so:
exten => 8878,1,Macro(cent_trnsfr,18005551212,278)
And the macro looks like this:
[macro-cent_trnsfr]
; ;;;;;;; new macro with busy check
;
; Enter with these
; ARG1 = number to dial
; ARG2 = voicemail extension box for busy responses
;
; Returns with FOUNDME = DIALSTATUS
;
;9w dials 9 for the telco centrex access code then waits .5 sec for outside dialtone
;
exten => s,1,SetGlobalVar(FOUNDME=ANSWER)
exten => s,2,Playback(transfer)
exten => s,3,Flash
exten => s,4,SendDTMF(9w${ARG1})
exten => s,5,SetGlobalVar(FOUNDME=${DIALSTATUS})
exten => s,6,Goto(s-${DIALSTATUS},1)
;
; returns here if busy
;
exten => s,103,SetGlobalVar(FOUNDME=BUSY)
exten => s,104,Goto(s-BUSY,1)
;
;
exten => s-BUSY,1,BackGround(the-party-you-are-calling)
exten => s-BUSY,2,BackGround(is-curntly-busy)
exten => s-BUSY,3,SetGlobalVar(FOUNDME=BUSY)
exten => s-BUSY,4,Macro(vm,${ARG2},BUSY) ;testing;;;;;;;;
exten => s-BUSY,5,Goto(s-CLEANEXIT,1)
;
exten => s-CANCEL,1,BackGround(canceled)
exten => s-CANCEL,2,SetGlobalVar(FOUNDME=CANCEL)
exten => s-CANCEL,3,Goto(s-CLEANEXIT,1)
;
exten => s-CHANUNAVAIL,1,BackGround(channel)
exten => s-CHANUNAVAIL,2,BackGround(is-curntly-unavail)
exten => s-CHANUNAVAIL,3,SetGlobalVar(FOUNDME=CHANUNAVAIL)
exten => s-CHANUNAVAIL,4,Goto(s-CLEANEXIT,1)
;
exten => s-NOANSWER,1,BackGround(nbdy-avail-to-take-call)
exten => s-NOANSWER,2,SetGlobalVar(FOUNDME=NOANSWER)
exten => s-NOANSWER,3,Goto(s-CLEANEXIT,1)
;
exten => s-ANSWER,1,SetGlobalVar(FOUNDME=ANSWER)
exten => s-ANSWER,2,Goto(s-CLEANEXIT,3)
;
exten => s-.,1,BackGround(something-Usr2bly-wrong)
exten => s-.,2,SetGlobalVar(FOUNDME=ERROR)
exten => s-.,3,Goto(s-CLEANEXIT,1)
;
exten => s-CLEANEXIT,1,GotoIf($[${ARG3} = RT]?3:2)
exten => s-CLEANEXIT,2,Hangup
exten => s-CLEANEXIT,3,NoOp
;