Access the extension a blind transfer came from

Writing my own Custom Destination which I have setup as a Misc Application with an extension (e.g. 123) users can transfer calls to, the Custom Destination and Misc Application work as desired, but I am unable to find which variable I can access in the custom code to return the call from the extension that transferred the call to the Misc Application.

E.g. from Ext 401 I dial a 416-555-5555, then transfer that call to the 123 Ext of the Misc Application, but I can’t to access a variable that references Ext 401 to transfer the call back to after a timeout.

${CDR(clid)} gives me the CID:XXXXXXXXXX which is the CID of the outbound route
${CALLERID(num)} gives me the number dialled e.g. 416-555-5555)
${CDR(src)} gives me the same as abouve 416-555-5555
${CDR(channel)} gives me the IAX2/XXXXXXXXXX-out-XXXX
${CDR(dst)} gives me the Misc Application Ext (e.g. 123)
${EXTEN} gives me s ( which is the from the start of the custom code in the conf )

exten => s,1, .... stuff here...

exten => T,2,Goto(custom-code,900,1)
exten => 900,3,Goto(extensions,?????,1)

In the Custom Destination, I have the Target set as custom-code,s,1

Any help would be appreciated.

Thanks, jd

I did follow the logs to macro-user-callerid and saw the note about how ${AMPUSER} is set upon return to the real user despite, but I think at the time I tested it, I had an Outbound CID set on the extension in question which might have been throwing me, going to test that now.

${AMPUSER} gives me a null

I feel like I am missing something very obvious.

Thanks, exactly what I was looking for. In the dump, this: ${FROMEXTEN}

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.