我正在开发一个通过Twilio API
但它在第一次通话后断开连接进行语音通话的应用程序。
这是我的代码:
my index.php
<?php
$serverroot=$_SERVER['DOCUMENT_ROOT'].'/twilioapi/twilio-php-master/Services/Twilio.php';
require($serverroot);
$version = "2010-04-01";
$num= '+1 218-461-4418';
$num1= '+91$$$$$$$$$$$';
$num2= '+91$$$$$$$$$$$';
$num3= '+91$$$$$$$$$$$';
$account_sid = '$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$';
$auth_token = '$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$';
$client = new TwilioRestClient($account_sid, $auth_token);
$participants = array($num1, $num2, $num3);
// Go through the participants array and call each person.
foreach ($participants as $particpant)
{
$vars = array(
'From' => $num,
'To' => $participant,
'Url' => 'http://my_url.com/twilioapi/mytest2.xml');
echo $response = $client->request("/$version/Accounts/$account_sid/Calls", "GET", $vars);
}
//echo json_encode($response);
?>
xml file
<Response>
<Say>Joining a conference room</Say>
<Dial>
<Conference>MyRoom</Conference>
</Dial>
</Response>
问候