Callback on call invitation sent
Overview
When a user sends a call invitation to other users, it represents the creation of a call.
Your server can receive the call creation callback from the ZIM server to obtain the details of the call invitation.
-
If multiple users are called and one of them is logged out, the logged-out user is not included in the call creation callback.
-
If all called users are logged out, the call creation callback is not returned.
-
If the call inviation has been sent but the caller logs out or is indicated to be logged out by a heartbeat timeout, the business backend receives the call cancellation callback from the ZIM server. For more information, see Call cancel callback.
Callback description
- Request method: POST.
- The callback data needs to be decoded by UrlDecode.
- When using the POST request method to pass parameters:
- The parameters in the body can be directly passed in the JsonObject format, without the need to serialize them into a string format.
- In the headers, set "Content-type" to "application/json".
- 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. |
create_time | Int | The Unix timestamp of call invitation creation. |
payload | String | The extended field for call creation. |
caller | String | The user creating the call. |
timeout | Int | The maximum time limit, in seconds, for waiting for a response from the called user. |
We recommend that you convert some parameters into integers for logic processing, including appid
and nonce
.
Sample code
{
"appid": "1",
"event": "call_create",
"nonce": "350176",
"signature": "signature",
"timestamp": 1499676978,
"call_id": "3501761173612493269",
"user_ids": ["abc","def"],
"create_time": 1499676968,
"payload": "payload",
"caller": "caller",
"timeout": 90
}
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.