@webex/plugin-meetings 3.12.0-next.11 → 3.12.0-next.110
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 +15 -2
- package/dist/aiEnableRequest/index.js.map +1 -1
- package/dist/breakouts/breakout.js +8 -3
- package/dist/breakouts/breakout.js.map +1 -1
- package/dist/breakouts/events.js +29 -14
- package/dist/breakouts/events.js.map +1 -1
- package/dist/breakouts/index.js +90 -3
- 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 +2 -2
- package/dist/config.js.map +1 -1
- package/dist/constants.js +37 -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 +4 -1
- package/dist/hashTree/constants.js.map +1 -1
- package/dist/hashTree/hashTreeParser.js +1003 -393
- package/dist/hashTree/hashTreeParser.js.map +1 -1
- package/dist/hashTree/utils.js +20 -0
- package/dist/hashTree/utils.js.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/interceptors/dataChannelAuthToken.js +75 -15
- package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
- package/dist/interceptors/locusRetry.js +23 -8
- package/dist/interceptors/locusRetry.js.map +1 -1
- package/dist/interpretation/index.js +10 -1
- 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 +4 -1
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/index.js +406 -121
- 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/types.js +19 -0
- package/dist/locus-info/types.js.map +1 -1
- package/dist/media/MediaConnectionAwaiter.js +15 -2
- 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 +4 -5
- package/dist/media/properties.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +5 -1
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +1662 -829
- 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 +5 -2
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/util.js +34 -2
- 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 +256 -118
- 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 +116 -18
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +10 -0
- package/dist/member/index.js.map +1 -1
- package/dist/member/types.js.map +1 -1
- package/dist/member/util.js +30 -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 +7 -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 +62 -15
- 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/reachability/clusterReachability.js.map +1 -1
- package/dist/reachability/index.js +121 -83
- 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/util.js +45 -0
- package/dist/reachability/util.js.map +1 -1
- package/dist/reactions/reactions.type.js.map +1 -1
- package/dist/recording-controller/index.js +1 -3
- package/dist/recording-controller/index.js.map +1 -1
- package/dist/roap/turnDiscovery.js +8 -1
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/types/common/errors/webex-errors.d.ts +32 -2
- package/dist/types/config.d.ts +2 -2
- package/dist/types/constants.d.ts +13 -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 +1 -0
- package/dist/types/hashTree/hashTreeParser.d.ts +178 -22
- package/dist/types/hashTree/utils.d.ts +7 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/interceptors/locusRetry.d.ts +4 -4
- package/dist/types/interpretation/interpretation.types.d.ts +10 -0
- package/dist/types/locus-info/index.d.ts +61 -7
- package/dist/types/locus-info/infoUtils.d.ts +8 -0
- package/dist/types/locus-info/types.d.ts +21 -1
- package/dist/types/media/MediaConnectionAwaiter.d.ts +10 -1
- package/dist/types/media/properties.d.ts +6 -2
- package/dist/types/meeting/in-meeting-actions.d.ts +4 -0
- package/dist/types/meeting/index.d.ts +175 -11
- package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
- package/dist/types/meeting/request.d.ts +1 -0
- package/dist/types/meeting/util.d.ts +9 -0
- package/dist/types/meetings/index.d.ts +38 -18
- 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 +1 -0
- package/dist/types/member/types.d.ts +1 -0
- package/dist/types/member/util.d.ts +9 -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 +6 -0
- package/dist/types/multistream/codec/constants.d.ts +7 -0
- package/dist/types/multistream/mediaRequestManager.d.ts +22 -5
- package/dist/types/reachability/clusterReachability.d.ts +3 -3
- 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 +3 -0
- package/dist/webinar/index.js +307 -161
- package/dist/webinar/index.js.map +1 -1
- package/package.json +23 -23
- package/src/aiEnableRequest/index.ts +16 -0
- package/src/breakouts/breakout.ts +3 -1
- package/src/breakouts/events.ts +33 -11
- package/src/breakouts/index.ts +110 -1
- package/src/common/errors/webex-errors.ts +50 -3
- package/src/config.ts +2 -2
- package/src/constants.ts +21 -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 +7 -0
- package/src/hashTree/hashTreeParser.ts +752 -192
- package/src/hashTree/utils.ts +19 -0
- package/src/index.ts +6 -0
- package/src/interceptors/dataChannelAuthToken.ts +88 -12
- package/src/interceptors/locusRetry.ts +25 -4
- package/src/interpretation/index.ts +27 -9
- package/src/interpretation/interpretation.types.ts +11 -0
- package/src/locus-info/controlsUtils.ts +3 -1
- package/src/locus-info/index.ts +412 -130
- package/src/locus-info/infoUtils.ts +41 -6
- package/src/locus-info/types.ts +25 -1
- package/src/media/MediaConnectionAwaiter.ts +21 -4
- package/src/media/index.ts +10 -1
- package/src/media/properties.ts +8 -3
- package/src/meeting/in-meeting-actions.ts +8 -0
- package/src/meeting/index.ts +913 -111
- package/src/meeting/locusMediaRequest.ts +106 -6
- package/src/meeting/muteState.ts +10 -1
- package/src/meeting/request.ts +11 -0
- package/src/meeting/util.ts +46 -5
- package/src/meeting-info/meeting-info-v2.ts +4 -2
- package/src/meetings/index.ts +168 -79
- package/src/meetings/meetings.types.ts +19 -0
- package/src/meetings/request.ts +43 -0
- package/src/meetings/util.ts +117 -4
- package/src/member/index.ts +10 -0
- package/src/member/types.ts +1 -0
- package/src/member/util.ts +29 -0
- package/src/members/index.ts +70 -7
- package/src/members/util.ts +12 -4
- package/src/metrics/constants.ts +6 -0
- package/src/multistream/codec/constants.ts +58 -0
- package/src/multistream/mediaRequestManager.ts +119 -28
- package/src/multistream/receiveSlot.ts +18 -0
- package/src/reachability/clusterReachability.ts +3 -2
- package/src/reachability/index.ts +47 -16
- package/src/reachability/reachability.types.ts +11 -0
- package/src/reachability/util.ts +36 -0
- package/src/reactions/reactions.type.ts +3 -0
- package/src/recording-controller/index.ts +1 -2
- package/src/roap/turnDiscovery.ts +9 -1
- package/src/webinar/index.ts +216 -38
- package/test/unit/spec/aiEnableRequest/index.ts +86 -0
- package/test/unit/spec/breakouts/breakout.ts +9 -3
- package/test/unit/spec/breakouts/events.ts +120 -2
- package/test/unit/spec/breakouts/index.ts +191 -2
- 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/hashTreeParser.ts +2110 -170
- package/test/unit/spec/hashTree/utils.ts +37 -0
- package/test/unit/spec/interceptors/dataChannelAuthToken.ts +196 -0
- package/test/unit/spec/interceptors/locusRetry.ts +205 -4
- package/test/unit/spec/interpretation/index.ts +26 -4
- package/test/unit/spec/locus-info/controlsUtils.js +172 -57
- package/test/unit/spec/locus-info/index.js +643 -63
- package/test/unit/spec/locus-info/infoUtils.js +184 -1
- package/test/unit/spec/media/MediaConnectionAwaiter.ts +55 -0
- package/test/unit/spec/media/index.ts +92 -0
- package/test/unit/spec/media/properties.ts +23 -23
- package/test/unit/spec/meeting/in-meeting-actions.ts +4 -0
- package/test/unit/spec/meeting/index.js +2711 -183
- 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 +12 -0
- package/test/unit/spec/meeting/utils.js +153 -1
- package/test/unit/spec/meeting-info/meetinginfov2.js +19 -10
- package/test/unit/spec/meetings/index.js +467 -36
- package/test/unit/spec/meetings/request.js +141 -0
- package/test/unit/spec/meetings/utils.js +402 -51
- package/test/unit/spec/member/index.js +7 -0
- package/test/unit/spec/member/util.js +89 -0
- 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 +501 -37
- package/test/unit/spec/reachability/index.ts +128 -46
- package/test/unit/spec/reachability/util.ts +31 -0
- package/test/unit/spec/recording-controller/index.js +9 -8
- package/test/unit/spec/roap/turnDiscovery.ts +20 -0
- package/test/unit/spec/webinar/index.ts +332 -31
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
import 'jsdom-global/register';
|
|
1
2
|
import {assert} from '@webex/test-helper-chai';
|
|
2
3
|
import sinon from 'sinon';
|
|
4
|
+
import {CapabilityState, WebCapabilities} from '@webex/web-capabilities';
|
|
3
5
|
|
|
4
6
|
import MeetingsUtil from '@webex/plugin-meetings/src/meetings/util';
|
|
5
7
|
import Metrics from '@webex/plugin-meetings/src/metrics';
|
|
6
8
|
import BEHAVIORAL_METRICS from '@webex/plugin-meetings/src/metrics/constants';
|
|
9
|
+
import LoggerProxy from '@webex/plugin-meetings/src/common/logs/logger-proxy';
|
|
10
|
+
|
|
11
|
+
const multipartSitePrefixList = ['.my.', '.mydmz.', '.mybts.', '.mydev.', '.myats2.', '.myats.'];
|
|
7
12
|
|
|
8
13
|
describe('plugin-meetings', () => {
|
|
9
14
|
beforeEach(() => {
|
|
@@ -75,6 +80,129 @@ describe('plugin-meetings', () => {
|
|
|
75
80
|
});
|
|
76
81
|
});
|
|
77
82
|
|
|
83
|
+
describe('#hasH264Codec', () => {
|
|
84
|
+
let isCapableOfReceivingVideoCodecStub;
|
|
85
|
+
|
|
86
|
+
beforeEach(() => {
|
|
87
|
+
isCapableOfReceivingVideoCodecStub = sinon.stub(
|
|
88
|
+
WebCapabilities,
|
|
89
|
+
'isCapableOfReceivingVideoCodec'
|
|
90
|
+
);
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it('returns true when video/H264 reports CAPABLE', async () => {
|
|
94
|
+
isCapableOfReceivingVideoCodecStub.withArgs('video/H264').returns(CapabilityState.CAPABLE);
|
|
95
|
+
|
|
96
|
+
const result = await MeetingsUtil.hasH264Codec();
|
|
97
|
+
assert.equal(result, true);
|
|
98
|
+
assert.calledOnceWithExactly(isCapableOfReceivingVideoCodecStub, 'video/H264');
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
it('returns false when video/H264 reports NOT_CAPABLE', async () => {
|
|
102
|
+
isCapableOfReceivingVideoCodecStub
|
|
103
|
+
.withArgs('video/H264')
|
|
104
|
+
.returns(CapabilityState.NOT_CAPABLE);
|
|
105
|
+
|
|
106
|
+
const result = await MeetingsUtil.hasH264Codec();
|
|
107
|
+
assert.equal(result, false);
|
|
108
|
+
assert.calledOnceWithExactly(isCapableOfReceivingVideoCodecStub, 'video/H264');
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
it('falls back to RTCPeerConnection when isCapableOfReceivingVideoCodec throws', async () => {
|
|
112
|
+
isCapableOfReceivingVideoCodecStub.throws(new Error('WebCapabilities unavailable'));
|
|
113
|
+
const mockPc = {createOffer: sinon.stub(), close: sinon.stub()};
|
|
114
|
+
global.window.RTCPeerConnection = sinon.stub().returns(mockPc);
|
|
115
|
+
mockPc.createOffer.resolves({sdp: 'v=0\r\na=rtpmap:96 H264/90000\r\n'});
|
|
116
|
+
|
|
117
|
+
assert.equal(await MeetingsUtil.hasH264Codec(), true);
|
|
118
|
+
assert.calledOnce(mockPc.close);
|
|
119
|
+
|
|
120
|
+
delete global.window.RTCPeerConnection;
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
describe('when video/H264 reports UNKNOWN (falls back to RTCPeerConnection)', () => {
|
|
124
|
+
let mockPc;
|
|
125
|
+
|
|
126
|
+
beforeEach(() => {
|
|
127
|
+
isCapableOfReceivingVideoCodecStub
|
|
128
|
+
.withArgs('video/H264')
|
|
129
|
+
.returns(CapabilityState.UNKNOWN);
|
|
130
|
+
mockPc = {createOffer: sinon.stub(), close: sinon.stub()};
|
|
131
|
+
global.window.RTCPeerConnection = sinon.stub().returns(mockPc);
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
afterEach(() => {
|
|
135
|
+
delete global.window.RTCPeerConnection;
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
it('returns true when SDP contains H264', async () => {
|
|
139
|
+
mockPc.createOffer.resolves({sdp: 'v=0\r\na=rtpmap:96 H264/90000\r\n'});
|
|
140
|
+
|
|
141
|
+
assert.equal(await MeetingsUtil.hasH264Codec(), true);
|
|
142
|
+
assert.calledOnce(mockPc.close);
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
it('returns false when SDP does not contain H264', async () => {
|
|
146
|
+
mockPc.createOffer.resolves({sdp: 'v=0\r\na=rtpmap:96 VP8/90000\r\n'});
|
|
147
|
+
|
|
148
|
+
assert.equal(await MeetingsUtil.hasH264Codec(), false);
|
|
149
|
+
assert.calledOnce(mockPc.close);
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
it('returns false when SDP is undefined', async () => {
|
|
153
|
+
mockPc.createOffer.resolves({sdp: undefined});
|
|
154
|
+
|
|
155
|
+
assert.equal(await MeetingsUtil.hasH264Codec(), false);
|
|
156
|
+
assert.calledOnce(mockPc.close);
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
it('logs a warning and returns false when createOffer throws', async () => {
|
|
160
|
+
sinon.stub(LoggerProxy.logger, 'warn');
|
|
161
|
+
mockPc.createOffer.rejects(new Error('createOffer failed'));
|
|
162
|
+
|
|
163
|
+
assert.equal(await MeetingsUtil.hasH264Codec(), false);
|
|
164
|
+
assert.calledOnce(mockPc.close);
|
|
165
|
+
assert.calledWith(
|
|
166
|
+
LoggerProxy.logger.warn,
|
|
167
|
+
'Meetings:util#hasH264Codec --> Error creating peerConnection for H.264 test.'
|
|
168
|
+
);
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
it('logs a warning and returns false when RTCPeerConnection constructor throws', async () => {
|
|
172
|
+
sinon.stub(LoggerProxy.logger, 'warn');
|
|
173
|
+
global.window.RTCPeerConnection = sinon.stub().throws(new Error('no RTCPeerConnection'));
|
|
174
|
+
|
|
175
|
+
assert.equal(await MeetingsUtil.hasH264Codec(), false);
|
|
176
|
+
assert.calledWith(
|
|
177
|
+
LoggerProxy.logger.warn,
|
|
178
|
+
'Meetings:util#hasH264Codec --> Error creating peerConnection for H.264 test.'
|
|
179
|
+
);
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
describe('#getSiteName', () => {
|
|
185
|
+
it('gets the site name from a standard Webex site', () => {
|
|
186
|
+
assert.equal(MeetingsUtil.getSiteName('go.webex.com', multipartSitePrefixList), 'go');
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
it('gets the site name from a my Webex site', () => {
|
|
190
|
+
assert.equal(MeetingsUtil.getSiteName('go.my.webex.com', multipartSitePrefixList), 'go.my');
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
it('uses the configured multipart site prefix list', () => {
|
|
194
|
+
assert.equal(MeetingsUtil.getSiteName('go.custom.webex.com', ['.custom.']), 'go.custom');
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
it('falls back to the first label when the multipart site prefix list does not match', () => {
|
|
198
|
+
assert.equal(MeetingsUtil.getSiteName('go.my.webex.com', ['.custom.']), 'go');
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
it('returns null when the site is empty', () => {
|
|
202
|
+
assert.equal(MeetingsUtil.getSiteName('', multipartSitePrefixList), null);
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
|
|
78
206
|
describe('#getThisDevice', () => {
|
|
79
207
|
it('return null if no devices in self', () => {
|
|
80
208
|
const newLocus = {};
|
|
@@ -83,25 +211,28 @@ describe('plugin-meetings', () => {
|
|
|
83
211
|
it('return null if no matched device in self', () => {
|
|
84
212
|
const newLocus = {
|
|
85
213
|
self: {
|
|
86
|
-
devices: [{state: 'JOINED', url: '456'}]
|
|
87
|
-
}
|
|
214
|
+
devices: [{state: 'JOINED', url: '456'}],
|
|
215
|
+
},
|
|
88
216
|
};
|
|
89
217
|
assert.equal(MeetingsUtil.getThisDevice(newLocus, '123'), null);
|
|
90
218
|
});
|
|
91
219
|
it('return the device match with current device', () => {
|
|
92
220
|
const newLocus = {
|
|
93
221
|
self: {
|
|
94
|
-
devices: [{state: 'JOINED', url: '123'}]
|
|
95
|
-
}
|
|
222
|
+
devices: [{state: 'JOINED', url: '123'}],
|
|
223
|
+
},
|
|
96
224
|
};
|
|
97
|
-
assert.deepEqual(MeetingsUtil.getThisDevice(newLocus, '123'), {
|
|
98
|
-
|
|
225
|
+
assert.deepEqual(MeetingsUtil.getThisDevice(newLocus, '123'), {
|
|
226
|
+
state: 'JOINED',
|
|
227
|
+
url: '123',
|
|
228
|
+
});
|
|
229
|
+
});
|
|
99
230
|
});
|
|
100
231
|
|
|
101
232
|
describe('#isBreakoutLocusDTO', () => {
|
|
102
233
|
it('returns false is no breakout in locus.controls', () => {
|
|
103
234
|
const newLocus = {
|
|
104
|
-
controls: {}
|
|
235
|
+
controls: {},
|
|
105
236
|
};
|
|
106
237
|
|
|
107
238
|
assert.equal(MeetingsUtil.isBreakoutLocusDTO(newLocus), false);
|
|
@@ -128,6 +259,217 @@ describe('plugin-meetings', () => {
|
|
|
128
259
|
};
|
|
129
260
|
assert.equal(MeetingsUtil.isBreakoutLocusDTO(newLocus), false);
|
|
130
261
|
});
|
|
262
|
+
|
|
263
|
+
it('returns true if newLocus.info.isBreakout is true', () => {
|
|
264
|
+
const newLocus = {
|
|
265
|
+
info: {
|
|
266
|
+
isBreakout: true,
|
|
267
|
+
},
|
|
268
|
+
};
|
|
269
|
+
assert.equal(MeetingsUtil.isBreakoutLocusDTO(newLocus), true);
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
it('returns false if newLocus.info.isBreakout is false', () => {
|
|
273
|
+
const newLocus = {
|
|
274
|
+
info: {
|
|
275
|
+
isBreakout: false,
|
|
276
|
+
},
|
|
277
|
+
};
|
|
278
|
+
assert.equal(MeetingsUtil.isBreakoutLocusDTO(newLocus), false);
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
it('returns true if both sessionType is BREAKOUT and info.isBreakout is true', () => {
|
|
282
|
+
const newLocus = {
|
|
283
|
+
controls: {
|
|
284
|
+
breakout: {
|
|
285
|
+
sessionType: 'BREAKOUT',
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
info: {
|
|
289
|
+
isBreakout: true,
|
|
290
|
+
},
|
|
291
|
+
};
|
|
292
|
+
assert.equal(MeetingsUtil.isBreakoutLocusDTO(newLocus), true);
|
|
293
|
+
});
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
describe('#isMainAssociatedWithBreakout', () => {
|
|
297
|
+
it('returns true when breakout control url matches main locus breakout url', () => {
|
|
298
|
+
const mainLocus = {
|
|
299
|
+
url: 'main-locus-url',
|
|
300
|
+
controls: {
|
|
301
|
+
breakout: {
|
|
302
|
+
url: 'breakout-control-url',
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
};
|
|
306
|
+
const breakoutLocus = {
|
|
307
|
+
controls: {
|
|
308
|
+
breakout: {
|
|
309
|
+
url: 'breakout-control-url',
|
|
310
|
+
},
|
|
311
|
+
},
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
assert.equal(MeetingsUtil.isMainAssociatedWithBreakout(mainLocus, breakoutLocus), true);
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
it('returns true when breakout self device replaces the main locus url', () => {
|
|
318
|
+
const mainLocus = {
|
|
319
|
+
url: 'main-locus-url',
|
|
320
|
+
controls: {},
|
|
321
|
+
};
|
|
322
|
+
const breakoutLocus = {
|
|
323
|
+
controls: {
|
|
324
|
+
breakout: {
|
|
325
|
+
url: 'other-breakout-url',
|
|
326
|
+
},
|
|
327
|
+
},
|
|
328
|
+
self: {
|
|
329
|
+
deviceUrl: 'device-url-1',
|
|
330
|
+
devices: [
|
|
331
|
+
{
|
|
332
|
+
url: 'device-url-1',
|
|
333
|
+
replaces: [{locusUrl: 'main-locus-url'}],
|
|
334
|
+
},
|
|
335
|
+
],
|
|
336
|
+
},
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
assert.equal(MeetingsUtil.isMainAssociatedWithBreakout(mainLocus, breakoutLocus), true);
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
it('returns false when breakout locus is not associated with the main locus', () => {
|
|
343
|
+
const mainLocus = {
|
|
344
|
+
url: 'main-locus-url',
|
|
345
|
+
controls: {
|
|
346
|
+
breakout: {
|
|
347
|
+
url: 'breakout-control-url',
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
};
|
|
351
|
+
const breakoutLocus = {
|
|
352
|
+
controls: {
|
|
353
|
+
breakout: {
|
|
354
|
+
url: 'different-breakout-url',
|
|
355
|
+
},
|
|
356
|
+
},
|
|
357
|
+
self: {
|
|
358
|
+
deviceUrl: 'device-url-1',
|
|
359
|
+
devices: [
|
|
360
|
+
{
|
|
361
|
+
url: 'device-url-1',
|
|
362
|
+
replaces: [{locusUrl: 'another-main-locus-url'}],
|
|
363
|
+
},
|
|
364
|
+
],
|
|
365
|
+
},
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
assert.equal(MeetingsUtil.isMainAssociatedWithBreakout(mainLocus, breakoutLocus), false);
|
|
369
|
+
});
|
|
370
|
+
});
|
|
371
|
+
|
|
372
|
+
describe('#isWholeMeetingEnded', () => {
|
|
373
|
+
[
|
|
374
|
+
{
|
|
375
|
+
description: 'state is INACTIVE with no endMeetingReason',
|
|
376
|
+
fullState: {state: 'INACTIVE'},
|
|
377
|
+
expected: true,
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
description: 'state is INACTIVE with endMeetingReason OTHER',
|
|
381
|
+
fullState: {state: 'INACTIVE', endMeetingReason: 'SOME_OTHER_REASON'},
|
|
382
|
+
expected: true,
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
description: 'state is INACTIVE with endMeetingReason BREAKOUT_ENDED',
|
|
386
|
+
fullState: {state: 'INACTIVE', endMeetingReason: 'BREAKOUT_ENDED'},
|
|
387
|
+
expected: false,
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
description: 'state is not INACTIVE',
|
|
391
|
+
fullState: {state: 'ACTIVE', endMeetingReason: 'SOME_OTHER_REASON'},
|
|
392
|
+
expected: false,
|
|
393
|
+
},
|
|
394
|
+
].forEach(({description, fullState, expected}) => {
|
|
395
|
+
it(`returns ${expected} when ${description}`, () => {
|
|
396
|
+
assert.equal(MeetingsUtil.isWholeMeetingEnded(fullState), expected);
|
|
397
|
+
});
|
|
398
|
+
});
|
|
399
|
+
});
|
|
400
|
+
|
|
401
|
+
describe('#isSelfMovedOrBreakoutEnded', () => {
|
|
402
|
+
[
|
|
403
|
+
{description: 'locus is undefined', locus: undefined, expected: false},
|
|
404
|
+
{
|
|
405
|
+
description: 'self state is JOINED',
|
|
406
|
+
locus: {self: {state: 'JOINED', reason: 'OTHER'}},
|
|
407
|
+
expected: false,
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
description: 'self state is LEFT with reason MOVED',
|
|
411
|
+
locus: {self: {state: 'LEFT', reason: 'MOVED'}},
|
|
412
|
+
expected: true,
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
description: 'fullState is INACTIVE with BREAKOUT_ENDED',
|
|
416
|
+
locus: {
|
|
417
|
+
self: {state: 'LEFT', reason: 'OTHER'},
|
|
418
|
+
fullState: {state: 'INACTIVE', endMeetingReason: 'BREAKOUT_ENDED'},
|
|
419
|
+
},
|
|
420
|
+
expected: true,
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
description: 'fullState is INACTIVE with different endMeetingReason',
|
|
424
|
+
locus: {
|
|
425
|
+
self: {state: 'LEFT', reason: 'OTHER'},
|
|
426
|
+
fullState: {state: 'INACTIVE', endMeetingReason: 'SOME_OTHER_REASON'},
|
|
427
|
+
},
|
|
428
|
+
expected: false,
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
description: 'fullState is missing',
|
|
432
|
+
locus: {self: {state: 'LEFT', reason: 'OTHER'}},
|
|
433
|
+
expected: false,
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
description: 'endMeetingReason is missing',
|
|
437
|
+
locus: {self: {state: 'LEFT', reason: 'OTHER'}, fullState: {state: 'INACTIVE'}},
|
|
438
|
+
expected: false,
|
|
439
|
+
},
|
|
440
|
+
].forEach(({description, locus, expected}) => {
|
|
441
|
+
it(`returns ${expected} when ${description}`, () => {
|
|
442
|
+
assert.equal(MeetingsUtil.isSelfMovedOrBreakoutEnded(locus), expected);
|
|
443
|
+
});
|
|
444
|
+
});
|
|
445
|
+
});
|
|
446
|
+
|
|
447
|
+
describe('#isOneOnOneCall', () => {
|
|
448
|
+
[
|
|
449
|
+
{description: 'locus is undefined', locus: undefined, expected: false},
|
|
450
|
+
{description: 'fullState is missing', locus: {}, expected: false},
|
|
451
|
+
{description: 'fullState.type is missing', locus: {fullState: {}}, expected: false},
|
|
452
|
+
{description: 'fullState.type is CALL', locus: {fullState: {type: 'CALL'}}, expected: true},
|
|
453
|
+
{
|
|
454
|
+
description: 'fullState.type is SIP_BRIDGE',
|
|
455
|
+
locus: {fullState: {type: 'SIP_BRIDGE'}},
|
|
456
|
+
expected: true,
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
description: 'fullState.type is SPACE_SHARE',
|
|
460
|
+
locus: {fullState: {type: 'SPACE_SHARE'}},
|
|
461
|
+
expected: true,
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
description: 'fullState.type is MEETING',
|
|
465
|
+
locus: {fullState: {type: 'MEETING'}},
|
|
466
|
+
expected: false,
|
|
467
|
+
},
|
|
468
|
+
].forEach(({description, locus, expected}) => {
|
|
469
|
+
it(`returns ${expected} when ${description}`, () => {
|
|
470
|
+
assert.equal(MeetingsUtil.isOneOnOneCall(locus), expected);
|
|
471
|
+
});
|
|
472
|
+
});
|
|
131
473
|
});
|
|
132
474
|
|
|
133
475
|
describe('#joinedOnThisDevice', () => {
|
|
@@ -138,11 +480,11 @@ describe('plugin-meetings', () => {
|
|
|
138
480
|
it('return true if joined on this device', () => {
|
|
139
481
|
const newLocus = {
|
|
140
482
|
self: {
|
|
141
|
-
devices: [{state: 'JOINED', correlationId: '111', url: '123'}]
|
|
142
|
-
}
|
|
483
|
+
devices: [{state: 'JOINED', correlationId: '111', url: '123'}],
|
|
484
|
+
},
|
|
143
485
|
};
|
|
144
486
|
const meeting = {
|
|
145
|
-
correlationId: '111'
|
|
487
|
+
correlationId: '111',
|
|
146
488
|
};
|
|
147
489
|
|
|
148
490
|
assert.equal(MeetingsUtil.joinedOnThisDevice(meeting, newLocus, '123'), true);
|
|
@@ -150,18 +492,18 @@ describe('plugin-meetings', () => {
|
|
|
150
492
|
it('return true if selfMoved on this device', () => {
|
|
151
493
|
const newLocus = {
|
|
152
494
|
self: {
|
|
153
|
-
devices: [{state: 'LEFT', reason: 'MOVED', correlationId: '111', url: '123'}]
|
|
154
|
-
}
|
|
495
|
+
devices: [{state: 'LEFT', reason: 'MOVED', correlationId: '111', url: '123'}],
|
|
496
|
+
},
|
|
155
497
|
};
|
|
156
498
|
const meeting = {
|
|
157
|
-
correlationId: '111'
|
|
499
|
+
correlationId: '111',
|
|
158
500
|
};
|
|
159
501
|
|
|
160
502
|
assert.equal(MeetingsUtil.joinedOnThisDevice(meeting, newLocus, '123'), true);
|
|
161
503
|
});
|
|
162
504
|
});
|
|
163
505
|
|
|
164
|
-
describe(
|
|
506
|
+
describe('#handleRoapMercury', () => {
|
|
165
507
|
let envelope;
|
|
166
508
|
let meetingCollection;
|
|
167
509
|
let roapMessageReceived;
|
|
@@ -176,67 +518,74 @@ describe('plugin-meetings', () => {
|
|
|
176
518
|
id: 'meeting-id',
|
|
177
519
|
roapMessageReceived,
|
|
178
520
|
roap: {
|
|
179
|
-
turnDiscovery: {handleTurnDiscoveryResponse}
|
|
180
|
-
}
|
|
521
|
+
turnDiscovery: {handleTurnDiscoveryResponse},
|
|
522
|
+
},
|
|
181
523
|
};
|
|
182
524
|
envelope = {
|
|
183
525
|
data: {
|
|
184
|
-
message:{
|
|
185
|
-
seq:
|
|
526
|
+
message: {
|
|
527
|
+
seq: 'seq',
|
|
186
528
|
messageType: 'messageType',
|
|
187
529
|
tieBreaker: 'tieBreaker',
|
|
188
530
|
errorType: 'errorType',
|
|
189
531
|
errorCause: 'errorCause',
|
|
190
|
-
sdps: [{id:'sdp-1'}]
|
|
532
|
+
sdps: [{id: 'sdp-1'}],
|
|
191
533
|
},
|
|
192
534
|
correlationId: 'correlationId',
|
|
193
535
|
eventType: 'locus.message.roap',
|
|
194
|
-
}
|
|
536
|
+
},
|
|
195
537
|
};
|
|
196
538
|
meetingCollection = {
|
|
197
|
-
getByKey: () => meeting
|
|
539
|
+
getByKey: () => meeting,
|
|
198
540
|
};
|
|
199
541
|
});
|
|
200
542
|
|
|
201
543
|
it('it sends the correct behaviour metric', () => {
|
|
202
544
|
MeetingsUtil.handleRoapMercury(envelope, meetingCollection);
|
|
203
|
-
assert.calledWith(
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
545
|
+
assert.calledWith(
|
|
546
|
+
Metrics.sendBehavioralMetric,
|
|
547
|
+
BEHAVIORAL_METRICS.ROAP_MERCURY_EVENT_RECEIVED,
|
|
548
|
+
{
|
|
549
|
+
correlation_id: 'correlationId',
|
|
550
|
+
seq: 'seq',
|
|
551
|
+
message_type: 'messageType',
|
|
552
|
+
error_type: 'errorType',
|
|
553
|
+
error_cause: 'errorCause',
|
|
554
|
+
}
|
|
555
|
+
);
|
|
210
556
|
assert.calledWith(roapMessageReceived, {
|
|
211
|
-
seq:
|
|
557
|
+
seq: 'seq',
|
|
212
558
|
messageType: 'messageType',
|
|
213
559
|
errorType: 'errorType',
|
|
214
560
|
tieBreaker: 'tieBreaker',
|
|
215
561
|
errorCause: 'errorCause',
|
|
216
|
-
sdp: {id:'sdp-1'}
|
|
217
|
-
})
|
|
218
|
-
|
|
562
|
+
sdp: {id: 'sdp-1'},
|
|
563
|
+
});
|
|
219
564
|
});
|
|
220
565
|
|
|
221
566
|
it('calls handleTurnDiscoveryResponse for TURN_DISCOVERY_RESPONSE', () => {
|
|
222
567
|
envelope.data.message.messageType = 'TURN_DISCOVERY_RESPONSE';
|
|
223
568
|
delete envelope.data.message.sdps;
|
|
224
569
|
MeetingsUtil.handleRoapMercury(envelope, meetingCollection);
|
|
225
|
-
assert.calledWith(
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
570
|
+
assert.calledWith(
|
|
571
|
+
meeting.roap.turnDiscovery.handleTurnDiscoveryResponse,
|
|
572
|
+
{
|
|
573
|
+
seq: 'seq',
|
|
574
|
+
messageType: 'TURN_DISCOVERY_RESPONSE',
|
|
575
|
+
errorType: 'errorType',
|
|
576
|
+
tieBreaker: 'tieBreaker',
|
|
577
|
+
errorCause: 'errorCause',
|
|
578
|
+
},
|
|
579
|
+
'from mercury'
|
|
580
|
+
);
|
|
232
581
|
});
|
|
233
|
-
})
|
|
582
|
+
});
|
|
234
583
|
});
|
|
235
584
|
|
|
236
585
|
describe('#isValidBreakoutLocus', () => {
|
|
237
586
|
it('returns false if is not breakout locus', () => {
|
|
238
587
|
const newLocus = {
|
|
239
|
-
controls: {}
|
|
588
|
+
controls: {},
|
|
240
589
|
};
|
|
241
590
|
|
|
242
591
|
assert.equal(MeetingsUtil.isValidBreakoutLocus(newLocus), false);
|
|
@@ -250,8 +599,8 @@ describe('plugin-meetings', () => {
|
|
|
250
599
|
},
|
|
251
600
|
},
|
|
252
601
|
fullState: {
|
|
253
|
-
state: 'INACTIVE'
|
|
254
|
-
}
|
|
602
|
+
state: 'INACTIVE',
|
|
603
|
+
},
|
|
255
604
|
};
|
|
256
605
|
assert.equal(MeetingsUtil.isValidBreakoutLocus(newLocus), false);
|
|
257
606
|
});
|
|
@@ -264,11 +613,11 @@ describe('plugin-meetings', () => {
|
|
|
264
613
|
},
|
|
265
614
|
},
|
|
266
615
|
fullState: {
|
|
267
|
-
state: 'ACTIVE'
|
|
616
|
+
state: 'ACTIVE',
|
|
268
617
|
},
|
|
269
618
|
self: {
|
|
270
|
-
state: 'LEFT'
|
|
271
|
-
}
|
|
619
|
+
state: 'LEFT',
|
|
620
|
+
},
|
|
272
621
|
};
|
|
273
622
|
assert.equal(MeetingsUtil.isValidBreakoutLocus(newLocus), false);
|
|
274
623
|
});
|
|
@@ -281,11 +630,11 @@ describe('plugin-meetings', () => {
|
|
|
281
630
|
},
|
|
282
631
|
},
|
|
283
632
|
fullState: {
|
|
284
|
-
state: 'ACTIVE'
|
|
633
|
+
state: 'ACTIVE',
|
|
285
634
|
},
|
|
286
635
|
self: {
|
|
287
|
-
state: 'JOINED'
|
|
288
|
-
}
|
|
636
|
+
state: 'JOINED',
|
|
637
|
+
},
|
|
289
638
|
};
|
|
290
639
|
assert.equal(MeetingsUtil.isValidBreakoutLocus(newLocus), true);
|
|
291
640
|
});
|
|
@@ -293,10 +642,12 @@ describe('plugin-meetings', () => {
|
|
|
293
642
|
|
|
294
643
|
describe('#getMediaServer', () => {
|
|
295
644
|
it('returns the contents of o-line lower cased', () => {
|
|
296
|
-
const sdp1 =
|
|
645
|
+
const sdp1 =
|
|
646
|
+
'v=0\r\no=homer 0 1 IN IP4 23.89.67.81\r\ns=-\r\nc=IN IP4 23.89.67.81\r\nb=TIAS:128000\r\nt=0 0\r\na=ice-lite\r\n';
|
|
297
647
|
assert.equal(MeetingsUtil.getMediaServer(sdp1), 'homer');
|
|
298
648
|
|
|
299
|
-
const sdp2 =
|
|
649
|
+
const sdp2 =
|
|
650
|
+
'v=0\r\no=HOMER 0 1 IN IP4 23.89.67.81\r\ns=-\r\nc=IN IP4 23.89.67.81\r\nb=TIAS:128000\r\nt=0 0\r\na=ice-lite\r\n';
|
|
300
651
|
assert.equal(MeetingsUtil.getMediaServer(sdp2), 'homer');
|
|
301
652
|
});
|
|
302
653
|
});
|
|
@@ -59,6 +59,13 @@ describe('member', () => {
|
|
|
59
59
|
assert.calledOnceWithExactly(MemberUtil.isPresenterAssignmentProhibited, participant);
|
|
60
60
|
});
|
|
61
61
|
|
|
62
|
+
it('checks that processParticipant calls isAttendeeAssignmentProhibited', () => {
|
|
63
|
+
sinon.spy(MemberUtil, 'isAttendeeAssignmentProhibited');
|
|
64
|
+
member.processParticipant(participant);
|
|
65
|
+
|
|
66
|
+
assert.calledOnceWithExactly(MemberUtil.isAttendeeAssignmentProhibited, participant);
|
|
67
|
+
});
|
|
68
|
+
|
|
62
69
|
it('checks that processParticipant calls canApproveAIEnablement', () => {
|
|
63
70
|
sinon.spy(MemberUtil, 'canApproveAIEnablement');
|
|
64
71
|
member.processParticipant(participant);
|