@webex/plugin-meetings 2.37.0 → 2.37.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/UPGRADING.md +9 -9
- package/browsers.js +19 -24
- package/dist/common/browser-detection.js +1 -20
- package/dist/common/browser-detection.js.map +1 -1
- package/dist/common/collection.js +5 -20
- package/dist/common/collection.js.map +1 -1
- package/dist/common/config.js +0 -7
- package/dist/common/config.js.map +1 -1
- package/dist/common/errors/captcha-error.js +5 -26
- package/dist/common/errors/captcha-error.js.map +1 -1
- package/dist/common/errors/intent-to-join.js +5 -26
- package/dist/common/errors/intent-to-join.js.map +1 -1
- package/dist/common/errors/join-meeting.js +6 -27
- package/dist/common/errors/join-meeting.js.map +1 -1
- package/dist/common/errors/media.js +5 -26
- package/dist/common/errors/media.js.map +1 -1
- package/dist/common/errors/parameter.js +5 -33
- package/dist/common/errors/parameter.js.map +1 -1
- package/dist/common/errors/password-error.js +5 -26
- package/dist/common/errors/password-error.js.map +1 -1
- package/dist/common/errors/permission.js +4 -25
- package/dist/common/errors/permission.js.map +1 -1
- package/dist/common/errors/reconnection-in-progress.js +0 -17
- package/dist/common/errors/reconnection-in-progress.js.map +1 -1
- package/dist/common/errors/reconnection.js +5 -26
- package/dist/common/errors/reconnection.js.map +1 -1
- package/dist/common/errors/stats.js +5 -26
- package/dist/common/errors/stats.js.map +1 -1
- package/dist/common/errors/webex-errors.js +7 -46
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/common/errors/webex-meetings-error.js +1 -24
- package/dist/common/errors/webex-meetings-error.js.map +1 -1
- package/dist/common/events/events-scope.js +0 -22
- package/dist/common/events/events-scope.js.map +1 -1
- package/dist/common/events/events.js +0 -23
- package/dist/common/events/events.js.map +1 -1
- package/dist/common/events/trigger-proxy.js +0 -12
- package/dist/common/events/trigger-proxy.js.map +1 -1
- package/dist/common/events/util.js +0 -15
- package/dist/common/events/util.js.map +1 -1
- package/dist/common/logs/logger-config.js +0 -4
- package/dist/common/logs/logger-config.js.map +1 -1
- package/dist/common/logs/logger-proxy.js +1 -8
- package/dist/common/logs/logger-proxy.js.map +1 -1
- package/dist/common/logs/request.js +35 -61
- package/dist/common/logs/request.js.map +1 -1
- package/dist/common/queue.js +4 -14
- package/dist/common/queue.js.map +1 -1
- package/dist/config.js +1 -5
- package/dist/config.js.map +1 -1
- package/dist/constants.js +46 -42
- package/dist/constants.js.map +1 -1
- package/dist/index.js +1 -17
- package/dist/index.js.map +1 -1
- package/dist/locus-info/controlsUtils.js +10 -28
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/embeddedAppsUtils.js +3 -26
- package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
- package/dist/locus-info/fullState.js +0 -15
- package/dist/locus-info/fullState.js.map +1 -1
- package/dist/locus-info/hostUtils.js +4 -12
- package/dist/locus-info/hostUtils.js.map +1 -1
- package/dist/locus-info/index.js +101 -193
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js +0 -37
- package/dist/locus-info/infoUtils.js.map +1 -1
- package/dist/locus-info/mediaSharesUtils.js +12 -38
- package/dist/locus-info/mediaSharesUtils.js.map +1 -1
- package/dist/locus-info/parser.js +87 -123
- package/dist/locus-info/parser.js.map +1 -1
- package/dist/locus-info/selfUtils.js +16 -81
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/media/index.js +74 -137
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +64 -110
- package/dist/media/properties.js.map +1 -1
- package/dist/media/util.js +3 -17
- package/dist/media/util.js.map +1 -1
- package/dist/mediaQualityMetrics/config.js +10 -12
- package/dist/mediaQualityMetrics/config.js.map +1 -1
- package/dist/meeting/effectsState.js +120 -192
- package/dist/meeting/effectsState.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +0 -13
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +812 -1487
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/muteState.js +31 -78
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +157 -227
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/state.js +21 -31
- package/dist/meeting/state.js.map +1 -1
- package/dist/meeting/util.js +25 -169
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/collection.js +3 -25
- package/dist/meeting-info/collection.js.map +1 -1
- package/dist/meeting-info/index.js +10 -33
- package/dist/meeting-info/index.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +179 -268
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/request.js +1 -16
- package/dist/meeting-info/request.js.map +1 -1
- package/dist/meeting-info/util.js +98 -183
- package/dist/meeting-info/util.js.map +1 -1
- package/dist/meeting-info/utilv2.js +137 -228
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/collection.js +3 -21
- package/dist/meetings/collection.js.map +1 -1
- package/dist/meetings/index.js +451 -570
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/request.js +7 -30
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +94 -148
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +49 -89
- package/dist/member/index.js.map +1 -1
- package/dist/member/util.js +17 -68
- package/dist/member/util.js.map +1 -1
- package/dist/members/collection.js +2 -12
- package/dist/members/collection.js.map +1 -1
- package/dist/members/index.js +68 -184
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js +21 -56
- package/dist/members/request.js.map +1 -1
- package/dist/members/util.js +9 -38
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/config.js +0 -2
- package/dist/metrics/config.js.map +1 -1
- package/dist/metrics/constants.js +1 -2
- package/dist/metrics/constants.js.map +1 -1
- package/dist/metrics/index.js +48 -136
- package/dist/metrics/index.js.map +1 -1
- package/dist/networkQualityMonitor/index.js +28 -57
- package/dist/networkQualityMonitor/index.js.map +1 -1
- package/dist/peer-connection-manager/index.js +60 -190
- package/dist/peer-connection-manager/index.js.map +1 -1
- package/dist/peer-connection-manager/util.js +10 -24
- package/dist/peer-connection-manager/util.js.map +1 -1
- package/dist/personal-meeting-room/index.js +10 -45
- package/dist/personal-meeting-room/index.js.map +1 -1
- package/dist/personal-meeting-room/request.js +2 -33
- package/dist/personal-meeting-room/request.js.map +1 -1
- package/dist/personal-meeting-room/util.js +0 -13
- package/dist/personal-meeting-room/util.js.map +1 -1
- package/dist/reachability/index.js +100 -166
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/request.js +2 -18
- package/dist/reachability/request.js.map +1 -1
- package/dist/reactions/reactions.js +0 -2
- package/dist/reactions/reactions.js.map +1 -1
- package/dist/reactions/reactions.type.js +0 -5
- package/dist/reactions/reactions.type.js.map +1 -1
- package/dist/reconnection-manager/index.js +294 -468
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/roap/collection.js +1 -12
- package/dist/roap/collection.js.map +1 -1
- package/dist/roap/handler.js +15 -85
- package/dist/roap/handler.js.map +1 -1
- package/dist/roap/index.js +42 -94
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/request.js +81 -148
- package/dist/roap/request.js.map +1 -1
- package/dist/roap/state.js +2 -39
- package/dist/roap/state.js.map +1 -1
- package/dist/roap/turnDiscovery.js +8 -52
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/roap/util.js +0 -26
- package/dist/roap/util.js.map +1 -1
- package/dist/statsAnalyzer/global.js +0 -2
- package/dist/statsAnalyzer/global.js.map +1 -1
- package/dist/statsAnalyzer/index.js +68 -168
- package/dist/statsAnalyzer/index.js.map +1 -1
- package/dist/statsAnalyzer/mqaUtil.js +54 -53
- package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
- package/dist/transcription/index.js +13 -45
- package/dist/transcription/index.js.map +1 -1
- package/internal-README.md +7 -6
- package/package.json +17 -17
- package/src/common/browser-detection.ts +9 -6
- package/src/common/collection.ts +3 -1
- package/src/common/errors/captcha-error.ts +6 -6
- package/src/common/errors/intent-to-join.ts +6 -6
- package/src/common/errors/join-meeting.ts +12 -8
- package/src/common/errors/media.ts +6 -6
- package/src/common/errors/parameter.ts +9 -6
- package/src/common/errors/password-error.ts +6 -6
- package/src/common/errors/permission.ts +5 -5
- package/src/common/errors/reconnection.ts +6 -6
- package/src/common/errors/stats.ts +6 -6
- package/src/common/errors/webex-errors.ts +7 -5
- package/src/common/errors/webex-meetings-error.ts +1 -1
- package/src/common/events/events-scope.ts +5 -1
- package/src/common/events/events.ts +5 -1
- package/src/common/events/trigger-proxy.ts +8 -3
- package/src/common/events/util.ts +1 -2
- package/src/common/logs/logger-proxy.ts +21 -10
- package/src/common/logs/request.ts +11 -8
- package/src/config.ts +11 -11
- package/src/constants.ts +138 -119
- package/src/index.js +1 -1
- package/src/locus-info/controlsUtils.ts +34 -24
- package/src/locus-info/fullState.ts +15 -11
- package/src/locus-info/hostUtils.ts +4 -3
- package/src/locus-info/index.ts +25 -34
- package/src/locus-info/infoUtils.ts +12 -4
- package/src/locus-info/mediaSharesUtils.ts +4 -4
- package/src/locus-info/parser.ts +45 -68
- package/src/locus-info/selfUtils.ts +106 -57
- package/src/media/index.ts +118 -109
- package/src/media/properties.ts +26 -20
- package/src/media/util.ts +2 -2
- package/src/mediaQualityMetrics/config.ts +46 -46
- package/src/meeting/effectsState.ts +35 -35
- package/src/meeting/in-meeting-actions.ts +7 -3
- package/src/meeting/index.ts +1435 -1210
- package/src/meeting/muteState.ts +62 -31
- package/src/meeting/request.ts +160 -113
- package/src/meeting/state.ts +45 -30
- package/src/meeting/util.ts +131 -90
- package/src/meeting-info/collection.ts +2 -1
- package/src/meeting-info/index.ts +32 -30
- package/src/meeting-info/meeting-info-v2.ts +106 -108
- package/src/meeting-info/request.ts +9 -3
- package/src/meeting-info/util.ts +54 -46
- package/src/meeting-info/utilv2.ts +59 -53
- package/src/meetings/collection.ts +1 -1
- package/src/meetings/index.ts +513 -441
- package/src/meetings/request.ts +26 -24
- package/src/meetings/util.ts +26 -23
- package/src/member/index.ts +55 -49
- package/src/member/util.ts +26 -13
- package/src/members/collection.ts +0 -1
- package/src/members/index.ts +172 -121
- package/src/members/request.ts +46 -14
- package/src/members/util.ts +44 -42
- package/src/metrics/config.ts +254 -81
- package/src/metrics/constants.ts +0 -2
- package/src/metrics/index.ts +84 -71
- package/src/networkQualityMonitor/index.ts +20 -23
- package/src/peer-connection-manager/index.ts +321 -241
- package/src/peer-connection-manager/util.ts +4 -2
- package/src/personal-meeting-room/index.ts +12 -16
- package/src/personal-meeting-room/request.ts +10 -3
- package/src/personal-meeting-room/util.ts +3 -3
- package/src/reachability/index.ts +61 -59
- package/src/reachability/request.ts +36 -32
- package/src/reactions/reactions.ts +4 -4
- package/src/reactions/reactions.type.ts +2 -3
- package/src/reconnection-manager/index.ts +159 -98
- package/src/roap/collection.ts +2 -4
- package/src/roap/handler.ts +63 -32
- package/src/roap/index.ts +78 -58
- package/src/roap/request.ts +69 -54
- package/src/roap/state.ts +17 -11
- package/src/roap/turnDiscovery.ts +60 -31
- package/src/roap/util.ts +39 -31
- package/src/statsAnalyzer/global.ts +30 -33
- package/src/statsAnalyzer/index.ts +397 -169
- package/src/statsAnalyzer/mqaUtil.ts +178 -72
- package/src/transcription/index.ts +34 -32
- package/test/integration/spec/journey.js +666 -462
- package/test/integration/spec/space-meeting.js +318 -203
- package/test/integration/spec/transcription.js +6 -7
- package/test/unit/spec/common/browser-detection.js +9 -28
- package/test/unit/spec/fixture/locus.js +92 -90
- package/test/unit/spec/locus-info/controlsUtils.js +5 -5
- package/test/unit/spec/locus-info/embeddedAppsUtils.js +8 -6
- package/test/unit/spec/locus-info/index.js +1 -2
- package/test/unit/spec/locus-info/infoUtils.js +24 -31
- package/test/unit/spec/locus-info/lib/BasicSeqCmp.json +88 -430
- package/test/unit/spec/locus-info/lib/SeqCmp.json +513 -685
- package/test/unit/spec/locus-info/parser.js +3 -9
- package/test/unit/spec/locus-info/selfConstant.js +72 -103
- package/test/unit/spec/locus-info/selfUtils.js +21 -12
- package/test/unit/spec/meeting/effectsState.js +33 -45
- package/test/unit/spec/meeting/in-meeting-actions.ts +2 -3
- package/test/unit/spec/meeting/index.js +1141 -649
- package/test/unit/spec/meeting/muteState.js +42 -33
- package/test/unit/spec/meeting/request.js +56 -45
- package/test/unit/spec/meeting/utils.js +66 -49
- package/test/unit/spec/meeting-info/meetinginfov2.js +100 -73
- package/test/unit/spec/meeting-info/request.js +7 -9
- package/test/unit/spec/meeting-info/util.js +11 -12
- package/test/unit/spec/meeting-info/utilv2.js +110 -74
- package/test/unit/spec/meetings/collection.js +1 -1
- package/test/unit/spec/meetings/index.js +438 -257
- package/test/unit/spec/meetings/utils.js +14 -12
- package/test/unit/spec/member/index.js +0 -1
- package/test/unit/spec/member/util.js +5 -6
- package/test/unit/spec/members/index.js +84 -35
- package/test/unit/spec/members/request.js +29 -20
- package/test/unit/spec/members/utils.js +8 -5
- package/test/unit/spec/metrics/index.js +16 -21
- package/test/unit/spec/networkQualityMonitor/index.js +21 -15
- package/test/unit/spec/peerconnection-manager/index.js +88 -58
- package/test/unit/spec/peerconnection-manager/utils.js +5 -4
- package/test/unit/spec/peerconnection-manager/utils.test-fixtures.ts +7 -8
- package/test/unit/spec/personal-meeting-room/personal-meeting-room.js +2 -7
- package/test/unit/spec/reachability/index.ts +9 -11
- package/test/unit/spec/reconnection-manager/index.js +14 -17
- package/test/unit/spec/roap/index.ts +18 -8
- package/test/unit/spec/roap/turnDiscovery.ts +22 -19
- package/test/unit/spec/roap/util.js +3 -3
- package/test/unit/spec/stats-analyzer/index.js +29 -24
- package/test/utils/cmr.js +44 -42
- package/test/utils/testUtils.js +83 -74
- package/test/utils/webex-config.js +18 -18
- package/test/utils/webex-test-users.js +53 -50
package/src/roap/request.ts
CHANGED
|
@@ -3,14 +3,7 @@
|
|
|
3
3
|
import {StatelessWebexPlugin} from '@webex/webex-core';
|
|
4
4
|
|
|
5
5
|
import LoggerProxy from '../common/logs/logger-proxy';
|
|
6
|
-
import {
|
|
7
|
-
PARTICIPANT,
|
|
8
|
-
LOCI,
|
|
9
|
-
CALL,
|
|
10
|
-
MEDIA,
|
|
11
|
-
HTTP_VERBS,
|
|
12
|
-
REACHABILITY
|
|
13
|
-
} from '../constants';
|
|
6
|
+
import {PARTICIPANT, LOCI, CALL, MEDIA, HTTP_VERBS, REACHABILITY} from '../constants';
|
|
14
7
|
import Metrics from '../metrics';
|
|
15
8
|
import {eventType} from '../metrics/config';
|
|
16
9
|
import ParameterError from '../common/errors/parameter';
|
|
@@ -24,7 +17,6 @@ export default class RoapRequest extends StatelessWebexPlugin {
|
|
|
24
17
|
* @returns {Promise} returns a promise that resolves/rejects whatever the request does
|
|
25
18
|
*/
|
|
26
19
|
|
|
27
|
-
|
|
28
20
|
attachRechabilityData(localSdp) {
|
|
29
21
|
const reachabilityData = window.localStorage.getItem(REACHABILITY.localStorage);
|
|
30
22
|
|
|
@@ -36,9 +28,10 @@ export default class RoapRequest extends StatelessWebexPlugin {
|
|
|
36
28
|
if (reachabilityResult && Object.keys(reachabilityResult).length) {
|
|
37
29
|
localSdp.reachability = reachabilityResult;
|
|
38
30
|
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
31
|
+
} catch (e) {
|
|
32
|
+
LoggerProxy.logger.error(
|
|
33
|
+
`Roap:request#attachReachabilityData --> Error in parsing reachability data: ${e}`
|
|
34
|
+
);
|
|
42
35
|
}
|
|
43
36
|
}
|
|
44
37
|
|
|
@@ -47,7 +40,9 @@ export default class RoapRequest extends StatelessWebexPlugin {
|
|
|
47
40
|
|
|
48
41
|
joinMeetingWithRoap(options) {
|
|
49
42
|
LoggerProxy.logger.info('Roap:request#joinMeetingWithRoap --> Join locus with roap');
|
|
50
|
-
LoggerProxy.logger.info(
|
|
43
|
+
LoggerProxy.logger.info(
|
|
44
|
+
`Roap:request#joinMeetingWithRoap --> Local SDP: ${options.roapMessage}`
|
|
45
|
+
);
|
|
51
46
|
|
|
52
47
|
return Promise.resolve().then(async () => {
|
|
53
48
|
// @ts-ignore
|
|
@@ -60,37 +55,36 @@ export default class RoapRequest extends StatelessWebexPlugin {
|
|
|
60
55
|
correlationId: options.correlationId,
|
|
61
56
|
localMedias: [
|
|
62
57
|
{
|
|
63
|
-
localSdp: JSON.stringify(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
58
|
+
localSdp: JSON.stringify(
|
|
59
|
+
this.attachRechabilityData({
|
|
60
|
+
roapMessage: options.roapMessage,
|
|
61
|
+
audioMuted: false,
|
|
62
|
+
videoMuted: false,
|
|
63
|
+
})
|
|
64
|
+
),
|
|
65
|
+
},
|
|
69
66
|
],
|
|
70
67
|
clientMediaPreferences: {
|
|
71
|
-
preferTranscoding: options.preferTranscoding ?? true
|
|
72
|
-
}
|
|
68
|
+
preferTranscoding: options.preferTranscoding ?? true,
|
|
69
|
+
},
|
|
73
70
|
};
|
|
74
71
|
|
|
75
72
|
if (options.locusUrl) {
|
|
76
73
|
url = `${options.locusUrl}/${PARTICIPANT}`;
|
|
77
|
-
}
|
|
78
|
-
else if (options.sipUrl) {
|
|
74
|
+
} else if (options.sipUrl) {
|
|
79
75
|
try {
|
|
80
76
|
// @ts-ignore
|
|
81
77
|
await this.webex.internal.services.waitForCatalog('postauth');
|
|
82
78
|
// @ts-ignore
|
|
83
79
|
url = `${this.webex.internal.services.get('locus')}/${LOCI}/${CALL}`;
|
|
84
80
|
body.invitee = {
|
|
85
|
-
address: options.sipTarget
|
|
81
|
+
address: options.sipTarget,
|
|
86
82
|
};
|
|
87
|
-
}
|
|
88
|
-
catch (e) {
|
|
83
|
+
} catch (e) {
|
|
89
84
|
LoggerProxy.logger.error(`Roap:request#joinMeetingWithRoap --> ${e}`);
|
|
90
|
-
throw
|
|
85
|
+
throw e;
|
|
91
86
|
}
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
87
|
+
} else {
|
|
94
88
|
throw new ParameterError('Must provide a locusUrl or sipTarget');
|
|
95
89
|
}
|
|
96
90
|
|
|
@@ -99,19 +93,23 @@ export default class RoapRequest extends StatelessWebexPlugin {
|
|
|
99
93
|
.request({
|
|
100
94
|
method: HTTP_VERBS.POST,
|
|
101
95
|
uri: url,
|
|
102
|
-
body
|
|
96
|
+
body,
|
|
103
97
|
})
|
|
104
98
|
.then((res) => {
|
|
105
99
|
const {locus} = res.body;
|
|
106
100
|
|
|
107
101
|
locus.roapSeq = options.roapMessage.seq;
|
|
108
102
|
locus.id = locus.url.split('/').pop();
|
|
109
|
-
LoggerProxy.logger.info(
|
|
103
|
+
LoggerProxy.logger.info(
|
|
104
|
+
`Roap:request#joinMeetingWithRoap --> Joined locus [${locus.id}][${locus.fullState.lastActive}]`
|
|
105
|
+
);
|
|
110
106
|
|
|
111
107
|
return locus;
|
|
112
108
|
})
|
|
113
109
|
.catch((err) => {
|
|
114
|
-
LoggerProxy.logger.error(
|
|
110
|
+
LoggerProxy.logger.error(
|
|
111
|
+
`Roap:request#joinMeetingWithRoap --> failed with error: ${err}`
|
|
112
|
+
);
|
|
115
113
|
throw err;
|
|
116
114
|
});
|
|
117
115
|
});
|
|
@@ -139,9 +137,7 @@ export default class RoapRequest extends StatelessWebexPlugin {
|
|
|
139
137
|
meetingId: string;
|
|
140
138
|
preferTranscoding?: boolean;
|
|
141
139
|
}) {
|
|
142
|
-
const {
|
|
143
|
-
roapMessage, locusSelfUrl, mediaId, correlationId, meetingId
|
|
144
|
-
} = options;
|
|
140
|
+
const {roapMessage, locusSelfUrl, mediaId, correlationId, meetingId} = options;
|
|
145
141
|
|
|
146
142
|
if (!mediaId) {
|
|
147
143
|
LoggerProxy.logger.info('Roap:request#sendRoap --> Race Condition /call mediaID not present');
|
|
@@ -151,7 +147,9 @@ export default class RoapRequest extends StatelessWebexPlugin {
|
|
|
151
147
|
// @ts-ignore
|
|
152
148
|
const deviceUrl = this.webex.internal.device.url;
|
|
153
149
|
|
|
154
|
-
LoggerProxy.logger.info(
|
|
150
|
+
LoggerProxy.logger.info(
|
|
151
|
+
`Roap:request#sendRoap --> ${mediaUrl} \n ${roapMessage.messageType} \n seq:${roapMessage.seq}`
|
|
152
|
+
);
|
|
155
153
|
|
|
156
154
|
Metrics.postEvent({event: eventType.MEDIA_REQUEST, meetingId});
|
|
157
155
|
|
|
@@ -164,34 +162,43 @@ export default class RoapRequest extends StatelessWebexPlugin {
|
|
|
164
162
|
device: {
|
|
165
163
|
url: deviceUrl,
|
|
166
164
|
// @ts-ignore
|
|
167
|
-
deviceType: this.config.meetings.deviceType
|
|
165
|
+
deviceType: this.config.meetings.deviceType,
|
|
168
166
|
},
|
|
169
167
|
correlationId,
|
|
170
168
|
localMedias: [
|
|
171
169
|
{
|
|
172
|
-
localSdp: JSON.stringify(
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
170
|
+
localSdp: JSON.stringify(
|
|
171
|
+
this.attachRechabilityData({
|
|
172
|
+
roapMessage,
|
|
173
|
+
// eslint-disable-next-line no-warning-comments
|
|
174
|
+
// TODO: check whats the need for video and audiomute
|
|
175
|
+
audioMuted: !!options.audioMuted,
|
|
176
|
+
videoMuted: !!options.videoMuted,
|
|
177
|
+
})
|
|
178
|
+
),
|
|
179
|
+
mediaId: options.mediaId,
|
|
180
|
+
},
|
|
181
181
|
],
|
|
182
182
|
clientMediaPreferences: {
|
|
183
|
-
preferTranscoding: options.preferTranscoding ?? true
|
|
184
|
-
}
|
|
185
|
-
}
|
|
183
|
+
preferTranscoding: options.preferTranscoding ?? true,
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
186
|
})
|
|
187
187
|
.then((res) => {
|
|
188
188
|
Metrics.postEvent({event: eventType.MEDIA_RESPONSE, meetingId});
|
|
189
189
|
|
|
190
190
|
// always it will be the first mediaConnection Object
|
|
191
|
-
const mediaConnections =
|
|
191
|
+
const mediaConnections =
|
|
192
|
+
res.body.mediaConnections &&
|
|
193
|
+
res.body.mediaConnections.length > 0 &&
|
|
194
|
+
res.body.mediaConnections[0];
|
|
192
195
|
|
|
193
196
|
LoggerProxy.logger.info(
|
|
194
|
-
`Roap:request#sendRoap --> response:${JSON.stringify(
|
|
197
|
+
`Roap:request#sendRoap --> response:${JSON.stringify(
|
|
198
|
+
mediaConnections,
|
|
199
|
+
null,
|
|
200
|
+
2
|
|
201
|
+
)}'\n StatusCode:'${res.statusCode}`
|
|
195
202
|
);
|
|
196
203
|
const {locus} = res.body;
|
|
197
204
|
|
|
@@ -199,14 +206,22 @@ export default class RoapRequest extends StatelessWebexPlugin {
|
|
|
199
206
|
|
|
200
207
|
return {
|
|
201
208
|
locus,
|
|
202
|
-
...(mediaConnections && {mediaConnections: res.body.mediaConnections})
|
|
209
|
+
...(mediaConnections && {mediaConnections: res.body.mediaConnections}),
|
|
203
210
|
};
|
|
204
211
|
})
|
|
205
212
|
.catch((err) => {
|
|
206
|
-
Metrics.postEvent({
|
|
213
|
+
Metrics.postEvent({
|
|
214
|
+
event: eventType.MEDIA_RESPONSE,
|
|
215
|
+
meetingId,
|
|
216
|
+
data: {error: Metrics.parseLocusError(err, true)},
|
|
217
|
+
});
|
|
207
218
|
LoggerProxy.logger.error(`Roap:request#sendRoap --> Error:${JSON.stringify(err, null, 2)}`);
|
|
208
219
|
LoggerProxy.logger.error(
|
|
209
|
-
`Roap:request#sendRoapRequest --> errorBody:${JSON.stringify(
|
|
220
|
+
`Roap:request#sendRoapRequest --> errorBody:${JSON.stringify(
|
|
221
|
+
roapMessage,
|
|
222
|
+
null,
|
|
223
|
+
2
|
|
224
|
+
)} + '\\n mediaId:'${options.mediaId}`
|
|
210
225
|
);
|
|
211
226
|
throw err;
|
|
212
227
|
});
|
package/src/roap/state.ts
CHANGED
|
@@ -19,8 +19,14 @@ const shouldStep = (roap, meeting) => {
|
|
|
19
19
|
return false;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
LoggerProxy.logger.log(
|
|
23
|
-
|
|
22
|
+
LoggerProxy.logger.log(
|
|
23
|
+
'Roap:state#shouldStep --> RoapStateMachine: PeerConnectionState, ',
|
|
24
|
+
meeting.mediaProperties.peerConnection.signalingState
|
|
25
|
+
);
|
|
26
|
+
LoggerProxy.logger.log(
|
|
27
|
+
'Roap:state#shouldStep --> RoapStateMachine: success save proceeding with transition, ',
|
|
28
|
+
roap.msg
|
|
29
|
+
);
|
|
24
30
|
|
|
25
31
|
return true;
|
|
26
32
|
};
|
|
@@ -49,7 +55,9 @@ const handleTransition = (value, signal, meeting) => {
|
|
|
49
55
|
if (meeting.mediaId) {
|
|
50
56
|
return ROAP.ROAP_STATE.WAIT_TX_OK;
|
|
51
57
|
}
|
|
52
|
-
LoggerProxy.logger.error(
|
|
58
|
+
LoggerProxy.logger.error(
|
|
59
|
+
'Roap:state#handleTransition --> Race Condition no mediaId, continuing.'
|
|
60
|
+
);
|
|
53
61
|
|
|
54
62
|
return value;
|
|
55
63
|
}
|
|
@@ -124,8 +132,8 @@ const RoapStateMachine = {
|
|
|
124
132
|
}
|
|
125
133
|
|
|
126
134
|
return handleTransition(value, signal, meeting);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
135
|
+
},
|
|
136
|
+
},
|
|
129
137
|
],
|
|
130
138
|
methods: {
|
|
131
139
|
/**
|
|
@@ -135,16 +143,14 @@ const RoapStateMachine = {
|
|
|
135
143
|
*/
|
|
136
144
|
onAfterStep(transition: any) {
|
|
137
145
|
LoggerProxy.logger.log(
|
|
138
|
-
`Roap:state#onAfterStep --> RoapStateMachine->onAfterStep#fired! State changed from '${transition.from}' to '${
|
|
139
|
-
transition.to
|
|
140
|
-
}' with transition '${transition.transition}''.`
|
|
146
|
+
`Roap:state#onAfterStep --> RoapStateMachine->onAfterStep#fired! State changed from '${transition.from}' to '${transition.to}' with transition '${transition.transition}''.`
|
|
141
147
|
);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
148
|
+
},
|
|
149
|
+
},
|
|
144
150
|
});
|
|
145
151
|
|
|
146
152
|
return new RoapState();
|
|
147
|
-
}
|
|
153
|
+
},
|
|
148
154
|
};
|
|
149
155
|
|
|
150
156
|
export default RoapStateMachine;
|
|
@@ -42,7 +42,6 @@ export default class TurnDiscovery {
|
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
|
|
46
45
|
/**
|
|
47
46
|
* waits for TURN_DISCOVERY_RESPONSE message to arrive
|
|
48
47
|
*
|
|
@@ -52,20 +51,28 @@ export default class TurnDiscovery {
|
|
|
52
51
|
*/
|
|
53
52
|
private waitForTurnDiscoveryResponse() {
|
|
54
53
|
if (!this.defer) {
|
|
55
|
-
LoggerProxy.logger.warn(
|
|
54
|
+
LoggerProxy.logger.warn(
|
|
55
|
+
'Roap:turnDiscovery#waitForTurnDiscoveryResponse --> TURN discovery is not in progress'
|
|
56
|
+
);
|
|
56
57
|
|
|
57
|
-
return Promise.reject(
|
|
58
|
+
return Promise.reject(
|
|
59
|
+
new Error('waitForTurnDiscoveryResponse() called before sendRoapTurnDiscoveryRequest()')
|
|
60
|
+
);
|
|
58
61
|
}
|
|
59
62
|
|
|
60
63
|
const {defer} = this;
|
|
61
64
|
|
|
62
65
|
this.responseTimer = setTimeout(() => {
|
|
63
|
-
LoggerProxy.logger.warn(
|
|
66
|
+
LoggerProxy.logger.warn(
|
|
67
|
+
`Roap:turnDiscovery#waitForTurnDiscoveryResponse --> timeout! no response arrived within ${TURN_DISCOVERY_TIMEOUT} seconds`
|
|
68
|
+
);
|
|
64
69
|
|
|
65
70
|
defer.reject(new Error('Timed out waiting for TURN_DISCOVERY_RESPONSE'));
|
|
66
71
|
}, TURN_DISCOVERY_TIMEOUT * 1000);
|
|
67
72
|
|
|
68
|
-
LoggerProxy.logger.info(
|
|
73
|
+
LoggerProxy.logger.info(
|
|
74
|
+
'Roap:turnDiscovery#waitForTurnDiscoveryResponse --> waiting for TURN_DISCOVERY_RESPONSE...'
|
|
75
|
+
);
|
|
69
76
|
|
|
70
77
|
return defer.promise;
|
|
71
78
|
}
|
|
@@ -83,7 +90,9 @@ export default class TurnDiscovery {
|
|
|
83
90
|
const {headers} = roapMessage;
|
|
84
91
|
|
|
85
92
|
if (!this.defer) {
|
|
86
|
-
LoggerProxy.logger.warn(
|
|
93
|
+
LoggerProxy.logger.warn(
|
|
94
|
+
'Roap:turnDiscovery#handleTurnDiscoveryResponse --> unexpected TURN discovery response'
|
|
95
|
+
);
|
|
87
96
|
|
|
88
97
|
return;
|
|
89
98
|
}
|
|
@@ -100,7 +109,9 @@ export default class TurnDiscovery {
|
|
|
100
109
|
// check if it matches any of our expected headers
|
|
101
110
|
expectedHeaders.forEach((expectedHeader) => {
|
|
102
111
|
if (receivedHeader.startsWith(`${expectedHeader.headerName}=`)) {
|
|
103
|
-
this.turnInfo[expectedHeader.field] = receivedHeader.substring(
|
|
112
|
+
this.turnInfo[expectedHeader.field] = receivedHeader.substring(
|
|
113
|
+
expectedHeader.headerName.length + 1
|
|
114
|
+
);
|
|
104
115
|
foundHeaders += 1;
|
|
105
116
|
}
|
|
106
117
|
});
|
|
@@ -110,11 +121,18 @@ export default class TurnDiscovery {
|
|
|
110
121
|
this.responseTimer = undefined;
|
|
111
122
|
|
|
112
123
|
if (foundHeaders !== expectedHeaders.length) {
|
|
113
|
-
LoggerProxy.logger.warn(
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
124
|
+
LoggerProxy.logger.warn(
|
|
125
|
+
`Roap:turnDiscovery#handleTurnDiscoveryResponse --> missing some headers, received: ${JSON.stringify(
|
|
126
|
+
headers
|
|
127
|
+
)}`
|
|
128
|
+
);
|
|
129
|
+
this.defer.reject(
|
|
130
|
+
new Error(`TURN_DISCOVERY_RESPONSE missing some headers: ${JSON.stringify(headers)}`)
|
|
131
|
+
);
|
|
132
|
+
} else {
|
|
133
|
+
LoggerProxy.logger.info(
|
|
134
|
+
`Roap:turnDiscovery#handleTurnDiscoveryResponse --> received a valid response, url=${this.turnInfo.url}`
|
|
135
|
+
);
|
|
118
136
|
this.defer.resolve();
|
|
119
137
|
}
|
|
120
138
|
}
|
|
@@ -132,7 +150,9 @@ export default class TurnDiscovery {
|
|
|
132
150
|
const seq = meeting.roapSeq + 1;
|
|
133
151
|
|
|
134
152
|
if (this.defer) {
|
|
135
|
-
LoggerProxy.logger.warn(
|
|
153
|
+
LoggerProxy.logger.warn(
|
|
154
|
+
'Roap:turnDiscovery#sendRoapTurnDiscoveryRequest --> already in progress'
|
|
155
|
+
);
|
|
136
156
|
|
|
137
157
|
return Promise.resolve();
|
|
138
158
|
}
|
|
@@ -145,19 +165,21 @@ export default class TurnDiscovery {
|
|
|
145
165
|
seq,
|
|
146
166
|
};
|
|
147
167
|
|
|
148
|
-
LoggerProxy.logger.info(
|
|
168
|
+
LoggerProxy.logger.info(
|
|
169
|
+
'Roap:turnDiscovery#sendRoapTurnDiscoveryRequest --> sending TURN_DISCOVERY_REQUEST'
|
|
170
|
+
);
|
|
149
171
|
|
|
150
172
|
return this.roapRequest
|
|
151
173
|
.sendRoap({
|
|
152
174
|
roapMessage,
|
|
153
175
|
correlationId: meeting.correlationId,
|
|
154
|
-
|
|
176
|
+
// @ts-ignore - Fix missing type
|
|
155
177
|
locusSelfUrl: meeting.selfUrl,
|
|
156
178
|
// @ts-ignore - Fix missing type
|
|
157
179
|
mediaId: isReconnecting ? '' : meeting.mediaId,
|
|
158
180
|
audioMuted: meeting.isAudioMuted(),
|
|
159
181
|
videoMuted: meeting.isVideoMuted(),
|
|
160
|
-
meetingId: meeting.id
|
|
182
|
+
meetingId: meeting.id,
|
|
161
183
|
})
|
|
162
184
|
.then(({mediaConnections}) => {
|
|
163
185
|
meeting.setRoapSeq(seq);
|
|
@@ -182,7 +204,7 @@ export default class TurnDiscovery {
|
|
|
182
204
|
roapMessage: {
|
|
183
205
|
messageType: ROAP.ROAP_TYPES.OK,
|
|
184
206
|
version: ROAP.ROAP_VERSION,
|
|
185
|
-
seq: meeting.roapSeq
|
|
207
|
+
seq: meeting.roapSeq,
|
|
186
208
|
},
|
|
187
209
|
// @ts-ignore - fix type
|
|
188
210
|
locusSelfUrl: meeting.selfUrl,
|
|
@@ -191,7 +213,7 @@ export default class TurnDiscovery {
|
|
|
191
213
|
correlationId: meeting.correlationId,
|
|
192
214
|
audioMuted: meeting.isAudioMuted(),
|
|
193
215
|
videoMuted: meeting.isVideoMuted(),
|
|
194
|
-
meetingId: meeting.id
|
|
216
|
+
meetingId: meeting.id,
|
|
195
217
|
});
|
|
196
218
|
}
|
|
197
219
|
|
|
@@ -213,13 +235,21 @@ export default class TurnDiscovery {
|
|
|
213
235
|
const isAnyClusterReachable = meeting.webex.meetings.reachability.isAnyClusterReachable();
|
|
214
236
|
|
|
215
237
|
if (isAnyClusterReachable) {
|
|
216
|
-
LoggerProxy.logger.info(
|
|
217
|
-
|
|
238
|
+
LoggerProxy.logger.info(
|
|
239
|
+
'Roap:turnDiscovery#doTurnDiscovery --> reachability has not failed, skipping TURN discovery'
|
|
240
|
+
);
|
|
241
|
+
|
|
242
|
+
return Promise.resolve({
|
|
243
|
+
turnServerInfo: undefined,
|
|
244
|
+
turnDiscoverySkippedReason: 'reachability',
|
|
245
|
+
});
|
|
218
246
|
}
|
|
219
247
|
|
|
220
248
|
// @ts-ignore - fix type
|
|
221
249
|
if (!meeting.config.experimental.enableTurnDiscovery) {
|
|
222
|
-
LoggerProxy.logger.info(
|
|
250
|
+
LoggerProxy.logger.info(
|
|
251
|
+
'Roap:turnDiscovery#doTurnDiscovery --> TURN discovery disabled in config, skipping it'
|
|
252
|
+
);
|
|
223
253
|
|
|
224
254
|
return Promise.resolve({turnServerInfo: undefined, turnDiscoverySkippedReason: 'config'});
|
|
225
255
|
}
|
|
@@ -236,18 +266,17 @@ export default class TurnDiscovery {
|
|
|
236
266
|
})
|
|
237
267
|
.catch((e) => {
|
|
238
268
|
// we catch any errors and resolve with no turn information so that the normal call join flow can continue without TURN
|
|
239
|
-
LoggerProxy.logger.info(
|
|
240
|
-
|
|
241
|
-
Metrics.sendBehavioralMetric(
|
|
242
|
-
BEHAVIORAL_METRICS.TURN_DISCOVERY_FAILURE,
|
|
243
|
-
{
|
|
244
|
-
correlation_id: meeting.correlationId,
|
|
245
|
-
locus_id: meeting.locusUrl.split('/').pop(),
|
|
246
|
-
reason: e.message,
|
|
247
|
-
stack: e.stack
|
|
248
|
-
}
|
|
269
|
+
LoggerProxy.logger.info(
|
|
270
|
+
`Roap:turnDiscovery#doTurnDiscovery --> TURN discovery failed, continuing without TURN: ${e}`
|
|
249
271
|
);
|
|
250
272
|
|
|
273
|
+
Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.TURN_DISCOVERY_FAILURE, {
|
|
274
|
+
correlation_id: meeting.correlationId,
|
|
275
|
+
locus_id: meeting.locusUrl.split('/').pop(),
|
|
276
|
+
reason: e.message,
|
|
277
|
+
stack: e.stack,
|
|
278
|
+
});
|
|
279
|
+
|
|
251
280
|
return Promise.resolve({turnServerInfo: undefined, turnDiscoverySkippedReason: undefined});
|
|
252
281
|
});
|
|
253
282
|
}
|
package/src/roap/util.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import PeerConnectionManager from '../peer-connection-manager';
|
|
2
|
-
import {
|
|
3
|
-
_ANSWER_,
|
|
4
|
-
_ERROR_,
|
|
5
|
-
_CONFLICT_,
|
|
6
|
-
ROAP,
|
|
7
|
-
SDP
|
|
8
|
-
} from '../constants';
|
|
2
|
+
import {_ANSWER_, _ERROR_, _CONFLICT_, ROAP, SDP} from '../constants';
|
|
9
3
|
import LoggerProxy from '../common/logs/logger-proxy';
|
|
10
4
|
import ParameterError from '../common/errors/parameter';
|
|
11
5
|
|
|
@@ -34,10 +28,16 @@ RoapUtil.handleError = (pc) =>
|
|
|
34
28
|
});
|
|
35
29
|
|
|
36
30
|
RoapUtil.findError = (messageType, errorType, type) =>
|
|
37
|
-
(type === ROAP.RECEIVE_ROAP_MSG || type === ROAP.SEND_ROAP_MSG) &&
|
|
31
|
+
(type === ROAP.RECEIVE_ROAP_MSG || type === ROAP.SEND_ROAP_MSG) &&
|
|
32
|
+
messageType === _ERROR_ &&
|
|
33
|
+
errorType === _CONFLICT_;
|
|
38
34
|
|
|
39
35
|
RoapUtil.ensureMeeting = (meeting, type) => {
|
|
40
|
-
if (
|
|
36
|
+
if (
|
|
37
|
+
type === ROAP.RECEIVE_ROAP_MSG ||
|
|
38
|
+
type === ROAP.SEND_ROAP_MSG ||
|
|
39
|
+
type === ROAP.SEND_ROAP_MSG_SUCCESS
|
|
40
|
+
) {
|
|
41
41
|
if (!meeting) {
|
|
42
42
|
return false;
|
|
43
43
|
}
|
|
@@ -46,25 +46,30 @@ RoapUtil.ensureMeeting = (meeting, type) => {
|
|
|
46
46
|
return true;
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
RoapUtil.updatePeerConnection = (meeting, session) =>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
49
|
+
RoapUtil.updatePeerConnection = (meeting, session) =>
|
|
50
|
+
PeerConnectionManager.updatePeerConnection(
|
|
51
|
+
{
|
|
52
|
+
offerSdp: session.OFFER.sdps,
|
|
53
|
+
peerConnection: meeting.mediaProperties.peerConnection,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
meetingId: meeting.id,
|
|
57
|
+
remoteQualityLevel: meeting.mediaProperties.remoteQualityLevel,
|
|
58
|
+
}
|
|
59
|
+
).then((res) => {
|
|
58
60
|
meeting.roap.lastRoapOffer = session.OFFER.sdps;
|
|
59
61
|
|
|
60
62
|
return res;
|
|
61
63
|
});
|
|
62
64
|
|
|
63
|
-
|
|
64
65
|
RoapUtil.setRemoteDescription = (meeting, session) => {
|
|
65
|
-
LoggerProxy.logger.info(
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
LoggerProxy.logger.info(
|
|
67
|
+
`Roap:util#setRemoteDescription --> Transmit WAIT_TX_OK, correlationId: ${meeting.correlationId}`
|
|
68
|
+
);
|
|
69
|
+
if (!(meeting && meeting.mediaProperties.peerConnection)) {
|
|
70
|
+
LoggerProxy.logger.error(
|
|
71
|
+
`Roap:util#setRemoteDescription --> DANGER no media or screen peer connection, correlationId: ${meeting.correlationId}`
|
|
72
|
+
);
|
|
68
73
|
|
|
69
74
|
return Promise.reject(new ParameterError('Must provide a media or screen peer connection'));
|
|
70
75
|
}
|
|
@@ -74,15 +79,18 @@ RoapUtil.setRemoteDescription = (meeting, session) => {
|
|
|
74
79
|
ROAP_ANSWER,
|
|
75
80
|
session.ANSWER.sdps[0],
|
|
76
81
|
meeting.id
|
|
77
|
-
)
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
)
|
|
83
|
+
.then(() => {
|
|
84
|
+
LoggerProxy.logger.info(
|
|
85
|
+
`Roap:util#setRemoteDescription --> Success for correlationId: ${meeting.correlationId}`
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
return {
|
|
89
|
+
seq: session.ANSWER.seq,
|
|
90
|
+
mediaId: meeting.mediaId,
|
|
91
|
+
correlationId: meeting.correlationId,
|
|
92
|
+
};
|
|
93
|
+
})
|
|
86
94
|
.catch((err) => {
|
|
87
95
|
LoggerProxy.logger.error(`Roap:util#setRemoteDescription --> ${err}`);
|
|
88
96
|
throw err;
|