[asterisk-users] Caller cannot blind transfer

Marek GreŇ°ko mgresko8 at gmail.com
Tue Jan 5 11:32:53 CST 2021


I am unable to figure out why I am not able to blind transfer when I
am the caller and I call the extension defined by gosub.

When running asterisk -rvvv I can see:

    -- Channel PJSIP/<caller number>-00000009: Dialed '<transfer
number>@gosub-stdexten' does not exist.

It is evident there has been added some weird context after the
extension number. The gosub-stdexten is a name of Gosub Procedure. Why
it used it as a context? Where is the context name read from?

The extensions are defined as follows:
exten => xx,1,Dial(PJSIP/xx,30,TtrKk)
exten => xy,1,GoSub(gosub-stdexten,s,1(xy,PJSIP/xy,30,TtrKk))

xx is a caller, xy is a callee

The procedure gosub-stdexten itself looks like this:

; Standard extension macro:
;   ${ARG1} - Extension  (we could have used ${MACRO_EXTEN} here as well
;   ${ARG2} - Device(s) to ring
;   ${ARG3} - How long
;   ${ARG4} - Options
; Retrieve the Call Forward number if available.
exten => s,1,Set(CFIM=${DB(CFIM/${ARG1})})
; Dial the appropriate number depending on whether the Call Forward
exten => s,n,GotoIf($["${vmbox}"!=""]?s-NoCFIM,1)
exten => s,n,Set(_vmbox=${ARG1})
exten => s,n,GotoIf($["${CFIM}"!=""]?s-CFIM,1:s-NoCFIM,1)
; Pass call to VoiceMail with the appropriate greeting.
;exten => s,n,GosubIf($[${DIALSTATUS}=BUSY]?s-BUSY,1:s-NOANSWER,1)
; Hangup.
exten => s,n,Hangup()
; Dial Call Forward number & return.
exten => s-CFIM,1,Dial(Local/${CFIM}@,${ARG3},${ARG4})
exten => s-CFIM,n,GosubIf($[${DIALSTATUS}=BUSY]?s-BUSY,1:s-NOANSWER,1)
exten => s-CFIM,n,Hangup()
; Dial actual extension & return.
exten => s-NoCFIM,1,Dial(${ARG2},${ARG3},${ARG4})
exten => s-NoCFIM,n,GosubIf($[${DIALSTATUS}=BUSY]?s-BUSY,1:s-NOANSWER,1)
exten => s-NoCFIM,n,Hangup()
; Unavailable voicemail message if there is no answer.
exten => s-NOANSWER,1,GotoIf($["${vmbox}"=""]?3:2)
exten => s-NOANSWER,2,VoiceMail(${vmbox}@|u)
exten => s-NOANSWER,3,Return()
; Busy voicemail message for any DIALSTATUS other than NOANSWER (or ANSWER).
exten => s-BUSY,1,GotoIf($["${vmbox}"=""]?3:2)
exten => s-BUSY,2,VoiceMail(${vmbox}@|b)
exten => s-BUSY,3,Return()

How could I fix it? Should I forward the original context somehow into the
exten => s-NoCFIM,1,Dial(${ARG2},${ARG3},${ARG4})
? And also maybe here
exten => s-CFIM,1,Dial(Local/${CFIM}@,${ARG3},${ARG4})



More information about the asterisk-users mailing list