Skip to main content

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:

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:

NameTypeDescription
appKeyStringThe appKey assigned to your application by RC.
nonceStringRandom string (max 18 characters).
timestampStringUnix timestamp in milliseconds.
signatureStringData 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):

NameTypeDescription
RC-NonceStringRandom string (max 18 characters).
RC-TimestampStringUnix timestamp in milliseconds.
RC-SignatureStringData signature. Compute SHA1 hash by concatenating App Secret (from Console), RC-Nonce, and RC-Timestamp in order.