@webex/plugin-meetings 3.3.1 → 3.4.0
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 +7 -2
- package/dist/breakouts/index.js.map +1 -1
- package/dist/constants.js +11 -4
- package/dist/constants.js.map +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/selfUtils.js +0 -5
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/media/MediaConnectionAwaiter.js +70 -15
- package/dist/media/MediaConnectionAwaiter.js.map +1 -1
- package/dist/media/index.js +12 -0
- package/dist/media/index.js.map +1 -1
- package/dist/meeting/connectionStateHandler.js +67 -0
- package/dist/meeting/connectionStateHandler.js.map +1 -0
- package/dist/meeting/index.js +552 -357
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/locusMediaRequest.js +7 -0
- package/dist/meeting/locusMediaRequest.js.map +1 -1
- package/dist/meeting/muteState.js +6 -1
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/util.js +1 -0
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/index.js +4 -4
- package/dist/meeting-info/index.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/meeting-info/util.js +17 -17
- package/dist/meeting-info/util.js.map +1 -1
- package/dist/meeting-info/utilv2.js +16 -16
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/collection.js +1 -1
- package/dist/meetings/collection.js.map +1 -1
- package/dist/meetings/index.js +37 -33
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/meetings.types.js +8 -0
- package/dist/meetings/meetings.types.js.map +1 -1
- package/dist/meetings/util.js +3 -2
- package/dist/meetings/util.js.map +1 -1
- package/dist/metrics/constants.js +2 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/metrics/index.js +57 -0
- package/dist/metrics/index.js.map +1 -1
- package/dist/personal-meeting-room/index.js +1 -1
- package/dist/personal-meeting-room/index.js.map +1 -1
- package/dist/reachability/clusterReachability.js +108 -53
- package/dist/reachability/clusterReachability.js.map +1 -1
- package/dist/reachability/index.js +415 -56
- package/dist/reachability/index.js.map +1 -1
- package/dist/types/constants.d.ts +11 -3
- package/dist/types/media/MediaConnectionAwaiter.d.ts +24 -4
- package/dist/types/meeting/connectionStateHandler.d.ts +30 -0
- package/dist/types/meeting/index.d.ts +27 -7
- package/dist/types/meeting/locusMediaRequest.d.ts +2 -0
- package/dist/types/meeting-info/index.d.ts +3 -2
- package/dist/types/meeting-info/meeting-info-v2.d.ts +3 -2
- package/dist/types/meeting-info/util.d.ts +5 -4
- package/dist/types/meeting-info/utilv2.d.ts +3 -2
- package/dist/types/meetings/collection.d.ts +3 -2
- package/dist/types/meetings/index.d.ts +4 -3
- package/dist/types/meetings/meetings.types.d.ts +9 -0
- package/dist/types/metrics/constants.d.ts +1 -0
- package/dist/types/metrics/index.d.ts +15 -0
- package/dist/types/reachability/clusterReachability.d.ts +31 -3
- package/dist/types/reachability/index.d.ts +93 -2
- package/dist/webinar/index.js +1 -1
- package/package.json +23 -23
- package/src/breakouts/index.ts +7 -1
- package/src/constants.ts +13 -17
- package/src/locus-info/selfUtils.ts +0 -5
- package/src/media/MediaConnectionAwaiter.ts +89 -14
- package/src/media/index.ts +13 -0
- package/src/meeting/connectionStateHandler.ts +65 -0
- package/src/meeting/index.ts +526 -292
- package/src/meeting/locusMediaRequest.ts +5 -0
- package/src/meeting/muteState.ts +6 -1
- package/src/meeting/util.ts +1 -0
- package/src/meeting-info/index.ts +9 -6
- package/src/meeting-info/meeting-info-v2.ts +4 -4
- package/src/meeting-info/util.ts +23 -28
- package/src/meeting-info/utilv2.ts +18 -24
- package/src/meetings/collection.ts +3 -3
- package/src/meetings/index.ts +39 -40
- package/src/meetings/meetings.types.ts +11 -0
- package/src/meetings/util.ts +5 -4
- package/src/metrics/constants.ts +1 -0
- package/src/metrics/index.ts +44 -0
- package/src/personal-meeting-room/index.ts +2 -2
- package/src/reachability/clusterReachability.ts +86 -25
- package/src/reachability/index.ts +316 -27
- package/test/unit/spec/breakouts/index.ts +51 -32
- package/test/unit/spec/locus-info/selfUtils.js +25 -23
- package/test/unit/spec/media/MediaConnectionAwaiter.ts +131 -32
- package/test/unit/spec/media/index.ts +42 -27
- package/test/unit/spec/meeting/connectionStateHandler.ts +102 -0
- package/test/unit/spec/meeting/index.js +758 -179
- package/test/unit/spec/meeting/locusMediaRequest.ts +7 -0
- package/test/unit/spec/meeting/muteState.js +24 -0
- package/test/unit/spec/meeting-info/index.js +4 -4
- package/test/unit/spec/meeting-info/meetinginfov2.js +24 -28
- package/test/unit/spec/meeting-info/request.js +2 -2
- package/test/unit/spec/meeting-info/utilv2.js +41 -49
- package/test/unit/spec/meetings/index.js +14 -0
- package/test/unit/spec/metrics/index.js +126 -0
- package/test/unit/spec/multistream/mediaRequestManager.ts +2 -2
- package/test/unit/spec/personal-meeting-room/personal-meeting-room.js +2 -2
- package/test/unit/spec/reachability/clusterReachability.ts +116 -22
- package/test/unit/spec/reachability/index.ts +1153 -84
- package/test/unit/spec/rtcMetrics/index.ts +1 -0
- package/dist/mediaQualityMetrics/config.js +0 -321
- package/dist/mediaQualityMetrics/config.js.map +0 -1
- package/dist/statsAnalyzer/global.js +0 -44
- package/dist/statsAnalyzer/global.js.map +0 -1
- package/dist/statsAnalyzer/index.js +0 -1072
- package/dist/statsAnalyzer/index.js.map +0 -1
- package/dist/statsAnalyzer/mqaUtil.js +0 -368
- package/dist/statsAnalyzer/mqaUtil.js.map +0 -1
- package/dist/types/mediaQualityMetrics/config.d.ts +0 -247
- package/dist/types/statsAnalyzer/global.d.ts +0 -36
- package/dist/types/statsAnalyzer/index.d.ts +0 -217
- package/dist/types/statsAnalyzer/mqaUtil.d.ts +0 -48
- package/src/mediaQualityMetrics/config.ts +0 -255
- package/src/statsAnalyzer/global.ts +0 -37
- package/src/statsAnalyzer/index.ts +0 -1318
- package/src/statsAnalyzer/mqaUtil.ts +0 -463
- package/test/unit/spec/stats-analyzer/index.js +0 -1819
package/src/metrics/constants.ts
CHANGED
|
@@ -69,6 +69,7 @@ const BEHAVIORAL_METRICS = {
|
|
|
69
69
|
ROAP_OFFER_TO_ANSWER_LATENCY: 'js_sdk_roap_offer_to_answer_latency',
|
|
70
70
|
ROAP_HTTP_RESPONSE_MISSING: 'js_sdk_roap_http_response_missing',
|
|
71
71
|
TURN_DISCOVERY_REQUIRES_OK: 'js_sdk_turn_discovery_requires_ok',
|
|
72
|
+
REACHABILITY_COMPLETED: 'js_sdk_reachability_completed',
|
|
72
73
|
};
|
|
73
74
|
|
|
74
75
|
export {BEHAVIORAL_METRICS as default};
|
package/src/metrics/index.ts
CHANGED
|
@@ -65,6 +65,50 @@ class Metrics {
|
|
|
65
65
|
tags: metricTags,
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Flattens an object into one that has no nested properties. Each level of nesting is represented
|
|
71
|
+
* by "_" in the flattened object property names.
|
|
72
|
+
* This function is needed, because Amplitude doesn't allow passing nested objects as metricFields.
|
|
73
|
+
* Use this function for metricFields before calling sendBehavioralMetric() if you want to send
|
|
74
|
+
* nested objects in your metrics.
|
|
75
|
+
*
|
|
76
|
+
* If the function is called with a literal, it returns an object with a single property "value"
|
|
77
|
+
* and the literal value in it.
|
|
78
|
+
*
|
|
79
|
+
* @param {any} payload object you want to flatten
|
|
80
|
+
* @param {string} prefix string prefix prepended to any property names in flatten object
|
|
81
|
+
* @returns {Object}
|
|
82
|
+
*/
|
|
83
|
+
prepareMetricFields(payload: any = {}, prefix = '') {
|
|
84
|
+
let output = {};
|
|
85
|
+
|
|
86
|
+
if (Array.isArray(payload)) {
|
|
87
|
+
payload.forEach((item, index) => {
|
|
88
|
+
const propName = prefix.length > 0 ? `${prefix}_${index}` : `${index}`;
|
|
89
|
+
|
|
90
|
+
output = {...output, ...this.prepareMetricFields(item, propName)};
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
return output;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (typeof payload !== 'object' || payload === null) {
|
|
97
|
+
if (prefix.length > 0) {
|
|
98
|
+
return {[prefix]: payload};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return {value: payload};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
Object.entries(payload).forEach(([key, value]) => {
|
|
105
|
+
const propName = prefix.length > 0 ? `${prefix}_${key}` : key;
|
|
106
|
+
|
|
107
|
+
output = {...output, ...this.prepareMetricFields(value, propName)};
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
return output;
|
|
111
|
+
}
|
|
68
112
|
}
|
|
69
113
|
|
|
70
114
|
// Export Metrics singleton ---------------------------------------------------
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @ts-ignore
|
|
2
2
|
import {StatelessWebexPlugin} from '@webex/webex-core';
|
|
3
3
|
|
|
4
|
-
import {MEETINGS,
|
|
4
|
+
import {MEETINGS, DESTINATION_TYPE} from '../constants';
|
|
5
5
|
import ParameterError from '../common/errors/parameter';
|
|
6
6
|
|
|
7
7
|
import PersonalMeetingRoomRequest from './request';
|
|
@@ -141,7 +141,7 @@ export default class PersonalMeetingRoom extends StatelessWebexPlugin {
|
|
|
141
141
|
*/
|
|
142
142
|
public get() {
|
|
143
143
|
const options = {
|
|
144
|
-
type:
|
|
144
|
+
type: DESTINATION_TYPE.PERSONAL_ROOM,
|
|
145
145
|
};
|
|
146
146
|
|
|
147
147
|
return this.meetingInfo.fetchMeetingInfo(options).then((pmr) => {
|
|
@@ -3,11 +3,9 @@ import {Defer} from '@webex/common';
|
|
|
3
3
|
import LoggerProxy from '../common/logs/logger-proxy';
|
|
4
4
|
import {ClusterNode} from './request';
|
|
5
5
|
import {convertStunUrlToTurn, convertStunUrlToTurnTls} from './util';
|
|
6
|
+
import EventsScope from '../common/events/events-scope';
|
|
6
7
|
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
const DEFAULT_TIMEOUT = 3000;
|
|
10
|
-
const VIDEO_MESH_TIMEOUT = 1000;
|
|
8
|
+
import {CONNECTION_STATE, Enum, ICE_GATHERING_STATE} from '../constants';
|
|
11
9
|
|
|
12
10
|
// result for a specific transport protocol (like udp or tcp)
|
|
13
11
|
export type TransportResult = {
|
|
@@ -23,10 +21,32 @@ export type ClusterReachabilityResult = {
|
|
|
23
21
|
xtls: TransportResult;
|
|
24
22
|
};
|
|
25
23
|
|
|
24
|
+
// data for the Events.resultReady event
|
|
25
|
+
export type ResultEventData = {
|
|
26
|
+
protocol: 'udp' | 'tcp' | 'xtls';
|
|
27
|
+
result: 'reachable' | 'unreachable' | 'untested';
|
|
28
|
+
latencyInMilliseconds: number; // amount of time it took to get the ICE candidate
|
|
29
|
+
clientMediaIPs?: string[];
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
// data for the Events.clientMediaIpsUpdated event
|
|
33
|
+
export type ClientMediaIpsUpdatedEventData = {
|
|
34
|
+
protocol: 'udp' | 'tcp' | 'xtls';
|
|
35
|
+
clientMediaIPs: string[];
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const Events = {
|
|
39
|
+
resultReady: 'resultReady', // emitted when a cluster is reached successfully using specific protocol
|
|
40
|
+
clientMediaIpsUpdated: 'clientMediaIpsUpdated', // emitted when more public IPs are found after resultReady was already sent for a given protocol
|
|
41
|
+
} as const;
|
|
42
|
+
|
|
43
|
+
export type Events = Enum<typeof Events>;
|
|
44
|
+
|
|
26
45
|
/**
|
|
27
46
|
* A class that handles reachability checks for a single cluster.
|
|
47
|
+
* It emits events from Events enum
|
|
28
48
|
*/
|
|
29
|
-
export class ClusterReachability {
|
|
49
|
+
export class ClusterReachability extends EventsScope {
|
|
30
50
|
private numUdpUrls: number;
|
|
31
51
|
private numTcpUrls: number;
|
|
32
52
|
private numXTlsUrls: number;
|
|
@@ -43,6 +63,7 @@ export class ClusterReachability {
|
|
|
43
63
|
* @param {ClusterNode} clusterInfo information about the media cluster
|
|
44
64
|
*/
|
|
45
65
|
constructor(name: string, clusterInfo: ClusterNode) {
|
|
66
|
+
super();
|
|
46
67
|
this.name = name;
|
|
47
68
|
this.isVideoMesh = clusterInfo.isVideoMesh;
|
|
48
69
|
this.numUdpUrls = clusterInfo.udp.length;
|
|
@@ -162,23 +183,54 @@ export class ClusterReachability {
|
|
|
162
183
|
this.defer.resolve();
|
|
163
184
|
}
|
|
164
185
|
|
|
186
|
+
/**
|
|
187
|
+
* Aborts the cluster reachability checks by closing the peer connection
|
|
188
|
+
*
|
|
189
|
+
* @returns {void}
|
|
190
|
+
*/
|
|
191
|
+
public abort() {
|
|
192
|
+
const {CLOSED} = CONNECTION_STATE;
|
|
193
|
+
|
|
194
|
+
if (this.pc.connectionState !== CLOSED) {
|
|
195
|
+
this.closePeerConnection();
|
|
196
|
+
this.finishReachabilityCheck();
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
165
200
|
/**
|
|
166
201
|
* Adds public IP (client media IPs)
|
|
167
202
|
* @param {string} protocol
|
|
168
203
|
* @param {string} publicIP
|
|
169
204
|
* @returns {void}
|
|
170
205
|
*/
|
|
171
|
-
private addPublicIP(protocol: 'udp' | 'tcp', publicIP?: string | null) {
|
|
206
|
+
private addPublicIP(protocol: 'udp' | 'tcp' | 'xtls', publicIP?: string | null) {
|
|
172
207
|
const result = this.result[protocol];
|
|
173
208
|
|
|
174
209
|
if (publicIP) {
|
|
210
|
+
let ipAdded = false;
|
|
211
|
+
|
|
175
212
|
if (result.clientMediaIPs) {
|
|
176
213
|
if (!result.clientMediaIPs.includes(publicIP)) {
|
|
177
214
|
result.clientMediaIPs.push(publicIP);
|
|
215
|
+
ipAdded = true;
|
|
178
216
|
}
|
|
179
217
|
} else {
|
|
180
218
|
result.clientMediaIPs = [publicIP];
|
|
219
|
+
ipAdded = true;
|
|
181
220
|
}
|
|
221
|
+
|
|
222
|
+
if (ipAdded)
|
|
223
|
+
this.emit(
|
|
224
|
+
{
|
|
225
|
+
file: 'clusterReachability',
|
|
226
|
+
function: 'addPublicIP',
|
|
227
|
+
},
|
|
228
|
+
Events.clientMediaIpsUpdated,
|
|
229
|
+
{
|
|
230
|
+
protocol,
|
|
231
|
+
clientMediaIPs: result.clientMediaIPs,
|
|
232
|
+
}
|
|
233
|
+
);
|
|
182
234
|
}
|
|
183
235
|
}
|
|
184
236
|
|
|
@@ -211,22 +263,43 @@ export class ClusterReachability {
|
|
|
211
263
|
}
|
|
212
264
|
|
|
213
265
|
/**
|
|
214
|
-
*
|
|
266
|
+
* Saves the latency in the result for the given protocol and marks it as reachable,
|
|
267
|
+
* emits the "resultReady" event if this is the first result for that protocol,
|
|
268
|
+
* emits the "clientMediaIpsUpdated" event if we already had a result and only found
|
|
269
|
+
* a new client IP
|
|
215
270
|
*
|
|
216
271
|
* @param {string} protocol
|
|
217
272
|
* @param {number} latency
|
|
273
|
+
* @param {string|null} [publicIp]
|
|
218
274
|
* @returns {void}
|
|
219
275
|
*/
|
|
220
|
-
private
|
|
276
|
+
private saveResult(protocol: 'udp' | 'tcp' | 'xtls', latency: number, publicIp?: string | null) {
|
|
221
277
|
const result = this.result[protocol];
|
|
222
278
|
|
|
223
279
|
if (result.latencyInMilliseconds === undefined) {
|
|
224
280
|
LoggerProxy.logger.log(
|
|
225
281
|
// @ts-ignore
|
|
226
|
-
`Reachability:index#
|
|
282
|
+
`Reachability:index#saveResult --> Successfully reached ${this.name} over ${protocol}: ${latency}ms`
|
|
227
283
|
);
|
|
228
284
|
result.latencyInMilliseconds = latency;
|
|
229
285
|
result.result = 'reachable';
|
|
286
|
+
if (publicIp) {
|
|
287
|
+
result.clientMediaIPs = [publicIp];
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
this.emit(
|
|
291
|
+
{
|
|
292
|
+
file: 'clusterReachability',
|
|
293
|
+
function: 'saveResult',
|
|
294
|
+
},
|
|
295
|
+
Events.resultReady,
|
|
296
|
+
{
|
|
297
|
+
protocol,
|
|
298
|
+
...result,
|
|
299
|
+
}
|
|
300
|
+
);
|
|
301
|
+
} else {
|
|
302
|
+
this.addPublicIP(protocol, publicIp);
|
|
230
303
|
}
|
|
231
304
|
}
|
|
232
305
|
|
|
@@ -243,15 +316,16 @@ export class ClusterReachability {
|
|
|
243
316
|
RELAY: 'relay',
|
|
244
317
|
};
|
|
245
318
|
|
|
319
|
+
const latencyInMilliseconds = this.getElapsedTime();
|
|
320
|
+
|
|
246
321
|
if (e.candidate) {
|
|
247
322
|
if (e.candidate.type === CANDIDATE_TYPES.SERVER_REFLEXIVE) {
|
|
248
|
-
this.
|
|
249
|
-
this.addPublicIP('udp', e.candidate.address);
|
|
323
|
+
this.saveResult('udp', latencyInMilliseconds, e.candidate.address);
|
|
250
324
|
}
|
|
251
325
|
|
|
252
326
|
if (e.candidate.type === CANDIDATE_TYPES.RELAY) {
|
|
253
327
|
const protocol = e.candidate.port === TURN_TLS_PORT ? 'xtls' : 'tcp';
|
|
254
|
-
this.
|
|
328
|
+
this.saveResult(protocol, latencyInMilliseconds);
|
|
255
329
|
// we don't add public IP for TCP, because in the case of relay candidates
|
|
256
330
|
// e.candidate.address is the TURN server address, not the client's public IP
|
|
257
331
|
}
|
|
@@ -314,22 +388,9 @@ export class ClusterReachability {
|
|
|
314
388
|
* @returns {Promise} promise that's resolved once reachability checks for this cluster are completed or timeout is reached
|
|
315
389
|
*/
|
|
316
390
|
private gatherIceCandidates() {
|
|
317
|
-
const timeout = this.isVideoMesh ? VIDEO_MESH_TIMEOUT : DEFAULT_TIMEOUT;
|
|
318
|
-
|
|
319
391
|
this.registerIceGatheringStateChangeListener();
|
|
320
392
|
this.registerIceCandidateListener();
|
|
321
393
|
|
|
322
|
-
// Set maximum timeout
|
|
323
|
-
setTimeout(() => {
|
|
324
|
-
const {CLOSED} = CONNECTION_STATE;
|
|
325
|
-
|
|
326
|
-
// Close any open peerConnections
|
|
327
|
-
if (this.pc.connectionState !== CLOSED) {
|
|
328
|
-
this.closePeerConnection();
|
|
329
|
-
this.finishReachabilityCheck();
|
|
330
|
-
}
|
|
331
|
-
}, timeout);
|
|
332
|
-
|
|
333
394
|
return this.defer.promise;
|
|
334
395
|
}
|
|
335
396
|
}
|