Adding multiple people to a conference call from caller Twilio

陌路散爱 提交于 2019-12-01 05:56:16

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>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!