1
votes

Following the tutorials to creation of a task router (Workspace,queue,worker,task) and task creation via a Phone Call.
I am able to successfully land the call and create the task via my node.js app.
After adding the Agent UI via tutorial @ Agent UI Add Project
Here is the application flow:

  • Customer calls Twilio number
  • Twilio Voice Posts to a Node.js Rest API
  • Twilio Voice Posts to a Node.js Rest API
  • Twiml generated and user gets Prompts
  • User chooses an option
  • Response is Posted to a Node.js API and task is created

The above steps are success
On the client
Agent launches the node.js app with taskrouter.min.js and agent.js as provided in the sample above.
Customer gets the default hold noise, on the agent browser a series of events "reservation created, update and reservation cancels" are observed. Posting the console logs towards the end.

  • Observation 1, customer gets the default Hold noise confirms that Task is created successfully via the App. Task also seen on the Twilio Admin GUI
  • Observation 2, Getting a sequence of Reservation,Update,Cancel events multiple times.
Also Observed that the dateCreated, dateUpdated and dateStatusChangedare year1970 , 1970-01-17T17:52:39.413Z. Any pointers would be greatly appreciated.
[Edit:] I do see similar issues with the PHP Sample code as well. Found that the Date is not an issue. [Edit:] Reached out to Twilio Support, hoping to hear from them, no luck so far
[RESOLVED] Heard back from twilio support, thanks twilio. Issue was with the Assignment Callback URL on the Workflow. My API was /Get. Changed it from Get to Post, to make it work. As the assignment URL was not reachable (via POST), task router was trying to cancel the reservation.
2
In what step do you accept the reservation? If you don't accept the reservation in time depending on your settings it will timeout.ecorvo
Before even i can accept the reservation, the cancel request is being recieved on the client, thinking i might have to set a timeout for acceptance when creating task. i get a reserve event on the client, few milli seconds, get a status change event and a cancel event. and i get these 3 events again after few milli secondstx fun
Check your Workflow Task Reservation Timeout. That is what causes it to timeout if the reservation is not accepted whiting the timeframe. Let me know if this is helpful.ecorvo
So you mentioned that you get a reservation update event. Somewhere in your app you must be updating the reservation. Any ideas?ecorvo
using Agent.js in the walkthrough.Activity.Update is fired agent status offline to "idle". When task is created, default status goes to "Cancel" and changesreserved. WR1 Agent One canceled 22:22:37 UTC 2016-01-19 WR Agent One canceled 22:22:37 UTC 2016-01-19 WR3 Agent One canceled 22:22:38 UTC 2016-01-19 WR4 Agent One pending 22:22:38 UTC 2016-01-19 AcceptRejectAbove is status changes on Twilio Create Task, GUI. Default status is cancelled , which i feel is wierd.tx fun

2 Answers

3
votes

Twilio employee here.

This is result of TaskRouter being able to hit your AssignmentCallbackUrl with an HTTP POST request. We've noticed that on your Account there's this notification message:

Cannot POST /assignment

Please enable POST for your AssignmentCallback endpoint.

TaskRouter will actively cancel the reservation if it cannot hit your AssignmentCallbackUrl or there is an error when issuing an Assignment Instruction.

The several updates in the console are due to the fact that TaskRouter cancels the reservation due to not hitting the AssignmentCallbackUrl, moving the Worker back to the previous state (Available), and then trying to assign the Task again, and thus generating another Reservation for the Worker for the same Task (repeat 15x until the Max Task Assignment is hit).

0
votes

Heard back from twilio support, thanks twilio. Issue was with the Assignment Callback URL on the Workflow. My API was /Get. Changed it from Get to Post, to make it work. As the assignment URL was not reachable (via POST), task router was trying to cancel the reservation.