I'm using the Twilio TaskRouter. A call comes into our number, Twilio makes an API call to our incoming call endpoint. I send the following response:
<Response>
<Say voice="woman">Thank you for calling</Say>
<Enqueue waitUrl="/Call/HoldMusic" workflowSid="WW..."/>
</Response>
The call is successfully enqueued and my workflow kicks off. I get the workflow assignment callback and respond with the following JSON:
{
"instruction": "dequeue",
"to": "+18885551213",
"timeout": 10,
"status_callback_url": "/Workflow/Changed",
"status_callback_events": "initiated,ringing,answered,completed",
"from": "+18885551212"
}
The outbound call is successfully made to my "to" number. If I accept the call, I get the reservation.accepted event to my task router callback endpoint. If I don't accept the call (let it timeout), I don't get a notification. Because I don't get a notification the dequeue failed, I can't cancel the reservation and have the call ring down through the queue.
I also changed the workflow assignment callback to return a "call" instruction and set the "status_callback_url" but again I only receive a callback if the call is answered, not if the call times out.
Is there something I'm doing wrong, or something fundamental I'm not understanding?
status_callback_url
should receive a callback when the call times out. I don't think your code is incorrect, so I recommend getting in touch with Twilio support and providing some task SIDs where this didn't work. They should be able to dig into it. One thing I'm wondering, Twilio is supposed to makeGET
requests to that URL, is your application set to receiveGET
requests? – philnash