0
votes

I am making a voip call through Twilio based on TwiML that is being generated dynamically from server. Sometimes when i call a user and user is not available i do not get any status back from Twilio. According to Twilio's documentation i set 'STATUS CALLBACK URL' in my Twilio Application and set a callback url(POST Requst) to it. Now i am confused how would i get status of the call e.g. in what type of parameters i will get Twilio CallStaus?

[System.Web.Http.HttpPost]
    public void TwilioCallbackEvent()
    {

    }

this is the sample method in which i want to receive callStatus from twilio.

1

1 Answers

0
votes

Twilio developer evangelist here.

When Twilio makes the webhook request to your status callback URL you receive the following parameters in the application/x-www-form-urlencoded format:

Parameter           Description
---------------------------------------------------------------------------
CallStatus          A descriptive status for the call. The value is one of queued, initiated, ringing, in-progress, busy, failed, or no-answer.
CallDuration        The duration in seconds of the just-completed call. Only present in the completed event.
SipResponseCode     The SIP code that resulted in a failed call. For instance 404 for a number that was unreachable or 487 if the Timeout value was reached before the call connected. Only present in the completed event if the CallStatus is failed or no-answer.
RecordingUrl        The URL of the phone call's recorded audio. This parameter is included only if Record=true is set on the REST API request and does not include recordings initiated in other ways. RecordingUrl is only present in the completed event. The recording file may not yet be accessible when the Status Callback is sent. Use RecordingStatusCallback for reliable notification on when the recording is available for access.
RecordingSid        The unique ID of the Recording from this call. RecordingSid is only present in the completed event.
RecordingDuration   The duration of the recorded audio (in seconds). RecordingDuration is only present in the completed event. To get a final accurate recording duration after any trimming of silence, use RecordingStatusCallback.
Timestamp           The timestamp when the event was fired, given as UTC in RFC 2822 format.
CallbackSource      A string that describes the source of the webhook. This is provided to help disambiguate why the webhook was made. On Status Callbacks, this value is always call-progress-events.
SequenceNumber      The order in which the events were fired, starting from 0. Although events are fired in order, they are made as separate HTTP requests and there is no guarantee they will arrive in the same order.

There is more information about the CallStatus parameter in the documentation.

You also receive all the regular parameters that are sent as part of a synchronous TwiML callback.

Let me know if this helps at all.