@webex/plugin-meetings 3.12.0-task-refactor.1 → 3.12.0-webex-services-ready.2
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/AGENTS.md +9 -0
- package/dist/aiEnableRequest/index.js +197 -0
- package/dist/aiEnableRequest/index.js.map +1 -0
- package/dist/aiEnableRequest/utils.js +36 -0
- package/dist/aiEnableRequest/utils.js.map +1 -0
- package/dist/annotation/index.js +14 -5
- package/dist/annotation/index.js.map +1 -1
- package/dist/breakouts/breakout.js +8 -3
- package/dist/breakouts/breakout.js.map +1 -1
- package/dist/breakouts/index.js +26 -2
- package/dist/breakouts/index.js.map +1 -1
- package/dist/common/errors/webex-errors.js +49 -5
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/config.js +9 -3
- package/dist/config.js.map +1 -1
- package/dist/constants.js +59 -10
- package/dist/constants.js.map +1 -1
- package/dist/controls-options-manager/constants.js +11 -1
- package/dist/controls-options-manager/constants.js.map +1 -1
- package/dist/controls-options-manager/index.js +67 -29
- package/dist/controls-options-manager/index.js.map +1 -1
- package/dist/controls-options-manager/util.js +91 -0
- package/dist/controls-options-manager/util.js.map +1 -1
- package/dist/hashTree/constants.js +34 -0
- package/dist/hashTree/constants.js.map +1 -0
- package/dist/hashTree/hashTree.js +533 -0
- package/dist/hashTree/hashTree.js.map +1 -0
- package/dist/hashTree/hashTreeParser.js +2068 -36
- package/dist/hashTree/hashTreeParser.js.map +1 -1
- package/dist/hashTree/types.js +13 -3
- package/dist/hashTree/types.js.map +1 -1
- package/dist/hashTree/utils.js +111 -0
- package/dist/hashTree/utils.js.map +1 -0
- package/dist/index.js +18 -2
- package/dist/index.js.map +1 -1
- package/dist/interceptors/constant.js +12 -0
- package/dist/interceptors/constant.js.map +1 -0
- package/dist/interceptors/dataChannelAuthToken.js +350 -0
- package/dist/interceptors/dataChannelAuthToken.js.map +1 -0
- package/dist/interceptors/index.js +7 -0
- package/dist/interceptors/index.js.map +1 -1
- package/dist/interceptors/locusRetry.js +23 -8
- package/dist/interceptors/locusRetry.js.map +1 -1
- package/dist/interceptors/locusRouteToken.js +27 -5
- package/dist/interceptors/locusRouteToken.js.map +1 -1
- package/dist/interceptors/utils.js +27 -0
- package/dist/interceptors/utils.js.map +1 -0
- package/dist/interpretation/index.js +11 -2
- package/dist/interpretation/index.js.map +1 -1
- package/dist/interpretation/interpretation.types.js +7 -0
- package/dist/interpretation/interpretation.types.js.map +1 -0
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/controlsUtils.js +11 -4
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/index.js +896 -277
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js +36 -5
- package/dist/locus-info/infoUtils.js.map +1 -1
- package/dist/locus-info/selfUtils.js +1 -0
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/locus-info/types.js +19 -0
- package/dist/locus-info/types.js.map +1 -1
- package/dist/media/MediaConnectionAwaiter.js +72 -3
- package/dist/media/MediaConnectionAwaiter.js.map +1 -1
- package/dist/media/index.js +8 -2
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +5 -2
- package/dist/media/properties.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +11 -1
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +2075 -1096
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/locusMediaRequest.js +229 -82
- package/dist/meeting/locusMediaRequest.js.map +1 -1
- package/dist/meeting/muteState.js +10 -1
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +55 -2
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/request.type.js.map +1 -1
- package/dist/meeting/util.js +168 -5
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +2 -2
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meetings/index.js +369 -173
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/meetings.types.js +6 -1
- package/dist/meetings/meetings.types.js.map +1 -1
- package/dist/meetings/request.js +39 -0
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +127 -25
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +20 -0
- package/dist/member/index.js.map +1 -1
- package/dist/member/types.js.map +1 -1
- package/dist/member/util.js +40 -0
- package/dist/member/util.js.map +1 -1
- package/dist/members/index.js +101 -43
- package/dist/members/index.js.map +1 -1
- package/dist/members/util.js +8 -1
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/constants.js +11 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/multistream/codec/constants.js +63 -0
- package/dist/multistream/codec/constants.js.map +1 -0
- package/dist/multistream/mediaRequestManager.js +64 -68
- package/dist/multistream/mediaRequestManager.js.map +1 -1
- package/dist/multistream/receiveSlot.js +9 -0
- package/dist/multistream/receiveSlot.js.map +1 -1
- package/dist/multistream/remoteMediaManager.js +11 -0
- package/dist/multistream/remoteMediaManager.js.map +1 -1
- package/dist/multistream/sendSlotManager.js +116 -2
- package/dist/multistream/sendSlotManager.js.map +1 -1
- package/dist/reachability/clusterReachability.js +171 -18
- package/dist/reachability/clusterReachability.js.map +1 -1
- package/dist/reachability/index.js +142 -94
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/reachability.types.js +2 -0
- package/dist/reachability/reachability.types.js.map +1 -1
- package/dist/reachability/reachabilityPeerConnection.js +1 -1
- package/dist/reachability/reachabilityPeerConnection.js.map +1 -1
- package/dist/reachability/util.js +45 -0
- package/dist/reachability/util.js.map +1 -1
- package/dist/reactions/reactions.type.js.map +1 -1
- package/dist/reconnection-manager/index.js +0 -1
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/recording-controller/index.js +1 -3
- package/dist/recording-controller/index.js.map +1 -1
- package/dist/types/aiEnableRequest/index.d.ts +5 -0
- package/dist/types/aiEnableRequest/utils.d.ts +2 -0
- package/dist/types/common/browser-detection.d.ts +1 -0
- package/dist/types/common/errors/webex-errors.d.ts +32 -2
- package/dist/types/common/events/events-scope.d.ts +1 -0
- package/dist/types/common/events/events.d.ts +1 -0
- package/dist/types/config.d.ts +7 -2
- package/dist/types/constants.d.ts +35 -1
- package/dist/types/controls-options-manager/constants.d.ts +6 -1
- package/dist/types/controls-options-manager/index.d.ts +16 -0
- package/dist/types/hashTree/constants.d.ts +11 -0
- package/dist/types/hashTree/hashTree.d.ts +136 -0
- package/dist/types/hashTree/hashTreeParser.d.ts +392 -14
- package/dist/types/hashTree/types.d.ts +20 -0
- package/dist/types/hashTree/utils.d.ts +40 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/interceptors/constant.d.ts +5 -0
- package/dist/types/interceptors/dataChannelAuthToken.d.ts +43 -0
- package/dist/types/interceptors/index.d.ts +2 -1
- package/dist/types/interceptors/locusRetry.d.ts +4 -4
- package/dist/types/interceptors/locusRouteToken.d.ts +2 -0
- package/dist/types/interceptors/utils.d.ts +1 -0
- package/dist/types/interpretation/interpretation.types.d.ts +10 -0
- package/dist/types/locus-info/index.d.ts +116 -51
- package/dist/types/locus-info/infoUtils.d.ts +8 -0
- package/dist/types/locus-info/types.d.ts +48 -12
- package/dist/types/media/MediaConnectionAwaiter.d.ts +20 -2
- package/dist/types/media/properties.d.ts +3 -1
- package/dist/types/meeting/in-meeting-actions.d.ts +10 -0
- package/dist/types/meeting/index.d.ts +196 -15
- package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
- package/dist/types/meeting/request.d.ts +17 -1
- package/dist/types/meeting/request.type.d.ts +5 -0
- package/dist/types/meeting/util.d.ts +40 -0
- package/dist/types/meeting-info/util.d.ts +1 -0
- package/dist/types/meeting-info/utilv2.d.ts +1 -0
- package/dist/types/meetings/index.d.ts +34 -20
- package/dist/types/meetings/meetings.types.d.ts +15 -0
- package/dist/types/meetings/request.d.ts +14 -0
- package/dist/types/member/index.d.ts +2 -0
- package/dist/types/member/types.d.ts +5 -4
- package/dist/types/member/util.d.ts +14 -0
- package/dist/types/members/index.d.ts +15 -2
- package/dist/types/members/util.d.ts +1 -5
- package/dist/types/metrics/constants.d.ts +10 -0
- package/dist/types/multistream/codec/constants.d.ts +7 -0
- package/dist/types/multistream/mediaRequestManager.d.ts +20 -26
- package/dist/types/multistream/sendSlotManager.d.ts +23 -1
- package/dist/types/reachability/clusterReachability.d.ts +33 -6
- package/dist/types/reachability/index.d.ts +10 -3
- package/dist/types/reachability/reachability.types.d.ts +7 -0
- package/dist/types/reachability/util.d.ts +17 -0
- package/dist/types/reactions/reactions.type.d.ts +4 -0
- package/dist/types/recording-controller/util.d.ts +5 -5
- package/dist/types/roap/index.d.ts +1 -1
- package/dist/types/webinar/utils.d.ts +6 -0
- package/dist/webinar/index.js +585 -164
- package/dist/webinar/index.js.map +1 -1
- package/dist/webinar/utils.js +25 -0
- package/dist/webinar/utils.js.map +1 -0
- package/package.json +26 -24
- package/src/aiEnableRequest/README.md +84 -0
- package/src/aiEnableRequest/index.ts +186 -0
- package/src/aiEnableRequest/utils.ts +25 -0
- package/src/annotation/index.ts +27 -7
- package/src/breakouts/breakout.ts +3 -1
- package/src/breakouts/index.ts +31 -0
- package/src/common/errors/webex-errors.ts +50 -3
- package/src/config.ts +7 -2
- package/src/constants.ts +49 -3
- package/src/controls-options-manager/constants.ts +14 -1
- package/src/controls-options-manager/index.ts +87 -28
- package/src/controls-options-manager/util.ts +81 -1
- package/src/hashTree/constants.ts +26 -0
- package/src/hashTree/hashTree.ts +480 -0
- package/src/hashTree/hashTreeParser.ts +1911 -29
- package/src/hashTree/types.ts +24 -1
- package/src/hashTree/utils.ts +98 -0
- package/src/index.ts +14 -1
- package/src/interceptors/constant.ts +6 -0
- package/src/interceptors/dataChannelAuthToken.ts +246 -0
- package/src/interceptors/index.ts +2 -1
- package/src/interceptors/locusRetry.ts +25 -4
- package/src/interceptors/locusRouteToken.ts +22 -5
- package/src/interceptors/utils.ts +16 -0
- package/src/interpretation/index.ts +29 -11
- package/src/interpretation/interpretation.types.ts +11 -0
- package/src/locus-info/controlsUtils.ts +20 -1
- package/src/locus-info/index.ts +958 -250
- package/src/locus-info/infoUtils.ts +41 -6
- package/src/locus-info/selfUtils.ts +1 -0
- package/src/locus-info/types.ts +51 -12
- package/src/media/MediaConnectionAwaiter.ts +62 -5
- package/src/media/index.ts +10 -1
- package/src/media/properties.ts +4 -1
- package/src/meeting/in-meeting-actions.ts +20 -0
- package/src/meeting/index.ts +1025 -146
- package/src/meeting/locusMediaRequest.ts +106 -6
- package/src/meeting/muteState.ts +10 -1
- package/src/meeting/request.ts +53 -0
- package/src/meeting/request.type.ts +6 -0
- package/src/meeting/util.ts +207 -7
- package/src/meeting-info/meeting-info-v2.ts +4 -2
- package/src/meetings/index.ts +307 -132
- package/src/meetings/meetings.types.ts +19 -0
- package/src/meetings/request.ts +43 -0
- package/src/meetings/util.ts +127 -13
- package/src/member/index.ts +20 -0
- package/src/member/types.ts +1 -0
- package/src/member/util.ts +41 -0
- package/src/members/index.ts +70 -7
- package/src/members/util.ts +12 -4
- package/src/metrics/constants.ts +11 -0
- package/src/multistream/codec/constants.ts +58 -0
- package/src/multistream/mediaRequestManager.ts +117 -76
- package/src/multistream/receiveSlot.ts +18 -0
- package/src/multistream/remoteMediaManager.ts +13 -0
- package/src/multistream/sendSlotManager.ts +97 -3
- package/src/reachability/clusterReachability.ts +156 -29
- package/src/reachability/index.ts +62 -17
- package/src/reachability/reachability.types.ts +11 -0
- package/src/reachability/reachabilityPeerConnection.ts +3 -1
- package/src/reachability/util.ts +36 -0
- package/src/reactions/reactions.type.ts +4 -0
- package/src/reconnection-manager/index.ts +0 -1
- package/src/recording-controller/index.ts +1 -2
- package/src/webinar/index.ts +448 -11
- package/src/webinar/utils.ts +16 -0
- package/test/unit/spec/aiEnableRequest/index.ts +1067 -0
- package/test/unit/spec/aiEnableRequest/utils.ts +130 -0
- package/test/unit/spec/annotation/index.ts +69 -7
- package/test/unit/spec/breakouts/breakout.ts +9 -3
- package/test/unit/spec/breakouts/index.ts +49 -0
- package/test/unit/spec/common/errors/webex-errors.ts +78 -0
- package/test/unit/spec/controls-options-manager/index.js +244 -29
- package/test/unit/spec/controls-options-manager/util.js +165 -0
- package/test/unit/spec/hashTree/hashTree.ts +721 -0
- package/test/unit/spec/hashTree/hashTreeParser.ts +5328 -0
- package/test/unit/spec/hashTree/utils.ts +264 -0
- package/test/unit/spec/interceptors/dataChannelAuthToken.ts +406 -0
- package/test/unit/spec/interceptors/locusRetry.ts +205 -4
- package/test/unit/spec/interceptors/locusRouteToken.ts +44 -0
- package/test/unit/spec/interceptors/utils.ts +75 -0
- package/test/unit/spec/interpretation/index.ts +26 -4
- package/test/unit/spec/locus-info/controlsUtils.js +222 -52
- package/test/unit/spec/locus-info/index.js +2000 -171
- package/test/unit/spec/locus-info/infoUtils.js +184 -1
- package/test/unit/spec/media/MediaConnectionAwaiter.ts +96 -1
- package/test/unit/spec/media/index.ts +92 -0
- package/test/unit/spec/media/properties.ts +12 -3
- package/test/unit/spec/meeting/in-meeting-actions.ts +12 -2
- package/test/unit/spec/meeting/index.js +2925 -209
- package/test/unit/spec/meeting/locusMediaRequest.ts +406 -4
- package/test/unit/spec/meeting/muteState.js +81 -0
- package/test/unit/spec/meeting/request.js +82 -0
- package/test/unit/spec/meeting/utils.js +595 -27
- package/test/unit/spec/meeting-info/meetinginfov2.js +19 -10
- package/test/unit/spec/meetings/index.js +1214 -75
- package/test/unit/spec/meetings/request.js +141 -0
- package/test/unit/spec/meetings/utils.js +453 -52
- package/test/unit/spec/member/index.js +35 -4
- package/test/unit/spec/member/util.js +154 -27
- package/test/unit/spec/members/index.js +216 -0
- package/test/unit/spec/members/request.js +37 -1
- package/test/unit/spec/members/utils.js +63 -0
- package/test/unit/spec/multistream/mediaRequestManager.ts +503 -122
- package/test/unit/spec/multistream/remoteMediaManager.ts +30 -0
- package/test/unit/spec/multistream/sendSlotManager.ts +135 -36
- package/test/unit/spec/reachability/clusterReachability.ts +125 -1
- package/test/unit/spec/reachability/index.ts +154 -49
- package/test/unit/spec/reachability/util.ts +31 -0
- package/test/unit/spec/reconnection-manager/index.js +4 -8
- package/test/unit/spec/recording-controller/index.js +9 -8
- package/test/unit/spec/webinar/index.ts +837 -39
- package/test/unit/spec/webinar/utils.ts +39 -0
|
@@ -965,6 +965,36 @@ describe('RemoteMediaManager', () => {
|
|
|
965
965
|
);
|
|
966
966
|
});
|
|
967
967
|
|
|
968
|
+
it('allocates 25 video slots for AllEqual25 layout', async () => {
|
|
969
|
+
const config = cloneDeep(DefaultTestConfiguration);
|
|
970
|
+
config.video.layouts['AllEqual25'] = {
|
|
971
|
+
activeSpeakerVideoPaneGroups: [
|
|
972
|
+
{id: 'main', numPanes: 25, size: 'best', priority: 255},
|
|
973
|
+
],
|
|
974
|
+
};
|
|
975
|
+
config.video.initialLayoutId = 'AllEqual25';
|
|
976
|
+
|
|
977
|
+
let slotCount = 0;
|
|
978
|
+
fakeReceiveSlotManager.allocateSlot.callsFake((mediaType: MediaType) => {
|
|
979
|
+
if (mediaType === MediaType.VideoMain) {
|
|
980
|
+
slotCount += 1;
|
|
981
|
+
return Promise.resolve(new FakeSlot(mediaType, `fake video ${slotCount}`));
|
|
982
|
+
}
|
|
983
|
+
return Promise.resolve(fakeAudioSlot);
|
|
984
|
+
});
|
|
985
|
+
|
|
986
|
+
remoteMediaManager = new RemoteMediaManager(
|
|
987
|
+
fakeReceiveSlotManager,
|
|
988
|
+
fakeMediaRequestManagers,
|
|
989
|
+
config
|
|
990
|
+
);
|
|
991
|
+
|
|
992
|
+
await remoteMediaManager.start();
|
|
993
|
+
|
|
994
|
+
assert.strictEqual(remoteMediaManager.getLayoutId(), 'AllEqual25');
|
|
995
|
+
assert.strictEqual(remoteMediaManager.slots.video.activeSpeaker.length, 25);
|
|
996
|
+
});
|
|
997
|
+
|
|
968
998
|
it('releases slots when switching to layout that requires less active speaker slots', async () => {
|
|
969
999
|
// start with "AllEqual" layout that needs just 9 video slots
|
|
970
1000
|
const config = cloneDeep(DefaultTestConfiguration);
|
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
import 'jsdom-global/register';
|
|
2
2
|
import SendSlotManager from '@webex/plugin-meetings/src/multistream/sendSlotManager';
|
|
3
|
-
import { LocalStream, MediaType, MultistreamRoapMediaConnection } from "@webex/internal-media-core";
|
|
4
|
-
import {expect} from '@webex/test-helper-chai';
|
|
3
|
+
import { LocalStream, MediaType, MultistreamRoapMediaConnection, MediaCodecMimeType } from "@webex/internal-media-core";
|
|
4
|
+
import {assert, expect} from '@webex/test-helper-chai';
|
|
5
5
|
import sinon from 'sinon';
|
|
6
|
+
import Metrics from '@webex/plugin-meetings/src/metrics';
|
|
7
|
+
import BEHAVIORAL_METRICS from '@webex/plugin-meetings/src/metrics/constants';
|
|
6
8
|
|
|
7
9
|
describe('SendSlotsManager', () => {
|
|
8
10
|
let sendSlotsManager: SendSlotManager;
|
|
9
11
|
const LoggerProxy = {
|
|
10
12
|
logger: {
|
|
11
13
|
info: sinon.stub(),
|
|
14
|
+
warn: sinon.stub(),
|
|
15
|
+
error: sinon.stub(),
|
|
12
16
|
},
|
|
13
17
|
};
|
|
14
18
|
|
|
15
19
|
beforeEach(() => {
|
|
16
20
|
sendSlotsManager = new SendSlotManager(LoggerProxy);
|
|
21
|
+
sinon.stub(Metrics, 'sendBehavioralMetric');
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
afterEach(() => {
|
|
25
|
+
sinon.restore();
|
|
17
26
|
});
|
|
18
27
|
|
|
19
28
|
describe('createSlot', () => {
|
|
@@ -29,13 +38,13 @@ describe('SendSlotsManager', () => {
|
|
|
29
38
|
it('should create a slot for the given mediaType', () => {
|
|
30
39
|
sendSlotsManager.createSlot(mediaConnection, mediaType);
|
|
31
40
|
|
|
32
|
-
|
|
41
|
+
assert.calledWith(mediaConnection.createSendSlot, mediaType, true);
|
|
33
42
|
});
|
|
34
43
|
|
|
35
44
|
it('should create a slot for the given mediaType & active state', () => {
|
|
36
45
|
sendSlotsManager.createSlot(mediaConnection, mediaType, false);
|
|
37
46
|
|
|
38
|
-
|
|
47
|
+
assert.calledWith(mediaConnection.createSendSlot, mediaType, false);
|
|
39
48
|
});
|
|
40
49
|
|
|
41
50
|
it('should throw an error if a slot for the given mediaType already exists', () => {
|
|
@@ -86,14 +95,12 @@ describe('SendSlotsManager', () => {
|
|
|
86
95
|
|
|
87
96
|
await sendSlotsManager.publishStream(mediaType, stream);
|
|
88
97
|
|
|
89
|
-
|
|
98
|
+
assert.calledWith(slot.publishStream, stream);
|
|
90
99
|
});
|
|
91
100
|
|
|
92
|
-
it('should throw an error if a slot for the given mediaType does not exist', (
|
|
93
|
-
sendSlotsManager.publishStream(mediaType, stream)
|
|
94
|
-
|
|
95
|
-
done();
|
|
96
|
-
});
|
|
101
|
+
it('should throw an error if a slot for the given mediaType does not exist', async () => {
|
|
102
|
+
await expect(sendSlotsManager.publishStream(mediaType, stream))
|
|
103
|
+
.to.be.rejectedWith(`Slot for ${mediaType} does not exist`);
|
|
97
104
|
});
|
|
98
105
|
});
|
|
99
106
|
|
|
@@ -116,14 +123,12 @@ describe('SendSlotsManager', () => {
|
|
|
116
123
|
|
|
117
124
|
await sendSlotsManager.unpublishStream(mediaType);
|
|
118
125
|
|
|
119
|
-
|
|
126
|
+
assert.called(slot.unpublishStream);
|
|
120
127
|
});
|
|
121
128
|
|
|
122
|
-
it('should throw an error if a slot for the given mediaType does not exist',(
|
|
123
|
-
sendSlotsManager.unpublishStream(mediaType)
|
|
124
|
-
|
|
125
|
-
done();
|
|
126
|
-
});
|
|
129
|
+
it('should throw an error if a slot for the given mediaType does not exist', async () => {
|
|
130
|
+
await expect(sendSlotsManager.unpublishStream(mediaType))
|
|
131
|
+
.to.be.rejectedWith(`Slot for ${mediaType} does not exist`);
|
|
127
132
|
});
|
|
128
133
|
});
|
|
129
134
|
|
|
@@ -147,7 +152,7 @@ describe('SendSlotsManager', () => {
|
|
|
147
152
|
|
|
148
153
|
await sendSlotsManager.setNamedMediaGroups(mediaType, groups);
|
|
149
154
|
|
|
150
|
-
|
|
155
|
+
assert.calledWith(slot.setNamedMediaGroups, groups);
|
|
151
156
|
});
|
|
152
157
|
|
|
153
158
|
it('should throw an error if the given mediaType is not audio', () => {
|
|
@@ -169,16 +174,16 @@ describe('SendSlotsManager', () => {
|
|
|
169
174
|
} as MultistreamRoapMediaConnection;
|
|
170
175
|
});
|
|
171
176
|
|
|
172
|
-
it('should set the active state of the sendSlot for the given mediaType',
|
|
177
|
+
it('should set the active state of the sendSlot for the given mediaType', () => {
|
|
173
178
|
const slot = {
|
|
174
|
-
|
|
179
|
+
active: false,
|
|
175
180
|
};
|
|
176
181
|
mediaConnection.createSendSlot.returns(slot);
|
|
177
182
|
sendSlotsManager.createSlot(mediaConnection, mediaType);
|
|
178
183
|
|
|
179
|
-
|
|
184
|
+
sendSlotsManager.setActive(mediaType, true);
|
|
180
185
|
|
|
181
|
-
expect(slot.
|
|
186
|
+
expect(slot.active).to.be.true;
|
|
182
187
|
});
|
|
183
188
|
|
|
184
189
|
it('should throw an error if a slot for the given mediaType does not exist', () => {
|
|
@@ -197,7 +202,7 @@ describe('SendSlotsManager', () => {
|
|
|
197
202
|
} as MultistreamRoapMediaConnection;
|
|
198
203
|
});
|
|
199
204
|
|
|
200
|
-
it('should
|
|
205
|
+
it('should delegate to slot.setCodecParameters, log deprecation warning and send deprecation metric', async () => {
|
|
201
206
|
const slot = {
|
|
202
207
|
setCodecParameters: sinon.stub().resolves(),
|
|
203
208
|
};
|
|
@@ -206,14 +211,17 @@ describe('SendSlotsManager', () => {
|
|
|
206
211
|
|
|
207
212
|
await sendSlotsManager.setCodecParameters(mediaType, codecParameters);
|
|
208
213
|
|
|
209
|
-
|
|
214
|
+
assert.calledWith(slot.setCodecParameters, codecParameters);
|
|
215
|
+
assert.called(LoggerProxy.logger.warn);
|
|
216
|
+
assert.calledWith(Metrics.sendBehavioralMetric as sinon.SinonStub,
|
|
217
|
+
BEHAVIORAL_METRICS.DEPRECATED_SET_CODEC_PARAMETERS_USED,
|
|
218
|
+
{ mediaType, codecParameters }
|
|
219
|
+
);
|
|
210
220
|
});
|
|
211
221
|
|
|
212
|
-
it('should throw an error if a slot for the given mediaType does not exist', (
|
|
213
|
-
sendSlotsManager.setCodecParameters(mediaType, codecParameters)
|
|
214
|
-
|
|
215
|
-
done();
|
|
216
|
-
});
|
|
222
|
+
it('should throw an error if a slot for the given mediaType does not exist', async () => {
|
|
223
|
+
await expect(sendSlotsManager.setCodecParameters(mediaType, codecParameters))
|
|
224
|
+
.to.be.rejectedWith(`Slot for ${mediaType} does not exist`);
|
|
217
225
|
});
|
|
218
226
|
});
|
|
219
227
|
|
|
@@ -227,23 +235,114 @@ describe('SendSlotsManager', () => {
|
|
|
227
235
|
} as MultistreamRoapMediaConnection;
|
|
228
236
|
});
|
|
229
237
|
|
|
230
|
-
it('should
|
|
238
|
+
it('should delegate to slot.deleteCodecParameters, log deprecation warning and send deprecation metric', async () => {
|
|
231
239
|
const slot = {
|
|
232
240
|
deleteCodecParameters: sinon.stub().resolves(),
|
|
233
241
|
};
|
|
234
242
|
mediaConnection.createSendSlot.returns(slot);
|
|
235
243
|
sendSlotsManager.createSlot(mediaConnection, mediaType);
|
|
236
244
|
|
|
237
|
-
await sendSlotsManager.deleteCodecParameters(mediaType,[]);
|
|
245
|
+
await sendSlotsManager.deleteCodecParameters(mediaType, []);
|
|
246
|
+
|
|
247
|
+
assert.calledWith(slot.deleteCodecParameters, []);
|
|
248
|
+
assert.called(LoggerProxy.logger.warn);
|
|
249
|
+
assert.calledWith(Metrics.sendBehavioralMetric as sinon.SinonStub,
|
|
250
|
+
BEHAVIORAL_METRICS.DEPRECATED_DELETE_CODEC_PARAMETERS_USED,
|
|
251
|
+
{ mediaType, parameters: [] }
|
|
252
|
+
);
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
it('should throw an error if a slot for the given mediaType does not exist', async () => {
|
|
256
|
+
await expect(sendSlotsManager.deleteCodecParameters(mediaType, []))
|
|
257
|
+
.to.be.rejectedWith(`Slot for ${mediaType} does not exist`);
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
describe('setCustomCodecParameters', () => {
|
|
262
|
+
let mediaConnection;
|
|
263
|
+
const mediaType = MediaType.AudioMain;
|
|
264
|
+
const codecMimeType = MediaCodecMimeType.OPUS;
|
|
265
|
+
const parameters = { maxaveragebitrate: '64000' };
|
|
266
|
+
|
|
267
|
+
beforeEach(() => {
|
|
268
|
+
mediaConnection = {
|
|
269
|
+
createSendSlot: sinon.stub(),
|
|
270
|
+
} as MultistreamRoapMediaConnection;
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
it('should set custom codec parameters on the sendSlot for the given mediaType and codec, log info and send metric', async () => {
|
|
274
|
+
const slot = {
|
|
275
|
+
setCustomCodecParameters: sinon.stub().resolves(),
|
|
276
|
+
};
|
|
277
|
+
mediaConnection.createSendSlot.returns(slot);
|
|
278
|
+
sendSlotsManager.createSlot(mediaConnection, mediaType);
|
|
279
|
+
|
|
280
|
+
await sendSlotsManager.setCustomCodecParameters(mediaType, codecMimeType, parameters);
|
|
281
|
+
|
|
282
|
+
assert.calledWith(slot.setCustomCodecParameters, codecMimeType, parameters);
|
|
283
|
+
assert.called(LoggerProxy.logger.info);
|
|
284
|
+
assert.calledWith(Metrics.sendBehavioralMetric as sinon.SinonStub,
|
|
285
|
+
BEHAVIORAL_METRICS.SET_CUSTOM_CODEC_PARAMETERS_USED,
|
|
286
|
+
{ mediaType, codecMimeType, parameters }
|
|
287
|
+
);
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
it('should throw an error if a slot for the given mediaType does not exist', async () => {
|
|
291
|
+
await expect(sendSlotsManager.setCustomCodecParameters(mediaType, codecMimeType, parameters))
|
|
292
|
+
.to.be.rejectedWith(`Slot for ${mediaType} does not exist`);
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
it('should throw and log error when setCustomCodecParameters fails', async () => {
|
|
296
|
+
const error = new Error('codec parameter failure');
|
|
297
|
+
const slot = {
|
|
298
|
+
setCustomCodecParameters: sinon.stub().rejects(error),
|
|
299
|
+
};
|
|
300
|
+
mediaConnection.createSendSlot.returns(slot);
|
|
301
|
+
sendSlotsManager.createSlot(mediaConnection, mediaType);
|
|
302
|
+
|
|
303
|
+
await expect(sendSlotsManager.setCustomCodecParameters(mediaType, codecMimeType, parameters))
|
|
304
|
+
.to.be.rejectedWith('codec parameter failure');
|
|
305
|
+
|
|
306
|
+
assert.called(LoggerProxy.logger.error);
|
|
307
|
+
assert.calledWith(Metrics.sendBehavioralMetric as sinon.SinonStub,
|
|
308
|
+
BEHAVIORAL_METRICS.SET_CUSTOM_CODEC_PARAMETERS_USED,
|
|
309
|
+
{ mediaType, codecMimeType, parameters }
|
|
310
|
+
);
|
|
311
|
+
});
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
describe('markCustomCodecParametersForDeletion', () => {
|
|
315
|
+
let mediaConnection;
|
|
316
|
+
const mediaType = MediaType.AudioMain;
|
|
317
|
+
const codecMimeType = MediaCodecMimeType.OPUS;
|
|
318
|
+
const parameters = ['maxaveragebitrate', 'maxplaybackrate'];
|
|
319
|
+
|
|
320
|
+
beforeEach(() => {
|
|
321
|
+
mediaConnection = {
|
|
322
|
+
createSendSlot: sinon.stub(),
|
|
323
|
+
} as MultistreamRoapMediaConnection;
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
it('should mark custom codec parameters for deletion on the sendSlot for the given mediaType and codec, log info and send metric', async () => {
|
|
327
|
+
const slot = {
|
|
328
|
+
markCustomCodecParametersForDeletion: sinon.stub().resolves(),
|
|
329
|
+
};
|
|
330
|
+
mediaConnection.createSendSlot.returns(slot);
|
|
331
|
+
sendSlotsManager.createSlot(mediaConnection, mediaType);
|
|
332
|
+
|
|
333
|
+
await sendSlotsManager.markCustomCodecParametersForDeletion(mediaType, codecMimeType, parameters);
|
|
238
334
|
|
|
239
|
-
|
|
335
|
+
assert.calledWith(slot.markCustomCodecParametersForDeletion, codecMimeType, parameters);
|
|
336
|
+
assert.called(LoggerProxy.logger.info);
|
|
337
|
+
assert.calledWith(Metrics.sendBehavioralMetric as sinon.SinonStub,
|
|
338
|
+
BEHAVIORAL_METRICS.MARK_CUSTOM_CODEC_PARAMETERS_FOR_DELETION_USED,
|
|
339
|
+
{ mediaType, codecMimeType, parameters }
|
|
340
|
+
);
|
|
240
341
|
});
|
|
241
342
|
|
|
242
|
-
it('should throw an error if a slot for the given mediaType does not exist', (
|
|
243
|
-
sendSlotsManager.
|
|
244
|
-
|
|
245
|
-
done();
|
|
246
|
-
});
|
|
343
|
+
it('should throw an error if a slot for the given mediaType does not exist', async () => {
|
|
344
|
+
await expect(sendSlotsManager.markCustomCodecParametersForDeletion(mediaType, codecMimeType, parameters))
|
|
345
|
+
.to.be.rejectedWith(`Slot for ${mediaType} does not exist`);
|
|
247
346
|
});
|
|
248
347
|
});
|
|
249
348
|
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
NatTypeUpdatedEventData,
|
|
11
11
|
} from '@webex/plugin-meetings/src/reachability/clusterReachability';
|
|
12
12
|
import {ReachabilityPeerConnection} from '@webex/plugin-meetings/src/reachability/reachabilityPeerConnection';
|
|
13
|
+
import {ReachabilityPeerConnectionEvents} from '@webex/plugin-meetings/src/reachability/reachability.types';
|
|
13
14
|
|
|
14
15
|
describe('ClusterReachability', () => {
|
|
15
16
|
let previousRTCPeerConnection;
|
|
@@ -92,6 +93,22 @@ describe('ClusterReachability', () => {
|
|
|
92
93
|
assert.deepEqual(emittedEvents[Events.clientMediaIpsUpdated], []);
|
|
93
94
|
});
|
|
94
95
|
|
|
96
|
+
it('should create separate peer connections when enablePerUdpUrlReachability is true', () => {
|
|
97
|
+
const perUdpClusterReachability = new ClusterReachability(
|
|
98
|
+
'testName',
|
|
99
|
+
{
|
|
100
|
+
isVideoMesh: false,
|
|
101
|
+
udp: ['stun:udp1', 'stun:udp2'],
|
|
102
|
+
tcp: ['stun:tcp1.webex.com'],
|
|
103
|
+
xtls: ['stun:xtls1.webex.com'],
|
|
104
|
+
},
|
|
105
|
+
true
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
assert.equal((perUdpClusterReachability as any).reachabilityPeerConnectionsForUdp.length, 2);
|
|
109
|
+
assert.instanceOf((perUdpClusterReachability as any).reachabilityPeerConnection, ReachabilityPeerConnection);
|
|
110
|
+
});
|
|
111
|
+
|
|
95
112
|
describe('#event relaying', () => {
|
|
96
113
|
let clock;
|
|
97
114
|
|
|
@@ -172,6 +189,44 @@ describe('ClusterReachability', () => {
|
|
|
172
189
|
clusterReachability.abort();
|
|
173
190
|
await promise;
|
|
174
191
|
});
|
|
192
|
+
|
|
193
|
+
it('emits only the first successful UDP result when enablePerUdpUrlReachability is true', async () => {
|
|
194
|
+
const perUdpClusterReachability = new ClusterReachability(
|
|
195
|
+
'testName',
|
|
196
|
+
{
|
|
197
|
+
isVideoMesh: false,
|
|
198
|
+
udp: ['stun:udp1', 'stun:udp2'],
|
|
199
|
+
tcp: [],
|
|
200
|
+
xtls: [],
|
|
201
|
+
},
|
|
202
|
+
true
|
|
203
|
+
);
|
|
204
|
+
|
|
205
|
+
const udpEvents: ResultEventData[] = [];
|
|
206
|
+
perUdpClusterReachability.on(Events.resultReady, (data: ResultEventData) => {
|
|
207
|
+
udpEvents.push(data);
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
const udpRpc1 = (perUdpClusterReachability as any).reachabilityPeerConnectionsForUdp[0];
|
|
211
|
+
const udpRpc2 = (perUdpClusterReachability as any).reachabilityPeerConnectionsForUdp[1];
|
|
212
|
+
|
|
213
|
+
udpRpc1.emit({file: 'test', function: 'test'}, ReachabilityPeerConnectionEvents.resultReady, {
|
|
214
|
+
protocol: 'udp',
|
|
215
|
+
result: 'reachable',
|
|
216
|
+
latencyInMilliseconds: 50,
|
|
217
|
+
clientMediaIPs: ['1.1.1.1'],
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
udpRpc2.emit({file: 'test', function: 'test'}, ReachabilityPeerConnectionEvents.resultReady, {
|
|
221
|
+
protocol: 'udp',
|
|
222
|
+
result: 'reachable',
|
|
223
|
+
latencyInMilliseconds: 30,
|
|
224
|
+
clientMediaIPs: ['2.2.2.2'],
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
assert.equal(udpEvents.length, 1);
|
|
228
|
+
assert.equal(udpEvents[0].latencyInMilliseconds, 50);
|
|
229
|
+
});
|
|
175
230
|
});
|
|
176
231
|
|
|
177
232
|
describe('#subnet collection', () => {
|
|
@@ -236,6 +291,38 @@ describe('ClusterReachability', () => {
|
|
|
236
291
|
assert.equal(clusterReachability.reachedSubnets.size, 3);
|
|
237
292
|
assert.deepEqual(Array.from(clusterReachability.reachedSubnets), ['192.168.1.1', '10.0.0.1', '172.16.0.1']);
|
|
238
293
|
});
|
|
294
|
+
|
|
295
|
+
it('collects reached subnets from all peer connections when enablePerUdpUrlReachability is true', async () => {
|
|
296
|
+
const perUdpClusterReachability = new ClusterReachability(
|
|
297
|
+
'testName',
|
|
298
|
+
{
|
|
299
|
+
isVideoMesh: false,
|
|
300
|
+
udp: ['stun:udp1', 'stun:udp2'],
|
|
301
|
+
tcp: ['stun:tcp1.webex.com'],
|
|
302
|
+
xtls: [],
|
|
303
|
+
},
|
|
304
|
+
true
|
|
305
|
+
);
|
|
306
|
+
|
|
307
|
+
const udpRpc1 = (perUdpClusterReachability as any).reachabilityPeerConnectionsForUdp[0];
|
|
308
|
+
const udpRpc2 = (perUdpClusterReachability as any).reachabilityPeerConnectionsForUdp[1];
|
|
309
|
+
const tcpTlsRpc = (perUdpClusterReachability as any).reachabilityPeerConnection;
|
|
310
|
+
|
|
311
|
+
udpRpc1.emit({file: 'test', function: 'test'}, ReachabilityPeerConnectionEvents.reachedSubnets, {
|
|
312
|
+
subnets: ['192.168.1.1'],
|
|
313
|
+
});
|
|
314
|
+
udpRpc2.emit({file: 'test', function: 'test'}, ReachabilityPeerConnectionEvents.reachedSubnets, {
|
|
315
|
+
subnets: ['10.0.0.1'],
|
|
316
|
+
});
|
|
317
|
+
tcpTlsRpc.emit({file: 'test', function: 'test'}, ReachabilityPeerConnectionEvents.reachedSubnets, {
|
|
318
|
+
subnets: ['172.16.0.1'],
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
assert.equal(perUdpClusterReachability.reachedSubnets.size, 3);
|
|
322
|
+
assert.isTrue(perUdpClusterReachability.reachedSubnets.has('192.168.1.1'));
|
|
323
|
+
assert.isTrue(perUdpClusterReachability.reachedSubnets.has('10.0.0.1'));
|
|
324
|
+
assert.isTrue(perUdpClusterReachability.reachedSubnets.has('172.16.0.1'));
|
|
325
|
+
});
|
|
239
326
|
});
|
|
240
327
|
|
|
241
328
|
describe('#delegation', () => {
|
|
@@ -277,6 +364,43 @@ describe('ClusterReachability', () => {
|
|
|
277
364
|
assert.calledOnce(rpcGetResultStub);
|
|
278
365
|
assert.deepEqual(result, expectedResult);
|
|
279
366
|
});
|
|
367
|
+
|
|
368
|
+
it('delegates start() and abort() to all peer connections when enablePerUdpUrlReachability is true', async () => {
|
|
369
|
+
const perUdpClusterReachability = new ClusterReachability(
|
|
370
|
+
'testName',
|
|
371
|
+
{
|
|
372
|
+
isVideoMesh: false,
|
|
373
|
+
udp: ['stun:udp1', 'stun:udp2'],
|
|
374
|
+
tcp: ['stun:tcp1.webex.com'],
|
|
375
|
+
xtls: [],
|
|
376
|
+
},
|
|
377
|
+
true
|
|
378
|
+
);
|
|
379
|
+
|
|
380
|
+
const udpRpc1 = (perUdpClusterReachability as any).reachabilityPeerConnectionsForUdp[0];
|
|
381
|
+
const udpRpc2 = (perUdpClusterReachability as any).reachabilityPeerConnectionsForUdp[1];
|
|
382
|
+
const tcpTlsRpc = (perUdpClusterReachability as any).reachabilityPeerConnection;
|
|
383
|
+
|
|
384
|
+
const startStub1 = sinon.stub(udpRpc1, 'start').resolves({udp: {result: 'reachable'}});
|
|
385
|
+
const startStub2 = sinon.stub(udpRpc2, 'start').resolves({udp: {result: 'unreachable'}});
|
|
386
|
+
const startStubTcp = sinon.stub(tcpTlsRpc, 'start').resolves({tcp: {result: 'reachable'}});
|
|
387
|
+
|
|
388
|
+
const abortStub1 = sinon.stub(udpRpc1, 'abort');
|
|
389
|
+
const abortStub2 = sinon.stub(udpRpc2, 'abort');
|
|
390
|
+
const abortStubTcp = sinon.stub(tcpTlsRpc, 'abort');
|
|
391
|
+
|
|
392
|
+
await perUdpClusterReachability.start();
|
|
393
|
+
|
|
394
|
+
assert.calledOnce(startStub1);
|
|
395
|
+
assert.calledOnce(startStub2);
|
|
396
|
+
assert.calledOnce(startStubTcp);
|
|
397
|
+
|
|
398
|
+
perUdpClusterReachability.abort();
|
|
399
|
+
|
|
400
|
+
assert.calledOnce(abortStub1);
|
|
401
|
+
assert.calledOnce(abortStub2);
|
|
402
|
+
assert.calledOnce(abortStubTcp);
|
|
403
|
+
});
|
|
280
404
|
});
|
|
281
405
|
|
|
282
406
|
describe('#WebRTC peer connection setup', () => {
|
|
@@ -616,4 +740,4 @@ describe('ClusterReachability', () => {
|
|
|
616
740
|
});
|
|
617
741
|
});
|
|
618
742
|
});
|
|
619
|
-
});
|
|
743
|
+
});
|