dongpei3245 2018-05-01 07:35
浏览 731

使用twilio语音时我遇到了这个致命的错误

PHP Fatal error: Uncaught exception 'Twilio\Exceptions\RestException' with message '[HTTP 400] Unable to create record: Account not authorized to call +126878****. Perhaps you need to enable some international permissions: https://www.twilio.com/user/account/settings/international' in /home/gwalioro/public_html/swifnix.com/works/call/twilio-php-master/Twilio/Version.php:85

Code Here

 require __DIR__ . '/twilio-php-master/Twilio/autoload.php';
 use Twilio\Rest\Client;
// Your Account SID and Auth Token from twilio.com/console
$account_sid = 'ACf9bd660b13b0******';
$auth_token = '7e5d0992f716420dad9******';
// In production, these should be environment variables. E.g.:
// $auth_token = $_ENV["TWILIO_ACCOUNT_SID"]
// A Twilio number you own with SMS capabilities
$twilio_number = "+12015****";
// Where to make a voice call (your cell phone?)
$to_number = "+1268784****";
$client = new Client($account_sid, $auth_token);
$call = $client->account->calls->create(  
    $to_number,
    $twilio_number,
    array(
        "url" => "http://demo.twilio.com/docs/voice.xml"
    )
);
echo  $call->sid;
  • 写回答

2条回答 默认 最新

  • dongzhui2636 2018-05-01 08:21
    关注

    I believe, the Error speaks for itself :) You need to enable International Permissions. This is made for you not to pay more, in case you don't need that.

    This is what Twilio manual tells us:

    Need to make outbound calls outside of the U.S, and want to select the regions and countries you’ll allow to protect your project from high-cost routes and potential fraud?

    see more in Twilio docs

    评论

报告相同问题?

悬赏问题

  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 UE5#if WITH_EDITOR导致打包的功能不可用
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?
  • ¥15 电磁场的matlab仿真
  • ¥15 mars2d在vue3中的引入问题
  • ¥50 h5唤醒支付宝并跳转至向小荷包转账界面