Twilio-为什么我处于通话状态的原因也正在进行中,并且我的电话尚未响铃 [英] Twilio - why i get in call status is in-progress also completed and my phone not ringing yet
问题描述
这是我的代码:
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完成了
And this is the results of callstatus: 1-initiated 2-in-progress 3-completed
推荐答案
此处是Twilio开发人员的传播者。
Twilio developer evangelist here.
在最后的注释中,您表明您正在使用 array('queued','initiated','ringing','answe红色,完成)
作为您的 statusCallbackEvent
参数。使用REST API进行调用时您可以订阅的唯一可用事件是已启动
,响铃
,已应答
和已完成
。
In your final comment you show that you are using array('queued','initiated', 'ringing', 'answered', 'completed')
as your statusCallbackEvent
parameter. When making calls with the REST API the only available events that you can subscribe to are initiated
, ringing
, answered
and completed
.
您可能会发现收到的 CallStatus
参数是已排队
,已启动
,铃声
,进行中
,忙
,失败
或没有答案
,但是这些是可用状态,而不是要订阅的可用事件。
You may find that the CallStatus
parameter you receive is one of queued
, initiated
, ringing
, in-progress
, busy
, failed
, or no-answer
but those are the available statuses, not the available events to subscribe to.
确保您仅请求事件已启动
,响铃
,已应答
和已完成
,您的通话就可以了。
Ensure that you are only requesting the events initiated
, ringing
, answered
and completed
and your call should be fine.
这篇关于Twilio-为什么我处于通话状态的原因也正在进行中,并且我的电话尚未响铃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!