@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
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
PEER_CONNECTION_STATE,
|
|
20
20
|
OFFER,
|
|
21
21
|
QUALITY_LEVELS,
|
|
22
|
-
REMOTE_VIDEO_CONSTRAINTS
|
|
22
|
+
REMOTE_VIDEO_CONSTRAINTS,
|
|
23
23
|
} from '../constants';
|
|
24
24
|
import BEHAVIORAL_METRICS from '../metrics/constants';
|
|
25
25
|
import {error, eventType} from '../metrics/config';
|
|
@@ -52,8 +52,7 @@ const insertBandwidthLimit = (sdpLines: any, index: number) => {
|
|
|
52
52
|
|
|
53
53
|
if (sdpLines[index].search(AUDIO) !== -1) {
|
|
54
54
|
limit = StaticConfig.meetings.bandwidth.audio;
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
55
|
+
} else {
|
|
57
56
|
limit = StaticConfig.meetings.bandwidth.video;
|
|
58
57
|
periodicKeyFrame = SDP.PERIODIC_KEYFRAME;
|
|
59
58
|
sdpLines.splice(index + 2, 0, periodicKeyFrame);
|
|
@@ -73,7 +72,9 @@ const setRemoteVideoConstraints = (sdp: string, level: string = QUALITY_LEVELS.H
|
|
|
73
72
|
const maxFs = REMOTE_VIDEO_CONSTRAINTS.MAX_FS[level];
|
|
74
73
|
|
|
75
74
|
if (!maxFs) {
|
|
76
|
-
throw new ParameterError(
|
|
75
|
+
throw new ParameterError(
|
|
76
|
+
`setRemoteVideoConstraints: unable to set max framesize, value for level "${level}" is not defined`
|
|
77
|
+
);
|
|
77
78
|
}
|
|
78
79
|
|
|
79
80
|
const modifiedSdp = PeerConnectionUtils.adjustH264Profile(sdp, maxFs);
|
|
@@ -81,10 +82,12 @@ const setRemoteVideoConstraints = (sdp: string, level: string = QUALITY_LEVELS.H
|
|
|
81
82
|
return modifiedSdp;
|
|
82
83
|
};
|
|
83
84
|
|
|
84
|
-
|
|
85
85
|
const setStartBitrateOnRemoteSdp = (sdp) => {
|
|
86
86
|
if (StaticConfig.meetings.bandwidth.startBitrate) {
|
|
87
|
-
sdp = sdp.replace(
|
|
87
|
+
sdp = sdp.replace(
|
|
88
|
+
/(\na=fmtp:(\d+).*profile-level-id=.*)/gi,
|
|
89
|
+
`$1;x-google-start-bitrate=${StaticConfig.meetings.bandwidth.startBitrate}`
|
|
90
|
+
);
|
|
88
91
|
}
|
|
89
92
|
|
|
90
93
|
return sdp;
|
|
@@ -118,18 +121,24 @@ const isSdpInvalid = (sdp: string) => {
|
|
|
118
121
|
|
|
119
122
|
for (const mediaLine of parsedSdp.media) {
|
|
120
123
|
if (!mediaLine.candidates || mediaLine.candidates?.length === 0) {
|
|
121
|
-
LoggerProxy.logger.error(
|
|
124
|
+
LoggerProxy.logger.error(
|
|
125
|
+
'PeerConnectionManager:index#isSdpInvalid --> iceCandidate: Ice candidate never completed'
|
|
126
|
+
);
|
|
122
127
|
|
|
123
128
|
return 'iceCandidate: Ice gathering never completed';
|
|
124
129
|
}
|
|
125
130
|
|
|
126
131
|
if (SDP.BAD_MEDIA_PORTS.includes(mediaLine.port)) {
|
|
127
|
-
LoggerProxy.logger.error(
|
|
132
|
+
LoggerProxy.logger.error(
|
|
133
|
+
'PeerConnectionManager:index#isSdpInvalid --> iceCandidate: Found invalid port number for the ice candidate'
|
|
134
|
+
);
|
|
128
135
|
|
|
129
136
|
return 'iceCandidate: Found invalid port number for the ice candidate';
|
|
130
137
|
}
|
|
131
138
|
if (!mediaLine.icePwd || !mediaLine.iceUfrag) {
|
|
132
|
-
LoggerProxy.logger.error(
|
|
139
|
+
LoggerProxy.logger.error(
|
|
140
|
+
'PeerConnectionManager:index#isSdpInvalid --> iceCandidate: ice ufrag and password not found'
|
|
141
|
+
);
|
|
133
142
|
|
|
134
143
|
return 'iceCandidate: ice ufrag and password not found';
|
|
135
144
|
}
|
|
@@ -199,11 +208,14 @@ pc.iceCandidate = (
|
|
|
199
208
|
const invalidSdpPresent = isSdpInvalid(peerConnection.sdp);
|
|
200
209
|
|
|
201
210
|
if (invalidSdpPresent) {
|
|
202
|
-
LoggerProxy.logger.error(
|
|
211
|
+
LoggerProxy.logger.error(
|
|
212
|
+
'PeerConnectionManager:index#iceCandidate --> SDP not valid after waiting.'
|
|
213
|
+
);
|
|
203
214
|
reject(new InvalidSdpError(invalidSdpPresent));
|
|
204
215
|
}
|
|
205
|
-
LoggerProxy.logger.log(
|
|
206
|
-
|
|
216
|
+
LoggerProxy.logger.log(
|
|
217
|
+
`PeerConnectionManager:index#iceCandidate --> Time to gather ice candidate ${miliseconds} miliseconds`
|
|
218
|
+
);
|
|
207
219
|
|
|
208
220
|
resolve();
|
|
209
221
|
};
|
|
@@ -219,7 +231,9 @@ pc.iceCandidate = (
|
|
|
219
231
|
doneGatheringIceCandidate(peerConnection);
|
|
220
232
|
}
|
|
221
233
|
if (peerConnection.iceGatheringState === GATHERING) {
|
|
222
|
-
LoggerProxy.logger.log(
|
|
234
|
+
LoggerProxy.logger.log(
|
|
235
|
+
'PeerConnectionManager:index#onIceGatheringStateChange --> Ice state changed to gathering'
|
|
236
|
+
);
|
|
223
237
|
}
|
|
224
238
|
};
|
|
225
239
|
|
|
@@ -227,16 +241,20 @@ pc.iceCandidate = (
|
|
|
227
241
|
if (evt.candidate === null) {
|
|
228
242
|
// @ts-ignore
|
|
229
243
|
doneGatheringIceCandidate(peerConnection);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
|
|
244
|
+
} else {
|
|
245
|
+
LoggerProxy.logger.log(
|
|
246
|
+
`PeerConnectionManager:index#onicecandidate --> Candidate ${evt.candidate?.type} ${evt.candidate?.protocol} ${evt.candidate?.address}:${evt.candidate?.port}`
|
|
247
|
+
);
|
|
233
248
|
}
|
|
234
249
|
};
|
|
235
250
|
|
|
236
251
|
peerConnection.onicecandidateerror = (event) => {
|
|
237
252
|
// we can often get ICE candidate errors (for example when failing to communicate with a TURN server)
|
|
238
253
|
// they don't mean that the whole ICE connection will fail, so it's OK to ignore them
|
|
239
|
-
LoggerProxy.logger.error(
|
|
254
|
+
LoggerProxy.logger.error(
|
|
255
|
+
'PeerConnectionManager:index#onicecandidateerror --> ignoring ice error:',
|
|
256
|
+
event
|
|
257
|
+
);
|
|
240
258
|
};
|
|
241
259
|
});
|
|
242
260
|
|
|
@@ -257,9 +275,10 @@ pc.replaceTrack = (peerConnection: any, track: any) => {
|
|
|
257
275
|
}
|
|
258
276
|
});
|
|
259
277
|
}
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
|
|
278
|
+
} catch (err) {
|
|
279
|
+
LoggerProxy.logger.error(
|
|
280
|
+
`PeerConnectionManager:index#replaceTrack --> Error replacing track, ${err}`
|
|
281
|
+
);
|
|
263
282
|
}
|
|
264
283
|
};
|
|
265
284
|
|
|
@@ -272,7 +291,9 @@ pc.replaceTrack = (peerConnection: any, track: any) => {
|
|
|
272
291
|
pc.addStream = (peerConnection: any, stream: any) => {
|
|
273
292
|
try {
|
|
274
293
|
if (stream && !isBrowser('edge')) {
|
|
275
|
-
const tracksPresent =
|
|
294
|
+
const tracksPresent =
|
|
295
|
+
peerConnection.getSenders &&
|
|
296
|
+
peerConnection.getSenders().find((sender) => sender.track != null);
|
|
276
297
|
|
|
277
298
|
if (tracksPresent) {
|
|
278
299
|
stream.getTracks().forEach((track) => {
|
|
@@ -288,13 +309,13 @@ pc.addStream = (peerConnection: any, stream: any) => {
|
|
|
288
309
|
// // https://bugs.chromium.org/p/chromium/issues/detail?id=764414
|
|
289
310
|
// // https://bugs.chromium.org/p/chromium/issues/detail?id=738918#c7
|
|
290
311
|
// peerConnection.addStream(stream);
|
|
291
|
-
}
|
|
292
|
-
else if (isBrowser('edge')) {
|
|
312
|
+
} else if (isBrowser('edge')) {
|
|
293
313
|
peerConnection.addStream(stream);
|
|
294
314
|
}
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
|
|
315
|
+
} catch (err) {
|
|
316
|
+
LoggerProxy.logger.error(
|
|
317
|
+
`PeerConnectionManager:index#addStream --> Error adding stream, error: ${error}`
|
|
318
|
+
);
|
|
298
319
|
}
|
|
299
320
|
};
|
|
300
321
|
|
|
@@ -306,8 +327,15 @@ pc.addStream = (peerConnection: any, stream: any) => {
|
|
|
306
327
|
* @param {String} meetingId
|
|
307
328
|
* @returns {undefined}
|
|
308
329
|
*/
|
|
309
|
-
pc.setRemoteSessionDetails = (
|
|
310
|
-
|
|
330
|
+
pc.setRemoteSessionDetails = (
|
|
331
|
+
peerConnection: any,
|
|
332
|
+
typeStr: string,
|
|
333
|
+
remoteSdp: string,
|
|
334
|
+
meetingId: string
|
|
335
|
+
) => {
|
|
336
|
+
LoggerProxy.logger.log(
|
|
337
|
+
`PeerConnectionManager:index#setRemoteSessionDetails --> Setting the remote description type: ${typeStr}State: ${peerConnection.signalingState}`
|
|
338
|
+
);
|
|
311
339
|
let sdp = remoteSdp;
|
|
312
340
|
|
|
313
341
|
// making sure that the remoteDescription is only set when there is a answer for offer
|
|
@@ -319,12 +347,16 @@ pc.setRemoteSessionDetails = (peerConnection: any, typeStr: string, remoteSdp: s
|
|
|
319
347
|
meetingId,
|
|
320
348
|
data: {
|
|
321
349
|
canProceed: false,
|
|
322
|
-
errors: [
|
|
323
|
-
error.name.MEDIA_ENGINE, 'missing remoteSdp')
|
|
324
|
-
|
|
350
|
+
errors: [
|
|
351
|
+
Metrics.generateErrorPayload(2001, true, error.name.MEDIA_ENGINE, 'missing remoteSdp'),
|
|
352
|
+
],
|
|
353
|
+
},
|
|
325
354
|
});
|
|
326
355
|
}
|
|
327
|
-
if (
|
|
356
|
+
if (
|
|
357
|
+
peerConnection.signalingState === SDP.HAVE_LOCAL_OFFER ||
|
|
358
|
+
(peerConnection.signalingState === SDP.STABLE && typeStr === SDP.OFFER)
|
|
359
|
+
) {
|
|
328
360
|
sdp = setStartBitrateOnRemoteSdp(sdp);
|
|
329
361
|
|
|
330
362
|
if (!peerConnection.enableExtmap) {
|
|
@@ -334,46 +366,57 @@ pc.setRemoteSessionDetails = (peerConnection: any, typeStr: string, remoteSdp: s
|
|
|
334
366
|
// remove any xtls candidates
|
|
335
367
|
sdp = sdp.replace(/^a=candidate:.*xTLS.*\r\n/gim, '');
|
|
336
368
|
|
|
337
|
-
return
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
369
|
+
return (
|
|
370
|
+
peerConnection
|
|
371
|
+
.setRemoteDescription(
|
|
372
|
+
new window.RTCSessionDescription({
|
|
373
|
+
type: typeStr,
|
|
374
|
+
sdp,
|
|
375
|
+
})
|
|
376
|
+
)
|
|
377
|
+
.then(() => {
|
|
378
|
+
if (peerConnection.signalingState === SDP.STABLE) {
|
|
379
|
+
Metrics.postEvent({
|
|
380
|
+
event: eventType.REMOTE_SDP_RECEIVED,
|
|
381
|
+
meetingId,
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
})
|
|
385
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
386
|
+
.catch((error) => {
|
|
387
|
+
LoggerProxy.logger.error(
|
|
388
|
+
`Peer-connection-manager:index#setRemoteDescription --> ${error} missing remotesdp`
|
|
389
|
+
);
|
|
390
|
+
|
|
391
|
+
const metricName = BEHAVIORAL_METRICS.PEERCONNECTION_FAILURE;
|
|
392
|
+
const data = {
|
|
393
|
+
correlation_id: meetingId,
|
|
394
|
+
reason: error.message,
|
|
395
|
+
stack: error.stack,
|
|
396
|
+
};
|
|
397
|
+
const metadata = {
|
|
398
|
+
type: error.name,
|
|
399
|
+
};
|
|
364
400
|
|
|
365
|
-
|
|
401
|
+
Metrics.sendBehavioralMetric(metricName, data, metadata);
|
|
366
402
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
403
|
+
return Metrics.postEvent({
|
|
404
|
+
event: eventType.REMOTE_SDP_RECEIVED,
|
|
405
|
+
meetingId,
|
|
406
|
+
data: {
|
|
407
|
+
canProceed: false,
|
|
408
|
+
errors: [
|
|
409
|
+
Metrics.generateErrorPayload(
|
|
410
|
+
2001,
|
|
411
|
+
true,
|
|
412
|
+
error.name.MEDIA_ENGINE,
|
|
413
|
+
'missing remoteSdp'
|
|
414
|
+
),
|
|
415
|
+
],
|
|
416
|
+
},
|
|
417
|
+
});
|
|
418
|
+
})
|
|
419
|
+
);
|
|
377
420
|
}
|
|
378
421
|
|
|
379
422
|
return Promise.reject(new MediaError('PeerConnection in wrong state'));
|
|
@@ -409,79 +452,80 @@ pc.createOffer = (
|
|
|
409
452
|
|
|
410
453
|
peerConnection.enableExtmap = enableExtmap;
|
|
411
454
|
|
|
412
|
-
return
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
455
|
+
return (
|
|
456
|
+
peerConnection
|
|
457
|
+
.createOffer()
|
|
458
|
+
.then((description) => {
|
|
459
|
+
// bug https://bugs.chromium.org/p/chromium/issues/detail?id=1020642
|
|
460
|
+
// chrome currently generates RTX line irrespective of whether the server side supports it
|
|
461
|
+
// we are removing apt as well because its associated with rtx line
|
|
462
|
+
|
|
463
|
+
if (!enableRtx) {
|
|
464
|
+
description.sdp = description.sdp.replace(/\r\na=rtpmap:\d+ rtx\/\d+/g, '');
|
|
465
|
+
description.sdp = description.sdp.replace(/\r\na=fmtp:\d+ apt=\d+/g, '');
|
|
466
|
+
}
|
|
423
467
|
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
468
|
+
return peerConnection.setLocalDescription(description);
|
|
469
|
+
})
|
|
470
|
+
.then(() => pc.iceCandidate(peerConnection, {remoteQualityLevel}))
|
|
471
|
+
.then(() => {
|
|
472
|
+
if (!checkH264Support(peerConnection.sdp)) {
|
|
473
|
+
throw new MediaError(
|
|
474
|
+
'openH264 is downloading please Wait. Upload logs if not working on second try'
|
|
475
|
+
);
|
|
476
|
+
}
|
|
431
477
|
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
478
|
+
if (!enableExtmap) {
|
|
479
|
+
peerConnection.sdp = peerConnection.sdp.replace(/\na=extmap.*/g, '');
|
|
480
|
+
}
|
|
435
481
|
|
|
436
|
-
|
|
482
|
+
pc.setContentSlides(peerConnection);
|
|
437
483
|
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
484
|
+
Metrics.postEvent({
|
|
485
|
+
event: eventType.LOCAL_SDP_GENERATED,
|
|
486
|
+
meetingId,
|
|
487
|
+
});
|
|
442
488
|
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
BEHAVIORAL_METRICS.INVALID_ICE_CANDIDATE,
|
|
450
|
-
{
|
|
489
|
+
return peerConnection;
|
|
490
|
+
})
|
|
491
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
492
|
+
.catch((error) => {
|
|
493
|
+
LoggerProxy.logger.error(`Peer-connection-manager:index#createOffer --> ${error}`);
|
|
494
|
+
if (error instanceof InvalidSdpError) {
|
|
495
|
+
Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.INVALID_ICE_CANDIDATE, {
|
|
451
496
|
correlation_id: meetingId,
|
|
452
497
|
code: error.code,
|
|
453
|
-
reason: error.message
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
Metrics.sendBehavioralMetric(metricName, data, metadata);
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
Metrics.postEvent({
|
|
472
|
-
event: eventType.LOCAL_SDP_GENERATED,
|
|
473
|
-
meetingId,
|
|
474
|
-
data: {
|
|
475
|
-
canProceed: false,
|
|
476
|
-
errors: [
|
|
477
|
-
// @ts-ignore
|
|
478
|
-
Metrics.generateErrorPayload(2001, true,
|
|
479
|
-
error.name.MEDIA_ENGINE)]
|
|
498
|
+
reason: error.message,
|
|
499
|
+
});
|
|
500
|
+
} else {
|
|
501
|
+
const metricName = BEHAVIORAL_METRICS.PEERCONNECTION_FAILURE;
|
|
502
|
+
const data = {
|
|
503
|
+
correlation_id: meetingId,
|
|
504
|
+
reason: error.message,
|
|
505
|
+
stack: error.stack,
|
|
506
|
+
};
|
|
507
|
+
const metadata = {
|
|
508
|
+
type: error.name,
|
|
509
|
+
};
|
|
510
|
+
|
|
511
|
+
Metrics.sendBehavioralMetric(metricName, data, metadata);
|
|
480
512
|
}
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
513
|
+
|
|
514
|
+
Metrics.postEvent({
|
|
515
|
+
event: eventType.LOCAL_SDP_GENERATED,
|
|
516
|
+
meetingId,
|
|
517
|
+
data: {
|
|
518
|
+
canProceed: false,
|
|
519
|
+
errors: [
|
|
520
|
+
// @ts-ignore
|
|
521
|
+
Metrics.generateErrorPayload(2001, true, error.name.MEDIA_ENGINE),
|
|
522
|
+
],
|
|
523
|
+
},
|
|
524
|
+
});
|
|
525
|
+
pc.close(peerConnection);
|
|
526
|
+
throw error;
|
|
527
|
+
})
|
|
528
|
+
);
|
|
485
529
|
};
|
|
486
530
|
|
|
487
531
|
/**
|
|
@@ -489,16 +533,17 @@ pc.createOffer = (
|
|
|
489
533
|
* @param {Object} peerConnection
|
|
490
534
|
* @returns {Promise.RTCPeerConnection}
|
|
491
535
|
*/
|
|
492
|
-
pc.rollBackLocalDescription = (peerConnection: any) =>
|
|
493
|
-
|
|
494
|
-
.setLocalDescription(new RTCSessionDescription({type: SDP.ROLLBACK}))
|
|
495
|
-
.then(() => peerConnection)
|
|
496
|
-
.catch((err) => {
|
|
497
|
-
LoggerProxy.logger.error(`Peer-connection-manager:index#setLocalDescription --> ${err} `);
|
|
498
|
-
|
|
536
|
+
pc.rollBackLocalDescription = (peerConnection: any) =>
|
|
537
|
+
peerConnection
|
|
499
538
|
// @ts-ignore
|
|
500
|
-
|
|
501
|
-
|
|
539
|
+
.setLocalDescription(new RTCSessionDescription({type: SDP.ROLLBACK}))
|
|
540
|
+
.then(() => peerConnection)
|
|
541
|
+
.catch((err) => {
|
|
542
|
+
LoggerProxy.logger.error(`Peer-connection-manager:index#setLocalDescription --> ${err} `);
|
|
543
|
+
|
|
544
|
+
// @ts-ignore
|
|
545
|
+
return Promise.error(err);
|
|
546
|
+
});
|
|
502
547
|
|
|
503
548
|
/**
|
|
504
549
|
* @param {Object} params {
|
|
@@ -517,7 +562,7 @@ pc.updatePeerConnection = (
|
|
|
517
562
|
offerToReceiveVideo: boolean;
|
|
518
563
|
offerSdp: string;
|
|
519
564
|
stream: MediaStream;
|
|
520
|
-
peerConnection: any
|
|
565
|
+
peerConnection: any;
|
|
521
566
|
},
|
|
522
567
|
{
|
|
523
568
|
meetingId,
|
|
@@ -527,19 +572,26 @@ pc.updatePeerConnection = (
|
|
|
527
572
|
remoteQualityLevel: string;
|
|
528
573
|
}
|
|
529
574
|
) => {
|
|
530
|
-
LoggerProxy.logger.log(
|
|
575
|
+
LoggerProxy.logger.log(
|
|
576
|
+
`PeerConnectionManager:index#updatePeerConnection --> updating the peerConnection with params: ${params}`
|
|
577
|
+
);
|
|
531
578
|
|
|
532
579
|
const {peerConnection, offerSdp} = params;
|
|
533
580
|
|
|
534
|
-
return pc
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
581
|
+
return pc
|
|
582
|
+
.createAnswer(
|
|
583
|
+
{
|
|
584
|
+
peerConnection,
|
|
585
|
+
offerSdp: offerSdp[0],
|
|
586
|
+
},
|
|
587
|
+
{meetingId, remoteQualityLevel}
|
|
588
|
+
)
|
|
589
|
+
.then((peerconnection) => {
|
|
590
|
+
// The content slides should also be set when we are sending inactive
|
|
591
|
+
pc.setContentSlides(peerconnection);
|
|
540
592
|
|
|
541
|
-
|
|
542
|
-
|
|
593
|
+
return Promise.resolve([peerconnection.sdp]);
|
|
594
|
+
});
|
|
543
595
|
};
|
|
544
596
|
|
|
545
597
|
/**
|
|
@@ -573,48 +625,50 @@ pc.createAnswer = (
|
|
|
573
625
|
return Promise.resolve(peerConnection);
|
|
574
626
|
}
|
|
575
627
|
|
|
576
|
-
return
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
peerConnection.setLocalDescription(answer))
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
628
|
+
return (
|
|
629
|
+
pc
|
|
630
|
+
.setRemoteSessionDetails(peerConnection, OFFER, params.offerSdp, meetingId)
|
|
631
|
+
.then(() => peerConnection.createAnswer(params.sdpConstraints))
|
|
632
|
+
.then((answer) => peerConnection.setLocalDescription(answer))
|
|
633
|
+
.then(() => pc.iceCandidate(peerConnection, {remoteQualityLevel}))
|
|
634
|
+
.then(() => {
|
|
635
|
+
peerConnection.sdp = limitBandwidth(peerConnection.localDescription.sdp);
|
|
636
|
+
peerConnection.sdp = PeerConnectionUtils.convertCLineToIpv4(peerConnection.sdp);
|
|
637
|
+
peerConnection.sdp = setRemoteVideoConstraints(peerConnection.sdp, remoteQualityLevel);
|
|
638
|
+
|
|
639
|
+
if (!checkH264Support(peerConnection.sdp)) {
|
|
640
|
+
throw new MediaError(
|
|
641
|
+
'openH264 is downloading please Wait. Upload logs if not working on second try'
|
|
642
|
+
);
|
|
643
|
+
}
|
|
586
644
|
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
645
|
+
return peerConnection;
|
|
646
|
+
})
|
|
647
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
648
|
+
.catch((error) => {
|
|
649
|
+
if (error instanceof InvalidSdpError) {
|
|
650
|
+
Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.INVALID_ICE_CANDIDATE, {
|
|
651
|
+
correlation_id: meetingId,
|
|
652
|
+
});
|
|
653
|
+
} else {
|
|
654
|
+
const metricName = BEHAVIORAL_METRICS.PEERCONNECTION_FAILURE;
|
|
655
|
+
const data = {
|
|
656
|
+
correlation_id: meetingId,
|
|
657
|
+
reason: error.message,
|
|
658
|
+
stack: error.stack,
|
|
659
|
+
};
|
|
660
|
+
const metadata = {
|
|
661
|
+
type: error.name,
|
|
662
|
+
};
|
|
663
|
+
|
|
664
|
+
Metrics.sendBehavioralMetric(metricName, data, metadata);
|
|
665
|
+
}
|
|
590
666
|
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
.catch((error) => {
|
|
594
|
-
if (error instanceof InvalidSdpError) {
|
|
595
|
-
Metrics.sendBehavioralMetric(
|
|
596
|
-
BEHAVIORAL_METRICS.INVALID_ICE_CANDIDATE,
|
|
597
|
-
{
|
|
598
|
-
correlation_id: meetingId
|
|
599
|
-
}
|
|
667
|
+
LoggerProxy.logger.error(
|
|
668
|
+
`PeerConnectionManager:index#setRemoteSessionDetails --> Error creating remote session, error: ${error}`
|
|
600
669
|
);
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
const metricName = BEHAVIORAL_METRICS.PEERCONNECTION_FAILURE;
|
|
604
|
-
const data = {
|
|
605
|
-
correlation_id: meetingId,
|
|
606
|
-
reason: error.message,
|
|
607
|
-
stack: error.stack
|
|
608
|
-
};
|
|
609
|
-
const metadata = {
|
|
610
|
-
type: error.name
|
|
611
|
-
};
|
|
612
|
-
|
|
613
|
-
Metrics.sendBehavioralMetric(metricName, data, metadata);
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
LoggerProxy.logger.error(`PeerConnectionManager:index#setRemoteSessionDetails --> Error creating remote session, error: ${error}`);
|
|
617
|
-
});
|
|
670
|
+
})
|
|
671
|
+
);
|
|
618
672
|
};
|
|
619
673
|
|
|
620
674
|
/**
|
|
@@ -626,24 +680,28 @@ pc.close = (peerConnection: any) => {
|
|
|
626
680
|
// peerConnection.close() fails on firefox on network changes and gives a Dom exception
|
|
627
681
|
// To avoid this we have added a try catch block.
|
|
628
682
|
// Please refer to https://bugzilla.mozilla.org/show_bug.cgi?id=1274407 for more information
|
|
629
|
-
LoggerProxy.logger.log(
|
|
683
|
+
LoggerProxy.logger.log(
|
|
684
|
+
'PeerConnectionManager:index#close --> pc: close() -> attempting to close the peer connection'
|
|
685
|
+
);
|
|
630
686
|
|
|
631
687
|
if (peerConnection && peerConnection.connectionState === PEER_CONNECTION_STATE.CLOSED) {
|
|
632
|
-
LoggerProxy.logger.log(
|
|
688
|
+
LoggerProxy.logger.log(
|
|
689
|
+
'PeerConnectionManager:index#close --> pc: close() -> connection already closed'
|
|
690
|
+
);
|
|
633
691
|
|
|
634
692
|
return Promise.resolve();
|
|
635
693
|
}
|
|
636
|
-
LoggerProxy.logger.log(
|
|
694
|
+
LoggerProxy.logger.log(
|
|
695
|
+
'PeerConnectionManager:index#close --> pc: close() -> closing the mediaPeerConnection'
|
|
696
|
+
);
|
|
637
697
|
|
|
638
|
-
return Promise.resolve()
|
|
639
|
-
.
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
});
|
|
698
|
+
return Promise.resolve().then(() => {
|
|
699
|
+
if (peerConnection && peerConnection.close) {
|
|
700
|
+
peerConnection.close();
|
|
701
|
+
}
|
|
702
|
+
});
|
|
644
703
|
};
|
|
645
704
|
|
|
646
|
-
|
|
647
705
|
pc.setPeerConnectionEvents = (meeting) => {
|
|
648
706
|
// In case ICE fail
|
|
649
707
|
const {peerConnection} = meeting.mediaProperties;
|
|
@@ -663,66 +721,74 @@ pc.setPeerConnectionEvents = (meeting) => {
|
|
|
663
721
|
canProceed: false,
|
|
664
722
|
errors: [
|
|
665
723
|
// @ts-ignore
|
|
666
|
-
Metrics.generateErrorPayload(
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
}
|
|
724
|
+
Metrics.generateErrorPayload(2004, false, error.name.MEDIA_ENGINE),
|
|
725
|
+
],
|
|
726
|
+
},
|
|
670
727
|
});
|
|
671
728
|
|
|
672
729
|
meeting.uploadLogs({
|
|
673
730
|
file: 'peer-connection-manager/index',
|
|
674
|
-
function: 'connectionFailed'
|
|
731
|
+
function: 'connectionFailed',
|
|
675
732
|
});
|
|
676
733
|
|
|
677
|
-
Metrics.sendBehavioralMetric(
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
locus_id: meeting.locusId
|
|
682
|
-
}
|
|
683
|
-
);
|
|
734
|
+
Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.CONNECTION_FAILURE, {
|
|
735
|
+
correlation_id: meeting.correlationId,
|
|
736
|
+
locus_id: meeting.locusId,
|
|
737
|
+
});
|
|
684
738
|
};
|
|
685
739
|
|
|
686
740
|
peerConnection.oniceconnectionstatechange = () => {
|
|
687
|
-
LoggerProxy.logger.info(
|
|
741
|
+
LoggerProxy.logger.info(
|
|
742
|
+
'PeerConnectionManager:index#setPeerConnectionEvents --> ICE STATE CHANGE.'
|
|
743
|
+
);
|
|
688
744
|
switch (peerConnection.iceConnectionState) {
|
|
689
745
|
case ICE_STATE.CHECKING:
|
|
690
|
-
LoggerProxy.logger.info(
|
|
746
|
+
LoggerProxy.logger.info(
|
|
747
|
+
'PeerConnectionManager:index#setPeerConnectionEvents --> ICE STATE CHECKING.'
|
|
748
|
+
);
|
|
691
749
|
Metrics.postEvent({event: eventType.ICE_START, meeting});
|
|
692
750
|
break;
|
|
693
751
|
case ICE_STATE.COMPLETED:
|
|
694
|
-
LoggerProxy.logger.info(
|
|
752
|
+
LoggerProxy.logger.info(
|
|
753
|
+
'PeerConnectionManager:index#setPeerConnectionEvents --> ICE STATE COMPLETED.'
|
|
754
|
+
);
|
|
695
755
|
break;
|
|
696
756
|
case ICE_STATE.CONNECTED:
|
|
697
757
|
// Ice connection state goes to connected when both client and server sends STUN packets and
|
|
698
758
|
// Established connected between them. Firefox does not trigger COMPLETED and only trigger CONNECTED
|
|
699
759
|
Metrics.postEvent({event: eventType.ICE_END, meeting});
|
|
700
|
-
Metrics.sendBehavioralMetric(
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
locus_id: meeting.locusId
|
|
705
|
-
}
|
|
706
|
-
);
|
|
760
|
+
Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.CONNECTION_SUCCESS, {
|
|
761
|
+
correlation_id: meeting.correlationId,
|
|
762
|
+
locus_id: meeting.locusId,
|
|
763
|
+
});
|
|
707
764
|
meeting.setNetworkStatus(NETWORK_STATUS.CONNECTED);
|
|
708
765
|
meeting.reconnectionManager.iceReconnected();
|
|
709
|
-
LoggerProxy.logger.info(
|
|
766
|
+
LoggerProxy.logger.info(
|
|
767
|
+
'PeerConnectionManager:index#setPeerConnectionEvents --> ICE STATE CONNECTED.'
|
|
768
|
+
);
|
|
710
769
|
break;
|
|
711
770
|
case ICE_STATE.CLOSED:
|
|
712
|
-
LoggerProxy.logger.info(
|
|
771
|
+
LoggerProxy.logger.info(
|
|
772
|
+
'PeerConnectionManager:index#setPeerConnectionEvents --> ICE STATE CLOSED.'
|
|
773
|
+
);
|
|
713
774
|
break;
|
|
714
775
|
case ICE_STATE.DISCONNECTED:
|
|
715
776
|
meeting.setNetworkStatus(NETWORK_STATUS.DISCONNECTED);
|
|
716
|
-
meeting.reconnectionManager.waitForIceReconnect()
|
|
717
|
-
.
|
|
718
|
-
|
|
777
|
+
meeting.reconnectionManager.waitForIceReconnect().catch(() => {
|
|
778
|
+
LoggerProxy.logger.info(
|
|
779
|
+
'PeerConnectionManager:index#setPeerConnectionEvents --> ICE STATE DISCONNECTED. Automatic Reconnection Timed Out.'
|
|
780
|
+
);
|
|
719
781
|
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
LoggerProxy.logger.info(
|
|
782
|
+
connectionFailed();
|
|
783
|
+
});
|
|
784
|
+
LoggerProxy.logger.info(
|
|
785
|
+
'PeerConnectionManager:index#setPeerConnectionEvents --> ICE STATE DISCONNECTED.'
|
|
786
|
+
);
|
|
723
787
|
break;
|
|
724
788
|
case ICE_STATE.FAILED:
|
|
725
|
-
LoggerProxy.logger.info(
|
|
789
|
+
LoggerProxy.logger.info(
|
|
790
|
+
'PeerConnectionManager:index#setPeerConnectionEvents --> ICE STATE FAILED.'
|
|
791
|
+
);
|
|
726
792
|
// notify of ice failure
|
|
727
793
|
// Ice failure is the only indicator currently for identifying the actual connection drop
|
|
728
794
|
// Firefox takes sometime 10-15 seconds to go to failed state
|
|
@@ -734,25 +800,39 @@ pc.setPeerConnectionEvents = (meeting) => {
|
|
|
734
800
|
};
|
|
735
801
|
|
|
736
802
|
peerConnection.onconnectionstatechange = () => {
|
|
737
|
-
LoggerProxy.logger.info(
|
|
803
|
+
LoggerProxy.logger.info(
|
|
804
|
+
'PeerConnectionManager:index#setPeerConnectionEvents --> CONNECTION STATE CHANGE.'
|
|
805
|
+
);
|
|
738
806
|
switch (peerConnection.connectionState) {
|
|
739
807
|
case CONNECTION_STATE.NEW:
|
|
740
|
-
LoggerProxy.logger.info(
|
|
808
|
+
LoggerProxy.logger.info(
|
|
809
|
+
'PeerConnectionManager:index#setPeerConnectionEvents --> CONNECTION STATE NEW.'
|
|
810
|
+
);
|
|
741
811
|
break;
|
|
742
812
|
case CONNECTION_STATE.CONNECTING:
|
|
743
|
-
LoggerProxy.logger.info(
|
|
813
|
+
LoggerProxy.logger.info(
|
|
814
|
+
'PeerConnectionManager:index#setPeerConnectionEvents --> CONNECTION STATE CONNECTING.'
|
|
815
|
+
);
|
|
744
816
|
break;
|
|
745
817
|
case CONNECTION_STATE.CONNECTED:
|
|
746
|
-
LoggerProxy.logger.info(
|
|
818
|
+
LoggerProxy.logger.info(
|
|
819
|
+
'PeerConnectionManager:index#setPeerConnectionEvents --> CONNECTION STATE CONNECTED.'
|
|
820
|
+
);
|
|
747
821
|
break;
|
|
748
822
|
case CONNECTION_STATE.CLOSED:
|
|
749
|
-
LoggerProxy.logger.info(
|
|
823
|
+
LoggerProxy.logger.info(
|
|
824
|
+
'PeerConnectionManager:index#setPeerConnectionEvents --> CONNECTION STATE CLOSED.'
|
|
825
|
+
);
|
|
750
826
|
break;
|
|
751
827
|
case CONNECTION_STATE.DISCONNECTED:
|
|
752
|
-
LoggerProxy.logger.info(
|
|
828
|
+
LoggerProxy.logger.info(
|
|
829
|
+
'PeerConnectionManager:index#setPeerConnectionEvents --> CONNECTION STATE DISCONNECTED.'
|
|
830
|
+
);
|
|
753
831
|
break;
|
|
754
832
|
case CONNECTION_STATE.FAILED:
|
|
755
|
-
LoggerProxy.logger.info(
|
|
833
|
+
LoggerProxy.logger.info(
|
|
834
|
+
'PeerConnectionManager:index#setPeerConnectionEvents --> CONNECTION STATE FAILED.'
|
|
835
|
+
);
|
|
756
836
|
// Special case happens only on chrome where there is no ICE FAILED event
|
|
757
837
|
// only CONNECTION FAILED event gets triggered
|
|
758
838
|
|