The iOS 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.
The iOS SDK provides real-time call quality events through the SinchExperimentalCallDelegate protocol, which includes the method callDidEmitCallQualityEvent(_ call: SinchCall, event: SinchCallQualityWarningEvent). This extends the standard call delegate handling so you can detect and act on call quality warning events during the call lifecycle.
public protocol SinchExperimentalCallDelegate: AnyObject {
func callDidEmitCallQualityEvent(_ call: SinchCall, event: SinchCallQualityWarningEvent)
}To handle call quality events, implement callDidEmitCallQualityEvent(_ call: SinchCall, event: SinchCallQualityWarningEvent) in your existing SinchClientMediator. Use this to process different call quality warning events and respond to connectivity issues effectively.
extension SinchClientMediator: SinchCallDelegate {
...
func callDidEmitCallQualityEvent(_ call: SinchCall, event: SinchCallQualityWarningEvent) {
switch event {
case .highInboundJitter(let eventType, let mediaStream):
// Handle high inbound jitter warning
case .highRemoteInboundRtt(let eventType, let mediaStream):
// Handle high remote inbound RTT warning
case .highInboundPacketLoss(let eventType, let mediaStream):
// Handle high inbound packet loss warning
case .missingMediaStream(let eventType):
// Handle missing media stream warning
case .constantAudioLevel(let eventType, let sourceType):
// Handle constant audio level warning
case .lowOSOutputVolumeLevel(let eventType):
// Handle low OS output volume warning
}
}
}SinchCallQualityWarningEvent contains information about the event type and the affected media/direction. These enums categorize the nature of the issue:
EventType:.triggeror.recover. A trigger indicates the onset of a problem; a recover signifies the resolution.MediaStreamType:.audioor.video, indicating the media stream affected.SourceStreamType:.inboundor.outbound, referring to the stream direction.
The table below summarizes the SinchCallQualityWarningEvent types emitted by the iOS SDK:
| Type | From (iOS SDK version) | MediaStreamType | SourceStreamType | Trigger conditions | Recovery conditions |
|---|---|---|---|---|---|
| .highRemoteInboundRtt | 5.24.14 | YES | NO | Round Trip Time (RTT) of packets is greater 300 ms | Round Trip Time (RTT) drops below 300 ms |
| .highInboundJitter | 5.24.14 | YES | NO | Inbound jitter is greater then 30 ms for 3 out of last 4 samples | Trigger conditions are no longer sustained |
| .highInboundPacketLoss | 5.24.14 | YES | NO | Inbound packet loss is greater then 1% in 3 out of last 4 samples | Trigger conditions are no longer sustained |
| .missingMediaStream | 5.24.14 | NO | NO | ICE state is not CONNECTED during the time the call is established | ICE state reaches CONNECTED state. |
| .constantAudioLevel | 5.24.14 | NO (audio only) | YES | Standard deviation of inbound/outbound audio level measurements from last 20 seconds (before 5.30.22 8 seconds) is lower then 0.5% of the maximum possible audio level value. | Trigger conditions are no longer sustained. |
| .zeroAudioLevel | 5.30.22 | NO (audio only) | YES | The audio level measurements of the inbound/outbound rtp audio stream from last 2 seconds are equal to 0. | Trigger conditions are no longer sustained. |
| .lowOSOutputVolumeLevel | 5.24.14 | NO (audio only) | NO | 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 outputVolume of AudioSession volume changes. | Trigger conditions are no longer sustained. |
For more detailed documentation of properties, classes and other iOS SDK specific structures see the Dokka documentation included inside the SDK archive available at the SDK downloads page.