Universal events are required for all RTMS implementations. They handle the connection handshake protocol, keep-alive operations, session and stream state management, and media data delivery.
Message transmission channels
RTMS events are transmitted through two connection types established during the handshake process.
| Signaling connection | Media connection |
|---|---|
SIGNALING_HAND_SHAKE_REQSIGNALING_HAND_SHAKE_RESPDATA_HAND_SHAKE_REQDATA_HAND_SHAKE_RESPEVENT_SUBSCRIPTIONEVENT_UPDATECLIENT_READY_ACKSTREAM_STATE_UPDATESESSION_STATE_UPDATESESSION_STATE_REQSESSION_STATE_RESPKEEP_ALIVE_REQKEEP_ALIVE_RESPSTREAM_STATE_REQSTREAM_STATE_RESPSTREAM_CLOSE_REQSTREAM_CLOSE_RESPVIDEO_SUBSCRIPTION_REQVIDEO_SUBSCRIPTION_RESP | KEEP_ALIVE_RESPMEDIA_DATA_AUDIOMEDIA_DATA_VIDEOMEDIA_DATA_SHAREMEDIA_DATA_TRANSCRIPTMEDIA_DATA_CHAT |
Both the signaling and media connections are WebSocket connections. They must use TLS 1.2 or 1.3. For details, see TLS requirements.
TLS requirements
RTMS requires TLS 1.2 or 1.3 on all WebSocket connections across all products. Connections that use an older TLS version are rejected during the TLS handshake. The requirement applies only to WebSocket connections. SRT media streams aren't affected.
Make sure your connection requests use TLS 1.2 or 1.3.
Supported cipher suites
These cipher suites are supported for each TLS version.
TLS 1.2
ECDHE-RSA-AES256-GCM-SHA384
DHE-RSA-AES256-GCM-SHA384
ECDHE-RSA-CHACHA20-POLY1305
DHE-RSA-CHACHA20-POLY1305
ECDHE-RSA-AES128-GCM-SHA256
DHE-RSA-AES128-GCM-SHA256
TLS 1.3
TLS_AES_256_GCM_SHA384
TLS_AES_128_GCM_SHA256
TLS_CHACHA20_POLY1305_SHA256
Protocol versions
The signaling handshake selects the protocol version for the stream. The media (data) handshake uses the version that the signaling handshake selected. Signaling and data connections must use the same message format.
| Signaling request | Selected version |
|---|---|
protocol_version missing or below 2 | V1 |
protocol_version 2 or higher | V2 |
The following table compares the features available in each version. A dash (—) means the version doesn't support the feature.
| Feature | V1 | V2 |
|---|---|---|
| Event identifier | event_type | event_code |
| Protobuf framing | — | Available |
media_type 32 (all) | Permitted | Rejected with status 48 |
| Multiple individual video | Requires V2, response status 49 | Available when enabled |
| SRT passphrase | — | Returned when an SRT URL is configured |
| Payload encryption | — | Negotiated with payload_encryptions |
| Payload key mode | — | 1 per-media derived (default), 2 direct master key |
Video and screen share codec PNG | Available | Not available. Use JPG or H.264. |
SRT transport and application-layer payload encryption are independent. A V2 response can include an SRT passphrase with payload encryption disabled, or enable payload encryption without an SRT endpoint.
Signaling handshake request
Sent to the signaling connectionSend a signed handshake request to the server_urls provided in the meeting.rtms_started event, also known as the signaling connection. Use your app credentials with the session details to generate the signature. For more information, see App establishes signaling connection.
{
"msg_type": 1,
"protocol_version": 2,
"sequence": 1,
"meeting_uuid": "xxxxxxxxxx",
"rtms_stream_id": "xxxxxxxxxx",
"signature": "xxxxxxxxxx",
"buffer_data": false
}
To enable payload encryption, add media_payload_key_mode and payload_encryptions. Each encryption offer includes a PEM-encoded public key.
{
"msg_type": 1,
"protocol_version": 2,
"sequence": 1,
"meeting_uuid": "xxxxxxxxxx",
"rtms_stream_id": "xxxxxxxxxx",
"signature": "xxxxxxxxxx",
"media_payload_key_mode": 1,
"payload_encryptions": [
{
"key_wrap_algorithm": 10,
"payload_encryption_algorithm": 1,
"public_key": "-----BEGIN PUBLIC KEY-----\n...\n-----END PUBLIC KEY-----\n",
"key_id": "client-key-1"
}
]
}
{
"msg_type": 1,
"protocol_version": 1,
"sequence": 1,
"meeting_uuid": "xxxxxxxxxx",
"rtms_stream_id": "xxxxxxxxxx",
"signature": "xxxxxxxxxx",
"buffer_data": false
}
| Field | Type | Description |
|---|---|---|
msg_type | int | The request from the app to the RTMS server to initiate a handshake. For more information, see RTMS_MESSAGE_TYPE. |
protocol_version | int | The RTMS protocol version. Missing or below 2 selects V1. 2 or higher selects V2. See Protocol versions. |
sequence | int | The sequence number of the message. Must start at 1. |
meeting_uuid | string | The unique identifier for the session. |
rtms_stream_id | string | The unique identifier of the RTMS stream. Multiple streams are possible for a session if streaming access stops or restarts. |
signature | string | The authentication signature created using app credentials and session details. |
buffer_data | bool | Optional. Default is true. When set to false, any audio data captured between the time the rtms_started webhook event is received and the time the signaling connection is established will be dropped. |
media_payload_key_mode (V2) | int | Optional. The payload key mode: 1 for per-media derived keys (default), or 2 for a direct master key. Used with payload_encryptions. |
payload_encryptions (V2) | array | Optional. Encryption offers for payload encryption. Each offer has key_wrap_algorithm, payload_encryption_algorithm, public_key (PEM), and key_id. If omitted, payload encryption stays disabled. An empty array returns status 4. |
Signaling handshake response
Sent from the signaling connectionThe signaling connection will respond with a signaling handshake response that includes the URLs of the media connections.
{
"msg_type": 2,
"protocol_version": 2,
"sequence": 0,
"status_code": 0,
"reason": "",
"media_server": {
"server_urls": {
"audio": "wss://127.0.0.0:443",
"video": "wss://127.0.0.0:443",
"transcript": "wss://127.0.0.0:443",
"all": "wss://127.0.0.0:443"
}
},
"payload_encrypted": false
}
{
"msg_type": 2,
"protocol_version": 1,
"sequence": 0,
"status_code": 0,
"reason": "",
"media_server": {
"server_urls": {
"audio": "wss://127.0.0.0:443",
"video": "wss://127.0.0.0:443",
"transcript": "wss://127.0.0.0:443",
"all": "wss://127.0.0.0:443"
}
}
}
| Field | Type | Description |
|---|---|---|
msg_type | int | The response from the signaling connection to the app after a handshake attempt. For more information, see RTMS_MESSAGE_TYPE. |
protocol_version | int | The RTMS protocol version. Missing or below 2 selects V1. 2 or higher selects V2. See Protocol versions. |
sequence | int | The sequence number of the message. |
status_code | int | The status code of the message. Status 0 means success. For more information, see RTMS_STATUS_CODE. |
reason | string | This is empty if successful. If failed, it will contain the reason for the failure. |
media_server | object | The media connection information. |
server_urls | object | Locations of available media connections. The response will depend on the app's available scopes. For example, if the app only supports audio, only audio will be included. |
payload_encrypted (V2) | bool | Whether payload encryption is enabled for the stream. |
srt_passphrase (V2) | string | Returned only when an SRT URL is configured. Base64-encoded text in JSON. |
srt_pbkey_length (V2) | int | Returned only when an SRT URL is configured. |
payload_encryptions (V2) | array | Returned when payload encryption is negotiated, with one entry per valid offer. |
wrapped_key (V2) | string | In each payload_encryptions entry, the payload key wrapped with the client's public key. Base64-encoded text in JSON. |
media_key_derivation (V2) | object | Returned in key mode 1. Contains the key derivation algorithm and parameters. |
media_derivations (V2) | array | Within media_key_derivation, one entry per granted media type, with media_type, salt, and info. salt and info are Base64-encoded text in JSON. |
Media handshake request
Sent to the media connectionTo establish a connection, send a handshake request to the media connections of the RTMS server(s) that were included in the signaling handshake and include the associated media parameters. The media connection responds with confirmed parameters of the requested media types.
Apps can request all available media streams or specify media streams by content type. If all are requested, the signaling connection responds with all media connections available according to the app's requested scopes.
If the app has scopes for audio and transcript only, a request for all media will include audio and transcript data but not video, chat, or screen share data.
To request only one media type, specify that media type in the media_type field. For more information, see MEDIA_DATA_TYPE. Use "media_type": 32 for all. In V2, 32 is rejected with status 48, so request each media type separately.
Media parameters (media_params) are optional. If not specified, the default values will be used.
The following tabs show a V2 request for each media type. In V2, request each media type on its own connection.
{
"msg_type": 3,
"protocol_version": 2,
"sequence": 0,
"meeting_uuid": "4nYtdqLVTVqGJ+QB62ED7Q==",
"rtms_stream_id": "03db704592624398931a588dd78200cb",
"signature": "kDBZVzEWgox9tWVBc7DHsjW2OnVD/6H1zN2vdmU9VY8=",
"media_type": 1,
"media_params": {
"audio": {
"content_type": 2,
"sample_rate": 1,
"channel": 1,
"codec": 1,
"data_opt": 1,
"send_rate": 20
}
}
}
{
"msg_type": 3,
"protocol_version": 2,
"sequence": 0,
"meeting_uuid": "4nYtdqLVTVqGJ+QB62ED7Q==",
"rtms_stream_id": "03db704592624398931a588dd78200cb",
"signature": "kDBZVzEWgox9tWVBc7DHsjW2OnVD/6H1zN2vdmU9VY8=",
"media_type": 2,
"media_params": {
"video": {
"codec": 5,
"resolution": 2,
"fps": 5
}
}
}
{
"msg_type": 3,
"protocol_version": 2,
"sequence": 0,
"meeting_uuid": "4nYtdqLVTVqGJ+QB62ED7Q==",
"rtms_stream_id": "03db704592624398931a588dd78200cb",
"signature": "kDBZVzEWgox9tWVBc7DHsjW2OnVD/6H1zN2vdmU9VY8=",
"media_type": 8,
"media_params": {
"transcript": {
"content_type": 5,
"src_language": 9,
"enable_lid": true
}
}
}
{
"msg_type": 3,
"protocol_version": 2,
"sequence": 0,
"meeting_uuid": "4nYtdqLVTVqGJ+QB62ED7Q==",
"rtms_stream_id": "03db704592624398931a588dd78200cb",
"signature": "kDBZVzEWgox9tWVBc7DHsjW2OnVD/6H1zN2vdmU9VY8=",
"media_type": 16
}
The following tabs show a V1 request for each media type.
{
"msg_type": 3,
"protocol_version": 1,
"sequence": 0,
"meeting_uuid": "4xxxxxxxxxx",
"rtms_stream_id": "xxxxxxxxxx",
"signature": "xxxxxxxxxx",
"media_type": 32,
"media_params": {
"audio": {
"content_type": 2,
"sample_rate": 1,
"channel": 1,
"codec": 1,
"data_opt": 1,
"send_rate": 100
},
"video": {
"codec": 5,
"resolution": 2,
"fps": 5
},
"deskshare": {
"codec": 5,
"resolution": 3,
"fps": 1
},
"transcript": {
"content_type": 5,
"src_language": 9,
"enable_lid": true
}
}
}
{
"msg_type": 3,
"protocol_version": 1,
"sequence": 0,
"meeting_uuid": "4nYtdqLVTVqGJ+QB62ED7Q==",
"rtms_stream_id": "03db704592624398931a588dd78200cb",
"signature": "kDBZVzEWgox9tWVBc7DHsjW2OnVD/6H1zN2vdmU9VY8=",
"media_type": 1,
"media_params": {
"audio": {
"content_type": 2,
"sample_rate": 1,
"channel": 1,
"codec": 1,
"data_opt": 1,
"send_rate": 20
}
}
}
{
"msg_type": 3,
"protocol_version": 1,
"sequence": 0,
"meeting_uuid": "4nYtdqLVTVqGJ+QB62ED7Q==",
"rtms_stream_id": "03db704592624398931a588dd78200cb",
"signature": "kDBZVzEWgox9tWVBc7DHsjW2OnVD/6H1zN2vdmU9VY8=",
"media_type": 2,
"media_params": {
"video": {
"codec": 5,
"resolution": 2,
"fps": 5
}
}
}
{
"msg_type": 3,
"protocol_version": 1,
"sequence": 0,
"meeting_uuid": "4nYtdqLVTVqGJ+QB62ED7Q==",
"rtms_stream_id": "03db704592624398931a588dd78200cb",
"signature": "kDBZVzEWgox9tWVBc7DHsjW2OnVD/6H1zN2vdmU9VY8=",
"media_type": 8,
"media_params": {
"transcript": {
"content_type": 5,
"src_language": 9,
"enable_lid": true
}
}
}
{
"msg_type": 3,
"protocol_version": 1,
"sequence": 0,
"meeting_uuid": "4nYtdqLVTVqGJ+QB62ED7Q==",
"rtms_stream_id": "03db704592624398931a588dd78200cb",
"signature": "kDBZVzEWgox9tWVBc7DHsjW2OnVD/6H1zN2vdmU9VY8=",
"media_type": 16
}
| Field | Type | Description |
|---|---|---|
msg_type | int | The app sends this message to the media connection to request a connection with the specified media parameters. For more information, see RTMS_MESSAGE_TYPE. |
protocol_version | int | The RTMS protocol version. Missing or below 2 selects V1. 2 or higher selects V2. See Protocol versions. |
sequence | int | The sequence number of the message. |
meeting_uuid | string | The unique identifier for the session. |
rtms_stream_id | string | The unique identifier of the RTMS stream. Multiple streams are possible for a session if streaming access stops or restarts. |
signature | string | The authentication signature created using app credentials and session details. |
media_type | int | The media type of the stream, either audio (1), video (2), screen share (4), transcript (8), chat (16), or all (32). For more information, see MEDIA_DATA_TYPE. |
media_params (Optional) | object | The media parameters of the stream that define the media formats. Parameters are set to default if not specified and returned in the response. |
content_type | int | The content type of the media stream, either RTP (1), raw audio (2), raw video (3), file stream (4), or text (5). For more information, see MEDIA_CONTENT_TYPE. |
sample_rate (audio) | int | The sample rate of the audio stream. For more information, see AUDIO_SAMPLE_RATE. |
channel (audio) | int | The channel of the audio stream, either mono (1) or stereo (2). For more information, see AUDIO_CHANNEL. |
codec (audio) | int | The codec of the audio data. Can be L16 (1), G711 (2), G722 (3), or Opus (4). For more information, see MEDIA_PAYLOAD_TYPE. |
data_opt (audio) | int | Defines whether media is separated or merged. For example, mixed audio or separated audio streams. For more information, see MEDIA_DATA_OPTION. |
send_rate (audio) | int | The send rate of the audio stream in milliseconds (ms). Must be a multiple of 20, up to 1000 ms. |
codec (video) | int | The codec of the video data that is set during the handshake and doesn't change during the session. Protocol V2: PNG isn't available. Use JPG at fps 5 or lower, and H.264 above 5 fps.Protocol V1: Can be JPG or PNG when fps <= 5, and H.264 when fps > 5. The default is JPG with an fps of 5.If the handshake request sets the fps > 5 but doesn't specify a codec, the server will set the codec to JPG (default) and the fps to 5. For more information, see MEDIA_PAYLOAD_TYPE. |
codec (screen share) | int | The codec of the screen share data that is set during the handshake and doesn't change during the session. Protocol V2: PNG isn't available. Use JPG at fps 1 or lower, and H.264 above 1 fps.Protocol V1: Can be JPG or PNG when fps <= 1, and H.264 when fps > 1. The default is JPG with an fps of 1.If the handshake request sets the fps > 1 but doesn't specify a codec, the server will set the codec to JPG (default) and the fps to 1. For more information, see MEDIA_PAYLOAD_TYPE. |
resolution (video) | int | The resolution of the video stream. Can be SD (1), HD (2), FHD (3), or QHD (4). The default is HD. SD is 360p (640×360). For more information, see MEDIA_RESOLUTION. |
resolution (screen share) | int | The resolution of the screen share stream. Can be SD (1), HD (2), FHD (3), or QHD (4). The default is FHD. For more information, see MEDIA_RESOLUTION. |
fps (video & screen share) | int | The frames per second of the video stream. Maximum of 30. |
src_language | int | Optional. The language of the transcript. If not specified, English will be the default language for the first 30 seconds of transcription. If specified, RTMS will transcribe the first 30 seconds of audio based on this language setting. For more information, see RTMS_TRANSCRIPT_LANGUAGE. |
enable_lid | bool | Optional. Default is true and Language Identification is enabled. When set to false, Language Identification is disabled and transcription will rely solely on the src_language parameter. |
If a V2 data handshake requests media_type: 32, the response has status 48. The protocol_version in this response is always 1, and it doesn't change the stream's V2 protocol.
{
"msg_type": 4,
"protocol_version": 1,
"status_code": 48,
"reason": "Media data type ALL is not supported by this protocol version"
}
Media handshake response
Sent from the media connectionThe media connection will respond with with a media handshake response that includes information about the media connections.
The following tabs show a V2 response for each media type.
{
"msg_type": 4,
"protocol_version": 2,
"status_code": 0,
"reason": "OK",
"sequence": 0,
"connection_id": "conn-audio-1",
"payload_encrypted": false,
"media_params": {
"audio": {
"content_type": 2,
"sample_rate": 1,
"channel": 1,
"codec": 1,
"data_opt": 1,
"send_rate": 20
}
}
}
{
"msg_type": 4,
"protocol_version": 2,
"status_code": 0,
"reason": "OK",
"sequence": 0,
"connection_id": "conn-video-1",
"payload_encrypted": false,
"media_params": {
"video": {
"content_type": 3,
"codec": 5,
"resolution": 2,
"data_opt": 3,
"fps": 5
}
}
}
{
"msg_type": 4,
"protocol_version": 2,
"status_code": 0,
"reason": "OK",
"sequence": 0,
"connection_id": "conn-transcript-1",
"payload_encrypted": false,
"media_params": {
"transcript": {
"content_type": 5,
"src_language": 9,
"enable_lid": true
}
}
}
{
"msg_type": 4,
"protocol_version": 2,
"status_code": 0,
"reason": "OK",
"sequence": 0,
"connection_id": "conn-chat-1",
"payload_encrypted": false,
"media_params": {
"chat": {
"content_type": 5
}
}
}
The following tabs show a V1 response for each media type.
{
"msg_type": 4,
"protocol_version": 1,
"status_code": 0,
"reason": "",
"sequence": 0,
"payload_encrypted": true,
"media_params": {
"audio": {
"content_type": 2,
"sample_rate": 1,
"channel": 1,
"codec": 1,
"data_opt": 1,
"send_rate": 100
},
"video": {
"content_type": 3,
"codec": 5,
"resolution": 2,
"data_opt": 3,
"fps": 5
},
"deskshare": {
"content_type": 3,
"codec": 5,
"resolution": 3,
"fps": 1
},
"transcript": {
"content_type": 5,
"src_language": 9,
"enable_lid": true
},
"chat": {
"content_type": 5
}
}
}
{
"msg_type": 4,
"protocol_version": 1,
"status_code": 0,
"reason": "",
"sequence": 0,
"payload_encrypted": true,
"media_params": {
"audio": {
"content_type": 2,
"sample_rate": 1,
"channel": 1,
"codec": 1,
"data_opt": 1,
"send_rate": 100
}
}
}
{
"msg_type": 4,
"protocol_version": 1,
"status_code": 0,
"reason": "",
"sequence": 0,
"payload_encrypted": true,
"media_params": {
"video": {
"content_type": 3,
"codec": 5,
"resolution": 2,
"data_opt": 3,
"fps": 5
}
}
}
{
"msg_type": 4,
"protocol_version": 1,
"status_code": 0,
"reason": "",
"sequence": 0,
"payload_encrypted": true,
"media_params": {
"transcript": {
"content_type": 5,
"src_language": 9,
"enable_lid": true
}
}
}
{
"msg_type": 4,
"protocol_version": 1,
"status_code": 0,
"reason": "",
"sequence": 0,
"payload_encrypted": true,
"media_params": {
"chat": {
"content_type": 5
}
}
}
| Field | Type | Description |
|---|---|---|
msg_type | int | The response from the media connection to the app after a handshake attempt. For more information, see RTMS_MESSAGE_TYPE. |
protocol_version | int | The RTMS protocol version. Missing or below 2 selects V1. 2 or higher selects V2. See Protocol versions. |
status_code | int | The status code of the message. Status 0 means success. For more information, see RTMS_STATUS_CODE. |
reason | string | This is empty if successful. If failed, it will contain the reason for the failure. |
sequence | int | The sequence number of the message. |
payload_encrypted (Optional) | bool | Indicates whether the payload is encrypted. For V2 streams, it's true when payload encryption was negotiated in the signaling handshake and the data parameters validated. |
content_type | int | The content type of the media. For more information, see MEDIA_CONTENT_TYPE. |
sample_rate | int | The sample rate of the audio stream. For more information, see AUDIO_SAMPLE_RATE. |
channel | int | The channel of the audio stream, either mono (1) or stereo (2). For more information, see AUDIO_CHANNEL. |
codec | int | The codec of the audio data. Can be L16 (1), G711 (2), G722 (3), or Opus (4). For more information, see MEDIA_PAYLOAD_TYPE. |
data_opt | int | Defines whether media is separated or merged. For example, mixed audio or separated audio streams. For more information, see MEDIA_DATA_OPTION. |
send_rate | int | The send rate of the audio stream in milliseconds (ms). Must be a multiple of 20. Can be up to 1000 ms. |
codec (video) | int | The codec of the video data that is set during the handshake and doesn't change during the session. Protocol V2: PNG isn't available. Use JPG at fps 5 or lower, and H.264 above 5 fps.Protocol V1: Can be JPG or PNG when fps <= 5, and H.264 when fps > 5. The default is JPG with an fps of 5.If the handshake request sets the fps > 5 but doesn't specify a codec, the server will set the codec to JPG (default) and the fps to 5. For more information, see MEDIA_PAYLOAD_TYPE. |
codec (screen share) | int | The codec of the screen share data that is set during the handshake and doesn't change during the session. Protocol V2: PNG isn't available. Use JPG at fps 1 or lower, and H.264 above 1 fps.Protocol V1: Can be JPG or PNG when fps <= 1, and H.264 when fps > 1. The default is JPG with an fps of 1.If the handshake request sets the fps > 1 but doesn't specify a codec, the server will set the codec to JPG (default) and the fps to 1. For more information, see MEDIA_PAYLOAD_TYPE. |
resolution (video) | int | The resolution of the video stream. Can be SD (1), HD (2), FHD (3), or QHD (4). The default is HD. SD is 360p (640×360). For more information, see MEDIA_RESOLUTION. |
resolution (screen share) | int | The resolution of the screen share stream. Can be SD (1), HD (2), FHD (3), or QHD (4). The default is FHD. For more information, see MEDIA_RESOLUTION. |
fps (video & screen share) | int | The frames per second of the video stream. Maximum of 30. |
src_language | int | Optional. The language of the transcript. If not specified, English will be the default language for the first 30 seconds of transcription. If specified, RTMS will transcribe the first 30 seconds of audio based on this language setting. For more information, see RTMS_TRANSCRIPT_LANGUAGE. |
enable_lid | bool | Optional. Default is true and Language Identification is enabled. When set to false, Language Identification is disabled and transcription will rely solely on the src_language parameter. |
connection_id (V2) | string | The identifier of the data connection. |
A V2 data handshake doesn't create a second payload key or change the key mode.
Client ready ACK message
Sent to the signaling connectionAfter the app receives the data handshake response from the media connection, it needs to send a client ready ack to the signaling connection to indicate that the full handshake has completed and that it is ready to receive media data.
This message should be sent after the signaling and media connections have been established.
{
"msg_type": 7,
"rtms_stream_id": "xxxxxxxxxx"
}
| Field | Type | Description |
|---|---|---|
msg_type | int | The app sends this message to the signaling connection to acknowledge that the server is ready to receive media. For more information, see RTMS_MESSAGE_TYPE. |
rtms_stream_id | string | The unique identifier for the RTMS stream. |
Keep-alive request
Sent from the media connectionTo maintain stable connections and prevent timeouts, RTMS servers send a keep-alive request to both the signaling and media connections every 10 seconds.
When three keep-alive requests are unanswered, the RTMS server takes different actions for the different connection types.
-
Signaling connection - The RTMS server will interrupt both the signaling and media connections, wait for one minute to allow for reconnection, and, if the connection is not restored, it will end the RTMS stream.
-
Media connections - The RTMS server will interrupt the media connection, wait for 65 seconds to allow for reconnection, and, if the connection is not restored, it will end the RTMS stream.
If an app doesn't receive a keep-alive request for 65 seconds, we recommend that the app reestablish the connection by resending the signaling handshake request. For more information, see Working with streams.
The RTMS server sends the following request to confirm the app wants to maintain a connection.
{
"msg_type": 12,
"timestamp": 1727384349123
}
| Field | Type | Description |
|---|---|---|
msg_type | int | The media connection sends this message to confirm the app wants to maintain a connection. For more information, see RTMS_MESSAGE_TYPE. |
timestamp | unsigned long | The Unix timestamp of the request. |
Keep-alive response
Sent to the media connectionTo maintain the connection, an app should respond to the request with the following response. The timestamp in the response must match the request.
{
"msg_type": 13,
"timestamp": 1727384349123
}
| Field | Type | Description |
|---|---|---|
msg_type | int | The app sends this message to the media connection to maintain a connection. For more information, see RTMS_MESSAGE_TYPE. |
timestamp | unsigned long | The Unix timestamp of the keep-alive request. |
Subscribe to events
Sent to the signaling connectionSend this message to the signaling connection to get data about behavior during sessions.
JSON subscriptions support session events only. Zoom Contact Center voice events and Zoom Phone events don't use this JSON subscription API.
The request format depends on the protocol version. V2 requests use event_code, and V1 requests use the legacy event_type. An entry must not contain both fields. Mixing them returns a REQUEST_ERROR_RESP message (msg_type 30) with status 6.
The server sends no success response for subscribe or unsubscribe requests. The requested state takes effect immediately. The server sends a request error response only for invalid requests.
{
"msg_type": 5,
"events": [
{
"event_code": 1000,
"subscribe": true
}
]
}
{
"msg_type": 5,
"events": [
{
"event_type": 2,
"subscribe": true
}
]
}
| Field | Type | Description |
|---|---|---|
msg_type | int | The app sends this message to the signaling connection to subscribe or unsubscribe to in-session events from the signaling connection. For more information, see RTMS_MESSAGE_TYPE. |
event_code (V2) | int | The event to subscribe to. Session events 1000 to 1011 are supported. For more information, see RTMS_EVENT_CODE. |
event_type (V1) | int | The legacy event to subscribe to. For more information, see RTMS_EVENT_TYPE. |
subscribe | bool | A boolean.True - subscribe to eventsFalse - unsubscribe from events |
Audio data
Sent from the media connectionAudio data from the media connection of a participant in a session. It can be either merged audio or individual audio.
{
"msg_type": 14,
"content": {
"user_id": 16778240,
"user_name": "John Smith",
"source": 1,
"data": "Hw1kDacNAA4sDkMOAQ5eDekMgAzXCw0L4Al4CDwHBAayBEwDmwHD/wn+rfyQ+3z6Z/k4+Ef3jvb09aj1YPUF9QL1OfVt9eH1f/YE96P3jPib+dX6Pvyr/ef+IABcAZ4CmQN3BFAF6QVxBs0G9wbjBqYGXwYFBm8FxwT/Aw4DHAIkARYA7v6o/T382/qq+YD4fPd99mz1p/Qq9KTzcfNv807zcPPQ8z70yfQ89az1SPbO9m/3Lfjf+I75M/rz+pT7KPzs/In9Fv7G/lP/q/8GAG4AtgBHAcABDQKtAkwDIgRQBYQGrgfyCEgKigvDDP4NFw/8D78QhBErEqoS/BL5EsYSfRLnEXARwhCMD1kO8ww8C5gJ5gfrBe8D3AGp/7P9IPyY+hL5t/dl9mv10fQ89NjzvvO78/HzbfTb9F71I/bw9vL3Kvlh+pX71/wr/m//owDCAbQCkwNoBPYEYQWxBZ0FZQUdBYkEBgRkA64CAgIdAT0AZf+T/tD93vz9+xf7B/o8+WX4pvcE90L2n/VM9d70pPSe9IL0nfTa9BX1cfXK9QP2S/a69hH3cPfx91P4w/hO+cr5XPr2+l/71/t9/AP9f/0R/p/+Pv/5/7IAWAH+AeMCAwQ7BaAG+wcmCZEKKQy8DT4PWhBXEVYSVBOgFM0VMxZSFhYW4BXTFUMVNBSzEtIQJg99Da0LogkXB40ESgJCAHj+ivyA+qn4KfcH9hr1JvRf89byq/Lt8kjzhvPy85P0n/X/9kn4lvni+kj84P1S/4wAuwHUAvcD9wS/BUwGaAZcBmcGTQb5BUkFQgQzAzkCVQEgALX+U/3N+4L6XfkU+Nj2o/WB9MTzOfO38g==",
"length": 1024,
"timestamp": 1738392033699
}
}
{
"msg_type": 14,
"content": {
"user_name": "John Smith",
"data": "Hw1kDacNAA4sDkMOAQ5eDekMgAzXCw0L4Al4CDwHBAayBEwDmwHD/wn+rfyQ+3z6Z/k4+Ef3jvb09aj1YPUF9QL1OfVt9eH1f/YE96P3jPib+dX6Pvyr/ef+IABcAZ4CmQN3BFAF6QVxBs0G9wbjBqYGXwYFBm8FxwT/Aw4DHAIkARYA7v6o/T382/qq+YD4fPd99mz1p/Qq9KTzcfNv807zcPPQ8z70yfQ89az1SPbO9m/3Lfjf+I75M/rz+pT7KPzs/In9Fv7G/lP/q/8GAG4AtgBHAcABDQKtAkwDIgRQBYQGrgfyCEgKigvDDP4NFw/8D78QhBErEqoS/BL5EsYSfRLnEXARwhCMD1kO8ww8C5gJ5gfrBe8D3AGp/7P9IPyY+hL5t/dl9mv10fQ89NjzvvO78/HzbfTb9F71I/bw9vL3Kvlh+pX71/wr/m//owDCAbQCkwNoBPYEYQWxBZ0FZQUdBYkEBgRkA64CAgIdAT0AZf+T/tD93vz9+xf7B/o8+WX4pvcE90L2n/VM9d70pPSe9IL0nfTa9BX1cfXK9QP2S/a69hH3cPfx91P4w/hO+cr5XPr2+l/71/t9/AP9f/0R/p/+Pv/5/7IAWAH+AeMCAwQ7BaAG+wcmCZEKKQy8DT4PWhBXEVYSVBOgFM0VMxZSFhYW4BXTFUMVNBSzEtIQJg99Da0LogkXB40ESgJCAHj+ivyA+qn4KfcH9hr1JvRf89byq/Lt8kjzhvPy85P0n/X/9kn4lvni+kj84P1S/4wAuwHUAvcD9wS/BUwGaAZcBmcGTQb5BUkFQgQzAzkCVQEgALX+U/3N+4L6XfkU+Nj2o/WB9MTzOfO38g=="
}
}
{
"msg_type": 14,
"content": {
"channel_id": "c8b2d3ce-b0d6-4cd1-9195-fe17a4bd5b8e",
"data": "Hw1kDacNAA4sDkMOAQ5eDekMgAzXCw0L4Al4CDwHBAayBEwDmwHD/wn+rfyQ+3z6Z/k4+Ef3jvb09aj1YPUF9QL1OfVt9eH1f/YE96P3jPib+dX6Pvyr/ef+IABcAZ4CmQN3BFAF6QVxBs0G9wbjBqYGXwYFBm8FxwT/Aw4DHAIkARYA7v6o/T382/qq+YD4fPd99mz1p/Qq9KTzcfNv807zcPPQ8z70yfQ89az1SPbO9m/3Lfjf+I75M/rz+pT7KPzs/In9Fv7G/lP/q/8GAG4AtgBHAcABDQKtAkwDIgRQBYQGrgfyCEgKigvDDP4NFw/8D78QhBErEqoS/BL5EsYSfRLnEXARwhCMD1kO8ww8C5gJ5gfrBe8D3AGp/7P9IPyY+hL5t/dl9mv10fQ89NjzvvO78/HzbfTb9F71I/bw9vL3Kvlh+pX71/wr/m//owDCAbQCkwNoBPYEYQWxBZ0FZQUdBYkEBgRkA64CAgIdAT0AZf+T/tD93vz9+xf7B/o8+WX4pvcE90L2n/VM9d70pPSe9IL0nfTa9BX1cfXK9QP2S/a69hH3cPfx91P4w/hO+cr5XPr2+l/71/t9/AP9f/0R/p/+Pv/5/7IAWAH+AeMCAwQ7BaAG+wcmCZEKKQy8DT4PWhBXEVYSVBOgFM0VMxZSFhYW4BXTFUMVNBSzEtIQJg99Da0LogkXB40ESgJCAHj+ivyA+qn4KfcH9hr1JvRf89byq/Lt8kjzhvPy85P0n/X/9kn4lvni+kj84P1S/4wAuwHUAvcD9wS/BUwGaAZcBmcGTQb5BUkFQgQzAzkCVQEgALX+U/3N+4L6XfkU+Nj2o/WB9MTzOfO38g==",
"length": 1024,
"timestamp": 1738392033699
}
}
| Field | Type | Description |
|---|---|---|
msg_type | int | Audio data sent from the media connection. For more information, see RTMS_MESSAGE_TYPE. |
user_id | int | The unique identifier of the participant whose audio is included in the data. |
user_name | string | The username of the participant whose audio is included in the data. If the user_id in the RTP header is 0, no user_name will be sent. |
source | int | The source of the audio. 1 for microphone audio, or 2 for shared-content audio. This lets you tell screen-share audio apart from microphone input. For more information, see AUDIO_DATA_SOURCE. |
channel_id | string | For Zoom Contact Center engagements, the unique identifier of the SIP trunk channel that carries this audio. Each party in an engagement is on a separate channel, so channel_id identifies which side of the call this audio belongs to. |
data | string | Audio data, base64-encoded binary. |
length | int | The length of the original binary data before base64 encoding. |
timestamp | unsigned long | The Unix timestamp of the data. |
Video data
Sent from the media connectionVideo data from the media connection of the Active speaker participant in a session.
{
"msg_type": 15,
"content": {
"user_id": 16778240,
"user_name": "John Smith",
"data": "Hw1kDacNAA4sDkMOAQ5eDekMgAzXCw0L4Al4CDwHBAayBEwDmwHD/wn+rfyQ+3z6Z/k4+Ef3jvb09aj1YPUF9QL1OfVt9eH1f/YE96P3jPib+dX6Pvyr/ef+IABcAZ4CmQN3BFAF6QVxBs0G9wbjBqYGXwYFBm8FxwT/Aw4DHAIkARYA7v6o/T382/qq+YD4fPd99mz1p/Qq9KTzcfNv807zcPPQ8z70yfQ89az1SPbO9m/3Lfjf+I75M/rz+pT7KPzs/In9Fv7G/lP/q/8GAG4AtgBHAcABDQKtAkwDIgRQBYQGrgfyCEgKigvDDP4NFw/8D78QhBErEqoS/BL5EsYSfRLnEXARwhCMD1kO8ww8C5gJ5gfrBe8D3AGp/7P9IPyY+hL5t/dl9mv10fQ89NjzvvO78/HzbfTb9F71I/bw9vL3Kvlh+pX71/wr/m//owDCAbQCkwNoBPYEYQWxBZ0FZQUdBYkEBgRkA64CAgIdAT0AZf+T/tD93vz9+xf7B/o8+WX4pvcE90L2n/VM9d70pPSe9IL0nfTa9BX1cfXK9QP2S/a69hH3cPfx91P4w/hO+cr5XPr2+l/71/t9/AP9f/0R/p/+Pv/5/7IAWAH+AeMCAwQ7BaAG+wcmCZEKKQy8DT4PWhBXEVYSVBOgFM0VMxZSFhYW4BXTFUMVNBSzEtIQJg99Da0LogkXB40ESgJCAHj+ivyA+qn4KfcH9hr1JvRf89byq/Lt8kjzhvPy85P0n/X/9kn4lvni+kj84P1S/4wAuwHUAvcD9wS/BUwGaAZcBmcGTQb5BUkFQgQzAzkCVQEgALX+U/3N+4L6XfkU+Nj2o/WB9MTzOfO38g==",
"length": 1024,
"timestamp": 1738392033699
}
}
| Field | Type | Description |
|---|---|---|
msg_type | int | Video data sent from the media connection. For more information, see RTMS_MESSAGE_TYPE. |
user_id | int | The unique identifier of the participant whose video was included in the data. |
user_name | string | The username of the participant whose video was included in the data. |
data | string | Video data, base64-encoded binary. |
length | int | The length of the original binary data before base64 encoding. |
timestamp | unsigned long | The Unix timestamp of the data. |
Screen share data
Sent from the media connectionContent shared by a participant in a session sent from the media connection.
{
"msg_type": 16,
"content": {
"user_id": 16778240,
"user_name": "John Smith",
"data": "Hw1kDacNAA4sDkMOAQ5eDekMgAzXCw0L4Al4CDwHBAayBEwDmwHD/wn+rfyQ+3z6Z/k4+Ef3jvb09aj1YPUF9QL1OfVt9eH1f/YE96P3jPib+dX6Pvyr/ef+IABcAZ4CmQN3BFAF6QVxBs0G9wbjBqYGXwYFBm8FxwT/Aw4DHAIkARYA7v6o/T382/qq+YD4fPd99mz1p/Qq9KTzcfNv807zcPPQ8z70yfQ89az1SPbO9m/3Lfjf+I75M/rz+pT7KPzs/In9Fv7G/lP/q/8GAG4AtgBHAcABDQKtAkwDIgRQBYQGrgfyCEgKigvDDP4NFw/8D78QhBErEqoS/BL5EsYSfRLnEXARwhCMD1kO8ww8C5gJ5gfrBe8D3AGp/7P9IPyY+hL5t/dl9mv10fQ89NjzvvO78/HzbfTb9F71I/bw9vL3Kvlh+pX71/wr/m//owDCAbQCkwNoBPYEYQWxBZ0FZQUdBYkEBgRkA64CAgIdAT0AZf+T/tD93vz9+xf7B/o8+WX4pvcE90L2n/VM9d70pPSe9IL0nfTa9BX1cfXK9QP2S/a69hH3cPfx91P4w/hO+cr5XPr2+l/71/t9/AP9f/0R/p/+Pv/5/7IAWAH+AeMCAwQ7BaAG+wcmCZEKKQy8DT4PWhBXEVYSVBOgFM0VMxZSFhYW4BXTFUMVNBSzEtIQJg99Da0LogkXB40ESgJCAHj+ivyA+qn4KfcH9hr1JvRf89byq/Lt8kjzhvPy85P0n/X/9kn4lvni+kj84P1S/4wAuwHUAvcD9wS/BUwGaAZcBmcGTQb5BUkFQgQzAzkCVQEgALX+U/3N+4L6XfkU+Nj2o/WB9MTzOfO38g==",
"length": 1024,
"timestamp": 1738392033699
}
}
| Field | Type | Description |
|---|---|---|
msg_type | int | Screen share data sent from the media connection. For more information, see RTMS_MESSAGE_TYPE. |
user_id | int | The unique identifier of the participant who shared their screen. |
user_name | string | The username of the participant who shared their screen. |
data | string | Screen share video data, base64-encoded binary. |
length | int | The length of the original binary data before base64 encoding. |
timestamp | unsigned long | The Unix timestamp of the data. |
Transcript data
Sent from the media connectionTranscript of the spoken audio in a session sent from the media connection. Messages will be sent separately for each participant who has spoken.
{
"msg_type": 17,
"content": {
"user_id": 19778240,
"user_name": "John Smith",
"start_time": 1727384100000,
"end_time": 1727384310000,
"timestamp": 1727384349000,
"language": 9,
"data": "Hi, hello world!"
}
}
{
"msg_type": 17,
"content": {
"channel_id": "c8b2d3ce-b0d6-4cd1-9195-fe17a4bd5b8e",
"start_time": 1738392033699,
"end_time": 1738392036866,
"timestamp": 1727384349000000,
"language": 9,
"data": "Hi, hello world!"
}
}
| Field | Type | Description |
|---|---|---|
msg_type | int | Transcript data sent from the media connection. For more information, see RTMS_MESSAGE_TYPE. |
user_id | int | The unique identifier of the participant whose transcript is included. |
user_name | string | The username of the participant whose transcript is included. |
channel_id | string | For Zoom Contact Center engagements, the unique identifier of the SIP trunk channel that carries this transcript. Each party in an engagement is on a separate channel, so channel_id identifies which side of the call this transcript belongs to. |
start_time | unsigned long | The Unix timestamp of when the transcription started. |
end_time | unsigned long | The Unix timestamp of when the transcription ended. |
timestamp | unsigned long | The Unix timestamp of the data. |
language | int | The language of the transcript data. For more information, see RTMS_TRANSCRIPT_LANGUAGE. |
data | string | The transcript data, UTF-8 encoded string. |
Chat data
Sent from the media connectionChat data sent from the media connection. Each participant's chat data is sent in a separate message.
{
"msg_type": 18,
"content": {
"timestamp": 1771635627032,
"data": "Content of the message",
"chat_session": {
"type": 1
},
"operation_type": 1,
"message_id": "1-{BAE4D8D3-629A-48E2-9C12-5442D81931BF}",
"sender": {
"user_id": 16778240,
"user_name": "John Smith"
},
"files": [
{
"file_id": "bJtDzXMnS1ufL1SHarZnMA",
"file_name": "test.txt",
"file_size": 28
}
],
"delete_file_id_list": ["-i81TZFYSK2KUltQP-Y_TA"]
}
}
| Field | Type | Description |
|---|---|---|
msg_type | int | Chat data sent from the media connection. For more information, see RTMS_MESSAGE_TYPE. |
timestamp | unsigned long | The Unix timestamp of the data. |
data | string | The message content. A UTF-8 encoded JSON object string. |
chat_session | object | The chat session that the message belongs to. |
chat_session.type | int | The type of chat session. RTMS currently only delivers 1 (EVERYONE, public chat). For more information, see RTMS_CHAT_SESSION_TYPE. |
operation_type | int | The operation that produced this message, such as send, edit, or delete. For more information, see RTMS_CHAT_OPERATION_TYPE. |
message_id | string | The unique identifier of the message. |
sender | object | The participant who sent the message. |
sender.user_id | unsigned int32 | The unique identifier of the participant who sent the message. |
sender.user_name | string | The username of the participant who sent the message. |
files | array | The files attached to the message. |
files[].file_id | string | The unique identifier of the attached file. |
files[].file_name | string | The name of the attached file. |
files[].file_size | unsigned long | The size of the attached file, in bytes. |
delete_file_id_list | array | Optional. The identifiers of files removed while editing a chat message. Only present when files are removed during an edit. |
Participant user info
Sent from the signaling connectionThe signaling connection sends a participant user info event when it observes media data from participants, including audio, video, screen sharing, transcript, or chat. The event lists those participants with their user_id, user_name, and participant_uuid. The signaling connection sends it automatically, so your app doesn't need to subscribe to it.
This event requires protocol V2.
{
"msg_type": 6,
"event": {
"event_code": 4,
"timestamp": 1793232000000,
"media_type": 1,
"participants": [
{
"user_id": 16778240,
"user_name": "Alice",
"participant_uuid": "C3677EC5-3786-A428-7627-84C3B77B49F8"
},
{
"user_id": 16779264,
"user_name": "Bob",
"participant_uuid": "A1248B36-97D2-4E53-AC91-23085F6D7B40"
}
]
}
}
| Field | Type | Description |
|---|---|---|
msg_type | int | The message type. Always 6 for an event update. For more information, see RTMS_MESSAGE_TYPE. |
event_code | int | The event code. Always 4 for participant user info. For more information, see RTMS_EVENT_CODE. |
timestamp | unsigned long | The Unix timestamp of the event. |
media_type | int | The type of media data that the service observed from these participants. For more information, see MEDIA_DATA_TYPE. |
participants | array | The participants whose media data the service observed. Each participant has the following fields. |
user_id | unsigned int32 | The unique identifier of the participant. |
user_name | string | The display name of the participant. |
participant_uuid | string | The unique identifier of the participant. |
Session state updated
Sent from the signaling connectionThe signaling connection sends session state updated events when a new session is added or the state of a session is changed. A session can stop and resume during a stream. This message does not require a response from the app.
The STARTED state means a brand-new session has started. Record the session information locally since the state of each session is changed separately.
{
"msg_type": 9,
"state": 1,
"stop_reason": 1,
"timestamp": 1727384349123,
"rtms_session_id": "xxxxxxxxxx"
}
| Field | Type | Description |
|---|---|---|
msg_type | int | The signaling connection sends this message when a session has been updated. For more information, see RTMS_MESSAGE_TYPE. |
state | int | The state of a session within a stream, including if a participant or host has started, paused, resumed or stopped a session. For more information, see RTMS_SESSION_STATE. |
reason | int | Describes why a session status has been updated. It's only sent if session state stops. For more information, see RTMS_STOP_REASON. |
timestamp | unsigned long | The Unix timestamp of when the session was updated. |
rtms_session_id | string | The unique identifier for the RTMS session. |
Session state request
Sent to the signaling connectionApps send the session state request event to the signaling connection to query the current session state. The signaling connection will respond with the current session state.
{
"msg_type": 10,
"rtms_session_id": "xxxxxxxxxx"
}
| Field | Type | Description |
|---|---|---|
msg_type | int | The app sends this message to query the current state of the session. For more information, see RTMS_MESSAGE_TYPE. |
rtms_session_id | string | The unique identifier for the RTMS session. |
Session state response
Sent from the signaling connectionThe signaling connection sends the session state response event in response to a session state request event.
{
"msg_type": 11,
"rtms_session_id": "xxxxxxxxxx",
"state": 1,
"timestamp": 1727384349123
}
| Field | Type | Description |
|---|---|---|
msg_type | int | The signaling connection sends this field as a response to the query for the state of the current session. For more information, see RTMS_MESSAGE_TYPE. |
rtms_session_id | string | The unique identifier for the RTMS session. |
state | int | The state of the current session. For more information, see RTMS_SESSION_STATE. |
timestamp | unsigned long | The Unix timestamp of the request. Use this to pair requests and responses. |
Stream state request
Sent to the signaling connectionApps send the current stream state request event to the signaling server to query the current stream state. Streams can be in one of the following states: inactive, active, interrupted, terminating, terminated, paused, or resumed.
{
"msg_type": 19,
"rtms_stream_id": "756FF58A-6332-6ECA-E4AE-21F2ABDCB485"
}
| Field | Type | Description |
|---|---|---|
msg_type | int | The app sends this message to query the current state of the state. For more information, see RTMS_MESSAGE_TYPE. |
rtms_stream_id | string | The unique identifier of the RTMS stream. |
Stream state response
Sent from the signaling connectionThe signaling connection sends the stream state response event in response to a stream state request event.
{
"msg_type": 20,
"state": 1,
"rtms_stream_id": "756FF58A-6332-6ECA-E4AE-21F2ABDCB485",
"timestamp": 1694204592
}
| Field | Type | Description |
|---|---|---|
msg_type | int | The signaling connection sends this message as a response to the query for the state of the current stream. For more information, see RTMS_MESSAGE_TYPE. |
state | int | The current state of the RTMS stream. For more information, see RTMS_STREAM_STATE. |
rtms_stream_id | string | The unique identifier for the RTMS stream. |
timestamp | unsigned long | The Unix timestamp of the request. Use this to pair requests and responses. |
Stream state updated
Sent from the signaling connection{
"msg_type": 8,
"state": 1,
"reason": 1,
"timestamp": 1727384349123
}
| Field | Type | Description |
|---|---|---|
msg_type | int | The signaling connection sends this message when a stream has been updated. For more information, see RTMS_MESSAGE_TYPE. |
state | int | The state of a stream, including if a stream is active, experiencing connection issues, or needs to be terminated. For more information, see RTMS_STREAM_STATE. |
reason | int | Describes why a stream status has been updated. For more information, see RTMS_STOP_REASON. |
timestamp | unsigned long | The Unix timestamp of when the stream was updated. |
Stream close request
Sent to the signaling connectionTo gracefully close a stream from the app backend, send a STREAM_CLOSE_REQ message through the signaling connection. RTMS will respond with a STREAM_CLOSE_RESP message and terminate the stream.
{
"msg_type": 21,
"rtms_stream_id": "xxxxxxxxxx"
}
| Field | Type | Description |
|---|---|---|
msg_type | int | The request from the app to close the stream. For more information, see RTMS_MESSAGE_TYPE. |
rtms_stream_id | string | The unique identifier of the RTMS stream to close. |
Stream close response
Sent from the signaling connectionThe signaling connection responds to a stream close request with a STREAM_CLOSE_RESP message confirming the result.
{
"msg_type": 22,
"rtms_stream_id": "xxxxxxxxxx",
"status_code": 0,
"reason": "OK",
"timestamp": 1727384349123
}
| Field | Type | Description |
|---|---|---|
msg_type | int | The response from the signaling connection after a stream close request. For more information, see RTMS_MESSAGE_TYPE. |
rtms_stream_id | string | The unique identifier of the RTMS stream. |
status_code | int | The status code of the response. Status 0 means success. For more information, see RTMS_STATUS_CODE. |
reason | string | Empty if successful. If failed, contains the reason for the failure. |
timestamp | unsigned long | The Unix timestamp of when the response was sent. |
Video subscription request
Sent to the signaling connectionTo use individual video subscriptions, configure data_opt to 4 (VIDEO_SINGLE_INDIVIDUAL_STREAM) when establishing the media connection, and subscribe to PARTICIPANT_VIDEO_ON and PARTICIPANT_VIDEO_OFF events using the Subscribe to events message.
To subscribe to an individual participant's video stream, send this message through the signaling connection containing the user_id obtained from a PARTICIPANT_VIDEO_ON event. The RTMS server supports subscribing to a single individual video stream at a time, a new subscription request will automatically unsubscribe from the previous individual's stream.
{
"msg_type": 28,
"user_id": 16778240,
"subscribe": true,
"timestamp": 1738392033699
}
| Field | Type | Description |
|---|---|---|
msg_type | int | The request from the app to subscribe or unsubscribe from an individual's video stream. For more information, see RTMS_MESSAGE_TYPE. |
user_id | unsigned int32 | The unique identifier of the participant to subscribe to, obtained from a PARTICIPANT_VIDEO_ON event. |
subscribe | bool | Set to true to subscribe, false to unsubscribe. |
timestamp | unsigned long | The Unix timestamp of the request. |
Video subscription response
Sent from the signaling connectionThe signaling connection responds to a video subscription request. If successful, the subscribed participant's video stream will begin transmitting through the video data socket connection.
{
"msg_type": 29,
"user_id": 16778240,
"status_code": 0,
"reason": "OK",
"timestamp": 1738392033699
}
| Field | Type | Description |
|---|---|---|
msg_type | int | The response from the signaling connection after a video subscription request. For more information, see RTMS_MESSAGE_TYPE. |
user_id | unsigned int32 | The unique identifier of the participant that was subscribed or unsubscribed. |
status_code | int | The status code of the response. Status 0 means success. For more information, see RTMS_STATUS_CODE. |
reason | string | Empty if successful. If failed, contains the reason for the failure. |
timestamp | unsigned long | The Unix timestamp of the response. |
Request error response
Sent from the signaling connectionTo find out why the signaling connection rejected a request, read the request error response. Use request_msg_type to match the error to the request that caused it, and use status_code and reason to find the cause.
The signaling connection sends this message only for invalid requests. It doesn't send a response to a valid subscribe or unsubscribe request. For more information, see Subscribe to events.
{
"msg_type": 30,
"request_msg_type": 5,
"status_code": 6,
"reason": "<reason for the failure>",
"timestamp": 1738392033699
}
| Field | Type | Description |
|---|---|---|
msg_type | int | The message type. Always 30 for a request error response. For more information, see RTMS_MESSAGE_TYPE. |
request_msg_type | int | The msg_type of the request that failed. For more information, see RTMS_MESSAGE_TYPE. |
status_code | int | The reason the request failed. For more information, see RTMS_STATUS_CODE. |
reason | string | A description of the failure. |
timestamp | unsigned long | The Unix timestamp of the response. |
A subscribe request that includes both event_code and event_type in the same entry returns status 6. For more information, see Subscribe to events.