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
| Parameter | Type | Description |
|---|---|---|
callId | string | Identifier of the call |
legId | string | Identifier of the leg that changed |
status | LegStatus | Updated status of the leg — see below |
LegStatus
| Android / Web value | iOS value | Description |
|---|---|---|
ringing / RINGING | VGLegStatusRinging | Remote leg is ringing |
answered / ANSWERED | VGLegStatusAnswered | Remote leg has answered the call |
completed / COMPLETED | VGLegStatusCompleted | Remote leg has ended |
Notes
- This event is especially useful for call progress UI
- Typically reflects remote leg transitions rather than your own local state
Related Actions
serverCall- Start an outbound callgetCallLegs- Retrieve call legs details