Skip to content

On Call Hangup

Fired when a call is terminated. This includes local or remote hangup and timeout/end scenarios.

Event Registration

fun setOnCallHangupListener(
  fn: (callId: String, callQuality: RTCQuality, reason: HangupReason) -> Unit
): Subscription

Usage Example


 client.setOnCallHangupListener { call, callQuality, reason ->
     println("Received $reason callQuality: $callQuality for Call $call")
 }

Event Data

ParameterTypeDescription
callIdstringIdentifier of the call that ended
callQualityRTCQualityCall quality metrics summary — see below
reasonHangupReasonReason the call ended — see below

RTCQuality

PropertyTypeDescription
mos_scorefloatMean Opinion Score — overall perceived call quality (higher is better)
quality_percentagefloatQuality expressed as a percentage (0–100)
jitter_min_varfloatMinimum jitter variance observed
jitter_max_varfloatMaximum jitter variance observed
jitter_loss_ratefloatPacket loss rate attributable to jitter
jitter_burst_ratefloatBurst loss rate attributable to jitter
flaw_totalintegerTotal number of detected flaws or errors
packet_cntintegerTotal number of packets transmitted
packet_loss_percfloatPacket loss as a percentage

HangupReason

Android / Web valueiOS valueDescription
remoteReject / REMOTE_REJECTVGHangupReasonRemoteRejectRemote party rejected the call
remoteHangup / REMOTE_HANGUPVGHangupReasonRemoteHangupRemote party hung up
remoteNoAnswerTimeout / REMOTE_NO_ANSWER_TIMEOUTVGHangupReasonRemoteNoAnswerTimeoutRemote did not answer within the timeout period
localHangup / LOCAL_HANGUPVGHangupReasonLocalHangupLocal party hung up
mediaTimeout / MEDIA_TIMEOUTVGHangupReasonMediaTimeoutMedia session timed out

Notes

  • Use reason to differentiate user actions from remote termination/timeouts
  • Final call cleanup and UI transitions should be driven from this event

Built with VitePress.