Unable to find extension '' in context 'mycontext' while transferring call with option t in dial() in asterisk

864 views Asked by At

So i am adding a call transfer facility in my code .When user dials the number of executive and executive picks the then executive has the authority to transfer the call to specific extension

[from-pstn]
exten=>_X.,1,Playback(hello-world)
exten=>_X.,n,set(__GOTO_ON_BLINDXFR=from-pstn^123456^1)
exten=>_X.,n,Goto(mycontext)

[mycontext]
exten=>_X.,1,dial(DAHDI/g0/0${9xxxxxxxxx},,mtG(recordvoice,${EXTEN},1))

[recordvoice]
exten=>_X.,1,Mixmonitor(myvoice.wav)

description of t option in dial

t: Allow the called user to transfer the call by hitting the blind xfer keys (features.conf) Does not affect transfers initiated through other methods.

    If you have set the variable GOTO_ON_BLINDXFR then the transferrer will be sent to the context|exten|pri (you can use ^ to represent | to avoid escapes), example: SetVar(GOTO_ON_BLINDXFR=woohoo^s^1); works with both t and T 

but when call connects and executive press '#'(default call transfer key) then call is not transfer and cli shows

Unable to find extension '' in context 'mycontext' 
2

There are 2 answers

0
singhakash On BEST ANSWER

By default asterisk search for the extension in the same context and it receives an empty extention. You can specify extension by pressing the extention after pressing # and in your dialplan you can route it to different context.For ex

[from-pstn]
exten=>_X.,1,Playback(hello-world)
exten=>_X.,n,set(__GOTO_ON_BLINDXFR=mycontext^123456^1)
exten=>_X.,n,Goto(mycontext,111,1)

[mycontext]
exten=>123,1,Goto(from-pstn)
exten=>111,1,dial(DAHDI/g0/0${9xxxxxxxxx},,mtG(recordvoice,111,1))

[recordvoice]
exten=>111,1,Mixmonitor(myvoice.wav)

and when the call is connected press 123 after # to transfer the call.

Cheers

0
Riad On

would you try with

[mycontext] exten=>_X.,1,dial(DAHDI/g0/0${9xxxxxxxxx},,mtG(recordvoice,${EXTEN},1))

instead of n