Twilio'在CONNECT'之后从代理收到HTTP代码403

时间:2015-04-30 14:48:48

标签: php twilio http-status-code-403 twilio-php

我在运行简单的Twilio代码时遇到了一些麻烦。 这是我的代码:`

<?php include "twilio-php-master/Services/Twilio.php"; 
$sid = 'AC***'; 
$token = '[token]'; 
$version= '2010-04-01';
$client = new Services_Twilio($sid, $token, $version);
$client->account->calls->create('+390550620591', '+393386432173','http://demo.twilio.com/welcome/voice/');
?>

它出现以下错误:

Fatal error: Uncaught exception 'Services_Twilio_TinyHttpException' with message 'Received HTTP code 403 from proxy after CONNECT' in /membri/testtwilio/MakeCall/twilio-php-master/Services/Twilio/TinyHttp.php:119
Stack trace: 
#0 /membri/testtwilio/MakeCall/twilio-php-master/Services/Twilio.php(183): Services_Twilio_TinyHttp->__call('post', Array)
#1 /membri/testtwilio/MakeCall/twilio-php-master/Services/Twilio.php(183): Services_Twilio_TinyHttp->post('/2010-04-01/Acc...', Array, 'To=%2B393386432...')
#2 /membri/testtwilio/MakeCall/twilio-php-master/Services/Twilio/ListResource.php(92): Base_Services_Twilio->createData('/2010-04-01/Acc...', Array)
#3 /membri/testtwilio/MakeCall/twilio-php-master/Services/Twilio/Rest/Calls.php(32): Services_Twilio_ListResource->_create(Array)
#4 /membri/testtwilio/MakeCall/index.php(20): Services_Twilio_Rest_Calls->create('+390550620591', '+393386432173', 'http://demo.twi...')
#5 {main} thrown in /membri/testtwilio/MakeCall/twilio-php-master/Services/Twilio/TinyHttp.php on line 119

我使用altervista进行托管。

1 个答案:

答案 0 :(得分:0)

转到您的altervista控制台&gt;&gt;编辑PHP设置&gt;&gt;

然后,您需要通过发送短信来验证您的帐户,否则您将无法连接到twilio api ..修复此问题,一切都应该很好..