0

Twillio task route

1) How can I manage different instruction in single callback URL using asp.net mvc Library?

Ex :

--> Task created using enqueue. I have placed dequeue instruction in Assignment callback url but how can I manage once task is created and reservation is created. How can accept reservation using reservation Id and place a call to twilio client ?

public ActionResult Assignment()
{
    var response = new
    {
        instruction = "dequeue" ,
        post_work_activity_sid = Singleton.Instance.PostWorkActivitySid
    };

    return new JsonResult() { Data = response };
}

Any suggestions will be useful

Thanks

1 Answers1

0

The dequeue response to the assignment callback, will automatically place a call to the to the selected worker. For this it needs the number, which can be provided in either of these 2 ways:

{
  "instruction" "dequeue",
  "to": "+14151112222",
  "from": "+18001231234",
  "post_work_activity_sid": "WA0123456789abcdef0123456789abcdef"  
}

Here number is explicitly provided, this can be the number of the selected worker. Alternatively, contact_uri can be added in the worker attributes, and skip 'to' parameter above. In that case, call will be placed automatically to the contact_uri

This is outlined at https://www.twilio.com/docs/api/taskrouter/handling-assignment-callbacks

Shailesh
  • 71
  • 6
  • Hi Thanks for the info but I wanted to make sure that once we enqueue the call how can I manage dequeue instruction and accept instruction – Chintan Mstry Feb 02 '18 at 06:43