错误:在PHP代码中使用twilo进行语音呼叫

时间:2017-07-25 03:37:21

标签: php twilio

我使用twilio进行呼叫系统,但我的错误是:

  

错误:帐户无权拨打+ 84983xxxxxx。也许你需要   启用一些国际权限:   https://www.twilio.com/user/account/settings/international

我通过https://www.twilio.com/user/account/settings/international检查了越南(+84),但仍遇到同样的错误

我的PHP代码:

<?php
require 'twilio-php/Services/Twilio.php';
function call_notify($number) {

// Twilio REST API version
$version = "2010-04-01";

// Set our Account SID and AuthToken
$sid = 'AC34962eb3f445dfa40893e64bb8xxxxxx';
$token = '9b0667c68299cf484228344d67xxxxxx';

// A phone number you have previously validated with Twilio
$phonenumber = '+155920xxxxx';

// 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
      $number, // The number of the phone receiving call
      'http://103.255.238.29/notify.xml' // The URL Twilio will request when the call is answered
        );
    echo 'Started call: ' . $call->sid;
      } catch (Exception $e) {
        echo 'Error: ' . $e->getMessage();
   }

}

call_notify("+84983xxxxxx");

请帮助我,谢谢

1 个答案:

答案 0 :(得分:0)

Twilio开发者传道者在这里。

我点击国际设置的网址,但被重定向到Messaging国际设置。

您可以在https://www.twilio.com/console/voice/settings/geo-permissions转到语音国际设置,并确保您也在该页面上检查了越南语。

我会反馈错误指向错误的页面。

如果有帮助,请告诉我!