CSS supports callbacks. To use this feature, you need to create a callback template in the console, configure an address to receive callbacks for an event, and then bind the template with your push domain name. If the event triggers a callback during live streaming, Tencent Cloud will send a request to your server, which is responsible for responding to the request. After successful verification, the server will obtain a JSON packet of the callback through the address configured.
This document describes how to create, modify and delete a callback template in the console.
You can create a callback template in the following ways:
Must-knows
Make sure the HTTP or HTTPS server you use to receive callbacks is able to receive requests and respond normally.
In the console, you can only bind and unbind callback templates at the domain level. For callback rules bound to specific streams by APIs, you need to call DeleteLiveCallbackRule to unbind them. For information about the parameters in a callback, see the following documents:
Creating a Callback Template
Recording Event Notification
3. Click Create Template, fill in the information, select the types of callbacks you want to receive, enter the callback URLs, and click Save.
Callback Type-Standard callbacks
Callback Type-Error callbacks
Configuration Item |
| Description |
Template Name |
| The callback template name, which can contain up to 30 Chinese characters, letters, numbers, underscores (_), and hyphens (-). |
Template Description |
| The description of the callback template, which can contain up to 100 Chinese characters, letters, numbers, underscores (_), and hyphens (-). |
Callback Key |
| |
Callback Type | Standard callbacks | Push Callback: Enter an HTTP or HTTPS address to receive push callbacks. |
|
| Interruption Callback: Enter an HTTP or HTTPS address to receive push interruption callbacks. |
|
| Recording file callback: Enter an HTTP or HTTPS address to receive push Recording file callback. |
|
| Recording status callback: Enter an HTTP or HTTPS address to receive push Recording status callback. |
|
| Recording Callback: Enter an HTTP or HTTPS address to receive recording callbacks. |
|
| Screencapture Callback: Enter an HTTP or HTTPS address to receive screencapture callbacks. |
|
| Porn Detection Callback: Enter an HTTP or HTTPS address to receive porn detection callbacks. |
|
| Quality Control Callback: Enter an HTTP or HTTPS address to receive quality control callbacks. |
|
| Evaluation Threshold Callback: Enter the HTTP or HTTPS address to receive evaluation threshold callbacks. |
|
| Average Score Evaluation Callback: Enter the HTTP or HTTPS address to receive average score evaluation callbacks. |
|
| Smart Wipe Callback: Enter the HTTP or HTTPS address to receive smart erasing callback. |
|
| Live subtitles Callback: The callback information is returned only when a subtitle stream is pulled. Live subtitles Callback: Enter the HTTP or HTTPS address to receive live subtitles callbacks. |
|
| Live Streaming Summary Callback:Enter the HTTP or HTTPS address to receive live streaming summary callbacks. |
|
| Smart Highlight Callback:Enter the HTTP or HTTPS address to receive smart highlight callbacks. |
| Error callbacks | Error callbacks: Enter an HTTP or HTTPS address to receive push error callbacks. |
|
| Recording Error Callback: Enter an HTTP or HTTPS address to receive push Recording callbacks. The Recording Exception Level defaults to "Error", but supports the selection of "Alarm" and allows multiple selections. |
Binding a Domain Name
1. Log in to the CSS console and select Feature Configuration >Live Stream Callback on the left sidebar. 2. You can bind a domain to a template in one of two ways:
Bind a domain to an existing template: Click Bind Domain Name in the top left.
Bind a domain after creating a template: after successfully creating a Callback template,click Bind Domain Name in the dialog box that pops up. 3. In the Bind Domain Name window, select the desired Live Callback template and Push Domain name(Multiple push domain names can be bound simultaneously) , then click on Confirm to successfully bind them.
Unbinding
1. Log in to the CSS console and select Feature Configuration >Live Stream Callback on the left sidebar. 2. Select the Callback template of the bound domain that you want to unbind, then click Unbind.
3. Confirm it if you wish to unbind the current linked domain, and click Confirm to proceed with unbinding.
Modifying a Callback Template
1. Log in to the CSS console and select Feature Configuration >Live Stream Callback on the left sidebar. 2. Select the target callback template and click Edit to modify its information.
3. After modification, click Save.
Deleting a Callback Template
Note:
If the template has been associated, you must first Unbinding it before performing a deletion process. Note that a deleted template cannot be recovered. Proceed with caution.
1. Log in to the CSS console and select Feature Configuration >Live Stream Callback on the left sidebar. 2. Select the successfully created callback template, click Delete in the upper part.
3. Confirm it if you wish to delete the callback template, click Confirm to delete successfully.
Related Operations
You can also unbind and bind domains and callback templates on the Domain Management page. For details, see Callback Configuration.