Exotel will perform an asynchronous HTTP request to the StatusCallback URL you have specified in your request (if any) once the call completes. List of parameters which will be sent as part of StatusCallback:

Parameter Name Type & Value
CallSid string; an alpha-numeric unique identifier of the call
DateUpdated Time in format YYYY-MM-DD HH:mm:ss; Date and time at which the status of the call was last updated in our system
Status Overall call status, which could be one of: 'completed', 'failed', 'busy' or 'no-answer'
RecordingUrl Link to the call recording if present.

List of additional fields which will be sent if 'terminal' event is subscribed using 'StatusCallbackEvents' in the request:

Parameter Name Type & Value
EventType

String; This will be the type of event for which 'StatusCallback' is triggered for and subscribed using 'StatusCallbackEvents'.

Currently, only ‘terminal’ as an event is supported which is triggered once the call is over. However, more events can be added in the future.

DateCreated Time in format YYYY-MM-DD HH:mm:ss; Date and time at which the user initiated the API
To Your customer's phone number as set in the API request. This number will be connected after `From`.
From The phone number that was attempted to be called first.
PhoneNumberSid This is your ExoPhone's unique identifier.
StartTime Time in format YYYY-MM-DD HH:mm:ss; Date and time when the call request was initiated to the operator
EndTime Time in format YYYY-MM-DD HH:mm:ss; Date and time when the call was completed
ConversationDuration The duration for the time `From` and `To` phone numbers were on call in seconds.
Direction

Can be:

  • inbound - Incoming call
  • outbound-dial - Outbound calls from Exotel dashboard
  • outbound-api - All other Outbound calls (API, campaign etc.)
CustomField The value that was passed in the CustomField parameter of the API (if set during the request) will be populated here.
Legs

An array which will denote detailed information about each leg attempt involved in the call.

  • Legs[i]: `i` denotes the index of the number in order it is attempted. If there are multiple numbers attempted, array’s length will be equal to total attempts. In case of outgoing call connecting two numbers, `i` will be have possible values of 0 and 1. 0th index will represent 'From' leg and 1st index will be represent 'To' leg.
  • OnCallDuration: Indicates the duration that this leg was on a call. This value could be 0 if the call was not picked up by the respective leg.
  • Status: This denotes the terminal status of the particular leg of the call. Can be:
    • completed - The call was answered by the leg.
    • busy - A busy signal was returned by the leg.
    • failed - The call could not be completed as dialled, most likely because the phone number was non-existent.
    • no-answer - The call ended without being answered.
    • canceled - The call was canceled while queued or ringing.
    • null (empty) - The call to that leg was not even attempted.

For understanding more about leg-wise call status, refer here.

Sample:
Legs[0][Status]= “completed”
Legs[0][OnCallDuration]= 29

curl -XPOST https://<your_api_key>:<your_api_token><subdomain>/v1/Accounts/<your_sid>/Calls/connect \
-d "From=+91941374XXXX" \
-d "To=+91886799XXXX" \
-d "CallerId=0113083XXXX" \
-d "StatusCallback=http://your-application.com/exotel-callback" \
-d "StatusCallbackEvents[0]=terminal" \
-d "StatusCallbackContentType=application/json"
{
  "CallSid": "492205107c5fb48f4ac25d1f77759339",
  "EventType": "terminal",
  "DateCreated": "2019-04-08 03:17:59",
  "DateUpdated": "2019-04-08 03:18:35",
  "Status": "no-answer",
  "To": "+91886799XXXX",
  "From": "+91941374XXXX",
  "PhoneNumberSid": "0113083XXXX",
  "StartTime": "2019-04-08 03:17:59",
  "EndTime": "2019-04-08 03:18:36",
  "Direction": "outbound-api",
  "RecordingUrl": "https://s3-ap-southeast-1.amazonaws.com/exotelrecordings/<your_sid>/492205107c5fb48f4ac25d1f77759339.mp3",
  "ConversationDuration": 32,
  "Legs": [
    {
      "OnCallDuration": 41,
      "Status": "completed"
    },
    {
      "OnCallDuration": 32,
      "Status": "completed"
    }
  ]
}
CallSid: 492205107c5fb48f4ac25d1f77759339
EventType: terminal
From: +91941374XXXX
To: +91886799XXXX
PhoneNumberSid: 0113083XXXX
Status: no-answer
Direction: outbound-api
DateCreated: 2019-04-08 03:10:55
DateUpdated: 2019-04-08 03:11:28
StartTime: 2019-04-08 03:10:55
EndTime: 2019-04-08 03:11:30
RecordingUrl:
ConversationDuration: 0
Legs[0][Status]: no-answer
Legs[0][OnCallDuration]: 0
Legs[1][Status]:
Legs[1][OnCallDuration]: 0