The Android SDK exposes real-time information related to call quality. Using this API, you can be notified as soon as any degradation of connectivity metrics is observed and adjust your application UI to provide visible feedback to the user.
Access call quality features via the CallQualityController interface. Each Call object provides its own CallQualityController for accessing quality features of that specific call.
val call: Call // Any call instance provided by the SDK
val callQualityController = call.qualityControllerReceive quality warning events via the CallQualityWarningEventListener interface. The snippet below shows how to add and remove your listener for those events.
val callQualityController = call.qualityController()
val myCallQualityWarningEventListener = CallQualityWarningEventListener { event ->
// Handle the warning event
}
// Add your listener
callQualityController.addCallQualityWarningEventListener(myCallQualityWarningEventListener)
// Remove your listener
callQualityController.removeCallQualityWarningEventListener(myCallQualityWarningEventListener)The CallQualityWarningEvent object provides the following information:
- Name of the warning
- Type of the event: either
Trigger(degradation occurred) orRecover(returned to expected value). - Media stream type of the warning. Included only for warnings that can be bound to individual streams (
AudioorVideo).
The table below summarizes the possible types of CallQualityWarningEvent objects emitted by the Android SDK:
| Type | From (Android SDK version) | Contains MediaStreamType | Trigger conditions | Recovery conditions |
|---|---|---|---|---|
| HighRemoteInboundRttWarningEvent | 6.3.9 | YES | Round Trip Time (RTT) of packets is greater 300 ms | Round Trip Time (RTT) drops below 300 ms |
| HighInboundJitterWarningEvent | 6.3.9 | YES | Inbound jitter is greater than 30 ms for 3 out of the last 4 samples | Trigger conditions are no longer sustained |
| HighInboundPacketLossWarningEvent | 6.3.9 | YES | Inbound packet loss is greater than 1% in 3 out of the last 4 samples | Trigger conditions are no longer sustained |
| MissingMediaStreamWarningEvent | 6.3.9 | NO | ICE state is not CONNECTED while the call is established | ICE state reaches CONNECTED. |
| ConstantOutboundAudioLevel | 6.7.11 | NO (audio only) | Standard deviation of outbound audio level measurements from the last 20 seconds (before 6.9.19: 8 seconds) is lower than 0.5% of the maximum possible audio level value. | Trigger conditions are no longer sustained. |
| ConstantInboundAudioLevel | 6.7.11 | NO (audio only) | Standard deviation of inbound audio level measurements from the last 20 seconds (before 6.9.19: 8 seconds) is lower than 0.5% of the maximum possible audio level value. | Trigger conditions are no longer sustained. |
| ZeroInboundAudioLevel | 6.9.19 | NO (audio only) | Audio level measurements of the inbound RTP audio stream from the last 2 seconds are equal to 0. | Trigger conditions are no longer sustained |
| ZeroOutboundAudioLevel | 6.9.19 | NO (audio only) | Audio level measurements of the outbound RTP audio stream from the last 2 seconds are equal to 0. | Trigger conditions are no longer sustained |
| LowOSOutputVolumeLevel | 6.7.11 | NO (audio only) | Platform volume, as set by the user or by a third-party app, is within the lower 25% range. Measured by observing STREAM_VOICE_CALL volume changes. | Trigger conditions are no longer sustained. |
For detailed documentation of properties, classes, and other Kotlin Android SDK specifics, see the Dokka documentation included in the SDK archive. It is available on the SDK downloads page.