webex

1.x

webex-js-sdk

webex

The Cisco Webex JS SDK

Install

npm install --save webex

Usage

All of the examples in these API docs assume you've gotten an authenticated Webex instance (unless otherwise specified) using one of the methods below.

webex has three basic modes of operation:

Shell Script (Quick Start)

This is the quickest way to get up and running with our JavaScript SDK. Simply set the environment variable WEBEX_ACCESS_TOKEN to your access token and add the following line at the top of your JavaScript file to get a ready-to-use instance.

You can get your WEBEX_ACCESS_TOKEN from the Cisco Webex for Developers portal.

const webex = require(`webex/env`);

webex/env is also a great way to get started with bots.

Browser

Our JavaScript SDK provides out-of-the-box support for the OAuth 2.0 Implicit Grant Flow.

You'll need to register an OAuth Client to get your "authorization string"

Use the steps under Bundling (or something similar) to get the SDK into your browser, then use the following JavaScript to get started:

const webex = Webex.init({
  config: {
    authorizationString: <your auth URL>,
  }
});

webex.once(`ready`, () => {
  if (webex.canAuthorize) {
    /* Your application code goes here */
  }
  else {
    /* Your login code goes here */

    /*
      The following is a naive example of how to log in a user. Note that login should probably require a user action, otherwise errors can lead you into an infinite redirect loop.

      This will direct the user agent to the Cisco login page. Once the user logs in, they'll be redirected back to your app and the SDK will handle parsing the URL.
    */
    webex.authorization.initiateLogin();
  }
});

Bundling

You'll need to bundle the SDK to use it in a web browser. Right now, we do all our SDK testing with Browserify, but our Cisco Webex Widgets use webpack.

The following snippet is the bare minimum to get our code into a form suitable for a web browser. You'll probably want to additionally pipe it through a minifier like UglifyJS before going to production.

npm install webex
npm install -g browserify
echo "window.webex = require('webex')" > ./index.js
browserify index.js > bundle.js

Then, just load your bundle using:

<script src="/bundle.js"></script>

NodeJS

Though the implicit flow is great for single page apps, it's not ideal for integrations that might need to do things on your users' behalf months in the future. We additionally support the OAuth 2.0 Authorization Code Grant flow, but due to its complexity, there's a bit you'll need to wire up in your app to take advantage of it. The following is an example of how an Express app might do authentication.

var Webex = require('webex');
const assert = require(`assert`);

app.use(function(req, res, next) {
  req.webex = Webex.init({
    config: {
      credentials: {
        authorizationString: <your auth URL>,
        client_secret: <your client secret>
      },
    }
  });

  req.webex.once(`ready`, next);
});

app.get(`/login`, (req, res) => {
  // buildLoginUrl() defaults to the implicit grant flow so explicitly pass
  // `confidential` to generate a URL suitable to the Authorization Code grant
  // flow.
  res
    .redirect(req.webex.credentials.buildLoginUrl({clientType: 'confidential'}))
    .end();
});

app.get(`/oauth/redirect`, (req, res, next) => {
  assert(req.params.code);
  req.webex.requestAuthorizationCodeGrant(req.params)
    .then(() => {
      res.redirect(`/`).end();
    })
    .catch(next);
});

Webex

See Browser Guide and Server Guide

new Webex()
Static Members
init(attrs)

Authorization

AuthorizationBrowser

Browser support for OAuth2. Automatically parses the URL hash for an access token

new AuthorizationBrowser()
Instance Members
isAuthenticating
isAuthorizing
initiateLogin(options)
initiateImplicitGrant(options)
initiateAuthorizationCodeGrant(options)
requestAccessTokenFromJwt(options)
logout(options)

AuthorizationNode

NodeJS support for OAuth2

new AuthorizationNode()
Instance Members
isAuthenticating
isAuthorizing
requestAuthorizationCodeGrant(options)
requestAccessTokenFromJwt(options)

Calling

Phone

new Phone()
Instance Members
connected
defaultFacingMode
registered
isCallingSupported()
register()
deregister()
createLocalMediaStream(options)
dial(dialString, options)
Events
call:created
call:incoming

PhoneConfig

PhoneConfig

Type: Object

Properties
audioBandwidthLimit (number?)
videoBandwidthLimit (number?)
enableExperimentalGroupCallingSupport (boolean?) : Group calling support should work, but necessarily introduces some breaking changes to the API. In order to get feedback, we're keeping the API unchanged by default and requiring folks to opt-in to these breakages. As these changes evolve, you may see some breaking changes that don't necessarily follow semantic versioning. When we're ready to drop the "experimental" moniker, we'll release an official SemVer Major bump.
Example
{
  audioBandwidthLimit: 64000,
  videoBandwidthLimit: 1000000,
  enableExperimentalGroupCallingSupport: false,
  hangupIfLastActive: {
    call: true,
    meeting: false
  }
}
Static Members
HangupBehavior

Call

new Call()
Instance Members
memberships
remoteAudioMuted
remoteVideoMuted
facingMode
localMediaStream
remoteMember
from
state
status
host
roomId
remoteMediaStream
localScreenShare
acknowledge()
answer
createOrJoinLocus(target, options)
decline()
getRawStatsStream()
getStatsStream()
hangup()
reject()
sendDtmf(tones)
sendFeedback(feedback)
startReceivingAudio()
startReceivingVideo()
startSendingAudio()
startSendingVideo()
stopReceivingAudio()
stopReceivingVideo()
stopSendingAudio()
stopSendingVideo()
toggleFacingMode()
toggleReceivingAudio()
toggleReceivingVideo()
toggleSendingAudio()
toggleSendingVideo()
Events
membership:notified
ringing
connected
disconnected
active
initializing
inactive
terminating
localMediaStream:change
remoteMediaStream:change
error
memberships:remove
membership:connected
membership:declined
membership:disconnected
membership:waiting
membership:change
memberships:add

CallMemberships

new CallMemberships()

CallMembership

new CallMembership()
Instance Members
isInitiator
personId
state
audioMuted
videoMuted

StatsStream

Polls an RTCPeerConnection once per second and emits its RTCStatsReport

new StatsStream(pc: RTCPeerConnection)

Extends Readable

Parameters

StatsStream

Polls an RTCPeerConnection once per second and emits its RTCStatsReport RTCStatsReport

new StatsStream(config: Object)

Extends Readable

Parameters
config (Object = {})

StatsFilter

Reforms the interesting data from an RTCStatsReport to a new format

new StatsFilter()

Extends Transform

StatsFilter

Reforms the interesting data from an RTCStatsReport into something grokkable

new StatsFilter()

Extends Transform

Meetings

Maintain a cache of meetings and sync with services.

new Meetings(args: ...any)

Extends WebexPlugin

Parameters
args (...any)
Static Members
setReachability()
getReachability()
startReachability()
getPersonalMeetingRoom()
create(destination, type = null)
getMeetingByType(type, value)
getAllMeetings(options)
syncMeetings()
getScheduledMeetings(options)
getAnalyzer()
getCalculator()
getDevices
Instance Members
personalMeetingRoom
getLogger()
propertyName
propertyName
Events
meetings:ready
meeting:removed
meeting:added
media:ready

Resources

These are the resources provided by Webex instances for interacting with our developer API

Memberships

Memberships represent a person's relationship to a room. Use this API to list members of any room that you're in or create memberships to invite someone to a room. Memberships can also be updated to make someone a moderator or deleted to remove them from the room.

new Memberships()
Instance Members
listen()
create(membership)
get(membership)
list(options)
listWithReadStatus(options)
remove(membership)
update(membership)
updateLastSeen(message)

Messages

Messages are how people communicate in rooms. Each message timestamped and represented in Webex as a distinct block of content. Messages can contain plain text and a single file attachment. See the Message Attachments Guide for a list of supported media types.

new Messages()
Instance Members
listen()
create(message)
get(message)
list(options)
remove(message)

People

new People()
Instance Members
get(person)
list(options, showAllTypes)

Rooms

Rooms are virtual meeting places for getting stuff done. This resource represents the room itself. Check out the Memberships API to learn how to add and remove people from rooms and the Messages API for posting and managing content.

new Rooms()
Instance Members
listen()
create(room)
get(room, options)
list(options)
listWithReadStatus(maxRecent)
getWithReadStatus(roomId)
remove(room)
update(room)

Teams

new Teams()
Instance Members
create(team)
get(team, options)
list(options)
update(team)

TeamMemberships

Team Memberships represent a person's relationship to a team. Use this API to list members of any team that you're in or create memberships to invite someone to a team. Team memberships can also be updated to make someome a moderator or deleted to remove them from the team.

Just like in the Webex app, you must be a member of the team in order to list its memberships or invite people.

new TeamMemberships()
Instance Members
create(membership)
get(membership)
list(options)
remove(membership)
update(membership)

Webhooks

Webhooks allow your app to be notified via HTTP when a specific event occurs on Webex. For example, your app can register a webhook to be notified when a new message is posted into a specific room.

new Webhooks()
Instance Members
create(webhook)
get(webhook)
list(options)
remove(webhook)
update(webhook)

Logging

Logger

new Logger()

LoggerConfig

LoggerConfig

Type: Object

Properties
level (string?) : Maximum log level that should be printed to the console. One of silent|error|warn|log|info|debug|trace
historyLength (number?) : Maximum number of entries to store in the log buffer.
Example
{
  level: process.env.LOGGER_LEVEL,
  historyLength: 1000
}

Types

The following typedefs describes the responses of the various API calls.

FeedbackObject

Payload for Call#sendFeedback

FeedbackObject

Type: Object

Properties
userRating (number) : Number between 1 and 5 (5 being best) to let the user score the call
userComments (string) : Freeform feedback from the user about the call
includeLogs (Boolean) : set to true to submit client logs to the Webex Teams cloud. Note: at this time, all logs, not just call logs, generated by the sdk will be uploaded to the Webex Cloud. Care has been taken to avoid including PII in these logs, but if you've taken advantage of the SDK's logger, you should make sure to avoid logging PII as well.

MembershipObject

MembershipObject

Type: Object

Properties
id (string) : Unique identifier for the membership
roomId (string) : The room ID
personId (string) : The person ID
personEmail (email) : The email address of the person / room member
isModerator (boolean) : Indicates whether the specified person should be a room moderator
isMonitor (boolean) : Indicates whether the specified member is a room monitor
created (isoDate) : The date and time that this membership was created

MessageObject

MessageObject

Type: Object

Properties
id (string) : (server generated) Unique identifier for the message
personId (string) : The ID for the author of the messasge
personEmail (email) : The email for the author of the messasge
roomId (string) : The ID for the room of the message
text (string) : The message posted to the room in plain text
markdown (string) : The message posted to the room in markdown
files (Array<string>) : The source URL(s) for the message attachment(s). See the Message Attachments Guide for a list of supported media types.
created (isoDate) : (server generated) The date and time that the message was created

PersonObject

PersonObject

Type: Object

Properties
id (string) : (server generated) Unique identifier for the person
emails (Array<email>) : Email addresses of the person
displayName (string) : Display name of the person
created (isoDate) : (server generated) The date and time that the person was created

RoomObject

RoomObject

Type: Object

Properties
id (string) : (server generated) Unique identifier for the room
title (string) : The display name for the room. All room members will see the title so make it something good
teamId (string) : (optional) The ID of the team to which the room belongs
created (isoDate) : (server generated) The date and time that the room was created

TeamObject

TeamObject

Type: Object

Properties
id (string) : (server generated) Unique identifier for the team
name (string) : The name of the team
created (isoDate) : (server generated) The date and time that the team was created

TeamMembershipObject

TeamMembershipObject

Type: Object

Properties
id (string) : (server generated) Unique identifier for the team membership
teamId (string) : The team ID
personId (string) : The person ID
personEmail (string) : The email address of the person
isModerator (boolean) : Set to true to make the person a team moderator
created (string) : (server generated) The date and time that the team membership was created

WebhookObject

WebhookObject

Type: Object

Properties
id (string) : (server generated) Unique identifier for the webhook
resource (string) : The resource type for the webhook
event (string) : The event type for the webhook
filter (string) : The filter that defines the webhook scope
targetUrl (string) : The URL that receives POST requests for each event
name (string) : A user-friendly name for this webhook
created (string) : (server generated) The date and time that the webhook was created

email

An email address, as a string.

email

Type: string

isoDate

The date and time, specified in ISO 8601 extended offset date/time format (e.g. 2015-10-18T14:26:16+00:00).

isoDate

Type: string

AttachmentActionObject

AttachmentActionObject

Type: Object

Properties
id (string) : (server generated) Unique identifier for the attachment action
messageId (string) : The ID of the message in which attachment action is to be performed
type (string) : The type of attachment action eg., submit
inputs (Object) : The inputs for form fields in attachment message
personId (string) : (server generated) The ID for the author of the attachment action
roomId (string) : (server generated) The ID for the room of the message
created (isoDate) : (server generated) The date and time that the message was created

initialize

Initializer

initialize(args: ...any): undefined
Parameters
args (...any)
Returns
undefined:

initialize

Initializer

initialize(args: ...any): undefined
Parameters
args (...any)
Returns
undefined:

create

Post a new attachment action for a message with attachment.

Parameters
attachmentAction (AttachmentActionObject)
Returns
Promise<AttachmentActionObject>:
Example
webex.rooms.create({title: 'Create Message Example'})
  .then(function(room) {
    return webex.messages.create({
      text: 'Howdy!',
      roomId: room.id,
      attachments:[ {
         contentType: 'application/vnd.microsoft.card.adaptive',
        content: {
          type: 'AdaptiveCard',
          version: '1.0',
          body: [
           {
            type: 'TextBlock',
            text: '',
            size: 'large'
            },
          {
            type: 'TextBlock',
            text: 'Adaptive Cards',
            separation: 'none'
          }
          {
          type: 'Input.Date',
          id: 'dueDate'
          }
      ],
    actions: [
        {
            type: 'Action.Submit',
            title: 'Due Date'
        }
    ]
  }
 }]
    });
  })
  .then(function(message) {
   return webex.attachmentActions.create({
     type: 'submit',
     messageId: message.id,
     inputs:{
       dueDate: '26/06/1995'
     }
   })
   .then(function(attachmentAction)){
     var assert = require('assert');
     assert(attachmentAction.id);
     assert(attachmentAction.type);
     assert(attachmentAction.personId);
     assert(attachmentAction.inputs);
     assert(attachmentAction.messageId);
     assert(attachmentAction.roomId);
     assert(attachmentAction.created);
     return 'success';
    }
  });
  // => success

get

Returns a single attachment action.

get(attachmentAction: string): Promise<AttachmentActionObject>
Parameters
attachmentAction (string)
Returns
Promise<AttachmentActionObject>:
Example
var attachmentAction;
webex.rooms.create({title: 'Get Message Example'})
  .then(function(room) {
    return webex.messages.create({
      text: 'Howdy!',
      roomId: room.id,
      attachments:[ {
         contentType: 'application/vnd.microsoft.card.adaptive',
        content: {
          type: 'AdaptiveCard',
          version: '1.0',
          body: [
           {
            type: 'TextBlock',
            text: '',
            size: 'large'
            },
          {
            type: 'TextBlock',
            text: 'Adaptive Cards',
            separation: 'none'
          },
          {
          type: 'Input.Date',
          id: 'dueDate'
          }
      ],
    actions: [
        {
            type: 'Action.Submit',
            title: 'Due Date'
        }
    ]
  }
 }]
    });
  })
  .then(function(message) {
    return webex.attachmentActions.create({
     type: 'submit',
     messageId: message.id,
     inputs:{
       dueDate: '26/06/1995'
     });
  })
  .then(function(attachmentAction) {
    return webex.attachmentActions.get(attachmentAction.id)
  })
   .then(function(attachmentAction){
       var assert = require('assert');
       assert.deepEqual(attachmentAction, attachmentAction);
       return 'success';
     })
  // => success

getAll

Gets a list of all recent devices associated with the user the device list gets populated from Redis

getAll(): Promise<Device>
Returns
Promise<Device>:

refresh

Gets a list of all recent devices associated with the user the device list gets populated from Redis

refresh(): Promise<Device>
Returns
Promise<Device>:

Search for a device by name

search(options: Object): Promise<Device>
Parameters
options (Object)
Name Description
options.searchQuery string
Returns
Promise<Device>:

upsert

Caches the device info and also registers to Redis for subsequent fetches

upsert(device: Object): deviceInfo
Parameters
device (Object)
Name Description
device.id string
Returns
deviceInfo:

get

Retreives device info of a particular device

get(token: string): Promise<deviceInfo>
Parameters
token (string)
Returns
Promise<deviceInfo>:

remove

Unregisters the device from Redis, will not fetch in subsequent loads, similar to space.deleteBinding()

remove(deviceId: string): Promise<deviceInfo>
Parameters
deviceId (string)
Returns
Promise<deviceInfo>:

requestPin

Requests to display PIN on the device

requestPin(device: object, options: object): Promise<deviceInfo>
Parameters
device (object)
options (object = {})
Name Description
options.data object
Returns
Promise<deviceInfo>:

pair

pairs the device with the user (manual pairing), also adds it to user's recents list for subsequent fetches. similar to space.join()

pair(options: object): Promise<deviceInfo>
Parameters
options (object = {})
Name Description
options.pin number
Returns
Promise<deviceInfo>:

unpair

unpairs the device with the user (manual/ultrasonic pairing), but still keeps in the recents list/does not remove from Redis options.removeAllDevices will remove all associated devices to user similar to space.leave()

unpair(options: object): Promise<deviceInfo>
Parameters
options (object = {})
Name Description
options.removeAllDevices boolean
Returns
Promise<deviceInfo>:

bindSpace

binds the space to the paired device (if supported) similar to space.bindConversation()

bindSpace(options: object): Promise<deviceInfo>
Parameters
options (object = {})
Name Description
options.url boolean , conversation url
options.kmsResourceObjectUrl boolean of the convo
Returns
Promise<deviceInfo>:

unbindSpace

unbinds the space to the paired device (if supported) similar to space.unbindConversation()

unbindSpace(): Promise<deviceInfo>
Returns
Promise<deviceInfo>:

getAudioState

Gets the audio state of the paired device similar to device.getAudioState()

getAudioState(): Promise<audioState>
Returns
Promise<audioState>:

putAudioState

Updates audio state of the paired device, should be called every 10 minutes or when mic or volume state is changed similar to device.putAudioState()

putAudioState(space: object, audioState: object): Promise<audioState>
Parameters
space (object)
audioState (object = {})
Returns
Promise<audioState>:

mute

Mutes paired device similar to device.mute()

mute(): Promise<audioState>
Returns
Promise<audioState>:

unmute

Unmutes paired device similar to device.unmute()

unmute(): Promise<audioState>
Returns
Promise<audioState>:

increaseVolume

Increases paired device's volume similar to device.increaseVolume()

increaseVolume(): Promise<audioState>
Returns
Promise<audioState>:

decreaseVolume

Decreases paired device's volume similar to device.decreaseVolume()

decreaseVolume(): Promise<audioState>
Returns
Promise<audioState>:

setVolume

Sets paired device's volume but should use increase and decrease api instead similar to device.setVolume()

setVolume(level: number): Promise<audioState>
Parameters
level (number = 0)
Returns
Promise<audioState>:

_updateDeviceMetadata

Utility function to update decrypted device name on device object

_updateDeviceMetadata(deviceArray: Array): device
Parameters
deviceArray (Array = [])
Returns
device:

_decryptDeviceName

Utility function to update decrypted device name on device object

_decryptDeviceName(inDevice: object): device
Parameters
inDevice (object = {})
Returns
device:

_receiveDeviceUpdates

Utility function to update device info on mercury updates

_receiveDeviceUpdates(device: object): device
Parameters
device (object)
Returns
device:

Metrics

Metrics handles all the call metrics events

new Metrics()
Instance Members
initialSetup(meetingCollection, webexVersion)
postEvent(options)
initPayload(eventType, identifiers, options)

AUDIO


Hey there. Glad you found your way here. Please be sure to alphabetize your constants.


AUDIO

Type: string

MeetingInfo

new MeetingInfo()
Static Members
getMeetingInfo(id)
setMeetingInfo(id, info)
fetchMeetingInfo(destination, type = null)

MeetingInfoCollection

new MeetingInfoCollection()
Static Members
get(id)

MeetingInfoRequest

new MeetingInfoRequest()
Static Members
fetchMeetingInfo(options)

MeetingInfoRequest

new MeetingInfoRequest()
Static Members
fetchMeetingInfo(options)

Helper function to check if a string matches a known meeting link pattern

isMeetingLink(value: String): Boolean
Parameters
value (String) string to parse and see if it matches a meeting link
Returns
Boolean:

getResourceUrl

Helper function to build up a correct locus url depending on the value passed

getResourceUrl(type: String, value: Object): Object
Parameters
type (String) One of [SIP_URI, PERSONAL_ROOM, MEETING_ID, CONVERSATION_URL, LOCUS_ID, MEETING_LINK]
value (Object) ?? value.value
Returns
Object: returns an object with {resource, method}

AudioVideo

AudioVideo

AudioVideo

Type: Object

Properties
audio (Object)
video (Object)

JoinOptions

JoinOptions

JoinOptions

Type: Object

Properties
resourceId (String?)
hostPin (String?)
moderator (Boolean?)

SendOptions

SendOptions

SendOptions

Type: Object

Properties
sendAudio (Boolean)
sendVideo (Boolean)
sendShare (Boolean)

SendOptions

SendOptions

SendOptions

Type: Object

Meeting

Meeting is the crux of the plugin

new Meeting()
Static Members
invite(invitee, alertIfActive = true)
admit(memberIds)
remove(memberId)
mute(memberId, mute)
transfer(memberId, moderator)
getMembers()
getStats(options, override)
createStats(options)
stopStats()
isAudioMuted()
isAudioSelf()
isVideoMuted()
isVideoSelf()
setRemoteStream(pc)
unsetRemoteStream()
closeRemoteStream()
setShareStream(pc)
setLocalTracks(localStream)
setLocalShareTrack(localShare)
unsetLocalVideoTrack()
unsetLocalShareTrack()
setPeerConnections()
closePeerConnections()
unsetPeerConnections(peerConnection)
muteAudio()
unmuteAudio()
muteVideo()
unmuteVideo()
joinWithMedia(options)
reconnect()
moveTo(resourceId)
moveFrom(resourceId)
getMediaStreams
addMedia(options)
updateMedia(options)
updateAudio(options, stream?)
updateVideo(options, stream?)
updateShare(options, stream?)
acknowledge(type)
decline(reason)
leave(options)
stopShare()
startRecording()
stopRecording()
pauseRecording()
resumeRecording()
lockMeeting()
unlockMeeting()
Instance Members
id
userId
resource
deviceUrl
meetingInfo
members
audio
video
meetingFiniteStateMachine
stats
convoId
locusUrl
sipUri
partner
type
owner
hostId
policy
mediaProperties
inMeetingActions
isSharing
callEvents
Events
media:stopped
meeting:ringing
meeting:ringingStop
meeting:startedSharingLocal
meeting:stoppedSharingLocal
meeting:locked
meeting:unlocked
meeting:actionsUpdate
meeting:self:mutedByOthers
meeting:self:guestAdmitted
meeting:self:lobbyWaiting
meeting:reconnectionStarting
meeting:reconnectionSuccess
meeting:reconnectionFailure
media:stopped
media:stopped

MediaDirection

MediaDirection

MediaDirection

Type: Object

Properties
sendAudio (boolean)
receiveAudio (boolean)
sendVideo (boolean)
receiveVideo (boolean)
sendShare (boolean)
receiveShare (boolean)

MediaDirection

MediaDirection

MediaDirection

Type: Object

Properties
sendAudio (boolean)
receiveAudio (boolean)
sendVideo (boolean)
receiveVideo (boolean)
sendShare (boolean)
receiveShare (boolean)

meeting

The meeting instance to execute all state changes on

meeting

join

Specify joining via audio (option: pstn), video, screenshare

join(options: JoinOptions): Promise
Parameters
options (JoinOptions = {}) A configurable options object for joining a meeting
Returns
Promise: the join response

SeqOptions

SeqOptions

Type: Object

Properties
correlationId (String)
mediaId (String)
seq (Number)

RoapOptions

Roap options

RoapOptions

Type: Object

Properties
sdp (String)
meeting (Meeting)
roapSeq (Number)

RoapHandler

new RoapHandler()
Instance Members
perform(session, meeting, action)
execute(signal, session, action, meeting, prefix)
handleAction(session, action, meeting, correlationId)
submit(action)

createState

createState(roapRef: Roap): StateMachine
Parameters
roapRef (Roap) initializes the state machine
Returns
StateMachine: an instance of a state machine

to

Method to handle the transitions between states

to(signal: String, meeting: Meeting, roap: Object): String
Parameters
signal (String)
meeting (Meeting) instance of a Meeting
roap (Object)
Returns
String: new state value

to

to(remote: Object): String
Parameters
remote (Object)
Name Description
remote.remoteAnswered Boolean
remote.remoteDeclined Boolean
Returns
String:

to

to(audio: Object): String
Parameters
audio (Object) The audio options
Name Description
audio.mute Boolean Whether to mute the meeting or not
audio.self Boolean Whether the was muted by the end user
audio.remote Boolean Whether the meeting was muted by the server
Returns
String: returns a new value to set the state to

to

to(video: Object): String
Parameters
video (Object) current video data for the transition {mute, self}
Returns
String: a new state value for the transition

onAfterStep

Event that fires after we've transitioned to a new state

onAfterStep(transition: Object): null
Parameters
transition (Object)
Returns
null:

RoapRequest

new RoapRequest()
Instance Members
attachRechabilityData(localSdp, options)
sendRoap(options)

Media

Media
Static Members
setLocalTrack(enabled, track)
reconnectMedia(peerConnection, meetingId)
generateLocalMedias(mediaId, audioMuted, videoMuted)
getLocalMedia(options)
checkTracks(trackType, track, receiveTracks)
attachMedia(mediaProperties, meetingId)
updateMedia(mediaProperties, meetingId)
setTrackOnTransceiver(transceiver, options)
updateTransceiver(meetingId, peerConnection, transceiver, options)
getDisplayMedia(options)
getMedia(audio, video)
getSupportedDevice(options?)
getDevices()
toggleStream()
stopTracks(track)
stopStream(stream)
getUserMedia(mediaSetting, audioVideo)

MediaProperties

new MediaProperties()

create

Initializes the StateMachine for the meeting

create(meetingRef: Meeting): StateMachine
Parameters
meetingRef (Meeting) A reference to a meeting instance
Returns
StateMachine:

onRemote

Ring stop transition, to end the ring event for the meeting, and transition the state to ANSWERED OR DECLINED, only for outgoing meetings

onRemote(transition: Object, stop: Object): Boolean
Parameters
transition (Object) -- FiniteStateMachine automatically passed, not used
stop (Object) -- {remoteAnswered: {Boolean}, remoteDeclined: {Boolean}}
Returns
Boolean:

onRing

Ring transition, to cause the ring event for the meeting, and transition the state to RINGING, for both incoming, and outgoing meetings

onRing(transition: Object, type: String): Boolean
Parameters
transition (Object) -- FiniteStateMachine automatically passed, not used
type (String) -- incoming call === INCOMING / or other meetings have a ring type of JOIN
Returns
Boolean:

onBeforeError

handle the error transition stage

onBeforeError(transition: Object, error: Error): Boolean
Parameters
transition (Object)
error (Error)
Returns
Boolean:

onAfterTransition

After ANY transition occurs, we want to know what state the meeting moved to for debugging

onAfterTransition(transition: Object): Boolean
Parameters
transition (Object)
Returns
Boolean:

create

create(mediaDirection: Object, meeting: Meeting): StateMachine
Parameters
mediaDirection (Object) An object that contains whether we send audio/video/screen streams
meeting (Meeting) the meeting instance we are using for this state machine
Returns
StateMachine: returns a StateMachine instance

isMuted

Convenience method to return whether the call is muted or not

isMuted(): Boolen
Returns
Boolen: whether the audio is muted or not

isMuted

Convenience function to tell whether we are muted or not

isMuted(): Boolen
Returns
Boolen: boolean that indicates whether the video is currently muted

isSelf

Convenience method to expose this.self

isSelf(): Boolen
Returns
Boolen: this.self

isSelf

Convenience function to tell who last muted/unmuted the video

isSelf(): Boolen
Returns
Boolen: boolean that indicates whether the video was muted by the end user or server

setData

setData(audio: Object): null
Parameters
audio (Object) the audio state to change
Returns
null:

setData

setData(video: Object): null
Parameters
video (Object) current video options to set on the state machine
Name Description
video.mute Boolean indicates if video is muted or not for a meeting
video.self Boolean indicates whether the end user or server muted the video
Returns
null:

onBeforeToggle

Method that gets fired before the toggle state change. If this fails, return false will cancel the transition and the state will remain unchanged

onBeforeToggle(transition: Object, audio: Object): Object
Parameters
transition (Object) the StateMachine transition object
audio (Object) Audio options
Returns
Object: this.data which contains {muted, self}

onBeforeToggle

Method that gets fired before the toggle state change. If this fails, return false will cancel the transition and the state will remain unchanged

onBeforeToggle(transition: Object, video: Object): Object
Parameters
transition (Object) the StateMachine transition object
video (Object) video options
Returns
Object: this.data which contains {muted, self}

onAfterToggle

onAfterToggle(transition: Object, audio: Object): Object
Parameters
transition (Object) StateMachine transition
audio (Object) audio options
Returns
Object: this.data which contains {muted, self}

onAfterToggle

onAfterToggle(transition: Object, video: Object): Object
Parameters
transition (Object) StateMachine transition
video (Object) video options
Returns
Object: this.data which contains {muted, self}

create

create(mediaDirection: Object, meeting: Meeting): Statemachine
Parameters
mediaDirection (Object) object containing media direction
Name Description
mediaDirection.sendVideo Boolean Whether or not to send video in the meeting
meeting (Meeting) an instance of a Meeting
Returns
Statemachine: returns a state machine instance

updateHostInfo

handles when the locus.host is updated

updateHostInfo(host: Object): undefined
Parameters
host (Object) the locus.host property
Returns
undefined:

updateMediaShares

handles when the locus.mediaShares is updated

updateMediaShares(mediaShares: Object): undefined
Parameters
mediaShares (Object) the locus.mediaShares property
Returns
undefined:

updateSelf

handles when the locus.self is updated

updateSelf(self: Object, participants: Array): undefined
Parameters
self (Object) the locus.mediaShares property
participants (Array) the locus.participants property
Returns
undefined:

EventsScope

Events plugin-meetings local Used to emit events internally between modules specific to an object

new EventsScope()

Extends ChildEmitter

parse

parses the relevant values for self: muted, guest, moderator, mediaStatus, state, joinedWith, creator, id

parse(self: Object, deviceId: String): undefined
Parameters
self (Object)
deviceId (String)
Returns
undefined:

getSelfIdentity

get the id from the self object

getSelfIdentity(self: Object): String
Parameters
self (Object)
Returns
String:

getMuted

get the muted property from the self object

getMuted(self: Object): Boolean
Parameters
self (Object)
Returns
Boolean:

isLocusGuestUnadmitted

isLocusGuestUnadmitted(check: Object): Boolean
Parameters
check (Object)
Returns
Boolean:

isLocusGuestAdmitted

isLocusGuestAdmitted(check: Object): Boolean
Parameters
check (Object)
Returns
Boolean:

isUnadmittedGuest

isUnadmittedGuest(self: Object): Boolean
Parameters
self (Object)
Returns
Boolean:
Throws
  • Error: when self is undefined

isAdmittedGuest

isAdmittedGuest(oldSelf: Object, changedSelf: Object): Boolean
Parameters
oldSelf (Object)
changedSelf (Object)
Returns
Boolean:
Throws
  • Error: if changed self was undefined

getSipUrl

extract the sipUrl from the partner

getSipUrl(partner: Object, type: any, sipUri: any, info: Object): Object
Parameters
partner (Object)
type (any)
sipUri (any)
info (Object)
Returns
Object:

parse

parse the relevant host values that we care about: id

parse(host: Object): Object
Parameters
host (Object)
Returns
Object: parsed host or null if host was undefined

getHosts

get the previous and current host values parsed, as well as the boolean updates

getHosts(oldHost: Object, newHost: Object): Object
Parameters
oldHost (Object)
newHost (Object)
Returns
Object: previous: {Object} old host, current: {Object} new host, updates: {isNewHost: {boolean}} boolean update values

isDifferentHosts

determine by id if 2 hosts are different

isDifferentHosts(previousId: String, currentId: String): Boolean
Parameters
previousId (String)
currentId (String)
Returns
Boolean:

getId

Extract the id from the host object

getId(host: Object): String
Parameters
host (Object)
Returns
String:

parse

parses the relevant values for mediaShares: contentId, disposition

parse(mediaShares: Object): undefined
Parameters
mediaShares (Object)
Returns
undefined:

getMediaShares

get the previous and current mediaShares values parsed, as well as the boolean updates

getMediaShares(oldShare: Object, newShare: Object): Object
Parameters
oldShare (Object)
newShare (Object)
Returns
Object: previous: {Object} old share, current: {Object} new share,

getDisposition

get the floor disposition (released, granted)

getDisposition(mediaShares: Object): Boolean
Parameters
mediaShares (Object)
Returns
Boolean: disposition

extractContent

extract the content property from media shares

extractContent(mediaShares: Object): Object
Parameters
mediaShares (Object)
Returns
Object:

extractFloor

extract the floor property from content object

extractFloor(content: Object): Object
Parameters
content (Object)
Returns
Object:

extractContentFloor

extract the content's floor from media shares

extractContentFloor(mediaShares: Object): Object
Parameters
mediaShares (Object)
Returns
Object:

getContentId

get who is sharing from media shares

getContentId(mediaShares: Object): Object
Parameters
mediaShares (Object)
Returns
Object:

ReconnectionManager

new ReconnectionManager()
Static Members
configure(meeting)
reset()
reconnect(meeting)

MeetingRequest

new MeetingRequest()
Instance Members
joinMeeting(options)
syncMeeting(options)
getFullLocus(options)
leaveMeeting(options)
acknowledgeMeeting(options)
recordMeeting(options)
declineMeeting(options)
remoteAudioVideoToggle(options)
changeMeetingFloor(options)
getActiveMeetings()
determineRedirections(responseBody)

MeetingRequest

new MeetingRequest()
Instance Members
joinMeeting(options)
syncMeeting(options)
getFullLocus(options)
leaveMeeting(options)
acknowledgeMeeting(options)
recordMeeting(options)
declineMeeting(options)
remoteAudioVideoToggle(options)
changeMeetingFloor(options)
getActiveMeetings()
determineRedirections(responseBody)

Members

new Members()
Static Members
setLocusUrl(locus, locusUrl = null)
setHostId(locus, hostId = null)
setType(fullState, type = null)
setSelfId(locus, selfId = null)
setMediaShareContentId(locus, contentId?)
addMember(invitee, alertIfActive?)
admitMembers(memberIds)
removeMember(memberId)
muteMember(memberId, mute = true)
transferHostToMember(memberId, moderator = true)
Events
members:update
members:content:update
members:host:update
members:self:update

Member

new Member()
Static Members
setIsContentSharing(flag)
setIsHost(flag)
setIsSelf(flag)
processIsContentSharing(participant, sharingId)
Instance Members
id
name
email
isAudioMuted
isVideoMuted
isSelf
isHost
isGuest
isInLobby
isInMeeting
isNotAdmitted
isContentSharing
status
isDevice
isUser
associatedUser
isRecording
isMutable
isRemovable
isModerator
isModeratorAssignmentProhibited

isUser

isUser(participant: Object): Boolean
Parameters
participant (Object) the locus participant
Returns
Boolean:

isGuest

isGuest(participant: Object): Boolean
Parameters
participant (Object) the locus participant
Returns
Boolean:

isDevice

isDevice(participant: Object): Boolean
Parameters
participant (Object) the locus participant
Returns
Boolean:

isSame

checks to see if the participant id is the same as the passed id there are multiple ids that can be used

isSame(participant: Object, id: String): Boolean
Parameters
participant (Object) the locus participant
id (String)
Returns
Boolean:

isAssociatedSame

checks to see if the participant id is the same as the passed id for associated devices there are multiple ids that can be used

isAssociatedSame(participant: Object, id: String): Boolean
Parameters
participant (Object) the locus participant
id (String)
Returns
Boolean:

isNotAdmitted

isNotAdmitted(participant: Object, isGuest: Boolean, status: String): Boolean
Parameters
participant (Object) the locus participant
isGuest (Boolean)
status (String)
Returns
Boolean:

isAudioMuted

isAudioMuted(participant: Object): Boolean
Parameters
participant (Object) the locus participant
Returns
Boolean:

isVideoMuted

isVideoMuted(participant: Object): Boolean
Parameters
participant (Object) the locus participant
Returns
Boolean:

isMuted

utility method for audio/video muted status

isMuted(status: String, accessor: String): Boolean
Parameters
status (String)
accessor (String)
Returns
Boolean:

isRecording

isRecording(participant: Object): Boolean
Parameters
participant (Object) the locus participant
Returns
Boolean:

extractStatus

extractStatus(participant: Object): String
Parameters
participant (Object) the locus participant
Returns
String:

extractId

extractId(participant: Object): String
Parameters
participant (Object) the locus participant
Returns
String:

extractName

extractName(participant: Object): String
Parameters
participant (Object) the locus participant
Returns
String:

MembersCollection

new MembersCollection()
Static Members
getAll()
Instance Members
get(id)

MembersRequest

new MembersRequest()
Static Members
addMembers(options)
admitMember(options)

generateAddMemberOptions

generateAddMemberOptions(invitee: Object, locusUrl: String, alertIfActive: Boolean): Object
Parameters
invitee (Object) with emailAddress or email
locusUrl (String)
alertIfActive (Boolean)
Returns
Object: the format object

generateAdmitMemberOptions

generateAdmitMemberOptions(memberIds: Array, locusUrl: String): Object
Parameters
memberIds (Array)
locusUrl (String)
Returns
Object: the format object

getAddMemberBody

getAddMemberBody(options: Object): Object
Parameters
options (Object) with {invitee: {emailAddress, email}, alertIfActive}
Returns
Object: with {invitees: [{address}] , alertIfActive}

getAdmitMemberRequestBody

getAdmitMemberRequestBody(options: Object): Object
Parameters
options (Object) with {memberIds}
Returns
Object: admit with {memberIds}

getAdmitMemberRequestParams

getAdmitMemberRequestParams(format: Object): Object
Parameters
format (Object) with {memberIds, locusUrl}
Returns
Object: the request parameters (method, uri, body) needed to make a admitMember request

getAddMemberRequestParams

getAddMemberRequestParams(format: Object): Object
Parameters
format (Object) with {invitee {emailAddress, email}, locusUrl, alertIfActive}
Returns
Object: the request parameters (method, uri, body) needed to make a addMember request

IntentToJoinError

Extended Error object to signify the intent to join for unclaimed PMR scenarios

new IntentToJoinError(message: String?, error: Object?)

Extends Error

Parameters
message (String? = ERROR_DICTIONARY.INTENT_TO_JOIN.MESSAGE)
error (Object? = null)

JoinMeetingError

Extended Error object to signify a join meeting error

new JoinMeetingError(options: Object?, message: String?, error: Object?)

Extends Error

Parameters
options (Object? = {})
message (String? = ERROR_DICTIONARY.JOIN_MEETING.MESSAGE)
error (Object? = null)

PermissionError

Extended Error object for general parameter errors

new PermissionError(message: String?, error: Object?)

Extends Error

Parameters
message (String? = ERROR_DICTIONARY.PERMISSION.MESSAGE)
error (Object? = null)

WebRTCStats

new WebRTCStats()
Static Members
setConfig(config)
associateMeeting(meeting)
addSenders(senders, useConfig)
addSender(sender, useConfig)
addSenderStats(id)
addReceiverStats(id)
addReceivers(receivers, useConfig)
addReceiver(receiver, useConfig)
getReceivers()
getSenders()
getSender(id)
getReceiver(id)
destroySenders()
destroyReceivers()
destroySender(id)
destroyReceiver(id)
Instance Members
senders
receivers
statsConfig

MeetingStats

new MeetingStats()
Static Members
doHistory(data)
doEvents(data)
withEventsHistory(history, cb)
withEvents(cb)
withHistory()
withStream(transceiverDirection, peerConnection)
withFilter(transceiverDirection, peerConnection)
withId(id)
build()
setId(id)
setHistory(history)
setEvents(events)
setStream(stream)
setFilter(filter)
getId()
getHistory()
getEvents()
getStream()
getFilter()

StatsHistory

stores the last x filtered stream datas

new StatsHistory(max: any)
Parameters
max (any)
Static Members
get()
clear()
getAt(index)
getMostRecent()
Instance Members
history
max
getComparable()
getSlice(exclusiveEnd)
add(data)

StatsHistory

new StatsHistory()
Static Members
get()
clear()
getAt(index)
getMostRecent()
Instance Members
history
max
getComparable()
getSlice(exclusiveEnd)
add(data)

WebRTCData

new WebRTCData()
Instance Members
getId()
getData()

StatsEvents

new StatsEvents()
Instance Members
start(data)
stop()
event(data)

StatsError

Extended Error object for Stats Errors

new StatsError(message: String?, error: Object?)

Extends Error

Parameters
message (String? = ERROR_DICTIONARY.STATS.MESSAGE)
error (Object? = null)

ReconnectionError

Extended Error object to signify the intent to join for unclaimed PMR scenarios

new ReconnectionError(message: String?, error: Object?)

Extends Error

Parameters
message (String? = ERROR_DICTIONARY.RECONNECTION.MESSAGE)
error (Object? = null)

MediaError

Extended Error object for media errors

new MediaError(message: String?, error: Object?)

Extends Error

Parameters
message (String? = ERROR_DICTIONARY.MEDIA.MESSAGE)
error (Object? = null)

InMeetingActions

new InMeetingActions()

PersonalMeetingRoom

new PersonalMeetingRoom()
Static Members
claim(link, pin, preferred = true)
get(options)
Instance Members
pmr
sipUri
userId
name

claimPmr

claimPmr(options: Object): Promise
Parameters
options (Object) with format of {userId, passcode, meetingAddress, preferred}
Returns
Promise: returns a promise that resolves/rejects the result of the request

Reachability

new Reachability()
Static Members
gatherReachability

pc

pc
Static Members
iceFailListener(peerConnection, fn, name)
detectFailures(peerConnection, reconnectFn = ()=>{LoggerProxy.logger.error('PeerConnectionManager->reconnectFn#Ice failed, no function to reconnect with.');})
setContentSlides(screenPc, screenPC)
iceCandidate(peerConnection)
replaceTrack(peerConnection, track)
addStream(peerConnection, stream)
setRemoteSessionDetails(peerConnection, typeStr, remoteSdp, meetingId)
createOffer(peerConnection, meetingId, params)
rollBackLocalDescription(peerConnection)
updatePeerConnection(params, meetingId)
createAnswer(params, meetingId)
close(peerConnection)

insertBandwidthLimit

munges the bandwidth limit into the sdp

insertBandwidthLimit
Parameters
sdpLines (String)
index (Number)
Returns
String:

setMaxFs

needed for calliope max-fs

setMaxFs
Parameters
sdp (String)
Returns
String:

checkH264Support

checks that sdp has h264 codec in it

checkH264Support
Parameters
sdp (String)
Returns
boolean:

validateSdp

validates the sdp, checks port, candidates, and ice info

validateSdp
Parameters
sdp (String)
Returns
Boolean:

limitBandwidth

munges the bandwidth into the sdp

limitBandwidth
Parameters
sdp (String)
Returns
String:

RechabilityRequest

new RechabilityRequest()
Instance Members
getClusters
remoteSDPForClusters

analyze

Can involve changing of the default plugin-meetings sdk for deeper results

analyze(series: Array, options: Object): Object
Parameters
series (Array) of WebRTCData
options (Object = {analysisKeys:ANALYSIS_STATS.DEFAULT_KEYS})
Name Description
options.analysisKeys Array [{key: 'bytesSent', check: 'increasing'}, {key: 'bytesReceived', check: 'increasing'}]
Returns
Object: analysis {valid: true/false, failed: { key: [number] }, data: { webRtcKeyToAnalyze: { valid: true/false, reports: [ { value: number, valid: true/false, difference: number } ] } } }

ParameterError

Extended Error object for general parameter errors

new ParameterError(message: String?, error: Object?)

Extends Error

Parameters
message (String? = ERROR_DICTIONARY.PARAMETER.MESSAGE)
error (Object? = null)

difference

Calculate an interval of values between 2 data points, using updated as the "latest" so updated - previous = interval

difference(previous: WebRTCData, updated: WebRTCData): Object
Parameters
previous (WebRTCData)
updated (WebRTCData)
Returns
Object: interval: {StringKey: IntervalValue, ..., n}

sum

Calculate an aggregate of values between an old summary and a new data point, using summary as the base to add to so aggregate = summary + data

sum(data: WebRTCData, summary: Object): Object
Parameters
data (WebRTCData)
summary (Object)
Returns
Object: aggregate {StringKey: SummedValue, ..., n}

MeetingCollection

new MeetingCollection()
Static Members
getByKey(key, value)

Collection

new Collection()
Static Members
get(id)
set(id, value)
delete(id)
getAll()
setAll(set)

_triggerCallEvents

Triggers call events for a given call/locus

_triggerCallEvents(call: Call, locus: Types~Locus): undefined
Parameters
call (Call)
locus (Types~Locus)
Returns
undefined:

has

Indicates if this collection already contains the specified locus

has(locus: Types~Locus): boolean
Parameters
locus (Types~Locus)
Returns
boolean:

startApplicationShare

Shares a particular application as a second stream in the call

startApplicationShare(): Promise
Returns
Promise:

startScreenShare

Shares the whole screen as a second stream in the call

startScreenShare(): Promise
Returns
Promise:

stopScreenShare

Stops sharing an application or whole screen media stream

stopScreenShare(): Promise
Returns
Promise:

findShare

Searches the call's current locus for the screen share entry in media shares

findShare(): undefined
Returns
undefined:

getThisDevice

Finds the self entry for the specified locus

getThisDevice(webex: ProxyWebex, locus: Types~Locus): Object
Parameters
webex (ProxyWebex)
locus (Types~Locus)
Returns
Object:

buildRoomInfo

Helper method to build a roomInfo object from a conversation object

buildRoomInfo(conversation: Conversation~ConversationObject): Promise<RoomInfoObject>
Parameters
conversation (Conversation~ConversationObject)
Returns
Promise<RoomInfoObject>:

buildRoomInfoList

Helper method to build a list of roomInfo object from conversation list

buildRoomInfoList(conversations: Conversation~ConversationObjectList): Promise<RoomInfoList>
Parameters
conversations (Conversation~ConversationObjectList)
Returns
Promise<RoomInfoList>: