Skip to content

Noise Removal for Incoming PSTN Calls

rsarika edited this page Jun 6, 2023 · 1 revision

Noise Removal for Incoming Calls

Developers can enable far end Noise removal for Incoming PSTN or phone calls. Generally, PSTN callers won't have a Noise removal feature on their device and by enabling this feature, noise can be removed and the SDK user will hear better and clear incoming sound.

This feature is available from v3.9.0 onwards.

This feature is available for WxC(WebexCalling) and CUCM calls only

Basic Usage

The below APIs are made available to developers to use the Noise Removal feature for incoming calls.

1. public func enableReceivingNoiseRemoval(shouldEnable: Bool, completionHandler: @escaping (ReceivingNoiseRemovalEnableResult) -> Void)

This API can be used to enable or disable the Noise removal feature. Callback indicates if the API call is successful or not. Actual result of the API is notified in onReceivingNoiseInfoChanged.

   call.enableReceivingNoiseRemoval(shouldEnable: !receivingNoiseInfo.isNoiseRemovalEnabled) { result in
       switch result {
       case .NoError:
           print("enable/disable ReceivingNoiseRemoval success")
       case .NotSupported:
           print("NotSupported")
       case .InternalError:
           print("InternalError")
       }
   }

2. Callback public var onReceivingNoiseInfoChanged: ((ReceivingNoiseInfo) -> Void)?

The ReceivingNoiseInfo object has two boolean values namely

  1. isNoiseDetected: Indicates if any noise is detected in the incoming call. This can be used to indicate presence of noise in audio at remote end. enableReceivingNoiseRemoval API needs to be called to remove detected noise.

  2. isNoiseRemovalEnabled: Indicates if the noise removal feature is enabled. If true, then the noise from the incoming call will be removed.

The onReceivingNoiseInfoChanged callback will be fired in the following cases:

  1. Initially, when the call is connected, with both isNoiseDetected and isNoiseRemovalEnabled as false. This indicates availability of incoming noise removal feature for the current call object.

  2. Subsequently, whenever values of isNoiseDetected or isNoiseRemovalEnabled changes. For eg: Callback gets fired when noise removal feature is enabled or disabled using enableReceivingNoiseRemoval or when background noise is detected.

   call.onReceivingNoiseInfoChanged = { info in

   }

3. public var receivingNoiseInfo: ReceivingNoiseInfo?

This API can be used to get the ReceivingNoiseInfo object

 val infoObject = call.receivingNoiseInfo
Clone this wiki locally