Skip to content

Introduction to Webex Meetings

Kesava Krishnan Madavan edited this page Aug 16, 2023 · 12 revisions

Table of Contents

Introduction

This document helps in understanding the Webex Meetings instance in the Web SDK. It explains multiple APIs related to meeting creation and fetching and related events.

The Meetings instance

The meetings instance is part of the Webex Meetings SDK that contains a list of meetings created using the SDK and APIs to perform specific operations or listen to certain events. A detailed explanation and code examples of how to use each of them are mentioned further down this document.

How to fetch the Meetings Instance?

After importing and initializing the Web SDK, the meetings instance will be accessible in the webex object as mentioned below,

const webex = new Webex.init();
const meetings = webex.meetings;

This meetings constant will hold the Webex Meetings instance

APIs

Device registration for a Meeting

Once we have the meetings instance, it can be used to register a device as follows,

const webex = new Webex.init();
await webex.meetings.register();
Asynchronous Yes
Parameters No parameters required
Returns Promise<undefined>

Create a Meeting

Once the registration is done, we can use the meetings instance to create a meeting as follows,

const meeting = await webex.meetings.create(destination,type);
Asynchronous Yes
Parameters
Sl. No Parameter Name Parameter Type Mandatory Description
1 destination String Yes This is the meeting destination to which a meeting object has to be created. The destination can be a URL or an email address too. The types of possible meeting destinations are listed in the below parameter
2 type String No

The types can be one of below,

  • MEETING_LINK
  • SIP_URI
  • CONVERSATION_URL
  • PERSONAL_ROOM
  • MEETING_LINK
Returns Promise<Meeting>

The meeting object returned by this create method can be used to perform actions on a meeting like mute/unmute, switch audio, lock meeting and so on.

Get the list of all Meetings

The SDK can have more than one meeting created at the same time and the list of all the current meetings can be obtained as follows,

const meetingList = webex.meetings.getAllMeetings();
Asynchronous No
Parameters

No parameters required

Returns Map<MeetingId,Meeting>

An example of what would be set to the meetingList constant is:

{
	"3c9628aa-b51d-45c4-9166-1b9f7dafe95e" : { id: "3c9628aa-b51d-45c4-9166-1b9f7dafe95e", ...otherMeetingObjectAttributes },
	"c7d69b95-c9c6-40c1-9138-c6005b8be554": { id: "c7d69b95-c9c6-40c1-9138-c6005b8be554", ...otherMeetingObjectAttributesAndMethods },
}

Syncing the Meetings from Webex Cloud

If the registered user of the SDK already has a meeting scheduled and is running, this API can be used to fetch such meeting objects

await webex.meetings.syncMeetings();
Asynchronous Yes
Parameters

No parameters required

Returns Promise<undefined>

Once this call succeeds, we shall be able to get the synced meetings with getAllMeetings method as mentioned below,

await webex.meetings.syncMeetings();
const meetingList = webex.meetings.getAllMeetings();

Fetching Meetings by Attribute

This API will be helpful if you want to fetch a meeting by any other attribute of the meeting object.

For instance, if you need to fetch a meeting by destination whose value is https://cisco.webex.com/meet/kmadavan :

const meeting = webex.meetings.getMeetingByType("destination","https://cisco.webex.com/meet/kmadavan");
Asynchronous No
Parameters
Name Description Type Mandatory
attrib What attribute of meeting you want to fetch data for. Eg. - correlationId, destination, meetingLink String Yes
value

What value should the method match with from list of meeting object for the said attrib

String Yes
Returns Object<Meeting>

Fetching PMR Information

PMR a.k.a Personal Meeting Room. This is a meeting with a static URL associated with each user's Webex account. This API will help fetch the current user's PMR information using which one can create and join the same.

const pmr = await webex.meetings.getPersonalMeetingRoom().get();
Asynchronous Yes
Parameters No parameters required
Returns Object

Events

Meetings Object is Ready

This event is fired when a meetings instance is ready. (i.e) The meetings instance will be ready once Webex is ready and the event is fired once all the Meetings instance parameters are set. This can be subscribed to after immediately Webex.init as follows,

webex.meetings.on('meetings:ready',() => {
	console.log('Meetings object is ready for device registration');
	// Perform device registration operation
});

This event listener won't receive any payload. Any API call via the Meetings instance should be made only upon receiving this event.

Meetings is registered

This event is fired when a meetings instance is registered after firing the webex.meetings.register() method. It can be listened to as follows,

webex.meetings.on('meetings:registered',() => {
	console.log('Meetings object is ready to perform other operations');
	// Perform operations on meetings object like create, sync etc.,
});

A meeting is added

This event is fired when a meeting is added to the Meetings instance and can be subscribed to as mentioned below,

webex.meetings.on('meeting:added',({type,meeting}) => {
	//Perform operations needed to be done on the specific meeting
});

This event receives an object with two attributes in the payload as stated:

Sl. No Attribute Name Value
1 type

One of the following,

Sl. No Type Description
1

CREATED

The meeting was created from within the SDK
2

INCOMING


3 JOIN The meeting was created using Sync Meetings API
2 meeting The Meeting object which can perform several operations on a meeting

A meeting is removed

This event is fired when a meeting is removed from the Meetings instance and it can be listened to like:

webex.meetings.on('meeting:removed',({meetingId,reason}) => {
	//Perform operations to cleanup the UI that is related to a Meeting
});

This event receives an object with two of the following attributes as payload:

Sl. No Attribute Name Value
1 meetingId

The Correlation ID of a meeting

2 reason

The meeting could have been removed due to one of the following reasons,

Sl. No Reason Description
1 SELF_REMOVED If the server or host removed the participant from a meeting
2 FULLSTATE_REMOVED Removed when meeting is ended by the host (Verify once)
3 MEETING_INACTIVE_TERMINATING Meeting got ended or everyone left the meeting
4 CLIENT_LEAVE_REQUEST The participant triggered a leave meeting request
5 CLIENT_LEAVE_REQUEST_TAB_CLOSED The participant triggered a leave meeting request by closing the browser tab
6 NO_MEETINGS_TO_SYNC A meeting is locally created somehow but doesn't exist in the cloud server upon trying to sync meetings. At that time, the locally created meeting will be removed for this reason.
7 MEETING_CONNECTION_FAILED Meeting failed to connect due to ICE candidate failures or firewall issues
8 USER_ENDED_SHARE_STREAMS The participant stopped sharing their streams (Verify if this triggers a meeting:removed event)

Network is disconnected

This event is fired when the meetings instance is disconnected from the Webex cloud server or when the browser network is disconnected and it can be subscribed as follows:

webex.meetings.on('network:disconnected',() => {
	//Perform operations to cleanup the UI that is related to a Meeting Leave
});

Network is connected

This event is fired when the meetings instance is connected when the network is already disconnected and it can be subscribed as follows:

webex.meetings.on('network:connected',() => {
	//Perform operations to reconnect Meeting
});
Clone this wiki locally