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
Twilio developer evangelist here.
In your final comment you show that you are using
array('queued','initiated', 'ringing', 'answered', 'completed')
as yourstatusCallbackEvent
parameter. When making calls with the REST API the only available events that you can subscribe to areinitiated
,ringing
,answered
andcompleted
.You may find that the
CallStatus
parameter you receive is one ofqueued
,initiated
,ringing
,in-progress
,busy
,failed
, orno-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
andcompleted
and your call should be fine.