DocumentationBlogSupport
Log inSign up
Log inSign up
BlogSupport
Build
Getting StartedPlatform Introduction
Embedded Apps
What's NewOverviewDeveloper GuideSidebar API Quick StartSubmission Checklist for Embedded Apps
Design Guidelines
MessagingMeetingsDevicesSidebarSidebar on Mobile
API Reference
BotsButtons and CardsIntegrationsBYODSService AppsService App GuestsService Apps G2GGuest IssuerWidgetsWebex ConnectLogin with WebexInstant ConnectInstant Connect Meeting LinksDeveloper SandboxBeta ProgramSubmit Your AppSupport PolicyFAQs
APIs
API Behavior ChangesPartners API GuideXML API DeprecationAccess the APIREST API BasicsCompliance
Webex APIs
Reference
Data Sources
Admin
OverviewAdmin APIsHybrid ServicesAuthentication
Guides
Hybrid ServicesWebhooksReal-time File DLP BasicsProvisioning APIsBackground ImagesAudit Events Error Reference
Reference
Admin Audit EventsAuthorizationsEventsGroupsHistorical AnalyticsHybrid ClustersHybrid ConnectorsLicensesMeeting QualitiesOrganization ContactsOrganizationsPartner ManagementPartner Reports/TemplatesPartner TagsPeopleRecording ReportRecordingsReport TemplatesReportsResource Group MembershipsResource GroupsRolesSecurity Audit EventsSession TypesSettingsSpace ClassificationsTracking CodesWorkspace LocationsWorkspace Metrics
Webex Calling Beta
Overview
Guides
Integrations and AuthorizationMetadata and Samples
Webex Calling
OverviewSDKs and ToolsWhat's New
Guides
Integrations and AuthorizationProvisioning APIsMetadata and SamplesBackground Images
Reference
Call ControlsCall RoutingCall Settings For MeCalling Service SettingsClient Call SettingsConference ControlsConverged RecordingsDECT Devices SettingsDevice Call SettingsDevicesEmergency Services SettingsFeatures: Announcement PlaylistFeatures: Announcement RepositoryFeatures: Auto AttendantFeatures: Call ParkFeatures: Call PickupFeatures: Call QueueFeatures: Call RecordingFeatures: Customer Experience EssentialsFeatures: Hunt GroupFeatures: Operating ModesFeatures: Paging GroupFeatures: Single Number ReachLocation Call SettingsLocation Call Settings: Call HandlingLocation Call Settings: SchedulesLocation Call Settings: VoicemailLocationsNumbersPSTNPartner Reports/TemplatesPeopleRecording ReportReportsReports: Detailed Call HistorySend Activation EmailUser Call SettingsVirtual Line Call SettingsWorkspace Call SettingsWorkspaces
Webex for Broadworks
Overview
Guides
Integrations and AuthorizationDeveloper's Guide
Reference
BroadWorks Billing ReportsBroadWorks EnterprisesBroadWorks SubscribersBroadWorks Workspaces
Webex for Wholesale
Overview
Guides
Developer's Guide
Reference
Wholesale Billing ReportsWholesale Provisioning
Webex for UCM
Guides
Integrations and Authorization
Reference
UCM Profile
Contact Center
Overview
Reference
Data Sources
Customer Journey Data
Overview
Guides
Getting StartedFAQ
Devices
Overview
Guides
Devices
Reference
Device Call SettingsDevice ConfigurationsDevicesWorkspace LocationsWorkspace MetricsWorkspace PersonalizationWorkspacesxAPI
Directory Services
Reference
Domain ManagementIdentity Organization
Meetings
Overview
Guides
Integrations and AuthorizationWebhooksWebinar GuideMeeting Resource Guide
Reference
Meeting ChatsMeeting Closed CaptionsMeeting InviteesMeeting MessagesMeeting ParticipantsMeeting PollsMeeting PreferencesMeeting Q and AMeeting QualitiesMeeting TranscriptsMeetingsMeetings Summary ReportPeopleRecording ReportRecordingsSession TypesTracking CodesVideo MeshWebhooks
Messaging
Overview
Guides
BotsIntegrations and AuthorizationWebhooksButtons and Cards
Reference
Attachment ActionsEventsMembershipsMessagesPeopleRoom TabsRoomsTeam MembershipsTeamsWebhooks
SCIM 2
Overview
Reference
SCIM 2 BulkSCIM 2 GroupsSCIM 2 Users
Workspace Integrations
OverviewTechnical DetailsControl Hub Features
Webex Status API
Full API Reference
Admin Audit EventsAttachment ActionsAuthorizationsBroadWorks Billing ReportsBroadWorks EnterprisesBroadWorks SubscribersBroadWorks WorkspacesCall ControlsCall RoutingCall Settings For MeCalling Service SettingsClient Call SettingsConference ControlsConverged RecordingsDECT Devices SettingsData SourcesDevice Call SettingsDevice ConfigurationsDevicesDomain ManagementEmergency Services SettingsEventsFeatures: Announcement PlaylistFeatures: Announcement RepositoryFeatures: Auto AttendantFeatures: Call ParkFeatures: Call PickupFeatures: Call QueueFeatures: Call RecordingFeatures: Customer Experience EssentialsFeatures: Hunt GroupFeatures: Operating ModesFeatures: Paging GroupFeatures: Single Number ReachGroupsGuests ManagementHistorical AnalyticsHybrid ClustersHybrid ConnectorsIdentity OrganizationIssuesLicensesLocation Call SettingsLocation Call Settings: Call HandlingLocation Call Settings: SchedulesLocation Call Settings: VoicemailLocationsMeeting ChatsMeeting Closed CaptionsMeeting InviteesMeeting MessagesMeeting ParticipantsMeeting PollsMeeting PreferencesMeeting Q and AMeeting QualitiesMeeting TranscriptsMeetingsMeetings Summary ReportMembershipsMessagesNumbersOrganization ContactsOrganizationsPSTNPartner ManagementPartner Reports/TemplatesPartner TagsPeopleRecording ReportRecordingsReport TemplatesReportsReports: Detailed Call HistoryResource Group MembershipsResource GroupsRolesRoom TabsRoomsSCIM 2 BulkSCIM 2 GroupsSCIM 2 UsersSecurity Audit EventsSend Activation EmailSession TypesSettingsSiteSpace ClassificationsTeam MembershipsTeamsTracking CodesUCM ProfileUser Call SettingsVideo MeshVirtual Line Call SettingsWebhooksWholesale Billing ReportsWholesale ProvisioningWorkspace Call SettingsWorkspace LocationsWorkspace MetricsWorkspace PersonalizationWorkspacesxAPI
API Changelog
SDKs
Space Meetings Migration
Calling
Introduction
Platform
Web
IntroductionQuickstart
Basics
AuthorizationCore ConceptsCalls
Advanced Features
Call SettingsContactsSupplementary ServicesVoicemailBackground Noise Reduction
Kitchen Sink
Meetings
Introduction
Platform
Web
IntroductionQuickstart
Basics
AuthorizationJoin a MeetingMigration To Improved MeetingsPasswords & CaptchasUnified Space Meetings
Advanced Features
Advanced ControlsDialing In and OutStreams & EffectsVideo Resolution
Multistream
Multistream Comprehensive GuideMultistream Quickstart
Migrating SDK V2 to V3
iOSAndroidBrowserNode.jsClick to Call
Developer CommunityCertifications

SDKs

Web Calling SDK | Quickstart Guide

Welcome to the Quick Start Guide for the Webex Calling SDK. This guide is designed to provide developers with a concise walkthrough to swiftly set up, authorize, and test the core calling functionalities within the Calling SDK.

By following the sequential flow of this document and integrating the provided code snippets, you'll be able to authenticate your application and initiate your first calls. Whether you're new to Webex's Calling SDK or looking to brush up on the basics, this guide ensures a streamlined experience to get you up and running in no time. Let's dive in!

anchorInstall the Calling SDK

anchor

To install and consume the latest stable version of the Calling SDK you can use NPM or CDN.

NPM

We test against the Active LTS (Long Term Support) version of Node.js and use npm@6 to run security audits.

The Calling SDK is available in two forms as a nodejs module via NPM. Install either of the following modules based on how you'd like to consume the Calling SDK. For more information on the ways to consume the module, refer to the section below.

  • @webex/calling
  • webex

When using the @webex/calling package, use these commands to install the package. You'll use these packages for "Option 1" in the section below.

npm install --save @webex/calling

or

yarn add @webex/calling

When using the webex package, use these commands to install the package. You'll use this for "Option 2" in the section below.

npm install --save webex

or

yarn add webex
CDN

A minified version of the Calling SDK is also provided via the unpkg.com Content Delivery Network (CDN). To include the CDN Calling SDK:

<script src='https://unpkg.com/webex/umd/calling.min.js'></script>

anchorInitialize the Calling SDK

anchor

To initialize the Calling SDK, you can use either a Webex object or Webex configuration. The initialization of the SDK also depends on how it is being consumed in the application. The process varies between the CDN and NPM forms of consumption.

Option 1

This option includes different steps based how you consume the SDK in your application. Use this option when you've already initialized a webex object prior to initializing the Calling SDK. This option requires you to have installed the @webex/calling package.

CDN
  1. Initialize a Webex object with an access token and required configuration. Refer to the Quickstart guide on how to initialize the webex object. You can also refer to the webexConfig object in Option 2 as a reference.
  2. Register with Webex Device Manager (WDM) and establish a mercury connection.
  3. Pass the webex and callingConfig objects as arguments and create a new Calling instance which initializes the different client modules. (Refer to the table in the Calling Configuration section to identify Calling Configuration attributes).
const calling = await Calling.init({ webex, callingConfig });
NPM
  1. Initialize a Webex object with an access token and required configuration. Refer to the Quickstart guide on how to initialize the webex object. You can also refer to the webexConfig object in Option 2 as a reference.
  2. Register with Webex Device Manager (WDM) and establish a mercury connection.
  3. Pass the webex and CallingClientConfig as arguments and create a new CallingClient instance.
import {createClient} from '@webex/calling';

const callingClientConfig = {
  logger: {
    level: 'info'
  },
  serviceData: { // This configuration is optional for Webex Calling. It is mandatory for Webex Contact Center
    indicator: 'contactcenter',
    domain: 'rtw.prod-us1.rtmsprod.net'
  },
};

const callingClient = await createClient(webex, callingClientConfig);

Similarly, initialize other client modules available in the Calling SDK to utilize features like voicemail and contacts.

import {createVoicemailClient, createContactsClient} from '@webex/calling';

const config = {
  logger: {
    level: 'info'
  },
};

const vmClient = await createVoicemailClient(webex, config);
const contactClient = await createContactsClient(webex, config);
Option 2

Use this option when you have not initialized the webex object prior to initializing the Calling SDK. This option requires you to have installed the webex package. The steps are common for both NPM and CDN methods. Note the first line of the code snippet, which should be avoided while using CDN.

  1. Pass the webexConfig and callingConfig objects as arguments and create a new Calling instance. (Refer to the attribute section for Webex configuration attributes).
  2. Wait for the Calling instance to be ready by listening for the ready event.
  3. Once the ready event is received, call the register() method to trigger Webex Device Manager registration, which establishes a mercury connection and initializes the various client modules within Calling object.
import Calling from 'webex/calling'; // NPM only

// Create the Webex configuration

const webexConfig = {
  config: {
    logger: {
      level: 'debug' // Set the desired log level
    },
    meetings: {
      reconnection: {
        enabled: true
      },
      enableRtx: true
    },
    encryption: {
      kmsInitialTimeout: 8000,
      kmsMaxTimeout: 40000,
      batcherMaxCalls: 30,
      caroots: null
    },
    dss: {}
  },
  credentials: {
    access_token: 'access_token'
  }
};

// Create the calling configuration

const callingConfig = {
  clientConfig: {
    calling: true,
    contact: true,
    callHistory: true,
    callSettings: true,
    voicemail: true
  },
  callingClientConfig: {
    logger: {
      level: 'info'
    }
  },
  logger: {
    level: 'info'
  }
};

// Create the Calling object

const calling = await Calling.init({ webexConfig, callingConfig });
let callingClient;
calling.on('ready', () => {
  calling.register().then(() => {
    callingClient = calling.callingClient;
  });
});

anchorAuthorize with Webex Calling

anchor

Initiating the authorization process with Webex Calling is the first step to harness the communication capabilities of the SDK. Before diving into call operations, you must first obtain the Line object from the CallingClient. Once you have the Line object in hand, you can invoke the line.register() function to create a device, laying the groundwork for initiating and managing voice calls. Before triggering the register() method, however, it's crucial to listen for the registered event to ensure the device is successfully registered and ready for operations. This section will guide you through these steps.

// Get Line object from the callingClient. Currently, only a single
// line is supported in the Calling package

const line = Object.values(callingClient.getLines())[0];

// Listen for the registered event from the line

line.on('registered', (lineInfo) => {
  console.log('Line information: ', lineInfo);
});

line.register();

anchorPlace a Call

anchor

Starting an outgoing call to a designated destination involves a sequence of steps. First, you need to capture the microphone stream, since this step ensures your application is set to transmit voice. Once the microphone stream is in place, you'll need to create the Call object from the Line.

You can create a microphone stream in a couple of ways.

Option 1

In this option, you'll use the createMicrophoneStream() within the Calling object to fetch the default microphone on the system. This option is only available when consuming the SDK via CDN.

const localAudioStream = await Calling.createMicrophoneStream({ audio: true });

const call = line.makeCall({
  type: 'uri',
  address: 'destination'
});

await call.dial(localAudioStream);
Option 2

This option is available to you if you consume the SDK via NPM. You'll need to use the LocalMicrophoneStream class from the SDK to create a microphone stream.

import {LocalMicrophoneStream} from '@webex/calling';

const localStream = navigator.mediaDevices.getUserMedia({audio: true});
const audioTrack = localStream.getAudioTracks()[0];
const localMicStream = new LocalMicrophoneStream(new MediaStream([audioTrack])); 

const call = line.makeCall({
  type: 'uri',
  address: 'destination'
});

await call.dial(localMicStream);

As you navigate through the intricacies of initiating and managing calls, it's vital to note that the Call object is not just a static entity but a dynamic one, emitting various events during the course of a call. By actively listening for these events, developers can gain insights into the different transitions and states that a call might enter, be it ringing, connected, or ended. Monitoring these events allows for a more responsive and intuitive user experience, as your application can adjust in real-time based on the call's status. For instance, you might update the user interface to reflect when a call is on hold or when the other party has picked up. Incorporating this event-driven approach will ensure a robust and interactive calling experience for your users.

call.on('progress', (correlationId) => {
  console.log('Call is ringing at the remote end');
});

call.on('connect', (correlationId) => {
  console.log('Call has been answered');
});

call.on('established', (correlationId) => {
  console.log('Call is now established. Media flows both ways');
});

call.on('disconnect', (correlationId) => {
  console.log('Call has been disconnected');
});

call.on('remote_media', (track) => {
  // Remote media information received from the SDK. This is relayed to the
  // application using the remote_media event
  document.getElementById('remote-audio').srcObject = new MediaStream([track]);
});

With the Call object ready, you can then utilize the dial method, incorporating the previously acquired microphone stream. This method combines the audio input with the call initiation, facilitating a communication link to your desired destination. This guide elucidates each step, providing you with a clear path to efficiently manage and initiate outgoing calls.

await call.dial(localAudioStream);

Handling incoming calls requires a similar approach. The first step involves listening for the incoming_call event on the Line. This event signals the arrival of an incoming call and provides the initial alert to the application. Once this event is detected and an incoming call is acknowledged, the focus shifts to the Call object. Here, similar to outgoing calls, developers should actively listen to the set of events emitted by the Call object. These events provide real-time updates about the call's status, such as whether it's been answered, or disconnected. Once those listeners are ready, you can call the answer method to answer the call.

let incomingCall;

line.on('line:incoming_call', (incomingCall) => {
  console.log('Incoming call arrived. Call information', incomingCall);
});

incomingCall.on('disconnect', (correlationId) => {
  console.log('Call has been disconnected');
});

incomingCall.on('remote_media', (track) => {
  // Remote media information received on the SDK. This is relayed to the
  // application using the remote_media event
  document.getElementById('remote-audio').srcObject = new MediaStream([track]);
});

incomingCall.answer();

Client objects will be created based on the calling configuration inside a Calling instance.

anchorCalling Configuration Details

anchor

This is the definition for a callingConfig object:

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,
   guestName: string
  }
 },
 logger: {
  level: string
 }
}

The following tables cover the different configuration attributes present inside the callingConfig object.

Client Configuration

S.noAttributeDescriptionData TypeDefault Attribute?Public Attribute?
1.callingToggles the availability of the callingClient module.BooleanNoYes
2.contactToggles the availability of the contactClient module.BooleanNoYes
3.callHistoryToggles the availability of the callHistory module.BooleanNoYes
4.callSettingsToggles the availability of the callSettings module.BooleanNoYes
5.voicemailToggles the availability of the voicemailClient module.BooleanNoYes
Calling Client Configuration

S.noAttributeDescriptionData TypeDefault Attribute?Public Attribute?
1.discoveryObjectNoYes
1.a.countryCountry from where the device registration is triggered. It has to be an Alpha-2 code as per ISO 3166-1 standards. Here's the list of officially assigned Alpha-2 codes from Wikipedia.StringNoYes
1.b.regionRegion from where the device registration is triggered. It should be one of the following: AP-SOUTHEAST, US-EAST, EU, or EU-CENTRAL.StringNoYes
2.serviceDatait represents the service data of the SDK.StringNoYes
2.a.domainIdentifies which service is using the Calling SDK.StringYesYes
2.b.indicatorThe type of service being used in the SDK. Its value should be CALLING, CONTACT_CENTER, or GUEST_CALLING.ServiceIndicatorNoNo
2.c.guestNameThe guestName attribute is used in the SDK to indicate the name of the guest within a calling service.StringNoYes
3.loggerLogger configuration.Object
Logger Configuration

S.noAttributeDescriptionData TypeDefault Attribute?Public Attribute?
1.levelMaximum log level that should be printed to the console. Possible values:silent, error, warn, log, info, debug, traceStringYes
In This Article
  • Install the Calling SDK
  • Initialize the Calling SDK
  • Authorize with Webex Calling
  • Place a Call
  • Calling Configuration Details

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.