Phone

interface Phone

Phone is a wrapper of the available calling related APIs

Since

0.1

Types

Link copied to clipboard
enum AudioBRNMode : Enum<Phone.AudioBRNMode>

The enumeration of audio BNR mode choices, default is HP.

Link copied to clipboard
enum CallingType : Enum<Phone.CallingType>

Represents Calling service type of logged in user

Link copied to clipboard
interface Captcha

Datatype representing the Captcha object

Link copied to clipboard
enum DefaultBandwidth : Enum<Phone.DefaultBandwidth>

The enumeration of common bandwidth choices.

Link copied to clipboard
enum FacingMode : Enum<Phone.FacingMode>

The enumeration of Camera facing modes.

Link copied to clipboard
enum H264LicenseAction : Enum<Phone.H264LicenseAction>

The options for H.264 video codec license from Cisco Systems, Inc

Link copied to clipboard
interface IncomingCallListener

The interface for a listener for incoming call

Link copied to clipboard
enum ServiceUrlType : Enum<Phone.ServiceUrlType>

The enumeration of service url.

Link copied to clipboard
enum VideoStreamMode : Enum<Phone.VideoStreamMode>

The enumeration of remote video stream.

Link copied to clipboard
enum VirtualBackgroundMode : Enum<Phone.VirtualBackgroundMode>

Represents different types of modes for setting Virtual Background

Link copied to clipboard
enum VirtualBackgroundType : Enum<Phone.VirtualBackgroundType>

Represents different Virtual Background types

Functions

Link copied to clipboard
abstract fun addVirtualBackground(image: LocalFile, handler: CompletionHandler<VirtualBackground>)

adds a virtual background. It will resize the uploaded image if its larger than 1280x720

Link copied to clipboard
abstract fun applyVirtualBackground(    backgroundItem: VirtualBackground,     mode: Phone.VirtualBackgroundMode,     handler: CompletionHandler<Boolean>)

Applies the virtual background for a video preview/call based on the VirtualBackgroundMode

Link copied to clipboard
abstract fun buildNotificationPayload(notification: Map<String, String>, notificationId: String): String

Builds the payload from FCM notification. This payload needs to be supplied to Phone.processPushNotification as first parameter

Link copied to clipboard
abstract fun cancel()

Cancel the currently outgoing call that has not been connected.

Link copied to clipboard
abstract fun connectPhoneServices(callback: CompletionHandler<PhoneConnectionResult>)

API for signing into phone services for CallingType.WebexCalling and CallingType.WebexForBroadworks. Result of connection status is notified in WebexUCLoginDelegate.onUCServerConnectionStateChanged.

Link copied to clipboard
abstract fun decryptCUCMPushMessage(payload: String): PushRESTPayload

Decrypts the payload received via PushREST for an incoming CUCM call

Link copied to clipboard
abstract fun dial(    dialString: String,     option: MediaOption,     callback: CompletionHandler<Call>)

Makes a call to an intended recipient on behalf of the authenticated user

Link copied to clipboard
abstract fun dialPhoneNumber(    dialString: String,     option: MediaOption,     callback: CompletionHandler<Call>)

Dials the given phone number on behalf of the authenticated user

Link copied to clipboard
abstract fun disableVideoCodecActivation()

Prevents the SDK from popping up an Alert for the end user to approve the use of H.264 video codec license from Cisco Systems, Inc.

Link copied to clipboard
abstract fun disconnectPhoneServices(callback: CompletionHandler<PhoneConnectionResult>)

API for signing out of phone services for CallingType.WebexCalling and CallingType.WebexForBroadworks. Result of connection status is notified in WebexUCLoginDelegate.onUCServerConnectionStateChanged.

Link copied to clipboard
abstract fun enableAskingReadPhoneStatePermission(enable: Boolean)

Toggle to enable or disable ask for android.Manifest.permission.READ_PHONE_STATE permission, true by default. When target SDK >= 30, this permission is required to check the network state, so SDK can auto-tuning performance during calls.

Link copied to clipboard
abstract fun enableAudioBNR(enable: Boolean)

Enable audio background noise removal. Default is false

Link copied to clipboard
abstract fun enableAudioEnhancementForModels(models: List<String>?)

Turn on audio enhancement for the specified device models. By default, the audio enhancement is enable for Samsung S7/S7Edge/S8/S8+/S9/S9+/S10/S10+/S10e/Note8/Note9.

Link copied to clipboard
abstract fun enableBackgroundConnection(enable: Boolean)

Set true to keep Webex server connection when minimize app. Default is false. When set to true, app will receive notifications in background, include incoming calls, messages, space updates, membership updates, etc.

Link copied to clipboard
abstract fun enableBackgroundStream(enable: Boolean)

Set true to keep video stream(include local and remote) when minimize app, else will stop. Default is false. Google recommend release camera when app goes background and resume after app foreground. When you use picture-in-picture mode in app should set this method to true before call.

Link copied to clipboard
abstract fun enableStreams(enable: Boolean)

Enables or disables all media streams on active calls.

Link copied to clipboard
abstract fun fetchVirtualBackgrounds(handler: CompletionHandler<List<VirtualBackground>>)

This returns the list of virtual backgrounds

Link copied to clipboard
abstract fun getAdvancedSetting(clz: KClass<out AdvancedSetting<*>>): AdvancedSetting<*>?

Returns value of the advanced setting that has been set.

Link copied to clipboard
abstract fun getAudioBNRMode(): Phone.AudioBRNMode

Return the audio background noise removal mode.

Link copied to clipboard
abstract fun getAudioMaxRxBandwidth(): Int

Return the current maximum receiving bandwidth of audio stream.

Link copied to clipboard
abstract fun getCallHistory(): List<CallHistoryRecord>?

A collection of Space which contains call history of One to One Spaces as well as Group type Spaces and UC Calls Note: The return type changed from Space to CallHistoryRecord to accommodate UC calls since 3.6.0

Link copied to clipboard
abstract fun getCallingType(): Phone.CallingType

Returns the type of Calling supported for logged in user

Link copied to clipboard
abstract fun getDefaultFacingMode(): Phone.FacingMode

Default camera facing mode of this phone, used as the default when dialing or answering a call. The default mode is the front camera.

Link copied to clipboard
abstract fun getIncomingCallListener(): Phone.IncomingCallListener?

The listener for incoming call

Link copied to clipboard
abstract fun getMaxVirtualBackgroundItems(): Int

Returns the limit of number of custom virtual backgrounds, default limit is 3

Link copied to clipboard
abstract fun getServiceUrl(serviceUrlType: Phone.ServiceUrlType): String?

Return the required service url, return null if unregistered.

Link copied to clipboard
abstract fun getSharingMaxRxBandwidth(): Int

Return the current maximum receiving bandwidth of content sharing stream.

Link copied to clipboard
abstract fun getVideoCodecLicense(): String

Return the text of the H.264 codec license from Cisco Systems, Inc.

Link copied to clipboard
abstract fun getVideoCodecLicenseURL(): String

Return the URL of the H.264 codec license from Cisco Systems, Inc.

Link copied to clipboard
abstract fun getVideoMaxRxBandwidth(): Int

Return the current maximum receiving bandwidth of video stream.

Link copied to clipboard
abstract fun getVideoMaxTxBandwidth(): Int

Return the current maximum sending bandwidth of video stream.

Link copied to clipboard
abstract fun getVideoStreamMode(): Phone.VideoStreamMode

Return the video stream mode.

Link copied to clipboard
abstract fun isAudioBNREnable(): Boolean

True if audio background noise removal is open, otherwise false.

Link copied to clipboard
abstract fun isH264LicenseActivated(): Boolean

Indicates the status of H264 license prompt acceptance.

Link copied to clipboard
abstract fun isHardwareAccelerationEnabled(): Boolean

Return True if Google hardware media codec is turned on for video. Otherwise, false.

Link copied to clipboard
abstract fun isRestrictedNetwork(): Boolean

Returns true if the device is in restricted network

Link copied to clipboard
abstract fun isVirtualBackgroundSupported(): Boolean

Returns true if virtual background is supported

Link copied to clipboard
abstract fun processPushNotification(msg: String, handler: CompletionHandler<PushNotificationResult>)

API to process the payload received in FCM service for Webex calling. Use Phone.buildNotificationPayload API to create the payload first.

Link copied to clipboard
abstract fun refreshMeetingCaptcha(handler: CompletionHandler<Phone.Captcha>)

Refresh the Captcha object to get a new Captcha code

Link copied to clipboard
abstract fun removeVirtualBackground(backgroundItem: VirtualBackground, handler: CompletionHandler<Boolean>)

Removes the virtual background

Link copied to clipboard
abstract fun requestVideoCodecActivation(builder: <Error class: unknown class>, callback: CompletionHandler<Phone.H264LicenseAction>?)

Pops up an Alert for the end user to approve the use of H.264 codec license from Cisco Systems, Inc.

Link copied to clipboard
abstract fun setAdvancedSetting(setting: AdvancedSetting<*>)

Set advanced settings for call. Only effective if set before the start of call.

Link copied to clipboard
abstract fun setAudioBNRMode(mode: Phone.AudioBRNMode)

Set the audio background noise removal mode, default value is AudioBRNMode.HP. This method only effective if set Phone.enableAudioBNR to true.

Link copied to clipboard
abstract fun setAudioMaxRxBandwidth(bandwidth: Int)

Set the max receiving bandwidth for audio in unit bps for the call. Only effective if set before the start of call. if 0, default value of 64 * 1000 is used.

Link copied to clipboard
abstract fun setDefaultFacingMode(mode: Phone.FacingMode)

Set default camera facing mode of this phone, used as the default when dialing or answering a call. The setting is not persistent.

Link copied to clipboard
abstract fun setHardwareAccelerationEnabled(enable: Boolean)

Turn on/off Google hardware media codec for video. By doing hardware codec, android devices can do high definition (720p@30fps) video calls, but please note, since the hardware codec is high depend on android devices, some devices support hardware codec not very well.

Link copied to clipboard
abstract fun setIncomingCallListener(listener: Phone.IncomingCallListener?)

Set the listener to listen to the incoming call to this Phone. This listener won't be fired when a 3rd incoming WxC or CUCM call is received. Max number of supported WxC or CUCM calls at a time is 2 (Applicable from 3.11 onwards)

Link copied to clipboard
abstract fun setMaxVirtualBackgroundItems(limit: Int)

The limit of number of custom virtual backgrounds, default limit is 3 Note: If background is uploaded after the limit is exhausted, older background will be deleted to make space for new ones.

Link copied to clipboard
abstract fun setOnRestrictedNetworkStatusChange(handler: CompletionHandler<Boolean>)

Sets a listener to monitor restricted network status changes

Link copied to clipboard
abstract fun setPushTokens(    bundleId: String,     deviceId: String,     voipToken: String,     appId: String = "")

Set parameters required for Push notifications of Webex calling

Link copied to clipboard
abstract fun setSharingMaxRxBandwidth(bandwidth: Int)

Set the max receiving bandwidth for content sharing in unit bps for the call. Only effective if set before the start of call. if 0, default value of 8000*1000 is used.

Link copied to clipboard
abstract fun setVideoMaxRxBandwidth(bandwidth: Int)

Set the max receiving bandwidth for video in unit bps for the call. Only effective if set before the start of call. if 0, default value of 2500*1000 is used.

Link copied to clipboard
abstract fun setVideoMaxTxBandwidth(bandwidth: Int)

Set the max sending bandwidth for video in unit bps for the call. Only effective if set before the start of call. if 0, default value of 2500*1000 is used.

Link copied to clipboard
abstract fun setVideoStreamMode(videoStreamMode: Phone.VideoStreamMode)

Set the video stream mode, default value is VideoStreamMode.COMPOSITED.

Link copied to clipboard
abstract fun startPreview(view: <Error class: unknown class>)

Render a preview of the local party before the call is answered.

Link copied to clipboard
abstract fun stopPreview()

Stop rendering the preview of the local party.