Implementing warm transfers programmatically with Taskrouter - twilio

I'm trying to implement warm transfers programmatically with taskrouter (transfer to internal queue, transfer direct to agent).
As I understand, when using the flex UI buttons to transfer, the assigned task gets reset back to reserved and a new reservation is created for the new worker to accept and join the conference.
When implementing cold transfers, the "Enqueue" Twiml can seamlessly handle task creation and worker assignment, however it also completes the initial worker reservation, which is not suitable for warm transfers.
How can I implement a warm transfer that does the following?
Reset task assignment status to reserved
Create a new reservation linked to the new worker
On reservation acceptance, join the already existing conference
Thanks

Twilio developer evangelist here.
This flow is best described in a visual form and there is a diagram below:
The important thing here is that you do not work with the original task, but create a new one that can be assigned to a worker or queue. Once that reservation is the accepted, direct the new agent into the existing Conference where the warm transfer can then take place.

Related

Twilio TaskRouter - how to include certain Unavailable workers to pick up tasks?

In our Twilio application we would like to use TaskRouter to distribute incoming calls. Suppose we would like to handle the following scenario:
All Workers login to front-end application and have their status set to Available. If there are any incoming calls, Workers receive them in the UI.
Some Workers have this custom attribute: {"work_hours": [600, 1600], "phone_numbers": ["+1...", "+1..."]}. If for some reason this Worker becomes Unavailable during their working hours set between "work_hours" attribute, we would still like to have incoming calls forwarded to their personal phones from "phone_numbers" attribute.
If the above fails, we would like to forward the incoming call to Voicemail.
Basically, my question is whether it is possible to include Unavailable workers to Workflows and Task Queues? The above scenario would most likely require 3 Task Queues: one for all Available Workers, one for Unavailable but with "work_hours" attributes where taskrouter.currentTime is between those hours and one for Voicemail.
Twilio Solutions Architect here!
I think that you may already found a solution for your problem, but in case someone else is having this problem, here's my solution:
The best way to do this is actually creating a new Activity on TaskRouter of type Unavailable with Work Hours that is is an available Activity. With that state created, you can set the worker availability to this state when they are on this use case, and with the Task Router Workflows, you can have specific queues for these agents and using the routing strategies, bring a task to this queue if necessary.
Regarding to call the agents on their personal phone numbers, you can create a conference between the original call and the agent's phone number and have them connected.
This is a bit tricky, but is completely possible.

Twilio Task Router - How to transfer assigned Task to some other worker?

There is one task Assigned to WORKER A, however after spending sometime, WORKER A realized, this can not be handled by own and needs to be transferred to WORKER B.
How can we achieve this using Twilio Task Router?
First you have to understand how is the lifecycle of a Task.
When the task is created. the first state is pending.
Then, Twilio will look for a worker who has capacity to get this Task.
The task is now reserved.
When a Task is reserved, this task could not be assigned to a new agent, because it violates the Task LifeCycle. (https://www.twilio.com/docs/taskrouter/lifecycle-task-state)
If you are going to solve this problem, you have two options:
If you want a Flex solution for the twilio flex plattaform you can use a plugin available (https://www.twilio.com/docs/flex/solutions-library/chat-and-sms-transfers)
If you want to solve it with a backend solution. you have to first:
delete or complete the Task.
Create a new one with the same Task attributes to preserve the data in the
conversation.
Create a new channel to communicate the worker with the task user.
Assign the task to the workerSid (WorkerB). Remember that, you have to handle if the worker B has no capacity to recieve a new Task

How can I use Twilio queues without agents having to dial in?

I'd like to have a support queue and a sales queue that call an available agent when there's someone in the queue. The way queue functionality is described in the Twilio docs, it seems that the only way to connect an agent and a caller is to have the agent call into the queue. Well, that's no good for a queue that would be empty for most of the time -- how would they know when to dial in?
Is there a way for an agent to be called and then connected to the queue when someone is waiting?
Twilio developer evangelist here.
This is the exact use case for the Twilio TaskRouter API. From the docs:
Twilio TaskRouter is a system for distributing tasks such as phone calls, leads, support tickets, and other work items to the people and processes that can best handle them. Example applications for TaskRouter include:
Distributing calls to call center agents. TaskRouter supports common features required in call center environments, such as skills-based routing and task prioritization.
Prioritizing and assigning CRM cases to agents in order to make sure they're handled within service level. TaskRouter lets you specify overflow rules for tasks, allowing you to vary assignment rules based on time spent in queue and case content.
Distributing leads to inside sales teams. TaskRouter's business rules allow you to control prioritization so that your team is always working on the most important opportunity.
Check out the quickstart guide for TaskRouter which takes you through creating a workspace and workers and creating tasks for the workers from phone calls.

Best way to build my call center using Twilio

I am working on building a call center using Twilio.
Parts of problems are tackled in questions and some answers are old. Given that what I am trying to do is one of the most common usecases, I am trying to use this question to build a tutorial so that people know what is the state of the art way to build this.
Usecase detail is below:
Call Tree:
Customers will call the Twilio number through phone.
Based on phone no identification high priority customers will be sent to Agent handling flow
Other customers have a call tree which they have to navigate, which will support them. Some customers might end up on Agent handling flow.
Call Center: Agent handling flow is as follows:
Agents are handling calls using their desktop computers. They are on the support page which has a Twilio phone call widget as a pop up window.
All agents can handle all calls.
There are two types of queues. High priority and Normal.
All available agents ring at the same time. Anyone can pick and then other agents are moved to the next caller if available.
If not agent available wait for some time, including giving an IVR option for voicemail.
After wait timeout send to IVR.
Following is based on my understanding. Please let me know if there is a better way.
Call Tree will work as per the following tutorial: https://www.twilio.com/docs/tutorials/walkthrough/ivr-phone-tree/node/express
Call Center Agent handling flow will work as follows:
Once workspace
n Workers
2 Task Queues - High priority and Normal
One Workflow which decides based on the task priority which queue to assign to.
My current queries are as follows:
What is the cleaned way of implementing wait for an agent for 1 minute and if agent is not available in 1 minute send to voicemail. Is this part of workflow?
What is the best way implement call receiving in browser. Webrtc?
Is there an HTML widget available for the implementing call receiving in the browser. This would include features like setting agent online/offline, receive call, end call, escalate to supervisor
Help with this will be really appreciated and will help avoid wild goose chases.
Andy , you should look at Twilio taskrouter .
1 You can use task reservation timeout to achieve your requirement 1 . Create a task for an incoming call , taskrouter can direct the call to the matching agent and if the reservatoin timeout is set to 1 minute , the task can be redirected to either a different agent or an IVR as you require
2 You can use Twilio Client , Twilio's WebRTC . You can set incoming/outgoing capabilities as required and can easily integrate with Taskrouter to handle incoming/outgoing calls.
[3] You can build a dialler easily to implement Twilio Client , here's a tutorial to help you progress : https://www.twilio.com/docs/quickstart/client/javascript . You can find a starter up implemented in C#,Java,nodejs,php,python and ruby.
Additionally, you will find this call centre blueprint useful :) https://github.com/nash-md/twilio-contact-center .

How to not offer a task to specific worker on Twilio

I am new in Twilio and i have been facing an issue while designing outbound dialer currently preview dialing. If a worker rejects a task than the same task should not be offered to that worker again.
How do i handle this case?
Typically if a worker rejects the task, the worker should be moved to an unavailable activity. Otherwise, if the worker is the only available and qualified worker, TaskRouter will continue to create new reservations.
You can specify a new activitySid upon rejection, so that the worker is moved to an unavailable activity at the same time:
https://www.twilio.com/docs/api/taskrouter/worker-js#reservation-reject
Here, making the worker activity unavailable would simply mean the worker will not be able to get any task.
But let's look at a more complicated use case where a Worker can accept, reject or cancel tasks. They need to be available to make this choice.
If you have only that agent, and they are available, then there is no way to prevent that agent from receiving the Task, unless you manipulate the Task attributes or worker attributes so that TaskRouter doesn’t assign the Task. For example, you could update TaskAttributes to have a rejected worker SID list, and then in the workflow say that worker.sid NOT IN task.rejectedWorkerSids.
And the ability to do this Target Workers Expression just shipped as a bug fix today! It should look like:
worker.sid NOT IN task.rejectedWorkers

Resources