我是 twilio 的新手。我正在使用 twilio 试用帐户,我正在使用 php。我已经创建了我的帐户,并且验证码已发送到我的号码。但是当我尝试拨打电话时出现错误
错误:提供的源电话号码 +1937xxxxxx6 尚未针对您的帐户进行验证。您只能使用您已验证或从 Twilio 购买的电话号码拨打电话。
这是我的代码
<?php
// Include the Twilio PHP library
require 'twilio-php-master/Services/Twilio.php';
// Twilio REST API version
$version = "2010-04-01";
// Set our Account SID and AuthToken
$sid = 'Axxxxxxxxxxxxxxxxxxffa58';
$token = 'f878xxxxxxxxxxxxxxxeb05';
// A phone number you have previously validated with Twilio
$phonenumber = '+19xxxxxxxx6';
// Instantiate a new Twilio Rest Client
$client = new Services_Twilio($sid, $token, $version);
try {
// Initiate a new outbound call
$call = $client->account->calls->create(
$phonenumber, // The number of the phone initiating the call
'+91xxxxxxxx7', // The number of the phone receiving call
'http://demo.twilio.com/welcome/voice' // The URL Twilio will request when the call is answered
);
echo 'Started call: ' . $call->sid;
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
?>