Request format
We send a POST request to thecb_url you registered. The event name appears in both the query parameters and the request body:
data; the three outer fields are always the same. time is the Unix timestamp (in seconds) when the event occurred.
Verify the signature (required)
The signature in the callback request headers uses exactly the same algorithm as calls to the server API (see the Overview), just in the opposite direction: this time we sign with yourapp_key and you verify. The request headers are app_id / nonce / timestamp / signature.
Without signature verification, anyone who knows your callback URL can forge events. Don’t skip this step.
Response requirements
- The HTTP status code must be
200 - The response body must be standard JSON:
{"code": 0} - Our request timeout is 10 seconds. Your handler must return within that time (move heavy work to async processing)
code counts as a failure.
Events at a glance
Subscribing is all it takes: the server enables the underlying events it needs based on the
events you subscribe to when you Configure event notifications, with no configuration by the deployer.
This applies from SMeeting server v1.8.0. In earlier versions, device_invite_failed, user_online / user_offline, mcu_record_done, and mcu_alarm
are sent only after the deployer appends the corresponding underlying events to rtc.callback_events in the server configuration (agent_invite_failed; im_connect, im_disconnect, agent_online, agent_offline; mcu_record; mcu_alarm respectively).user_enter — User enters the meeting
role: 0 regular member, 1 host, 2 co-host.
Sent only after the user has actually connected to the meeting (joined its audio/video channel). Users held in the waiting room, or whose join fails partway, do not trigger it.
When the same user_id enters the meeting on multiple devices, the event fires once for each device.
user_exit — User exits the meeting
Has two more fields than user_enter:
reason:1exited voluntarily,2removed,3replaced by the same user entering again,4heartbeat timeout,5meeting destroyed,6switched to audience,7device connection lost7only applies to SIP / H.323 terminals joined through the device gateway: the terminal dropped abnormally (signaling or media timeout, network failure). A normal hang-up on the terminal is still1, so you can tell a normal hang-up from an unexpected droponlineis the number of online members in the meeting after this user exits;0means everyone has exited
online == 0 to tell that “the meeting is actually empty” is more reliable than keeping your own count.
meeting_status_change — Meeting status changes
1 not started, 2 in progress, 3 ended. from_status is included so you can tell
a “normal start” (1→2) apart from cases like “an abnormal restart”.
mcu_status_change — Recording task status changes
task_typeis a bit mask; for the values, see the Cloud recording and stream mixing guidetask_status:0pending,1in progress,2ending,3ended abnormally,4ended normallyerr_deschas content only whentask_status=3record_count/total_duration/total_sizeare the number of files, total duration (seconds), and total bytes produced by this recording
0 and 2 are transitional states. Your backend usually only needs to care about 1 (started), 3 (failed), and 4 (ended).
When the task ends, record_count in this event is often still 0: recording files start transcoding and uploading only after the task ends.
After all files are uploaded, this event is sent again, and the counts in that one are complete.
mcu_record_done — A recording file is ready
task_status changes to 4 (ended normally), the file
is often still being transcoded and uploaded, so requesting the URL then may return nothing.
One recording of a meeting produces multiple files, and this event is sent per file. A recording longer than the segment limit (1 hour by default)
is split into segments by duration, and a recording that resumes after an interruption also starts a new segment. So:
- Get the playback URL by
record_id, nottask_id. See Get the playback URL of a recording file seqstarts at 1, and sorting by it gives the playback order;offset_msis the offset (milliseconds) from the start of the whole recording, for continuous playbackreason:1split by duration,2resumed after an interruption (there is a time gap from the previous segment),3final segment at the end,0unknownis_lastistruewhen all files of this recording are ready
duration is this segment’s duration (seconds), and vod_size is its size in bytes.
mcu_alarm — Recording task error
alarm_brief above means “Stream push interrupted”.) gw is the gateway node running the task. Giving us this value speeds up troubleshooting a lot. Note that an alarm doesn’t mean the task has stopped—
rely on task_status in mcu_status_change.
Push tasks that keep failing also use this event: task_type 0 means it’s a push alarm, and task_id is then the push task’s push_id,
not a recording task, so don’t pass it to mcu/* endpoints; whether the push has recovered is shown by status in List push tasks.
See the Media output guide.
user_mic_state_change / user_camera_state_change / user_extra_screen_state_change — User media status changes
The three events share one structure. Read the status field that matches the event name; the other two are a snapshot at the time of sending:
mic_state/camera_state/extra_screen_state:1on,2off — the same values as the in-meeting member list- Sent only when the status actually flips. The camera counts as on while either its high or low stream is published; both appearing together sends one event
- “Extra screen” means an extra screen pushed by a client (a secondary screen, such as the always-on second view each participant keeps in remote bid evaluation). Each person pushes their own and keeps it on; it is independent of meeting sharing (
share_state_change) - Dual-stream content sharing from a SIP/H.323 endpoint doesn’t use this event; it counts as meeting sharing and shows up in
share_state_change - When one action toggles several media at once (for example, joining with both microphone and camera on), each is sent separately with the same
ts_ms - No “off” events are sent when a user leaves; treat
user_exitas “everything off” - Status reflects whether the stream is being published: a microphone that is only muted locally while still published does not trigger “off”
share_state_change — Meeting sharing status changes
Both start and stop of sharing use this event, for screen sharing and whiteboard sharing alike:
from_state/to_state:0no sharing,1screen,2whiteboard.0→1/2is a start,1/2→0is a stop,1↔2switches the sharing typeuser_idis the person who started or stopped sharing; on stop it is the previous sharer- A stop is sent when the sharer stops, the host stops it, the host disables sharing, or the sharer leaves
- When a new sharer takes over from a sharer who has dropped off, a stop for the previous sharer is sent first, then a start for the new one
- “Start” is sent as soon as sharing is granted, without waiting for the client to actually push the screen
- Dual-stream content sharing from a SIP/H.323 endpoint is meeting sharing too: when the endpoint presses its local share button, this event is sent (the platform can’t start sharing on these endpoints remotely) and
user_idis that device
device_invite_failed — Device invitation failed
Sent when a device invited with Invite devices to the channel (agent/invite) failed to enter:
meeting_id: the current meeting found byroom_no; empty if none is found (for example, the meeting was deleted), and the event is still sentroom_no: the room number given in the invitationdevice: the invited device.typeis the device type (2SIP,3H.323,4GB28181,5RTSP, and so on),contactis the device identifier from the invitation, andnameis the device namecode: whenreasonisjoin_refused, the error code for the refused entry (for example, the meeting has ended);0otherwisemsg: the original description, such as a SIP status line, an H.323 release reason, a stream pull error, or a server message, for troubleshooting
reason values:
- Sent only for devices invited by the platform; failures of devices dialing in by themselves (the endpoint dials the meeting number) are not sent
- At most once per invitation; a device that entered successfully and then dropped off is not an invitation failure, that goes through
user_exit(reason7) - A device already in another meeting that is invited over and refused entry to the new meeting is also sent as
join_refused
user_online / user_offline — User comes online / goes offline
Tells you whether a user is online, regardless of whether they’re in a meeting (for entering and exiting meetings, see user_enter / user_exit). People and devices share these two events, distinguished by is_agent:
- People: a person comes online when the client enables out-of-meeting messages (for example, by calling
smeeting.enableIm()on Web) and establishes an IM connection, and goes offline when they disconnect, are kicked, or time out on heartbeat - Devices: SIP / H.323 endpoints and GB28181 devices connected through the device gateway come online when they register with the device gateway, and go offline when they unregister or time out on heartbeat; direct-IP endpoints are probed periodically by the device gateway: online when reachable, offline when unreachable
user_offline has two more fields than user_online, reason and heartbeat_at, at the same level as the other fields):
- Multi-device sign-in counts per connection: when the same person enables out-of-meeting messages on several clients, each client sends its own online and offline event, distinguished by
sid. To tell whether the person is still online, aggregate thesids of all clients byuser_idyourself; a singleuser_offlinedoesn’t mean the person is offline - Devices count per status change: periodic registration refreshes and heartbeats don’t resend online; an event is sent only when the device actually switches between online and offline, and a device that resumes heartbeats after going offline sends online again
- An offline caused by heartbeat timeout waits for the timeout to be determined, so it’s sent 5–7 minutes after the actual disconnection; when you need the actual disconnection time, use
heartbeat_at - Devices don’t belong to any single app, so every app subscribed to these events receives the same device’s online and offline events
Idempotency and retry
Network jitter can cause the same event to be delivered more than once. Make your handling idempotent byevent + business key (meeting_id, task_id,
user_id). Don’t deduplicate by time—there can be several events of the same type within the same second.
Media status and sharing status events are not guaranteed to arrive in order (for example, when the microphone is toggled quickly, “off” may arrive before “on”).
Trust the one with the largest ts_ms (milliseconds); the three media status fields are a full snapshot at the time of sending, so you can simply overwrite.