@webex/plugin-meetings 3.0.0 → 3.1.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.
Files changed (138) hide show
  1. package/dist/breakouts/breakout.js +1 -1
  2. package/dist/breakouts/index.js +1 -1
  3. package/dist/config.d.ts +1 -0
  4. package/dist/config.js +2 -1
  5. package/dist/config.js.map +1 -1
  6. package/dist/constants.d.ts +5 -4
  7. package/dist/constants.js +8 -4
  8. package/dist/constants.js.map +1 -1
  9. package/dist/index.d.ts +1 -1
  10. package/dist/index.js +6 -0
  11. package/dist/index.js.map +1 -1
  12. package/dist/interpretation/index.js +16 -2
  13. package/dist/interpretation/index.js.map +1 -1
  14. package/dist/interpretation/siLanguage.js +1 -1
  15. package/dist/locus-info/mediaSharesUtils.js +15 -1
  16. package/dist/locus-info/mediaSharesUtils.js.map +1 -1
  17. package/dist/locus-info/selfUtils.js +5 -0
  18. package/dist/locus-info/selfUtils.js.map +1 -1
  19. package/dist/media/MediaConnectionAwaiter.d.ts +61 -0
  20. package/dist/media/MediaConnectionAwaiter.js +163 -0
  21. package/dist/media/MediaConnectionAwaiter.js.map +1 -0
  22. package/dist/media/index.js +4 -1
  23. package/dist/media/index.js.map +1 -1
  24. package/dist/media/properties.js +4 -24
  25. package/dist/media/properties.js.map +1 -1
  26. package/dist/meeting/index.d.ts +26 -7
  27. package/dist/meeting/index.js +893 -677
  28. package/dist/meeting/index.js.map +1 -1
  29. package/dist/meeting/muteState.d.ts +2 -8
  30. package/dist/meeting/muteState.js +37 -25
  31. package/dist/meeting/muteState.js.map +1 -1
  32. package/dist/meeting/request.d.ts +3 -0
  33. package/dist/meeting/request.js +32 -23
  34. package/dist/meeting/request.js.map +1 -1
  35. package/dist/meeting/util.js +1 -0
  36. package/dist/meeting/util.js.map +1 -1
  37. package/dist/meeting-info/utilv2.js +4 -1
  38. package/dist/meeting-info/utilv2.js.map +1 -1
  39. package/dist/meetings/index.d.ts +8 -0
  40. package/dist/meetings/index.js +20 -0
  41. package/dist/meetings/index.js.map +1 -1
  42. package/dist/multistream/mediaRequestManager.d.ts +2 -1
  43. package/dist/multistream/mediaRequestManager.js +1 -1
  44. package/dist/multistream/mediaRequestManager.js.map +1 -1
  45. package/dist/multistream/remoteMediaGroup.d.ts +2 -0
  46. package/dist/multistream/remoteMediaGroup.js +16 -2
  47. package/dist/multistream/remoteMediaGroup.js.map +1 -1
  48. package/dist/multistream/remoteMediaManager.d.ts +15 -0
  49. package/dist/multistream/remoteMediaManager.js +179 -65
  50. package/dist/multistream/remoteMediaManager.js.map +1 -1
  51. package/dist/multistream/sendSlotManager.d.ts +9 -1
  52. package/dist/multistream/sendSlotManager.js +22 -0
  53. package/dist/multistream/sendSlotManager.js.map +1 -1
  54. package/dist/reachability/clusterReachability.d.ts +1 -0
  55. package/dist/reachability/clusterReachability.js +29 -15
  56. package/dist/reachability/clusterReachability.js.map +1 -1
  57. package/dist/reachability/index.d.ts +4 -0
  58. package/dist/reachability/index.js +18 -2
  59. package/dist/reachability/index.js.map +1 -1
  60. package/dist/reachability/request.js +12 -10
  61. package/dist/reachability/request.js.map +1 -1
  62. package/dist/reachability/util.d.ts +7 -0
  63. package/dist/reachability/util.js +19 -0
  64. package/dist/reachability/util.js.map +1 -1
  65. package/dist/reconnection-manager/index.js +2 -1
  66. package/dist/reconnection-manager/index.js.map +1 -1
  67. package/dist/roap/index.d.ts +10 -2
  68. package/dist/roap/index.js +15 -0
  69. package/dist/roap/index.js.map +1 -1
  70. package/dist/roap/request.js +3 -3
  71. package/dist/roap/request.js.map +1 -1
  72. package/dist/roap/turnDiscovery.d.ts +64 -17
  73. package/dist/roap/turnDiscovery.js +307 -126
  74. package/dist/roap/turnDiscovery.js.map +1 -1
  75. package/dist/statsAnalyzer/index.js +53 -30
  76. package/dist/statsAnalyzer/index.js.map +1 -1
  77. package/dist/webinar/index.js +1 -1
  78. package/package.json +22 -22
  79. package/src/config.ts +1 -0
  80. package/src/constants.ts +7 -3
  81. package/src/index.ts +1 -0
  82. package/src/interpretation/index.ts +18 -1
  83. package/src/locus-info/mediaSharesUtils.ts +16 -0
  84. package/src/locus-info/selfUtils.ts +5 -0
  85. package/src/media/MediaConnectionAwaiter.ts +174 -0
  86. package/src/media/index.ts +3 -1
  87. package/src/media/properties.ts +6 -31
  88. package/src/meeting/index.ts +321 -106
  89. package/src/meeting/muteState.ts +34 -20
  90. package/src/meeting/request.ts +18 -2
  91. package/src/meeting/util.ts +1 -0
  92. package/src/meeting-info/utilv2.ts +2 -1
  93. package/src/meetings/index.ts +18 -0
  94. package/src/multistream/mediaRequestManager.ts +4 -1
  95. package/src/multistream/remoteMediaGroup.ts +19 -0
  96. package/src/multistream/remoteMediaManager.ts +101 -16
  97. package/src/multistream/sendSlotManager.ts +28 -0
  98. package/src/reachability/clusterReachability.ts +20 -5
  99. package/src/reachability/index.ts +24 -1
  100. package/src/reachability/request.ts +15 -11
  101. package/src/reachability/util.ts +21 -0
  102. package/src/reconnection-manager/index.ts +1 -1
  103. package/src/roap/index.ts +25 -3
  104. package/src/roap/request.ts +3 -3
  105. package/src/roap/turnDiscovery.ts +244 -78
  106. package/src/statsAnalyzer/index.ts +63 -27
  107. package/test/integration/spec/journey.js +14 -14
  108. package/test/integration/spec/space-meeting.js +1 -1
  109. package/test/unit/spec/interpretation/index.ts +39 -3
  110. package/test/unit/spec/locus-info/index.js +28 -19
  111. package/test/unit/spec/locus-info/mediaSharesUtils.ts +9 -0
  112. package/test/unit/spec/locus-info/selfUtils.js +42 -12
  113. package/test/unit/spec/media/MediaConnectionAwaiter.ts +344 -0
  114. package/test/unit/spec/media/index.ts +89 -78
  115. package/test/unit/spec/media/properties.ts +16 -70
  116. package/test/unit/spec/meeting/index.js +638 -139
  117. package/test/unit/spec/meeting/muteState.js +219 -67
  118. package/test/unit/spec/meeting/request.js +21 -0
  119. package/test/unit/spec/meeting/utils.js +6 -1
  120. package/test/unit/spec/meeting-info/utilv2.js +6 -0
  121. package/test/unit/spec/meetings/index.js +40 -20
  122. package/test/unit/spec/multistream/mediaRequestManager.ts +20 -2
  123. package/test/unit/spec/multistream/remoteMediaGroup.ts +79 -1
  124. package/test/unit/spec/multistream/remoteMediaManager.ts +199 -1
  125. package/test/unit/spec/multistream/sendSlotManager.ts +50 -18
  126. package/test/unit/spec/reachability/clusterReachability.ts +86 -22
  127. package/test/unit/spec/reachability/index.ts +197 -60
  128. package/test/unit/spec/reachability/request.js +15 -7
  129. package/test/unit/spec/reachability/util.ts +32 -2
  130. package/test/unit/spec/reconnection-manager/index.js +28 -0
  131. package/test/unit/spec/roap/index.ts +61 -6
  132. package/test/unit/spec/roap/turnDiscovery.ts +298 -16
  133. package/test/unit/spec/stats-analyzer/index.js +179 -0
  134. package/dist/member/member.types.d.ts +0 -11
  135. package/dist/member/member.types.js +0 -17
  136. package/dist/member/member.types.js.map +0 -1
  137. package/src/member/member.types.ts +0 -13
  138. /package/test/unit/spec/locus-info/{lib/selfConstant.js → selfConstant.js} +0 -0
@@ -4,7 +4,7 @@ import sinon from 'sinon';
4
4
  import testUtils from '../../../utils/testUtils';
5
5
 
6
6
  // packages/@webex/plugin-meetings/test/unit/spec/reachability/clusterReachability.ts
7
- import { ClusterReachability } from '@webex/plugin-meetings/src/reachability/clusterReachability'; // replace with actual path
7
+ import {ClusterReachability} from '@webex/plugin-meetings/src/reachability/clusterReachability'; // replace with actual path
8
8
 
9
9
  describe('ClusterReachability', () => {
10
10
  let previousRTCPeerConnection;
@@ -28,9 +28,8 @@ describe('ClusterReachability', () => {
28
28
  isVideoMesh: false,
29
29
  udp: ['stun:udp1', 'stun:udp2'],
30
30
  tcp: ['stun:tcp1.webex.com', 'stun:tcp2.webex.com:5004'],
31
- xtls: ['xtls1', 'xtls2'],
31
+ xtls: ['stun:xtls1.webex.com', 'stun:xtls2.webex.com:443'],
32
32
  });
33
-
34
33
  });
35
34
 
36
35
  afterEach(() => {
@@ -50,8 +49,26 @@ describe('ClusterReachability', () => {
50
49
  iceServers: [
51
50
  {username: '', credential: '', urls: ['stun:udp1']},
52
51
  {username: '', credential: '', urls: ['stun:udp2']},
53
- {username: 'webexturnreachuser', credential: 'webexturnreachpwd', urls: ['turn:tcp1.webex.com?transport=tcp']},
54
- {username: 'webexturnreachuser', credential: 'webexturnreachpwd', urls: ['turn:tcp2.webex.com:5004?transport=tcp']}
52
+ {
53
+ username: 'webexturnreachuser',
54
+ credential: 'webexturnreachpwd',
55
+ urls: ['turn:tcp1.webex.com?transport=tcp'],
56
+ },
57
+ {
58
+ username: 'webexturnreachuser',
59
+ credential: 'webexturnreachpwd',
60
+ urls: ['turn:tcp2.webex.com:5004?transport=tcp'],
61
+ },
62
+ {
63
+ username: 'webexturnreachuser',
64
+ credential: 'webexturnreachpwd',
65
+ urls: ['turns:xtls1.webex.com?transport=tcp'],
66
+ },
67
+ {
68
+ username: 'webexturnreachuser',
69
+ credential: 'webexturnreachpwd',
70
+ urls: ['turns:xtls2.webex.com:443?transport=tcp'],
71
+ },
55
72
  ],
56
73
  iceCandidatePoolSize: 0,
57
74
  iceTransportPolicy: 'all',
@@ -79,7 +96,7 @@ describe('ClusterReachability', () => {
79
96
  assert.deepEqual(clusterReachability.getResult(), {
80
97
  udp: {result: 'untested'},
81
98
  tcp: {result: 'untested'},
82
- xtls: {result: 'untested'}
99
+ xtls: {result: 'untested'},
83
100
  });
84
101
  });
85
102
 
@@ -92,7 +109,7 @@ describe('ClusterReachability', () => {
92
109
 
93
110
  afterEach(() => {
94
111
  clock.restore();
95
- })
112
+ });
96
113
 
97
114
  it('should initiate the ICE gathering process', async () => {
98
115
  const promise = clusterReachability.start();
@@ -107,11 +124,11 @@ describe('ClusterReachability', () => {
107
124
  assert.calledOnceWithExactly(fakePeerConnection.createOffer, {offerToReceiveAudio: true});
108
125
  assert.calledOnce(fakePeerConnection.setLocalDescription);
109
126
 
110
- await clock.tickAsync(3000);// move the clock so that reachability times out
127
+ await clock.tickAsync(3000); // move the clock so that reachability times out
111
128
  await promise;
112
129
  });
113
130
 
114
- it('resolves and has correct result as soon as it finds that both udp and tcp is reachable', async () => {
131
+ it('resolves and has correct result as soon as it finds that all udp, tcp and tls are reachable', async () => {
115
132
  const promise = clusterReachability.start();
116
133
 
117
134
  await clock.tickAsync(100);
@@ -120,12 +137,17 @@ describe('ClusterReachability', () => {
120
137
  await clock.tickAsync(100);
121
138
  fakePeerConnection.onicecandidate({candidate: {type: 'relay', address: 'someTurnRelayIp'}});
122
139
 
140
+ await clock.tickAsync(100);
141
+ fakePeerConnection.onicecandidate({
142
+ candidate: {type: 'relay', address: 'someTurnRelayIp', port: 443},
143
+ });
144
+
123
145
  await promise;
124
146
 
125
147
  assert.deepEqual(clusterReachability.getResult(), {
126
148
  udp: {result: 'reachable', latencyInMilliseconds: 100, clientMediaIPs: ['somePublicIp']},
127
149
  tcp: {result: 'reachable', latencyInMilliseconds: 200},
128
- xtls: {result: 'untested'}
150
+ xtls: {result: 'reachable', latencyInMilliseconds: 300},
129
151
  });
130
152
  });
131
153
 
@@ -139,7 +161,7 @@ describe('ClusterReachability', () => {
139
161
  assert.deepEqual(clusterReachability.getResult(), {
140
162
  udp: {result: 'unreachable'},
141
163
  tcp: {result: 'unreachable'},
142
- xtls: {result: 'untested'}
164
+ xtls: {result: 'unreachable'},
143
165
  });
144
166
  });
145
167
 
@@ -148,7 +170,7 @@ describe('ClusterReachability', () => {
148
170
  isVideoMesh: true,
149
171
  udp: ['stun:udp1', 'stun:udp2'],
150
172
  tcp: ['stun:tcp1.webex.com', 'stun:tcp2.webex.com:5004'],
151
- xtls: ['xtls1', 'xtls2'],
173
+ xtls: ['stun:xtls1.webex.com', 'stun:xtls1.webex.com:443'],
152
174
  });
153
175
 
154
176
  const promise = clusterReachability.start();
@@ -160,7 +182,7 @@ describe('ClusterReachability', () => {
160
182
  assert.deepEqual(clusterReachability.getResult(), {
161
183
  udp: {result: 'unreachable'},
162
184
  tcp: {result: 'unreachable'},
163
- xtls: {result: 'untested'}
185
+ xtls: {result: 'unreachable'},
164
186
  });
165
187
  });
166
188
 
@@ -176,7 +198,7 @@ describe('ClusterReachability', () => {
176
198
  assert.deepEqual(clusterReachability.getResult(), {
177
199
  udp: {result: 'unreachable'},
178
200
  tcp: {result: 'unreachable'},
179
- xtls: {result: 'untested'}
201
+ xtls: {result: 'unreachable'},
180
202
  });
181
203
  });
182
204
 
@@ -194,7 +216,7 @@ describe('ClusterReachability', () => {
194
216
  assert.deepEqual(clusterReachability.getResult(), {
195
217
  udp: {result: 'reachable', latencyInMilliseconds: 30, clientMediaIPs: ['somePublicIp1']},
196
218
  tcp: {result: 'unreachable'},
197
- xtls: {result: 'untested'}
219
+ xtls: {result: 'unreachable'},
198
220
  });
199
221
  });
200
222
 
@@ -211,15 +233,19 @@ describe('ClusterReachability', () => {
211
233
  await clock.tickAsync(10);
212
234
  fakePeerConnection.onicecandidate({candidate: {type: 'srflx', address: 'somePublicIp3'}});
213
235
 
214
- await clock.tickAsync(3000);// move the clock so that reachability times out
236
+ await clock.tickAsync(3000); // move the clock so that reachability times out
215
237
 
216
238
  await promise;
217
239
 
218
240
  // latency should be from only the first candidates, but the clientMediaIps should be from all UDP candidates (not TCP)
219
241
  assert.deepEqual(clusterReachability.getResult(), {
220
- udp: {result: 'reachable', latencyInMilliseconds: 10, clientMediaIPs: ['somePublicIp1', 'somePublicIp2', 'somePublicIp3']},
242
+ udp: {
243
+ result: 'reachable',
244
+ latencyInMilliseconds: 10,
245
+ clientMediaIPs: ['somePublicIp1', 'somePublicIp2', 'somePublicIp3'],
246
+ },
221
247
  tcp: {result: 'unreachable'},
222
- xtls: {result: 'untested'}
248
+ xtls: {result: 'unreachable'},
223
249
  });
224
250
  });
225
251
 
@@ -236,7 +262,7 @@ describe('ClusterReachability', () => {
236
262
  await clock.tickAsync(10);
237
263
  fakePeerConnection.onicecandidate({candidate: {type: 'relay', address: 'someTurnRelayIp3'}});
238
264
 
239
- await clock.tickAsync(3000);// move the clock so that reachability times out
265
+ await clock.tickAsync(3000); // move the clock so that reachability times out
240
266
 
241
267
  await promise;
242
268
 
@@ -244,7 +270,38 @@ describe('ClusterReachability', () => {
244
270
  assert.deepEqual(clusterReachability.getResult(), {
245
271
  udp: {result: 'unreachable'},
246
272
  tcp: {result: 'reachable', latencyInMilliseconds: 10},
247
- xtls: {result: 'untested'}
273
+ xtls: {result: 'unreachable'},
274
+ });
275
+ });
276
+
277
+ it('should store latency only for the first tls relay candidate', async () => {
278
+ const promise = clusterReachability.start();
279
+
280
+ await clock.tickAsync(10);
281
+ fakePeerConnection.onicecandidate({
282
+ candidate: {type: 'relay', address: 'someTurnRelayIp1', port: 443},
283
+ });
284
+
285
+ // generate more candidates
286
+ await clock.tickAsync(10);
287
+ fakePeerConnection.onicecandidate({
288
+ candidate: {type: 'relay', address: 'someTurnRelayIp2', port: 443},
289
+ });
290
+
291
+ await clock.tickAsync(10);
292
+ fakePeerConnection.onicecandidate({
293
+ candidate: {type: 'relay', address: 'someTurnRelayIp3', port: 443},
294
+ });
295
+
296
+ await clock.tickAsync(3000); // move the clock so that reachability times out
297
+
298
+ await promise;
299
+
300
+ // latency should be from only the first candidates, but the clientMediaIps should be from only from UDP candidates
301
+ assert.deepEqual(clusterReachability.getResult(), {
302
+ udp: {result: 'unreachable'},
303
+ tcp: {result: 'unreachable'},
304
+ xtls: {result: 'reachable', latencyInMilliseconds: 10},
248
305
  });
249
306
  });
250
307
 
@@ -266,13 +323,20 @@ describe('ClusterReachability', () => {
266
323
 
267
324
  // send also a relay candidate so that the reachability check finishes
268
325
  fakePeerConnection.onicecandidate({candidate: {type: 'relay', address: 'someTurnRelayIp'}});
326
+ fakePeerConnection.onicecandidate({
327
+ candidate: {type: 'relay', address: 'someTurnRelayIp', port: 443},
328
+ });
269
329
 
270
330
  await promise;
271
331
 
272
332
  assert.deepEqual(clusterReachability.getResult(), {
273
- udp: {result: 'reachable', latencyInMilliseconds: 10, clientMediaIPs: ['somePublicIp1', 'somePublicIp2']},
333
+ udp: {
334
+ result: 'reachable',
335
+ latencyInMilliseconds: 10,
336
+ clientMediaIPs: ['somePublicIp1', 'somePublicIp2'],
337
+ },
274
338
  tcp: {result: 'reachable', latencyInMilliseconds: 40},
275
- xtls: {result: 'untested'}
339
+ xtls: {result: 'reachable', latencyInMilliseconds: 40},
276
340
  });
277
341
  });
278
342
  });
@@ -1,11 +1,14 @@
1
1
  import {assert} from '@webex/test-helper-chai';
2
2
  import MockWebex from '@webex/test-helper-mock-webex';
3
3
  import sinon from 'sinon';
4
- import Reachability, {ReachabilityResults, ReachabilityResultsForBackend} from '@webex/plugin-meetings/src/reachability/';
4
+ import Reachability, {
5
+ ReachabilityResults,
6
+ ReachabilityResultsForBackend,
7
+ } from '@webex/plugin-meetings/src/reachability/';
5
8
  import MeetingUtil from '@webex/plugin-meetings/src/meeting/util';
6
9
  import * as ClusterReachabilityModule from '@webex/plugin-meetings/src/reachability/clusterReachability';
7
10
 
8
- import { IP_VERSION } from '@webex/plugin-meetings/src/constants';
11
+ import {IP_VERSION} from '@webex/plugin-meetings/src/constants';
9
12
 
10
13
  describe('isAnyPublicClusterReachable', () => {
11
14
  let webex;
@@ -36,19 +39,31 @@ describe('isAnyPublicClusterReachable', () => {
36
39
  };
37
40
 
38
41
  it('returns true when udp is reachable', async () => {
39
- await checkIsClusterReachable({x: {udp: {result: 'reachable'}, tcp: {result: 'unreachable'}}}, true);
42
+ await checkIsClusterReachable(
43
+ {x: {udp: {result: 'reachable'}, tcp: {result: 'unreachable'}}},
44
+ true
45
+ );
40
46
  });
41
47
 
42
48
  it('returns true when tcp is reachable', async () => {
43
- await checkIsClusterReachable({x: {udp: {result: 'unreachable'}, tcp: {result: 'reachable'}}}, true);
49
+ await checkIsClusterReachable(
50
+ {x: {udp: {result: 'unreachable'}, tcp: {result: 'reachable'}}},
51
+ true
52
+ );
44
53
  });
45
54
 
46
55
  it('returns true when both tcp and udp are reachable', async () => {
47
- await checkIsClusterReachable({x: {udp: {result: 'reachable'}, tcp: {result: 'reachable'}}}, true);
56
+ await checkIsClusterReachable(
57
+ {x: {udp: {result: 'reachable'}, tcp: {result: 'reachable'}}},
58
+ true
59
+ );
48
60
  });
49
61
 
50
62
  it('returns false when both tcp and udp are unreachable', async () => {
51
- await checkIsClusterReachable({x: {udp: {result: 'unreachable'}, tcp: {result: 'unreachable'}}}, false);
63
+ await checkIsClusterReachable(
64
+ {x: {udp: {result: 'unreachable'}, tcp: {result: 'unreachable'}}},
65
+ false
66
+ );
52
67
  });
53
68
 
54
69
  it('returns false when reachability result is empty', async () => {
@@ -61,60 +76,69 @@ describe('isAnyPublicClusterReachable', () => {
61
76
 
62
77
  describe('ignores video mesh reachability', () => {
63
78
  it('returns false if there are no public cluster results, only video mesh', async () => {
64
- await checkIsClusterReachable({
65
- x: {
66
- udp: {result: 'reachable'},
67
- tcp: {result: 'reachable'},
68
- isVideoMesh: true,
69
- },
70
- y: {
71
- udp: {result: 'unreachable'},
72
- tcp: {result: 'reachable'},
73
- isVideoMesh: true,
74
- }
75
- }, false);
79
+ await checkIsClusterReachable(
80
+ {
81
+ x: {
82
+ udp: {result: 'reachable'},
83
+ tcp: {result: 'reachable'},
84
+ isVideoMesh: true,
85
+ },
86
+ y: {
87
+ udp: {result: 'unreachable'},
88
+ tcp: {result: 'reachable'},
89
+ isVideoMesh: true,
90
+ },
91
+ },
92
+ false
93
+ );
76
94
  });
77
95
 
78
96
  it('returns false if there public cluster reachability failed, only video mesh succeeded', async () => {
79
- await checkIsClusterReachable({
80
- x: {
81
- udp: {result: 'unreachable'},
82
- tcp: {result: 'reachable'},
83
- isVideoMesh: true,
84
- },
85
- y: {
86
- udp: {result: 'reachable'},
87
- tcp: {result: 'unreachable'},
88
- isVideoMesh: true,
89
- },
90
- publicOne: {
91
- udp: {result: 'unreachable'},
92
- tcp: {result: 'unreachable'},
93
- isVideoMesh: false,
94
- }
95
- }, false);
97
+ await checkIsClusterReachable(
98
+ {
99
+ x: {
100
+ udp: {result: 'unreachable'},
101
+ tcp: {result: 'reachable'},
102
+ isVideoMesh: true,
103
+ },
104
+ y: {
105
+ udp: {result: 'reachable'},
106
+ tcp: {result: 'unreachable'},
107
+ isVideoMesh: true,
108
+ },
109
+ publicOne: {
110
+ udp: {result: 'unreachable'},
111
+ tcp: {result: 'unreachable'},
112
+ isVideoMesh: false,
113
+ },
114
+ },
115
+ false
116
+ );
96
117
  });
97
118
 
98
119
  it('returns true if there is at least 1 public cluster result, while video mesh is not reachable', async () => {
99
- await checkIsClusterReachable({
100
- x: {
101
- udp: {result: 'reachable'},
102
- tcp: {result: 'reachable'},
103
- isVideoMesh: true,
104
- },
105
- y: {
106
- udp: {result: 'unreachable'},
107
- tcp: {result: 'reachable'},
108
- isVideoMesh: true,
109
- },
110
- publicOne: {
111
- udp: {result: 'unreachable'},
112
- tcp: {result: 'reachable'},
113
- isVideoMesh: false,
114
- }
115
- }, true);
120
+ await checkIsClusterReachable(
121
+ {
122
+ x: {
123
+ udp: {result: 'reachable'},
124
+ tcp: {result: 'reachable'},
125
+ isVideoMesh: true,
126
+ },
127
+ y: {
128
+ udp: {result: 'unreachable'},
129
+ tcp: {result: 'reachable'},
130
+ isVideoMesh: true,
131
+ },
132
+ publicOne: {
133
+ udp: {result: 'unreachable'},
134
+ tcp: {result: 'reachable'},
135
+ isVideoMesh: false,
136
+ },
137
+ },
138
+ true
139
+ );
116
140
  });
117
- })
141
+ });
118
142
  });
119
143
 
120
144
  describe('gatherReachability', () => {
@@ -244,7 +268,10 @@ describe('gatherReachability', () => {
244
268
  });
245
269
 
246
270
  it('starts ClusterReachability on each media cluster', async () => {
247
- webex.config.meetings.experimental = {enableTcpReachability: true};
271
+ webex.config.meetings.experimental = {
272
+ enableTcpReachability: true,
273
+ enableTlsReachability: true,
274
+ };
248
275
 
249
276
  const getClustersResult = {
250
277
  clusters: {
@@ -284,11 +311,11 @@ describe('gatherReachability', () => {
284
311
  xtls: ['xtls1.1', 'xtls1.2'],
285
312
  isVideoMesh: false,
286
313
  });
287
- // cluster 2 is video mesh, so we should not do TCP reachability on it
314
+ // cluster 2 is video mesh, so we should not do TCP or TLS reachability on it
288
315
  assert.calledWith(clusterReachabilityCtorStub, 'cluster 2', {
289
316
  udp: ['udp2.1', 'udp2.2'],
290
317
  tcp: [],
291
- xtls: ['xtls2.1', 'xtls2.2'],
318
+ xtls: [],
292
319
  isVideoMesh: true,
293
320
  });
294
321
 
@@ -296,7 +323,10 @@ describe('gatherReachability', () => {
296
323
  });
297
324
 
298
325
  it('does not do TCP reachability if it is disabled in config', async () => {
299
- webex.config.meetings.experimental = {enableTcpReachability: false};
326
+ webex.config.meetings.experimental = {
327
+ enableTcpReachability: false,
328
+ enableTlsReachability: true,
329
+ };
300
330
 
301
331
  const getClustersResult = {
302
332
  clusters: {
@@ -329,6 +359,82 @@ describe('gatherReachability', () => {
329
359
  xtls: ['testXTLS1', 'testXTLS2'],
330
360
  });
331
361
  });
362
+
363
+ it('does not do TLS reachability if it is disabled in config', async () => {
364
+ webex.config.meetings.experimental = {
365
+ enableTcpReachability: true,
366
+ enableTlsReachability: false,
367
+ };
368
+
369
+ const getClustersResult = {
370
+ clusters: {
371
+ 'cluster name': {
372
+ udp: ['testUDP1', 'testUDP2'],
373
+ tcp: ['testTCP1', 'testTCP2'],
374
+ xtls: ['testXTLS1', 'testXTLS2'],
375
+ isVideoMesh: false,
376
+ },
377
+ },
378
+ joinCookie: {id: 'id'},
379
+ };
380
+
381
+ const reachability = new Reachability(webex);
382
+
383
+ reachability.reachabilityRequest.getClusters = sinon.stub().returns(getClustersResult);
384
+
385
+ const clusterReachabilityCtorStub = sinon
386
+ .stub(ClusterReachabilityModule, 'ClusterReachability')
387
+ .callsFake(() => ({
388
+ start: sinon.stub().resolves({}),
389
+ }));
390
+
391
+ await reachability.gatherReachability();
392
+
393
+ assert.calledOnceWithExactly(clusterReachabilityCtorStub, 'cluster name', {
394
+ isVideoMesh: false,
395
+ udp: ['testUDP1', 'testUDP2'],
396
+ tcp: ['testTCP1', 'testTCP2'],
397
+ xtls: [], // empty list because TLS is disabled in config
398
+ });
399
+ });
400
+
401
+ it('does not do TCP or TLS reachability if it is disabled in config', async () => {
402
+ webex.config.meetings.experimental = {
403
+ enableTcpReachability: false,
404
+ enableTlsReachability: false,
405
+ };
406
+
407
+ const getClustersResult = {
408
+ clusters: {
409
+ 'cluster name': {
410
+ udp: ['testUDP1', 'testUDP2'],
411
+ tcp: ['testTCP1', 'testTCP2'],
412
+ xtls: ['testXTLS1', 'testXTLS2'],
413
+ isVideoMesh: false,
414
+ },
415
+ },
416
+ joinCookie: {id: 'id'},
417
+ };
418
+
419
+ const reachability = new Reachability(webex);
420
+
421
+ reachability.reachabilityRequest.getClusters = sinon.stub().returns(getClustersResult);
422
+
423
+ const clusterReachabilityCtorStub = sinon
424
+ .stub(ClusterReachabilityModule, 'ClusterReachability')
425
+ .callsFake(() => ({
426
+ start: sinon.stub().resolves({}),
427
+ }));
428
+
429
+ await reachability.gatherReachability();
430
+
431
+ assert.calledOnceWithExactly(clusterReachabilityCtorStub, 'cluster name', {
432
+ isVideoMesh: false,
433
+ udp: ['testUDP1', 'testUDP2'],
434
+ tcp: [], // empty list because TCP is disabled in config
435
+ xtls: [], // empty list because TLS is disabled in config
436
+ });
437
+ });
332
438
  });
333
439
 
334
440
  describe('getReachabilityResults', () => {
@@ -460,10 +566,14 @@ describe('getReachabilityMetrics', () => {
460
566
  reachability_public_udp_failed: 0,
461
567
  reachability_public_tcp_success: 0,
462
568
  reachability_public_tcp_failed: 0,
569
+ reachability_public_xtls_success: 0,
570
+ reachability_public_xtls_failed: 0,
463
571
  reachability_vmn_udp_success: 0,
464
572
  reachability_vmn_udp_failed: 0,
465
573
  reachability_vmn_tcp_success: 0,
466
574
  reachability_vmn_tcp_failed: 0,
575
+ reachability_vmn_xtls_success: 0,
576
+ reachability_vmn_xtls_failed: 0,
467
577
  });
468
578
  });
469
579
 
@@ -523,10 +633,14 @@ describe('getReachabilityMetrics', () => {
523
633
  reachability_public_udp_failed: 2,
524
634
  reachability_public_tcp_success: 2,
525
635
  reachability_public_tcp_failed: 1,
636
+ reachability_public_xtls_success: 0,
637
+ reachability_public_xtls_failed: 0,
526
638
  reachability_vmn_udp_success: 1,
527
639
  reachability_vmn_udp_failed: 0,
528
640
  reachability_vmn_tcp_success: 1,
529
641
  reachability_vmn_tcp_failed: 1,
642
+ reachability_vmn_xtls_success: 0,
643
+ reachability_vmn_xtls_failed: 0,
530
644
  }
531
645
  );
532
646
  });
@@ -562,7 +676,16 @@ describe('getReachabilityMetrics', () => {
562
676
  public5: {
563
677
  udp: {result: 'reachable', latencyInMilliseconds: '400', clientMediaIPs: ['10.10.10.10']},
564
678
  tcp: {result: 'untested'},
565
- xtls: {result: 'untested'},
679
+ xtls: {result: 'unreachable'},
680
+ },
681
+ public6: {
682
+ udp: {result: 'untested'},
683
+ tcp: {result: 'untested'},
684
+ xtls: {
685
+ result: 'reachable',
686
+ latencyInMilliseconds: '200',
687
+ clientMediaIPs: ['10.10.10.10'],
688
+ },
566
689
  },
567
690
  },
568
691
  // expected result:
@@ -571,10 +694,14 @@ describe('getReachabilityMetrics', () => {
571
694
  reachability_public_udp_failed: 1,
572
695
  reachability_public_tcp_success: 1,
573
696
  reachability_public_tcp_failed: 2,
697
+ reachability_public_xtls_success: 1,
698
+ reachability_public_xtls_failed: 1,
574
699
  reachability_vmn_udp_success: 0,
575
700
  reachability_vmn_udp_failed: 0,
576
701
  reachability_vmn_tcp_success: 0,
577
702
  reachability_vmn_tcp_failed: 0,
703
+ reachability_vmn_xtls_success: 0,
704
+ reachability_vmn_xtls_failed: 0,
578
705
  }
579
706
  );
580
707
  });
@@ -611,10 +738,16 @@ describe('getReachabilityMetrics', () => {
611
738
  vmn5: {
612
739
  udp: {result: 'reachable', latencyInMilliseconds: 200, clientMediaIPs: ['10.10.10.10']},
613
740
  tcp: {result: 'unreachable'},
614
- xtls: {result: 'untested'},
741
+ xtls: {result: 'unreachable'},
615
742
  isVideoMesh: true,
616
743
  someOtherField: 'any value',
617
744
  },
745
+ vmn6: {
746
+ udp: {result: 'untested'},
747
+ tcp: {result: 'untested'},
748
+ xtls: {result: 'reachable', latencyInMilliseconds: 100, clientMediaIPs: ['10.10.10.10']},
749
+ isVideoMesh: true,
750
+ },
618
751
  },
619
752
  // expected result:
620
753
  {
@@ -622,11 +755,15 @@ describe('getReachabilityMetrics', () => {
622
755
  reachability_public_udp_failed: 0,
623
756
  reachability_public_tcp_success: 0,
624
757
  reachability_public_tcp_failed: 0,
758
+ reachability_public_xtls_success: 0,
759
+ reachability_public_xtls_failed: 0,
625
760
  reachability_vmn_udp_success: 3,
626
761
  reachability_vmn_udp_failed: 1,
627
762
  reachability_vmn_tcp_success: 1,
628
763
  reachability_vmn_tcp_failed: 3,
764
+ reachability_vmn_xtls_success: 1,
765
+ reachability_vmn_xtls_failed: 1,
629
766
  }
630
767
  );
631
768
  });
632
- });
769
+ });
@@ -4,6 +4,7 @@ import MockWebex from '@webex/test-helper-mock-webex';
4
4
  import Meetings from '@webex/plugin-meetings';
5
5
  import ReachabilityRequest from '@webex/plugin-meetings/src/reachability/request';
6
6
  import {IP_VERSION} from '@webex/plugin-meetings/src/constants';
7
+ import {NewMetrics} from '@webex/internal-plugin-metrics';
7
8
 
8
9
 
9
10
  describe('plugin-meetings/reachability', () => {
@@ -14,6 +15,7 @@ describe('plugin-meetings/reachability', () => {
14
15
  webex = new MockWebex({
15
16
  children: {
16
17
  meetings: Meetings,
18
+ newMetrics: NewMetrics
17
19
  },
18
20
  });
19
21
 
@@ -22,19 +24,25 @@ describe('plugin-meetings/reachability', () => {
22
24
  regionCode: 'WEST-COAST',
23
25
  };
24
26
 
25
- webex.internal = {
26
- services: {
27
- get: sinon.mock().returns('locusUrl'),
28
- waitForCatalog: sinon.mock().returns(Promise.resolve({})),
29
- },
27
+ webex.internal.services = {
28
+ get: sinon.mock().returns('locusUrl'),
29
+ waitForCatalog: sinon.mock().returns(Promise.resolve({})),
30
30
  };
31
31
 
32
-
33
32
  reachabilityRequest = new ReachabilityRequest(webex);
34
33
 
35
34
  });
36
35
 
37
36
  describe('#getClusters', () => {
37
+
38
+ beforeEach(() => {
39
+ sinon.spy(webex.internal.newMetrics.callDiagnosticLatencies, 'measureLatency');
40
+ });
41
+
42
+ afterEach(() => {
43
+ sinon.restore();
44
+ });
45
+
38
46
  it('sends a GET request with the correct params', async () => {
39
47
  webex.request = sinon.mock().returns(Promise.resolve({
40
48
  body: {
@@ -49,7 +57,6 @@ describe('plugin-meetings/reachability', () => {
49
57
  }));
50
58
 
51
59
  const res = await reachabilityRequest.getClusters(IP_VERSION.only_ipv4);
52
-
53
60
  const requestParams = webex.request.getCall(0).args[0];
54
61
 
55
62
  assert.equal(requestParams.method, 'GET');
@@ -63,6 +70,7 @@ describe('plugin-meetings/reachability', () => {
63
70
  });
64
71
  assert.deepEqual(res.clusters.clusterId, {udp: "testUDP", isVideoMesh: true})
65
72
  assert.deepEqual(res.joinCookie, {anycastEntryPoint: "aws-eu-west-1"})
73
+ assert.calledOnceWithExactly(webex.internal.newMetrics.callDiagnosticLatencies.measureLatency, sinon.match.func, 'internal.get.cluster.time');
66
74
  });
67
75
  });
68
76
  });