@webex/plugin-meetings 3.8.0-next.30 → 3.8.0-next.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/media/index.js +3 -15
- package/dist/media/index.js.map +1 -1
- package/dist/meeting/index.js.map +1 -1
- package/dist/reconnection-manager/index.js +2 -2
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/turnDiscovery.js +31 -23
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/roap/types.js +17 -0
- package/dist/roap/types.js.map +1 -0
- package/dist/types/meeting/index.d.ts +2 -1
- package/dist/types/roap/index.d.ts +3 -2
- package/dist/types/roap/turnDiscovery.d.ts +1 -17
- package/dist/types/roap/types.d.ts +16 -0
- package/dist/webinar/index.js +1 -1
- package/package.json +3 -3
- package/src/media/index.ts +5 -21
- package/src/meeting/index.ts +6 -6
- package/src/reconnection-manager/index.ts +2 -2
- package/src/roap/index.ts +3 -7
- package/src/roap/turnDiscovery.ts +21 -35
- package/src/roap/types.ts +23 -0
- package/test/unit/spec/media/index.ts +6 -16
- package/test/unit/spec/meeting/index.js +12 -17
- package/test/unit/spec/reconnection-manager/index.js +4 -4
- package/test/unit/spec/roap/turnDiscovery.ts +72 -28
|
@@ -2664,7 +2664,7 @@ describe('plugin-meetings', () => {
|
|
|
2664
2664
|
|
|
2665
2665
|
meeting.roap.doTurnDiscovery = sinon.stub().resolves({
|
|
2666
2666
|
turnServerInfo: {
|
|
2667
|
-
|
|
2667
|
+
urls: [FAKE_TURN_URL],
|
|
2668
2668
|
username: FAKE_TURN_USER,
|
|
2669
2669
|
password: FAKE_TURN_PASSWORD,
|
|
2670
2670
|
},
|
|
@@ -2686,7 +2686,7 @@ describe('plugin-meetings', () => {
|
|
|
2686
2686
|
meeting.id,
|
|
2687
2687
|
sinon.match({
|
|
2688
2688
|
turnServerInfo: {
|
|
2689
|
-
|
|
2689
|
+
urls: [FAKE_TURN_URL],
|
|
2690
2690
|
username: FAKE_TURN_USER,
|
|
2691
2691
|
password: FAKE_TURN_PASSWORD,
|
|
2692
2692
|
},
|
|
@@ -2744,7 +2744,7 @@ describe('plugin-meetings', () => {
|
|
|
2744
2744
|
.onSecondCall()
|
|
2745
2745
|
.returns({
|
|
2746
2746
|
turnServerInfo: {
|
|
2747
|
-
|
|
2747
|
+
urls: [FAKE_TURN_URL],
|
|
2748
2748
|
username: FAKE_TURN_USER,
|
|
2749
2749
|
password: FAKE_TURN_PASSWORD,
|
|
2750
2750
|
},
|
|
@@ -2956,7 +2956,7 @@ describe('plugin-meetings', () => {
|
|
|
2956
2956
|
.onSecondCall()
|
|
2957
2957
|
.returns({
|
|
2958
2958
|
turnServerInfo: {
|
|
2959
|
-
|
|
2959
|
+
urls: [FAKE_TURN_URL],
|
|
2960
2960
|
username: FAKE_TURN_USER,
|
|
2961
2961
|
password: FAKE_TURN_PASSWORD,
|
|
2962
2962
|
},
|
|
@@ -3133,7 +3133,7 @@ describe('plugin-meetings', () => {
|
|
|
3133
3133
|
.onSecondCall()
|
|
3134
3134
|
.returns({
|
|
3135
3135
|
turnServerInfo: {
|
|
3136
|
-
|
|
3136
|
+
urls: [FAKE_TURN_URL],
|
|
3137
3137
|
username: FAKE_TURN_USER,
|
|
3138
3138
|
password: FAKE_TURN_PASSWORD,
|
|
3139
3139
|
},
|
|
@@ -3185,7 +3185,7 @@ describe('plugin-meetings', () => {
|
|
|
3185
3185
|
.onSecondCall()
|
|
3186
3186
|
.returns({
|
|
3187
3187
|
turnServerInfo: {
|
|
3188
|
-
|
|
3188
|
+
urls: [FAKE_TURN_URL],
|
|
3189
3189
|
username: FAKE_TURN_USER,
|
|
3190
3190
|
password: FAKE_TURN_PASSWORD,
|
|
3191
3191
|
},
|
|
@@ -3637,7 +3637,7 @@ describe('plugin-meetings', () => {
|
|
|
3637
3637
|
|
|
3638
3638
|
meeting.roap.doTurnDiscovery = sinon.stub().resolves({
|
|
3639
3639
|
turnServerInfo: {
|
|
3640
|
-
|
|
3640
|
+
urls: [FAKE_TURN_URL],
|
|
3641
3641
|
username: FAKE_TURN_USER,
|
|
3642
3642
|
password: FAKE_TURN_PASSWORD,
|
|
3643
3643
|
},
|
|
@@ -3663,7 +3663,7 @@ describe('plugin-meetings', () => {
|
|
|
3663
3663
|
meeting.id,
|
|
3664
3664
|
sinon.match({
|
|
3665
3665
|
turnServerInfo: {
|
|
3666
|
-
|
|
3666
|
+
urls: [FAKE_TURN_URL],
|
|
3667
3667
|
username: FAKE_TURN_USER,
|
|
3668
3668
|
password: FAKE_TURN_PASSWORD,
|
|
3669
3669
|
},
|
|
@@ -3940,7 +3940,7 @@ describe('plugin-meetings', () => {
|
|
|
3940
3940
|
.resolves({id: 'fake clientMediaPreferences'});
|
|
3941
3941
|
meeting.roap.doTurnDiscovery = sinon.stub().resolves({
|
|
3942
3942
|
turnServerInfo: {
|
|
3943
|
-
|
|
3943
|
+
urls: ['turns:turn-server-url1:443?transport=tcp', 'turns:turn-server-url2:443?transport=tcp'],
|
|
3944
3944
|
username: 'turn user',
|
|
3945
3945
|
password: 'turn password',
|
|
3946
3946
|
},
|
|
@@ -3958,12 +3958,7 @@ describe('plugin-meetings', () => {
|
|
|
3958
3958
|
expectedMediaConnectionConfig = {
|
|
3959
3959
|
iceServers: [
|
|
3960
3960
|
{
|
|
3961
|
-
urls: 'turn:turn-server-
|
|
3962
|
-
username: 'turn user',
|
|
3963
|
-
credential: 'turn password',
|
|
3964
|
-
},
|
|
3965
|
-
{
|
|
3966
|
-
urls: 'turns:turn-server-url:443?transport=tcp',
|
|
3961
|
+
urls: ['turns:turn-server-url1:443?transport=tcp', 'turns:turn-server-url2:443?transport=tcp'],
|
|
3967
3962
|
username: 'turn user',
|
|
3968
3963
|
credential: 'turn password',
|
|
3969
3964
|
},
|
|
@@ -5231,7 +5226,7 @@ describe('plugin-meetings', () => {
|
|
|
5231
5226
|
// and check that when we fallback to transcoded we still do another TURN discovery
|
|
5232
5227
|
await runCheck(
|
|
5233
5228
|
{
|
|
5234
|
-
|
|
5229
|
+
urls: ['turns:turn-server-url1:443?transport=tcp', 'turns:turn-server-url2:443?transport=tcp'],
|
|
5235
5230
|
username: 'turn user',
|
|
5236
5231
|
password: 'turn password',
|
|
5237
5232
|
},
|
|
@@ -5245,7 +5240,7 @@ describe('plugin-meetings', () => {
|
|
|
5245
5240
|
// but doing it just for completeness
|
|
5246
5241
|
await runCheck(
|
|
5247
5242
|
{
|
|
5248
|
-
|
|
5243
|
+
urls: ['turns:turn-server-url1:443?transport=tcp', 'turns:turn-server-url2:443?transport=tcp'],
|
|
5249
5244
|
username: 'turn user',
|
|
5250
5245
|
password: 'turn password',
|
|
5251
5246
|
},
|
|
@@ -60,7 +60,7 @@ describe('plugin-meetings', () => {
|
|
|
60
60
|
roap: {
|
|
61
61
|
doTurnDiscovery: sinon.stub().resolves({
|
|
62
62
|
turnServerInfo: {
|
|
63
|
-
|
|
63
|
+
urls: ['fake_turn_url1', 'fake_turn_url2'],
|
|
64
64
|
username: 'fake_turn_username',
|
|
65
65
|
password: 'fake_turn_password',
|
|
66
66
|
},
|
|
@@ -137,7 +137,7 @@ describe('plugin-meetings', () => {
|
|
|
137
137
|
assert.calledOnce(fakeMediaConnection.reconnect);
|
|
138
138
|
assert.calledWith(fakeMediaConnection.reconnect, [
|
|
139
139
|
{
|
|
140
|
-
urls: '
|
|
140
|
+
urls: ['fake_turn_url1', 'fake_turn_url2'],
|
|
141
141
|
username: 'fake_turn_username',
|
|
142
142
|
credential: 'fake_turn_password',
|
|
143
143
|
},
|
|
@@ -152,12 +152,12 @@ describe('plugin-meetings', () => {
|
|
|
152
152
|
});
|
|
153
153
|
|
|
154
154
|
// this can happen when we land on a video mesh node
|
|
155
|
-
it('does not use TURN server if TURN
|
|
155
|
+
it('does not use TURN server if TURN urls is an empty array', async () => {
|
|
156
156
|
const rm = new ReconnectionManager(fakeMeeting);
|
|
157
157
|
|
|
158
158
|
fakeMeeting.roap.doTurnDiscovery.resolves({
|
|
159
159
|
turnServerInfo: {
|
|
160
|
-
|
|
160
|
+
urls: [],
|
|
161
161
|
username: 'whatever',
|
|
162
162
|
password: 'whatever',
|
|
163
163
|
},
|
|
@@ -15,7 +15,8 @@ describe('TurnDiscovery', () => {
|
|
|
15
15
|
let mockRoapRequest: RoapRequest;
|
|
16
16
|
let testMeeting: any;
|
|
17
17
|
|
|
18
|
-
const
|
|
18
|
+
const FAKE_TURN_URL1 = 'turns:fakeTurnServer1.com:443?transport=tcp';
|
|
19
|
+
const FAKE_TURN_URL2 = 'turns:fakeTurnServer2.com:443?transport=tcp';
|
|
19
20
|
const FAKE_TURN_USERNAME = 'someUsernameFromServer';
|
|
20
21
|
const FAKE_TURN_PASSWORD = 'fakePasswordFromServer';
|
|
21
22
|
const FAKE_LOCUS_ID = '09493311-f5d5-3e58-b491-009cc628162e';
|
|
@@ -186,7 +187,8 @@ describe('TurnDiscovery', () => {
|
|
|
186
187
|
{
|
|
187
188
|
messageType: 'TURN_DISCOVERY_RESPONSE',
|
|
188
189
|
headers: [
|
|
189
|
-
`x-cisco-turn-url=${
|
|
190
|
+
`x-cisco-turn-url=${FAKE_TURN_URL1}`,
|
|
191
|
+
`x-cisco-turn-url=${FAKE_TURN_URL2}`,
|
|
190
192
|
`x-cisco-turn-username=${FAKE_TURN_USERNAME}`,
|
|
191
193
|
`x-cisco-turn-password=${FAKE_TURN_PASSWORD}`,
|
|
192
194
|
],
|
|
@@ -195,7 +197,7 @@ describe('TurnDiscovery', () => {
|
|
|
195
197
|
);
|
|
196
198
|
|
|
197
199
|
await checkResult(result, 'OK', {
|
|
198
|
-
|
|
200
|
+
urls: [FAKE_TURN_URL1, FAKE_TURN_URL2],
|
|
199
201
|
username: FAKE_TURN_USERNAME,
|
|
200
202
|
password: FAKE_TURN_PASSWORD,
|
|
201
203
|
});
|
|
@@ -220,7 +222,7 @@ describe('TurnDiscovery', () => {
|
|
|
220
222
|
{
|
|
221
223
|
messageType: 'TURN_DISCOVERY_RESPONSE',
|
|
222
224
|
headers: [
|
|
223
|
-
`x-cisco-turn-url=${
|
|
225
|
+
`x-cisco-turn-url=${FAKE_TURN_URL1}`,
|
|
224
226
|
`x-cisco-turn-username=${FAKE_TURN_USERNAME}`,
|
|
225
227
|
`x-cisco-turn-password=${FAKE_TURN_PASSWORD}`,
|
|
226
228
|
'noOkInTransaction',
|
|
@@ -230,7 +232,7 @@ describe('TurnDiscovery', () => {
|
|
|
230
232
|
);
|
|
231
233
|
|
|
232
234
|
await checkResult(result, undefined, {
|
|
233
|
-
|
|
235
|
+
urls: [FAKE_TURN_URL1],
|
|
234
236
|
username: FAKE_TURN_USERNAME,
|
|
235
237
|
password: FAKE_TURN_PASSWORD,
|
|
236
238
|
});
|
|
@@ -241,7 +243,7 @@ describe('TurnDiscovery', () => {
|
|
|
241
243
|
mediaConnections: [
|
|
242
244
|
{
|
|
243
245
|
mediaId: '464ff97f-4bda-466a-ad06-3a22184a2274',
|
|
244
|
-
remoteSdp: `{"roapMessage": {"messageType":"TURN_DISCOVERY_RESPONSE","seq":"0","headers": ["x-cisco-turn-url=${
|
|
246
|
+
remoteSdp: `{"roapMessage": {"messageType":"TURN_DISCOVERY_RESPONSE","seq":"0","headers": ["x-cisco-turn-url=${FAKE_TURN_URL1}","x-cisco-turn-username=${FAKE_TURN_USERNAME}","x-cisco-turn-password=${FAKE_TURN_PASSWORD}", "noOkInTransaction"]}}`,
|
|
245
247
|
},
|
|
246
248
|
],
|
|
247
249
|
});
|
|
@@ -256,7 +258,7 @@ describe('TurnDiscovery', () => {
|
|
|
256
258
|
mockRoapRequest.sendRoap.resetHistory();
|
|
257
259
|
|
|
258
260
|
await checkResult(result, undefined, {
|
|
259
|
-
|
|
261
|
+
urls: [FAKE_TURN_URL1],
|
|
260
262
|
username: FAKE_TURN_USERNAME,
|
|
261
263
|
password: FAKE_TURN_PASSWORD,
|
|
262
264
|
});
|
|
@@ -268,7 +270,7 @@ describe('TurnDiscovery', () => {
|
|
|
268
270
|
mediaConnections: [
|
|
269
271
|
{
|
|
270
272
|
mediaId: '464ff97f-4bda-466a-ad06-3a22184a2274',
|
|
271
|
-
remoteSdp: `{"roapMessage": {"messageType":"TURN_DISCOVERY_RESPONSE","seq":"0","headers": ["x-cisco-turn-url=${
|
|
273
|
+
remoteSdp: `{"roapMessage": {"messageType":"TURN_DISCOVERY_RESPONSE","seq":"0","headers": ["x-cisco-turn-url=${FAKE_TURN_URL1}","x-cisco-turn-username=${FAKE_TURN_USERNAME}","x-cisco-turn-password=${FAKE_TURN_PASSWORD}"]}}`,
|
|
272
274
|
},
|
|
273
275
|
],
|
|
274
276
|
};
|
|
@@ -290,7 +292,7 @@ describe('TurnDiscovery', () => {
|
|
|
290
292
|
sendRoapPromiseResolve(sendRoapResult);
|
|
291
293
|
|
|
292
294
|
await checkResult(result, 'OK', {
|
|
293
|
-
|
|
295
|
+
urls: [FAKE_TURN_URL1],
|
|
294
296
|
username: FAKE_TURN_USERNAME,
|
|
295
297
|
password: FAKE_TURN_PASSWORD,
|
|
296
298
|
});
|
|
@@ -350,16 +352,17 @@ describe('TurnDiscovery', () => {
|
|
|
350
352
|
{
|
|
351
353
|
messageType: 'TURN_DISCOVERY_RESPONSE',
|
|
352
354
|
headers: [
|
|
353
|
-
`x-cisco-turn-url=${
|
|
355
|
+
`x-cisco-turn-url=${FAKE_TURN_URL1}`,
|
|
354
356
|
`x-cisco-turn-username=${FAKE_TURN_USERNAME}`,
|
|
355
357
|
`x-cisco-turn-password=${FAKE_TURN_PASSWORD}`,
|
|
358
|
+
`x-cisco-turn-url=${FAKE_TURN_URL2}`,
|
|
356
359
|
],
|
|
357
360
|
},
|
|
358
361
|
'from test'
|
|
359
362
|
);
|
|
360
363
|
|
|
361
364
|
await checkResult(result, 'OK', {
|
|
362
|
-
|
|
365
|
+
urls: [FAKE_TURN_URL1, FAKE_TURN_URL2],
|
|
363
366
|
username: FAKE_TURN_USERNAME,
|
|
364
367
|
password: FAKE_TURN_PASSWORD,
|
|
365
368
|
});
|
|
@@ -415,7 +418,7 @@ describe('TurnDiscovery', () => {
|
|
|
415
418
|
{
|
|
416
419
|
messageType: 'TURN_DISCOVERY_RESPONSE',
|
|
417
420
|
headers: [
|
|
418
|
-
`x-cisco-turn-url=${
|
|
421
|
+
`x-cisco-turn-url=${FAKE_TURN_URL1}`,
|
|
419
422
|
`x-cisco-turn-username=${FAKE_TURN_USERNAME}`,
|
|
420
423
|
`x-cisco-turn-password=${FAKE_TURN_PASSWORD}`,
|
|
421
424
|
],
|
|
@@ -428,7 +431,7 @@ describe('TurnDiscovery', () => {
|
|
|
428
431
|
|
|
429
432
|
const {turnServerInfo, turnDiscoverySkippedReason} = await result;
|
|
430
433
|
assert.deepEqual(turnServerInfo, {
|
|
431
|
-
|
|
434
|
+
urls: [FAKE_TURN_URL1],
|
|
432
435
|
username: FAKE_TURN_USERNAME,
|
|
433
436
|
password: FAKE_TURN_PASSWORD,
|
|
434
437
|
});
|
|
@@ -455,7 +458,7 @@ describe('TurnDiscovery', () => {
|
|
|
455
458
|
{
|
|
456
459
|
messageType: 'TURN_DISCOVERY_RESPONSE',
|
|
457
460
|
headers: [
|
|
458
|
-
`x-cisco-turn-url=${
|
|
461
|
+
`x-cisco-turn-url=${FAKE_TURN_URL1}`,
|
|
459
462
|
`x-cisco-turn-username=${FAKE_TURN_USERNAME}`,
|
|
460
463
|
`x-cisco-turn-password=${FAKE_TURN_PASSWORD}`,
|
|
461
464
|
],
|
|
@@ -471,7 +474,7 @@ describe('TurnDiscovery', () => {
|
|
|
471
474
|
const {turnServerInfo, turnDiscoverySkippedReason} = await result;
|
|
472
475
|
|
|
473
476
|
assert.deepEqual(turnServerInfo, {
|
|
474
|
-
|
|
477
|
+
urls: [FAKE_TURN_URL1],
|
|
475
478
|
username: FAKE_TURN_USERNAME,
|
|
476
479
|
password: FAKE_TURN_PASSWORD,
|
|
477
480
|
});
|
|
@@ -493,7 +496,7 @@ describe('TurnDiscovery', () => {
|
|
|
493
496
|
messageType: 'TURN_DISCOVERY_RESPONSE',
|
|
494
497
|
headers: [
|
|
495
498
|
'x-cisco-turn-unexpected-header=xxx',
|
|
496
|
-
`x-cisco-turn-url=${
|
|
499
|
+
`x-cisco-turn-url=${FAKE_TURN_URL1}`,
|
|
497
500
|
'x-cisco-some-other-header',
|
|
498
501
|
`x-cisco-turn-username=${FAKE_TURN_USERNAME}`,
|
|
499
502
|
`x-cisco-turn-password=${FAKE_TURN_PASSWORD}`,
|
|
@@ -510,7 +513,47 @@ describe('TurnDiscovery', () => {
|
|
|
510
513
|
|
|
511
514
|
const {turnServerInfo, turnDiscoverySkippedReason} = await result;
|
|
512
515
|
assert.deepEqual(turnServerInfo, {
|
|
513
|
-
|
|
516
|
+
urls: [FAKE_TURN_URL1],
|
|
517
|
+
username: FAKE_TURN_USERNAME,
|
|
518
|
+
password: FAKE_TURN_PASSWORD,
|
|
519
|
+
});
|
|
520
|
+
assert.isUndefined(turnDiscoverySkippedReason);
|
|
521
|
+
});
|
|
522
|
+
|
|
523
|
+
// this happens when we land on video-mesh nodes (VMN) - we will get a single empty url
|
|
524
|
+
it('filters out any empty TURN urls', async () => {
|
|
525
|
+
const td = new TurnDiscovery(mockRoapRequest);
|
|
526
|
+
const result = td.doTurnDiscovery(testMeeting, false);
|
|
527
|
+
|
|
528
|
+
// check that TURN_DISCOVERY_REQUEST was sent
|
|
529
|
+
await checkRoapMessageSent('TURN_DISCOVERY_REQUEST', 0);
|
|
530
|
+
// @ts-ignore
|
|
531
|
+
mockRoapRequest.sendRoap.resetHistory();
|
|
532
|
+
|
|
533
|
+
// simulate the response with some empty urls, normally there would be just 1, but we put more just for the sake of testing
|
|
534
|
+
td.handleTurnDiscoveryResponse(
|
|
535
|
+
{
|
|
536
|
+
messageType: 'TURN_DISCOVERY_RESPONSE',
|
|
537
|
+
headers: [
|
|
538
|
+
'x-cisco-turn-url=',
|
|
539
|
+
`x-cisco-turn-username=${FAKE_TURN_USERNAME}`,
|
|
540
|
+
'x-cisco-turn-url=',
|
|
541
|
+
`x-cisco-turn-password=${FAKE_TURN_PASSWORD}`,
|
|
542
|
+
'x-cisco-turn-url=non-empty-url',
|
|
543
|
+
'x-cisco-turn-url=',
|
|
544
|
+
],
|
|
545
|
+
},
|
|
546
|
+
'from test'
|
|
547
|
+
);
|
|
548
|
+
|
|
549
|
+
await testUtils.flushPromises();
|
|
550
|
+
|
|
551
|
+
// check that we've sent OK and still parsed the headers we care about
|
|
552
|
+
await checkRoapMessageSent('OK', 0);
|
|
553
|
+
|
|
554
|
+
const {turnServerInfo, turnDiscoverySkippedReason} = await result;
|
|
555
|
+
assert.deepEqual(turnServerInfo, {
|
|
556
|
+
urls: ['non-empty-url'], // empty urls should be filtered out
|
|
514
557
|
username: FAKE_TURN_USERNAME,
|
|
515
558
|
password: FAKE_TURN_PASSWORD,
|
|
516
559
|
});
|
|
@@ -575,7 +618,7 @@ describe('TurnDiscovery', () => {
|
|
|
575
618
|
{
|
|
576
619
|
messageType: 'TURN_DISCOVERY_RESPONSE',
|
|
577
620
|
headers: [
|
|
578
|
-
`x-cisco-turn-url=${
|
|
621
|
+
`x-cisco-turn-url=${FAKE_TURN_URL1}`,
|
|
579
622
|
`x-cisco-turn-username=${FAKE_TURN_USERNAME}`,
|
|
580
623
|
],
|
|
581
624
|
},
|
|
@@ -587,7 +630,7 @@ describe('TurnDiscovery', () => {
|
|
|
587
630
|
assert.isUndefined(turnServerInfo);
|
|
588
631
|
assert.equal(
|
|
589
632
|
turnDiscoverySkippedReason,
|
|
590
|
-
`failure: TURN_DISCOVERY_RESPONSE from test missing some headers: ["x-cisco-turn-url=${
|
|
633
|
+
`failure: TURN_DISCOVERY_RESPONSE from test missing some headers: ["x-cisco-turn-url=${FAKE_TURN_URL1}","x-cisco-turn-username=${FAKE_TURN_USERNAME}"]`
|
|
591
634
|
);
|
|
592
635
|
checkFailureMetricsSent();
|
|
593
636
|
});
|
|
@@ -655,7 +698,7 @@ describe('TurnDiscovery', () => {
|
|
|
655
698
|
{
|
|
656
699
|
messageType: 'TURN_DISCOVERY_RESPONSE',
|
|
657
700
|
headers: [
|
|
658
|
-
`x-cisco-turn-url=${
|
|
701
|
+
`x-cisco-turn-url=${FAKE_TURN_URL1}`,
|
|
659
702
|
`x-cisco-turn-username=${FAKE_TURN_USERNAME}`,
|
|
660
703
|
`x-cisco-turn-password=${FAKE_TURN_PASSWORD}`,
|
|
661
704
|
],
|
|
@@ -707,7 +750,7 @@ describe('TurnDiscovery', () => {
|
|
|
707
750
|
{
|
|
708
751
|
messageType: 'TURN_DISCOVERY_RESPONSE',
|
|
709
752
|
headers: [
|
|
710
|
-
`x-cisco-turn-url=${
|
|
753
|
+
`x-cisco-turn-url=${FAKE_TURN_URL1}`,
|
|
711
754
|
`x-cisco-turn-username=${FAKE_TURN_USERNAME}`,
|
|
712
755
|
`x-cisco-turn-password=${FAKE_TURN_PASSWORD}`,
|
|
713
756
|
],
|
|
@@ -816,7 +859,8 @@ describe('TurnDiscovery', () => {
|
|
|
816
859
|
errorType: undefined,
|
|
817
860
|
errorCause: undefined,
|
|
818
861
|
headers: [
|
|
819
|
-
`x-cisco-turn-url=${
|
|
862
|
+
`x-cisco-turn-url=${FAKE_TURN_URL1}`,
|
|
863
|
+
`x-cisco-turn-url=${FAKE_TURN_URL2}`,
|
|
820
864
|
`x-cisco-turn-username=${FAKE_TURN_USERNAME}`,
|
|
821
865
|
`x-cisco-turn-password=${FAKE_TURN_PASSWORD}`,
|
|
822
866
|
'noOkInTransaction',
|
|
@@ -902,7 +946,7 @@ describe('TurnDiscovery', () => {
|
|
|
902
946
|
|
|
903
947
|
assert.deepEqual(result, {
|
|
904
948
|
turnServerInfo: {
|
|
905
|
-
|
|
949
|
+
urls: [FAKE_TURN_URL1, FAKE_TURN_URL2],
|
|
906
950
|
username: FAKE_TURN_USERNAME,
|
|
907
951
|
password: FAKE_TURN_PASSWORD,
|
|
908
952
|
},
|
|
@@ -914,7 +958,7 @@ describe('TurnDiscovery', () => {
|
|
|
914
958
|
|
|
915
959
|
it('works as expected when httpResponse is missing some headers', async () => {
|
|
916
960
|
roapMessage.headers = [
|
|
917
|
-
`x-cisco-turn-url=${
|
|
961
|
+
`x-cisco-turn-url=${FAKE_TURN_URL1}`, // missing headers for username and password
|
|
918
962
|
];
|
|
919
963
|
|
|
920
964
|
const httpResponse = {mediaConnections: [{remoteSdp: JSON.stringify({roapMessage})}]};
|
|
@@ -930,7 +974,7 @@ describe('TurnDiscovery', () => {
|
|
|
930
974
|
assert.deepEqual(result, {
|
|
931
975
|
turnServerInfo: undefined,
|
|
932
976
|
turnDiscoverySkippedReason:
|
|
933
|
-
'failure: TURN_DISCOVERY_RESPONSE in http response missing some headers: ["x-cisco-turn-url=turns:
|
|
977
|
+
'failure: TURN_DISCOVERY_RESPONSE in http response missing some headers: ["x-cisco-turn-url=turns:fakeTurnServer1.com:443?transport=tcp"]',
|
|
934
978
|
});
|
|
935
979
|
assert.calledOnceWithExactly(handleTurnDiscoveryResponseSpy, roapMessage, 'in http response');
|
|
936
980
|
|
|
@@ -939,7 +983,7 @@ describe('TurnDiscovery', () => {
|
|
|
939
983
|
|
|
940
984
|
it('sends OK when required', async () => {
|
|
941
985
|
roapMessage.headers = [
|
|
942
|
-
`x-cisco-turn-url=${
|
|
986
|
+
`x-cisco-turn-url=${FAKE_TURN_URL1}`,
|
|
943
987
|
`x-cisco-turn-username=${FAKE_TURN_USERNAME}`,
|
|
944
988
|
`x-cisco-turn-password=${FAKE_TURN_PASSWORD}`,
|
|
945
989
|
// noOkInTransaction is missing
|
|
@@ -951,7 +995,7 @@ describe('TurnDiscovery', () => {
|
|
|
951
995
|
|
|
952
996
|
assert.deepEqual(result, {
|
|
953
997
|
turnServerInfo: {
|
|
954
|
-
|
|
998
|
+
urls: [FAKE_TURN_URL1],
|
|
955
999
|
username: FAKE_TURN_USERNAME,
|
|
956
1000
|
password: FAKE_TURN_PASSWORD,
|
|
957
1001
|
},
|
|
@@ -982,7 +1026,7 @@ describe('TurnDiscovery', () => {
|
|
|
982
1026
|
mediaConnections: [
|
|
983
1027
|
{
|
|
984
1028
|
mediaId: '464ff97f-4bda-466a-ad06-3a22184a2274',
|
|
985
|
-
remoteSdp: `{"roapMessage": {"messageType":"TURN_DISCOVERY_RESPONSE","seq":"0","headers": ["x-cisco-turn-url=${
|
|
1029
|
+
remoteSdp: `{"roapMessage": {"messageType":"TURN_DISCOVERY_RESPONSE","seq":"0","headers": ["x-cisco-turn-url=${FAKE_TURN_URL1}","x-cisco-turn-username=${FAKE_TURN_USERNAME}","x-cisco-turn-password=${FAKE_TURN_PASSWORD}", "noOkInTransaction"]}}`,
|
|
986
1030
|
},
|
|
987
1031
|
],
|
|
988
1032
|
});
|