tencent cloud

Feedback

Relay Event Notification

Last updated: 2024-04-25 10:48:27
    Relay callbacks are used to call back status information of relay tasks. You need to configure the callback address in a relay task and then Tencent Cloud CSS backend will call back different results to the specified server.
    This document describes the parameters in callback message notifications sent by Tencent Cloud CSS after a stream push/interruption callback event is triggered.

    Notes

    1. You need to understand how to configure callbacks and how will you receive messages via Tencent Cloud CSS before reading this document. For more information, see How to Receive Event Notifications.
    2. If the task has not reached its end time, continuous retries due to source or destination address unavailability, or automatic task migration due to machine abnormalities, will generate task end callbacks. Do not use these callbacks as the final task end callbacks.
    3. If you need to determine whether the task is streaming properly, you can do so from the receiving end, such as using the stream interruption callback in Cloud Streaming Services or the stream status query API, etc.

    Relay Event Parameters

    Event type parameters

    Event Type
    Parameter Value
    Relay
    event_type = 314

    Common callback parameters

    Parameter
    Type
    Description
    appId
    int
    User APPID
    callback_event
    string
    Callback event type
    source_urls
    string
    Pull source URLs
    to_url
    string
    Push destination URL
    stream_id
    string
    Live stream name
    task_id
    string
    Task ID
    event_time
    string
    Event timestamp, for example: 1712893433

    Parameters in msg

    Parameter
    Type
    Description
    task_start_time
    int
    Task start timestamp, in milliseconds
    url
    string
    Source URL of the current pull task
    index
    string
    Index of the list for on-demand files
    duration
    int
    Duration of an on-demand file, in seconds
    task_exit_time
    int
    Task stop timestamp, in milliseconds
    code
    string
    Task stop error code
    message
    string
    Task stop error message

    Sample callback message

    TaskStart - Callback of the task start event
    VodSourceFileStart - Callback of the on-demand file’s start
    VodSourceFileFinish - Callback of the on-demand file’s end
    TaskExit - Callback of the task stop event
    {
    "appid": 4,
    
    "callback_event": "TaskStart",
    
    "event_type": 314,
    
    "interface": "general_callback",
    
    "msg": "{\\"task_start_time\\":0}",
    
    "product_name": "pullpush",
    
    "source_urls": "[\\"http://yourURL.cn/live/normal_230753472*****21162358-upload-45eb/playlist.m3u8\\"]\\n",
    
    "stream_id": "testvod",
    
    "task_id": "118148",
    
    "to_url": "rtmp://xxx.livepush.myqcloud.com/live/testvod"
    }
    
    {
    "appid": 4,
    
    "callback_event": "VodSourceFileStart",
    
    "callback_url": "http://you.callback.url",
    
    "event_type": 314,
    
    "interface": "general_callback",
    
    "msg": "{\\"url\\":\\"http://remit-tx-ugcpub.douyucdn2.cn/live/normal_466247620*****3100448-upload-216b/playlist.m3u8\\",\\"index\\":0,\\"duration\\":14920}",
    
    "product_name": "pullpush",
    
    "source_urls": "[\\"http://yourURL.cn/live/normal_466247620*****3100448-upload-216b/playlist.m3u8\\"]\\n",
    
    "stream_id": "testvod",
    
    "task_id": "118145",
    
    "to_url": "rtmp://xxx.livepush.myqcloud.com/live/testvod"
    }
    
    {
    "appid": 4,
    
    "callback_event": "VodSourceFileFinish",
    
    "callback_url": "http://you.callback.url",
    
    "event_type": 314,
    
    "interface": "general_callback",
    
    "msg": "{\\"url\\":\\"http://yourURL.cn/live/normal_466247620*****3100448-upload-216b/playlist.m3u8\\",\\"index\\":0,\\"duration\\":14920}",
    
    "product_name": "pullpush",
    
    "source_urls": "[\\"http://yourURL.cn/live/normal_466247620*****3100448-upload-216b/playlist.m3u8\\"]\\n",
    
    "stream_id": "testvod",
    
    "task_id": "118145",
    
    "to_url": "rtmp://xxx.livepush.myqcloud.com/live/testvod"
    }
    {
    "appid": 4,
    
    "callback_event": "TaskExit",
    
    "event_type": 314,
    
    "interface": "general_callback",
    
    "msg": "{\\"message\\":\\"write packet error.\\",\\"code\\":-22,\\"task_exit_time\\":0}",
    
    "product_name": "pullpush",
    
    "source_urls": "[\\"http://yourURL.cn/live/normal_230753472*****21162358-upload-4\\"]\\n"
    }
    Note:
    Sequence of callbacks for relay tasks with “Video on-demand” as the source content: TaskStart - Callback of the task start event > VodSourceFileStart - Callback of the on-demand file’s start > VodSourceFileFinish - Callback of the on-demand file’s end.
    There is an interval of up to 2s between TaskStart and VodSourceFileStart callbacks.
    Callback settings are included in the relay task configuration. For detailed directions, see Relay.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support