Call quality

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.

Accessing call quality component

The iOS SDK provides the ability to receive real-time call quality events through the SinchExperimentalCallDelegate protocol, which includes the method callDidEmitCallQualityEvent(_ call: SinchCall, event: SinchCallQualityWarningEvent). This protocol is part of SinchCallDelegate, enabling the detection and handling of various call quality warning events within the call lifecycle.

Copy
Copied
public protocol SinchExperimentalCallDelegate: AnyObject {

  func callDidEmitCallQualityEvent(_ call: SinchCall, event: SinchCallQualityWarningEvent)
}

Call quality warning events

To handle call quality events, implement the callDidEmitCallQualityEvent(_ call: SinchCall, event: SinchCallQualityWarningEvent) method in your existing SinchClientMediator. This method processes different types of call quality warning events, allowing your application to respond to connectivity issues effectively.

Copy
Copied
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
    }
  }
}

The SinchCallQualityWarningEvent contains information about EventType, MediaStreamType or SourceStreamType. These enums categorize the nature of the call quality issues.

  • EventType can be .trigger or .recover . A trigger indicates the onset of a problem, while a recover signifies the resolution of the issue
  • MediaStreamType can be .audio or .video , indicating the type of media stream affected
  • SourceStreamType can be .inbound or .outbound , referring to the direction of the media stream

The below table summarizes the possible types of SinchCallQualityWarningEvent objects being emmitted 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.

More resources on SDK specifics

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.

We'd love to hear from you!
Rate this content:
Still have a question?
 
Ask the community.