please select
Call
  • Web
    • Overview
      • Product Introduction
      • Activate the Service
      • Pricing
        • Free Minutes
        • Call Monthly Packages
        • Billing Explanation for Subscription Package Duration
    • Get Started
      • Run Sample Code
      • Integration (React)
      • Integration (Vue3)
      • Secure authentication with userSig
    • Basic Features
      • UI Customization
      • Configuring Nickname and Avatar
      • GroupCall
      • Floating Window
      • Custom Ringtone
      • Configure Resolution and Fill Mode
      • Monitoring Call Status
      • Language Settings
    • Advanced Features
      • Virtual Background
      • AI Noise Suppression
      • On-Cloud Recording
    • Client APIs
      • UIKit APIs
        • API Overview
        • TUICallKit
      • Engine APIs
        • TUICallEngine
        • TUICallEvent
    • Server APIs
      • Call Status Callback
        • Call Status Callback
        • Call Event Callback
        • Callback Configuration
          • API List for Callback Configuration
          • Establishing Callback Configuration
          • Retrieving Callback Configuration
          • Update Callback Configuration
          • Remove Callback Configuration
      • REST API
        • Introduction to REST API
        • Retrieve records via callId
        • Retrieve Records Based on Conditions
    • FAQs
      • All Platfroms
      • Web
      • ErrorCode
      • Release Notes
  • Android
    • Overview
      • Product Introduction
      • Activate the Service
      • Pricing
        • Free Minutes
        • Call Monthly Packages
        • Billing Explanation for Subscription Package Duration
    • Get Started
      • Run Sample Code
      • Integration
      • Secure authentication with userSig
    • Basic Features
      • UI Customization
      • Offline Call Push
      • Configuring Nicknames and Avatars
      • Group Call
      • Floating Window
      • Custom Ringtone
      • Monitoring Call Status
    • Advanced Features
      • Virtual Background
      • AI Noise Suppression
      • On-Cloud Recording
    • Client APIs
      • UIKit APIs
        • API Overview
        • TUICallKit
        • TUICallObserver
        • Type Definition
      • Engine APIs
        • TUICallEngine
    • Server APIs
      • Call Status Callback
        • Call Status Callback
        • Call Event Callback
        • Callback Configuration
          • API List for Callback Configuration
          • Establishing Callback Configuration
          • Retrieving Callback Configuration
          • Update Callback Configuration
          • Remove Callback Configuration
      • REST API
        • Introduction to REST API
        • Retrieve records via callId
        • Retrieve Records Based on Conditions
    • FAQs
      • All Platforms
      • Android
      • ErrorCode
      • Release Notes
  • iOS
    • Overview
      • Product Introduction
      • Activate the Service
      • Pricing
        • Free Minutes
        • Call Monthly Packages
        • Billing Explanation for Subscription Package Duration
    • Get Started
      • Run Sample Code
      • Integration
      • Secure authentication with userSig
    • Basic Features
      • UI Customization
      • Offline Call Push
        • VoIP
        • APNs
      • Configuring Nicknames and Avatars
      • Group Call
      • Floating Window
      • Custom Ringtone
      • Monitoring Call Status
    • Advanced Features
      • Virtual Background
      • AI Noise Suppression
      • On-Cloud Recording
    • Client APIs
      • UIKit APIs
        • API Overview
        • TUICallKit
        • TUICallObserver
        • Type Definition
      • Engine APIs
        • TUICallEngine
    • Server APIs
      • Call Status Callback
        • Call Status Callback
        • Call Event Callback
        • Callback Configuration
          • API List for Callback Configuration
          • Establishing Callback Configuration
          • Retrieving Callback Configuration
          • Update Callback Configuration
          • Remove Callback Configuration
      • REST API
        • Introduction to REST API
        • Retrieve records via callId
        • Retrieve Records Based on Conditions
    • FQAs
      • All Platform
      • iOS
      • ErrorCode
      • Release Notes
  • Flutter
    • Overview
      • Product Introduction
      • Activate the Service
      • Pricing
        • Free Minutes
        • Call Monthly Packages
        • Billing Explanation for Subscription Package Duration
    • Get Started
      • Run Sample Code
      • Integration
      • Secure authentication with userSig
    • Basic Features
      • UI Customization
      • offline Call Push
        • Notification
        • VoIP (Optional)
      • Configuring Nicknames and Avatars
      • Group Call
      • Floating Window
      • Custom Ringtone
      • Monitoring Call Status
    • Advanced Features
      • Virtual Background
      • AI Noise Suppression
      • On-Cloud Recording
      • Beauty Effects
    • Client APIs
      • API Overview
      • TUICallKit
      • TUICallEngine
      • TUICallObserver
      • Type Definition
    • Server APIs
      • Call Status Callback
        • Call Status Callback
        • Call Event Callback
        • Callback Configuration
          • API List for Callback Configuration
          • Establishing Callback Configuration
          • Retrieving Callback Configuration
          • Update Callback Configuration
          • Remove Callback Configuration
      • REST API
        • Introduction to REST API
        • Retrieve records via callId
        • Retrieve Records Based on Conditions
    • FQAs
      • All Platform
      • Flutter
      • ErrorCode
      • Upgrading
      • Release Notes
Call

Call Event Callback

To facilitate refined control of your call services, the TRTC Call (TUICallKit) offers call status callbacks. Your business backend can use these callbacks to peek at users' call results in real-time, such as missed calls, rejections, etc., and based on this, perform real-time data analytics and other operations. For calling configuration methods, see Callback Configuration API List.

Use Conditions

Only applications (SDKAppId) that have activated the Group Call Version of TRTC Call can use the call status callback. You can also activate the trial version for a free trial. For version descriptions and activation instructions, see Activate the Service.
Currently, call status callbacks are available only in specific versions of TUICallKit across various platforms, as detailed in the table below:
Platform/Framework
Version number
Android/iOS/Flutter/uni-app (client)
≥ 1.7.1
Web
≥ 1.4.6
WeChat Mini Program
≥ 1.5.1
Note:
Only after all participating platforms/frameworks are upgraded to the versions mentioned above, can the corresponding call information be peeked at in the console.

Notes

To enable the callback, you must configure the callback URL and enable the switch for this command. Please refer to Create Callback Configuration.
The direction of the callback is from the Callkit backend to the app backend via an HTTP POST request.
After receiving the callback request, the app backend must check whether the SDKAppID contained in the request URL is consistent with its own SDKAppID.

Scenarios that may trigger this callback

Actions generated by an app user during a call via the client, such as answering and hanging up.

Timing of the callback

After operations by the user such as answering and hanging up.

Possible callback results

API description

Request URL

In the following example, the callback URL configured in the app is https://www.example.com. Example:
$http://www.example.com?sdkappid=$sdkappid&command=$command&contenttype=json&clientip=$clientip&optplatform=$optplatform

Request parameters

Parameter
Description
http
Request protocol is HTTPS or HTTP, request method is POST
www.example.com
Callback URL
sdkappid
SDKAppID assigned by the Instant Messaging console when an application is created
command
Please refer to: Callback command list
contenttype
Fixed value: json
clientip
Client IP, such as 127.0.0.1
optplatform
Client platforms may include iOS, Android, Web, miniProgram
The specific callback content is included in the HTTP request body. See the callback examples below for details.

Callback Example

Webhook request example:
POST /?sdkappid=8888888&command=caller_start_call&contenttype=json&clientip=127.0.0.1&optplatform=iOS HTTP/1.1
Host: www.example.com
Content-Length: 337
{
"UserId": "Alice",
"RoomId": "Alice's Room",
"TotalNum": 2,
"MediaType": "audio",
"CallType": "single",
"CallId": "aheahfo-eqwnknoihfsd-qweqf",
"Role": "caller",
"Event": "start_call",
"CallResult": "",
"EventTime": 1704695566,
"StartCallTs": 1704856873,
"AcceptTs": 1704856876,
"EndTs": 1704856885
}

Request packet fields

Field
Type
Description
UserId
String
Operating User ID
RoomId
String
Operating Room ID
TotalNum
Integer
Number of Participants in Call
CallType
String
Call Type:
Single Audio Call
Group Video Call
CallId
String
Call Unique ID
Role
String
role :
Caller User ID
Callee User ID
Event
String
Call Event:
start_call Caller initiates call
call_accepted Caller answers call
call_missed Caller missed call
call_rejected Caller rejects call
call_busy Caller line busy
cancel_call Caller cancels call
call_failed Caller failed to initiate call
call_end Caller call ended normally
call_interrupted Caller call interrupted
receive_call Callee receives call
accept_call Callee answers call
not_answer_call Callee does not answer
reject_call Callee rejects call
ignore_call Called party ignores call
call_canceled Called party cancels call
call_end Normal termination of called party's call
call_interrupted Called party's call abnormally interrupted
invite_user Midway invite user
join_in_group_call Join the call midway
StartCallTs
Integer
Timestamp when call is initiated (second-level) only returned on normal_end
AcceptTs
Integer
Timestamp when call is answered (second-level) only returned on normal_end
EndTs
Integer
Timestamp when call ends (second-level) only returned on normal_end
Note:
CallResult field shows all types only for one-on-one calls, group chat only has normal_end.