@webex/plugin-meetings 3.8.0-next.35 → 3.8.0-next.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/meeting/index.js +1 -1
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/util.js +2 -2
- package/dist/meeting/util.js.map +1 -1
- package/dist/roap/turnDiscovery.js +15 -5
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/types/meeting/util.d.ts +1 -1
- package/dist/types/roap/turnDiscovery.d.ts +4 -0
- package/dist/webinar/index.js +1 -1
- package/package.json +3 -3
- package/src/meeting/index.ts +4 -1
- package/src/meeting/util.ts +3 -1
- package/src/roap/turnDiscovery.ts +14 -5
- package/test/unit/spec/meeting/index.js +6 -1
- package/test/unit/spec/meeting/utils.js +59 -33
- package/test/unit/spec/roap/turnDiscovery.ts +38 -0
package/src/meeting/util.ts
CHANGED
@@ -575,7 +575,9 @@ const MeetingUtil = {
|
|
575
575
|
|
576
576
|
canUserRenameOthers: (displayHints) => displayHints.includes(DISPLAY_HINTS.CAN_RENAME_OTHERS),
|
577
577
|
|
578
|
-
canShareWhiteBoard: (displayHints) =>
|
578
|
+
canShareWhiteBoard: (displayHints, policies) =>
|
579
|
+
displayHints.includes(DISPLAY_HINTS.SHARE_WHITEBOARD) &&
|
580
|
+
!!policies[SELF_POLICY.SUPPORT_WHITEBOARD],
|
579
581
|
|
580
582
|
/**
|
581
583
|
* Adds the current locus sequence information to a request body
|
@@ -31,6 +31,17 @@ export default class TurnDiscovery {
|
|
31
31
|
|
32
32
|
private responseTimer?: ReturnType<typeof setTimeout>;
|
33
33
|
|
34
|
+
/** Resets the turnInfo structure to the defaults
|
35
|
+
* @returns {void}
|
36
|
+
*/
|
37
|
+
private resetTurnInfo() {
|
38
|
+
this.turnInfo = {
|
39
|
+
urls: [],
|
40
|
+
username: '',
|
41
|
+
password: '',
|
42
|
+
};
|
43
|
+
}
|
44
|
+
|
34
45
|
/**
|
35
46
|
* Constructor
|
36
47
|
*
|
@@ -38,11 +49,7 @@ export default class TurnDiscovery {
|
|
38
49
|
*/
|
39
50
|
constructor(roapRequest: RoapRequest) {
|
40
51
|
this.roapRequest = roapRequest;
|
41
|
-
this.
|
42
|
-
urls: [],
|
43
|
-
username: '',
|
44
|
-
password: '',
|
45
|
-
};
|
52
|
+
this.resetTurnInfo();
|
46
53
|
}
|
47
54
|
|
48
55
|
/**
|
@@ -119,6 +126,8 @@ export default class TurnDiscovery {
|
|
119
126
|
|
120
127
|
const foundHeaders = {};
|
121
128
|
|
129
|
+
this.resetTurnInfo();
|
130
|
+
|
122
131
|
headers?.forEach((receivedHeader) => {
|
123
132
|
// check if it matches any of our expected headers
|
124
133
|
expectedHeaders.forEach((expectedHeader) => {
|
@@ -10841,6 +10841,11 @@ describe('plugin-meetings', () => {
|
|
10841
10841
|
requiredDisplayHints: [],
|
10842
10842
|
requiredPolicies: [SELF_POLICY.SUPPORT_POLLING_AND_QA],
|
10843
10843
|
},
|
10844
|
+
{
|
10845
|
+
actionName: 'canShareWhiteBoard',
|
10846
|
+
requiredDisplayHints: [DISPLAY_HINTS.SHARE_WHITEBOARD],
|
10847
|
+
requiredPolicies: [SELF_POLICY.SUPPORT_WHITEBOARD],
|
10848
|
+
},
|
10844
10849
|
],
|
10845
10850
|
({
|
10846
10851
|
actionName,
|
@@ -11249,7 +11254,7 @@ describe('plugin-meetings', () => {
|
|
11249
11254
|
assert.calledWith(canSendReactionsSpy, null, userDisplayHints);
|
11250
11255
|
assert.calledWith(canUserRenameSelfAndObservedSpy, userDisplayHints);
|
11251
11256
|
assert.calledWith(canUserRenameOthersSpy, userDisplayHints);
|
11252
|
-
assert.calledWith(canShareWhiteBoardSpy, userDisplayHints);
|
11257
|
+
assert.calledWith(canShareWhiteBoardSpy, userDisplayHints, selfUserPolicies);
|
11253
11258
|
|
11254
11259
|
assert.calledWith(ControlsOptionsUtil.hasHints, {
|
11255
11260
|
requiredHints: [DISPLAY_HINTS.MUTE_ALL],
|
@@ -66,7 +66,7 @@ describe('plugin-meetings', () => {
|
|
66
66
|
|
67
67
|
describe('#cleanup', () => {
|
68
68
|
it('do clean up on meeting object with LLM enabled', async () => {
|
69
|
-
meeting.config = {enableAutomaticLLM
|
69
|
+
meeting.config = {enableAutomaticLLM: true};
|
70
70
|
await MeetingUtil.cleanUp(meeting);
|
71
71
|
assert.calledOnce(meeting.cleanupLocalStreams);
|
72
72
|
assert.calledOnce(meeting.closeRemoteStreams);
|
@@ -84,7 +84,7 @@ describe('plugin-meetings', () => {
|
|
84
84
|
});
|
85
85
|
|
86
86
|
it('do clean up on meeting object with LLM disabled', async () => {
|
87
|
-
meeting.config = {enableAutomaticLLM
|
87
|
+
meeting.config = {enableAutomaticLLM: false};
|
88
88
|
await MeetingUtil.cleanUp(meeting);
|
89
89
|
assert.calledOnce(meeting.cleanupLocalStreams);
|
90
90
|
assert.calledOnce(meeting.closeRemoteStreams);
|
@@ -392,8 +392,7 @@ describe('plugin-meetings', () => {
|
|
392
392
|
meetingJoinUrl: 'meetingJoinUrl',
|
393
393
|
locusUrl: 'locusUrl',
|
394
394
|
meetingRequest: {
|
395
|
-
joinMeeting: sinon.stub().returns(
|
396
|
-
Promise.resolve(joinMeetingResponse)),
|
395
|
+
joinMeeting: sinon.stub().returns(Promise.resolve(joinMeetingResponse)),
|
397
396
|
},
|
398
397
|
getWebexObject: sinon.stub().returns(webex),
|
399
398
|
setLocus: sinon.stub(),
|
@@ -410,23 +409,29 @@ describe('plugin-meetings', () => {
|
|
410
409
|
id: 'fake client media preferences',
|
411
410
|
};
|
412
411
|
|
413
|
-
webex.meetings.reachability.getReachabilityReportToAttachToRoap.resolves(
|
414
|
-
|
412
|
+
webex.meetings.reachability.getReachabilityReportToAttachToRoap.resolves(
|
413
|
+
FAKE_REACHABILITY_REPORT
|
414
|
+
);
|
415
|
+
webex.meetings.reachability.getClientMediaPreferences.resolves(
|
416
|
+
FAKE_CLIENT_MEDIA_PREFERENCES
|
417
|
+
);
|
415
418
|
|
416
|
-
sinon
|
417
|
-
|
418
|
-
.get(() => true);
|
419
|
-
sinon
|
420
|
-
.stub(webex.internal.device.ipNetworkDetector, 'supportsIpV6')
|
421
|
-
.get(() => true);
|
419
|
+
sinon.stub(webex.internal.device.ipNetworkDetector, 'supportsIpV4').get(() => true);
|
420
|
+
sinon.stub(webex.internal.device.ipNetworkDetector, 'supportsIpV6').get(() => true);
|
422
421
|
|
423
422
|
await MeetingUtil.joinMeeting(meeting, {
|
424
423
|
reachability: 'reachability',
|
425
424
|
roapMessage: 'roapMessage',
|
426
425
|
});
|
427
426
|
|
428
|
-
assert.calledOnceWithExactly(
|
429
|
-
|
427
|
+
assert.calledOnceWithExactly(
|
428
|
+
webex.meetings.reachability.getReachabilityReportToAttachToRoap
|
429
|
+
);
|
430
|
+
assert.calledOnceWithExactly(
|
431
|
+
webex.meetings.reachability.getClientMediaPreferences,
|
432
|
+
meeting.isMultistream,
|
433
|
+
IP_VERSION.ipv4_and_ipv6
|
434
|
+
);
|
430
435
|
|
431
436
|
assert.calledOnce(meeting.meetingRequest.joinMeeting);
|
432
437
|
const parameter = meeting.meetingRequest.joinMeeting.getCall(0).args[0];
|
@@ -436,9 +441,9 @@ describe('plugin-meetings', () => {
|
|
436
441
|
assert.equal(parameter.clientMediaPreferences, FAKE_CLIENT_MEDIA_PREFERENCES);
|
437
442
|
assert.equal(parameter.roapMessage, 'roapMessage');
|
438
443
|
|
439
|
-
assert.calledOnce(meeting.setLocus)
|
444
|
+
assert.calledOnce(meeting.setLocus);
|
440
445
|
const setLocusParameter = meeting.setLocus.getCall(0).args[0];
|
441
|
-
assert.deepEqual(setLocusParameter, MeetingUtil.parseLocusJoin(joinMeetingResponse))
|
446
|
+
assert.deepEqual(setLocusParameter, MeetingUtil.parseLocusJoin(joinMeetingResponse));
|
442
447
|
|
443
448
|
assert.calledWith(webex.internal.newMetrics.submitClientEvent, {
|
444
449
|
name: 'client.locus.join.request',
|
@@ -460,7 +465,6 @@ describe('plugin-meetings', () => {
|
|
460
465
|
});
|
461
466
|
});
|
462
467
|
|
463
|
-
|
464
468
|
it('#Should call `meetingRequest.joinMeeting and handle a date header in the response : isoLocalClientMeetingJoinedTime', async () => {
|
465
469
|
meeting.isMultistream = true;
|
466
470
|
|
@@ -471,30 +475,30 @@ describe('plugin-meetings', () => {
|
|
471
475
|
id: 'fake client media preferences',
|
472
476
|
};
|
473
477
|
|
474
|
-
webex.meetings.reachability.getReachabilityReportToAttachToRoap.resolves(
|
475
|
-
|
478
|
+
webex.meetings.reachability.getReachabilityReportToAttachToRoap.resolves(
|
479
|
+
FAKE_REACHABILITY_REPORT
|
480
|
+
);
|
481
|
+
webex.meetings.reachability.getClientMediaPreferences.resolves(
|
482
|
+
FAKE_CLIENT_MEDIA_PREFERENCES
|
483
|
+
);
|
476
484
|
|
477
|
-
sinon
|
478
|
-
|
479
|
-
.get(() => true);
|
480
|
-
sinon
|
481
|
-
.stub(webex.internal.device.ipNetworkDetector, 'supportsIpV6')
|
482
|
-
.get(() => true);
|
485
|
+
sinon.stub(webex.internal.device.ipNetworkDetector, 'supportsIpV4').get(() => true);
|
486
|
+
sinon.stub(webex.internal.device.ipNetworkDetector, 'supportsIpV6').get(() => true);
|
483
487
|
|
484
488
|
meeting.meetingRequest.joinMeeting.resolves({
|
485
489
|
headers: {
|
486
|
-
date: 'test'
|
490
|
+
date: 'test',
|
487
491
|
},
|
488
492
|
body: {
|
489
493
|
mediaConnections: [{mediaId: 'test'}],
|
490
494
|
locus: {
|
491
495
|
url: 'test',
|
492
496
|
self: {
|
493
|
-
id: 'test'
|
494
|
-
}
|
495
|
-
}
|
496
|
-
}
|
497
|
-
})
|
497
|
+
id: 'test',
|
498
|
+
},
|
499
|
+
},
|
500
|
+
},
|
501
|
+
});
|
498
502
|
|
499
503
|
await MeetingUtil.joinMeeting(meeting, {
|
500
504
|
reachability: 'reachability',
|
@@ -749,8 +753,30 @@ describe('plugin-meetings', () => {
|
|
749
753
|
|
750
754
|
describe('canShareWhiteBoard', () => {
|
751
755
|
it('works as expected', () => {
|
752
|
-
assert.deepEqual(
|
753
|
-
|
756
|
+
assert.deepEqual(
|
757
|
+
MeetingUtil.canShareWhiteBoard(['SHARE_WHITEBOARD'], {
|
758
|
+
[SELF_POLICY.SUPPORT_WHITEBOARD]: true,
|
759
|
+
}),
|
760
|
+
true
|
761
|
+
);
|
762
|
+
assert.deepEqual(
|
763
|
+
MeetingUtil.canShareWhiteBoard([], {
|
764
|
+
[SELF_POLICY.SUPPORT_WHITEBOARD]: true,
|
765
|
+
}),
|
766
|
+
false
|
767
|
+
);
|
768
|
+
assert.deepEqual(
|
769
|
+
MeetingUtil.canShareWhiteBoard(['SHARE_WHITEBOARD'], {
|
770
|
+
[SELF_POLICY.SUPPORT_WHITEBOARD]: false,
|
771
|
+
}),
|
772
|
+
false
|
773
|
+
);
|
774
|
+
assert.deepEqual(
|
775
|
+
MeetingUtil.canShareWhiteBoard([], {
|
776
|
+
[SELF_POLICY.SUPPORT_WHITEBOARD]: false,
|
777
|
+
}),
|
778
|
+
false
|
779
|
+
);
|
754
780
|
});
|
755
781
|
});
|
756
782
|
|
@@ -394,6 +394,44 @@ describe('TurnDiscovery', () => {
|
|
394
394
|
'failure: TURN_DISCOVERY_RESPONSE in http response has unexpected messageType: {"seq":"0","messageType":"ERROR"}'
|
395
395
|
);
|
396
396
|
});
|
397
|
+
|
398
|
+
it('resets turnInfo each time TURN discovery is done', async () => {
|
399
|
+
const runCheck = async (td, turnUrl, expectedResult) => {
|
400
|
+
mockRoapRequest.sendRoap = sinon.fake.resolves({
|
401
|
+
mediaConnections: [
|
402
|
+
{
|
403
|
+
mediaId: '464ff97f-4bda-466a-ad06-3a22184a2274',
|
404
|
+
remoteSdp: `{"roapMessage": {"messageType":"TURN_DISCOVERY_RESPONSE","seq":"0","headers": ["x-cisco-turn-url=${turnUrl}","x-cisco-turn-username=${FAKE_TURN_USERNAME}","x-cisco-turn-password=${FAKE_TURN_PASSWORD}", "noOkInTransaction"]}}`,
|
405
|
+
},
|
406
|
+
],
|
407
|
+
});
|
408
|
+
|
409
|
+
const result = td.doTurnDiscovery(testMeeting, false);
|
410
|
+
|
411
|
+
// check that TURN_DISCOVERY_REQUEST was sent
|
412
|
+
await checkRoapMessageSent('TURN_DISCOVERY_REQUEST', 0);
|
413
|
+
|
414
|
+
// @ts-ignore
|
415
|
+
mockRoapRequest.sendRoap.resetHistory();
|
416
|
+
|
417
|
+
await checkResult(result, undefined, expectedResult);
|
418
|
+
};
|
419
|
+
|
420
|
+
const td = new TurnDiscovery(mockRoapRequest);
|
421
|
+
|
422
|
+
await runCheck(td, FAKE_TURN_URL1, {
|
423
|
+
urls: [FAKE_TURN_URL1],
|
424
|
+
username: FAKE_TURN_USERNAME,
|
425
|
+
password: FAKE_TURN_PASSWORD,
|
426
|
+
});
|
427
|
+
|
428
|
+
// call it again with different turn url, the result should not have the previous url
|
429
|
+
await runCheck(td, FAKE_TURN_URL2, {
|
430
|
+
urls: [FAKE_TURN_URL2],
|
431
|
+
username: FAKE_TURN_USERNAME,
|
432
|
+
password: FAKE_TURN_PASSWORD,
|
433
|
+
});
|
434
|
+
});
|
397
435
|
});
|
398
436
|
});
|
399
437
|
|