Skip to content
Last updated

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.

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.

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:

TypeFrom
(iOS SDK version)
MediaStreamTypeSourceStreamTypeTrigger conditionsRecovery conditions
.highRemoteInboundRtt5.24.14YESNORound Trip Time (RTT) of packets is greater 300 msRound Trip Time (RTT) drops below 300 ms
.highInboundJitter5.24.14YESNOInbound jitter is greater then 30 ms for 3 out of last 4 samplesTrigger conditions are no longer sustained
.highInboundPacketLoss5.24.14YESNOInbound packet loss is greater then 1% in 3 out of last 4 samplesTrigger conditions are no longer sustained
.missingMediaStream5.24.14NONOICE state is not CONNECTED during the time the call is establishedICE state reaches CONNECTED state.
.constantAudioLevel5.24.14NO (audio only)YESStandard 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.
.zeroAudioLevel5.30.22NO (audio only)YESThe audio level measurements of the inbound/outbound rtp audio stream from last 2 seconds are equal to 0.Trigger conditions are no longer sustained.
.lowOSOutputVolumeLevel5.24.14NO (audio only)NOVolume (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.