ApsaraVideo Real-time Communication Callback

Updated at:

ApsaraVideo Real-time Communication provides callback events for channels, users, bypass stream ingest, and stream mixing. You can configure these callback events in the console.

Introduction to callbacks

Callback events allow your business server to receive real-time status changes for channels, users, bypass stream ingest, and stream mixing:

  • Channel callbacks: Events such as a channel being created or dissolved.

  • User callbacks: Events such as a user joining or leaving a channel, switching roles, or starting or stopping stream ingest or pulling.

  • Bypass and stream mixing callbacks: Stream Relay events.

For more information about channel and user callbacks, see Subscribe to channel message callbacks. For more information about bypass and stream mixing callbacks, see Subscribe to stream mixing and ingest events.

Create a callback task

Channel and user callbacks

  1. Log on to the ApsaraVideo Live console.

  2. In the navigation pane on the left, click Live + > ApsaraVideo Real-time Communication > Applications.

  3. Find the application for which you want to create a callback task, click Manage to go to the application management page.

  4. In the navigation pane on the left, choose Callbacks > Channel and User Callbacks, and click Create Task.

  5. Set the callback parameters. The parameters are described in the following table:

    Parameter

    Description

    Callback URL

    The address of your business server that receives callback messages. HTTP and HTTPS are supported. We recommend that you use HTTPS.

    Event Scope

    Callback events include User events and Channel events.

    • User events include the following:

      • Join channel

      • Start screen sharing

      • Leave

      • Stop video ingest

      • Switch role

      • Stop audio ingest

      • Start video ingest

      • Stop screen sharing

      • Start audio ingest

    • Channel events include the following:

      • Channel started

      • Channel ended

    Specified Channel

    Optional. If you do not specify a channel, callbacks are generated for events in all channels by default. If you specify a channel, callbacks are generated only for events in that channel.

    Specified User

    Optional. This parameter applies only to user events. If you specify a user ID, you must also specify a channel ID. You can enter up to 20 user IDs, separated by commas (,).

  6. Click OK to create the task.

Bypass and stream mixing callbacks

  1. Log on to the ApsaraVideo Live console.

  2. In the navigation pane on the left, click Live + > ApsaraVideo Real-time Communication > Applications.

  3. Find the application for which you want to create a callback task and click Manage.

  4. In the navigation pane on the left, choose Callbacks > Mixed-stream Relay Callbacks, and click Configure.

  5. Set the callback parameters. The parameters are described in the following table:

    Parameter

    Description

    Callback URL

    The address of your business server that receives callback messages. HTTP and HTTPS are supported. We recommend that you use HTTPS.

    Channel

    Optional. Specify the channels (ChannelIDs) from which you want to receive callbacks. You can specify up to 20 channels. Separate multiple IDs with commas (,). Each channel ID can contain uppercase letters, lowercase letters, digits, underscores (_), and hyphens (-). The maximum length is 64 characters. If you leave this blank, you will receive callbacks from all channels by default.

Edit and delete callback records

Channel and user callbacks

After you create a channel and user callback task, you can update or delete the task.

  1. Go to the Channel and User Callbacks page and find the task that you want to update or delete.

  2. In the Actions column, click Edit to modify the task or Delete to delete the task.

Bypass and stream mixing callbacks

After you configure bypass and stream mixing callbacks, you can modify or delete the configuration.

After the relay and mixing callback task is configured, the status shows Configured. You can manage the callback task through Modify, Delete, and Sample Callback operations. The page also displays the configured callback URL and channel scope (such as All Channels).

View callback records

After a callback task becomes active, you can view the details of callback events in the callback records.

Callback records retain the callback success or failure data of the last 7 days. You can filter records by time range (Today, Last 3 Days, Last 7 Days, Custom) and Callback ID. Records contain the following fields:

  • Callback ID

  • Callback Time

  • Callback Content

  • Callback URL

  • Request Result

Click the Callback Records tab to filter records by time range (Today, Last 3 Days, Last 7 Days, or Custom) and view the Callback Time, Callback Content, Callback URL, and Request Result.