Skip to content

On Leg Status Update

Fired when a remote call leg status changes (for example, ringing, answered, completed).

Event Registration

fun setOnLegStatusUpdate(
  fn: (callId: String, legId: String, status: LegStatus) -> Unit
): Subscription

Usage Example

 client.setOnLegStatusUpdate { call, legId, status ->
     when(status) {
         LegStatus.ringing -> println("Leg $legId for call $call is ringing")
         LegStatus.answered -> println("Leg $legId for call $call was answered")
         LegStatus.completed -> println("Leg $legId for call $call was completed")
     }
 }

Event Data

ParameterTypeDescription
callIdstringIdentifier of the call
legIdstringIdentifier of the leg that changed
statusLegStatusUpdated status of the leg — see below

LegStatus

Android / Web valueiOS valueDescription
ringing / RINGINGVGLegStatusRingingRemote leg is ringing
answered / ANSWEREDVGLegStatusAnsweredRemote leg has answered the call
completed / COMPLETEDVGLegStatusCompletedRemote leg has ended

Notes

  • This event is especially useful for call progress UI
  • Typically reflects remote leg transitions rather than your own local state

Built with VitePress.