Skip to content

Noise Removal for Incoming PSTN Calls

Rohit Sharma edited this page Jun 5, 2023 · 1 revision

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. enableReceivingNoiseRemoval(enable: Boolean, callback: CompletionHandler)

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

call.enableReceivingNoiseRemoval(enable, callback)

2. Callback CallObserver.onReceivingNoiseInfoChanged(info: ReceivingNoiseInfo)

This callback is notified as part of the CallObserver set using Call.setObserver() API.

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 noise in audio at the 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 the 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 the noise removal feature is enabled or disabled using enableReceivingNoiseRemoval or when background noise is detected.

   val mediaOption = MediaOption.audioOnly()
   webex.phone.dial("+1800123456", mediaOption, CompletionHandler { result ->
       if (result.isSuccessful) {
           // Dial api is successful
           val call = result.data
           call?.setObserver(object : CallObserver {
               override fun onReceivingNoiseInfoChanged(info: ReceivingNoiseInfo) {
                   // Use the info object to take further actions
               }
           })
       } else {
           // Dial failed
       }
   })

3. getReceivingNoiseInfo()

This API can be used to get the ReceivingNoiseInfo object

val infoObject = call.getReceivingNoiseInfo()
Clone this wiki locally