Call quality
The Android SDK exposes real time information related to call quality. By using this API you can be notified as soon as any degradation of connectivity metrics is observed and adjust your application UI, providing visible feedback to the user.
Accessing call quality component
The Android SDK provides access to call quality features via the CallQualityController
interface. Each Call
object provides its own CallQualityController
for accessing quality features of that specific call.
import com.sinch.android.rtc.calling.Experimental
val call: Call // Any call instance provided by the SDK
val callQualityController = Experimental.qualityController(call)
Call quality warning events
The Android SDK provides information about quality warning events via CallQualityWarningEventListener
interface. The below snippet demonstrates how to assign and remove your listener for those events.
import com.sinch.android.rtc.calling.Experimental
val callQualityController = Experimental.qualityController(call)
val myCallQualityWarningEventListener = CallQualityWarningEventListener { callQualityWarningEvent -> exp
// Handle the warning event
}
// Add your listener
callQualityController.addCallQualityWarningEventListener (myCallQualityWarningEventListener)
// Remove your listener
callQualityController.removeCallQualityWarningEventListener(myCallQualityWarningEventListener)
The CallQualityWarningEvent
object passed inside the callback provides the following information about the event observed:
- Name of the warning
-
Type of the event. Can be either
Trigger
orRecover
depending if given metric degradation has just occured or if it returned to expected value. -
Media stream type of the warning. This is included only for warnings that can be bound to individual streams (
Audio
orVideo
).
The below table summarizes the possible types of CallQualityWarningEvent
objects being emmitted by the Andorid 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 then 30 ms for 3 out of last 4 samples | Trigger conditions are no longer sustained |
HighInboundPacketLossWarningEvent | 6.3.9 | YES | Inbound packet loss is greater then 1% in 3 out of last 4 samples | Trigger conditions are no longer sustained |
MissingMediaStreamWarningEvent | 6.3.9 | NO | ICE state is not CONNECTED during the time the call is established |
ICE state reaches CONNECTED state. |
ConstantOutboundAudioLevel | 6.7.11 | NO (audio only) | Standard deviation of outbound audio level measurements from last 20 seconds (before 6.9.19 8 seconds) is lower then 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 last 20 seconds (before 6.9.19 8 seconds) is lower then 0.5% of the maximum possible audio level value. |
Trigger conditions are no longer sustained. |
zeroInboundAudioLevel | 6.9.19 | NO (Audio only) | The audio level measurements of the inbound rtp audio stream from last 2 seconds are equal to 0. | Trigger conditions are no longer sustained |
zeroOutboundAudioLevel | 6.9.19 | NO (Audio only) | The audio level measurements of the outbound rtp audio stream from last 2 seconds are equal to 0. | Trigger conditions are no longer sustained |
LowOSOutputVolumeLevel | 6.7.11 | NO (audio only) | Volume (on platform level) as set by the user or externally by 3rd party application is within lower 25% range. The factor is measured by observing STREAM_VOICE_CALL volume changes. |
Trigger conditions are no longer sustained. |
More resources on SDK specifics
For more detailed documentation of properties, classes and other Kotlin Android SDK specific structures see the Dokka documentation included inside the SDK archive available at the SDK downloads page.