Twilio - why i get in call status is in-progress a

2019-06-08 19:36发布

this is my code :

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" 
    )
)

And this is the results of callstatus: 1-initiated 2-in-progress 3-completed

1条回答
我欲成王,谁敢阻挡
2楼-- · 2019-06-08 19:54

Twilio developer evangelist here.

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.

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.

查看更多
登录 后发表回答