1

All is using cell phone, no soft phones.
I am trying to created a flow where a customer calls in, All the agents that are available will have their phone ringing. The first agent that answers, all other dials are disconnected. Later, during the call, the agent will need to add one or more other agent to participate in the call.
As far as I can see the response to the customer call should be a Twiml on the lines:

<Dial><Conference>My Conf</Conference></Dial>

But what should I add to this so it calls (for example) three more agents, and hangup on the other agents after the first one answers? Something like this (this does not work):

<Response>
    <Dial><Conference>My Conf</Conference></Dial>
    <Dial callerId="+1888XXXXXXX">
        <Number>111-987-6543</Number>
        <Number>222-987-6543</Number>
        <Number>333-987-6543</Number>
    </Dial>
</Response>
Itay Moav -Malimovka
  • 52,579
  • 61
  • 190
  • 278

1 Answers1

3

The approach above won't work well in production. When an agent is on a call, future calls will still be sent to all agents and that Agent on the call's voice mail will pick up.

Look at Twilio Task Router for a way to properly assign calls to agents. Task Router has an SDK which you can use to allow agents to go online. Agents are assigned to Task Queues which allow proper routing. If an agent is on a call, Task Router will not attempt to assign them another call.

You can also handle conference events with Task Router.

Alan
  • 10,465
  • 2
  • 8
  • 9
  • Will this solution allow all available agents phones to ring at the same time, or is it a Round-Robin like approach to available agents? Due to the nature of the call center a call has to be answered as fast as possible. – Itay Moav -Malimovka Apr 28 '20 at 15:58
  • Task Router does have a Multi-reservation feature - https://www.twilio.com/blog/2015/04/route-tasks-even-faster-with-taskrouter-multi-reservation.html and https://www.twilio.com/changelog/taskrouter-now-dials-only-one-worker-multi-reservation. – Alan Apr 28 '20 at 16:04
  • Cool - that was what I was looking for, One last, in this model, Can an agent add another agent to the call? Or do I need to somehow transfer this to a Conference type call first? (Not sure how I would go about this). – Itay Moav -Malimovka Apr 28 '20 at 16:18
  • Task Router uses Conference Calls specifically for this purpose. Task Router presents high layer constructs to manipulate the call, https://www.twilio.com/docs/taskrouter/api/reservations#conference. Also this may be useful - https://www.twilio.com/docs/taskrouter/contact-center-blueprint/call-control-concepts and https://www.twilio.com/docs/taskrouter/contact-center-blueprint/call-control-concepts-web-sequence-diagrams. – Alan Apr 28 '20 at 20:06
  • Another thing I am stuck on - Do I need to create all my agents as workers in Twilio before I can use the TaskRouter, or can I create them on the fly, when a task comes in. I am maintaining that list inside my app. – Itay Moav -Malimovka Apr 29 '20 at 01:56
  • You will create the workers ahead of time. The workers need to be in an "online" status so Task Router knows they are available to receive tasks (calls in this case). Here is a good blog to get an idea of how to set things up at a basic level - How to Customize Phone Call Workflows with Twilio Studio and TaskRouter https://www.twilio.com/blog/2018/06/customize-phone-call-workflows-twilio-studio-taskrouter.html – Alan Apr 29 '20 at 09:15
  • I am handling it in another post, but FYI, When I try to do multiple reservations as in the first link. (I have two workers available) one phone is ringing, the other one, his assignment immediately changes status to "reservation_status": "rescinded" . Which probably prevents the second phone from ringing. I do see this error in the debugger. – Itay Moav -Malimovka Apr 29 '20 at 17:30