Disconnect
The Disconnect event is fired when a call ends, for any reason. The cause for a disconnect event on a call can be:
hangup: one party hung up the call, a<Hangup>verb was executed, or there was no more BXML to execute; it indicates that the call ended normally.busy: the callee was busy.timeout: the call wasn't answered before thecallTimeoutwas reached.cancel: the call was cancelled by its originator while it was ringing.rejected: the call was rejected by the callee.callback-error: a BXML callback couldn't be delivered to your callback server.invalid-bxml: invalid BXML was returned in response to a callback.application-error: an unsupported action was tried on the call, e.g. trying to play a .ogg audio.account-limit: the account rate limits were reached.node-capacity-exceeded: the system maximum capacity was reached.error: some error not described in any of the other causes happened on the call.unknown: some unknown error happened on the call.
caution
This list is not exhaustive and other values can appear in the future.
Request Parameters
| Property | Description |
|---|---|
| eventType | The event type, value is disconnect. |
| eventTime | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. |
| accountId | The user account associated with the call. |
| applicationId | The id of the application associated with the call. |
| to | The phone number that received the call, in E.164 format (e.g. +15555555555). |
| from | The provided identifier string of the caller used in the from field of the original call. |
| direction | The direction of the call. Either inbound or outbound. The direction of a call never changes. |
| callId | The call id associated with the event. |
| callUrl | The URL of the call associated with the event. |
| startTime | Time the call was started, in ISO 8601 format. |
| enqueuedTime | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. |
| answerTime | (optional) Time the call was answered, in ISO 8601 format. |
| endTime | Time the call ended, in ISO 8601 format. |
| cause | Reason the call ended. See above for possible values. |
| errorMessage | (optional) Text explaining the reason that caused the call to be ended in case of errors. |
| errorId | (optional) Bandwidth internal id that references the error event. |
| tag | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. |
| sipCallId | (optional) The SIP Call-ID of the call's current SIP dialog with Bandwidth's SBC. Present on any call, inbound or outbound, once that dialog has been established; may be absent very early in a call before the dialog exists. |
| sipResponseCode | (optional) The SIP status code of the final response that rejected an outbound call's (or transferred leg's) INVITE (e.g. 486 for busy, 603 for decline). Present only when the call was rejected with a SIP response. |
| sipStatusLine | (optional) The full SIP status line, exactly as received, of the final response that rejected an outbound call's INVITE (e.g. SIP/2.0 603 Network Blocked or SIP/2.0 603 Decline). The reason phrase can help distinguish outcomes that share a status code. Present only when an outbound call was rejected with a SIP response. |
| sipHeaders | (optional) Object of SIP headers from the final response that rejected an outbound call. Currently contains a single key, reason, holding the raw, unmodified Reason header value (e.g. call-analytics block information from a terminating carrier). If the response carries more than one Reason header, all values are returned in the order received, separated by , . Present only when the response included a Reason header. |
Expected Response
HTTP/1.1 204
Examples
Call Ended due to a Busy Signal
POST http://yourUrl.example/disconnect
Content-Type: application/json
{
"eventType" : "disconnect",
"eventTime" : "2019-06-20T15:55:55.533Z",
"accountId" : "55555555",
"applicationId" : "7fc9698a-b04a-468b-9e8f-91238c0d0086",
"from" : "+15551112222",
"to" : "+15553334444",
"direction" : "outbound",
"callId" : "c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d",
"callUrl" : "https://voice.bandwidth.com/api/v2/accounts/55555555/calls/c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d",
"startTime" : "2019-06-20T15:54:22.234Z",
"endTime" : "2019-06-20T15:55:54.123Z",
"cause" : "busy",
"errorMessage" : "Callee is busy",
"errorId" : "4642074b-7b58-478b-96e4-3a60955c6765"
}
Call Ended due to a Busy Signal with Enqueued Time
POST http://yourUrl.example/disconnect
Content-Type: application/json
{
"eventType" : "disconnect",
"eventTime" : "2019-06-20T15:55:55.533Z",
"accountId" : "55555555",
"applicationId" : "7fc9698a-b04a-468b-9e8f-91238c0d0086",
"from" : "+15551112222",
"to" : "+15553334444",
"direction" : "outbound",
"callId" : "c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d",
"callUrl" : "https://voice.bandwidth.com/api/v2/accounts/55555555/calls/c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d",
"enqueuedTime" : "2019-06-20T15:51:09.729Z",
"startTime" : "2019-06-20T15:54:22.234Z",
"endTime" : "2019-06-20T15:55:54.123Z",
"cause" : "busy",
"errorMessage" : "Callee is busy",
"errorId" : "4642074b-7b58-478b-96e4-3a60955c6765"
}
Disconnect Event with SIP Call-ID
POST http://yourUrl.example/disconnect
Content-Type: application/json
{
"eventType" : "disconnect",
"eventTime" : "2026-06-16T12:35:00.533Z",
"accountId" : "9901078",
"applicationId" : "7fc9698a-b04a-468b-9e8f-91238c0d0086",
"from" : "+15551112222",
"to" : "+15553334444",
"direction" : "inbound",
"callId" : "c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d",
"callUrl" : "https://voice.bandwidth.com/api/v2/accounts/9901078/calls/c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d",
"startTime" : "2026-06-16T12:29:55.000Z",
"answerTime" : "2026-06-16T12:30:00.120Z",
"endTime" : "2026-06-16T12:35:00.530Z",
"cause" : "hangup",
"sipCallId" : "c95ac8d6e1a31c52eb38f419893c151633ec68f8d@sbc.bandwidth.com"
}
Outbound Call Rejected
POST http://yourUrl.example/disconnect
Content-Type: application/json
{
"eventType" : "disconnect",
"eventTime" : "2019-06-20T15:55:55.533Z",
"accountId" : "55555555",
"applicationId" : "7fc9698a-b04a-468b-9e8f-91238c0d0086",
"from" : "+15551112222",
"to" : "+15553334444",
"direction" : "outbound",
"callId" : "c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d",
"callUrl" : "https://voice.bandwidth.com/api/v2/accounts/55555555/calls/c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d",
"startTime" : "2019-06-20T15:54:22.234Z",
"endTime" : "2019-06-20T15:55:54.123Z",
"cause" : "busy",
"errorMessage" : "Callee is busy",
"errorId" : "4642074b-7b58-478b-96e4-3a60955c6765",
"sipResponseCode" : 486
}
Outbound Call Blocked by Carrier Call Analytics
A terminating carrier's call analytics blocked the call. The reason value is passed through exactly as the carrier sent it, so you can use the url it contains to request redress.
POST http://yourUrl.example/disconnect
Content-Type: application/json
{
"eventType" : "disconnect",
"eventTime" : "2026-10-15T15:55:55.533Z",
"accountId" : "55555555",
"applicationId" : "7fc9698a-b04a-468b-9e8f-91238c0d0086",
"from" : "+15551112222",
"to" : "+15553334444",
"direction" : "outbound",
"callId" : "c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d",
"callUrl" : "https://voice.bandwidth.com/api/v2/accounts/55555555/calls/c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d",
"startTime" : "2026-10-15T15:55:54.234Z",
"endTime" : "2026-10-15T15:55:55.123Z",
"cause" : "rejected",
"errorMessage" : "Call declined",
"errorId" : "4642074b-7b58-478b-96e4-3a60955c6765",
"sipResponseCode" : 603,
"sipStatusLine" : "SIP/2.0 603 Network Blocked",
"sipHeaders" : {
"reason" : "SIP;cause=603;text=\"v=analytics1;url=https://www.att.com/redressC;id=att2\";location=RLN"
}
}
Outbound Call Declined with a Reason Header
Some carriers return a generic 603 Decline status line for an analytics block. Check sipHeaders.reason to tell the two apart.
POST http://yourUrl.example/disconnect
Content-Type: application/json
{
"eventType" : "disconnect",
"eventTime" : "2026-10-15T15:55:55.533Z",
"accountId" : "55555555",
"applicationId" : "7fc9698a-b04a-468b-9e8f-91238c0d0086",
"from" : "+15551112222",
"to" : "+15553334444",
"direction" : "outbound",
"callId" : "c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d",
"callUrl" : "https://voice.bandwidth.com/api/v2/accounts/55555555/calls/c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d",
"startTime" : "2026-10-15T15:55:54.234Z",
"endTime" : "2026-10-15T15:55:55.123Z",
"cause" : "rejected",
"errorMessage" : "Call declined",
"errorId" : "4642074b-7b58-478b-96e4-3a60955c6765",
"sipResponseCode" : 603,
"sipStatusLine" : "SIP/2.0 603 Decline",
"sipHeaders" : {
"reason" : "SIP;cause=603;text=\"v=analytics1;url=https://www.att.com/redressC;id=att2\";location=RLN"
}
}
Outbound Call Rejected without a Reason Header
When the response has no Reason header, sipHeaders is omitted.
POST http://yourUrl.example/disconnect
Content-Type: application/json
{
"eventType" : "disconnect",
"eventTime" : "2026-10-15T15:55:55.533Z",
"accountId" : "55555555",
"applicationId" : "7fc9698a-b04a-468b-9e8f-91238c0d0086",
"from" : "+15551112222",
"to" : "+15553334444",
"direction" : "outbound",
"callId" : "c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d",
"callUrl" : "https://voice.bandwidth.com/api/v2/accounts/55555555/calls/c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d",
"startTime" : "2026-10-15T15:55:54.234Z",
"endTime" : "2026-10-15T15:55:55.123Z",
"cause" : "rejected",
"errorMessage" : "Call declined",
"errorId" : "4642074b-7b58-478b-96e4-3a60955c6765",
"sipResponseCode" : 603,
"sipStatusLine" : "SIP/2.0 603 Decline"
}