Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
712 views
in Technique[技术] by (71.8m points)

php - Adding multiple people to a conference call from caller Twilio

I read lots of articles about Twilio conference call. I created a php function which creates a Twilio conference which can add any one who have access to that link to the Conference with this link. so then I read this article about Dialing Multiple Numbers Simultaneously with Twilio.

This article shows how to dial multiple clients or numbers in the same time but the first one who accept the call will connect while the others will be hung up on.

<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Dial>
    <Number>877-555-1212</Number>
    <Number>877-999-1234</Number>
    <Number>877-123-4567</Number>
  </Dial>
</Response>

So now my question is that can I add all of them to a conference call troughs a twilio php function?

I also checked this question on stack overflow but the different is that I am using TwiML and then I thought maybe there is a function to add all clients to same room whe he/she calls a list of them.

 $dial->conference('My conference', array(
            'startConferenceOnEnter' => True,
            'endConferenceOnExit' => True
            ));
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I opened a ticket in twilio, one of its developer said make your call trough REST api and add all of clients or numbers to to same conference but in my case My android app is pointing to a twilML so I decided to Add the caller itself to a conference call and then make my REST call to that conference call.

so now it worked for my case.

here is my codes

......
//some php codes to configure the Twilio and get the from and to caller ids 


//this part belongs to my caller. I added this php file url to my TwiML app
//so when my user hit the dial button it will sent the caller to this conference room and waits for others.
$response = new Twiml;
$dial = $response->dial();
$dial->conference('Room 123', array(
                'startConferenceOnEnter' => True,
                'endConferenceOnExit' => True
                ));
print $response;


//this is the part that make a call other participants and will  add them to the same conference room that caller is.
$call = $client->calls->create(
    "yourClient", "youtwiliophonenumber",
    array("url" => "http://domain/conference.xml")
);

And then I added this xml file to the url of REST call api here is my XML file

<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Dial>
    <Conference startConferenceOnEnter="true" endConferenceOnExit="true">Room 123</Conference>
  </Dial>
</Response>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...