@webex/plugin-meetings 2.36.1 → 2.37.1
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/handler.ts
CHANGED
|
@@ -11,7 +11,6 @@ import RoapUtil from './util';
|
|
|
11
11
|
import RoapCollection from './collection';
|
|
12
12
|
import Meeting from '../meeting';
|
|
13
13
|
|
|
14
|
-
|
|
15
14
|
const checkForAndHandleErrors = (action, meeting, correlationId) => {
|
|
16
15
|
if (action && action.type) {
|
|
17
16
|
if (action.msg && action.msg.messageType && action.msg.errorType) {
|
|
@@ -23,7 +22,9 @@ const checkForAndHandleErrors = (action, meeting, correlationId) => {
|
|
|
23
22
|
}
|
|
24
23
|
})
|
|
25
24
|
.catch((err) => {
|
|
26
|
-
LoggerProxy.logger.warn(
|
|
25
|
+
LoggerProxy.logger.warn(
|
|
26
|
+
`Roap:handler#checkForAndHandleErrors --> Cannot reset the peer connection with error: ${err}`
|
|
27
|
+
);
|
|
27
28
|
});
|
|
28
29
|
|
|
29
30
|
return true;
|
|
@@ -37,11 +38,11 @@ const checkForAndHandleErrors = (action, meeting, correlationId) => {
|
|
|
37
38
|
return false;
|
|
38
39
|
};
|
|
39
40
|
|
|
40
|
-
const compareWithLastRoapMessage = (lastRoapMessage, currentRoapMessage) =>
|
|
41
|
+
const compareWithLastRoapMessage = (lastRoapMessage, currentRoapMessage) =>
|
|
42
|
+
lastRoapMessage?.msg?.seq === currentRoapMessage.msg.seq &&
|
|
43
|
+
lastRoapMessage?.msg?.messageType === currentRoapMessage.msg.messageType;
|
|
41
44
|
|
|
42
|
-
const handleSessionStep = ({
|
|
43
|
-
roap, session, locusUrl, correlationId
|
|
44
|
-
}) => {
|
|
45
|
+
const handleSessionStep = ({roap, session, locusUrl, correlationId}) => {
|
|
45
46
|
const {seq: sequenceId, messageType} = roap.msg;
|
|
46
47
|
|
|
47
48
|
if (session.OFFER && messageType === _OFFER_) {
|
|
@@ -51,15 +52,22 @@ const handleSessionStep = ({
|
|
|
51
52
|
const data = {
|
|
52
53
|
correlation_id: correlationId,
|
|
53
54
|
locus_id: locusUrl.split('/').pop(),
|
|
54
|
-
sequence: sequenceId
|
|
55
|
+
sequence: sequenceId,
|
|
55
56
|
};
|
|
56
57
|
|
|
57
58
|
Metrics.sendBehavioralMetric(metricName, data);
|
|
58
59
|
|
|
59
|
-
LoggerProxy.logger.warn(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
LoggerProxy.logger.warn(
|
|
61
|
+
`Roap:handler#handleSessionStep --> Glare condition occurred with new mercury event, sequenceId: ${sequenceId}`
|
|
62
|
+
);
|
|
63
|
+
} else {
|
|
64
|
+
LoggerProxy.logger.info(
|
|
65
|
+
`Roap:handler#handleSessionStep --> Save OFFER/ANSWER seq:${sequenceId} new mercury event ${messageType}local state: ${JSON.stringify(
|
|
66
|
+
session.state.state,
|
|
67
|
+
null,
|
|
68
|
+
2
|
|
69
|
+
)}`
|
|
70
|
+
);
|
|
63
71
|
session[messageType] = roap.msg;
|
|
64
72
|
session[messageType].remote = !!roap.remote;
|
|
65
73
|
}
|
|
@@ -75,7 +83,7 @@ export default class RoapHandler extends StatelessWebexPlugin {
|
|
|
75
83
|
roapAnswer: any;
|
|
76
84
|
roapFinished: any;
|
|
77
85
|
roapOk: any;
|
|
78
|
-
|
|
86
|
+
|
|
79
87
|
constructor(attrs, options, roapOk, roapAnswer, roapFinished) {
|
|
80
88
|
super({}, options);
|
|
81
89
|
this.attrs = attrs;
|
|
@@ -99,7 +107,7 @@ export default class RoapHandler extends StatelessWebexPlugin {
|
|
|
99
107
|
this.roapFinished(meeting.correlationId, action.msg.seq);
|
|
100
108
|
break;
|
|
101
109
|
|
|
102
|
-
|
|
110
|
+
// TODO: (important )handle roap state for sending offers as well
|
|
103
111
|
// case ROAP.ROAP_STATE.WAIT_RX_OFFER:
|
|
104
112
|
// case ROAP.ROAP_STATE.WAIT_RX_ANSWER:
|
|
105
113
|
// case ROAP.ROAP_STATE.WAIT_RX_OK:
|
|
@@ -116,7 +124,7 @@ export default class RoapHandler extends StatelessWebexPlugin {
|
|
|
116
124
|
seq: session.OFFER.seq,
|
|
117
125
|
correlationId: meeting.correlationId,
|
|
118
126
|
audioMuted: meeting.isAudioMuted(),
|
|
119
|
-
videoMuted: meeting.isVideoMuted()
|
|
127
|
+
videoMuted: meeting.isVideoMuted(),
|
|
120
128
|
});
|
|
121
129
|
})
|
|
122
130
|
.catch((error) => {
|
|
@@ -125,14 +133,16 @@ export default class RoapHandler extends StatelessWebexPlugin {
|
|
|
125
133
|
correlation_id: meeting.correlationId,
|
|
126
134
|
locus_id: meeting.locusUrl.split('/').pop(),
|
|
127
135
|
reason: error.message,
|
|
128
|
-
stack: error.stack
|
|
136
|
+
stack: error.stack,
|
|
129
137
|
};
|
|
130
138
|
const metadata = {
|
|
131
|
-
type: error.name
|
|
139
|
+
type: error.name,
|
|
132
140
|
};
|
|
133
141
|
|
|
134
142
|
Metrics.sendBehavioralMetric(metricName, data, metadata);
|
|
135
|
-
LoggerProxy.logger.error(
|
|
143
|
+
LoggerProxy.logger.error(
|
|
144
|
+
`Roap:handler#perform --> Error occured during wait receive answer, continuing, ${error}`
|
|
145
|
+
);
|
|
136
146
|
});
|
|
137
147
|
}
|
|
138
148
|
break;
|
|
@@ -145,18 +155,25 @@ export default class RoapHandler extends StatelessWebexPlugin {
|
|
|
145
155
|
break;
|
|
146
156
|
// case ROAP.ROAP_STATE.IDLE_LOCAL_OFFER:
|
|
147
157
|
case ROAP.ROAP_STATE.ERROR:
|
|
148
|
-
LoggerProxy.logger.error(
|
|
158
|
+
LoggerProxy.logger.error(
|
|
159
|
+
`Roap:handler#perform --> Roap State ERROR for session: ${session}`
|
|
160
|
+
);
|
|
149
161
|
break;
|
|
150
162
|
case ROAP.ROAP_STATE.GLARE:
|
|
151
163
|
session.GLARE_OFFER.tieBreaker = session.GLARE_OFFER.tieBreaker || 0;
|
|
152
164
|
session.OFFER.tieBreaker = session.OFFER.tieBreaker || 0;
|
|
153
|
-
LoggerProxy.logger.warn(
|
|
165
|
+
LoggerProxy.logger.warn(
|
|
166
|
+
'Roap:handler#perform --> Roap State resolved the GLARE condition.'
|
|
167
|
+
);
|
|
154
168
|
if (session.GLARE_OFFER.tieBreaker < session.OFFER.tieBreaker) {
|
|
155
169
|
// 2
|
|
156
|
-
LoggerProxy.logger.log(
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
170
|
+
LoggerProxy.logger.log(
|
|
171
|
+
'Roap:handler#perform --> Roap State local offer won after GLARE.'
|
|
172
|
+
);
|
|
173
|
+
} else {
|
|
174
|
+
LoggerProxy.logger.log(
|
|
175
|
+
'Roap:handler#perform --> Roap State remote offer won after GLARE.'
|
|
176
|
+
);
|
|
160
177
|
}
|
|
161
178
|
session.state.step(ROAP.ROAP_SIGNAL.GLARE_RESOLVED, meeting, action);
|
|
162
179
|
// @ts-ignore
|
|
@@ -182,7 +199,7 @@ export default class RoapHandler extends StatelessWebexPlugin {
|
|
|
182
199
|
roap: action,
|
|
183
200
|
locusUrl: meeting.locusUrl,
|
|
184
201
|
correlationId: meeting.correlationId,
|
|
185
|
-
session
|
|
202
|
+
session,
|
|
186
203
|
});
|
|
187
204
|
signal = ROAP.ROAP_SIGNAL[`${prefix}${action.msg.messageType}`];
|
|
188
205
|
session.state.step(signal, meeting, action);
|
|
@@ -201,21 +218,29 @@ export default class RoapHandler extends StatelessWebexPlugin {
|
|
|
201
218
|
handleAction(session: object, action: any, meeting: Meeting, correlationId: string) {
|
|
202
219
|
let signal;
|
|
203
220
|
|
|
204
|
-
|
|
205
221
|
switch (action.type) {
|
|
206
222
|
case ROAP.RECEIVE_ROAP_MSG:
|
|
207
|
-
LoggerProxy.logger.log(
|
|
223
|
+
LoggerProxy.logger.log(
|
|
224
|
+
`Roap:handler#handleAction --> RECEIVE_ROAP_MSG event captured, reciving a roap message : ${JSON.stringify(
|
|
225
|
+
action
|
|
226
|
+
)}`
|
|
227
|
+
);
|
|
208
228
|
if (compareWithLastRoapMessage(this.lastRoapMessage, action)) {
|
|
209
|
-
LoggerProxy.logger.warn(
|
|
210
|
-
|
|
211
|
-
|
|
229
|
+
LoggerProxy.logger.warn(
|
|
230
|
+
`Roap:handler#handleAction --> duplicate roap offer from server: ${action.msg.seq}`
|
|
231
|
+
);
|
|
232
|
+
} else {
|
|
212
233
|
this.lastRoapMessage = action;
|
|
213
234
|
action.remote = true;
|
|
214
235
|
this.execute(signal, session, action, meeting, ROAP.RX_);
|
|
215
236
|
}
|
|
216
237
|
break;
|
|
217
238
|
case ROAP.SEND_ROAP_MSG:
|
|
218
|
-
LoggerProxy.logger.log(
|
|
239
|
+
LoggerProxy.logger.log(
|
|
240
|
+
`Roap:handler#handleAction --> SEND_ROAP_MSG event captured, sending roap message ${JSON.stringify(
|
|
241
|
+
action
|
|
242
|
+
)}`
|
|
243
|
+
);
|
|
219
244
|
|
|
220
245
|
action.local = true;
|
|
221
246
|
this.execute(signal, session, action, meeting, ROAP.TX_);
|
|
@@ -227,10 +252,16 @@ export default class RoapHandler extends StatelessWebexPlugin {
|
|
|
227
252
|
break;
|
|
228
253
|
case ROAP.RECEIVE_CALL_LEAVE:
|
|
229
254
|
RoapCollection.deleteSession(correlationId);
|
|
230
|
-
LoggerProxy.logger.log(
|
|
255
|
+
LoggerProxy.logger.log(
|
|
256
|
+
`Roap:handler#handleAction --> RECEIVE_CALL_LEAVE event captured, cleaning up the RoapHandler for correlationId: ${correlationId}`
|
|
257
|
+
);
|
|
258
|
+
break;
|
|
231
259
|
case ROAP.RESET_ROAP_STATE:
|
|
232
260
|
RoapCollection.deleteSessionSequence(correlationId, action.msg.seq);
|
|
233
|
-
LoggerProxy.logger.log(
|
|
261
|
+
LoggerProxy.logger.log(
|
|
262
|
+
`Roap:handler#handleAction --> RESET_ROAP_STATE event captured, resetting the RoapHandler state based on sequenceId: ${action.msg.seq}`
|
|
263
|
+
);
|
|
264
|
+
break;
|
|
234
265
|
default:
|
|
235
266
|
return true;
|
|
236
267
|
}
|
package/src/roap/index.ts
CHANGED
|
@@ -21,11 +21,11 @@ import Meeting from '../meeting';
|
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
* @typedef {Object} SeqOptions
|
|
25
|
+
* @property {String} correlationId
|
|
26
|
+
* @property {String} mediaId
|
|
27
|
+
* @property {Number} seq
|
|
28
|
+
*/
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* @class Roap
|
|
@@ -68,7 +68,13 @@ export default class Roap extends StatelessWebexPlugin {
|
|
|
68
68
|
* @private
|
|
69
69
|
* @memberof Roap
|
|
70
70
|
*/
|
|
71
|
-
this.roapHandler = new RoapHandler(
|
|
71
|
+
this.roapHandler = new RoapHandler(
|
|
72
|
+
this.attrs,
|
|
73
|
+
this.options,
|
|
74
|
+
this.sendRoapOK.bind(this),
|
|
75
|
+
this.sendRoapAnswer.bind(this),
|
|
76
|
+
this.roapFinished.bind(this)
|
|
77
|
+
);
|
|
72
78
|
/**
|
|
73
79
|
* The Roap Request Server Proxy Object
|
|
74
80
|
* @instance
|
|
@@ -101,18 +107,19 @@ export default class Roap extends StatelessWebexPlugin {
|
|
|
101
107
|
const msg = data.message;
|
|
102
108
|
const {correlationId} = data;
|
|
103
109
|
|
|
104
|
-
LoggerProxy.logger.log(
|
|
110
|
+
LoggerProxy.logger.log(
|
|
111
|
+
`Roap:index#roapEvent --> Received Roap Message [${JSON.stringify(msg, null, 2)}]`
|
|
112
|
+
);
|
|
105
113
|
|
|
106
114
|
if (msg.messageType === ROAP.ROAP_TYPES.TURN_DISCOVERY_RESPONSE) {
|
|
107
115
|
// turn discovery is not part of normal roap protocol and so we are not handling it
|
|
108
116
|
// through the usual roap state machine
|
|
109
117
|
this.turnDiscovery.handleTurnDiscoveryResponse(msg);
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
118
|
+
} else {
|
|
112
119
|
this.roapHandler.submit({
|
|
113
120
|
type: ROAP.RECEIVE_ROAP_MSG,
|
|
114
121
|
msg,
|
|
115
|
-
correlationId
|
|
122
|
+
correlationId,
|
|
116
123
|
});
|
|
117
124
|
}
|
|
118
125
|
}
|
|
@@ -129,7 +136,7 @@ export default class Roap extends StatelessWebexPlugin {
|
|
|
129
136
|
this.roapHandler.submit({
|
|
130
137
|
type: ROAP.RECEIVE_CALL_LEAVE,
|
|
131
138
|
seq,
|
|
132
|
-
correlationId
|
|
139
|
+
correlationId,
|
|
133
140
|
});
|
|
134
141
|
|
|
135
142
|
return Promise.resolve();
|
|
@@ -145,11 +152,14 @@ export default class Roap extends StatelessWebexPlugin {
|
|
|
145
152
|
private sendRoapOK(options: any) {
|
|
146
153
|
return Promise.resolve().then(() => {
|
|
147
154
|
// @ts-ignore
|
|
148
|
-
const meeting = this.webex.meetings.meetingCollection.getByKey(
|
|
155
|
+
const meeting = this.webex.meetings.meetingCollection.getByKey(
|
|
156
|
+
'correlationId',
|
|
157
|
+
options.correlationId
|
|
158
|
+
);
|
|
149
159
|
const roapMessage = {
|
|
150
160
|
messageType: ROAP.ROAP_TYPES.OK,
|
|
151
161
|
version: ROAP.ROAP_VERSION,
|
|
152
|
-
seq: options.seq
|
|
162
|
+
seq: options.seq,
|
|
153
163
|
};
|
|
154
164
|
|
|
155
165
|
LoggerProxy.logger.log(`Roap:index#sendRoapOK --> ROAP OK sending with seq ${options.seq}`);
|
|
@@ -162,13 +172,13 @@ export default class Roap extends StatelessWebexPlugin {
|
|
|
162
172
|
correlationId: options.correlationId,
|
|
163
173
|
audioMuted: meeting.isAudioMuted(),
|
|
164
174
|
videoMuted: meeting.isVideoMuted(),
|
|
165
|
-
meetingId: meeting.id
|
|
175
|
+
meetingId: meeting.id,
|
|
166
176
|
})
|
|
167
177
|
.then(() => {
|
|
168
178
|
this.roapHandler.submit({
|
|
169
179
|
type: ROAP.SEND_ROAP_MSG,
|
|
170
180
|
msg: roapMessage,
|
|
171
|
-
correlationId: options.correlationId
|
|
181
|
+
correlationId: options.correlationId,
|
|
172
182
|
});
|
|
173
183
|
LoggerProxy.logger.log(`Roap:index#sendRoapOK --> ROAP OK sent with seq ${options.seq}`);
|
|
174
184
|
meeting.setRoapSeq(options.seq);
|
|
@@ -189,18 +199,21 @@ export default class Roap extends StatelessWebexPlugin {
|
|
|
189
199
|
*/
|
|
190
200
|
private sendRoapAnswer(options: any) {
|
|
191
201
|
// @ts-ignore
|
|
192
|
-
const meeting = this.webex.meetings.meetingCollection.getByKey(
|
|
202
|
+
const meeting = this.webex.meetings.meetingCollection.getByKey(
|
|
203
|
+
'correlationId',
|
|
204
|
+
options.correlationId
|
|
205
|
+
);
|
|
193
206
|
const roapMessage = {
|
|
194
207
|
messageType: ROAP.ROAP_TYPES.ANSWER,
|
|
195
208
|
sdps: options.sdps,
|
|
196
209
|
version: ROAP.ROAP_VERSION,
|
|
197
|
-
seq: options.seq
|
|
210
|
+
seq: options.seq,
|
|
198
211
|
};
|
|
199
212
|
|
|
200
213
|
this.roapHandler.submit({
|
|
201
214
|
type: ROAP.SEND_ROAP_MSG,
|
|
202
215
|
msg: roapMessage,
|
|
203
|
-
correlationId: options.correlationId
|
|
216
|
+
correlationId: options.correlationId,
|
|
204
217
|
});
|
|
205
218
|
|
|
206
219
|
return this.roapRequest
|
|
@@ -211,7 +224,7 @@ export default class Roap extends StatelessWebexPlugin {
|
|
|
211
224
|
correlationId: options.correlationId,
|
|
212
225
|
audioMuted: options.audioMuted,
|
|
213
226
|
videoMuted: options.videoMuted,
|
|
214
|
-
meetingId: meeting.id
|
|
227
|
+
meetingId: meeting.id,
|
|
215
228
|
})
|
|
216
229
|
.then(() => {
|
|
217
230
|
meeting.setRoapSeq(options.seq);
|
|
@@ -219,7 +232,7 @@ export default class Roap extends StatelessWebexPlugin {
|
|
|
219
232
|
this.roapHandler.submit({
|
|
220
233
|
type: ROAP.SEND_ROAP_MSG_SUCCESS,
|
|
221
234
|
seq: roapMessage.seq,
|
|
222
|
-
correlationId: meeting.correlationId
|
|
235
|
+
correlationId: meeting.correlationId,
|
|
223
236
|
});
|
|
224
237
|
});
|
|
225
238
|
}
|
|
@@ -238,7 +251,7 @@ export default class Roap extends StatelessWebexPlugin {
|
|
|
238
251
|
messageType: ROAP.ROAP_TYPES.ERROR,
|
|
239
252
|
version: ROAP.ROAP_VERSION,
|
|
240
253
|
errorType,
|
|
241
|
-
seq: session.OFFER.seq
|
|
254
|
+
seq: session.OFFER.seq,
|
|
242
255
|
};
|
|
243
256
|
|
|
244
257
|
return this.roapRequest.sendRoap(msg, locus);
|
|
@@ -258,14 +271,17 @@ export default class Roap extends StatelessWebexPlugin {
|
|
|
258
271
|
sdps: [options.sdp],
|
|
259
272
|
// sdps: [options.sdp],
|
|
260
273
|
version: ROAP.ROAP_VERSION,
|
|
261
|
-
seq:
|
|
262
|
-
|
|
274
|
+
seq:
|
|
275
|
+
typeof options.roapSeq !== 'number' && Number.isNaN(parseFloat(options.roapSeq))
|
|
276
|
+
? 0
|
|
277
|
+
: options.roapSeq + 1,
|
|
278
|
+
tieBreaker: 4294967294, // Math.floor(Math.random() * (2 ** 32) - 1) // TODO: Handle the roap conflict scenario
|
|
263
279
|
};
|
|
264
280
|
|
|
265
281
|
this.roapHandler.submit({
|
|
266
282
|
type: ROAP.SEND_ROAP_MSG,
|
|
267
283
|
msg: roapMessage,
|
|
268
|
-
correlationId: meeting.correlationId
|
|
284
|
+
correlationId: meeting.correlationId,
|
|
269
285
|
});
|
|
270
286
|
|
|
271
287
|
// When reconnecting, it's important that the first roap message being sent out has empty media id.
|
|
@@ -281,13 +297,13 @@ export default class Roap extends StatelessWebexPlugin {
|
|
|
281
297
|
mediaId: sendEmptyMediaId ? '' : meeting.mediaId,
|
|
282
298
|
audioMuted: meeting.isAudioMuted(),
|
|
283
299
|
videoMuted: meeting.isVideoMuted(),
|
|
284
|
-
meetingId: meeting.id
|
|
300
|
+
meetingId: meeting.id,
|
|
285
301
|
})
|
|
286
302
|
.then(({locus, mediaConnections}) => {
|
|
287
303
|
this.roapHandler.submit({
|
|
288
304
|
type: ROAP.SEND_ROAP_MSG_SUCCESS,
|
|
289
305
|
seq: roapMessage.seq,
|
|
290
|
-
correlationId: meeting.correlationId
|
|
306
|
+
correlationId: meeting.correlationId,
|
|
291
307
|
});
|
|
292
308
|
meeting.setRoapSeq(roapMessage.seq);
|
|
293
309
|
|
|
@@ -316,56 +332,60 @@ export default class Roap extends StatelessWebexPlugin {
|
|
|
316
332
|
messageType: ROAP.ROAP_TYPES.OFFER,
|
|
317
333
|
sdps: [options.sdp],
|
|
318
334
|
version: ROAP.ROAP_VERSION,
|
|
319
|
-
seq:
|
|
320
|
-
|
|
335
|
+
seq:
|
|
336
|
+
typeof options.roapSeq !== 'number' && Number.isNaN(parseFloat(options.roapSeq))
|
|
337
|
+
? 0
|
|
338
|
+
: options.roapSeq + 1,
|
|
339
|
+
tieBreaker: 4294967294, // Math.floor(Math.random() * (2 ** 32) - 1) // TODO: Handle the roap conflict scenario
|
|
321
340
|
};
|
|
322
341
|
|
|
323
342
|
this.roapHandler.submit({
|
|
324
343
|
type: ROAP.SEND_ROAP_MSG,
|
|
325
344
|
msg: roapMessage,
|
|
326
|
-
correlationId: meeting.correlationId
|
|
345
|
+
correlationId: meeting.correlationId,
|
|
327
346
|
});
|
|
328
347
|
|
|
329
348
|
const roapBody = {
|
|
330
349
|
localMedias: [
|
|
331
350
|
{
|
|
332
|
-
localSdp: JSON.stringify(
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
351
|
+
localSdp: JSON.stringify(
|
|
352
|
+
this.roapRequest.attachRechabilityData({
|
|
353
|
+
roapMessage,
|
|
354
|
+
// eslint-disable-next-line no-warning-comments
|
|
355
|
+
// TODO: check whats the need for video and audiomute
|
|
356
|
+
audioMuted: !!meeting.isAudioMuted(),
|
|
357
|
+
videoMuted: !!meeting.isVideoMuted(),
|
|
358
|
+
})
|
|
359
|
+
),
|
|
360
|
+
// mediaId: meeting.mediaId
|
|
361
|
+
},
|
|
362
|
+
],
|
|
342
363
|
};
|
|
343
364
|
|
|
344
|
-
return MeetingUtil.joinMeetingOptions(meeting, {roapMessage: roapBody})
|
|
345
|
-
.
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
meeting.setRoapSeq(roapMessage.seq);
|
|
365
|
+
return MeetingUtil.joinMeetingOptions(meeting, {roapMessage: roapBody}).then((locus) => {
|
|
366
|
+
this.roapHandler.submit({
|
|
367
|
+
type: ROAP.SEND_ROAP_MSG_SUCCESS,
|
|
368
|
+
seq: roapMessage.seq,
|
|
369
|
+
correlationId: meeting.correlationId,
|
|
370
|
+
});
|
|
371
|
+
meeting.setRoapSeq(roapMessage.seq);
|
|
352
372
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
373
|
+
// eslint-disable-next-line no-warning-comments
|
|
374
|
+
// TODO: we need to attach peerconenction to locus not sure if we need to pass everything here
|
|
375
|
+
return locus;
|
|
356
376
|
// eslint-disable-next-line no-warning-comments
|
|
357
377
|
// TODO: check where to update the sequence number
|
|
358
|
-
|
|
378
|
+
});
|
|
359
379
|
};
|
|
360
380
|
|
|
361
381
|
/**
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
382
|
+
* Called when the roap sequence is finished (completed successfully or failed)
|
|
383
|
+
* @param {String} correlationId id of the meeting affected
|
|
384
|
+
* @param {String} sequenceId the id of the finished sequence
|
|
385
|
+
* @returns {undefined}
|
|
386
|
+
* @private
|
|
387
|
+
* @memberof Roap
|
|
388
|
+
*/
|
|
369
389
|
private roapFinished(correlationId: string, sequenceId: string) {
|
|
370
390
|
RoapCollection.onSessionSequenceFinish(correlationId, sequenceId);
|
|
371
391
|
// @ts-ignore
|