Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twilio - How to move an existing call to a conference

With twilio, on an existing call (2 legs - caller leg and called leg), I want to move the call into a conference room. Both legs have to be present into the room How to bridge the both legs without losing one or the other leg ?

Thank you

Regards

like image 624
zucher Avatar asked Mar 25 '14 18:03

zucher


People also ask

How do you do a conference call on twilio?

Configuring your Twilio number Click on the number you'd like to use. On the next screen, scroll down to “Voice & Fax.” Under “A Call Comes In”, select “Studio Flow” and “conference call” from the dropdown menus. Click “Save” and you're ready to test.

What is twilio conference?

Twilio's Voice Conference is a flexible way for developers to manage multi party calls from 2 participants to 250 participants. Voice Conferences can be used for standard multi party audio bridges, for inbound contact centers, or for outbound dialers.

What is twilio programmable voice?

The Twilio Programmable Voice API gives developers programmatic control over their calls, with APIs built for a wide variety of uses from basic phone to phone calling, app to phone calling, Interactive Voice Response (IVR), conference calling, SIP interfacing, call recording, transcription, call tracking, and more.

How do I add whisper to twilio?

Implementing call whisper with Twilio The <Dial> verb in TwiML makes it very easy to add a call whisper feature to your Twilio voice application by providing a call screening URL that controls the call once the callee picks up while the caller continues to hear ringing (required answerOnBridge set to true).


2 Answers

The trick to prevent the call being dropped is by using “action” url for parent leg to dial into conference and modifying the child leg to move in the same conference.

Here’s the detailed flow to start calls between 2 person and then upgrade that to a conference

(1) Create a TwiML Response API to dial calls in conference(based suited to your business logic ) . Here’s a simple example TwiML (http://www.mocky.io/v2/584ac0f81000002b14fb0205)

<Response>
<Dial>
<Conference>letItGoSimple</Conference>
</Dial>
</Response>

(2) When you initiate the call , your Url parameter should be set to return TwiML like the one below (example Twiml : http://www.mocky.io/v2/584ac8a3100000c914fb0214 )

<Response>
<Dial action="http://www.mocky.io/v2/584ac0f81000002b14fb0205" method="GET">
<Number>+44xxxxxxxx</Number>
</Dial>
</Response>

Note that the action url has been set to TwiML from step one . It is very important in this flow as this would prevent the call from being dropped when you modify the Child Leg of the call .

(3) After step 2 is executed, the two parties would be on a direct call (no conference)

(4) When you want to upgrade the call to a conference , POST to the child call SID with Url set to Twiml To Dial into conference ,

Example : 
curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACxxxxxxxxxxxx/Calls/CAyyyyyyyyyyyyyy -d "Url=http://www.mocky.io/v2/584ac0f81000002b14fb0205" -d "Method=GET"  -u ‘accountSID:authToken'

It is important that you modify the child leg of the call .

(5) Here is what will happen when you execute step 4

  • Child call will be redirected to the Url and would be dialed into the conference
  • Parent call will move to action and would be dialed in the same conference

Hope this helps.

like image 124
am1704 Avatar answered Nov 04 '22 19:11

am1704


Twilio evangelist here.

So the best answer is to just put both calls into a conference to start. Its a little more difficult since you have to use the API to initiate the second leg, but it gives you a lot more flexibility to move call legs around.

If thats not possible, then it gets a bit more challenging since there isn't a great way today to get the SID of the second call. What you would likely need to do is use the Calls list resource in the REST API to find the SID of that second call. You can use the list filter parameters To and Status to find the specific call. Once you have the call resource of the second leg, it contains a parameter called parent_call_sid which is the SID of the original incoming call.

Now that you have the SID's for both call legs you can use the REST API to redirect both calls to new Voice Urls which return TwiML containing the <Conference> noun.

Hope that helps.

like image 27
Devin Rader Avatar answered Nov 04 '22 20:11

Devin Rader