@webex/plugin-meetings 2.35.3 → 2.35.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/browser-detection.js.map +1 -1
- package/dist/common/collection.js.map +1 -1
- package/dist/common/config.js.map +1 -1
- package/dist/common/errors/captcha-error.js +7 -0
- package/dist/common/errors/captcha-error.js.map +1 -1
- package/dist/common/errors/intent-to-join.js +8 -0
- package/dist/common/errors/intent-to-join.js.map +1 -1
- package/dist/common/errors/join-meeting.js +8 -0
- package/dist/common/errors/join-meeting.js.map +1 -1
- package/dist/common/errors/media.js +7 -0
- package/dist/common/errors/media.js.map +1 -1
- package/dist/common/errors/parameter.js.map +1 -1
- package/dist/common/errors/password-error.js +7 -0
- package/dist/common/errors/password-error.js.map +1 -1
- package/dist/common/errors/permission.js +7 -0
- package/dist/common/errors/permission.js.map +1 -1
- package/dist/common/errors/reconnection-in-progress.js.map +1 -1
- package/dist/common/errors/reconnection.js +7 -0
- package/dist/common/errors/reconnection.js.map +1 -1
- package/dist/common/errors/stats.js +7 -0
- package/dist/common/errors/stats.js.map +1 -1
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/common/errors/webex-meetings-error.js +5 -2
- package/dist/common/errors/webex-meetings-error.js.map +1 -1
- package/dist/common/events/events-scope.js.map +1 -1
- package/dist/common/events/events.js.map +1 -1
- package/dist/common/events/trigger-proxy.js.map +1 -1
- package/dist/common/events/util.js.map +1 -1
- package/dist/common/logs/logger-config.js.map +1 -1
- package/dist/common/logs/logger-proxy.js.map +1 -1
- package/dist/common/logs/request.js +3 -0
- package/dist/common/logs/request.js.map +1 -1
- package/dist/common/queue.js.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
- package/dist/locus-info/fullState.js.map +1 -1
- package/dist/locus-info/hostUtils.js.map +1 -1
- package/dist/locus-info/index.js +43 -5
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js.map +1 -1
- package/dist/locus-info/mediaSharesUtils.js.map +1 -1
- package/dist/locus-info/parser.js +12 -3
- package/dist/locus-info/parser.js.map +1 -1
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +12 -0
- package/dist/media/properties.js.map +1 -1
- package/dist/media/util.js.map +1 -1
- package/dist/mediaQualityMetrics/config.js.map +1 -1
- package/dist/meeting/effectsState.js +8 -1
- package/dist/meeting/effectsState.js.map +1 -1
- package/dist/meeting/index.js +151 -32
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/muteState.js +6 -0
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +54 -24
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/state.js.map +1 -1
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/collection.js +4 -1
- package/dist/meeting-info/collection.js.map +1 -1
- package/dist/meeting-info/index.js +5 -0
- package/dist/meeting-info/index.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +14 -2
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/request.js +3 -0
- package/dist/meeting-info/request.js.map +1 -1
- package/dist/meeting-info/util.js.map +1 -1
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/collection.js +4 -1
- package/dist/meetings/collection.js.map +1 -1
- package/dist/meetings/index.js +72 -20
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/request.js +4 -0
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +30 -7
- package/dist/member/index.js.map +1 -1
- package/dist/member/util.js +2 -1
- package/dist/member/util.js.map +1 -1
- package/dist/members/collection.js +1 -0
- package/dist/members/collection.js.map +1 -1
- package/dist/members/index.js +12 -1
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js +19 -9
- package/dist/members/request.js.map +1 -1
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/config.js.map +1 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/metrics/index.js +8 -0
- package/dist/metrics/index.js.map +1 -1
- package/dist/networkQualityMonitor/index.js +10 -2
- package/dist/networkQualityMonitor/index.js.map +1 -1
- package/dist/peer-connection-manager/index.js +11 -4
- package/dist/peer-connection-manager/index.js.map +1 -1
- package/dist/personal-meeting-room/index.js +11 -0
- package/dist/personal-meeting-room/index.js.map +1 -1
- package/dist/personal-meeting-room/request.js +2 -1
- package/dist/personal-meeting-room/request.js.map +1 -1
- package/dist/personal-meeting-room/util.js.map +1 -1
- package/dist/reachability/index.js +17 -7
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/request.js +1 -0
- package/dist/reachability/request.js.map +1 -1
- package/dist/reconnection-manager/index.js +21 -2
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/roap/collection.js +1 -0
- package/dist/roap/collection.js.map +1 -1
- package/dist/roap/handler.js +14 -2
- package/dist/roap/handler.js.map +1 -1
- package/dist/roap/index.js +11 -1
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/request.js +7 -2
- package/dist/roap/request.js.map +1 -1
- package/dist/roap/state.js.map +1 -1
- package/dist/roap/turnDiscovery.js +9 -1
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/roap/util.js.map +1 -1
- package/dist/statsAnalyzer/global.js.map +1 -1
- package/dist/statsAnalyzer/index.js +19 -1
- package/dist/statsAnalyzer/index.js.map +1 -1
- package/dist/statsAnalyzer/mqaUtil.js +9 -3
- package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
- package/dist/transcription/index.js +10 -3
- package/dist/transcription/index.js.map +1 -1
- package/package.json +17 -17
- package/src/common/{browser-detection.js → browser-detection.ts} +1 -1
- package/src/common/collection.ts +6 -6
- package/src/common/{config.js → config.ts} +1 -1
- package/src/common/errors/{captcha-error.js → captcha-error.ts} +5 -1
- package/src/common/errors/{intent-to-join.js → intent-to-join.ts} +6 -1
- package/src/common/errors/{join-meeting.js → join-meeting.ts} +6 -1
- package/src/common/errors/{media.js → media.ts} +5 -1
- package/src/common/errors/parameter.ts +3 -2
- package/src/common/errors/{password-error.js → password-error.ts} +5 -1
- package/src/common/errors/{permission.js → permission.ts} +5 -1
- package/src/common/errors/{reconnection-in-progress.js → reconnection-in-progress.ts} +0 -0
- package/src/common/errors/{reconnection.js → reconnection.ts} +5 -1
- package/src/common/errors/{stats.js → stats.ts} +5 -1
- package/src/common/errors/{webex-errors.js → webex-errors.ts} +1 -2
- package/src/common/errors/{webex-meetings-error.js → webex-meetings-error.ts} +3 -1
- package/src/common/events/{events-scope.js → events-scope.ts} +1 -1
- package/src/common/events/{events.js → events.ts} +0 -0
- package/src/common/events/{trigger-proxy.js → trigger-proxy.ts} +1 -2
- package/src/common/events/{util.js → util.ts} +1 -1
- package/src/common/logs/{logger-config.js → logger-config.ts} +1 -2
- package/src/common/logs/{logger-proxy.js → logger-proxy.ts} +1 -1
- package/src/common/logs/{request.js → request.ts} +12 -2
- package/src/common/queue.ts +1 -2
- package/src/{config.js → config.ts} +1 -0
- package/src/constants.ts +1 -0
- package/src/locus-info/{controlsUtils.js → controlsUtils.ts} +4 -4
- package/src/locus-info/{embeddedAppsUtils.js → embeddedAppsUtils.ts} +5 -6
- package/src/locus-info/{fullState.js → fullState.ts} +1 -1
- package/src/locus-info/{hostUtils.js → hostUtils.ts} +5 -5
- package/src/locus-info/{index.js → index.ts} +67 -32
- package/src/locus-info/{infoUtils.js → infoUtils.ts} +3 -4
- package/src/locus-info/{mediaSharesUtils.js → mediaSharesUtils.ts} +13 -13
- package/src/locus-info/{parser.js → parser.ts} +22 -12
- package/src/locus-info/{selfUtils.js → selfUtils.ts} +17 -19
- package/src/media/{index.js → index.ts} +108 -39
- package/src/media/{properties.js → properties.ts} +16 -4
- package/src/media/{util.js → util.ts} +2 -3
- package/src/mediaQualityMetrics/{config.js → config.ts} +1 -1
- package/src/meeting/{effectsState.js → effectsState.ts} +12 -6
- package/src/meeting/{index.js → index.ts} +323 -147
- package/src/meeting/{muteState.js → muteState.ts} +16 -11
- package/src/meeting/{request.js → request.ts} +124 -36
- package/src/meeting/{state.js → state.ts} +6 -6
- package/src/meeting/{util.js → util.ts} +4 -4
- package/src/meeting-info/{collection.js → collection.ts} +4 -1
- package/src/meeting-info/{index.js → index.ts} +10 -6
- package/src/meeting-info/{meeting-info-v2.js → meeting-info-v2.ts} +28 -10
- package/src/meeting-info/{request.js → request.ts} +6 -2
- package/src/meeting-info/{util.js → util.ts} +6 -5
- package/src/meeting-info/{utilv2.js → utilv2.ts} +8 -7
- package/src/meetings/{collection.js → collection.ts} +5 -2
- package/src/meetings/{index.js → index.ts} +88 -22
- package/src/meetings/{request.js → request.ts} +6 -1
- package/src/meetings/{util.js → util.ts} +5 -3
- package/src/member/{index.js → index.ts} +46 -15
- package/src/member/{util.js → util.ts} +17 -16
- package/src/members/{collection.js → collection.ts} +2 -1
- package/src/members/{index.js → index.ts} +39 -26
- package/src/members/{request.js → request.ts} +16 -5
- package/src/members/{util.js → util.ts} +7 -7
- package/src/metrics/{config.js → config.ts} +0 -2
- package/src/metrics/{constants.js → constants.ts} +0 -0
- package/src/metrics/{index.js → index.ts} +27 -8
- package/src/networkQualityMonitor/{index.js → index.ts} +18 -3
- package/src/peer-connection-manager/{index.js → index.ts} +72 -28
- package/src/personal-meeting-room/{index.js → index.ts} +17 -4
- package/src/personal-meeting-room/{request.js → request.ts} +3 -1
- package/src/personal-meeting-room/{util.js → util.ts} +1 -1
- package/src/reachability/{index.js → index.ts} +28 -17
- package/src/reachability/request.ts +4 -2
- package/src/reconnection-manager/{index.js → index.ts} +42 -13
- package/src/roap/{collection.js → collection.ts} +1 -0
- package/src/roap/{handler.js → handler.ts} +15 -4
- package/src/roap/{index.js → index.ts} +23 -10
- package/src/roap/{request.js → request.ts} +19 -3
- package/src/roap/{state.js → state.ts} +3 -2
- package/src/roap/turnDiscovery.ts +14 -5
- package/src/roap/{util.js → util.ts} +1 -2
- package/src/statsAnalyzer/{global.js → global.ts} +0 -0
- package/src/statsAnalyzer/{index.js → index.ts} +36 -17
- package/src/statsAnalyzer/{mqaUtil.js → mqaUtil.ts} +6 -1
- package/src/transcription/{index.js → index.ts} +16 -11
- package/test/integration/spec/space-meeting.js +1 -2
- package/test/unit/spec/roap/util.js +1 -1
|
@@ -20,12 +20,14 @@ export type ClusterList = {
|
|
|
20
20
|
* @class ReachabilityRequest
|
|
21
21
|
*/
|
|
22
22
|
class ReachabilityRequest {
|
|
23
|
+
webex: any;
|
|
24
|
+
|
|
23
25
|
/**
|
|
24
26
|
* Creates an instance of ReachabilityRequest.
|
|
25
27
|
* @param {object} webex
|
|
26
28
|
* @memberof ReachabilityRequest
|
|
27
29
|
*/
|
|
28
|
-
constructor(webex) {
|
|
30
|
+
constructor(webex: object) {
|
|
29
31
|
this.webex = webex;
|
|
30
32
|
}
|
|
31
33
|
|
|
@@ -58,7 +60,7 @@ class ReachabilityRequest {
|
|
|
58
60
|
* @param {Object} localSDPList localSDPs for the cluster
|
|
59
61
|
* @returns {Object}
|
|
60
62
|
*/
|
|
61
|
-
remoteSDPForClusters = (localSDPList) => this.webex.request({
|
|
63
|
+
remoteSDPForClusters = (localSDPList: object) => this.webex.request({
|
|
62
64
|
method: HTTP_VERBS.POST,
|
|
63
65
|
shouldRefreshAccessToken: false,
|
|
64
66
|
api: API.CALLIOPEDISCOVERY,
|
|
@@ -23,6 +23,7 @@ import {eventType, reconnection, errorObjects} from '../metrics/config';
|
|
|
23
23
|
import Media from '../media';
|
|
24
24
|
import Metrics from '../metrics';
|
|
25
25
|
import RoapCollection from '../roap/collection';
|
|
26
|
+
import Meeting from '../meeting';
|
|
26
27
|
|
|
27
28
|
/**
|
|
28
29
|
* Used to indicate that the reconnect logic needs to be retried.
|
|
@@ -39,6 +40,8 @@ class NeedsRetryError extends Error {}
|
|
|
39
40
|
* @extends {Error}
|
|
40
41
|
*/
|
|
41
42
|
class NeedsRejoinError extends Error {
|
|
43
|
+
wasSharing: any;
|
|
44
|
+
|
|
42
45
|
/**
|
|
43
46
|
* Creates an instance of NeedsRejoinError.
|
|
44
47
|
* @param {Object} params
|
|
@@ -46,7 +49,14 @@ class NeedsRejoinError extends Error {
|
|
|
46
49
|
* @param {Error} params.error
|
|
47
50
|
* @memberof NeedsRejoinError
|
|
48
51
|
*/
|
|
49
|
-
constructor({
|
|
52
|
+
constructor({
|
|
53
|
+
wasSharing,
|
|
54
|
+
error = new Error('Meeting needs to be rejoined'),
|
|
55
|
+
}: {
|
|
56
|
+
wasSharing?: boolean;
|
|
57
|
+
error?: Error;
|
|
58
|
+
}) {
|
|
59
|
+
// @ts-ignore
|
|
50
60
|
super(error);
|
|
51
61
|
|
|
52
62
|
this.wasSharing = wasSharing;
|
|
@@ -58,10 +68,19 @@ class NeedsRejoinError extends Error {
|
|
|
58
68
|
* @class ReconnectionManager
|
|
59
69
|
*/
|
|
60
70
|
export default class ReconnectionManager {
|
|
71
|
+
autoRejoinEnabled: any;
|
|
72
|
+
iceState: any;
|
|
73
|
+
maxRejoinAttempts: any;
|
|
74
|
+
meeting: any;
|
|
75
|
+
rejoinAttempts: any;
|
|
76
|
+
shareStatus: any;
|
|
77
|
+
status: any;
|
|
78
|
+
tryCount: any;
|
|
79
|
+
webex: any;
|
|
61
80
|
/**
|
|
62
81
|
* @param {Meeting} meeting
|
|
63
82
|
*/
|
|
64
|
-
constructor(meeting) {
|
|
83
|
+
constructor(meeting: Meeting) {
|
|
65
84
|
/**
|
|
66
85
|
* Stores ICE reconnection state data.
|
|
67
86
|
*
|
|
@@ -74,6 +93,7 @@ export default class ReconnectionManager {
|
|
|
74
93
|
disconnected: false,
|
|
75
94
|
resolve: () => {},
|
|
76
95
|
timer: undefined,
|
|
96
|
+
// @ts-ignore
|
|
77
97
|
timeoutDuration: meeting.config.reconnection.iceReconnectionTimeout
|
|
78
98
|
};
|
|
79
99
|
|
|
@@ -99,6 +119,7 @@ export default class ReconnectionManager {
|
|
|
99
119
|
*/
|
|
100
120
|
// TODO : change this logic to not save the meeting instance
|
|
101
121
|
// It gets complicated when meeting ends on remote side , We have a old meeting instance which is not up to date
|
|
122
|
+
// @ts-ignore
|
|
102
123
|
this.webex = meeting.webex;
|
|
103
124
|
/**
|
|
104
125
|
* @instance
|
|
@@ -110,8 +131,10 @@ export default class ReconnectionManager {
|
|
|
110
131
|
// try moving this to meetings collection
|
|
111
132
|
this.meeting = meeting;
|
|
112
133
|
|
|
134
|
+
// @ts-ignore
|
|
113
135
|
this.maxRejoinAttempts = meeting.config.reconnection.maxRejoinAttempts;
|
|
114
136
|
this.rejoinAttempts = RECONNECTION.STATE.DEFAULT_TRY_COUNT;
|
|
137
|
+
// @ts-ignore
|
|
115
138
|
this.autoRejoinEnabled = meeting.config.reconnection.autoRejoin;
|
|
116
139
|
|
|
117
140
|
|
|
@@ -127,7 +150,7 @@ export default class ReconnectionManager {
|
|
|
127
150
|
* @public
|
|
128
151
|
* @memberof ReconnectionManager
|
|
129
152
|
*/
|
|
130
|
-
iceReconnected() {
|
|
153
|
+
public iceReconnected() {
|
|
131
154
|
if (this.iceState.disconnected) {
|
|
132
155
|
LoggerProxy.logger.log('ReconnectionManager:index#iceReconnected --> ice has reconnected');
|
|
133
156
|
|
|
@@ -153,13 +176,13 @@ export default class ReconnectionManager {
|
|
|
153
176
|
* @public
|
|
154
177
|
* @memberof ReconnectionManager
|
|
155
178
|
*/
|
|
156
|
-
waitForIceReconnect() {
|
|
179
|
+
public waitForIceReconnect() {
|
|
157
180
|
if (!this.iceState.disconnected) {
|
|
158
181
|
LoggerProxy.logger.log('ReconnectionManager:index#waitForIceReconnect --> waiting for ice reconnect');
|
|
159
182
|
|
|
160
183
|
this.iceState.disconnected = true;
|
|
161
184
|
|
|
162
|
-
return new Promise((resolve, reject) => {
|
|
185
|
+
return new Promise<void>((resolve, reject) => {
|
|
163
186
|
this.iceState.timer = setTimeout(() => {
|
|
164
187
|
if (this.iceState.disconnected === false) {
|
|
165
188
|
resolve();
|
|
@@ -183,7 +206,7 @@ export default class ReconnectionManager {
|
|
|
183
206
|
* @public
|
|
184
207
|
* @memberof ReconnectionManager
|
|
185
208
|
*/
|
|
186
|
-
reset() {
|
|
209
|
+
public reset() {
|
|
187
210
|
this.status = RECONNECTION.STATE.DEFAULT_STATUS;
|
|
188
211
|
this.tryCount = RECONNECTION.STATE.DEFAULT_TRY_COUNT;
|
|
189
212
|
this.rejoinAttempts = RECONNECTION.STATE.DEFAULT_TRY_COUNT;
|
|
@@ -194,7 +217,7 @@ export default class ReconnectionManager {
|
|
|
194
217
|
* @public
|
|
195
218
|
* @memberof ReconnectionManager
|
|
196
219
|
*/
|
|
197
|
-
cleanUp() {
|
|
220
|
+
public cleanUp() {
|
|
198
221
|
this.reset();
|
|
199
222
|
this.meeting = null;
|
|
200
223
|
}
|
|
@@ -205,7 +228,7 @@ export default class ReconnectionManager {
|
|
|
205
228
|
* @private
|
|
206
229
|
* @memberof ReconnectionManager
|
|
207
230
|
*/
|
|
208
|
-
validate() {
|
|
231
|
+
private validate() {
|
|
209
232
|
if (this.meeting.config.reconnection.enabled) {
|
|
210
233
|
if (
|
|
211
234
|
this.status === RECONNECTION.STATE.DEFAULT_STATUS ||
|
|
@@ -233,7 +256,13 @@ export default class ReconnectionManager {
|
|
|
233
256
|
* @public
|
|
234
257
|
* @memberof ReconnectionManager
|
|
235
258
|
*/
|
|
236
|
-
async reconnect({
|
|
259
|
+
public async reconnect({
|
|
260
|
+
networkDisconnect = false,
|
|
261
|
+
networkRetry = false,
|
|
262
|
+
}: {
|
|
263
|
+
networkDisconnect?: boolean;
|
|
264
|
+
networkRetry?: boolean;
|
|
265
|
+
} = {}) {
|
|
237
266
|
LoggerProxy.logger.info(`ReconnectionManager:index#reconnect --> Reconnection start for meeting ${this.meeting.id}.`);
|
|
238
267
|
// First, validate that we can reconnect, if not, it will throw an error
|
|
239
268
|
try {
|
|
@@ -315,7 +344,7 @@ export default class ReconnectionManager {
|
|
|
315
344
|
* @private
|
|
316
345
|
* @memberof ReconnectionManager
|
|
317
346
|
*/
|
|
318
|
-
async executeReconnection({networkDisconnect = false}) {
|
|
347
|
+
private async executeReconnection({ networkDisconnect = false }: { networkDisconnect?: boolean }) {
|
|
319
348
|
this.status = RECONNECTION.STATE.IN_PROGRESS;
|
|
320
349
|
|
|
321
350
|
LoggerProxy.logger.info('ReconnectionManager:index#executeReconnection --> Attempting to reconnect to meeting.');
|
|
@@ -385,7 +414,7 @@ export default class ReconnectionManager {
|
|
|
385
414
|
* @param {boolean} wasSharing
|
|
386
415
|
* @returns {Promise}
|
|
387
416
|
*/
|
|
388
|
-
async rejoinMeeting(wasSharing = false) {
|
|
417
|
+
async rejoinMeeting(wasSharing: boolean = false) {
|
|
389
418
|
try {
|
|
390
419
|
LoggerProxy.logger.info('ReconnectionManager:index#rejoinMeeting --> attemping meeting rejoin');
|
|
391
420
|
const previousCorrelationId = this.meeting.correlationId;
|
|
@@ -481,7 +510,7 @@ export default class ReconnectionManager {
|
|
|
481
510
|
* @private
|
|
482
511
|
* @memberof ReconnectionManager
|
|
483
512
|
*/
|
|
484
|
-
async reconnectMercuryWebSocket() {
|
|
513
|
+
private async reconnectMercuryWebSocket() {
|
|
485
514
|
LoggerProxy.logger.info('ReconnectionManager:index#reconnectMercuryWebSocket --> Reconnecting websocket.');
|
|
486
515
|
// First, attempt to disconnect if we think we are already connected.
|
|
487
516
|
if (this.webex.internal.mercury.connected) {
|
|
@@ -515,7 +544,7 @@ export default class ReconnectionManager {
|
|
|
515
544
|
* @private
|
|
516
545
|
* @memberof ReconnectionManager
|
|
517
546
|
*/
|
|
518
|
-
static async setupPeerConnection(meeting) {
|
|
547
|
+
private static async setupPeerConnection(meeting: Meeting) {
|
|
519
548
|
LoggerProxy.logger.log('ReconnectionManager:index#setupPeerConnection --> Begin resetting peer connection');
|
|
520
549
|
// close pcs, unset to null and create a new one with out closing any streams
|
|
521
550
|
PeerConnectionManager.close(meeting.mediaProperties.peerConnection);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* no-param-reassign */
|
|
2
|
+
// @ts-ignore
|
|
2
3
|
import {StatelessWebexPlugin} from '@webex/webex-core';
|
|
3
4
|
|
|
4
5
|
import LoggerProxy from '../common/logs/logger-proxy';
|
|
@@ -8,6 +9,7 @@ import BEHAVIORAL_METRICS from '../metrics/constants';
|
|
|
8
9
|
|
|
9
10
|
import RoapUtil from './util';
|
|
10
11
|
import RoapCollection from './collection';
|
|
12
|
+
import Meeting from '../meeting';
|
|
11
13
|
|
|
12
14
|
|
|
13
15
|
const checkForAndHandleErrors = (action, meeting, correlationId) => {
|
|
@@ -67,6 +69,13 @@ const handleSessionStep = ({
|
|
|
67
69
|
* @class RoapHandler
|
|
68
70
|
*/
|
|
69
71
|
export default class RoapHandler extends StatelessWebexPlugin {
|
|
72
|
+
attrs: any;
|
|
73
|
+
lastRoapMessage: any;
|
|
74
|
+
options: any;
|
|
75
|
+
roapAnswer: any;
|
|
76
|
+
roapFinished: any;
|
|
77
|
+
roapOk: any;
|
|
78
|
+
|
|
70
79
|
constructor(attrs, options, roapOk, roapAnswer, roapFinished) {
|
|
71
80
|
super({}, options);
|
|
72
81
|
this.attrs = attrs;
|
|
@@ -84,7 +93,7 @@ export default class RoapHandler extends StatelessWebexPlugin {
|
|
|
84
93
|
* @param {Object} action
|
|
85
94
|
* @returns {null}
|
|
86
95
|
*/
|
|
87
|
-
perform(session, meeting, action) {
|
|
96
|
+
perform(session: any, meeting: any, action: any) {
|
|
88
97
|
switch (session.state.state) {
|
|
89
98
|
case ROAP.ROAP_STATE.INIT:
|
|
90
99
|
this.roapFinished(meeting.correlationId, action.msg.seq);
|
|
@@ -150,6 +159,7 @@ export default class RoapHandler extends StatelessWebexPlugin {
|
|
|
150
159
|
LoggerProxy.logger.log('Roap:handler#perform --> Roap State remote offer won after GLARE.');
|
|
151
160
|
}
|
|
152
161
|
session.state.step(ROAP.ROAP_SIGNAL.GLARE_RESOLVED, meeting, action);
|
|
162
|
+
// @ts-ignore
|
|
153
163
|
this.perform(session, meeting);
|
|
154
164
|
break;
|
|
155
165
|
default:
|
|
@@ -166,7 +176,7 @@ export default class RoapHandler extends StatelessWebexPlugin {
|
|
|
166
176
|
* @param {String} prefix
|
|
167
177
|
* @returns {null}
|
|
168
178
|
*/
|
|
169
|
-
execute(signal, session, action, meeting, prefix) {
|
|
179
|
+
execute(signal: string, session: any, action: any, meeting: Meeting, prefix: string) {
|
|
170
180
|
if (session && session.state) {
|
|
171
181
|
handleSessionStep({
|
|
172
182
|
roap: action,
|
|
@@ -188,7 +198,7 @@ export default class RoapHandler extends StatelessWebexPlugin {
|
|
|
188
198
|
* @param {String} correlationId
|
|
189
199
|
* @returns {Boolean}
|
|
190
200
|
*/
|
|
191
|
-
handleAction(session, action, meeting, correlationId) {
|
|
201
|
+
handleAction(session: object, action: any, meeting: Meeting, correlationId: string) {
|
|
192
202
|
let signal;
|
|
193
203
|
|
|
194
204
|
|
|
@@ -233,7 +243,7 @@ export default class RoapHandler extends StatelessWebexPlugin {
|
|
|
233
243
|
* @param {Object} action
|
|
234
244
|
* @returns {Boolean}
|
|
235
245
|
*/
|
|
236
|
-
submit(action) {
|
|
246
|
+
submit(action: any) {
|
|
237
247
|
const {correlationId} = action;
|
|
238
248
|
let {seq} = action;
|
|
239
249
|
|
|
@@ -241,6 +251,7 @@ export default class RoapHandler extends StatelessWebexPlugin {
|
|
|
241
251
|
seq = action.msg.seq;
|
|
242
252
|
}
|
|
243
253
|
const session = RoapCollection.getSessionSequence(correlationId, seq);
|
|
254
|
+
// @ts-ignore
|
|
244
255
|
const meeting = this.webex.meetings.meetingCollection.getByKey('correlationId', correlationId);
|
|
245
256
|
|
|
246
257
|
if (checkForAndHandleErrors(action, meeting, correlationId)) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @ts-ignore
|
|
1
2
|
import {StatelessWebexPlugin} from '@webex/webex-core';
|
|
2
3
|
|
|
3
4
|
import {ROAP} from '../constants';
|
|
@@ -8,6 +9,7 @@ import RoapHandler from './handler';
|
|
|
8
9
|
import RoapRequest from './request';
|
|
9
10
|
import RoapCollection from './collection';
|
|
10
11
|
import TurnDiscovery from './turnDiscovery';
|
|
12
|
+
import Meeting from '../meeting';
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
15
|
* Roap options
|
|
@@ -31,12 +33,19 @@ import TurnDiscovery from './turnDiscovery';
|
|
|
31
33
|
* @private
|
|
32
34
|
*/
|
|
33
35
|
export default class Roap extends StatelessWebexPlugin {
|
|
36
|
+
attrs: any;
|
|
37
|
+
lastRoapOffer: any;
|
|
38
|
+
options: any;
|
|
39
|
+
roapHandler: any;
|
|
40
|
+
roapRequest: any;
|
|
41
|
+
turnDiscovery: any;
|
|
42
|
+
|
|
34
43
|
/**
|
|
35
44
|
*
|
|
36
45
|
* @param {Object} attrs
|
|
37
46
|
* @param {Object} options
|
|
38
47
|
*/
|
|
39
|
-
constructor(attrs, options) {
|
|
48
|
+
constructor(attrs: any, options: any) {
|
|
40
49
|
super({}, options);
|
|
41
50
|
/**
|
|
42
51
|
* @instance
|
|
@@ -67,6 +76,7 @@ export default class Roap extends StatelessWebexPlugin {
|
|
|
67
76
|
* @private
|
|
68
77
|
* @memberof Roap
|
|
69
78
|
*/
|
|
79
|
+
// @ts-ignore
|
|
70
80
|
this.roapRequest = new RoapRequest({}, options);
|
|
71
81
|
/**
|
|
72
82
|
* The last roap offer sent to server and acked
|
|
@@ -87,7 +97,7 @@ export default class Roap extends StatelessWebexPlugin {
|
|
|
87
97
|
* @private
|
|
88
98
|
* @memberof Roap
|
|
89
99
|
*/
|
|
90
|
-
roapEvent(data) {
|
|
100
|
+
private roapEvent(data: any) {
|
|
91
101
|
const msg = data.message;
|
|
92
102
|
const {correlationId} = data;
|
|
93
103
|
|
|
@@ -115,7 +125,7 @@ export default class Roap extends StatelessWebexPlugin {
|
|
|
115
125
|
* @private
|
|
116
126
|
* @memberof Roap
|
|
117
127
|
*/
|
|
118
|
-
stop(correlationId, seq) {
|
|
128
|
+
private stop(correlationId: string, seq: number) {
|
|
119
129
|
this.roapHandler.submit({
|
|
120
130
|
type: ROAP.RECEIVE_CALL_LEAVE,
|
|
121
131
|
seq,
|
|
@@ -132,8 +142,9 @@ export default class Roap extends StatelessWebexPlugin {
|
|
|
132
142
|
* @private
|
|
133
143
|
* @memberof Roap
|
|
134
144
|
*/
|
|
135
|
-
sendRoapOK(options) {
|
|
145
|
+
private sendRoapOK(options: any) {
|
|
136
146
|
return Promise.resolve().then(() => {
|
|
147
|
+
// @ts-ignore
|
|
137
148
|
const meeting = this.webex.meetings.meetingCollection.getByKey('correlationId', options.correlationId);
|
|
138
149
|
const roapMessage = {
|
|
139
150
|
messageType: ROAP.ROAP_TYPES.OK,
|
|
@@ -176,7 +187,8 @@ export default class Roap extends StatelessWebexPlugin {
|
|
|
176
187
|
* @private
|
|
177
188
|
* @memberof Roap
|
|
178
189
|
*/
|
|
179
|
-
sendRoapAnswer(options) {
|
|
190
|
+
private sendRoapAnswer(options: any) {
|
|
191
|
+
// @ts-ignore
|
|
180
192
|
const meeting = this.webex.meetings.meetingCollection.getByKey('correlationId', options.correlationId);
|
|
181
193
|
const roapMessage = {
|
|
182
194
|
messageType: ROAP.ROAP_TYPES.ANSWER,
|
|
@@ -221,7 +233,7 @@ export default class Roap extends StatelessWebexPlugin {
|
|
|
221
233
|
* @private
|
|
222
234
|
* @memberof Roap
|
|
223
235
|
*/
|
|
224
|
-
sendRoapError(session, locus, errorType) {
|
|
236
|
+
private sendRoapError(session: any, locus: object, errorType: string) {
|
|
225
237
|
const msg = {
|
|
226
238
|
messageType: ROAP.ROAP_TYPES.ERROR,
|
|
227
239
|
version: ROAP.ROAP_VERSION,
|
|
@@ -239,7 +251,7 @@ export default class Roap extends StatelessWebexPlugin {
|
|
|
239
251
|
* @private
|
|
240
252
|
* @memberof Roap
|
|
241
253
|
*/
|
|
242
|
-
sendRoapMediaRequest(options) {
|
|
254
|
+
sendRoapMediaRequest(options: any) {
|
|
243
255
|
const {meeting, reconnect} = options;
|
|
244
256
|
const roapMessage = {
|
|
245
257
|
messageType: ROAP.ROAP_TYPES.OFFER,
|
|
@@ -298,7 +310,7 @@ export default class Roap extends StatelessWebexPlugin {
|
|
|
298
310
|
* @private
|
|
299
311
|
* @memberof Roap
|
|
300
312
|
*/
|
|
301
|
-
sendRoapCallRequest = (options) => {
|
|
313
|
+
sendRoapCallRequest = (options: any) => {
|
|
302
314
|
const {meeting} = options;
|
|
303
315
|
const roapMessage = {
|
|
304
316
|
messageType: ROAP.ROAP_TYPES.OFFER,
|
|
@@ -354,8 +366,9 @@ export default class Roap extends StatelessWebexPlugin {
|
|
|
354
366
|
* @private
|
|
355
367
|
* @memberof Roap
|
|
356
368
|
*/
|
|
357
|
-
roapFinished(correlationId, sequenceId) {
|
|
369
|
+
private roapFinished(correlationId: string, sequenceId: string) {
|
|
358
370
|
RoapCollection.onSessionSequenceFinish(correlationId, sequenceId);
|
|
371
|
+
// @ts-ignore
|
|
359
372
|
const meeting = this.webex.meetings.meetingCollection.getByKey('correlationId', correlationId);
|
|
360
373
|
|
|
361
374
|
meeting.mediaNegotiatedEvent();
|
|
@@ -374,7 +387,7 @@ export default class Roap extends StatelessWebexPlugin {
|
|
|
374
387
|
* media connection just after a reconnection
|
|
375
388
|
* @returns {Promise}
|
|
376
389
|
*/
|
|
377
|
-
doTurnDiscovery(meeting, isReconnecting) {
|
|
390
|
+
doTurnDiscovery(meeting: Meeting, isReconnecting: boolean) {
|
|
378
391
|
return this.turnDiscovery.doTurnDiscovery(meeting, isReconnecting);
|
|
379
392
|
}
|
|
380
393
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
1
|
/* global window */
|
|
2
|
+
// @ts-ignore
|
|
3
3
|
import {StatelessWebexPlugin} from '@webex/webex-core';
|
|
4
4
|
|
|
5
5
|
import LoggerProxy from '../common/logs/logger-proxy';
|
|
@@ -50,10 +50,11 @@ export default class RoapRequest extends StatelessWebexPlugin {
|
|
|
50
50
|
LoggerProxy.logger.info(`Roap:request#joinMeetingWithRoap --> Local SDP: ${options.roapMessage}`);
|
|
51
51
|
|
|
52
52
|
return Promise.resolve().then(async () => {
|
|
53
|
+
// @ts-ignore
|
|
53
54
|
const deviceUrl = this.webex.internal.device.url;
|
|
54
55
|
let url = '';
|
|
55
56
|
|
|
56
|
-
const body = {
|
|
57
|
+
const body: any = {
|
|
57
58
|
deviceUrl,
|
|
58
59
|
usingResource: options.resourceId || null,
|
|
59
60
|
correlationId: options.correlationId,
|
|
@@ -76,7 +77,9 @@ export default class RoapRequest extends StatelessWebexPlugin {
|
|
|
76
77
|
}
|
|
77
78
|
else if (options.sipUrl) {
|
|
78
79
|
try {
|
|
80
|
+
// @ts-ignore
|
|
79
81
|
await this.webex.internal.services.waitForCatalog('postauth');
|
|
82
|
+
// @ts-ignore
|
|
80
83
|
url = `${this.webex.internal.services.get('locus')}/${LOCI}/${CALL}`;
|
|
81
84
|
body.invitee = {
|
|
82
85
|
address: options.sipTarget
|
|
@@ -91,6 +94,7 @@ export default class RoapRequest extends StatelessWebexPlugin {
|
|
|
91
94
|
throw new ParameterError('Must provide a locusUrl or sipTarget');
|
|
92
95
|
}
|
|
93
96
|
|
|
97
|
+
// @ts-ignore
|
|
94
98
|
return this.webex
|
|
95
99
|
.request({
|
|
96
100
|
method: HTTP_VERBS.POST,
|
|
@@ -125,7 +129,16 @@ export default class RoapRequest extends StatelessWebexPlugin {
|
|
|
125
129
|
* @param {String} options.meetingId
|
|
126
130
|
* @returns {Promise} returns the response/failure of the request
|
|
127
131
|
*/
|
|
128
|
-
sendRoap(options
|
|
132
|
+
sendRoap(options: {
|
|
133
|
+
roapMessage: any;
|
|
134
|
+
locusSelfUrl: string;
|
|
135
|
+
mediaId: string;
|
|
136
|
+
correlationId: string;
|
|
137
|
+
audioMuted: boolean;
|
|
138
|
+
videoMuted: boolean;
|
|
139
|
+
meetingId: string;
|
|
140
|
+
preferTranscoding?: boolean;
|
|
141
|
+
}) {
|
|
129
142
|
const {
|
|
130
143
|
roapMessage, locusSelfUrl, mediaId, correlationId, meetingId
|
|
131
144
|
} = options;
|
|
@@ -135,12 +148,14 @@ export default class RoapRequest extends StatelessWebexPlugin {
|
|
|
135
148
|
}
|
|
136
149
|
|
|
137
150
|
const mediaUrl = `${locusSelfUrl}/${MEDIA}`;
|
|
151
|
+
// @ts-ignore
|
|
138
152
|
const deviceUrl = this.webex.internal.device.url;
|
|
139
153
|
|
|
140
154
|
LoggerProxy.logger.info(`Roap:request#sendRoap --> ${mediaUrl} \n ${roapMessage.messageType} \n seq:${roapMessage.seq}`);
|
|
141
155
|
|
|
142
156
|
Metrics.postEvent({event: eventType.MEDIA_REQUEST, meetingId});
|
|
143
157
|
|
|
158
|
+
// @ts-ignore
|
|
144
159
|
return this.webex
|
|
145
160
|
.request({
|
|
146
161
|
uri: mediaUrl,
|
|
@@ -148,6 +163,7 @@ export default class RoapRequest extends StatelessWebexPlugin {
|
|
|
148
163
|
body: {
|
|
149
164
|
device: {
|
|
150
165
|
url: deviceUrl,
|
|
166
|
+
// @ts-ignore
|
|
151
167
|
deviceType: this.config.meetings.deviceType
|
|
152
168
|
},
|
|
153
169
|
correlationId,
|
|
@@ -2,6 +2,7 @@ import StateMachine from 'javascript-state-machine';
|
|
|
2
2
|
|
|
3
3
|
import LoggerProxy from '../common/logs/logger-proxy';
|
|
4
4
|
import {ROAP, _OFFER_, _ANSWER_, _REQUESTED_} from '../constants';
|
|
5
|
+
import Meeting from '../meeting';
|
|
5
6
|
|
|
6
7
|
const shouldStep = (roap, meeting) => {
|
|
7
8
|
const {messageType} = roap.msg;
|
|
@@ -115,7 +116,7 @@ const RoapStateMachine = {
|
|
|
115
116
|
* @param {Object} roap
|
|
116
117
|
* @returns {String} new state value
|
|
117
118
|
*/
|
|
118
|
-
to(signal, meeting, roap) {
|
|
119
|
+
to(signal: string, meeting: Meeting, roap: object) {
|
|
119
120
|
const value = this.state;
|
|
120
121
|
|
|
121
122
|
if (!shouldStep(roap, meeting)) {
|
|
@@ -132,7 +133,7 @@ const RoapStateMachine = {
|
|
|
132
133
|
* @param {Object} transition
|
|
133
134
|
* @returns {null}
|
|
134
135
|
*/
|
|
135
|
-
onAfterStep(transition) {
|
|
136
|
+
onAfterStep(transition: any) {
|
|
136
137
|
LoggerProxy.logger.log(
|
|
137
138
|
`Roap:state#onAfterStep --> RoapStateMachine->onAfterStep#fired! State changed from '${transition.from}' to '${
|
|
138
139
|
transition.to
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @ts-ignore - Types not available for @webex/common
|
|
1
2
|
import {Defer} from '@webex/common';
|
|
2
3
|
|
|
3
4
|
import Metrics from '../metrics';
|
|
@@ -6,6 +7,7 @@ import LoggerProxy from '../common/logs/logger-proxy';
|
|
|
6
7
|
import {ROAP} from '../constants';
|
|
7
8
|
|
|
8
9
|
import RoapRequest from './request';
|
|
10
|
+
import Meeting from '../meeting';
|
|
9
11
|
|
|
10
12
|
const TURN_DISCOVERY_TIMEOUT = 10; // in seconds
|
|
11
13
|
|
|
@@ -48,7 +50,7 @@ export default class TurnDiscovery {
|
|
|
48
50
|
* @private
|
|
49
51
|
* @memberof Roap
|
|
50
52
|
*/
|
|
51
|
-
waitForTurnDiscoveryResponse() {
|
|
53
|
+
private waitForTurnDiscoveryResponse() {
|
|
52
54
|
if (!this.defer) {
|
|
53
55
|
LoggerProxy.logger.warn('Roap:turnDiscovery#waitForTurnDiscoveryResponse --> TURN discovery is not in progress');
|
|
54
56
|
|
|
@@ -76,7 +78,8 @@ export default class TurnDiscovery {
|
|
|
76
78
|
* @public
|
|
77
79
|
* @memberof Roap
|
|
78
80
|
*/
|
|
79
|
-
handleTurnDiscoveryResponse(roapMessage) {
|
|
81
|
+
public handleTurnDiscoveryResponse(roapMessage: object) {
|
|
82
|
+
// @ts-ignore - Fix missing type
|
|
80
83
|
const {headers} = roapMessage;
|
|
81
84
|
|
|
82
85
|
if (!this.defer) {
|
|
@@ -125,7 +128,7 @@ export default class TurnDiscovery {
|
|
|
125
128
|
* @private
|
|
126
129
|
* @memberof Roap
|
|
127
130
|
*/
|
|
128
|
-
sendRoapTurnDiscoveryRequest(meeting, isReconnecting) {
|
|
131
|
+
private sendRoapTurnDiscoveryRequest(meeting: Meeting, isReconnecting: boolean) {
|
|
129
132
|
const seq = meeting.roapSeq + 1;
|
|
130
133
|
|
|
131
134
|
if (this.defer) {
|
|
@@ -148,7 +151,9 @@ export default class TurnDiscovery {
|
|
|
148
151
|
.sendRoap({
|
|
149
152
|
roapMessage,
|
|
150
153
|
correlationId: meeting.correlationId,
|
|
154
|
+
// @ts-ignore - Fix missing type
|
|
151
155
|
locusSelfUrl: meeting.selfUrl,
|
|
156
|
+
// @ts-ignore - Fix missing type
|
|
152
157
|
mediaId: isReconnecting ? '' : meeting.mediaId,
|
|
153
158
|
audioMuted: meeting.isAudioMuted(),
|
|
154
159
|
videoMuted: meeting.isVideoMuted(),
|
|
@@ -170,7 +175,7 @@ export default class TurnDiscovery {
|
|
|
170
175
|
* @param {Meeting} meeting
|
|
171
176
|
* @returns {Promise}
|
|
172
177
|
*/
|
|
173
|
-
sendRoapOK(meeting) {
|
|
178
|
+
sendRoapOK(meeting: Meeting) {
|
|
174
179
|
LoggerProxy.logger.info('Roap:turnDiscovery#sendRoapOK --> sending OK');
|
|
175
180
|
|
|
176
181
|
return this.roapRequest.sendRoap({
|
|
@@ -179,7 +184,9 @@ export default class TurnDiscovery {
|
|
|
179
184
|
version: ROAP.ROAP_VERSION,
|
|
180
185
|
seq: meeting.roapSeq
|
|
181
186
|
},
|
|
187
|
+
// @ts-ignore - fix type
|
|
182
188
|
locusSelfUrl: meeting.selfUrl,
|
|
189
|
+
// @ts-ignore - fix type
|
|
183
190
|
mediaId: meeting.mediaId,
|
|
184
191
|
correlationId: meeting.correlationId,
|
|
185
192
|
audioMuted: meeting.isAudioMuted(),
|
|
@@ -201,7 +208,8 @@ export default class TurnDiscovery {
|
|
|
201
208
|
* media connection just after a reconnection
|
|
202
209
|
* @returns {Promise}
|
|
203
210
|
*/
|
|
204
|
-
doTurnDiscovery(meeting, isReconnecting) {
|
|
211
|
+
doTurnDiscovery(meeting: Meeting, isReconnecting: boolean) {
|
|
212
|
+
// @ts-ignore - fix type
|
|
205
213
|
const isAnyClusterReachable = meeting.webex.meetings.reachability.isAnyClusterReachable();
|
|
206
214
|
|
|
207
215
|
if (isAnyClusterReachable) {
|
|
@@ -209,6 +217,7 @@ export default class TurnDiscovery {
|
|
|
209
217
|
return Promise.resolve({turnServerInfo: undefined, turnDiscoverySkippedReason: 'reachability'});
|
|
210
218
|
}
|
|
211
219
|
|
|
220
|
+
// @ts-ignore - fix type
|
|
212
221
|
if (!meeting.config.experimental.enableTurnDiscovery) {
|
|
213
222
|
LoggerProxy.logger.info('Roap:turnDiscovery#doTurnDiscovery --> TURN discovery disabled in config, skipping it');
|
|
214
223
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
import PeerConnectionManager from '../peer-connection-manager';
|
|
3
2
|
import {
|
|
4
3
|
_ANSWER_,
|
|
@@ -10,7 +9,7 @@ import {
|
|
|
10
9
|
import LoggerProxy from '../common/logs/logger-proxy';
|
|
11
10
|
import ParameterError from '../common/errors/parameter';
|
|
12
11
|
|
|
13
|
-
const RoapUtil = {};
|
|
12
|
+
const RoapUtil: any = {};
|
|
14
13
|
const ROAP_ANSWER = _ANSWER_.toLowerCase();
|
|
15
14
|
|
|
16
15
|
RoapUtil.shouldHandleMedia = (meeting) => {
|
|
File without changes
|