… but can find any variable that contains the agent or extension to which the caller has been transfered …
The EXTEN variable contains the Queue extension, same thing for the CDR(dst) …
you cannot get the extension that the queue has transferred to directly. the best way is to capture Asterisk events … there are events generated (among other things) for AgentConnect, AgentComplete and others that will contain information on the agent’s extension involved.
You absolutely can get the extension the queue was transferred to directly. It’s super easy, does not require the AMI at all, and you can use it immediately in the dial plan for whatever purposes you want.
${MEMBERINTERFACE} is the channel variable you want. The only thing you need to remember is two configuration lines for your queue in queues.conf for these queue specific channel variables to be set:
setinterfacevar=yes
setqueueentryvar=yes
That’s it. You can even use a Macro or AGI in the Queue() to do whatever you want to do with it. That’s what I am doing a thousand times a day in my queues.