From 6045698cdc8c0c0b617d057696301f96afd71f86 Mon Sep 17 00:00:00 2001 From: DX-Bandwidth Date: Tue, 3 Nov 2026 14:08:55 +0000 Subject: [PATCH 1/2] Generate SDK with OpenAPI Generator Version 7.24.0 --- .openapi-generator/FILES | 2 + README.md | 1 + bandwidth.yml | 249 ++++++++++++++++-- docs/DisconnectCallback.md | 6 +- docs/InboundCallbackMessage.md | 2 + docs/InitiateCallback.md | 2 +- docs/MultiChannelAction.md | 2 +- docs/MultiChannelActionCalendarEvent.md | 2 +- docs/RbmActionBase.md | 2 +- docs/RbmActionDial.md | 2 +- docs/RbmActionOpenUrl.md | 2 +- docs/RbmActionViewLocation.md | 2 +- docs/RbmSession.md | 29 ++ docs/RbmSuggestionResponse.md | 4 +- docs/StatusCallbackMessage.md | 2 + docs/StatusCallbackTypeEnum.md | 4 +- docs/TransferDisconnectCallback.md | 6 + models/callback.ts | 2 +- models/disconnect-callback.ts | 10 +- models/inbound-callback-message.ts | 4 + models/index.ts | 1 + models/initiate-callback.ts | 2 +- models/list-message-item.ts | 2 +- models/multi-channel-action-calendar-event.ts | 2 +- models/multi-channel-action.ts | 2 +- models/rbm-action-base.ts | 2 +- models/rbm-action-dial.ts | 2 +- models/rbm-action-open-url.ts | 2 +- models/rbm-action-view-location.ts | 2 +- models/rbm-session.ts | 42 +++ models/rbm-suggestion-response.ts | 4 +- models/status-callback-message.ts | 4 + models/status-callback-type-enum.ts | 3 +- models/transfer-disconnect-callback.ts | 12 + 34 files changed, 375 insertions(+), 42 deletions(-) create mode 100644 docs/RbmSession.md create mode 100644 models/rbm-session.ts diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 52c0736..30b0159 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -170,6 +170,7 @@ docs/RbmMessageContentRichCard.md docs/RbmMessageContentText.md docs/RbmMessageMedia.md docs/RbmOpenUrlEnum.md +docs/RbmSession.md docs/RbmStandaloneCard.md docs/RbmSuggestionResponse.md docs/RbmWebViewEnum.md @@ -378,6 +379,7 @@ models/rbm-message-content-rich-card.ts models/rbm-message-content-text.ts models/rbm-message-media.ts models/rbm-open-url-enum.ts +models/rbm-session.ts models/rbm-standalone-card.ts models/rbm-suggestion-response.ts models/rbm-web-view-enum.ts diff --git a/README.md b/README.md index 89740b4..29f67b9 100644 --- a/README.md +++ b/README.md @@ -311,6 +311,7 @@ Class | Method | HTTP request | Description - [RbmMessageContentText](docs/RbmMessageContentText.md) - [RbmMessageMedia](docs/RbmMessageMedia.md) - [RbmOpenUrlEnum](docs/RbmOpenUrlEnum.md) + - [RbmSession](docs/RbmSession.md) - [RbmStandaloneCard](docs/RbmStandaloneCard.md) - [RbmSuggestionResponse](docs/RbmSuggestionResponse.md) - [RbmWebViewEnum](docs/RbmWebViewEnum.md) diff --git a/bandwidth.yml b/bandwidth.yml index 350b621..0df9d76 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -2031,6 +2031,7 @@ components: messageLength: type: integer description: The length of the message content. + nullable: true example: 18 attachmentCount: type: integer @@ -2620,14 +2621,13 @@ components: type: string description: Displayed text for user to click maxLength: 25 - example: Hello world + example: Track my order rbmActionPostbackData: title: Post Back Data type: string - format: byte - description: Base64 payload the customer receives when the reply is clicked. + description: Payload the customer receives when the reply is clicked. maxLength: 2048 - example: SGVsbG8gd29ybGQ= + example: track-order-43654 rbmActionBase: type: object properties: @@ -2916,8 +2916,8 @@ components: properties: text: type: string - description: The text associated with the suggestion response. - example: Yes, I would like to proceed + description: The text of the suggestion the user tapped. + example: Track my order postbackData: $ref: '#/components/schemas/rbmActionPostbackData' pairedMessageId: @@ -2938,6 +2938,70 @@ components: format: double description: The longitude of the client's location. example: '-122.4194' + rbmSession: + type: object + description: >- + RCS interactive session information for the message. + + An interactive session is a 24-hour window covering all Rich and Rich + Media messages exchanged between an + + RCS agent and a specific end user mobile number. It is triggered when at + least 4 messages are exchanged within + + 24 hours, at least 2 of them mobile-originated and at least 1 + mobile-terminated. + + Only present on `message-delivered`, `message-received` and + `session-started` callbacks for RBM messages of + + US agents with the Conversational billing category. Omitted for all + other messages. + properties: + canInitiate: + type: boolean + description: >- + Whether the message can start an interactive session. + + `false` if the message is already part of an active session, or if + the agent is not eligible for + + interactive session billing. + example: false + id: + type: string + nullable: true + description: >- + The unique identifier of the interactive session the message is part + of. This is not a message ID. + + Omitted if the message is not part of a session. + example: 0f5a3b9c-2d4e-4f6a-8b1c-7e9d0a2b3c4d + type: + type: string + nullable: true + description: |- + The type of the interactive session. + Only present on `session-started` callbacks. + example: INTERACTIVE_SESSION + startTime: + type: string + nullable: true + format: date-time + description: >- + The time the 24-hour session window opened. Only present on + `session-started` callbacks. + example: '2026-08-06T09:59:55Z' + endTime: + type: string + nullable: true + format: date-time + description: >- + The time the 24-hour session window closes. Only present on + `session-started` callbacks. + example: '2026-08-07T09:59:55Z' + required: + - canInitiate callback: description: >- Callbacks are divided into two types based on direction of the related @@ -2960,6 +3024,7 @@ components: message-delivered: '#/components/schemas/statusCallback' message-failed: '#/components/schemas/statusCallback' message-read: '#/components/schemas/statusCallback' + session-started: '#/components/schemas/statusCallback' message-received: '#/components/schemas/inboundCallback' requested-location-response: '#/components/schemas/inboundCallback' suggestion-response: '#/components/schemas/inboundCallback' @@ -3060,12 +3125,17 @@ components: - `message-read` indicates that the RBM message was read by the recipient. + + - `session-started` indicates that a previously exchanged RBM message is + now part of an RCS interactive session and is no longer billed + individually. enum: - message-sending - message-sent - message-delivered - message-failed - message-read + - session-started example: message-delivered inboundCallbackTypeEnum: type: string @@ -3143,6 +3213,8 @@ components: $ref: '#/components/schemas/priorityEnum' channel: $ref: '#/components/schemas/multiChannelMessageChannelEnum' + session: + $ref: '#/components/schemas/rbmSession' required: - id - owner @@ -4876,6 +4948,10 @@ components: $ref: '#/components/schemas/sipCallId' sipResponseCode: $ref: '#/components/schemas/sipResponseCode' + sipStatusLine: + $ref: '#/components/schemas/sipStatusLine' + sipHeaders: + $ref: '#/components/schemas/sipHeaders' dtmfCallback: type: object description: >- @@ -5395,6 +5471,12 @@ components: $ref: '#/components/schemas/errorMessage' errorId: $ref: '#/components/schemas/errorId' + sipResponseCode: + $ref: '#/components/schemas/sipResponseCode' + sipStatusLine: + $ref: '#/components/schemas/sipStatusLine' + sipHeaders: + $ref: '#/components/schemas/sipHeaders' eventType: type: string description: >- @@ -5710,23 +5792,44 @@ components: additionalProperties: type: string description: >- - (optional) Map of customer-supplied X-* headers from the original - INVITE. Keys are lowercase (SIP headers are case-insensitive). Present - only for inbound SIP URI calls with custom headers. Note - keys preserve - the original SIP header name in lowercase rather than Bandwidth's usual - camelCase JSON convention, since these are passthrough values from the - caller's SIP INVITE, not Bandwidth-defined fields. If the same header - name is sent more than once in the INVITE, only the last value is kept. + (optional) Map of SIP headers, with lowercase keys (SIP headers are + case-insensitive). On the Initiate callback, contains the + customer-supplied X-* headers from the original INVITE; present only for + inbound SIP URI calls with custom headers. On the Disconnect and + Transfer Disconnect callbacks, contains a single `reason` key holding + the raw, unmodified `Reason` header value from the final SIP response + that rejected an outbound call (or transferred leg); present only when + that response included a `Reason` header (for example, `v=analytics1` + 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 `, `. Note - on the Initiate + callback, keys preserve the original SIP header name in lowercase rather + than Bandwidth's usual camelCase JSON convention, since these are + passthrough values from the caller's SIP INVITE, not Bandwidth-defined + fields. If the same header name is sent more than once in the INVITE, + only the last value is kept. The example shown is for the Initiate + callback; on the Disconnect and Transfer Disconnect callbacks the only + key is `reason`. example: x-custom-header: customer-value x-session-id: sess-12345 sipResponseCode: type: integer description: >- - (optional) The SIP status code returned by Bandwidth's SBC when it - rejected an outbound call's INVITE (e.g. 486 for busy, 603 for decline). - Present only when an outbound call was rejected by the SBC. + (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. example: 486 + sipStatusLine: + type: string + description: >- + (optional) The full SIP status line, exactly as received, of the final + response that rejected an outbound call's INVITE. The reason phrase can + help distinguish outcomes that share a status code, such as `603 Network + Blocked` and `603 Decline`. Present only when an outbound call was + rejected with a SIP response. + example: SIP/2.0 603 Network Blocked codeRequest: type: object properties: @@ -8878,6 +8981,31 @@ components: media: - >- https://messaging.bandwidth.com/api/v2/users/9900902/media/14762070468292kw2fuqty55yp2b2/0/bw.png + rbmMessageReceivedSessionCallbackExample: + summary: >- + An example of a rbm message-received callback body for a message that is + part of an RCS interactive session. + value: + time: '2026-08-06T10:00:05.502180Z' + type: message-received + to: BandwidthRBM + description: Incoming message received + message: + id: 1786010405502l2ntaoajuqjhqnxu + owner: BandwidthRBM + applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 + time: '2026-08-06T10:00:05.302180Z' + segmentCount: 1 + direction: in + to: + - BandwidthRBM + from: '+12345678902' + channel: RBM + content: + text: Yes, please book it for tomorrow. + session: + canInitiate: false + id: 0f5a3b9c-2d4e-4f6a-8b1c-7e9d0a2b3c4d messageSendingCallbackExample: summary: An example of a message-sending callback body. value: @@ -8977,6 +9105,79 @@ components: owner: '+12345678902' direction: out segmentCount: 1 + rbmMessageDeliveredSessionCallbackExample: + summary: >- + An example of a rbm message-delivered callback body for a message that + is part of an RCS interactive session. + value: + type: message-delivered + time: '2026-08-06T10:01:11.160744Z' + description: Message delivered to handset. + to: '+12345678902' + message: + id: 1786010470868ty55yp2b2kw2fuq + time: '2026-08-06T10:01:10.868292Z' + to: + - '+12345678902' + from: BandwidthRBM + text: '' + applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 + owner: BandwidthRBM + direction: out + segmentCount: 1 + channel: RBM + session: + canInitiate: false + id: 0f5a3b9c-2d4e-4f6a-8b1c-7e9d0a2b3c4d + rbmMessageDeliveredCanInitiateSessionCallbackExample: + summary: >- + An example of a rbm message-delivered callback body for a message that + is not yet part of an RCS interactive session. + value: + type: message-delivered + time: '2026-08-06T09:59:56.160744Z' + description: Message delivered to handset. + to: '+12345678902' + message: + id: 1786010395000kw2fuqty55yp2b2 + time: '2026-08-06T09:59:55.000000Z' + to: + - '+12345678902' + from: BandwidthRBM + text: '' + applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 + owner: BandwidthRBM + direction: out + segmentCount: 1 + channel: RBM + session: + canInitiate: true + sessionStartedCallbackExample: + summary: An example of a session-started callback body. + value: + type: session-started + time: '2026-08-06T10:00:00.123000Z' + description: Message is now part of an RCS interactive session. + to: '+12345678902' + message: + id: 1786010395000kw2fuqty55yp2b2 + owner: BandwidthRBM + applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 + time: '2026-08-06T10:00:00.120000Z' + segmentCount: 1 + direction: out + to: + - '+12345678902' + from: BandwidthRBM + text: '' + tag: '' + channel: RBM + session: + canInitiate: false + id: 0f5a3b9c-2d4e-4f6a-8b1c-7e9d0a2b3c4d + type: INTERACTIVE_SESSION + startTime: '2026-08-06T09:59:55Z' + endTime: '2026-08-07T09:59:55Z' messageFailedCallbackExample: summary: An example of a message-failed callback body. value: @@ -9980,6 +10181,9 @@ components: $ref: '#/components/examples/smsMessageReceivedCallbackExample' mmsMessageReceivedCallback: $ref: '#/components/examples/mmsMessageReceivedCallbackExample' + rbmMessageReceivedSessionCallback: + $ref: >- + #/components/examples/rbmMessageReceivedSessionCallbackExample responses: '200': description: OK @@ -9995,8 +10199,9 @@ components: information regarding a message sent (MT) from your message-enabled Bandwidth telephone number. -

The payload type will be one of message-sending, message-sent, message-delivered, message-failed or message-read. -

Note that message-read callbacks are pertinent only for RBM messages sent from the /messages/multiChannel endpoint. +

The payload type will be one of message-sending, message-sent, message-delivered, message-failed, message-read or session-started. +

Note that message-read and session-started callbacks are pertinent only for RBM messages sent from the /messages/multiChannel endpoint. +

Note that session-started callbacks are pertinent only for RBM messages of agents with the Conversational billing category.

Please visit Webhooks

content: @@ -10015,8 +10220,16 @@ components: groupMmsMessageDeliveredCallback: $ref: >- #/components/examples/groupMmsMessageDeliveredCallbackExample + rbmMessageDeliveredSessionCallback: + $ref: >- + #/components/examples/rbmMessageDeliveredSessionCallbackExample + rbmMessageDeliveredCanInitiateSessionCallback: + $ref: >- + #/components/examples/rbmMessageDeliveredCanInitiateSessionCallbackExample messageFailedCallback: $ref: '#/components/examples/messageFailedCallbackExample' + sessionStartedCallback: + $ref: '#/components/examples/sessionStartedCallbackExample' responses: '200': description: OK diff --git a/docs/DisconnectCallback.md b/docs/DisconnectCallback.md index 2ba585b..29c5c5e 100644 --- a/docs/DisconnectCallback.md +++ b/docs/DisconnectCallback.md @@ -24,7 +24,9 @@ Name | Type | Description | Notes **errorId** | **string** | Bandwidth\'s internal id that references the error event. | [optional] [default to undefined] **tag** | **string** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] [default to undefined] **sipCallId** | **string** | (optional) The SIP Call-ID of the call\'s current SIP dialog with Bandwidth\'s SBC. Used to correlate dialogs and trace calls. 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. | [optional] [default to undefined] -**sipResponseCode** | **number** | (optional) The SIP status code returned by Bandwidth\'s SBC when it rejected an outbound call\'s INVITE (e.g. 486 for busy, 603 for decline). Present only when an outbound call was rejected by the SBC. | [optional] [default to undefined] +**sipResponseCode** | **number** | (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. | [optional] [default to undefined] +**sipStatusLine** | **string** | (optional) The full SIP status line, exactly as received, of the final response that rejected an outbound call\'s INVITE. The reason phrase can help distinguish outcomes that share a status code, such as `603 Network Blocked` and `603 Decline`. Present only when an outbound call was rejected with a SIP response. | [optional] [default to undefined] +**sipHeaders** | **{ [key: string]: string; }** | (optional) Map of SIP headers, with lowercase keys (SIP headers are case-insensitive). On the Initiate callback, contains the customer-supplied X-* headers from the original INVITE; present only for inbound SIP URI calls with custom headers. On the Disconnect and Transfer Disconnect callbacks, contains a single `reason` key holding the raw, unmodified `Reason` header value from the final SIP response that rejected an outbound call (or transferred leg); present only when that response included a `Reason` header (for example, `v=analytics1` 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 `, `. Note - on the Initiate callback, keys preserve the original SIP header name in lowercase rather than Bandwidth\'s usual camelCase JSON convention, since these are passthrough values from the caller\'s SIP INVITE, not Bandwidth-defined fields. If the same header name is sent more than once in the INVITE, only the last value is kept. The example shown is for the Initiate callback; on the Disconnect and Transfer Disconnect callbacks the only key is `reason`. | [optional] [default to undefined] ## Example @@ -51,6 +53,8 @@ const instance: DisconnectCallback = { tag, sipCallId, sipResponseCode, + sipStatusLine, + sipHeaders, }; ``` diff --git a/docs/InboundCallbackMessage.md b/docs/InboundCallbackMessage.md index 8f4c90f..090f10c 100644 --- a/docs/InboundCallbackMessage.md +++ b/docs/InboundCallbackMessage.md @@ -18,6 +18,7 @@ Name | Type | Description | Notes **media** | **Array<string>** | Optional media, not applicable for sms | [optional] [default to undefined] **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] [default to undefined] **channel** | [**MultiChannelMessageChannelEnum**](MultiChannelMessageChannelEnum.md) | | [optional] [default to undefined] +**session** | [**RbmSession**](RbmSession.md) | | [optional] [default to undefined] **content** | [**MultiChannelMessageContent**](MultiChannelMessageContent.md) | | [optional] [default to undefined] **suggestionResponse** | [**RbmSuggestionResponse**](RbmSuggestionResponse.md) | | [optional] [default to undefined] **locationResponse** | [**RbmLocationResponse**](RbmLocationResponse.md) | | [optional] [default to undefined] @@ -41,6 +42,7 @@ const instance: InboundCallbackMessage = { media, priority, channel, + session, content, suggestionResponse, locationResponse, diff --git a/docs/InitiateCallback.md b/docs/InitiateCallback.md index 9f53506..e509b2d 100644 --- a/docs/InitiateCallback.md +++ b/docs/InitiateCallback.md @@ -20,7 +20,7 @@ Name | Type | Description | Notes **stirShaken** | [**StirShaken**](StirShaken.md) | | [optional] [default to undefined] **uui** | **string** | The value of the `User-To-User` header to send within the initial `INVITE`. Must include the encoding parameter as specified in RFC 7433. Only `base64`, `jwt` and `hex` encoding are currently allowed. This value, including the encoding specifier, may not exceed 256 characters. | [optional] [default to undefined] **sipCallId** | **string** | (optional) The SIP Call-ID of the call\'s current SIP dialog with Bandwidth\'s SBC. Used to correlate dialogs and trace calls. 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. | [optional] [default to undefined] -**sipHeaders** | **{ [key: string]: string; }** | (optional) Map of customer-supplied X-* headers from the original INVITE. Keys are lowercase (SIP headers are case-insensitive). Present only for inbound SIP URI calls with custom headers. Note - keys preserve the original SIP header name in lowercase rather than Bandwidth\'s usual camelCase JSON convention, since these are passthrough values from the caller\'s SIP INVITE, not Bandwidth-defined fields. If the same header name is sent more than once in the INVITE, only the last value is kept. | [optional] [default to undefined] +**sipHeaders** | **{ [key: string]: string; }** | (optional) Map of SIP headers, with lowercase keys (SIP headers are case-insensitive). On the Initiate callback, contains the customer-supplied X-* headers from the original INVITE; present only for inbound SIP URI calls with custom headers. On the Disconnect and Transfer Disconnect callbacks, contains a single `reason` key holding the raw, unmodified `Reason` header value from the final SIP response that rejected an outbound call (or transferred leg); present only when that response included a `Reason` header (for example, `v=analytics1` 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 `, `. Note - on the Initiate callback, keys preserve the original SIP header name in lowercase rather than Bandwidth\'s usual camelCase JSON convention, since these are passthrough values from the caller\'s SIP INVITE, not Bandwidth-defined fields. If the same header name is sent more than once in the INVITE, only the last value is kept. The example shown is for the Initiate callback; on the Disconnect and Transfer Disconnect callbacks the only key is `reason`. | [optional] [default to undefined] ## Example diff --git a/docs/MultiChannelAction.md b/docs/MultiChannelAction.md index 5d9e4b1..ab86686 100644 --- a/docs/MultiChannelAction.md +++ b/docs/MultiChannelAction.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | [**RbmActionTypeEnum**](RbmActionTypeEnum.md) | | [default to undefined] **text** | **string** | Displayed text for user to click | [default to undefined] -**postbackData** | **string** | Base64 payload the customer receives when the reply is clicked. | [default to undefined] +**postbackData** | **string** | Payload the customer receives when the reply is clicked. | [default to undefined] **phoneNumber** | **string** | The phone number to dial. Must be E164 format. | [default to undefined] **latitude** | **number** | The latitude of the location. Must be in range [-90.000000, 90.000000]. | [default to undefined] **longitude** | **number** | The longitude of the location. Must be in range [-180.000000, 180.000000]. | [default to undefined] diff --git a/docs/MultiChannelActionCalendarEvent.md b/docs/MultiChannelActionCalendarEvent.md index 372c968..3b268d8 100644 --- a/docs/MultiChannelActionCalendarEvent.md +++ b/docs/MultiChannelActionCalendarEvent.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | [**RbmActionTypeEnum**](RbmActionTypeEnum.md) | | [default to undefined] **text** | **string** | Displayed text for user to click | [default to undefined] -**postbackData** | **string** | Base64 payload the customer receives when the reply is clicked. | [default to undefined] +**postbackData** | **string** | Payload the customer receives when the reply is clicked. | [default to undefined] **title** | **string** | The title of the event. | [default to undefined] **startTime** | **string** | The start time of the event. Must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. | [default to undefined] **endTime** | **string** | The end time of the event. Must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. | [default to undefined] diff --git a/docs/RbmActionBase.md b/docs/RbmActionBase.md index 7a5d8f8..2b603b2 100644 --- a/docs/RbmActionBase.md +++ b/docs/RbmActionBase.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | [**RbmActionTypeEnum**](RbmActionTypeEnum.md) | | [default to undefined] **text** | **string** | Displayed text for user to click | [default to undefined] -**postbackData** | **string** | Base64 payload the customer receives when the reply is clicked. | [default to undefined] +**postbackData** | **string** | Payload the customer receives when the reply is clicked. | [default to undefined] ## Example diff --git a/docs/RbmActionDial.md b/docs/RbmActionDial.md index 334cbc7..1d5ea17 100644 --- a/docs/RbmActionDial.md +++ b/docs/RbmActionDial.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | [**RbmActionTypeEnum**](RbmActionTypeEnum.md) | | [default to undefined] **text** | **string** | Displayed text for user to click | [default to undefined] -**postbackData** | **string** | Base64 payload the customer receives when the reply is clicked. | [default to undefined] +**postbackData** | **string** | Payload the customer receives when the reply is clicked. | [default to undefined] **phoneNumber** | **string** | The phone number to dial. Must be E164 format. | [default to undefined] ## Example diff --git a/docs/RbmActionOpenUrl.md b/docs/RbmActionOpenUrl.md index 112070a..a247ff5 100644 --- a/docs/RbmActionOpenUrl.md +++ b/docs/RbmActionOpenUrl.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | [**RbmActionTypeEnum**](RbmActionTypeEnum.md) | | [default to undefined] **text** | **string** | Displayed text for user to click | [default to undefined] -**postbackData** | **string** | Base64 payload the customer receives when the reply is clicked. | [default to undefined] +**postbackData** | **string** | Payload the customer receives when the reply is clicked. | [default to undefined] **url** | **string** | The URL to open in browser. Must use http:// or https:// scheme. | [default to undefined] **application** | [**RbmOpenUrlEnum**](RbmOpenUrlEnum.md) | | [optional] [default to undefined] **webviewViewMode** | [**RbmWebViewEnum**](RbmWebViewEnum.md) | | [optional] [default to undefined] diff --git a/docs/RbmActionViewLocation.md b/docs/RbmActionViewLocation.md index e88c044..28b1835 100644 --- a/docs/RbmActionViewLocation.md +++ b/docs/RbmActionViewLocation.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | [**RbmActionTypeEnum**](RbmActionTypeEnum.md) | | [default to undefined] **text** | **string** | Displayed text for user to click | [default to undefined] -**postbackData** | **string** | Base64 payload the customer receives when the reply is clicked. | [default to undefined] +**postbackData** | **string** | Payload the customer receives when the reply is clicked. | [default to undefined] **latitude** | **number** | The latitude of the location. Must be in range [-90.000000, 90.000000]. | [default to undefined] **longitude** | **number** | The longitude of the location. Must be in range [-180.000000, 180.000000]. | [default to undefined] **label** | **string** | The label of the location. | [optional] [default to undefined] diff --git a/docs/RbmSession.md b/docs/RbmSession.md new file mode 100644 index 0000000..87305bb --- /dev/null +++ b/docs/RbmSession.md @@ -0,0 +1,29 @@ +# RbmSession + +RCS interactive session information for the message. An interactive session is a 24-hour window covering all Rich and Rich Media messages exchanged between an RCS agent and a specific end user mobile number. It is triggered when at least 4 messages are exchanged within 24 hours, at least 2 of them mobile-originated and at least 1 mobile-terminated. Only present on `message-delivered`, `message-received` and `session-started` callbacks for RBM messages of US agents with the Conversational billing category. Omitted for all other messages. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**canInitiate** | **boolean** | Whether the message can start an interactive session. `false` if the message is already part of an active session, or if the agent is not eligible for interactive session billing. | [default to undefined] +**id** | **string** | The unique identifier of the interactive session the message is part of. This is not a message ID. Omitted if the message is not part of a session. | [optional] [default to undefined] +**type** | **string** | The type of the interactive session. Only present on `session-started` callbacks. | [optional] [default to undefined] +**startTime** | **string** | The time the 24-hour session window opened. Only present on `session-started` callbacks. | [optional] [default to undefined] +**endTime** | **string** | The time the 24-hour session window closes. Only present on `session-started` callbacks. | [optional] [default to undefined] + +## Example + +```typescript +import { RbmSession } from 'bandwidth-sdk'; + +const instance: RbmSession = { + canInitiate, + id, + type, + startTime, + endTime, +}; +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/RbmSuggestionResponse.md b/docs/RbmSuggestionResponse.md index 79d9ee8..a50cbbc 100644 --- a/docs/RbmSuggestionResponse.md +++ b/docs/RbmSuggestionResponse.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**text** | **string** | The text associated with the suggestion response. | [optional] [default to undefined] -**postbackData** | **string** | Base64 payload the customer receives when the reply is clicked. | [optional] [default to undefined] +**text** | **string** | The text of the suggestion the user tapped. | [optional] [default to undefined] +**postbackData** | **string** | Payload the customer receives when the reply is clicked. | [optional] [default to undefined] **pairedMessageId** | **string** | Corresponding parent message ID (MT). | [optional] [default to undefined] ## Example diff --git a/docs/StatusCallbackMessage.md b/docs/StatusCallbackMessage.md index d0b04c3..7a0bae6 100644 --- a/docs/StatusCallbackMessage.md +++ b/docs/StatusCallbackMessage.md @@ -19,6 +19,7 @@ Name | Type | Description | Notes **media** | **Array<string>** | Optional media, not applicable for sms | [optional] [default to undefined] **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] [default to undefined] **channel** | [**MultiChannelMessageChannelEnum**](MultiChannelMessageChannelEnum.md) | | [optional] [default to undefined] +**session** | [**RbmSession**](RbmSession.md) | | [optional] [default to undefined] ## Example @@ -39,6 +40,7 @@ const instance: StatusCallbackMessage = { media, priority, channel, + session, }; ``` diff --git a/docs/StatusCallbackTypeEnum.md b/docs/StatusCallbackTypeEnum.md index e7ad89a..f41ee8c 100644 --- a/docs/StatusCallbackTypeEnum.md +++ b/docs/StatusCallbackTypeEnum.md @@ -1,6 +1,6 @@ # StatusCallbackTypeEnum -The possible status callbacks when sending an MT SMS or MMS or RBM message: - `message-sending` indicates that Bandwidth is sending the message to the upstream provider. - `message-sent` indicates that the message has left the Bandwidth network and is in transit to the provider. - `message-delivered` indicates that the message was successfully delivered to handset. - `message-failed` indicates that the message could not be sent to the intended recipient. - `message-read` indicates that the RBM message was read by the recipient. +The possible status callbacks when sending an MT SMS or MMS or RBM message: - `message-sending` indicates that Bandwidth is sending the message to the upstream provider. - `message-sent` indicates that the message has left the Bandwidth network and is in transit to the provider. - `message-delivered` indicates that the message was successfully delivered to handset. - `message-failed` indicates that the message could not be sent to the intended recipient. - `message-read` indicates that the RBM message was read by the recipient. - `session-started` indicates that a previously exchanged RBM message is now part of an RCS interactive session and is no longer billed individually. ## Enum @@ -14,4 +14,6 @@ The possible status callbacks when sending an MT SMS or MMS or RBM message: - `m * `MessageRead` (value: `'message-read'`) +* `SessionStarted` (value: `'session-started'`) + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/TransferDisconnectCallback.md b/docs/TransferDisconnectCallback.md index b39dccd..0a11c4e 100644 --- a/docs/TransferDisconnectCallback.md +++ b/docs/TransferDisconnectCallback.md @@ -26,6 +26,9 @@ Name | Type | Description | Notes **cause** | **string** | Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown. | [optional] [default to undefined] **errorMessage** | **string** | Text explaining the reason that caused the call to fail in case of errors. | [optional] [default to undefined] **errorId** | **string** | Bandwidth\'s internal id that references the error event. | [optional] [default to undefined] +**sipResponseCode** | **number** | (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. | [optional] [default to undefined] +**sipStatusLine** | **string** | (optional) The full SIP status line, exactly as received, of the final response that rejected an outbound call\'s INVITE. The reason phrase can help distinguish outcomes that share a status code, such as `603 Network Blocked` and `603 Decline`. Present only when an outbound call was rejected with a SIP response. | [optional] [default to undefined] +**sipHeaders** | **{ [key: string]: string; }** | (optional) Map of SIP headers, with lowercase keys (SIP headers are case-insensitive). On the Initiate callback, contains the customer-supplied X-* headers from the original INVITE; present only for inbound SIP URI calls with custom headers. On the Disconnect and Transfer Disconnect callbacks, contains a single `reason` key holding the raw, unmodified `Reason` header value from the final SIP response that rejected an outbound call (or transferred leg); present only when that response included a `Reason` header (for example, `v=analytics1` 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 `, `. Note - on the Initiate callback, keys preserve the original SIP header name in lowercase rather than Bandwidth\'s usual camelCase JSON convention, since these are passthrough values from the caller\'s SIP INVITE, not Bandwidth-defined fields. If the same header name is sent more than once in the INVITE, only the last value is kept. The example shown is for the Initiate callback; on the Disconnect and Transfer Disconnect callbacks the only key is `reason`. | [optional] [default to undefined] ## Example @@ -53,6 +56,9 @@ const instance: TransferDisconnectCallback = { cause, errorMessage, errorId, + sipResponseCode, + sipStatusLine, + sipHeaders, }; ``` diff --git a/models/callback.ts b/models/callback.ts index eda1a69..bc193d2 100644 --- a/models/callback.ts +++ b/models/callback.ts @@ -30,6 +30,6 @@ import type { StatusCallback } from './status-callback'; * @type Callback * Callbacks are divided into two types based on direction of the related message: - `statusCallback` indicates status of an outbound MT SMS, MMS, or RBM message. - `inboundCallback` indicates an inbound MO message or a multichannel message client\'s response to a suggestion or location request. */ -export type Callback = { type: 'message-delivered' } & StatusCallback | { type: 'message-failed' } & StatusCallback | { type: 'message-read' } & StatusCallback | { type: 'message-received' } & InboundCallback | { type: 'message-sending' } & StatusCallback | { type: 'message-sent' } & StatusCallback | { type: 'requested-location-response' } & InboundCallback | { type: 'suggestion-response' } & InboundCallback; +export type Callback = { type: 'message-delivered' } & StatusCallback | { type: 'message-failed' } & StatusCallback | { type: 'message-read' } & StatusCallback | { type: 'message-received' } & InboundCallback | { type: 'message-sending' } & StatusCallback | { type: 'message-sent' } & StatusCallback | { type: 'requested-location-response' } & InboundCallback | { type: 'session-started' } & StatusCallback | { type: 'suggestion-response' } & InboundCallback; diff --git a/models/disconnect-callback.ts b/models/disconnect-callback.ts index 80790f8..6a4ac22 100644 --- a/models/disconnect-callback.ts +++ b/models/disconnect-callback.ts @@ -91,9 +91,17 @@ export interface DisconnectCallback { */ 'sipCallId'?: string; /** - * (optional) The SIP status code returned by Bandwidth\'s SBC when it rejected an outbound call\'s INVITE (e.g. 486 for busy, 603 for decline). Present only when an outbound call was rejected by the SBC. + * (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. */ 'sipResponseCode'?: number; + /** + * (optional) The full SIP status line, exactly as received, of the final response that rejected an outbound call\'s INVITE. The reason phrase can help distinguish outcomes that share a status code, such as `603 Network Blocked` and `603 Decline`. Present only when an outbound call was rejected with a SIP response. + */ + 'sipStatusLine'?: string; + /** + * (optional) Map of SIP headers, with lowercase keys (SIP headers are case-insensitive). On the Initiate callback, contains the customer-supplied X-* headers from the original INVITE; present only for inbound SIP URI calls with custom headers. On the Disconnect and Transfer Disconnect callbacks, contains a single `reason` key holding the raw, unmodified `Reason` header value from the final SIP response that rejected an outbound call (or transferred leg); present only when that response included a `Reason` header (for example, `v=analytics1` 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 `, `. Note - on the Initiate callback, keys preserve the original SIP header name in lowercase rather than Bandwidth\'s usual camelCase JSON convention, since these are passthrough values from the caller\'s SIP INVITE, not Bandwidth-defined fields. If the same header name is sent more than once in the INVITE, only the last value is kept. The example shown is for the Initiate callback; on the Disconnect and Transfer Disconnect callbacks the only key is `reason`. + */ + 'sipHeaders'?: { [key: string]: string; }; } diff --git a/models/inbound-callback-message.ts b/models/inbound-callback-message.ts index b56b57b..15ea0f0 100644 --- a/models/inbound-callback-message.ts +++ b/models/inbound-callback-message.ts @@ -30,6 +30,9 @@ import type { PriorityEnum } from './priority-enum'; import type { RbmLocationResponse } from './rbm-location-response'; // May contain unused imports in some cases // @ts-ignore +import type { RbmSession } from './rbm-session'; +// May contain unused imports in some cases +// @ts-ignore import type { RbmSuggestionResponse } from './rbm-suggestion-response'; // May contain unused imports in some cases // @ts-ignore @@ -76,6 +79,7 @@ export interface InboundCallbackMessage { 'media'?: Array; 'priority'?: PriorityEnum; 'channel'?: MultiChannelMessageChannelEnum; + 'session'?: RbmSession; 'content'?: MultiChannelMessageContent; 'suggestionResponse'?: RbmSuggestionResponse; 'locationResponse'?: RbmLocationResponse; diff --git a/models/index.ts b/models/index.ts index 2a926de..5a68669 100644 --- a/models/index.ts +++ b/models/index.ts @@ -144,6 +144,7 @@ export * from './rbm-message-content-rich-card'; export * from './rbm-message-content-text'; export * from './rbm-message-media'; export * from './rbm-open-url-enum'; +export * from './rbm-session'; export * from './rbm-standalone-card'; export * from './rbm-suggestion-response'; export * from './rbm-web-view-enum'; diff --git a/models/initiate-callback.ts b/models/initiate-callback.ts index 72d031e..70e7848 100644 --- a/models/initiate-callback.ts +++ b/models/initiate-callback.ts @@ -75,7 +75,7 @@ export interface InitiateCallback { */ 'sipCallId'?: string; /** - * (optional) Map of customer-supplied X-* headers from the original INVITE. Keys are lowercase (SIP headers are case-insensitive). Present only for inbound SIP URI calls with custom headers. Note - keys preserve the original SIP header name in lowercase rather than Bandwidth\'s usual camelCase JSON convention, since these are passthrough values from the caller\'s SIP INVITE, not Bandwidth-defined fields. If the same header name is sent more than once in the INVITE, only the last value is kept. + * (optional) Map of SIP headers, with lowercase keys (SIP headers are case-insensitive). On the Initiate callback, contains the customer-supplied X-* headers from the original INVITE; present only for inbound SIP URI calls with custom headers. On the Disconnect and Transfer Disconnect callbacks, contains a single `reason` key holding the raw, unmodified `Reason` header value from the final SIP response that rejected an outbound call (or transferred leg); present only when that response included a `Reason` header (for example, `v=analytics1` 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 `, `. Note - on the Initiate callback, keys preserve the original SIP header name in lowercase rather than Bandwidth\'s usual camelCase JSON convention, since these are passthrough values from the caller\'s SIP INVITE, not Bandwidth-defined fields. If the same header name is sent more than once in the INVITE, only the last value is kept. The example shown is for the Initiate callback; on the Disconnect and Transfer Disconnect callbacks the only key is `reason`. */ 'sipHeaders'?: { [key: string]: string; }; } diff --git a/models/list-message-item.ts b/models/list-message-item.ts index 980737b..d1eab82 100644 --- a/models/list-message-item.ts +++ b/models/list-message-item.ts @@ -66,7 +66,7 @@ export interface ListMessageItem { /** * The length of the message content. */ - 'messageLength'?: number; + 'messageLength'?: number | null; /** * The number of attachments the message has. */ diff --git a/models/multi-channel-action-calendar-event.ts b/models/multi-channel-action-calendar-event.ts index 1ca5e90..905465e 100644 --- a/models/multi-channel-action-calendar-event.ts +++ b/models/multi-channel-action-calendar-event.ts @@ -30,7 +30,7 @@ export interface MultiChannelActionCalendarEvent { */ 'text': string; /** - * Base64 payload the customer receives when the reply is clicked. + * Payload the customer receives when the reply is clicked. */ 'postbackData': string; /** diff --git a/models/multi-channel-action.ts b/models/multi-channel-action.ts index fe7b201..caf7af1 100644 --- a/models/multi-channel-action.ts +++ b/models/multi-channel-action.ts @@ -45,7 +45,7 @@ export interface MultiChannelAction { */ 'text': string; /** - * Base64 payload the customer receives when the reply is clicked. + * Payload the customer receives when the reply is clicked. */ 'postbackData': string; /** diff --git a/models/rbm-action-base.ts b/models/rbm-action-base.ts index 5819d0c..741d3bf 100644 --- a/models/rbm-action-base.ts +++ b/models/rbm-action-base.ts @@ -24,7 +24,7 @@ export interface RbmActionBase { */ 'text': string; /** - * Base64 payload the customer receives when the reply is clicked. + * Payload the customer receives when the reply is clicked. */ 'postbackData': string; } diff --git a/models/rbm-action-dial.ts b/models/rbm-action-dial.ts index d292a21..5f640a2 100644 --- a/models/rbm-action-dial.ts +++ b/models/rbm-action-dial.ts @@ -30,7 +30,7 @@ export interface RbmActionDial { */ 'text': string; /** - * Base64 payload the customer receives when the reply is clicked. + * Payload the customer receives when the reply is clicked. */ 'postbackData': string; /** diff --git a/models/rbm-action-open-url.ts b/models/rbm-action-open-url.ts index d28784b..b6d65da 100644 --- a/models/rbm-action-open-url.ts +++ b/models/rbm-action-open-url.ts @@ -36,7 +36,7 @@ export interface RbmActionOpenUrl { */ 'text': string; /** - * Base64 payload the customer receives when the reply is clicked. + * Payload the customer receives when the reply is clicked. */ 'postbackData': string; /** diff --git a/models/rbm-action-view-location.ts b/models/rbm-action-view-location.ts index 766b681..9df9d55 100644 --- a/models/rbm-action-view-location.ts +++ b/models/rbm-action-view-location.ts @@ -30,7 +30,7 @@ export interface RbmActionViewLocation { */ 'text': string; /** - * Base64 payload the customer receives when the reply is clicked. + * Payload the customer receives when the reply is clicked. */ 'postbackData': string; /** diff --git a/models/rbm-session.ts b/models/rbm-session.ts new file mode 100644 index 0000000..d9c6bce --- /dev/null +++ b/models/rbm-session.ts @@ -0,0 +1,42 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bandwidth + * Bandwidth\'s Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * RCS interactive session information for the message. An interactive session is a 24-hour window covering all Rich and Rich Media messages exchanged between an RCS agent and a specific end user mobile number. It is triggered when at least 4 messages are exchanged within 24 hours, at least 2 of them mobile-originated and at least 1 mobile-terminated. Only present on `message-delivered`, `message-received` and `session-started` callbacks for RBM messages of US agents with the Conversational billing category. Omitted for all other messages. + */ +export interface RbmSession { + /** + * Whether the message can start an interactive session. `false` if the message is already part of an active session, or if the agent is not eligible for interactive session billing. + */ + 'canInitiate': boolean; + /** + * The unique identifier of the interactive session the message is part of. This is not a message ID. Omitted if the message is not part of a session. + */ + 'id'?: string | null; + /** + * The type of the interactive session. Only present on `session-started` callbacks. + */ + 'type'?: string | null; + /** + * The time the 24-hour session window opened. Only present on `session-started` callbacks. + */ + 'startTime'?: string | null; + /** + * The time the 24-hour session window closes. Only present on `session-started` callbacks. + */ + 'endTime'?: string | null; +} + diff --git a/models/rbm-suggestion-response.ts b/models/rbm-suggestion-response.ts index d062db2..47a9e37 100644 --- a/models/rbm-suggestion-response.ts +++ b/models/rbm-suggestion-response.ts @@ -16,11 +16,11 @@ export interface RbmSuggestionResponse { /** - * The text associated with the suggestion response. + * The text of the suggestion the user tapped. */ 'text'?: string; /** - * Base64 payload the customer receives when the reply is clicked. + * Payload the customer receives when the reply is clicked. */ 'postbackData'?: string; /** diff --git a/models/status-callback-message.ts b/models/status-callback-message.ts index 21a2816..1a2a925 100644 --- a/models/status-callback-message.ts +++ b/models/status-callback-message.ts @@ -22,6 +22,9 @@ import type { MultiChannelMessageChannelEnum } from './multi-channel-message-cha // May contain unused imports in some cases // @ts-ignore import type { PriorityEnum } from './priority-enum'; +// May contain unused imports in some cases +// @ts-ignore +import type { RbmSession } from './rbm-session'; /** * Message payload schema within a callback @@ -64,6 +67,7 @@ export interface StatusCallbackMessage { 'media'?: Array; 'priority'?: PriorityEnum; 'channel'?: MultiChannelMessageChannelEnum; + 'session'?: RbmSession; } diff --git a/models/status-callback-type-enum.ts b/models/status-callback-type-enum.ts index c628fa5..1ae6121 100644 --- a/models/status-callback-type-enum.ts +++ b/models/status-callback-type-enum.ts @@ -15,7 +15,7 @@ /** - * The possible status callbacks when sending an MT SMS or MMS or RBM message: - `message-sending` indicates that Bandwidth is sending the message to the upstream provider. - `message-sent` indicates that the message has left the Bandwidth network and is in transit to the provider. - `message-delivered` indicates that the message was successfully delivered to handset. - `message-failed` indicates that the message could not be sent to the intended recipient. - `message-read` indicates that the RBM message was read by the recipient. + * The possible status callbacks when sending an MT SMS or MMS or RBM message: - `message-sending` indicates that Bandwidth is sending the message to the upstream provider. - `message-sent` indicates that the message has left the Bandwidth network and is in transit to the provider. - `message-delivered` indicates that the message was successfully delivered to handset. - `message-failed` indicates that the message could not be sent to the intended recipient. - `message-read` indicates that the RBM message was read by the recipient. - `session-started` indicates that a previously exchanged RBM message is now part of an RCS interactive session and is no longer billed individually. */ export const StatusCallbackTypeEnum = { @@ -24,6 +24,7 @@ export const StatusCallbackTypeEnum = { MessageDelivered: 'message-delivered', MessageFailed: 'message-failed', MessageRead: 'message-read', + SessionStarted: 'session-started', } as const; export type StatusCallbackTypeEnum = typeof StatusCallbackTypeEnum[keyof typeof StatusCallbackTypeEnum]; diff --git a/models/transfer-disconnect-callback.ts b/models/transfer-disconnect-callback.ts index 37b5827..6277bc5 100644 --- a/models/transfer-disconnect-callback.ts +++ b/models/transfer-disconnect-callback.ts @@ -98,6 +98,18 @@ export interface TransferDisconnectCallback { * Bandwidth\'s internal id that references the error event. */ 'errorId'?: string | null; + /** + * (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. + */ + 'sipResponseCode'?: number; + /** + * (optional) The full SIP status line, exactly as received, of the final response that rejected an outbound call\'s INVITE. The reason phrase can help distinguish outcomes that share a status code, such as `603 Network Blocked` and `603 Decline`. Present only when an outbound call was rejected with a SIP response. + */ + 'sipStatusLine'?: string; + /** + * (optional) Map of SIP headers, with lowercase keys (SIP headers are case-insensitive). On the Initiate callback, contains the customer-supplied X-* headers from the original INVITE; present only for inbound SIP URI calls with custom headers. On the Disconnect and Transfer Disconnect callbacks, contains a single `reason` key holding the raw, unmodified `Reason` header value from the final SIP response that rejected an outbound call (or transferred leg); present only when that response included a `Reason` header (for example, `v=analytics1` 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 `, `. Note - on the Initiate callback, keys preserve the original SIP header name in lowercase rather than Bandwidth\'s usual camelCase JSON convention, since these are passthrough values from the caller\'s SIP INVITE, not Bandwidth-defined fields. If the same header name is sent more than once in the INVITE, only the last value is kept. The example shown is for the Initiate callback; on the Disconnect and Transfer Disconnect callbacks the only key is `reason`. + */ + 'sipHeaders'?: { [key: string]: string; }; } From e5c44879d85959baab047caab7232f11e7f10b35 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Tue, 3 Nov 2026 13:09:19 -0500 Subject: [PATCH 2/2] update unit tests --- tests/unit/models/disconnect-callback.test.ts | 4 ++++ .../models/inbound-callback-message.test.ts | 3 +++ tests/unit/models/rbm-session.test.ts | 19 +++++++++++++++++++ .../models/status-callback-message.test.ts | 3 +++ .../models/status-callback-type-enum.test.ts | 4 +++- .../transfer-disconnect-callback.test.ts | 6 ++++++ 6 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 tests/unit/models/rbm-session.test.ts diff --git a/tests/unit/models/disconnect-callback.test.ts b/tests/unit/models/disconnect-callback.test.ts index 51a2b8b..b564613 100644 --- a/tests/unit/models/disconnect-callback.test.ts +++ b/tests/unit/models/disconnect-callback.test.ts @@ -23,6 +23,8 @@ describe('DisconnectCallback', () => { tag: 'test-tag', sipCallId: 'test-sipCallId', sipResponseCode: 200, + sipStatusLine: 'test-sipStatusLine', + sipHeaders: { reason: 'test-reason' }, }; expect(fixture.eventType).toBe('test-eventType'); @@ -44,5 +46,7 @@ describe('DisconnectCallback', () => { expect(fixture.tag).toBe('test-tag'); expect(fixture.sipCallId).toBe('test-sipCallId'); expect(fixture.sipResponseCode).toBe(200); + expect(fixture.sipStatusLine).toBe('test-sipStatusLine'); + expect(fixture.sipHeaders).toEqual({ reason: 'test-reason' }); }); }); diff --git a/tests/unit/models/inbound-callback-message.test.ts b/tests/unit/models/inbound-callback-message.test.ts index 2be69ce..598b254 100644 --- a/tests/unit/models/inbound-callback-message.test.ts +++ b/tests/unit/models/inbound-callback-message.test.ts @@ -2,6 +2,7 @@ import { InboundCallbackMessage } from '../../../models/inbound-callback-message import { MessageDirectionEnum } from '../../../models/message-direction-enum'; import { PriorityEnum } from '../../../models/priority-enum'; import { MultiChannelMessageChannelEnum } from '../../../models/multi-channel-message-channel-enum'; +import { RbmSession } from '../../../models/rbm-session'; import { MultiChannelMessageContent } from '../../../models/multi-channel-message-content'; import { RbmSuggestionResponse } from '../../../models/rbm-suggestion-response'; import { RbmLocationResponse } from '../../../models/rbm-location-response'; @@ -23,6 +24,7 @@ describe('InboundCallbackMessage', () => { media: [], priority: PriorityEnum.Default, channel: MultiChannelMessageChannelEnum.Rbm, + session: {} as unknown as RbmSession, content: {} as unknown as MultiChannelMessageContent, suggestionResponse: {} as unknown as RbmSuggestionResponse, locationResponse: {} as unknown as RbmLocationResponse, @@ -41,6 +43,7 @@ describe('InboundCallbackMessage', () => { expect(fixture.media).toEqual([]); expect(fixture.priority).toBe(PriorityEnum.Default); expect(fixture.channel).toBe(MultiChannelMessageChannelEnum.Rbm); + expect(fixture.session).toBeDefined(); expect(fixture.content).toBeDefined(); expect(fixture.suggestionResponse).toBeDefined(); expect(fixture.locationResponse).toBeDefined(); diff --git a/tests/unit/models/rbm-session.test.ts b/tests/unit/models/rbm-session.test.ts new file mode 100644 index 0000000..8b100d7 --- /dev/null +++ b/tests/unit/models/rbm-session.test.ts @@ -0,0 +1,19 @@ +import { RbmSession } from '../../../models/rbm-session'; + +describe('RbmSession', () => { + test('should accept the expected shape', () => { + const fixture: RbmSession = { + canInitiate: true, + id: 'test-id', + type: 'test-type', + startTime: 'test-startTime', + endTime: 'test-endTime', + }; + + expect(fixture.canInitiate).toBe(true); + expect(fixture.id).toBe('test-id'); + expect(fixture.type).toBe('test-type'); + expect(fixture.startTime).toBe('test-startTime'); + expect(fixture.endTime).toBe('test-endTime'); + }); +}); diff --git a/tests/unit/models/status-callback-message.test.ts b/tests/unit/models/status-callback-message.test.ts index 1d32800..4c45692 100644 --- a/tests/unit/models/status-callback-message.test.ts +++ b/tests/unit/models/status-callback-message.test.ts @@ -2,6 +2,7 @@ import { StatusCallbackMessage } from '../../../models/status-callback-message'; import { MessageDirectionEnum } from '../../../models/message-direction-enum'; import { PriorityEnum } from '../../../models/priority-enum'; import { MultiChannelMessageChannelEnum } from '../../../models/multi-channel-message-channel-enum'; +import { RbmSession } from '../../../models/rbm-session'; describe('StatusCallbackMessage', () => { test('should accept the expected shape', () => { @@ -20,6 +21,7 @@ describe('StatusCallbackMessage', () => { media: [], priority: PriorityEnum.Default, channel: MultiChannelMessageChannelEnum.Rbm, + session: {} as unknown as RbmSession, }; expect(fixture.id).toBe('test-id'); @@ -35,5 +37,6 @@ describe('StatusCallbackMessage', () => { expect(fixture.media).toEqual([]); expect(fixture.priority).toBe(PriorityEnum.Default); expect(fixture.channel).toBe(MultiChannelMessageChannelEnum.Rbm); + expect(fixture.session).toBeDefined(); }); }); diff --git a/tests/unit/models/status-callback-type-enum.test.ts b/tests/unit/models/status-callback-type-enum.test.ts index 806bb62..20b5df7 100644 --- a/tests/unit/models/status-callback-type-enum.test.ts +++ b/tests/unit/models/status-callback-type-enum.test.ts @@ -7,12 +7,14 @@ describe('StatusCallbackTypeEnum', () => { expect(StatusCallbackTypeEnum.MessageDelivered).toBe('message-delivered'); expect(StatusCallbackTypeEnum.MessageFailed).toBe('message-failed'); expect(StatusCallbackTypeEnum.MessageRead).toBe('message-read'); + expect(StatusCallbackTypeEnum.SessionStarted).toBe('session-started'); expect(Object.values(StatusCallbackTypeEnum)).toEqual([ 'message-sending', 'message-sent', 'message-delivered', 'message-failed', - 'message-read' + 'message-read', + 'session-started' ]); }); }); diff --git a/tests/unit/models/transfer-disconnect-callback.test.ts b/tests/unit/models/transfer-disconnect-callback.test.ts index 20a879b..8cbde1f 100644 --- a/tests/unit/models/transfer-disconnect-callback.test.ts +++ b/tests/unit/models/transfer-disconnect-callback.test.ts @@ -24,6 +24,9 @@ describe('TransferDisconnectCallback', () => { cause: 'test-cause', errorMessage: 'test-errorMessage', errorId: 'test-errorId', + sipResponseCode: 200, + sipStatusLine: 'test-sipStatusLine', + sipHeaders: { reason: 'test-reason' }, }; expect(fixture.eventType).toBe('test-eventType'); @@ -46,5 +49,8 @@ describe('TransferDisconnectCallback', () => { expect(fixture.cause).toBe('test-cause'); expect(fixture.errorMessage).toBe('test-errorMessage'); expect(fixture.errorId).toBe('test-errorId'); + expect(fixture.sipResponseCode).toBe(200); + expect(fixture.sipStatusLine).toBe('test-sipStatusLine'); + expect(fixture.sipHeaders).toEqual({ reason: 'test-reason' }); }); });