All Products
Search
Document Center

ApsaraVideo Live:Callback management

Last Updated:Nov 21, 2025

ApsaraVideo Live provides event callbacks for live stream ingest status, live recording, on-demand recording, live snapshots, and automated review. This topic describes how to configure these callbacks and their parameters, and provides examples.

Callback overview

When a specific event is triggered during a live stream, Alibaba Cloud sends a request to your server. Your server must respond to this request. After your server successfully authenticates the request, it receives a JSON data packet that contains the event callback information.

ApsaraVideo Live supports callbacks for the following events:

Callback method

ApsaraVideo Live uses HTTP and HTTPS webhooks to send event notifications. You can deploy an HTTP service to receive callback messages and then configure the webhook address in the ApsaraVideo Live console or using an API.

Note

Some SSL certificates may not be compatible. If a callback fails, you can try using an HTTP webhook.

  • When a stream ingest or interruption event occurs, the ApsaraVideo Live service sends an HTTP GET request to this address. The request details are sent as URL parameters.

  • When other events occur, the ApsaraVideo Live service sends an HTTP POST request to this address. The request details are sent in the JSON body.

Notes

The webhook URL does not require a special identifier but must be publicly accessible. Your server must respond to requests sent to this URL. If a request times out, ApsaraVideo Live retries it. The timeout period is 5 seconds, and the system retries the request up to five times at 1-second intervals.

Live stream ingest callback

You can configure a webhook address in the console or using an API to receive notifications about the stream ingest status for a domain name. These notifications are for events such as successful ingest, stream interruption, and anomalous ingest.

  • How to configure the live stream ingest callback

    • Console

      Log on to the ApsaraVideo Live console. In the navigation pane on the left, choose Feature Management > Event Callbacks. On the Event Callbacks page, select the domain name for which you want to enable callbacks. On the Callback Settings tab, enable the Ingest Callback switch, and then add or modify the callback type and ingest webhook address. For more information, see Ingest callback.

    • API

      Interface

      Description

      References

      SetLiveStreamsNotifyUrlConfig

      Configures an ingest callback.

      For more information, see SetLiveStreamsNotifyUrlConfig.

      DescribeLiveStreamsNotifyUrlConfig

      Queries the configuration of an ingest callback.

      Query the callback configuration for live stream ingest

      DeleteLiveStreamsNotifyUrlConfig

      Deletes the configuration of an ingest callback.

      For more information, see DeleteLiveStreamsNotifyUrlConfig.

  • Inference Stream Callback

    The inference stream callback provides parameters encapsulated in a MultiDict.

    • Callback logic for the publish status in ingest and interruption callbacks

      1. For an RTMP stream, ApsaraVideo Live sends a successful ingest callback within 2 seconds after it receives an On Publish message, provided that the ingest client does not disconnect.

      2. Consider a scenario where you have an ingest domain A and a streaming domain B. If you require callbacks for stream pulling (scheduled stream pulling or on-demand origin fetch) on domain B, you must configure the Stream Ingest Callback on domain A. After the configuration is complete, the callback logic for stream pulling on domain B is the same as the logic described in the previous step. By default, stream pulling is considered successful if the connection is established and is not actively disconnected within 2 seconds.

      Note
      • Do not rely solely on callbacks to determine whether stream ingest and pulling are normal. You should also call the DescribeLiveStreamsOnlineList operation to query the list of active streams. Distribute the playback URL only after you confirm that the stream ingest is normal.

      • If no stream data is pushed to the live center for 10 seconds or more, the ApsaraVideo Live service automatically disconnects the stream.

    • Parameters for the inference stream callback

      Parameter

      Description

      action

      The event.

      • publish: stream ingest.

      • publish_done: stream interruption.

      ip

      The IP address of the ingest client.

      id

      The StreamName.

      app

      The ingest domain name. By default, this is your custom ingest domain name. If no ingest domain name is attached, this is the streaming domain name.

      appname

      The AppName.

      time

      The UNIX timestamp. Unit: seconds.

      usrargs

      The user-defined ingest parameters.

      node

      The name of the CDN node or server that receives the stream.

      height

      The height of the resolution. Unit: pixel.

      Note

      Resolution information (height and width) is generated only in the first callback.

      width

      The width of the resolution. Unit: pixel.

    • Example of ingest status callback parameters:

      http://1.1.X.X?action=publish&ip=192.168.0.1&id=world&app=example.aliyundoc.com&appname=liveApp****&time=1609220385&usrargs={user_parameters}&
      node=cdnvideocenter01020711****.cm3&height=720&width=1280
    • Example of stream interruption status callback parameters:

      http://1.1.X.X?action=publish_done&ip=192.168.0.0&id=world&app=example.aliyundoc.com&appname=liveApp****&time=1609220385&usrargs={user_parameters}&
      node=cdnvideocenter01020711****.cm3&height=720&width=1280
    • Anomalous ingest event callback

      • Anomalous ingest event callback parameters

        Parameter

        Description

        action

        publish_exception_notify.

        domain

        The ingest domain name.

        appname

        The AppName.

        stream

        The StreamName.

        ip

        The IP address of the ingest client.

        time

        The time of the callback.

        type

        The event type.

        event_time

        The time of the event occurrence.

      • Anomaly types

        Event code

        Event type

        1001

        The URL contains invalid characters.

        2001

        The video codec is in the blacklist.

        2002

        The video codec is not in the whitelist.

        2003

        The audio codec is in the blacklist.

        2004

        The audio codec is not in the whitelist.

        3001

        Failed to parse the audio header.

        3002

        Failed to parse the video header.

        3003

        Failed to parse the metadata.

        4001

        The video width and height are inconsistent.

        4002

        The metadata does not contain audio data, but audio data is sent.

        4003

        The actual audio and video data does not match the header.

        4004

        The metadata does not contain video data, but video data is sent.

        4005

        The audio codec information changed mid-stream.

        4006

        The video codec information changed mid-stream.

        4007

        An audio frame was received before the audio High Dynamic Range (HDR) information.

        4008

        A video frame was received before the video HDR information.

        5001

        The Composition Time Stamp (CTS) fluctuates excessively.

        5002

        The Decoding Time Stamp (DTS) is not incremental.

        5003

        The difference between the audio and video timestamps is too large.

        5004

        The audio DTS increases excessively.

        5005

        The video DTS increases excessively.

        5006

        The interval for receiving audio frames is too long.

        5007

        The interval for receiving video frames is too long.

        5008

        The Group of Pictures (GOP) is too large.

      • Example of anomalous ingest event callback parameters:

        {
        "action": "publish_exception_notify",
        "domain": "demo.aliyundoc.com",
        "appname": "liveApp****",
        "stream": "liveStream****",
        "ip": "141.01.****"
        "time": "1739760710"
        "type": "5002"
        "event_time": "1739760710"
        }
    • Authentication for live stream ingest callbacks

      1. The authentication feature for ingest callbacks is disabled by default. You can enable it when you configure the ingest webhook address. After you enable this feature, the authentication logic is as follows:

        When ApsaraVideo Live sends a callback request, it includes the ALI-LIVE-TIMESTAMP and ALI-LIVE-SIGNATURE fields in the HTTP or HTTPS request header. Your server can use these fields for signature authentication. The value of ALI-LIVE-SIGNATURE is calculated as follows:

        ALI-LIVE-SIGNATURE = MD5SUM(MD5CONTENT)

        MD5CONTENT = Ingest domain name|Value of ALI-LIVE-TIMESTAMP|Authentication Key

        Note

        The ingest domain name is the domain name for which the webhook URL is configured. The Authentication Key is the key that you configure for the ingest webhook URL.

      2. When your server receives a callback message, it must concatenate the ingest domain name, the value of ALI-LIVE-TIMESTAMP, and the Authentication Key. Then, it calculates the MD5 hash of the concatenated string to generate a signature string. The server must then compare the generated signature string with the value of the ALI-LIVE-SIGNATURE field in the HTTP or HTTPS request header from ApsaraVideo Live. If the two strings do not match, the request is considered invalid.

    • Authentication for live stream ingest status callbacks

      By default, authentication for stream ingest callbacks is disabled. You can enable the feature when you specify the stream ingest callback URL. After you enable the feature, the following authentication logic applies:

      1. When ApsaraVideo Live initiates a callback request, it includes the ALI-LIVE-TIMESTAMP and ALI-LIVE-SIGNATURE headers in the HTTP or HTTPS request so that the callback message receiving server can authenticate the signature. The value of ALI-LIVE-SIGNATURE is calculated based on the following formula:

        ALI-LIVE-SIGNATURE = MD5SUM (MD5CONTENT)

        MD5CONTENT = Domain name|ALI-LIVE-TIMESTAMP value|Cryptographic key

        Note

        Domain name is the ingest domain for which you configure the callback URL. Cryptographic key is the cryptographic key that you specify for the callback URL.

      2. After receiving a callback message, the callback message receiving server concatenates the domain name of the callback, value of the ALI-LIVE-TIMESTAMP header, and cryptographic key in the preceding format. The server calculates the MD5 value of the string to obtain an encrypted string. Then, the server compares the encrypted string with the value of the ALI-LIVE-SIGNATURE header in the HTTP or HTTPS request initiated by ApsaraVideo Live. If the two values are different, the request is invalid.

Live recording callback

Live recording callbacks include recording status callbacks, file generation callbacks, and recording error callbacks.

  • How to configure live recording callbacks

    • Console

      Log on to the ApsaraVideo Live console. In the navigation pane on the left, choose Feature Management > Event Callbacks. On the Event Callbacks page, select the domain name for which you want to enable callbacks. On the Callback Settings tab, enable the Recording Callback switch, and then add or modify the webhook address. For more information, see Recording callback.

    • API

      API operation

      Description

      References

      AddLiveRecordNotifyConfig

      Adds a domain-level recording callback configuration.

      To enable recording task status callbacks, set the NeedStatusNotify parameter to true.

      For more information, see AddLiveRecordNotifyConfig.

      DescribeLiveRecordNotifyConfig

      Queries a domain-level recording callback configuration.

      Querying the Live Recording Callback Configuration

      DeleteLiveRecordNotifyConfig

      Deletes a domain-level recording callback configuration.

      For more information, see DeleteLiveRecordNotifyConfig.

  • Recording status callback: This callback is sent when a file starts or stops recording to indicate the recording status.

    • Recording status callback parameters

      Parameter

      Description

      domain

      The streaming domain name used for recording.

      app

      The AppName.

      stream

      The StreamName.

      event

      The event name.

      • record_started: The recording has successfully started.

      • record_paused: The recording has been successfully paused.

    • Example of recording status callback parameters

      {
      "domain": "demo.aliyundoc.com",
      "app": "liveApp****",
      "stream": "liveStream****",
      "event": "record_started"
      }
  • File generation callback: This callback is sent when a recording file is generated. It includes details such as the filename, start and end times, and duration.

    • File generation callback parameters

      Parameter

      Description

      domain

      The streaming domain name used for recording.

      app

      The AppName.

      stream

      The StreamName.

      uri

      The path of the recording file in your OSS bucket.

      record_id

      The ID of the manifest.

      file_url

      The URL of the recording file.

      duration

      The duration of the recording file. Unit: seconds.

      start_time

      The recording start time. This is a UNIX timestamp. Unit: seconds.

      stop_time

      The recording end time. This is a UNIX timestamp. Unit: seconds.

      is_finished

      Indicates whether the recording is complete.

      file_url

      The URL of the recording file.

      oss_endpoint

      The name of the OSS storage Endpoint.

      oss_bucket

      The name of the OSS storage bucket.

      push_args

      Parameters prefixed with `callback_` in the ingest URL, such as `callback_arg1` and `callback_myid`.

      Note

      Custom parameters cannot be passed for transcoded recording streams.

      Each parameter name can have only one value. If multiple values are passed for the same parameter, the callback includes only the first value. For example, if the ingest parameters include callback_args1=value1&callback_args1=value2, the callback will still be "callback_args1": "value1".

    • Example of file generation callback parameters

      The ingest URL is:

      rtmp://demo.aliyundoc.com/liveApp****/liveStream****?callback_args1=value1&callback_myid=1231389741

      The callback content is:

      {
        "domain": "demo.aliyundoc.com",
        "app": "liveApp****",
        "stream": "liveStream****",
        "uri": "liveApp****/liveStream****/0_2017-03-08-23:09:46_2017-03-08-23:10:40.flv",
        "file_url": "http://****.oss-****.aliyuncs.com/liveApp****/liveStream****/0_2017-03-08-23:09:46_2017-03-08-23:10:40.flv",
        "duration": 69.403,
        "start_time": 1488985786,
        "stop_time": 1488985840,
        "push_args": {
          "callback_args1": "value1",
          "callback_myid": "1231389741"
        }
      }
      Note

      The preceding callback example applies to all customers who do not have a custom callback template.

  • Recording error callback: If an error occurs during recording or container format conversion (to MP4 or FLV) because of an abnormal source stream or an OSS write failure, an error callback is triggered.

    • Recording error callback parameters

      Parameter

      Description

      domain

      The streaming domain name used for recording.

      app

      The AppName.

      stream

      The StreamName.

      event

      The event name.

      • record_error: A recording error occurred.

      • transformat_error: A container format conversion error occurred.

      error_info

      The error message in JSON format. It includes the following fields:

      • code: The error code.

      • message: The error message description.

      file_info

      The file information. This exists only for container format conversion errors and includes the following fields:

      • uri: The storage address of the converted file.

      • start_time: The time when the file recording started.

      • stop_time: The time when the file recording stopped.

    • Example of recording error callback parameters

      Recording error

      {
          "domain": "example.com",
          "app": "live",
          "stream": "stream123",
          "event": "record_error",
          "error_info": {
              "code": "TsSegmenterFail",
              "message": "ts segmenter error"
          }
      }

      List of error codes:

      Code

      Message

      Description

      BucketNotFound

      Bucket not found

      The bucket does not exist or was deleted.

      AccessDenied

      Bucket not belong config userId

      The bucket does not belong to the account ID configured for recording.

      StreamFormatError

      video stream format error

      The live stream format is invalid.

      UserDisable

      Unauthorized access to OSS by user

      The user is not authorized to access OSS, or the authorization was deleted.

      Container format conversion error

      {
          "domain": "example.com",
          "app": "live",
          "stream": "stream123",
          "event": "transformat_error",
          "error_info": {
              "code": "PermissionDenied.ResourceAccess",
              "message": "MTS not authorized to operate on the OutputBucket"
          },
          "file_info": {
              "uri": "record/live/stream123/2025-11-19-03-17-03_2025-11-19-03-28-39.flv",
              "start_time": 1763493420,
              "stop_time": 1763494119
          }
      }

      List of error codes:

      Code

      Message

      Description

      InvalidParameter.ResourceNotFound

      The resource operated cannot be found

      The bucket does not exist or was deleted.

      InvalidParameter.ResourceContentBad

      The resource operated InputFile is bad

      The container format conversion failed due to poor quality of the source stream.

      PermissionDenied.ResourceAccess

      MTS not authorized to operate on the OutputBucket

      The user is not authorized to access OSS, or the authorization was deleted.

On-demand recording callback

The on-demand recording callback lets you decide whether to record a stream. Before recording starts, ApsaraVideo Live sends a callback with stream parameters to your server.

You can specify a webhook address and set a domain, app, or stream for on-demand recording. When the recording service receives a stream that matches the domain, app, or stream name, it sends a request with five parameters to your webhook address to determine whether to record this stream.

  • Request parameters

    ParameterTypeDescription
    domainStringThe main streaming domain.
    appStringThe name of the application to which the live stream belongs.
    streamStringThe name of the live stream.
    codecStringThe encoding format. Valid values:
    • h264
    • h265
    vbitrateStringThe bitrate of the video. Unit: Kbit/s.
  • Response parameters

    ParameterTypeRequiredDescription
    ApiVersionStringNo

    The version of the API. The default version is 1.0.

    NeedRecordBoolYesIndicates whether recording is required.
    IntervalJSONObjectNoThe duration of the recording in each format in each cycle. Valid values: 5 to 21600. Unit: seconds.
    FormatJSONArrayNoThe format of the recording. The recording can be in the MP4, FLV, or M3U8 format.
  • Request example

    GET /?app=seq_all&domain=demo.aliyundoc.com&stream=ondemand8&vbitrate=2000&codec=h264 HTTP/1.1
    Host: pull.aliyundoc.com
    User-Agent: Go-http-client/1.1
    Accept-Encoding: gzip
  • Response example

    {
        "ApiVersion" : "1.0",
        "NeedRecord" : true,
        "Interval" : {
            "Mp4": 300,
            "Flv": 120,
            "M3U8": 180
        },
        "Format" : ["mp4","flv"]
    }
  • Response parameter handling

    The recording service overwrites the existing configuration with the parameters returned by your server. For example, if you specify `Interval`, the recording service overwrites the `Interval` value in the database. For the `Format` parameter, the service calculates the intersection of the specified formats and the formats in the database. If none of the formats that you specify match the existing configuration, the stream is not recorded.

    Note
    • Any HTTP status code other than 200 is considered a failed API call.

    • The response body is limited to 2,048 bytes. A longer response is truncated to prevent malicious attacks.

Live snapshot callback

ApsaraVideo Live supports callbacks for live snapshot results. You can configure the webhook address in the console or using an API.

  • How to configure snapshot callbacks

    • Console

      Log on to the ApsaraVideo Live console. In the navigation pane on the left, choose Feature Management > Event Callbacks. On the Event Callbacks page, select the domain name for which you want to enable callbacks. On the Callback Settings tab, enable the Snapshot Callback switch, and then add or modify the webhook address. For more information, see Snapshot callback.

    • API

      Interface

      Description

      References

      AddLiveSnapshotNotifyConfig

      Adds a snapshot callback configuration.

      For more information, see AddLiveSnapshotNotifyConfig.

      UpdateLiveSnapshotNotifyConfig

      Modifies a snapshot callback configuration.

      Update Snapshot Notification Configuration

      DescribeLiveSnapshotNotifyConfig

      Queries a snapshot callback configuration.

      Retrieve snapshot callback configuration

      DeleteLiveSnapshotNotifyConfig

      Deletes a snapshot callback configuration.

      Delete a callback configuration for live snapshots

    • Snapshot file callback parameters

      Parameter

      Description

      Event

      The event.

      DomainName

      The streaming domain name used for the snapshot.

      AppName

      The AppName.

      StreamName

      The StreamName.

      OssBucket

      The name of the bucket where the snapshot is stored.

      OssEndpoint

      The OSS Endpoint where the snapshot is stored.

      OssObject

      The filename of the snapshot.

      CreateTime

      The time when the snapshot was taken.

      SnapshotUrl

      The path of the snapshot file in your OSS bucket.

      Size

      The image size. Unit: bytes.

      Width

      The image width. Unit: pixel.

      Height

      The image height. Unit: pixel.

    • Example of snapshot file callback parameters

      {
          "Event":"Snapshot",
          "DomainName":"demo.aliyundoc.com",
          "AppName":"liveApp****",
          "StreamName":"liveStream****",
          "OssBucket":"liveBucket****",
          "OssEndpoint":"oss-cn-shan****.aliyuncs.com",
          "OssObject":"1****.jpg",
          "CreateTime":"2015-12-01T17:36:00Z",
          "SnapshotUrl":"http://liveBucket****.oss-cn-shan****.aliyuncs.com/1****.jpg",
          "Size":"36291",
          "Width":"1280",
          "Height":"720"
      }
    • ApsaraVideo Live supports authentication for snapshot callbacks. For more information, see SetSnapshotCallbackAuth and Snapshot callback authentication.

Automated review callback

ApsaraVideo Live supports result callbacks for video review and voice review. You can configure the webhook address in the console or using an API.

  • How to configure video review callbacks

    • Console

      Log on to the ApsaraVideo Live console. In the navigation pane on the left, choose Feature Management > Event Callbacks. On the Event Callbacks page, select the domain name for which you want to enable callbacks. On the Callback Settings tab, enable the Video Review Callback switch, and then add or modify the webhook address. For more information, see Video review callback.

      Note

      Currently, the automated review feature is available only in some live centers. For more information about the live centers that support this feature, see Service regions.

    • API

      Interface

      Description

      References

      AddLiveDetectNotifyConfig

      Adds a video review callback configuration.

      For more information, see AddLiveDetectNotifyConfig.

      DescribeLiveAudioAuditNotifyConfig

      Queries a video review callback configuration.

      Query the callback configuration for live stream moderation

      UpdateLiveDetectNotifyConfig

      Updates a video review callback configuration.

      For more information, see UpdateLiveDetectNotifyConfig.

      DeleteLiveDetectNotifyConfig

      Deletes a video review callback configuration.

      For more information, see DeleteLiveDetectNotifyConfig.

  • Video review callback

    Callbacks are sent only for video content that is flagged as problematic. The notification includes the review results and storage information for the snapshot of the problematic video.

    • Video review callback parameters

      Parameter

      Type

      Description

      DomainName

      String

      The streaming domain name.

      AppName

      String

      The AppName.

      StreamName

      String

      The StreamName.

      OssEndpoint

      String

      The Endpoint of the storage object.

      OssBucket

      String

      The bucket of the storage object.

      OssObject

      String

      The filename of the storage object.

      Result

      JSONArray

      The detection result. For more information, see Result.

      Table 1. Result

      Parameter

      Type

      Description

      BizType

      String

      The business type. This can be used to select a model. The default value is the domain name.

      Scene

      String

      The detection scenario.

      • porn: pornography detection.

      • terrorism: terrorism and politically sensitive content.

      • ad: text and image violations.

      • live: undesirable scenes.

      • logo: image logos.

      Label

      String

      The classification of the detection result. The classifications vary based on the detection scenario:

      • Image pornography detection (porn) result classifications:

        • normal: normal.

        • sexy: sexy.

        • porn: pornographic.

      • Image terrorism and politically sensitive content (terrorism) result classifications:

        • normal: normal.

        • bloody: bloody.

        • explosion: explosion and smoke.

        • outfit: special attire.

        • logo: special logo.

        • weapon: weapon.

        • politics: politically sensitive.

        • violence : fighting.

        • crowd: crowd.

        • parade: Parade

        • carcrash: car crash scene.

        • flag: flag.

        • location: landmark.

        • others: others.

      • Text and image violations (ad) result classifications:

        • normal: normal.

        • ad: other advertisements.

        • npx: spam ad.

        • qrcode: contains QR code.

        • programCode: contains Mini Program code.

      • Undesirable scenes (live) result classifications:

        • normal: normal.

        • meaningless: no content in the image, such as a black or white screen.

        • PIP: Picture-in-Picture.

        • smoking: smoking.

        • drivelive: in-vehicle streaming.

      • Image logos (logo) result classifications:

        • normal: normal.

        • TV: contains a controlled logo.

        • trademark: contains a trademark.

      Rate

      Float

      The confidence score. Valid values: 0 (lowest confidence) to 100 (highest confidence).

      Note

      This value is for reference only. We strongly recommend that you do not use it in your business logic. Use the Label result to determine content violations.

      Extent

      String

      Reserved field.

      Note

      By default, new users use this version. Existing users remain on their current version. To upgrade to this version, submit a ticket. For more information about how to submit a ticket, see Contact us.

    • Example of video review callback parameters

      {
       "DomainName": "demo.aliyundoc.com",
       "AppName": "liveApp****",
       "StreamName": "liveStream****",
       "OssEndpoint": "oss-cn-hang****.aliyuncs.com",
       "OssBucket": "liveBucket****",
       "OssObject": "example.jpg",
       "Result": [
           {
               "BizType": "demo.aliyundoc.com",
               "Result": [
                   {"Label": "Porn", "Rate":11, "Suggestion": "review", "Scene":"porn", "Extent": {}},
                   {"Label": "Ad", "Rate":11, "Suggestion": "review", "Scene":"ad", "Extent": {}}
               ]
           }
       ]
      }
                          
  • How to configure voice review callbacks

    • Console

      Log on to the ApsaraVideo Live console. In the navigation pane on the left, choose Feature Management > Event Callbacks. On the Event Callbacks page, select the domain name for which you want to enable callbacks. On the Callback Settings tab, enable the Voice Review Callback switch, and then add or modify the webhook address. For more information, see Voice review callback.

    • API

      API operation

      Description

      References

      AddLiveAudioAuditNotifyConfig

      Adds a voice review callback configuration.

      Important

      The response for a voice review callback is a JSON string.

      For more information, see AddLiveAudioAuditNotifyConfig.

      DeleteLiveAudioAuditNotifyConfig

      Deletes a voice review callback configuration.

      For more information, see DeleteLiveAudioAuditNotifyConfig.

      UpdateLiveAudioAuditNotifyConfig

      Updates a voice review callback configuration.

      For more information, see UpdateLiveAudioAuditNotifyConfig.

      DescribeLiveAudioAuditNotifyConfig

      Queries a voice review callback configuration.

      For more information, see DescribeLiveAudioAuditNotifyConfig.

  • Voice review callback

    Callbacks are sent only for audio content that is flagged as problematic. The notification includes the transcribed text of the problematic audio and the context from the last minute.

    • Voice review callback parameters

      Parameter

      Type

      Description

      domain

      String

      The streaming domain name.

      app

      String

      The AppName.

      stream

      String

      The StreamName.

      timestamp

      Int

      The callback timestamp. Unit: seconds.

      result

      JSONArray

      The detection result. For more information, see Result.

      Table 2. Result

      Parameter

      Type

      Description

      scene

      String

      The detection scenario.

      label

      String

      The classification of the detection result. Valid values:

      • normal: normal text

      • spam: Junk or unsolicited content

      • ad: advertisement

      • politics: politically sensitive

      • terrorism: terrorism

      • abuse: abusive language

      • porn: pornographic

      • flood: flooding

      • contraband: prohibited items

      • meaningless: meaningless

      suggestion

      String

      The recommended action. Valid values:

      • pass: The result is normal. No further action is needed.

      • review: The result is uncertain. Manual review is required.

      • block: The result is a violation. We recommend that you delete the content or restrict its visibility.

      rate

      Float

      The confidence score. Valid values: 0 (lowest confidence) to 100 (highest confidence).

      Note

      This value is for reference only. We strongly recommend that you do not use it in your business logic. Use the Label result to determine content violations.

      details

      JSONArray

      The details of the text corresponding to the audio. Each sentence corresponds to an element. It can contain one or more elements. For a description of the structure of each element, see Detail.

      Table 3. Detail

      Parameter

      Type

      Description

      startTime

      Int

      The start timestamp of the sentence. Unit: seconds.

      endTime

      Int

      The end timestamp of the sentence. Unit: seconds.

      text

      String

      The text converted from the problematic audio.

      label

      String

      The classification of the detection result. Valid values:

      • normal: normal text

      • spam: Contains junk content

      • ad: advertisement

      • politics: politically sensitive

      • Terrorism

      • abuse: abusive language

      • porn: pornographic

      • flood: flooding

      • contraband: prohibited items

      • Meaningless: meaningless

    • Example of voice review callback parameters

      {
          "domain": "example.aliyundoc.com",
          "app": "liveApp****",
          "stream": "5d9747eba39b44769852d276f9ff****",
          "timestamp": 1572248095,
          "result": [
              {
                  "scene": "antispam",
                  "label": "ad",
                  "suggestion": "block",
                  "rate": 99.91,
                  "details": [
                      {
                          "startTime": 1572248023,
                          "endTime": 1572248040,
                          "text": "Free 120-day stay at Lijiang Longchuan and other hotels. The right to stay can be shared with friends and family. Come to the Yunqi She International Hotel reception center at 96 Tuanjie Street, Mangshi, next to Dengchao KTV. For inquiries, call 2285699.",
                          "label": "ad"
                      },
                      {
                          "startTime": 1572248040,
                          "endTime": 1572248070,
                          "text": "Classic collection villas, enjoy Longduo Hot Spring, Lianghe Golden Pagoda, and Hot Spring Tourist Town Phase II Binjiangyuan area. Grand opening on November 2nd. Natural hot spring water piped into every home. Diverse and classic layouts, great value. You deserve it. Super value offers on the opening day. You are welcome to come and see. Address: 229 Xianfeng Road, Zhedao Town, Lianghe County. Hotline: 0692695577769***",
                          "label": "normal"
                      },
                      {
                          "startTime": 1572248072,
                          "endTime": 1572248077,
                          "text": "Happy times are spent with you. Relaxed days are especially easy.",
                          "label": "normal"
                      },
                      {
                          "startTime": 1572248078,
                          "endTime": 1572248086,
                          "text": "fme043 taking a break from the busy schedule for some music time, warmed by songs, and thinking of you at the cinema.",
                          "label": "normal"
                      }
                  ]
              }
          ]
      }

Dual-stream disaster recovery callback

This callback provides notifications about the results of stream switching for dual-stream disaster recovery.

  • How to configure callbacks:

  • Stream switching callback:

    Parameter

    Description

    action

    The event type: multistream_set_master_result, which indicates the stream switching result.

    domain

    The ingest domain name.

    appname

    The AppName.

    streamname

    The StreamName.

    upstreamsequence

    The identifier of the primary stream after the switch.

    upstreamip

    The IP address of the ingest client for the primary stream after the switch.

    upstreamtime

    The start time of the ingest for the primary stream after the switch. This is a UNIX timestamp. Unit: seconds.

    changereason

    The reason that triggered the stream switch.

    changetime

    The time when the stream switching operation was performed. This is a UNIX timestamp. Unit: seconds.

    time

    The time when the callback notification was generated. This is a UNIX timestamp. Unit: seconds.

  • Callback example:

    {
      "action": "multistream_set_master_result",
      "domain": "demo.aliyundoc.com",
      "appname": "liveApp****",
      "streamname": "liveStream****",
      "upstreamsequence": "main",
      "upstreamip": "203.**.***.10",
      "upstreamtime": 17*****710,
      "changereason": "merge_cut_manually",
      "changetime": 17*****705,
      "time": 17*****706
    }