Skip to content

Commit

Permalink
feat: added support for "early-call-min-clusters" option in Orpheus API
Browse files Browse the repository at this point in the history
  • Loading branch information
marcin-bazyl committed Nov 29, 2024
1 parent 7e0ed3c commit a8072cd
Show file tree
Hide file tree
Showing 18 changed files with 975 additions and 479 deletions.
2 changes: 0 additions & 2 deletions packages/@webex/plugin-meetings/src/meeting/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4771,8 +4771,6 @@ export default class Meeting extends StatelessWebexPlugin {
if (!joinResponse) {
// This is the 1st attempt or a retry after join request failed -> we need to do a join with TURN discovery

// @ts-ignore
joinOptions.reachability = await this.webex.meetings.reachability.getReachabilityResults();
const turnDiscoveryRequest = await this.roap.generateTurnDiscoveryRequestMessage(
this,
true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ export type RoapRequest = {
mediaId: string;
roapMessage: any;
reachability: any;
clientMediaPreferences: any;
sequence?: any;
joinCookie: any; // any, because this is opaque to the client, we pass whatever object we got from one backend component (Orpheus) to the other (Locus)
ipVersion?: IP_VERSION;
};

export type LocalMuteRequest = {
Expand Down Expand Up @@ -202,10 +201,6 @@ export class LocusMediaRequest extends WebexPlugin {
const body: any = {
device: this.config.device,
correlationId: this.config.correlationId,
clientMediaPreferences: {
preferTranscoding: this.config.preferTranscoding,
ipver: request.type === 'RoapMessage' ? request.ipVersion : undefined,
},
};

const localMedias: any = {
Expand All @@ -223,7 +218,7 @@ export class LocusMediaRequest extends WebexPlugin {
case 'RoapMessage':
localMedias.roapMessage = request.roapMessage;
localMedias.reachability = request.reachability;
body.clientMediaPreferences.joinCookie = request.joinCookie;
body.clientMediaPreferences = request.clientMediaPreferences;

// @ts-ignore
this.webex.internal.newMetrics.submitClientEvent({
Expand Down
13 changes: 3 additions & 10 deletions packages/@webex/plugin-meetings/src/meeting/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ export default class MeetingRequest extends StatelessWebexPlugin {
locale?: string;
deviceCapabilities?: Array<string>;
liveAnnotationSupported: boolean;
ipVersion?: IP_VERSION;
alias?: string;
clientMediaPreferences: any;
}) {
const {
asResourceOccupant,
Expand All @@ -147,21 +147,18 @@ export default class MeetingRequest extends StatelessWebexPlugin {
moveToResource,
roapMessage,
reachability,
preferTranscoding,
breakoutsSupported,
locale,
deviceCapabilities = [],
liveAnnotationSupported,
ipVersion,
clientMediaPreferences,
alias,
} = options;

LoggerProxy.logger.info('Meeting:request#joinMeeting --> Joining a meeting', correlationId);

let url = '';

const joinCookie = await this.getJoinCookie();

const body: any = {
asResourceOccupant,
device: {
Expand All @@ -176,11 +173,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
allowMultiDevice: true,
ensureConversation: ensureConversation || false,
supportsNativeLobby: 1,
clientMediaPreferences: {
preferTranscoding: preferTranscoding ?? true,
joinCookie,
ipver: ipVersion,
},
clientMediaPreferences,
};

if (alias) {
Expand Down
13 changes: 9 additions & 4 deletions packages/@webex/plugin-meetings/src/meeting/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const MeetingUtil = {
return IP_VERSION.unknown;
},

joinMeeting: (meeting, options) => {
joinMeeting: async (meeting, options) => {
if (!meeting) {
return Promise.reject(new ParameterError('You need a meeting object.'));
}
Expand All @@ -127,6 +127,12 @@ const MeetingUtil = {
options: {meetingId: meeting.id},
});

const reachability = await webex.meetings.reachability.getReachabilityReportToAttachToRoap();
const clientMediaPreferences = await webex.meetings.reachability.getClientMediaPreferences(
meeting.isMultistream,
MeetingUtil.getIpVersion(webex)
);

// eslint-disable-next-line no-warning-comments
// TODO: check if the meeting is in JOINING state
// if Joining state termintate the request as user might click multiple times
Expand All @@ -138,20 +144,19 @@ const MeetingUtil = {
locusUrl: meeting.locusUrl,
locusClusterUrl: meeting.meetingInfo?.locusClusterUrl,
correlationId: meeting.correlationId,
reachability: options.reachability,
reachability,
roapMessage: options.roapMessage,
permissionToken: meeting.permissionToken,
resourceId: options.resourceId || null,
moderator: options.moderator,
pin: options.pin,
moveToResource: options.moveToResource,
preferTranscoding: !meeting.isMultistream,
asResourceOccupant: options.asResourceOccupant,
breakoutsSupported: options.breakoutsSupported,
locale: options.locale,
deviceCapabilities: options.deviceCapabilities,
liveAnnotationSupported: options.liveAnnotationSupported,
ipVersion: MeetingUtil.getIpVersion(meeting.getWebexObject()),
clientMediaPreferences,
})
.then((res) => {
const parsed = MeetingUtil.parseLocusJoin(res);
Expand Down
Loading

0 comments on commit a8072cd

Please sign in to comment.