CreateBlogSupport
Log inSign up
Home
Webex Calling
  • Guides
  • Webex Calling Beta
  • Webex Cloud Calling
  • Broadworks Calling
  • UCM Calling
  • AI Assistant for Developers
  • Beta Program
  • Webex Status API

Webex Calling

Basic Usage

This article outlines the fundamental steps for integrating call functionality using the Webex Android SDK.

anchorRegister for Callbacks

anchor

To initiate and receive calls, the phone services must be operational. After a user signs into Webex, authentication for Webex calling phone services occurs automatically via Single Sign-On (SSO). An application can register the WebexUCLoginDelegate to determine when the phone services are ready. The onUCServerConnectionStateChanged callback provides the phone services connection status, indicating UCLoginServerConnectionStatus.Connected when it is available for use:

private class UCDelegate() : WebexUCLoginDelegate{
    // Triggered when the application needs to hide the WebView that was loaded in `loadSSOViewInBackground`.
    override fun hideUCSSOBrowser() {
        super.hideUCSSOBrowser()
    }

    // Triggered when SSO authentication for the CUCM domain/server is required.
    // The given ssoUrl needs to be loaded in a WebView to start the authentication process.
    // This callback applies only to [com.ciscowebex.androidsdk.phone.Phone.CallingType.CUCM].
    override fun loadUCSSOViewInBackground(ssoUrl: String) {
        super.loadUCSSOViewInBackground(ssoUrl)
    }

    // Notify when the user is successfully logged in to the Webex Calling service.
    override fun onUCLoggedIn() {
        super.onUCLoggedIn()
    }

    // Notify the app whenever the server URL/domain, username, and password are required for authentication.
    // Application needs to display the option for entering required details.
    override fun onUCLoginFailed() {
        super.onUCLoginFailed()
    }

    // Triggered when an SSO login fails.
    override fun onUCSSOLoginFailed(failureReason: UCSSOFailureReason) {
        super.onUCSSOLoginFailed(failureReason)
    }

    // Triggered when the calling service connection status changes.
    override fun onUCServerConnectionStateChanged(status: UCLoginServerConnectionStatus, failureReason: PhoneServiceRegistrationFailureReason) {
        super.onUCServerConnectionStateChanged(status, failureReason)
        
        // UCLoginServerConnectionStatus indicates the phone services connection status.
    }

    // Triggered when the server URL/domain, username and password are required for authentication.
    // Application needs to display the option for entering required details.
    override fun showUCNonSSOLoginView() {
        super.showUCNonSSOLoginView()
    }

    // Triggered when the application needs to show the webview loaded in [loadSSOViewInBackground].
    override fun showUCSSOBrowser() {
        super.showUCSSOBrowser()
    }
}

//Save the delegate object into webex instance to register the callbacks.
...
webex?.delegate = UCDelegate()
...

anchorQuery Phone Services Status

anchor

Check the current phone services status using the webex.getUCServerConnectionStatus() method:

var phoneServicesStatus = webex.getUCServerConnectionStatus()
if (phoneServicesStatus == UCLoginServerConnectionStatus.Connected) {
    // Phone services are ready to use.
}

anchorPlace an Outgoing Call

anchor

When phone services are active, you can make outgoing calls to any Webex calling or PSTN number using webex.phone.dialPhoneNumber(). Note that attempting to dial anything other than phone numbers with webex.phone.dialPhoneNumber() will result in a call failure, indicated by INVALID_API_ERROR.

val mediaOption = MediaOption.audioOnly()
webex.phone.dialPhoneNumber("+1800123456", mediaOption, CompletionHandler { result ->
    if (result.isSuccessful) {
        // Dial out is successful; result.data returns a Call object.
        // Store the Call object for further use.
        val call = result.data
        call?.setObserver(object : CallObserver {
            override fun onConnected(call: Call?) {
                super.onConnected(call)
            }

            override fun onDisconnected(event: CallObserver.CallDisconnectedEvent?) {
                super.onDisconnected(event)
            }

            override fun onRinging(call: Call?) {
                super.onRinging(call)
            }
        })
    } else {
        // Dialing failed; result.error, an instance of WebexError.ErrorCode, provides more details.
    }
})

The dialPhoneNumber() method is available from v3.9.2 and later.

anchorMute or Unmute a Call

anchor

To mute a call:

call?.setSendingAudio(false)

To unmute a call:

call?.setSendingAudio(true)

anchorHold or Resume a Call

anchor

To hold a call:

call?.holdCall(true) 

To resume a call:

call?.holdCall(false)

Check if a call is on hold:

var isOnHold = call?.isOnHold() : false

anchorEnd a call

anchor

End a connected call using the call.hangup() method:

call?.hangup(CompletionHandler { result ->
        if (result.isSuccessful) {
            // Call has ended. Handle cleanup.
        } else {
            // Ending the call failed.
        }
    })
In This Article
  • Register for Callbacks
  • Query Phone Services Status
  • Place an Outgoing Call
  • Mute or Unmute a Call
  • Hold or Resume a Call
  • End a call

Connect

Support

Developer Community

Developer Events

Contact Sales

Handy Links

Webex Ambassadors

Webex App Hub

Resources

Open Source Bot Starter Kits

Download Webex

DevNet Learning Labs

Terms of Service

Privacy Policy

Cookie Policy

Trademarks

© 2025 Cisco and/or its affiliates. All rights reserved.