Twilio-为什么我处于通话状态的原因也正在进行中,并且我的电话尚未响铃 [英] Twilio - why i get in call status is in-progress also completed and my phone not ringing yet

查看:124
本文介绍了Twilio-为什么我处于通话状态的原因也正在进行中,并且我的电话尚未响铃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的代码:

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆