Server APIs v2
  • Server APIs overview
  • Accessing Server APIs
  • Room signaling
  • Stream mixing
  • Streaming moderation
  • Streaming control
  • CDN recording
  • Server callbacks
  • Return codes
  • API testing
  • FAQ
  • Documentation
  • Server APIs v2
  • Server callbacks
  • Callback on stream mixing ended

Callback on stream mixing ended

Last updated:2022-03-22 13:07

1 Description

For your app server to receive callbacks from the ZEGO server, you need to set up server-to-server callbacks first.

When a stream mixing task on a stream mixing server ends, the stream mixing server notifies your app server by sending a POST request to the pre-configured callback endpoint.

2 Callback request

  • Request method: POST/FORM(Form values need to be decoded using urldecode
  • Request endpoint: the callback address provided by you, which is maintained in the ZEGO Admin Console.
  • Transmission protocol: HTTPS

3 Callback parameters

Parameter Type Description
appid
Uint
App identifier.
event
String
Event name. For this callback, the event name is "mix_stop".
seq
Int
The sequence number of the stream mixing request, which guarantees the requests to be executed in the correct order. It increases by one each time.
task_id
String
Task ID of the stream mixing task. If you specify the task_id in the request that starts the stream mixing task, ZEGO adds your AppID as a prefix to the task_id to form a new task ID. If you don't specify the task_id in the request, ZEGO generates a task ID by concatenating other parameters, such as mix_url and others.
channel_id
String
Channel ID, with a maximum length of 255 bytes. It's equivalent to the Room ID on the client side.
publish_id
String
Publisher ID, with a maximum length of 255 bytes. It's equivalent to the User ID on the client side.
mix_url
String
The URL of the output stream (for RTMP streaming), with a maximum length of 255 bytes.
mix_stream_alias
String
The stream ID of the output stream, with a maximum length of 255 bytes.
timestamp
Int
The current time of the server, a Unix timestamp.
nonce
String
Random number.
signature
String
Signature string for authentication. For more details about the request signature, see Authenticating server-to-server callbacks.

4 Sample request data

Array
(
    [appid] => 111111
    [event]  => mix_stop
    [seq]   => 1234
    [task_id] => aaa
    [channel_id] => 0xb-0x1
    [publish_id] => publish
    [mix_url] => mix_url
    [mix_stream_alias] => aaaa
    [timestamp] => 1481597358
    [nonce] => 158273
    [signature] => signature
)

5 Response

1

The return value 1 indicates success; other values indicate failure.

Page Directory