logo
Voice Call
Server API
Stream Mixing and Transcoding APIs
On this page

Room destroyed Callback


Description

When developers need to know information about when a Room is destroyed, they can obtain it through this Callback.

Callback description

  • Request method: POST.
Note

The Callback data format is JSON. You need to perform UrlDecode decoding on it.

  • Request address: Please configure the Callback address on the ZEGO Console.
  • Transfer protocol: HTTPS/HTTP. HTTPS is recommended.

Callback parameters

Common parametersTypeDescription
eventStringCallback event. The Callback return value for this is room_close.
appidUInt32Unique identifier of the APP.
timestampInt64Server current time, Unix timestamp, unit: seconds.
nonceStringRandom number.
signatureStringVerification string. For details, see Verification Description.
Business parametersTypeDescription
room_idStringRoom ID.
room_session_idUInt64

Unique identifier of the Room lifecycle, which remains unchanged throughout the Room's lifecycle.
After a Room is created, a unique room_session_id is generated. If the Room is destroyed and then a new Room is created with the same room_id, a new unique room_session_id is generated.

This parameter is consistent with the parameter room_seq in the User logged into Room Callback and User logged out of Room Callback.

close_reasonUInt32

Reason for Room destruction.

  • 0: Normal destruction.
  • 1: The last User in the Room had a heartbeat timeout, and the Room was empty, so it was destroyed.
  • 2: The last User in the Room went offline, and the Room was empty, so it was destroyed.
  • 3: The last User in the Room was Kicked out, and the Room was empty, so it was destroyed.
room_close_timeStringRoom destruction time, which is the server current time, Unix timestamp, unit: milliseconds.
Note

It is recommended that you convert some parameters to Int for logical processing. Related fields include room_close_time.

Data example

{
    "event": "room_close",
    "appid": 1,
    "timestamp": 1499676989,
    "nonce": "350176",
    "signature": "signature",
    "room_id": "rid_1242649",
    "room_session_id": 858012925204410400,
    "close_reason": 1,
    "room_close_time": "1499676989909"
}

Return response

Return HTTP status code 2XX (e.g., 200) indicates success, and other responses indicate failure.

Callback retry strategy

If the ZEGO server does not receive a response, or the received HTTP status code is not 2XX (e.g., 200), it will attempt to retry, up to 5 retries. The interval between each retry request and the last request is 2s, 4s, 8s, 16s, and 32s respectively. If the 5th retry still fails, no more retries will be made, and the Callback will be lost.

Previous

Room Created Callback

Next

User Logged in Callback

On this page

Back to top