0
votes

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?

1
The 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 make GET requests to that URL, is your application set to receive GET requests?philnash
The callback URL accepts either GET or POST. I don't see anything in the debugger console either. I will get in touch with support.Dan Morphis

1 Answers

1
votes

To answer my own question. If you don't include the "status_callback_events" value, then Twilio will send an event for all events. The missing event was no-answer. I'm marking this as answered so that future people can see the list of Twilio events for the dequeue and call instruction.

Current known list of dequeue and call events:

  • queued
  • no-answer
  • initiated
  • ringing
  • answered
  • completed
  • in-progress
  • busy
  • canceled
  • failed