Skip to main content
In-channel custom messages can carry your own signaling, such as hand raising, whiteboard sync, or status broadcasts. The C interface currently only supports receiving: messages sent by other clients (Web / iOS / Android / Go SDK) through SendCustomMsg are passed through to this callback.

rtc_set_custom_msg_callback

action, sid, uid, channel, and is_private are all strongly typed fields you can use directly. content can be any JSON value (object / array / scalar). The C interface always serializes it into the content_json string and passes it through; parse it yourself with a library such as cJSON or jansson.

Example


Memory and threading

content_json is held by the SDK during the callback and freed as soon as the callback returns. To keep it beyond the callback, you must strdup a copy yourself.The callback fires on an internal SDK thread; don’t do slow work in it.
When content is empty or serialization fails, content_json is NULL. Always check for NULL before parsing.