Documentation
zim In-app Chat
Documentation
Demo APP
SDK Center
API Center
FAQ
Code Market
Console
Sign Up
Log In
中文站 English
  • Documentation
  • In-app Chat
  • Server APIs
  • Server callbacks
  • Callback on call invitation canceled

Callback on call invitation canceled

Last updated:2024-08-06 19:54

Overview

When the following situations occur (which can be divided into two types), your server can receive a callback on the call invitation cancellation from the ZIM server, in order to determine the call status:

  • Cancelled by caller:

    • The caller cancels the call.
    • After the initialization of the call invitation and before its timeout, no callee accepts the invitation, and the caller logs out.
    • After the initialization of the call invitation and before its timeout, no callee accepts the invitation, and the caller goes offline due to heartbeat timeout.
  • Cancelled by timeout:

    • From the initialization of the call invitation to its timeout, no callee responds to the invitation, and the caller is still online.

      From the initialization of the call invitation to its timeout, if no callee responds to the invitation, and the caller is still offline, it will trigger the

      If after the call is successfully created and before the call times out, if no call recipient responds and the calling user goes offline, it will trigger the callback on call invitation timed out .

Callback description

  • Request method: POST.

    The callback data format is JSON, and you need to perform UrlDecode decoding on it.

  • Request URL: Configure the callback URL in the ZEGOCLOUD console.
  • Protocol: HTTPS/HTTP. HTTPS is recommended.

    Callback parameters

Parameter Type Description
appid String The unique ID of an app.
event String The callback event. The return value is call_create.
nonce String A random number.
signature String The verification string. For more information, see Authenticating server-to-server callbacks.
timestamp Int The Unix timestamp of the server.
call_id String The ID of the caller.
user_ids Array The list of IDs of users to be called.

When a call is cancelled and the called party logs out, the user_ids of the cancel callback will still return the identifier of the called party.

reason String Reason for cancellation:
  • Active cancellation(caller_cancel)
  • Timeout cancellation(timeout_cancel)
payload String Call to cancel a filled extension field.

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

Sample code

  • POST/JSON
{
    "appid": "1",
    "event": "call_cancel",
    "nonce": "350176",
    "signature": "signature",
    "timestamp": 1499676978,
    "call_id": "3501761173612493269",
    "user_ids": ["abc","def"],
    "reason": "caller_cancel",
    "payload": "payload",
}

Return codes

If an HTTP status code 2XX (for example, 200) is returned, the callback succeeded. Otherwise, the callback failed.

Callback retry policy

If the ZEGOCLOUD server does not receive a response, or the HTTP status code received by the ZEGOCLOUD server is not 2xx (such as 200), it will retry with intervals of 2s, 4s, 8s, 16s, and 32s respectively. If the retry still fails after an interval of 32s, it will no longer retry.

Page Directory
  • Free trial
  • 提交工单
    咨询集成、功能及报价等问题
    电话咨询
    400 1006 604
    Get Consulting
    Scan Wechat QR code