将多个人添加到呼叫者Twilio的电话会议中

Mar*_*tin 5 php twilio twilio-php twilio-api twilio-twiml

我读了很多关于Twilio电话会议的文章.我创建了一个php函数,它创建了一个Twilio会议,可以通过链接添加任何有权访问会议链接的人.所以我读这篇关于与Twilio同时拨打多个号码的文章.

本文介绍如何在同一时间拨打多个客户端或号码,但接受呼叫的第一个将连接,而其他客户端将挂断.

<?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>
Run Code Online (Sandbox Code Playgroud)

所以现在我的问题是,我可以将所有这些添加到电话会议中通过twilio php功能吗?

我也在堆栈溢出上检查了这个问题,但不同的是我使用的是TwiML然后我想也许有一个函数可以将所有客户端添加到同一个房间,当他/她调用它们的列表时.

 $dial->conference('My conference', array(
            'startConferenceOnEnter' => True,
            'endConferenceOnExit' => True
            ));
Run Code Online (Sandbox Code Playgroud)

Mar*_*tin 6

我在twilio开了一张票,它的开发者之一说通过REST api打电话给所有客户或号码到同一个会议但在我的情况下我的android应用程序指向twilML所以我决定添加调用者本身到电话会议,然后我的REST呼叫电话会议.

所以现在它适用于我的情况.

这是我的代码

......
//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")
);
Run Code Online (Sandbox Code Playgroud)

然后我将这个xml文件添加到REST调用api的url这里是我的XML文件

<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Dial>
    <Conference startConferenceOnEnter="true" endConferenceOnExit="true">Room 123</Conference>
  </Dial>
</Response>
Run Code Online (Sandbox Code Playgroud)