这是我的代码:
require_once 'library/Twilio/autoload.php'
use Twilio\Rest\Client
account_sid ='ACXXXXXXX'
auth_token ='xxxxx'
twilio_number ='+1xxxx'
to_number = "+212xxxx"
client = new Client($account_sid, $auth_token)
client->account->calls->create(
to_number,
twilio_number,
array("method" => "GET","statusCallback" => "https://xxx.php",
"statusCallbackEvent" => array('initiated', 'ringing',
'answered','completed'),
"statusCallbackMethod" => "POST",
"url" => "http://xxx.php"
)
)
这是callstatus的结果: 1启动 2进行中 3完成
答案 0 :(得分:0)
这里是Twilio开发人员的传播者。
在最后的评论中,您表明您正在使用array('queued','initiated', 'ringing', 'answered', 'completed')
作为statusCallbackEvent
参数。使用REST API the only available events that you can subscribe to are initiated
, ringing
, answered
and completed
进行调用时。
您可能会发现收到的CallStatus
参数是queued
,initiated
,ringing
,in-progress
,busy
,{ {1}}或failed
,但这些是可用状态,而不是要订阅的可用事件。
确保您仅请求事件no-answer
,initiated
,ringing
和answered
,并且通话应该正常。