Manipulate call in progress with only keypress with Twilio - twilio

Is there a way to manipulate (play menu, put on hold, transfer etc) call in progress by having the caller or called party press a special key such as #.
For example, I would like to allow a called party to be able to transfer a call from their cell phone by just pressing the # key.
When the pound key is pressed, I could play a menu such as "What do you want to do with this call?" "Press 1 to place on hold, 2 to transfer, 3 to send to voicemail" etc.
I know I can do this all day long if the user has a web interface or possibly even having the user text something but.. I don't want the user to be required to send a text message or have a web interface handy.
Thanks in advance for any assistance here.

Twilio developer evangelist here.
You can do that yes. There is a simplified version of your request explained in these two blog posts handling transferring calls, depending on your language of choice:
Warm Phone Call Transfers with Python, Flask and Twilio Voice
How to Warm Transfer a Call with Java and Twilio Voice
Essentially, the idea is that you use a conference call that allows one party to hang up on the call using the * key. You do this by setting the hangupOnStar property on the <Dial> verb to true.
When hanging up with the * you can then give the call admin a list of options, such as transfer, using the <Gather> verb which can then be applied to the call.
I recommend reading through one of those posts for all the details.

Related

Twilio Queue Connecting to the wrong call

I am working with a twilio queue and I have multiple numbers that come into the queue. The operator receives a popup and it shows the department that a customer is calling into (based on the twilio number they dial).
Like:
Technical support [has it's own number]
Customer Service [has it's own number]
Sales [has it's own number]
I am presenting this info to the operator and when they accept the call it connects the operator to the queue and pops off the top.
The issue: If another call comes in it pops someone off the top of the queue and they may have called a different department. So, the info I am showing to the operator is not accurate. The first person in the queue may have called sales, and someone else calls technical support. The operator answers technical support when they really called sales. So I am displaying bad info.
I know they have twilio task router. But, is it possible to solve this with the queue? Essentially I want to be able to identify what number someone called which categorizes it into the right department.
Can I pop a specific call off the queue based on call SID or something like that so I know I am delivering the right call?
Thanks
Twilio developer evangelist here.
You have a couple of options here.
You could enqueue the calls coming in to your support/customer service/sales numbers into differently named queues. That way, when an operator accepts a sales call, they will only dial into the sales queue.
Alternatively, instead of dialling the queue, you could use the REST API to update the queued call, redirecting it to connect to your operator another way. For example, if your operator accepts the call they could <Dial> into a <Conference> and at the same time redirect the call, via the REST API, to that conference too.

For voice tasks in Twilio Flex, how do I get the current conference ConferenceSid?

I can see that for all the voice interactions, behind the scenes flex is using its voice API to create a conference between caller and worker. How do I obtain the created ConferenceSid after the task has been selected and reserved?
What I would like to do is simply Get the value upon connecting.
I can see a very long and not so pretty way of getting it, which is by running a twilio function that iterates over every conference, making additional requests to see the participants. But that seems way to complex to me.
I can see in the logs that the conference friendly is being printed
ConferencesState handleConferenceUpdate WT5d0800a3ce8724fd55cf89841c48XXX
Is there anyone who can help here?
UPDATE:
#philnash below answered the question exactly.
Twilio developer evangelist here.
There seems like a couple of ways to get hold of the Conference SID in a Flex interaction.
First, the task that your worker accepts has a number of attributes that are set by Flex and relevant for the type of task it is. For a voice call, you will find a conference key, which has an object including the sid as well as entries for the participants.
Secondly, I found that the <TaskCanvas> component in the UI is passed a context that includes a conference object. That object then has a source property which expands to an object with a conferenceSid property, as well as other properties, including a participants list.
Does that point you in the right direction?

Setting up call enqueueing and forwarding using Twilio Studio

I was recently trying to use the Twilio Studio to set up an IVR system to route the calls to the correct numbers based on the selected user input. I was able to create the following workflow and it works fine.
Here I am able to split the call based on user's input via keypad or voice and direct the call to the corresponding number. I am also able to track the number of times a user has pressed an invalid input and disconnect the call after a specific number of invalid inputs. It's all working fine.
Now I am trying to enqueue the calls so that users will stay in a queue while the agent is busy. I also want to forward the calls to a specif number and if that number does not pick or reject, call another number. This helps me to make sure that the calls are not missed. I also added a call forwarding option with recording enabled. But when I try to play the recording, it says an application error occurred.
I have been trying to contact support regarding the documentation or examples fo the above requirements, but it's very hard to get a reply as I don't have paid support enabled. Can anyone suggest good documentation with an example to handle my requirements.
Twilio developer evangelist here.
For queueing calls and then having more than one number called you should take a look at TaskRouter. It turns calls into tasks that can be assigned to workers via a workflow and can definitely handle your need to dial more than one person. You can then send your call into the workflow from Studio using the enqueue widget.
As for your recording issue, can you provide more detail? How did you add the call forwarding with recording option? How did you try to play the recording? Was there any more detail in the Twilio Debugger?

How to record when Make a call between two numbers not registered in twilio

I did when Make a call between two numbers not registered in Twilio using following link "Make a call between two numbers not registered in twilio" in C#. But I need to record while pressing 1 during the call at any time.Thanks in advance.
Twilio developer evangelist here.
You cannot nest a <Gather> within a <Dial>, so you can't interrupt a call between two people by pressing 1.
You could place your callers in a <Conference> (in fact, according to that SO question you linked to, it looks like you might have already). Then you can use <Dial>'s hangupOnStar attribute to end the conference for the moderator and allow them to record the call.
You'd then need to direct the moderator into a new <Conference> with the record attribute set to record-from-start. And then you'd need to redirect the original caller from their original conference to the conference that is being recorded.
Let me know if that helps at all.

Twilio - Call another person during a call and setup a conference call

I'm using Twilio to build a service right now. Here's my use case:
In a web page, I input a phone number and call it using Twilio JS (already done). During the call, I want to input another number and call another person. The call with the first person will be forwarded to the conference. When the second person answer the call, he will join the conference too.
Is it possible to use Twilio to implement this case?
This is definitely possible with twilio. i have worked on that scenario directly and twilio api works excellently well.
When u initiate a call from the twilio number to the first number, use the call back url to connect the person to the another person you want.
This can be done using twiML, which has <Dial> which will be of great help to you.
This is the easiest way of implementation.
The other way, is pretty clean but takes time to implement.
The twilio api provides conference capability themselves.
So you can create a request of conference with all the numbers that need to be connected.
The down side of this is that, all number will be called and connected, if your requirement is to call the first number and then only connect him to another person, then i wouldnt recommend this solution.
I hope this helped you.

Resources