Skip to content

Quickstart Guide (Calling)

Sreekanth Narayanan edited this page Sep 21, 2023 · 24 revisions

/*<![CDATA[*/ div.rbtoc1695302837758 {padding: 0px;} div.rbtoc1695302837758 ul {list-style: disc;margin-left: 0px;} div.rbtoc1695302837758 li {margin-left: 0px;padding-left: 0px;} /*]]>*/

Introduction

The Calling SDK helps in developing applications that leverage Webex Calling workflows across browsers. It comprises of a suite of modules that provide a host of features.

  • Device Registration
  • Inbound/outbound calls
  • Supplementary services like hold/resume, call transfer(blind/consult)
  • Voicemail
  • Call Settings (Call forwarding, do not disturb, call waiting).
  • Call History
  • Contacts

Details about these features are covered later in the document.

Importing Calling SDK

To import the latest stable version of the Calling SDK one can use NPM or CDN.

NPM

import Calling from 'webex/calling'

CDN

 A built, minified version of the Calling SDK is also provided. It can be accessed as mentioned below:

<script src="../calling.min.js"></script>

// TODO: Add the location of the published calling SDK

Initialize Calling SDK

To initialize Calling SDK, either a Webex object or Webex configuration is required.

Option 1
  1. Initialize Webex object. (Refer to Web SDK Wiki | Quick Start guide to find the steps)
  2. Register with Webex Device Manager (WDM) and establish mercury connection.
  3. Pass Webex object and calling configuration as arguments and create new Calling instance which will initialize different client modules that it offers. (Refer to the table in the Calling Configuration section to identify Calling Configuration attributes)
const calling  = new Calling(webex, callingConfig);
Option 2
  1. Pass Webex configuration and calling configuration and create new Calling instance. (Refer to Web SDK Wiki | Quick Start guide to identify configuration attributes for Webex Configuration)
  2. Wait for Calling instance to be ready by listening for the event.
  3. Once the event is received, call the register API to trigger Webex Device Manager registration, establishing mercury connection and initializing the various client modules within Calling.
const calling  = new Calling({webexConfig, callingConfig});
calling.on("ready", () => {
	calling.register().then(() => {
		// insert code to register with Mobius
	});
});

Note: Client objects will be created based on calling configuration inside Calling instance.

Calling Configuration

This is the example of calling configuration.

callingConfig: {
	clientConfig: {
		calling: boolean,
		contact: boolean,
		callHistory: boolean,
		callSettings: boolean,
		voicemail: boolean,
	},
	callingClientConfig: {
		logger: {
			level: string
		},
		discovery: {
			country: string,
			region: string,
		},
		serviceData: {
			domain: string,
			indicator: string,
		}
	},
	logger: {
		level: string
	}
}

Following tables cover different configuration attributes present inside calling configuration.

Client Configuration

| S.no

|

Attribute

|

Description

|

Data type

|

Default attribute?

|

Public attribute?

| | --- | --- | --- | --- | --- | --- | | 1. | calling | Toggles the availability of the callingClient module  | Boolean | No | YES | | 2. | contact | Toggles the availability of the contactClient module | Boolean | No | YES | | 3. | callHistory | Toggles the availability of the callHistory module | Boolean | No | YES | | 4. | callSettings | Toggles the availability of the callSettings module | Boolean | No | YES | | 5. | voicemail | Toggles the availability of the voicemailClient module | Boolean | No | YES |

Calling Client Configuration

| S.no

|

Attribute

|

Description

|

Data type

|

Default attribute?

|

Public attribute?

| | --- | --- | --- | --- | --- | --- | | 1. | discovery |
| Object | No | Yes | | 1.a. | country | Country from where the device registration is triggered | String | No | Yes | | 1.b. | region | Region from where the device registration is triggered | String | No | Yes | | 2. | serviceIndicator |
| String | No | Yes | | 2.a. | domain | Identifies which service is using Calling SDK | String | Yes | Yes | | 2.b. | indicator |
| String | No | No | | 3.  | logger | Logger Configuration | Object |
|
|

Logger Configuration

| S.no

|

Attribute

|

Description

|

Data type

|

Default attribute?

|

Public attribute?

| | --- | --- | --- | --- | --- | --- | | 1. | level | Maximum log level that should be printed to the console. One of silent|error|warn|log|info|debug|trace | String |
| YES |

Client Modules

There are multiple client modules available within the Calling Instance as mentioned in the introduction. They are created based on the configuration provided during initialization.

CallingClient 

This module provides functionalities for:

  • Fetching line objects
  • Line registration
  • Inbound/outbound calls
  • Supplementary services like hold/resume, call transfer(blind and consult)
ContactClient

This module is required for contact management. Functionalities available are:

  • Fetch contacts
  • Create contacts
  • Create contact groups
VoicemailClient

This module is used to provide access to voicemail functionalities like:

  • Fetching voicemails
  • Marking voicemails read/unread
  • Deleting voicemails
  • Fetching transcript for voicemails
CallHistoryClient

This module helps in fetching call records across different types of calls and meetings in Webex. It also provides options to filter these records.

CallSettingsClient

This module allows user-specific setting changes. Some of them are listed below.

  • Call Forwarding
  • Call Waiting
  • Do not Disturb(DND)
Clone this wiki locally