How to implement video call with twilio task router - twilio

We are using Task Router for our Call Center Project. Incoming calls routing through Task Router to our agents. Now, We have to impliment Video Call as well. I want to understand, how we can use Same Task Router for Voice Call and Video call to distribute to our Agents ?
Is there any code of reference example to use that ?

Twilio developer evangelist here.
We have one example of a multichannel contact centre that is powered by TaskRouter. You can see it on GitHub here: https://github.com/nash-md/twilio-contact-center.
When you integrate Voice with TaskRouter, the TwiML integration makes it straightforward to create tasks by enqueueing the call to a workflow. When you are working with other inputs you need to manually create the tasks and handle the assignment on the other end too. This app should help you see how that works.
I'm not super familiar with the codebase myself, but you probably want to start by checking out the task controller which starts video chat rooms and creates a task to match. Then the workflow controller is the client side component that deal with receiving, accepting or denying reservations.
Let me know if that helps at all.

Related

Twilio Flex. Start a stream once an agent has accepted a task

so, the flow is, I call enqueue Twiml verb. It creates a task and assigning to a specific agent. I have a task router callback on reservation.accepted event. I got it, but once I update a customer call with Stream Twiml - it's removing a customer from the conference which Flex creates. I'd like to avoid it somehow. To avoid that I update a customer participant with end_conference_on_exit: false attribute. Then I update a customer call with Stream and Dial.conference to get a customer back to a conference which I do not like. Is there any easier way to implement it ?
Twilio developer evangelist here.
Updating a call like that will always take it out of it's current TwiML flow and you would have to redirect back to where it was, like you have already implemented.
I know this is not starting the stream after the task is accepted, but I think the best way to implement this right now is to use the fork stream Studio widget directly before the send to Flex widget in the Studio Voice IVR flow.

Is there a way to respond to Twilio studio executions programmatically?

I would like to build an end-to-end test of my Twilio Studio Flow, where it receives an incoming call and from there proceeds to expect user input via dial-pad and voice. I've also connected the REST API as an additional trigger to point to the same tree as the voice path. So far I can create a new execution of said flow and have the steps returned, and from there I would like to respond to each additional step with test input (in the form of TwiML) and continue the execution to determine the pass/fail of my tests with expected input.
There is a recent blog I read that may be of interest to you.
Automating how IVR call flows are tested
https://tech.ovoenergy.com/automating-how-ivr-call-flows-are-tested/
ivr-tester
https://github.com/SketchingDev/ivr-tester
That said, is there a particular issue you encountered with the above approach you are taking? It is not clear what the issue is.

Handling 3 call queues in twilio in an elegant way

I'd love some advice on my twilio setup for a problem I'm trying to solve.
Overview
A client can call our twilio number and have one of three cases to handle:
- is our client and has a question - should be transfered to CC queue (2ppl),
- wants to buy our services - should be transfered to Sales queue (7ppl),
- has some other case - should be transfered to a different queue, lets call it Other (1 person)
Current solution
The client calls:
welcome message
we gather his digit input
enqueue a call to the appropiate queue
assign a task to an available worker with the conference instruction
Problem with the current solution
If there are no workers in the office to handle the call the client will wait forever until he hangs-up by himself. The wroker who answers doesn't know the clients phone number so he isn't able to fallow-up if neccesary.
Questions
After the client picks a queue i would like to check if I have any workers in the office in that queque (not in Offline mode). If everybody is on offline mode redirect to voicemail and a an email is sent to a specified email address with the caller phone number and voicemail recording url.
After the worker picks-up (accepts the reservation) send him a message with the clients phone number.
If no worker answers within a specified amount of time (for example 5 minutes) the call gets redirected to voicemail and a an email is sent to a specified email address with the caller phone number and voicemail recording url.
Twilio developer evangelist here.
Answers in order, parts 1 and 3 need to talk about voicemail which I'll cover at the bottom:
You can use a skip_if expression to skip a queue if there are no available workers.
I assume this is using the reservation.conference instruction in the JavaScript SDK. You can actually inspect the reservation object at this stage too, check out reservation.task.attributes for all the task attributes, which should include the call attributes. You can use this to show your agent on screen or send them a message some other way.
For this, you should set a timeout on your queue. When the timeout fires the task should drop through to the next queue in the workflow.
Voicemail
For parts 1 and 3 we are ejecting a task from one queue, but it needs to go somewhere else to be dealt with. You want to send the calls to voicemail, which doesn't require an agent to deal with it. Currently, the best way to deal with this is direct the task to a queue that has one bot worker in it. The job of the worker is to redirect incoming reservations straight to some TwiML. You achieve this by instantly responding to an assignment callback with the redirect instruction.
To create voicemail, you can combine <Say> and <Record>. Make sure you set the recordingStatusCallback attribute to a URL in your application, you can then use the results to email the link to the voicemail recording.
Let me know if this helps at all.
thank you for yout time to answer my questions. Below please find my reply:
1. It seems that this does not work in console - I find this information in the documentation "skip_if cannot be configured through the console - it must be posted on the workflow API". As I am not using the workflow API this is probably not a solution for me.
2. I using this tutorial: https://www.twilio.com/docs/quickstart/php/taskrouter/twiml-dequeue-call but instead of using dequeue instruction i use conference. I don't quit get how to "inspect the reservation" - maybe you have a tutorial on that? While looking for other solutions I came up with workspace event calback, but I am not sure if this would work.
3) How can I do that in the console?

With Twilio, can you get a notification when a queue add/removes a member?

I'm trying to do some server side queue management with a an application I am writing, using Twilio (C# MVC project). Is there any way to receive a notification of some sort when a caller is added to or removed from a queue without constantly having to check the queue myself?
Twilio evangelist here.
I'd suggest looking into using the waitUrl and action parameters on the [<Enqueue>][1] verb.
The url provided in the waitUrl param is requested when the user enters the queue. The url in the action parameter is requested when the caller leaves the queue.
I wrote a blog post a while ago that shows how to create a dashboard un ASP.NET MVC that displays current queue size and average time in queue using those two parameters. It should be pretty straight forward to adapt the post to whatever language and framework your working with.
Hope that helps.

Twilio Queue management issue / best practice

We are setting up a call center using Twilio.
At the end of the greetings and menus, our users are redirected to a queue waiting for the next available agent.
We would like the system to:
- Call automatically the next available agent. This is to prevent the agent from dialing the queue to know if users are waiting.
- Be able to change the order of the queue. Our users have different priorities.
How can we get this done? What are the best practices?
FYI: We are using PHP, TWIML and we DO NOT have our own IPBX (Not able to use SIP Protocol).
Thanks,
Dimitri
Twilio evangelist here.
There are a few ways you could do this, but my suggestion would be to use the action attribute of the Enqueue verb.
The action attribute lets you tell Twilio about a URL that you want it to request when a caller leaves the Queue. As part of this request, Twilio will pass you a parameter named QueueSid. Using the QueueSid, you can make a request to Queues endpoint in the Twilio API, see if the current_size of the Queue is greater than zero, and if it is initiate a call out to the next available agent.
Hope that helps.

Resources