I am trying to create an attended transfer using Twilio.
The flow I would like is as follows:
1. Existing call with two legs (client side, agent side)
2. Using API put Client on HOLD and put Agent 1 in Conference
3. Using API Put Agent 2 into same Conference
4. Agent 1 and Agent 2 can speak without Client hearing
5. Using API add Client to Conference
6. Client, Agent 1 and Agent 2 can speak together
7. Using API Agent 1 can be disconnected from the call
Is it possible to do this?
Or do we need to create a conference for all our inbound and outbound calls?
(even though only about 5% of our calls get transferred)
Twilio developer evangelist here.
You can definitely do this. It might be easier to do this from the context of a conference in the first place, as you can take advantage of putting conference participants on hold.
To do it from a regular call to start with, you would want to redirect one of the agent or caller to new TwiML and then make sure the other leg of the call had somewhere to continue to with the existing TwiML. It's probably easier to transfer the agent's call with the REST API and then make sure that the TwiML you originally return to the user continues to place them into a queue using <Enqueue> that you can then call them out of later, or simply a looping <Play>.
Let me know if that helps at all.
Related
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.
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>
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.
I am using voice-quickstart-ios but i am facing some problems here.
I need to know a few things.
How can I make call from sub account without using REST API rather TwiML <dial>?
If point 1 is not possible then how can i make call without changing leg of the call or if i had to change the leg then how can i retrieve it in voice-quickstart-ios SDK?
How can i record a call with leg CallSid using REST API?(if i can retrieve leg of the call)
Does twilio cloud have scheduler? (eg: firebase pubsub)?
Answers:
Q: How can I make call from sub account without using REST API rather TwiML ?
A: You cannot initiate a call using Twilio Markup Language (TwiML), only manage an existing call. You will need to use the REST API (Calls Resource) to initiate a call.
Q: If point 1 is not possible then how can i make call without changing leg of the call or if i had to change the leg then how can i retrieve it in voice-quickstart-ios SDK?
A: I don't understand this question. Can you provide more details on what you mean? Two call legs are involved when connecting parties, sometimes referred to as the "parent" leg (the main leg) and the "child" leg, the leg that is kicked off by some action of the parent. Your iOS SDK leg would be the parent leg, if making an outbound call toward Twilio and would use TwiML to create the child leg.
How can i record a call with leg CallSid using REST API?(if i can retrieve leg of the call)
A: Using the REST API Recording Resourcee.
Q: Does Twilio cloud have scheduler? (eg: firebase pubsub)?
A: Not at this time.
I have implemented warm transfer in the my application (C#) but I have to extend it.
Below is my new use case:
Customer calls to our Twilio number. That Twilio number is assigned to a department in our database. Based on that number I retrieve all agents in that department. So, I want this call to go to all the agents in that department and all agents can see an incoming call on their screen.
How can I make a call to multiple agents on their 'client id' (they have generated their capability token with)?
PS: I can't use dial because dial is used for conference once agent picks up the call, I have to do something in CallResource.Create() function in C#
Twilio developer evangelist here.
If you can't do this via <Dial>, you need to loop through all the numbers you want to call within your C# code, calling CallResource.Create() for each of them.
Note, you will likely want to setup to receive statusCallback webhooks so that you can complete the other calls if someone has answered.
Why twilio not provide a hold option as like their mute option?
It doesn't make sense, to use a API to do this option because it just like the mute option except it needs Hold music to be played during for caller.
Any solution? or update?
as for a solution, I would understand that an agent is only dealing with a single call at any one time, so having to place a caller on hold, should be pretty simply, you could simply take the call and place it into a conference where you can play the music of your choice. You could use the agent name perhaps and add hold to it to easily get the agent back to the call in the conference, so perhaps creating a conference in such a way, where the agent name is agent1, the conference name could be agent1hold. Once the agent has finished with that which he was busy with when placing the call on hold in the first place, he could simply dial back into the conference. you would need to make sure that you setup the conference correctly so that if the caller has to be placed on hold again, and the agent exits the conference, that the conference is not terminated.
Megan from Twilio here.
Basic hold functionality can be handled via modifying live calls:
https://www.twilio.com/docs/api/rest/change-call-state
An example in Python where you would use the URL parameter directing the caller to some TwiML to <Play> the caller some hold music. You easily give this a try by hosting the TwiML with Twimlbin.
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACCOUNT_SID"
auth_token = "AUTH_TOKEN"
client = TwilioRestClient(account_sid, auth_token)
call = client.calls.update("CALL_SID", url="YOUR_TWIMLBIN_URL",
method="POST")
And some examples of working with other scenarios involving <Conference> can be found on our blog.
In Java: https://www.twilio.com/blog/2015/08/how-to-warm-transfer-a-call-with-java-and-twilio-voice.html
In Python: https://www.twilio.com/blog/2015/09/warm-phone-call-transfers-with-python-flask-and-twilio-voice.html