Click-to-Call

Click-to-Call lets your contactsClosed The person interacting with an agent, IVR, or bot in your contact center. call a live agent with one single click. From a button on your website, visitors can start a direct call to an agent. This can help you to reduce or eliminate: 

  • Extra steps when connecting to a Sales or Support team.

  • Overhead costs, such as service number fees and mobile surcharges.

Click-to-Call works through a software development kit (SDK) written in JavaScript. To get it set up, you must work with a developer to implement the SDK in your website. You must also work with a Account Representative who can provide specific credentials.

Click-to-Call is supported on desktop browsers.

Click-to-Call SDK Details

The SDK consists of a single clicktocall.js file. This must be included or referenced on each webpage where you want the Click-to-Call button to display. You must also implement your own UI components, like the Click-to-Call button and call controls. The Click-to-Call button must invoke the makeCall function in the SDK, which initiates a WebRTC call. If the call request is authenticated by CXone, the call is placed.

Integration Prerequisites

To prepare your developers to integrate Click-to-Call into your site, you must complete the following:

  • Obtain a Client ID from your Account Representative.

  • Work with your Account Representative to provision phone numbers specific for Click-to-Call.

  • Implement a POST API on your own server. This API must generate a JWT token for authentication. This validates that incoming call requests are legitimate.

  • Provide the public key to your Account Representative for authentication.

  • Consider your UI design. You must develop your own UI for the contact side of the call, including buttons for call controls like mute or ending the call. The SDK includes sample React and Angular components that your developers can use for reference and inspiration. The agent side of the call is handled in their agent application, therefore UI development is only needed for the contact side.

CXone Setup

In addition to adding the Click-to-Call functionality to your website, you must also ensure your routing components are set up in CXone. Your CXone administrator can set up the necessary components.

Be sure you have:

  • An inbound voice ACD skill created with the necessary agents assigned to it.

  • Points of contact (POC) set up for the voice calls. These must be phone POCs for each Click-to-Call phone number. The developer implementing Click-to-Call on your site must use this for contactAddress in the JavaScript file.

  • A Studio script to route the calls to an agent.

Depending on your CXone setup, you may be able to use existing routing components, or you might need to create and set up new ones.

SDK Integration

Be sure you have completed or prepared the necessary items in the prerequisites section.

  1. Incorporate the clicktocall.js file into your webpage as you see fit.

  2. In the clicktocall.js file, set the API endpoint URL of your POST API.

    let getJWT1TokenURL = '<YOUR_TOKEN_ENDPOINT_URL>';
  3. Update the getJWT2TokenURL variable with the following API endpoint. CXone uses this to validate your JWT:

    let getJWT2TokenURL = 'https://api-na1.niceincontact.com/ClickToCall/GetJWT2Token';
  4. Add the following UI components to your website. Be sure to give each component a unique identifier. The SDK package includes sample UI components in React and Angular. You can find these in the IntegrationHelpers/UIComponents directory.

    • Button to start the voice call.

    • Button to hang up or disconnect the call.

    • Button to mute and unmute the call audio.

    • Button to display a keypad for DTMF inputs.

    • A <div> for displaying the keypad keys.

    • Label to display call success or error messages.

    • An <audio> tag to play certain sounds like dialing tones or call connection sounds.

  5. Update the clicktocall.js file with references to the UI components you added in the previous step.

    let clickToCallButtonId = '<YOUR_CLICK_TO_CALL_BUTTON_ID>';
    let hangUpButtonId = '<YOUR_HANG_UP_BUTTON_ID>';
    let muteAudioButtonId = '<YOUR_MUTE_AUDIO_BUTTON_ID>';
    let keypadButtonId = '<YOUR_KEYPAD_BUTTON_ID>';
    let dtmfKeyDivId = '<YOUR_DTMF_KEY_DIV_ID>';
    let callStatusMessageLabelId = '<YOUR_CALL_STATUS_MESSAGE_LABEL_ID>';
    let remoteAudioId = '<YOUR_AUDIO_CONTROL_ID>';
  6. Add the makeCall(contactAddress) method to the Click-to-Call button.

  7. To send DTMF tones, call the guiSendDTMF(digit) function when a DTMF button is clicked.

  8. Set your preferences in the configurations section of the clicktocall.js file. This is a section with several configuration variables that control certain types of behavior.

    • Set the retry count with retryCount. If a call disconnects, this is the number of times the system attempts to reconnect the call. The default is 3.

    • Set the POCREnvironmentXHeaderValue value to PROD.

    • Set the configuration settings for the phone server in phoneServerConfig and clientId.

      let phoneServerConfig = {
      	domain: '<Domain of the SIP server>', //Set value of this configuration to 'cxonevoice.com'
      	addresses: [], //Keep this array empty
      	iceServers: [], //Keep this array empty
      	userName: '<username>', //This configuration is a human-readable string used to identify the sender in a more friendly way. In agent applications like CXone Agent, this might be displayed on the screen during a call. Tthis value should not contain any spaces and should not exceed 20 characters. 
      	displayName: '', // This is an optional field and its value can be kept the same as userName 
      	password: '' //Keep this field empty
      }
      let clientID = '<YOUR_CLIENT_ID>'; //Set the value of this configuration as provided by CXone 
  9. If you want to customize the contact-side notifications related to calls failing or disconnecting, change the text strings in the following variables in clicktocall.js.

    • callFailedToConnectErrorMessage

    • uiErrorMessage

    • contactSupportTeamMessage

  10. Be sure to perform ample testing to ensure you can initiate and route calls successfully.