I am using Queues to handle incoming calls which works pretty well.
What I would like to do now is to get the info which extensions has answered a call in "sub-queue-answer" context of extensions_custom.conf to hand over this information via CURL to another - e.g. CRM-server via:
exten => s,n,Set(foo=${CURL(https://hostname/voipcr.php?device=pbx1.xxx\&agent=${???}...)})
anyone any idea which variable can be set in the spaceholder of the three ??? to hand over the extension number of the agent who has answered that call?
You can not do that using extensions. Queues are sending calls to users without passing through the dialplan (a queue will call a agent directly).
To access data about who answered the call (and also when that happened) you need to listen for the AgentConnect event on Asterisk Manager Interface. As you can see in the documentation, the
AgentConnectevent will pass a lot of properties that you can parse, to extract the information you need. Probably you want to checkMemberNameandInterfaceproperties, but that is subject to your particular setup.Queue logs / CDR will help you only if you want to send the data after the call has been completed, but, to do that, you probably need to create a polling system (an undesirable solution, from my point of view).