Updated on 2023-03-23 GMT+08:00

Subscribing to Call End Notifications

Function

A notification is sent when a call ends. The call record information is returned.

Function Prototype

setOnCallEndedNotifyCB(onCallEndedNotify: (callRecordInfo: CallRecordInfo) => void): voidsetOnCallEndedNotifyCB(onCallEndedNotify: (callRecordInfo: CallRecordInfo) => void): void

Request Parameters

Table 1 Input parameter description
Parameter Mandatory Type Description
onCallEndedNotify Y (callRecordInfo: CallRecordInfo) => void Notification sent when a call ends. The call record information is returned.

Return Values

void

Notification Method Parameters

(callRecordInfo: CallRecordInfo) => void

Table 2 Input parameter description
Parameter Type Description
callRecordInfo CallRecordInfo Call record information.
Table 3 CallRecordInfo
Parameter Type Description
callInfo CallInfo Call information.
reason CallEndReason Call end reason.
Table 4 CallInfo
Parameter Type Description
mediaType MediaType Media type.
number string Number of the other participant.
nickName string Name of the other participant.
startTime string Start time of the call.
endTime string End time of the call. This field is left blank before the call ends.
isCallOut boolean Whether the call is an outgoing call.
Table 5 Enumerated values of MediaType
Enumeration Name Enumerated Value Description
HWM_MEDIA_TYPE_AUDIO 0 Audio.
HWM_MEDIA_TYPE_VIDEO 1 Video.
Table 6 Enumerated values of CallEndReason
Enumeration Name Enumerated Value Description
HWM_CALL_END_REASON_CONNECTED_HANGUP_BY_CALLER 1 The caller hangs up the call (the call is connected).
HWM_CALL_END_REASON_CONNECTED_HANGUP_BY_CALLEE 2 The called participant hangs up the call (the call is connected).
HWM_CALL_END_REASON_HANGUP_BY_CALLER 3 The caller hangs up the call (the call is not connected).
HWM_CALL_END_REASON_HANGUP_BY_CALLEE 4 The called participant hangs up the call (the call is not connected).
HWM_CALL_END_REASON_CALLEE_BUSY 5 The called participant is in a call (the call is not connected).
HWM_CALL_END_REASON_CALLEE_ANSWER_TIMEOUT 6 The called participant does not answer the call (the call is not connected).
HWM_CALL_END_REASON_CALLEE_NUMBER_ERROR 7 The called number is incorrect (the call is not connected).
HWM_CALL_END_REASON_FAILED 8 The call fails.