【发布时间】:2017-03-31 12:13:29
【问题描述】:
我正在尝试在两个人之间建立通话,我可以拨打电话,但接听电话的人可以收听预先录制的语音邮件。我想在这两个人之间进行现场对话。我没有得到应该是什么 URL,我该如何设置它。
我的示例 PHP 代码是 -
require_once "application/helpers/Services/twilio-php-master/Twilio/autoload.php";
use Twilio\Rest\Client;
// Step 2: Set our AccountSid and AuthToken from https://twilio.com/console
$AccountSid = "Axxxxxxxxxxxxxxxxxxxxxc0";
$AuthToken = "xxxxxxxxxxxxxxxxxxxxxxxxx";
// Step 3: Instantiate a new Twilio Rest Client
$client = new Client($AccountSid, $AuthToken);
try {
// Initiate a new outbound call
$call = $client->account->calls->create(
// Step 4: Change the 'To' number below to whatever number you'd like
// to call.
"+91my_number",
//$_POST['to'],
// Step 5: Change the 'From' number below to be a valid Twilio number
// that you've purchased or verified with Twilio.
"+1_twilioverified_number",
// Step 6: Set the URL Twilio will request when the call is answered.
array("url" => "http://demo.twilio.com/welcome/voice/")
);
echo "Started call: " . $call->sid;
} catch (Exception $e) {
echo "Error: " . $e->getMessage();
}
有没有人可以帮助我解决这个问题。 先感谢您。等待回复。
【问题讨论】:
-
你找到解决办法了吗?
标签: twilio twilio-api twilio-php twilio-click-to-call