I need asterisk to execute a web request when a operator picks up a call in a queue.
I can get asterisk to send that request as soon as there is an incoming call to an extension but I need the extension of the actual operator picking up the call too.
Queues don’t set DIALSTATUS and both Queue and Dial supervise the call, not just set it up, so any following dialplan is not run until the call ends.
ExecIf is not an event handler. It is a test of the value of the expression at point in time when it is run.
Both Queue and Dial have subroutines that can be run, on the answering channel, at the point the call is answered. That is one way of getting Curl called on answer. The curl needs to run very quickly a the call will not be fully connected until it completes.
Note that variables set in such a subroutine will require special consideration to access from the main channel, as they will only be set on the answering channel. The user of IMPORT, SHARED, of GLOBAL may be necessary.