Event reference
The Realtime Media Streams (RTMS) events and messages included here outline how your app and RTMS work together to receive session updates, establish signaling and media connections, manage session states, handle keep-alive requests, and receive media data.
The examples on this page use meeting-specific values (such as
meeting_uuidandmeeting.rtms_started), but the message structure is the same across all RTMS-supported products.
This message classification table outlines the messages that RTMS currently supports, and their corresponding transmission channels.
| Signaling connection | Media connection |
|---|---|
SIGNALING_HAND_SHAKE_REQ``SIGNALING_HAND_SHAKE_RESP``DATA_HAND_SHAKE_REQ``DATA_HAND_SHAKE_RESP``EVENT_SUBSCRIPTION``EVENT_UPDATE``CLIENT_READY_ACK``STREAM_STATE_UPDATE``SESSION_STATE_UPDATE``SESSION_STATE_REQ``SESSION_STATE_RESP``KEEP_ALIVE_REQ``KEEP_ALIVE_RESP``STREAM_STATE_REQ``STREAM_STATE_RESP``STREAM_CLOSE_REQ``STREAM_CLOSE_RESP``VIDEO_SUBSCRIPTION_REQ``VIDEO_SUBSCRIPTION_RESP | KEEP_ALIVE_RESP``MEDIA_DATA_AUDIO``MEDIA_DATA_VIDEO``MEDIA_DATA_SHARE``MEDIA_DATA_TRANSCRIPT``MEDIA_DATA_CHAT |
Signaling handshake request
Sent to the signaling connection
Send 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.
Use
meeting.rtms_startedandmeeting.rtms_stoppedevents in the Webhook reference to get initial session details like themeeting_uuidandrtms_stream_id.
{
"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 design version. By default, it's 1.0. |
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. |
> When buffer_data is set to false, only the initial buffer data is dropped. Audio data will continue to be buffered during connection interruptions, and any buffered data will be transmitted once a new connection is established. |
Signaling handshake response
Sent from the signaling connection
The signaling connection will respond with a signaling handshake response that includes the URLs of the media connections.
{
"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 design version. By default, it's 1.0. |
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. |
Media handshake request
Sent to the media connection
To 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.
Media parameters (media_params) are optional. If not specified, the default values will be used.
For more information, see Data type definitions for options on codecs, resolutions, rates, etc.
{
"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": 4,
"media_params": {
"deskshare": {
"codec": 5,
"resolution": 3,
"fps": 1
}
}
}
{
"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
}
}
}
Chat data is not supported yet.
{
"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 design version. By default, it's 1.0. |
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. 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. 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. 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. |
| > After 30 seconds, the audio language will be automatically detected and override this parameter. | ||
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. |
Media handshake response
Sent from the media connection
The media connection will respond with with a media handshake response that includes information about the media connections.
{
"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": {
"deskshare": {
"content_type": 3,
"codec": 5,
"resolution": 3,
"fps": 1
}
}
}
{
"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
}
}
}
Chat data is not supported yet.
{
"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 design version. By default, it's 1.0. |
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_encryption (Optional) | bool | Default is false for any TLS connection. The encryption keys in the signaling handshake response message. If true, the payload is encrypted. If false, but the payload protocol is UPD, and the payload will still be encrypted. |
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. 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. 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. 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. |
| > After 30 seconds, the audio language will be automatically detected and override this parameter. | ||
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. |
Client ready ACK message
Sent to the signaling connection
After 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 connection
To 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 connection
To 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 connection
Send this message to the signaling connection to get data about behavior during sessions.
Note
Some events are sent automatically and don't need to be subscribed to. To ensure your app works as expected, don't subscribe to these events.
- FIRST_PACKET_TIMESTAMP = 1
- MEDIA_CONNECTION_INTERRUPTED = 7
This message does not require a response.
{
"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_type | int | The type of event to subscribe to. For more information, see RTMS_EVENT_TYPE. |
subscribe | bool | A boolean. True - subscribe to events False - unsubscribe from events |
Audio data
Sent from the media connection
Audio 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",
"data": "Hw1kDacNAA4sDkMOAQ5eDekMgAzXCw0L4Al4CDwHBAayBEwDmwHD/wn+rfyQ+3z6Z/k4+Ef3jvb09aj1YPUF9QL1OfVt9eH1f/YE96P3jPib+dX6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P9IPyY+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. |
channel_id | string | The unique identifier of the participant whose audio is included in the data. |
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 connection
Video 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 connection
Content 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 connection
Transcript 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 | The unique identifier of the participant whose transcript is included. |
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 connection
Chat data is not supported yet.
Chat data sent from the media connection. Messages will be sent separately for all participants who have sent chat messages.
{
"msg_type": 18,
"content": {
"timestamp": 1727384349000,
"data": "Chat message"
}
}
| 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 chat message, UTF-8 encoded string. |
Session state updated
Sent from the signaling connection
The 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 connection
Apps 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 connection
The 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 connection
Apps 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 connection
The 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 connection
To 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 connection
The 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 connection
To 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 connection
The 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. |
First timestamp from the signaling connection
Sent from the signaling connection
After the signaling connection connects, it sends a message to the app with the first timestamp. Use this timestamp as the start of the session. This message does not require a response from the app.
{
"msg_type": 6,
"event": {
"event_type": 1,
"timestamp": 1727384349123
}
}
| Field | Type | Description |
|---|---|---|
msg_type | int | The signaling connection sends this message to the app to provide the first timestamp for the connection. For more information, see RTMS_MESSAGE_TYPE. |
event_type | int | The first timestamp event. For more information, see RTMS_EVENT_TYPE. |
timestamp | unsigned long | The Unix timestamp sent by the signaling connection. |
Active speaker change
Sent from the signaling connection
The signaling connection sends active speaker change events that provide timestamps for when a user is the primary participant speaking (green box around their tile in the session). This message does not require a response from the app.
{
"msg_type": 6,
"event": {
"event_type": 2,
"timestamp": 1727384349123,
"user_id": 22334455,
"user_name": "John Smith"
}
}
| Field | Type | Description |
|---|---|---|
msg_type | int | The signaling connection sends this message to the app when the active speaker changes. For more information, see RTMS_MESSAGE_TYPE. |
event_type | int | The active speaker changed event. For more information, see RTMS_EVENT_TYPE. |
timestamp | unsigned long | The Unix timestamp of the event. |
user_id | unsigned int32 | The current active speaker's unique identifier. |
user_name | string | The current active speaker's username. |
Participant joined
Sent from the signaling connection
The signaling connection sends participant join events when someone joins the session. This message does not require a response from the app.
{
"msg_type": 6,
"event": {
"event_type": 3,
"timestamp": 1727384349123,
"participants": [
{
"user_id": xxxxxxxxxx,
"user_name": "John Smith"
},
{
"user_id": xxxxxxxxxx,
"user_name": "Alice"
}
]
}
}
| Field | Type | Description |
|---|---|---|
msg_type | int | The signaling connection sends this message to the app when a participant joins a session. For more information, see RTMS_MESSAGE_TYPE. |
event_type | int | A participant has joined the session event. For more information, see RTMS_EVENT_TYPE. |
timestamp | unsigned long | The Unix timestamp of when a participant joined. |
participants | array | The participants in the session. |
user_id | unsigned long | The unique identifier of the participant that joined. |
user_name | string | The username of the participant that joined. |
Participant leave
Sent from the signaling connection
The signaling connection sends participant leave events when a user leaves a session, including when it ends. This message does not require a response from the app.
{
"msg_type": 6,
"event": {
"event_type": 4,
"timestamp": 1727384349123,
"participants": [
{
"user_id": xxxxxxxxxx
},
{
"user_id": xxxxxxxxxx
}
]
}
}
| Field | Type | Description |
|---|---|---|
msg_type | int | The signaling connection sends this message to the app when the participant leaves a session. For more information, see RTMS_MESSAGE_TYPE. |
event_type | int | The participant has left the session event. For more information, see RTMS_EVENT_TYPE. |
timestamp | unsigned long | The Unix timestamp of when the participant left. |
participants | array | The participants that left the session. |
user_id | unsigned int32 | The unique identifier of the participants who have left the session. |
Sharing started
Sent from the signaling connection
The signaling connection sends sharing started events when a user starts sharing their screen if the app has the DESKSHARE scope. This message does not require a response from the app.
{
"msg_type": 6,
"event": {
"event_type": 5,
"timestamp": 1727384349123,
"user_id": 1234234567890,
"user_name": "John Smith"
}
}
| Field | Type | Description |
|---|---|---|
msg_type | int | The signaling connection sends this message when a participant starts sharing their screen. For more information, see RTMS_MESSAGE_TYPE. |
event_type | int | A participant starts sharing their screen. For more information, see RTMS_EVENT_TYPE. |
timestamp | unsigned long | The Unix timestamp when screen sharing started. |
user_id | unsigned int32 | The unique identifier of the participant that started sharing. |
user_name | string | The username of the participant that started screen sharing. |
Sharing stopped
Sent from the signaling connection
The signaling connection sends sharing stopped events when a user stops sharing their screen if the app has the DESKSHARE scope. This message does not require a response from the app.
{
"msg_type": 6,
"event": {
"event_type": 6,
"timestamp": 1727384349123
}
}
| Field | Type | Description |
|---|---|---|
msg_type | int | The signaling connection sends this message when a participant stops sharing their screen. For more information, see RTMS_MESSAGE_TYPE. |
event_type | int | The signaling connection sends this message when screen sharing stops. For more information, see RTMS_EVENT_TYPE. |
timestamp | unsigned long | The Unix timestamp when screen sharing stopped. |
Participant video on
Sent from the signaling connection
The signaling connection sends a participant video on event when a participant enables their camera and is actively streaming video. Use the user_id in this event to send a video subscription request. This message does not require a response from the app.
{
"msg_type": 6,
"event": {
"event_type": 8,
"timestamp": 1727384349123,
"participants": [
{
"user_id": 16778240
},
{
"user_id": 33556610
}
]
}
}
| Field | Type | Description |
|---|---|---|
msg_type | int | The signaling connection sends this message when a participant turns their camera on. For more information, see RTMS_MESSAGE_TYPE. |
event_type | int | A participant's camera is turned on. For more information, see RTMS_EVENT_TYPE. |
timestamp | unsigned long | The Unix timestamp of the event. |
participants | array | List of participants who turned their camera on. |
user_id | unsigned int32 | The unique identifier of the participant in the session. |
Participant video off
Sent from the signaling connection
The signaling connection sends a participant video off event when a participant turns off their camera. No video stream is being sent from that participant. This message does not require a response from the app.
{
"msg_type": 6,
"event": {
"event_type": 9,
"timestamp": 1727384349123,
"participants": [
{
"user_id": 16778240
}
]
}
}
| Field | Type | Description |
|---|---|---|
msg_type | int | The signaling connection sends this message when a participant turns their camera off. For more information, see RTMS_MESSAGE_TYPE. |
event_type | int | A participant's camera is turned off. For more information, see RTMS_EVENT_TYPE. |
timestamp | unsigned long | The Unix timestamp of the event. |
participants | array | List of participants who turned their camera off. |
user_id | unsigned int32 | The unique identifier of the participant in the session. |