Server Callbacks
RTC services provide the following server callbacks to synchronize business data and status notifications to your configured callback addresses. All server callbacks must be enabled in the Console.
Refer to these documents to learn how to configure callbacks in the Console and parse callback data:
- Room Status Update Callback: Notifies your application server about RTC room status changes at specified intervals, including events triggered by call participants, meeting members, or hosts in live streaming rooms.
- CDN Live Streaming Callback: Synchronizes all room relay streaming status changes to your configured application server address in real time.
- Cloud Recording · Status Callback: Synchronizes cloud recording stage data and status to your application server in real time.
- Cloud Screenshot · Status Callback: Synchronizes cloud screenshot stage data and status to your application server in real time.
- Cloud Player · Status Callback: Synchronizes cloud player data and status to your application server in real time.
- Content Moderation · Status Callback: Delivers moderation results to your configured application server address in real time.
RTC callback services use two signature rules. Note that Room Status Update Callback has its own distinct signature method.
Callback Signature Rules for Room Status Update
The following rules apply only to Room Status Update Callback.
When pushing data to your application server (calling your server interface), the Room Status Update service includes four HTTP header fields in POST requests:
Name | Type | Description |
---|---|---|
appKey | String | The appKey assigned to your application by RC. |
nonce | String | Random string (max 18 characters). |
timestamp | String | Unix timestamp in milliseconds. |
signature | String | Data signature. |
Calculating the Signature
Concatenate the App Secret (assigned by RC), Nonce (random string), and Timestamp in order, then compute the SHA1 hash of the combined string.
Validation Example
PHP code example:
$appSecret = 'your-own-app-secret'; // Replace with your App Secret from the Developer Platform.
$nonce = $_GET['nonce']; // Get the random string.
$timestamp = $_GET['timestamp']; // Get the timestamp.
$signature = $_GET['signature']; // Get the data signature.
$local_signature = sha1($appSecret.$nonce.$timestamp); // Generate local signature.
if(strcmp($signature, $local_signature)===0){
// TODO: Add business logic here.
echo 'OK';
} else {
echo 'Error';
}
Signature Rules for Other Callback Services
The following rules apply only to CDN Live Streaming Callback, Cloud Recording · Status Callback, Cloud Screenshot · Status Callback, Cloud Player · Status Callback, and Content Moderation · Status Callback.
When pushing data to your application server, RC includes three HTTP header fields in POST requests (appKey is passed in the request body; refer to callback documentation):
Name | Type | Description |
---|---|---|
RC-Nonce | String | Random string (max 18 characters). |
RC-Timestamp | String | Unix timestamp in milliseconds. |
RC-Signature | String | Data signature. Compute SHA1 hash by concatenating App Secret (from Console), RC-Nonce, and RC-Timestamp in order. |