@webex/calling 3.10.0-next.11 → 3.10.0-next.13

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.
@@ -12,9 +12,9 @@ _Object$defineProperty(exports, "__esModule", {
12
12
  value: true
13
13
  });
14
14
  exports.createCall = exports.Call = void 0;
15
- var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
16
15
  var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
17
16
  var _assign = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/assign"));
17
+ var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
18
18
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
19
19
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
20
20
  var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
@@ -99,7 +99,114 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
99
99
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "localAudioStream", void 0);
100
100
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "rtcMetrics", void 0);
101
101
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "callKeepaliveRetryCount", 0);
102
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "callKeepaliveInterval", void 0);
102
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "callKeepaliveRetryCallback", function (interval) {
103
+ if (_this.callKeepaliveRetryCount === _constants.MAX_CALL_KEEPALIVE_RETRY_COUNT) {
104
+ _Logger.default.warn("Max keepalive retry attempts reached. Aborting call keepalive for callId: ".concat(_this.callId), {
105
+ file: _constants.CALL_FILE,
106
+ method: 'keepaliveRetryCallback'
107
+ });
108
+ return;
109
+ }
110
+ _this.callKeepaliveRetryCount += 1;
111
+ setTimeout(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
112
+ return _regenerator.default.wrap(function _callee$(_context) {
113
+ while (1) switch (_context.prev = _context.next) {
114
+ case 0:
115
+ _context.prev = 0;
116
+ _context.next = 3;
117
+ return _this.postStatus();
118
+ case 3:
119
+ _this.scheduleCallKeepaliveInterval();
120
+ _context.next = 10;
121
+ break;
122
+ case 6:
123
+ _context.prev = 6;
124
+ _context.t0 = _context["catch"](0);
125
+ _context.next = 10;
126
+ return _this.handleCallKeepaliveError(_context.t0);
127
+ case 10:
128
+ case "end":
129
+ return _context.stop();
130
+ }
131
+ }, _callee, null, [[0, 6]]);
132
+ })), interval * 1000);
133
+ });
134
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleCallKeepaliveError", /*#__PURE__*/function () {
135
+ var _ref2 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2(err) {
136
+ var error, abort;
137
+ return _regenerator.default.wrap(function _callee2$(_context2) {
138
+ while (1) switch (_context2.prev = _context2.next) {
139
+ case 0:
140
+ error = err;
141
+ /* We are clearing the timer here as all are error scenarios. Only scenario where
142
+ * timer reset won't be required is 503 with retry after. But that case will
143
+ * be handled automatically as Mobius will also reset timer when we post status
144
+ * in retry-after scenario.
145
+ */
146
+ /* istanbul ignore next */
147
+ if (_this.sessionTimer) {
148
+ clearInterval(_this.sessionTimer);
149
+ }
150
+ _context2.next = 4;
151
+ return (0, _Utils.handleCallErrors)(function (callError) {
152
+ _this.emit(_types3.CALL_EVENT_KEYS.CALL_ERROR, callError);
153
+ _this.submitCallErrorMetric(callError);
154
+ }, _types.ERROR_LAYER.CALL_CONTROL, _this.callKeepaliveRetryCallback, _this.getCorrelationId(), error, 'handleCallEstablished', _constants.CALL_FILE);
155
+ case 4:
156
+ abort = _context2.sent;
157
+ if (abort) {
158
+ _this.sendCallStateMachineEvt({
159
+ type: 'E_SEND_CALL_DISCONNECT'
160
+ });
161
+ _this.emit(_types3.CALL_EVENT_KEYS.DISCONNECT, _this.getCorrelationId());
162
+ _this.callKeepaliveRetryCount = 0;
163
+ }
164
+ _context2.next = 8;
165
+ return (0, _Utils.uploadLogs)({
166
+ correlationId: _this.correlationId,
167
+ callId: _this.callId,
168
+ broadworksCorrelationInfo: _this.broadworksCorrelationInfo
169
+ });
170
+ case 8:
171
+ case "end":
172
+ return _context2.stop();
173
+ }
174
+ }, _callee2);
175
+ }));
176
+ return function (_x) {
177
+ return _ref2.apply(this, arguments);
178
+ };
179
+ }());
180
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "scheduleCallKeepaliveInterval", function () {
181
+ var loggerContext = {
182
+ file: _constants.CALL_FILE,
183
+ method: 'scheduleCallKeepaliveInterval'
184
+ };
185
+ _this.sessionTimer = setInterval(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3() {
186
+ var res;
187
+ return _regenerator.default.wrap(function _callee3$(_context3) {
188
+ while (1) switch (_context3.prev = _context3.next) {
189
+ case 0:
190
+ _context3.prev = 0;
191
+ _context3.next = 3;
192
+ return _this.postStatus();
193
+ case 3:
194
+ res = _context3.sent;
195
+ _Logger.default.info("Session refresh successful", loggerContext);
196
+ _context3.next = 11;
197
+ break;
198
+ case 7:
199
+ _context3.prev = 7;
200
+ _context3.t0 = _context3["catch"](0);
201
+ _context3.next = 11;
202
+ return _this.handleCallKeepaliveError(_context3.t0);
203
+ case 11:
204
+ case "end":
205
+ return _context3.stop();
206
+ }
207
+ }, _callee3, null, [[0, 7]]);
208
+ })), _constants.DEFAULT_SESSION_TIMER);
209
+ });
103
210
  /**
104
211
  * Media failed, so collect a stats report from webrtc
105
212
  * send a webrtc telemetry dump to the configured server using the internal media core check metrics configured callback
@@ -107,34 +214,34 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
107
214
  * @returns {Promise<void>}
108
215
  */
109
216
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "forceSendStatsReport", /*#__PURE__*/function () {
110
- var _ref2 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
217
+ var _ref5 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4(_ref4) {
111
218
  var callFrom, loggerContext, errorInfo, errorStatus;
112
- return _regenerator.default.wrap(function _callee$(_context) {
113
- while (1) switch (_context.prev = _context.next) {
219
+ return _regenerator.default.wrap(function _callee4$(_context4) {
220
+ while (1) switch (_context4.prev = _context4.next) {
114
221
  case 0:
115
- callFrom = _ref.callFrom;
222
+ callFrom = _ref4.callFrom;
116
223
  loggerContext = {
117
224
  file: _constants.CALL_FILE,
118
225
  method: _constants.METHODS.FORCE_SEND_STATS_REPORT
119
226
  };
120
- _context.prev = 2;
121
- _context.next = 5;
227
+ _context4.prev = 2;
228
+ _context4.next = 5;
122
229
  return _this.mediaConnection.forceRtcMetricsSend();
123
230
  case 5:
124
231
  _Logger.default.info("Successfully uploaded available webrtc telemetry statistics", loggerContext);
125
232
  _Logger.default.info("callFrom: ".concat(callFrom), loggerContext);
126
- _context.next = 18;
233
+ _context4.next = 18;
127
234
  break;
128
235
  case 9:
129
- _context.prev = 9;
130
- _context.t0 = _context["catch"](2);
131
- errorInfo = _context.t0;
132
- _context.next = 14;
236
+ _context4.prev = 9;
237
+ _context4.t0 = _context4["catch"](2);
238
+ errorInfo = _context4.t0;
239
+ _context4.next = 14;
133
240
  return (0, _Utils.serviceErrorCodeHandler)(errorInfo, loggerContext);
134
241
  case 14:
135
- errorStatus = _context.sent;
242
+ errorStatus = _context4.sent;
136
243
  _Logger.default.error("Failed to upload webrtc telemetry statistics. ".concat((0, _stringify.default)(errorStatus)), loggerContext);
137
- _context.next = 18;
244
+ _context4.next = 18;
138
245
  return (0, _Utils.uploadLogs)({
139
246
  correlationId: _this.correlationId,
140
247
  callId: _this.callId,
@@ -142,12 +249,12 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
142
249
  });
143
250
  case 18:
144
251
  case "end":
145
- return _context.stop();
252
+ return _context4.stop();
146
253
  }
147
- }, _callee, null, [[2, 9]]);
254
+ }, _callee4, null, [[2, 9]]);
148
255
  }));
149
- return function (_x) {
150
- return _ref2.apply(this, arguments);
256
+ return function (_x2) {
257
+ return _ref5.apply(this, arguments);
151
258
  };
152
259
  }());
153
260
  /**
@@ -195,10 +302,10 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
195
302
  * @param roapMessage
196
303
  */
197
304
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "post", /*#__PURE__*/function () {
198
- var _ref3 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2(roapMessage) {
305
+ var _ref6 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5(roapMessage) {
199
306
  var basePayload;
200
- return _regenerator.default.wrap(function _callee2$(_context2) {
201
- while (1) switch (_context2.prev = _context2.next) {
307
+ return _regenerator.default.wrap(function _callee5$(_context5) {
308
+ while (1) switch (_context5.prev = _context5.next) {
202
309
  case 0:
203
310
  basePayload = {
204
311
  device: {
@@ -210,7 +317,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
210
317
  mediaId: (0, _uuid.v4)()
211
318
  }
212
319
  };
213
- return _context2.abrupt("return", _this.webex.request({
320
+ return _context5.abrupt("return", _this.webex.request({
214
321
  uri: "".concat(_this.mobiusUrl).concat(_constants.DEVICES_ENDPOINT_RESOURCE, "/").concat(_this.deviceId, "/").concat(_constants.CALL_ENDPOINT_RESOURCE),
215
322
  method: _types2.HTTP_METHODS.POST,
216
323
  service: _types2.ALLOWED_SERVICES.MOBIUS,
@@ -224,12 +331,12 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
224
331
  }));
225
332
  case 2:
226
333
  case "end":
227
- return _context2.stop();
334
+ return _context5.stop();
228
335
  }
229
- }, _callee2);
336
+ }, _callee5);
230
337
  }));
231
- return function (_x2) {
232
- return _ref3.apply(this, arguments);
338
+ return function (_x3) {
339
+ return _ref6.apply(this, arguments);
233
340
  };
234
341
  }());
235
342
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onEffectEnabled", function () {
@@ -1137,22 +1244,22 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
1137
1244
  }, {
1138
1245
  key: "handleOutgoingCallSetup",
1139
1246
  value: (function () {
1140
- var _handleOutgoingCallSetup = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3(event) {
1247
+ var _handleOutgoingCallSetup = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6(event) {
1141
1248
  var _this2 = this;
1142
1249
  var message, response, errData;
1143
- return _regenerator.default.wrap(function _callee3$(_context3) {
1144
- while (1) switch (_context3.prev = _context3.next) {
1250
+ return _regenerator.default.wrap(function _callee6$(_context6) {
1251
+ while (1) switch (_context6.prev = _context6.next) {
1145
1252
  case 0:
1146
1253
  _Logger.default.info("".concat(_constants2.METHOD_START_MESSAGE, " with: ").concat(this.getCorrelationId()), {
1147
1254
  file: _constants.CALL_FILE,
1148
1255
  method: _constants.METHODS.HANDLE_OUTGOING_CALL_SETUP
1149
1256
  });
1150
1257
  message = event.data;
1151
- _context3.prev = 2;
1152
- _context3.next = 5;
1258
+ _context6.prev = 2;
1259
+ _context6.next = 5;
1153
1260
  return this.post(message);
1154
1261
  case 5:
1155
- response = _context3.sent;
1262
+ response = _context6.sent;
1156
1263
  _Logger.default.info("Response: ".concat((0, _stringify.default)(response)), {
1157
1264
  file: _constants.CALL_FILE,
1158
1265
  method: _constants.METHODS.HANDLE_OUTGOING_CALL_SETUP
@@ -1166,16 +1273,16 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
1166
1273
  file: _constants.CALL_FILE,
1167
1274
  method: this.handleOutgoingCallSetup.name
1168
1275
  });
1169
- _context3.next = 19;
1276
+ _context6.next = 19;
1170
1277
  break;
1171
1278
  case 12:
1172
- _context3.prev = 12;
1173
- _context3.t0 = _context3["catch"](2);
1174
- _Logger.default.error("Failed to setup the call: ".concat((0, _stringify.default)(_context3.t0)), {
1279
+ _context6.prev = 12;
1280
+ _context6.t0 = _context6["catch"](2);
1281
+ _Logger.default.error("Failed to setup the call: ".concat((0, _stringify.default)(_context6.t0)), {
1175
1282
  file: _constants.CALL_FILE,
1176
1283
  method: _constants.METHODS.HANDLE_OUTGOING_CALL_SETUP
1177
1284
  });
1178
- errData = _context3.t0;
1285
+ errData = _context6.t0;
1179
1286
  (0, _Utils.handleCallErrors)(function (error) {
1180
1287
  _this2.emit(_types3.CALL_EVENT_KEYS.CALL_ERROR, error);
1181
1288
  _this2.submitCallErrorMetric(error);
@@ -1189,7 +1296,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
1189
1296
  function (interval) {
1190
1297
  return undefined;
1191
1298
  }, this.getCorrelationId(), errData, _constants.METHODS.HANDLE_OUTGOING_CALL_SETUP, _constants.CALL_FILE);
1192
- _context3.next = 19;
1299
+ _context6.next = 19;
1193
1300
  return (0, _Utils.uploadLogs)({
1194
1301
  correlationId: this.correlationId,
1195
1302
  callId: this.callId,
@@ -1197,11 +1304,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
1197
1304
  });
1198
1305
  case 19:
1199
1306
  case "end":
1200
- return _context3.stop();
1307
+ return _context6.stop();
1201
1308
  }
1202
- }, _callee3, this, [[2, 12]]);
1309
+ }, _callee6, this, [[2, 12]]);
1203
1310
  }));
1204
- function handleOutgoingCallSetup(_x3) {
1311
+ function handleOutgoingCallSetup(_x4) {
1205
1312
  return _handleOutgoingCallSetup.apply(this, arguments);
1206
1313
  }
1207
1314
  return handleOutgoingCallSetup;
@@ -1216,21 +1323,21 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
1216
1323
  }, {
1217
1324
  key: "handleCallHold",
1218
1325
  value: (function () {
1219
- var _handleCallHold = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5(event) {
1326
+ var _handleCallHold = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8(event) {
1220
1327
  var _this3 = this;
1221
1328
  var response, errData;
1222
- return _regenerator.default.wrap(function _callee5$(_context5) {
1223
- while (1) switch (_context5.prev = _context5.next) {
1329
+ return _regenerator.default.wrap(function _callee8$(_context8) {
1330
+ while (1) switch (_context8.prev = _context8.next) {
1224
1331
  case 0:
1225
1332
  _Logger.default.info("".concat(_constants2.METHOD_START_MESSAGE, " with: ").concat(this.getCorrelationId()), {
1226
1333
  file: _constants.CALL_FILE,
1227
1334
  method: _constants.METHODS.HANDLE_CALL_HOLD
1228
1335
  });
1229
- _context5.prev = 1;
1230
- _context5.next = 4;
1336
+ _context8.prev = 1;
1337
+ _context8.next = 4;
1231
1338
  return this.postSSRequest(undefined, _types3.SUPPLEMENTARY_SERVICES.HOLD);
1232
1339
  case 4:
1233
- response = _context5.sent;
1340
+ response = _context8.sent;
1234
1341
  _Logger.default.log("Response code: ".concat(response.statusCode), {
1235
1342
  file: _constants.CALL_FILE,
1236
1343
  method: _constants.METHODS.HANDLE_CALL_HOLD
@@ -1241,10 +1348,10 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
1241
1348
  * received from Mobius and forwarded towards calling client
1242
1349
  */
1243
1350
  if (this.isHeld() === false) {
1244
- this.supplementaryServicesTimer = setTimeout(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4() {
1351
+ this.supplementaryServicesTimer = setTimeout(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7() {
1245
1352
  var errorContext, callError;
1246
- return _regenerator.default.wrap(function _callee4$(_context4) {
1247
- while (1) switch (_context4.prev = _context4.next) {
1353
+ return _regenerator.default.wrap(function _callee7$(_context7) {
1354
+ while (1) switch (_context7.prev = _context7.next) {
1248
1355
  case 0:
1249
1356
  errorContext = {
1250
1357
  file: _constants.CALL_FILE,
@@ -1259,21 +1366,21 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
1259
1366
  _this3.submitCallErrorMetric(callError);
1260
1367
  case 5:
1261
1368
  case "end":
1262
- return _context4.stop();
1369
+ return _context7.stop();
1263
1370
  }
1264
- }, _callee4);
1371
+ }, _callee7);
1265
1372
  })), _constants.SUPPLEMENTARY_SERVICES_TIMEOUT);
1266
1373
  }
1267
- _context5.next = 16;
1374
+ _context8.next = 16;
1268
1375
  break;
1269
1376
  case 9:
1270
- _context5.prev = 9;
1271
- _context5.t0 = _context5["catch"](1);
1272
- _Logger.default.error("Failed to put the call on hold: ".concat((0, _stringify.default)(_context5.t0)), {
1377
+ _context8.prev = 9;
1378
+ _context8.t0 = _context8["catch"](1);
1379
+ _Logger.default.error("Failed to put the call on hold: ".concat((0, _stringify.default)(_context8.t0)), {
1273
1380
  file: _constants.CALL_FILE,
1274
1381
  method: _constants.METHODS.HANDLE_CALL_HOLD
1275
1382
  });
1276
- errData = _context5.t0;
1383
+ errData = _context8.t0;
1277
1384
  (0, _Utils.handleCallErrors)(function (error) {
1278
1385
  _this3.emit(_types3.CALL_EVENT_KEYS.HOLD_ERROR, error);
1279
1386
  _this3.submitCallErrorMetric(error);
@@ -1287,7 +1394,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
1287
1394
  function (interval) {
1288
1395
  return undefined;
1289
1396
  }, this.getCorrelationId(), errData, _constants.METHODS.HANDLE_CALL_HOLD, _constants.CALL_FILE);
1290
- _context5.next = 16;
1397
+ _context8.next = 16;
1291
1398
  return (0, _Utils.uploadLogs)({
1292
1399
  correlationId: this.correlationId,
1293
1400
  callId: this.callId,
@@ -1295,11 +1402,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
1295
1402
  });
1296
1403
  case 16:
1297
1404
  case "end":
1298
- return _context5.stop();
1405
+ return _context8.stop();
1299
1406
  }
1300
- }, _callee5, this, [[1, 9]]);
1407
+ }, _callee8, this, [[1, 9]]);
1301
1408
  }));
1302
- function handleCallHold(_x4) {
1409
+ function handleCallHold(_x5) {
1303
1410
  return _handleCallHold.apply(this, arguments);
1304
1411
  }
1305
1412
  return handleCallHold;
@@ -1314,21 +1421,21 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
1314
1421
  }, {
1315
1422
  key: "handleCallResume",
1316
1423
  value: (function () {
1317
- var _handleCallResume = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7(event) {
1424
+ var _handleCallResume = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee0(event) {
1318
1425
  var _this4 = this;
1319
1426
  var response, errData;
1320
- return _regenerator.default.wrap(function _callee7$(_context7) {
1321
- while (1) switch (_context7.prev = _context7.next) {
1427
+ return _regenerator.default.wrap(function _callee0$(_context0) {
1428
+ while (1) switch (_context0.prev = _context0.next) {
1322
1429
  case 0:
1323
1430
  _Logger.default.info("".concat(_constants2.METHOD_START_MESSAGE, " with: ").concat(this.getCorrelationId()), {
1324
1431
  file: _constants.CALL_FILE,
1325
1432
  method: _constants.METHODS.HANDLE_CALL_RESUME
1326
1433
  });
1327
- _context7.prev = 1;
1328
- _context7.next = 4;
1434
+ _context0.prev = 1;
1435
+ _context0.next = 4;
1329
1436
  return this.postSSRequest(undefined, _types3.SUPPLEMENTARY_SERVICES.RESUME);
1330
1437
  case 4:
1331
- response = _context7.sent;
1438
+ response = _context0.sent;
1332
1439
  _Logger.default.log("Response code: ".concat(response.statusCode), {
1333
1440
  file: _constants.CALL_FILE,
1334
1441
  method: _constants.METHODS.HANDLE_CALL_RESUME
@@ -1339,10 +1446,10 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
1339
1446
  * received from Mobius on resuming the call and forwarded towards calling client
1340
1447
  */
1341
1448
  if (this.isHeld() === true) {
1342
- this.supplementaryServicesTimer = setTimeout(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6() {
1449
+ this.supplementaryServicesTimer = setTimeout(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee9() {
1343
1450
  var errorContext, callError;
1344
- return _regenerator.default.wrap(function _callee6$(_context6) {
1345
- while (1) switch (_context6.prev = _context6.next) {
1451
+ return _regenerator.default.wrap(function _callee9$(_context9) {
1452
+ while (1) switch (_context9.prev = _context9.next) {
1346
1453
  case 0:
1347
1454
  errorContext = {
1348
1455
  file: _constants.CALL_FILE,
@@ -1357,21 +1464,21 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
1357
1464
  _this4.submitCallErrorMetric(callError);
1358
1465
  case 5:
1359
1466
  case "end":
1360
- return _context6.stop();
1467
+ return _context9.stop();
1361
1468
  }
1362
- }, _callee6);
1469
+ }, _callee9);
1363
1470
  })), _constants.SUPPLEMENTARY_SERVICES_TIMEOUT);
1364
1471
  }
1365
- _context7.next = 16;
1472
+ _context0.next = 16;
1366
1473
  break;
1367
1474
  case 9:
1368
- _context7.prev = 9;
1369
- _context7.t0 = _context7["catch"](1);
1370
- _Logger.default.error("Failed to resume the call: ".concat((0, _stringify.default)(_context7.t0)), {
1475
+ _context0.prev = 9;
1476
+ _context0.t0 = _context0["catch"](1);
1477
+ _Logger.default.error("Failed to resume the call: ".concat((0, _stringify.default)(_context0.t0)), {
1371
1478
  file: _constants.CALL_FILE,
1372
1479
  method: _constants.METHODS.HANDLE_CALL_RESUME
1373
1480
  });
1374
- errData = _context7.t0;
1481
+ errData = _context0.t0;
1375
1482
  (0, _Utils.handleCallErrors)(function (error) {
1376
1483
  _this4.emit(_types3.CALL_EVENT_KEYS.RESUME_ERROR, error);
1377
1484
  _this4.submitCallErrorMetric(error);
@@ -1385,7 +1492,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
1385
1492
  function (interval) {
1386
1493
  return undefined;
1387
1494
  }, this.getCorrelationId(), errData, _constants.METHODS.HANDLE_CALL_RESUME, _constants.CALL_FILE);
1388
- _context7.next = 16;
1495
+ _context0.next = 16;
1389
1496
  return (0, _Utils.uploadLogs)({
1390
1497
  correlationId: this.correlationId,
1391
1498
  callId: this.callId,
@@ -1393,11 +1500,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
1393
1500
  });
1394
1501
  case 16:
1395
1502
  case "end":
1396
- return _context7.stop();
1503
+ return _context0.stop();
1397
1504
  }
1398
- }, _callee7, this, [[1, 9]]);
1505
+ }, _callee0, this, [[1, 9]]);
1399
1506
  }));
1400
- function handleCallResume(_x5) {
1507
+ function handleCallResume(_x6) {
1401
1508
  return _handleCallResume.apply(this, arguments);
1402
1509
  }
1403
1510
  return handleCallResume;
@@ -1486,35 +1593,35 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
1486
1593
  }, {
1487
1594
  key: "handleOutgoingCallAlerting",
1488
1595
  value: (function () {
1489
- var _handleOutgoingCallAlerting = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8(event) {
1596
+ var _handleOutgoingCallAlerting = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1(event) {
1490
1597
  var _this5 = this;
1491
1598
  var res, errData;
1492
- return _regenerator.default.wrap(function _callee8$(_context8) {
1493
- while (1) switch (_context8.prev = _context8.next) {
1599
+ return _regenerator.default.wrap(function _callee1$(_context1) {
1600
+ while (1) switch (_context1.prev = _context1.next) {
1494
1601
  case 0:
1495
1602
  _Logger.default.info("".concat(_constants2.METHOD_START_MESSAGE, " with: ").concat(this.getCorrelationId()), {
1496
1603
  file: _constants.CALL_FILE,
1497
1604
  method: _constants.METHODS.HANDLE_OUTGOING_CALL_ALERTING
1498
1605
  });
1499
- _context8.prev = 1;
1500
- _context8.next = 4;
1606
+ _context1.prev = 1;
1607
+ _context1.next = 4;
1501
1608
  return this.patch(_types4.MobiusCallState.ALERTING);
1502
1609
  case 4:
1503
- res = _context8.sent;
1610
+ res = _context1.sent;
1504
1611
  _Logger.default.log("PATCH response: ".concat(res.statusCode), {
1505
1612
  file: _constants.CALL_FILE,
1506
1613
  method: _constants.METHODS.HANDLE_OUTGOING_CALL_ALERTING
1507
1614
  });
1508
- _context8.next = 15;
1615
+ _context1.next = 15;
1509
1616
  break;
1510
1617
  case 8:
1511
- _context8.prev = 8;
1512
- _context8.t0 = _context8["catch"](1);
1513
- _Logger.default.error("Failed to signal call progression: ".concat((0, _stringify.default)(_context8.t0)), {
1618
+ _context1.prev = 8;
1619
+ _context1.t0 = _context1["catch"](1);
1620
+ _Logger.default.error("Failed to signal call progression: ".concat((0, _stringify.default)(_context1.t0)), {
1514
1621
  file: _constants.CALL_FILE,
1515
1622
  method: _constants.METHODS.HANDLE_OUTGOING_CALL_ALERTING
1516
1623
  });
1517
- errData = _context8.t0;
1624
+ errData = _context1.t0;
1518
1625
  (0, _Utils.handleCallErrors)(function (error) {
1519
1626
  _this5.emit(_types3.CALL_EVENT_KEYS.CALL_ERROR, error);
1520
1627
  _this5.submitCallErrorMetric(error);
@@ -1528,7 +1635,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
1528
1635
  function (interval) {
1529
1636
  return undefined;
1530
1637
  }, this.getCorrelationId(), errData, _constants.METHODS.HANDLE_OUTGOING_CALL_ALERTING, _constants.CALL_FILE);
1531
- _context8.next = 15;
1638
+ _context1.next = 15;
1532
1639
  return (0, _Utils.uploadLogs)({
1533
1640
  correlationId: this.correlationId,
1534
1641
  callId: this.callId,
@@ -1536,11 +1643,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
1536
1643
  });
1537
1644
  case 15:
1538
1645
  case "end":
1539
- return _context8.stop();
1646
+ return _context1.stop();
1540
1647
  }
1541
- }, _callee8, this, [[1, 8]]);
1648
+ }, _callee1, this, [[1, 8]]);
1542
1649
  }));
1543
- function handleOutgoingCallAlerting(_x6) {
1650
+ function handleOutgoingCallAlerting(_x7) {
1544
1651
  return _handleOutgoingCallAlerting.apply(this, arguments);
1545
1652
  }
1546
1653
  return handleOutgoingCallAlerting;
@@ -1581,11 +1688,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
1581
1688
  }, {
1582
1689
  key: "handleOutgoingCallConnect",
1583
1690
  value: (function () {
1584
- var _handleOutgoingCallConnect = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee9(event) {
1691
+ var _handleOutgoingCallConnect = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10(event) {
1585
1692
  var _this6 = this;
1586
1693
  var res, errData;
1587
- return _regenerator.default.wrap(function _callee9$(_context9) {
1588
- while (1) switch (_context9.prev = _context9.next) {
1694
+ return _regenerator.default.wrap(function _callee10$(_context10) {
1695
+ while (1) switch (_context10.prev = _context10.next) {
1589
1696
  case 0:
1590
1697
  _Logger.default.info("".concat(_constants2.METHOD_START_MESSAGE, " with: ").concat(this.getCorrelationId()), {
1591
1698
  file: _constants.CALL_FILE,
@@ -1594,38 +1701,38 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
1594
1701
 
1595
1702
  /* We should have received an Offer by now */
1596
1703
  if (this.remoteRoapMessage) {
1597
- _context9.next = 4;
1704
+ _context10.next = 4;
1598
1705
  break;
1599
1706
  }
1600
1707
  _Logger.default.warn('Offer not yet received from remote end... Exiting', {
1601
1708
  file: _constants.CALL_FILE,
1602
1709
  method: _constants.METHODS.HANDLE_OUTGOING_CALL_CONNECT
1603
1710
  });
1604
- return _context9.abrupt("return");
1711
+ return _context10.abrupt("return");
1605
1712
  case 4:
1606
- _context9.prev = 4;
1713
+ _context10.prev = 4;
1607
1714
  /* Start Offer/Answer as we might have buffered the offer by now */
1608
1715
  this.mediaConnection.roapMessageReceived(this.remoteRoapMessage);
1609
1716
 
1610
1717
  /* send call_connect PATCH */
1611
- _context9.next = 8;
1718
+ _context10.next = 8;
1612
1719
  return this.patch(_types4.MobiusCallState.CONNECTED);
1613
1720
  case 8:
1614
- res = _context9.sent;
1721
+ res = _context10.sent;
1615
1722
  _Logger.default.log("PATCH response: ".concat(res.statusCode), {
1616
1723
  file: _constants.CALL_FILE,
1617
1724
  method: _constants.METHODS.HANDLE_OUTGOING_CALL_CONNECT
1618
1725
  });
1619
- _context9.next = 19;
1726
+ _context10.next = 19;
1620
1727
  break;
1621
1728
  case 12:
1622
- _context9.prev = 12;
1623
- _context9.t0 = _context9["catch"](4);
1624
- _Logger.default.error("Failed to connect the call: ".concat((0, _stringify.default)(_context9.t0)), {
1729
+ _context10.prev = 12;
1730
+ _context10.t0 = _context10["catch"](4);
1731
+ _Logger.default.error("Failed to connect the call: ".concat((0, _stringify.default)(_context10.t0)), {
1625
1732
  file: _constants.CALL_FILE,
1626
1733
  method: _constants.METHODS.HANDLE_OUTGOING_CALL_CONNECT
1627
1734
  });
1628
- errData = _context9.t0;
1735
+ errData = _context10.t0;
1629
1736
  (0, _Utils.handleCallErrors)(function (error) {
1630
1737
  _this6.emit(_types3.CALL_EVENT_KEYS.CALL_ERROR, error);
1631
1738
  _this6.submitCallErrorMetric(error);
@@ -1639,7 +1746,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
1639
1746
  function (interval) {
1640
1747
  return undefined;
1641
1748
  }, this.getCorrelationId(), errData, _constants.METHODS.HANDLE_OUTGOING_CALL_CONNECT, _constants.CALL_FILE);
1642
- _context9.next = 19;
1749
+ _context10.next = 19;
1643
1750
  return (0, _Utils.uploadLogs)({
1644
1751
  correlationId: this.correlationId,
1645
1752
  callId: this.callId,
@@ -1647,11 +1754,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
1647
1754
  });
1648
1755
  case 19:
1649
1756
  case "end":
1650
- return _context9.stop();
1757
+ return _context10.stop();
1651
1758
  }
1652
- }, _callee9, this, [[4, 12]]);
1759
+ }, _callee10, this, [[4, 12]]);
1653
1760
  }));
1654
- function handleOutgoingCallConnect(_x7) {
1761
+ function handleOutgoingCallConnect(_x8) {
1655
1762
  return _handleOutgoingCallConnect.apply(this, arguments);
1656
1763
  }
1657
1764
  return handleOutgoingCallConnect;
@@ -1666,10 +1773,10 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
1666
1773
  }, {
1667
1774
  key: "handleIncomingCallDisconnect",
1668
1775
  value: (function () {
1669
- var _handleIncomingCallDisconnect = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee0(event) {
1776
+ var _handleIncomingCallDisconnect = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11(event) {
1670
1777
  var response;
1671
- return _regenerator.default.wrap(function _callee0$(_context0) {
1672
- while (1) switch (_context0.prev = _context0.next) {
1778
+ return _regenerator.default.wrap(function _callee11$(_context11) {
1779
+ while (1) switch (_context11.prev = _context11.next) {
1673
1780
  case 0:
1674
1781
  _Logger.default.info("".concat(_constants2.METHOD_START_MESSAGE, " with: ").concat(this.getCorrelationId()), {
1675
1782
  file: _constants.CALL_FILE,
@@ -1677,21 +1784,21 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
1677
1784
  });
1678
1785
  this.emit(_types3.CALL_EVENT_KEYS.DISCONNECT, this.correlationId);
1679
1786
  this.setDisconnectReason();
1680
- _context0.prev = 3;
1681
- _context0.next = 6;
1787
+ _context11.prev = 3;
1788
+ _context11.next = 6;
1682
1789
  return this.delete();
1683
1790
  case 6:
1684
- response = _context0.sent;
1791
+ response = _context11.sent;
1685
1792
  _Logger.default.log("Response code: ".concat(response.statusCode), {
1686
1793
  file: _constants.CALL_FILE,
1687
1794
  method: _constants.METHODS.HANDLE_INCOMING_CALL_DISCONNECT
1688
1795
  });
1689
- _context0.next = 14;
1796
+ _context11.next = 14;
1690
1797
  break;
1691
1798
  case 10:
1692
- _context0.prev = 10;
1693
- _context0.t0 = _context0["catch"](3);
1694
- _Logger.default.warn("Failed to delete the call: ".concat((0, _stringify.default)(_context0.t0)), {
1799
+ _context11.prev = 10;
1800
+ _context11.t0 = _context11["catch"](3);
1801
+ _Logger.default.warn("Failed to delete the call: ".concat((0, _stringify.default)(_context11.t0)), {
1695
1802
  file: _constants.CALL_FILE,
1696
1803
  method: _constants.METHODS.HANDLE_INCOMING_CALL_DISCONNECT
1697
1804
  });
@@ -1727,11 +1834,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
1727
1834
  });
1728
1835
  case 20:
1729
1836
  case "end":
1730
- return _context0.stop();
1837
+ return _context11.stop();
1731
1838
  }
1732
- }, _callee0, this, [[3, 10]]);
1839
+ }, _callee11, this, [[3, 10]]);
1733
1840
  }));
1734
- function handleIncomingCallDisconnect(_x8) {
1841
+ function handleIncomingCallDisconnect(_x9) {
1735
1842
  return _handleIncomingCallDisconnect.apply(this, arguments);
1736
1843
  }
1737
1844
  return handleIncomingCallDisconnect;
@@ -1746,21 +1853,21 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
1746
1853
  }, {
1747
1854
  key: "handleOutgoingCallDisconnect",
1748
1855
  value: (function () {
1749
- var _handleOutgoingCallDisconnect = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1(event) {
1856
+ var _handleOutgoingCallDisconnect = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12(event) {
1750
1857
  var response;
1751
- return _regenerator.default.wrap(function _callee1$(_context1) {
1752
- while (1) switch (_context1.prev = _context1.next) {
1858
+ return _regenerator.default.wrap(function _callee12$(_context12) {
1859
+ while (1) switch (_context12.prev = _context12.next) {
1753
1860
  case 0:
1754
1861
  _Logger.default.info("".concat(_constants2.METHOD_START_MESSAGE, " with: ").concat(this.getCorrelationId()), {
1755
1862
  file: _constants.CALL_FILE,
1756
1863
  method: _constants.METHODS.HANDLE_OUTGOING_CALL_DISCONNECT
1757
1864
  });
1758
1865
  this.setDisconnectReason();
1759
- _context1.prev = 2;
1760
- _context1.next = 5;
1866
+ _context12.prev = 2;
1867
+ _context12.next = 5;
1761
1868
  return this.delete();
1762
1869
  case 5:
1763
- response = _context1.sent;
1870
+ response = _context12.sent;
1764
1871
  _Logger.default.log("Response code: ".concat(response.statusCode), {
1765
1872
  file: _constants.CALL_FILE,
1766
1873
  method: _constants.METHODS.HANDLE_OUTGOING_CALL_DISCONNECT
@@ -1769,11 +1876,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
1769
1876
  file: _constants.CALL_FILE,
1770
1877
  method: _constants.METHODS.HANDLE_OUTGOING_CALL_DISCONNECT
1771
1878
  });
1772
- _context1.next = 14;
1879
+ _context12.next = 14;
1773
1880
  break;
1774
1881
  case 10:
1775
- _context1.prev = 10;
1776
- _context1.t0 = _context1["catch"](2);
1882
+ _context12.prev = 10;
1883
+ _context12.t0 = _context12["catch"](2);
1777
1884
  _Logger.default.warn('Failed to delete the call', {
1778
1885
  file: _constants.CALL_FILE,
1779
1886
  method: _constants.METHODS.HANDLE_OUTGOING_CALL_DISCONNECT
@@ -1810,26 +1917,25 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
1810
1917
  });
1811
1918
  case 20:
1812
1919
  case "end":
1813
- return _context1.stop();
1920
+ return _context12.stop();
1814
1921
  }
1815
- }, _callee1, this, [[2, 10]]);
1922
+ }, _callee12, this, [[2, 10]]);
1816
1923
  }));
1817
- function handleOutgoingCallDisconnect(_x9) {
1924
+ function handleOutgoingCallDisconnect(_x0) {
1818
1925
  return _handleOutgoingCallDisconnect.apply(this, arguments);
1819
1926
  }
1820
1927
  return handleOutgoingCallDisconnect;
1821
- }()
1928
+ }())
1929
+ }, {
1930
+ key: "handleCallEstablished",
1931
+ value:
1822
1932
  /**
1823
1933
  * Handle Call Established - Roap related negotiations.
1824
1934
  *
1825
1935
  * @param event - Call Events.
1826
1936
  */
1827
1937
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
1828
- )
1829
- }, {
1830
- key: "handleCallEstablished",
1831
- value: function handleCallEstablished(event) {
1832
- var _this7 = this;
1938
+ function handleCallEstablished(event) {
1833
1939
  var loggerContext = {
1834
1940
  file: _constants.CALL_FILE,
1835
1941
  method: _constants.METHODS.HANDLE_CALL_ESTABLISHED
@@ -1840,85 +1946,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
1840
1946
  /* Reset Early dialog parameters */
1841
1947
  this.earlyMedia = false;
1842
1948
  this.connected = true;
1843
-
1844
- /* Session timers need to be reset at all offer/answer exchanges */
1845
- if (this.sessionTimer) {
1846
- _Logger.default.log('Resetting session timer', loggerContext);
1847
- clearInterval(this.sessionTimer);
1848
- }
1849
- this.sessionTimer = setInterval(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10() {
1850
- var res, error, abort;
1851
- return _regenerator.default.wrap(function _callee10$(_context10) {
1852
- while (1) switch (_context10.prev = _context10.next) {
1853
- case 0:
1854
- _context10.prev = 0;
1855
- _context10.next = 3;
1856
- return _this7.postStatus();
1857
- case 3:
1858
- res = _context10.sent;
1859
- _this7.callKeepaliveRetryCount = 0;
1860
- _this7.callKeepaliveInterval = undefined;
1861
- _Logger.default.info("Session refresh successful", loggerContext);
1862
- _context10.next = 19;
1863
- break;
1864
- case 9:
1865
- _context10.prev = 9;
1866
- _context10.t0 = _context10["catch"](0);
1867
- error = _context10.t0;
1868
- /* We are clearing the timer here as all are error scenarios. Only scenario where
1869
- * timer reset won't be required is 503 with retry after. But that case will
1870
- * be handled automatically as Mobius will also reset timer when we post status
1871
- * in retry-after scenario.
1872
- */
1873
- /* istanbul ignore next */
1874
- if (_this7.sessionTimer) {
1875
- clearInterval(_this7.sessionTimer);
1876
- }
1877
- _context10.next = 15;
1878
- return (0, _Utils.handleCallErrors)(function (callError) {
1879
- _this7.emit(_types3.CALL_EVENT_KEYS.CALL_ERROR, callError);
1880
- _this7.submitCallErrorMetric(callError);
1881
- }, _types.ERROR_LAYER.CALL_CONTROL, function (interval) {
1882
- _this7.callKeepaliveRetryCount += 1;
1883
- _this7.callKeepaliveInterval = interval * 1000;
1884
-
1885
- // If we have reached the max retry count, do not attempt to refresh the session
1886
- if (_this7.callKeepaliveRetryCount === _constants.MAX_CALL_KEEPALIVE_RETRY_COUNT) {
1887
- _this7.callKeepaliveRetryCount = 0;
1888
- clearInterval(_this7.sessionTimer);
1889
- _this7.sessionTimer = undefined;
1890
- _this7.callKeepaliveInterval = undefined;
1891
- _Logger.default.warn("Max call keepalive retry attempts reached for call: ".concat(_this7.getCorrelationId()), loggerContext);
1892
- return;
1893
- }
1894
-
1895
- // Scheduling next keepalive attempt - calling handleCallEstablished
1896
- _this7.sendCallStateMachineEvt({
1897
- type: 'E_CALL_ESTABLISHED'
1898
- });
1899
- }, _this7.getCorrelationId(), error, 'handleCallEstablished', _constants.CALL_FILE);
1900
- case 15:
1901
- abort = _context10.sent;
1902
- if (abort) {
1903
- _this7.sendCallStateMachineEvt({
1904
- type: 'E_SEND_CALL_DISCONNECT'
1905
- });
1906
- _this7.emit(_types3.CALL_EVENT_KEYS.DISCONNECT, _this7.getCorrelationId());
1907
- _this7.callKeepaliveRetryCount = 0;
1908
- _this7.callKeepaliveInterval = undefined;
1909
- }
1910
- _context10.next = 19;
1911
- return (0, _Utils.uploadLogs)({
1912
- correlationId: _this7.correlationId,
1913
- callId: _this7.callId,
1914
- broadworksCorrelationInfo: _this7.broadworksCorrelationInfo
1915
- });
1916
- case 19:
1917
- case "end":
1918
- return _context10.stop();
1919
- }
1920
- }, _callee10, null, [[0, 9]]);
1921
- })), this.callKeepaliveInterval || _constants.DEFAULT_SESSION_TIMER);
1949
+ this.scheduleCallKeepaliveInterval();
1922
1950
  }
1923
1951
 
1924
1952
  /**
@@ -1929,10 +1957,10 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
1929
1957
  }, {
1930
1958
  key: "handleUnknownState",
1931
1959
  value: (function () {
1932
- var _handleUnknownState = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11(event) {
1960
+ var _handleUnknownState = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13(event) {
1933
1961
  var eventData, response;
1934
- return _regenerator.default.wrap(function _callee11$(_context11) {
1935
- while (1) switch (_context11.prev = _context11.next) {
1962
+ return _regenerator.default.wrap(function _callee13$(_context13) {
1963
+ while (1) switch (_context13.prev = _context13.next) {
1936
1964
  case 0:
1937
1965
  _Logger.default.info("".concat(_constants2.METHOD_START_MESSAGE, " with: ").concat(this.getCorrelationId()), {
1938
1966
  file: _constants.CALL_FILE,
@@ -1953,21 +1981,21 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
1953
1981
  /* We need to clear the call at Mobius too. For delete failure
1954
1982
  * error handling is not required
1955
1983
  */
1956
- _context11.prev = 3;
1984
+ _context13.prev = 3;
1957
1985
  this.setDisconnectReason();
1958
- _context11.next = 7;
1986
+ _context13.next = 7;
1959
1987
  return this.delete();
1960
1988
  case 7:
1961
- response = _context11.sent;
1989
+ response = _context13.sent;
1962
1990
  _Logger.default.log("Response code: ".concat(response.statusCode), {
1963
1991
  file: _constants.CALL_FILE,
1964
1992
  method: _constants.METHODS.HANDLE_UNKNOWN_STATE
1965
1993
  });
1966
- _context11.next = 15;
1994
+ _context13.next = 15;
1967
1995
  break;
1968
1996
  case 11:
1969
- _context11.prev = 11;
1970
- _context11.t0 = _context11["catch"](3);
1997
+ _context13.prev = 11;
1998
+ _context13.t0 = _context13["catch"](3);
1971
1999
  _Logger.default.warn('Failed to delete the call', {
1972
2000
  file: _constants.CALL_FILE,
1973
2001
  method: _constants.METHODS.HANDLE_UNKNOWN_STATE
@@ -1997,11 +2025,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
1997
2025
  });
1998
2026
  case 20:
1999
2027
  case "end":
2000
- return _context11.stop();
2028
+ return _context13.stop();
2001
2029
  }
2002
- }, _callee11, this, [[3, 11]]);
2030
+ }, _callee13, this, [[3, 11]]);
2003
2031
  }));
2004
- function handleUnknownState(_x0) {
2032
+ function handleUnknownState(_x1) {
2005
2033
  return _handleUnknownState.apply(this, arguments);
2006
2034
  }
2007
2035
  return handleUnknownState;
@@ -2019,36 +2047,36 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2019
2047
  }, {
2020
2048
  key: "getEmitterCallback",
2021
2049
  value: function getEmitterCallback(errData) {
2022
- var _this8 = this;
2050
+ var _this7 = this;
2023
2051
  return function (error) {
2024
- switch (_this8.callStateMachine.state.value) {
2052
+ switch (_this7.callStateMachine.state.value) {
2025
2053
  case 'S_CALL_HOLD':
2026
- _this8.emit(_types3.CALL_EVENT_KEYS.HOLD_ERROR, error);
2027
- if (_this8.supplementaryServicesTimer) {
2028
- clearTimeout(_this8.supplementaryServicesTimer);
2029
- _this8.supplementaryServicesTimer = undefined;
2054
+ _this7.emit(_types3.CALL_EVENT_KEYS.HOLD_ERROR, error);
2055
+ if (_this7.supplementaryServicesTimer) {
2056
+ clearTimeout(_this7.supplementaryServicesTimer);
2057
+ _this7.supplementaryServicesTimer = undefined;
2030
2058
  }
2031
- _this8.submitCallErrorMetric(error);
2032
- _this8.sendCallStateMachineEvt({
2059
+ _this7.submitCallErrorMetric(error);
2060
+ _this7.sendCallStateMachineEvt({
2033
2061
  type: 'E_CALL_ESTABLISHED',
2034
2062
  data: errData
2035
2063
  });
2036
2064
  return;
2037
2065
  case 'S_CALL_RESUME':
2038
- _this8.emit(_types3.CALL_EVENT_KEYS.RESUME_ERROR, error);
2039
- _this8.submitCallErrorMetric(error);
2040
- _this8.sendCallStateMachineEvt({
2066
+ _this7.emit(_types3.CALL_EVENT_KEYS.RESUME_ERROR, error);
2067
+ _this7.submitCallErrorMetric(error);
2068
+ _this7.sendCallStateMachineEvt({
2041
2069
  type: 'E_CALL_ESTABLISHED',
2042
2070
  data: errData
2043
2071
  });
2044
2072
  return;
2045
2073
  default:
2046
- _this8.emit(_types3.CALL_EVENT_KEYS.CALL_ERROR, error);
2047
- _this8.submitCallErrorMetric(error);
2074
+ _this7.emit(_types3.CALL_EVENT_KEYS.CALL_ERROR, error);
2075
+ _this7.submitCallErrorMetric(error);
2048
2076
  /* Disconnect call if it's not a midcall case */
2049
2077
  /* istanbul ignore else */
2050
- if (!_this8.connected) {
2051
- _this8.sendMediaStateMachineEvt({
2078
+ if (!_this7.connected) {
2079
+ _this7.sendMediaStateMachineEvt({
2052
2080
  type: 'E_ROAP_ERROR',
2053
2081
  data: errData
2054
2082
  });
@@ -2070,27 +2098,27 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2070
2098
  }, {
2071
2099
  key: "handleRoapEstablished",
2072
2100
  value: (function () {
2073
- var _handleRoapEstablished = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12(context, event) {
2074
- var _this9 = this;
2075
- var _ref7, received, message, res, errData;
2076
- return _regenerator.default.wrap(function _callee12$(_context12) {
2077
- while (1) switch (_context12.prev = _context12.next) {
2101
+ var _handleRoapEstablished = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14(context, event) {
2102
+ var _this8 = this;
2103
+ var _ref9, received, message, res, errData;
2104
+ return _regenerator.default.wrap(function _callee14$(_context14) {
2105
+ while (1) switch (_context14.prev = _context14.next) {
2078
2106
  case 0:
2079
2107
  _Logger.default.info("".concat(_constants2.METHOD_START_MESSAGE, " with: ").concat(this.getCorrelationId()), {
2080
2108
  file: _constants.CALL_FILE,
2081
2109
  method: _constants.METHODS.HANDLE_ROAP_ESTABLISHED
2082
2110
  });
2083
- _ref7 = event.data, received = _ref7.received, message = _ref7.message;
2111
+ _ref9 = event.data, received = _ref9.received, message = _ref9.message;
2084
2112
  this.receivedRoapOKSeq = message.seq;
2085
2113
  if (received) {
2086
- _context12.next = 24;
2114
+ _context14.next = 24;
2087
2115
  break;
2088
2116
  }
2089
2117
  _Logger.default.info('Sending Media Ok to the remote End', {
2090
2118
  file: _constants.CALL_FILE,
2091
2119
  method: _constants.METHODS.HANDLE_ROAP_ESTABLISHED
2092
2120
  });
2093
- _context12.prev = 5;
2121
+ _context14.prev = 5;
2094
2122
  if (this.callStateMachine.state.value === 'S_RECV_CALL_PROGRESS' || this.callStateMachine.state.value === 'S_SEND_CALL_SETUP') {
2095
2123
  _Logger.default.info('Media negotiation completed before call connect. Setting media negotiation completed flag.', {
2096
2124
  file: _constants.CALL_FILE,
@@ -2099,10 +2127,10 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2099
2127
  this.mediaNegotiationCompleted = true;
2100
2128
  }
2101
2129
  message.seq = this.seq;
2102
- _context12.next = 10;
2130
+ _context14.next = 10;
2103
2131
  return this.postMedia(message);
2104
2132
  case 10:
2105
- res = _context12.sent;
2133
+ res = _context14.sent;
2106
2134
  _Logger.default.log("Response code: ".concat(res.statusCode), {
2107
2135
  file: _constants.CALL_FILE,
2108
2136
  method: _constants.METHODS.HANDLE_ROAP_ESTABLISHED
@@ -2113,36 +2141,36 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2113
2141
  type: 'E_CALL_ESTABLISHED'
2114
2142
  });
2115
2143
  }
2116
- _context12.next = 22;
2144
+ _context14.next = 22;
2117
2145
  break;
2118
2146
  case 15:
2119
- _context12.prev = 15;
2120
- _context12.t0 = _context12["catch"](5);
2147
+ _context14.prev = 15;
2148
+ _context14.t0 = _context14["catch"](5);
2121
2149
  _Logger.default.warn('Failed to process MediaOk request', {
2122
2150
  file: _constants.CALL_FILE,
2123
2151
  method: _constants.METHODS.HANDLE_ROAP_ESTABLISHED
2124
2152
  });
2125
- errData = _context12.t0;
2153
+ errData = _context14.t0;
2126
2154
  (0, _Utils.handleCallErrors)(this.getEmitterCallback(errData), _types.ERROR_LAYER.MEDIA, function (interval) {
2127
2155
  /* Start retry if only it is a midcall case */
2128
2156
  /* istanbul ignore else */
2129
- if (_this9.connected) {
2157
+ if (_this8.connected) {
2130
2158
  setTimeout(function () {
2131
- _this9.sendMediaStateMachineEvt({
2159
+ _this8.sendMediaStateMachineEvt({
2132
2160
  type: 'E_ROAP_OK',
2133
2161
  data: event.data
2134
2162
  });
2135
2163
  }, interval * 1000);
2136
2164
  }
2137
2165
  }, this.getCorrelationId(), errData, this.handleRoapEstablished.name, _constants.CALL_FILE);
2138
- _context12.next = 22;
2166
+ _context14.next = 22;
2139
2167
  return (0, _Utils.uploadLogs)({
2140
2168
  correlationId: this.correlationId,
2141
2169
  callId: this.callId,
2142
2170
  broadworksCorrelationInfo: this.broadworksCorrelationInfo
2143
2171
  });
2144
2172
  case 22:
2145
- _context12.next = 29;
2173
+ _context14.next = 29;
2146
2174
  break;
2147
2175
  case 24:
2148
2176
  _Logger.default.info('Notifying internal-media-core about ROAP OK message', {
@@ -2176,11 +2204,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2176
2204
  }
2177
2205
  case 29:
2178
2206
  case "end":
2179
- return _context12.stop();
2207
+ return _context14.stop();
2180
2208
  }
2181
- }, _callee12, this, [[5, 15]]);
2209
+ }, _callee14, this, [[5, 15]]);
2182
2210
  }));
2183
- function handleRoapEstablished(_x1, _x10) {
2211
+ function handleRoapEstablished(_x10, _x11) {
2184
2212
  return _handleRoapEstablished.apply(this, arguments);
2185
2213
  }
2186
2214
  return handleRoapEstablished;
@@ -2195,11 +2223,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2195
2223
  }, {
2196
2224
  key: "handleRoapError",
2197
2225
  value: (function () {
2198
- var _handleRoapError = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13(context, event) {
2199
- var _this0 = this;
2226
+ var _handleRoapError = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15(context, event) {
2227
+ var _this9 = this;
2200
2228
  var message, res, errData;
2201
- return _regenerator.default.wrap(function _callee13$(_context13) {
2202
- while (1) switch (_context13.prev = _context13.next) {
2229
+ return _regenerator.default.wrap(function _callee15$(_context15) {
2230
+ while (1) switch (_context15.prev = _context15.next) {
2203
2231
  case 0:
2204
2232
  _Logger.default.info("".concat(_constants2.METHOD_START_MESSAGE, " with: ").concat(this.getCorrelationId()), {
2205
2233
  file: _constants.CALL_FILE,
@@ -2210,38 +2238,38 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2210
2238
  message = event.data;
2211
2239
  /* istanbul ignore else */
2212
2240
  if (!(message && message.messageType === 'ERROR')) {
2213
- _context13.next = 17;
2241
+ _context15.next = 17;
2214
2242
  break;
2215
2243
  }
2216
- _context13.prev = 3;
2217
- _context13.next = 6;
2244
+ _context15.prev = 3;
2245
+ _context15.next = 6;
2218
2246
  return this.postMedia(message);
2219
2247
  case 6:
2220
- res = _context13.sent;
2248
+ res = _context15.sent;
2221
2249
  _Logger.default.info("Response code: ".concat(res.statusCode), {
2222
2250
  file: _constants.CALL_FILE,
2223
2251
  method: _constants.METHODS.HANDLE_ROAP_ERROR
2224
2252
  });
2225
- _context13.next = 17;
2253
+ _context15.next = 17;
2226
2254
  break;
2227
2255
  case 10:
2228
- _context13.prev = 10;
2229
- _context13.t0 = _context13["catch"](3);
2256
+ _context15.prev = 10;
2257
+ _context15.t0 = _context15["catch"](3);
2230
2258
  _Logger.default.warn('Failed to communicate ROAP error to Webex Calling', {
2231
2259
  file: _constants.CALL_FILE,
2232
2260
  method: _constants.METHODS.HANDLE_ROAP_ERROR
2233
2261
  });
2234
- errData = _context13.t0;
2262
+ errData = _context15.t0;
2235
2263
  (0, _Utils.handleCallErrors)(function (error) {
2236
- _this0.emit(_types3.CALL_EVENT_KEYS.CALL_ERROR, error);
2237
- _this0.submitCallErrorMetric(error);
2264
+ _this9.emit(_types3.CALL_EVENT_KEYS.CALL_ERROR, error);
2265
+ _this9.submitCallErrorMetric(error);
2238
2266
  }, _types.ERROR_LAYER.MEDIA,
2239
2267
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
2240
2268
  /* istanbul ignore next */
2241
2269
  function (interval) {
2242
2270
  return undefined;
2243
2271
  }, this.getCorrelationId(), errData, this.handleRoapError.name, _constants.CALL_FILE);
2244
- _context13.next = 17;
2272
+ _context15.next = 17;
2245
2273
  return (0, _Utils.uploadLogs)({
2246
2274
  correlationId: this.correlationId,
2247
2275
  callId: this.callId,
@@ -2264,11 +2292,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2264
2292
  }
2265
2293
  case 18:
2266
2294
  case "end":
2267
- return _context13.stop();
2295
+ return _context15.stop();
2268
2296
  }
2269
- }, _callee13, this, [[3, 10]]);
2297
+ }, _callee15, this, [[3, 10]]);
2270
2298
  }));
2271
- function handleRoapError(_x11, _x12) {
2299
+ function handleRoapError(_x12, _x13) {
2272
2300
  return _handleRoapError.apply(this, arguments);
2273
2301
  }
2274
2302
  return handleRoapError;
@@ -2283,11 +2311,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2283
2311
  }, {
2284
2312
  key: "handleOutgoingRoapOffer",
2285
2313
  value: (function () {
2286
- var _handleOutgoingRoapOffer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14(context, event) {
2287
- var _this1 = this;
2314
+ var _handleOutgoingRoapOffer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16(context, event) {
2315
+ var _this0 = this;
2288
2316
  var message, res, errData;
2289
- return _regenerator.default.wrap(function _callee14$(_context14) {
2290
- while (1) switch (_context14.prev = _context14.next) {
2317
+ return _regenerator.default.wrap(function _callee16$(_context16) {
2318
+ while (1) switch (_context16.prev = _context16.next) {
2291
2319
  case 0:
2292
2320
  _Logger.default.info("".concat(_constants2.METHOD_START_MESSAGE, " with: ").concat(this.getCorrelationId()), {
2293
2321
  file: _constants.CALL_FILE,
@@ -2295,7 +2323,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2295
2323
  });
2296
2324
  message = event.data;
2297
2325
  if (message !== null && message !== void 0 && message.sdp) {
2298
- _context14.next = 6;
2326
+ _context16.next = 6;
2299
2327
  break;
2300
2328
  }
2301
2329
  _Logger.default.info('Initializing Offer...', {
@@ -2303,39 +2331,39 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2303
2331
  method: _constants.METHODS.HANDLE_OUTGOING_ROAP_OFFER
2304
2332
  });
2305
2333
  this.mediaConnection.initiateOffer();
2306
- return _context14.abrupt("return");
2334
+ return _context16.abrupt("return");
2307
2335
  case 6:
2308
- _context14.prev = 6;
2309
- _context14.next = 9;
2336
+ _context16.prev = 6;
2337
+ _context16.next = 9;
2310
2338
  return this.postMedia(message);
2311
2339
  case 9:
2312
- res = _context14.sent;
2340
+ res = _context16.sent;
2313
2341
  _Logger.default.log("Response code: ".concat(res.statusCode), {
2314
2342
  file: _constants.CALL_FILE,
2315
2343
  method: _constants.METHODS.HANDLE_OUTGOING_ROAP_OFFER
2316
2344
  });
2317
- _context14.next = 20;
2345
+ _context16.next = 20;
2318
2346
  break;
2319
2347
  case 13:
2320
- _context14.prev = 13;
2321
- _context14.t0 = _context14["catch"](6);
2348
+ _context16.prev = 13;
2349
+ _context16.t0 = _context16["catch"](6);
2322
2350
  _Logger.default.warn('Failed to process MediaOk request', {
2323
2351
  file: _constants.CALL_FILE,
2324
2352
  method: _constants.METHODS.HANDLE_OUTGOING_ROAP_OFFER
2325
2353
  });
2326
- errData = _context14.t0;
2354
+ errData = _context16.t0;
2327
2355
  (0, _Utils.handleCallErrors)(this.getEmitterCallback(errData), _types.ERROR_LAYER.MEDIA, function (interval) {
2328
2356
  /* Start retry if only it is a midcall case */
2329
- if (_this1.connected) {
2357
+ if (_this0.connected) {
2330
2358
  setTimeout(function () {
2331
- _this1.sendMediaStateMachineEvt({
2359
+ _this0.sendMediaStateMachineEvt({
2332
2360
  type: 'E_SEND_ROAP_OFFER',
2333
2361
  data: event.data
2334
2362
  });
2335
2363
  }, interval * 1000);
2336
2364
  }
2337
2365
  }, this.getCorrelationId(), errData, _constants.METHODS.HANDLE_OUTGOING_ROAP_OFFER, _constants.CALL_FILE);
2338
- _context14.next = 20;
2366
+ _context16.next = 20;
2339
2367
  return (0, _Utils.uploadLogs)({
2340
2368
  correlationId: this.correlationId,
2341
2369
  callId: this.callId,
@@ -2343,11 +2371,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2343
2371
  });
2344
2372
  case 20:
2345
2373
  case "end":
2346
- return _context14.stop();
2374
+ return _context16.stop();
2347
2375
  }
2348
- }, _callee14, this, [[6, 13]]);
2376
+ }, _callee16, this, [[6, 13]]);
2349
2377
  }));
2350
- function handleOutgoingRoapOffer(_x13, _x14) {
2378
+ function handleOutgoingRoapOffer(_x14, _x15) {
2351
2379
  return _handleOutgoingRoapOffer.apply(this, arguments);
2352
2380
  }
2353
2381
  return handleOutgoingRoapOffer;
@@ -2362,49 +2390,49 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2362
2390
  }, {
2363
2391
  key: "handleOutgoingRoapAnswer",
2364
2392
  value: (function () {
2365
- var _handleOutgoingRoapAnswer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15(context, event) {
2366
- var _this10 = this;
2393
+ var _handleOutgoingRoapAnswer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17(context, event) {
2394
+ var _this1 = this;
2367
2395
  var message, res, errData;
2368
- return _regenerator.default.wrap(function _callee15$(_context15) {
2369
- while (1) switch (_context15.prev = _context15.next) {
2396
+ return _regenerator.default.wrap(function _callee17$(_context17) {
2397
+ while (1) switch (_context17.prev = _context17.next) {
2370
2398
  case 0:
2371
2399
  _Logger.default.info("".concat(_constants2.METHOD_START_MESSAGE, " with: ").concat(this.getCorrelationId()), {
2372
2400
  file: _constants.CALL_FILE,
2373
2401
  method: _constants.METHODS.HANDLE_OUTGOING_ROAP_ANSWER
2374
2402
  });
2375
2403
  message = event.data;
2376
- _context15.prev = 2;
2404
+ _context17.prev = 2;
2377
2405
  message.seq = this.seq;
2378
- _context15.next = 6;
2406
+ _context17.next = 6;
2379
2407
  return this.postMedia(message);
2380
2408
  case 6:
2381
- res = _context15.sent;
2409
+ res = _context17.sent;
2382
2410
  _Logger.default.log("Response code: ".concat(res.statusCode), {
2383
2411
  file: _constants.CALL_FILE,
2384
2412
  method: _constants.METHODS.HANDLE_OUTGOING_ROAP_ANSWER
2385
2413
  });
2386
- _context15.next = 17;
2414
+ _context17.next = 17;
2387
2415
  break;
2388
2416
  case 10:
2389
- _context15.prev = 10;
2390
- _context15.t0 = _context15["catch"](2);
2417
+ _context17.prev = 10;
2418
+ _context17.t0 = _context17["catch"](2);
2391
2419
  _Logger.default.warn('Failed to send MediaAnswer request', {
2392
2420
  file: _constants.CALL_FILE,
2393
2421
  method: _constants.METHODS.HANDLE_OUTGOING_ROAP_ANSWER
2394
2422
  });
2395
- errData = _context15.t0;
2423
+ errData = _context17.t0;
2396
2424
  (0, _Utils.handleCallErrors)(this.getEmitterCallback(errData), _types.ERROR_LAYER.MEDIA, function (interval) {
2397
2425
  /* Start retry if only it is a midcall case */
2398
- if (_this10.connected) {
2426
+ if (_this1.connected) {
2399
2427
  setTimeout(function () {
2400
- _this10.sendMediaStateMachineEvt({
2428
+ _this1.sendMediaStateMachineEvt({
2401
2429
  type: 'E_SEND_ROAP_ANSWER',
2402
2430
  data: event.data
2403
2431
  });
2404
2432
  }, interval * 1000);
2405
2433
  }
2406
2434
  }, this.getCorrelationId(), errData, _constants.METHODS.HANDLE_OUTGOING_ROAP_ANSWER, _constants.CALL_FILE);
2407
- _context15.next = 17;
2435
+ _context17.next = 17;
2408
2436
  return (0, _Utils.uploadLogs)({
2409
2437
  correlationId: this.correlationId,
2410
2438
  callId: this.callId,
@@ -2412,11 +2440,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2412
2440
  });
2413
2441
  case 17:
2414
2442
  case "end":
2415
- return _context15.stop();
2443
+ return _context17.stop();
2416
2444
  }
2417
- }, _callee15, this, [[2, 10]]);
2445
+ }, _callee17, this, [[2, 10]]);
2418
2446
  }));
2419
- function handleOutgoingRoapAnswer(_x15, _x16) {
2447
+ function handleOutgoingRoapAnswer(_x16, _x17) {
2420
2448
  return _handleOutgoingRoapAnswer.apply(this, arguments);
2421
2449
  }
2422
2450
  return handleOutgoingRoapAnswer;
@@ -2498,7 +2526,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2498
2526
  * @param settings.debugId - String.
2499
2527
  */
2500
2528
  function initMediaConnection(localAudioTrack, debugId) {
2501
- var _this11 = this;
2529
+ var _this10 = this;
2502
2530
  var mediaConnection = new _internalMediaCore.RoapMediaConnection({
2503
2531
  skipInactiveTransceivers: true,
2504
2532
  iceServers: [],
@@ -2518,11 +2546,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2518
2546
  screenShareVideo: 'inactive'
2519
2547
  }
2520
2548
  }, debugId || "WebexCallSDK-".concat(this.correlationId), function (data) {
2521
- return _this11.rtcMetrics.addMetrics(data);
2549
+ return _this10.rtcMetrics.addMetrics(data);
2522
2550
  }, function () {
2523
- return _this11.rtcMetrics.closeMetrics();
2551
+ return _this10.rtcMetrics.closeMetrics();
2524
2552
  }, function () {
2525
- return _this11.rtcMetrics.sendMetricsInQueue();
2553
+ return _this10.rtcMetrics.sendMetricsInQueue();
2526
2554
  });
2527
2555
  this.mediaConnection = mediaConnection;
2528
2556
  }
@@ -2576,10 +2604,10 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2576
2604
  * @param localAudioStream - The local audio stream for the call.
2577
2605
  */
2578
2606
  function () {
2579
- var _answer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16(localAudioStream) {
2607
+ var _answer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18(localAudioStream) {
2580
2608
  var localAudioTrack;
2581
- return _regenerator.default.wrap(function _callee16$(_context16) {
2582
- while (1) switch (_context16.prev = _context16.next) {
2609
+ return _regenerator.default.wrap(function _callee18$(_context18) {
2610
+ while (1) switch (_context18.prev = _context18.next) {
2583
2611
  case 0:
2584
2612
  _Logger.default.info("".concat(_constants2.METHOD_START_MESSAGE, " with stream"), {
2585
2613
  file: _constants.CALL_FILE,
@@ -2588,7 +2616,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2588
2616
  this.localAudioStream = localAudioStream;
2589
2617
  localAudioTrack = localAudioStream.outputStream.getAudioTracks()[0];
2590
2618
  if (localAudioTrack) {
2591
- _context16.next = 8;
2619
+ _context18.next = 8;
2592
2620
  break;
2593
2621
  }
2594
2622
  _Logger.default.warn("Did not find a local track while answering the call ".concat(this.getCorrelationId()), {
@@ -2599,7 +2627,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2599
2627
  this.sendCallStateMachineEvt({
2600
2628
  type: 'E_SEND_CALL_DISCONNECT'
2601
2629
  });
2602
- return _context16.abrupt("return");
2630
+ return _context18.abrupt("return");
2603
2631
  case 8:
2604
2632
  localAudioTrack.enabled = true;
2605
2633
  if (!this.mediaConnection) {
@@ -2620,11 +2648,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2620
2648
  }
2621
2649
  case 11:
2622
2650
  case "end":
2623
- return _context16.stop();
2651
+ return _context18.stop();
2624
2652
  }
2625
- }, _callee16, this);
2653
+ }, _callee18, this);
2626
2654
  }));
2627
- function answer(_x17) {
2655
+ function answer(_x18) {
2628
2656
  return _answer.apply(this, arguments);
2629
2657
  }
2630
2658
  return answer;
@@ -2637,10 +2665,10 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2637
2665
  }, {
2638
2666
  key: "dial",
2639
2667
  value: (function () {
2640
- var _dial = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17(localAudioStream) {
2668
+ var _dial = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19(localAudioStream) {
2641
2669
  var localAudioTrack;
2642
- return _regenerator.default.wrap(function _callee17$(_context17) {
2643
- while (1) switch (_context17.prev = _context17.next) {
2670
+ return _regenerator.default.wrap(function _callee19$(_context19) {
2671
+ while (1) switch (_context19.prev = _context19.next) {
2644
2672
  case 0:
2645
2673
  _Logger.default.info("".concat(_constants2.METHOD_START_MESSAGE, " with stream"), {
2646
2674
  file: _constants.CALL_FILE,
@@ -2649,7 +2677,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2649
2677
  this.localAudioStream = localAudioStream;
2650
2678
  localAudioTrack = localAudioStream.outputStream.getAudioTracks()[0];
2651
2679
  if (localAudioTrack) {
2652
- _context17.next = 8;
2680
+ _context19.next = 8;
2653
2681
  break;
2654
2682
  }
2655
2683
  _Logger.default.warn("Did not find a local track while dialing the call ".concat(this.getCorrelationId()), {
@@ -2658,7 +2686,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2658
2686
  });
2659
2687
  this.deleteCb(this.getCorrelationId());
2660
2688
  this.emit(_types3.CALL_EVENT_KEYS.DISCONNECT, this.getCorrelationId());
2661
- return _context17.abrupt("return");
2689
+ return _context19.abrupt("return");
2662
2690
  case 8:
2663
2691
  localAudioTrack.enabled = true;
2664
2692
  if (!this.mediaConnection) {
@@ -2679,11 +2707,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2679
2707
  }
2680
2708
  case 11:
2681
2709
  case "end":
2682
- return _context17.stop();
2710
+ return _context19.stop();
2683
2711
  }
2684
- }, _callee17, this);
2712
+ }, _callee19, this);
2685
2713
  }));
2686
- function dial(_x18) {
2714
+ function dial(_x19) {
2687
2715
  return _dial.apply(this, arguments);
2688
2716
  }
2689
2717
  return dial;
@@ -2697,15 +2725,15 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2697
2725
  * @param state -.
2698
2726
  */
2699
2727
  function () {
2700
- var _patch = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18(state) {
2701
- return _regenerator.default.wrap(function _callee18$(_context18) {
2702
- while (1) switch (_context18.prev = _context18.next) {
2728
+ var _patch = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20(state) {
2729
+ return _regenerator.default.wrap(function _callee20$(_context20) {
2730
+ while (1) switch (_context20.prev = _context20.next) {
2703
2731
  case 0:
2704
2732
  _Logger.default.info("Send a PATCH for ".concat(state, " to Webex Calling"), {
2705
2733
  file: _constants.CALL_FILE,
2706
2734
  method: 'patch'
2707
2735
  });
2708
- return _context18.abrupt("return", this.webex.request({
2736
+ return _context20.abrupt("return", this.webex.request({
2709
2737
  // Sample uri: http://localhost/api/v1/calling/web/devices/{deviceid}/calls/{callid}
2710
2738
 
2711
2739
  uri: "".concat(this.mobiusUrl).concat(_constants.DEVICES_ENDPOINT_RESOURCE, "/").concat(this.deviceId, "/").concat(_constants.CALLS_ENDPOINT_RESOURCE, "/").concat(this.callId),
@@ -2724,11 +2752,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2724
2752
  }));
2725
2753
  case 2:
2726
2754
  case "end":
2727
- return _context18.stop();
2755
+ return _context20.stop();
2728
2756
  }
2729
- }, _callee18, this);
2757
+ }, _callee20, this);
2730
2758
  }));
2731
- function patch(_x19) {
2759
+ function patch(_x20) {
2732
2760
  return _patch.apply(this, arguments);
2733
2761
  }
2734
2762
  return patch;
@@ -2743,10 +2771,10 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2743
2771
  }, {
2744
2772
  key: "postSSRequest",
2745
2773
  value: (function () {
2746
- var _postSSRequest = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19(context, type) {
2774
+ var _postSSRequest = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21(context, type) {
2747
2775
  var request, transferContext;
2748
- return _regenerator.default.wrap(function _callee19$(_context19) {
2749
- while (1) switch (_context19.prev = _context19.next) {
2776
+ return _regenerator.default.wrap(function _callee21$(_context21) {
2777
+ while (1) switch (_context21.prev = _context21.next) {
2750
2778
  case 0:
2751
2779
  request = {
2752
2780
  uri: "".concat(this.mobiusUrl).concat(_constants2.SERVICES_ENDPOINT),
@@ -2761,15 +2789,15 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2761
2789
  callId: this.callId
2762
2790
  }
2763
2791
  };
2764
- _context19.t0 = type;
2765
- _context19.next = _context19.t0 === _types3.SUPPLEMENTARY_SERVICES.HOLD ? 4 : _context19.t0 === _types3.SUPPLEMENTARY_SERVICES.RESUME ? 6 : _context19.t0 === _types3.SUPPLEMENTARY_SERVICES.TRANSFER ? 8 : 12;
2792
+ _context21.t0 = type;
2793
+ _context21.next = _context21.t0 === _types3.SUPPLEMENTARY_SERVICES.HOLD ? 4 : _context21.t0 === _types3.SUPPLEMENTARY_SERVICES.RESUME ? 6 : _context21.t0 === _types3.SUPPLEMENTARY_SERVICES.TRANSFER ? 8 : 12;
2766
2794
  break;
2767
2795
  case 4:
2768
2796
  request.uri = "".concat(request.uri, "/").concat(_constants.CALL_HOLD_SERVICE, "/").concat(_constants.HOLD_ENDPOINT);
2769
- return _context19.abrupt("break", 13);
2797
+ return _context21.abrupt("break", 13);
2770
2798
  case 6:
2771
2799
  request.uri = "".concat(request.uri, "/").concat(_constants.CALL_HOLD_SERVICE, "/").concat(_constants.RESUME_ENDPOINT);
2772
- return _context19.abrupt("break", 13);
2800
+ return _context21.abrupt("break", 13);
2773
2801
  case 8:
2774
2802
  request.uri = "".concat(request.uri, "/").concat(_constants.CALL_TRANSFER_SERVICE, "/").concat(_constants.TRANSFER_ENDPOINT);
2775
2803
  transferContext = context;
@@ -2788,21 +2816,21 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2788
2816
  transferType: _types4.TransferType.CONSULT
2789
2817
  });
2790
2818
  }
2791
- return _context19.abrupt("break", 13);
2819
+ return _context21.abrupt("break", 13);
2792
2820
  case 12:
2793
2821
  _Logger.default.warn("Unknown type for PUT request: ".concat(type), {
2794
2822
  file: _constants.CALL_FILE,
2795
2823
  method: _constants.METHODS.POST_SS_REQUEST
2796
2824
  });
2797
2825
  case 13:
2798
- return _context19.abrupt("return", this.webex.request(request));
2826
+ return _context21.abrupt("return", this.webex.request(request));
2799
2827
  case 14:
2800
2828
  case "end":
2801
- return _context19.stop();
2829
+ return _context21.stop();
2802
2830
  }
2803
- }, _callee19, this);
2831
+ }, _callee21, this);
2804
2832
  }));
2805
- function postSSRequest(_x20, _x21) {
2833
+ function postSSRequest(_x21, _x22) {
2806
2834
  return _postSSRequest.apply(this, arguments);
2807
2835
  }
2808
2836
  return postSSRequest;
@@ -2814,11 +2842,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2814
2842
  }, {
2815
2843
  key: "postStatus",
2816
2844
  value: (function () {
2817
- var _postStatus = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
2818
- return _regenerator.default.wrap(function _callee20$(_context20) {
2819
- while (1) switch (_context20.prev = _context20.next) {
2845
+ var _postStatus = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
2846
+ return _regenerator.default.wrap(function _callee22$(_context22) {
2847
+ while (1) switch (_context22.prev = _context22.next) {
2820
2848
  case 0:
2821
- return _context20.abrupt("return", this.webex.request({
2849
+ return _context22.abrupt("return", this.webex.request({
2822
2850
  uri: "".concat(this.mobiusUrl).concat(_constants.DEVICES_ENDPOINT_RESOURCE, "/").concat(this.deviceId, "/").concat(_constants.CALLS_ENDPOINT_RESOURCE, "/").concat(this.callId, "/").concat(_constants.CALL_STATUS_RESOURCE),
2823
2851
  method: _types2.HTTP_METHODS.POST,
2824
2852
  service: _types2.ALLOWED_SERVICES.MOBIUS,
@@ -2833,9 +2861,9 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2833
2861
  }));
2834
2862
  case 1:
2835
2863
  case "end":
2836
- return _context20.stop();
2864
+ return _context22.stop();
2837
2865
  }
2838
- }, _callee20, this);
2866
+ }, _callee22, this);
2839
2867
  }));
2840
2868
  function postStatus() {
2841
2869
  return _postStatus.apply(this, arguments);
@@ -2854,14 +2882,14 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2854
2882
  }, {
2855
2883
  key: "completeTransfer",
2856
2884
  value: (function () {
2857
- var _completeTransfer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21(transferType, transferCallId, transferTarget) {
2858
- var _this12 = this;
2859
- var context, errData, _context21, _errData;
2860
- return _regenerator.default.wrap(function _callee21$(_context22) {
2861
- while (1) switch (_context22.prev = _context22.next) {
2885
+ var _completeTransfer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23(transferType, transferCallId, transferTarget) {
2886
+ var _this11 = this;
2887
+ var context, errData, _context23, _errData;
2888
+ return _regenerator.default.wrap(function _callee23$(_context24) {
2889
+ while (1) switch (_context24.prev = _context24.next) {
2862
2890
  case 0:
2863
2891
  if (!(transferType === _types4.TransferType.BLIND && transferTarget)) {
2864
- _context22.next = 19;
2892
+ _context24.next = 19;
2865
2893
  break;
2866
2894
  }
2867
2895
  /* blind transfer */
@@ -2874,8 +2902,8 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2874
2902
  transferorCallId: this.getCallId(),
2875
2903
  destination: transferTarget
2876
2904
  };
2877
- _context22.prev = 3;
2878
- _context22.next = 6;
2905
+ _context24.prev = 3;
2906
+ _context24.next = 6;
2879
2907
  return this.postSSRequest(context, _types3.SUPPLEMENTARY_SERVICES.TRANSFER);
2880
2908
  case 6:
2881
2909
  _Logger.default.info("Blind Transfer completed for correlationId ".concat(this.getCorrelationId()), {
@@ -2883,37 +2911,37 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2883
2911
  method: _constants.METHODS.COMPLETE_TRANSFER
2884
2912
  });
2885
2913
  this.metricManager.submitCallMetric(_types5.METRIC_EVENT.CALL, _types5.TRANSFER_ACTION.BLIND, _types5.METRIC_TYPE.BEHAVIORAL, this.getCallId(), this.getCorrelationId(), undefined);
2886
- _context22.next = 17;
2914
+ _context24.next = 17;
2887
2915
  break;
2888
2916
  case 10:
2889
- _context22.prev = 10;
2890
- _context22.t0 = _context22["catch"](3);
2917
+ _context24.prev = 10;
2918
+ _context24.t0 = _context24["catch"](3);
2891
2919
  _Logger.default.warn("Blind Transfer failed for correlationId ".concat(this.getCorrelationId()), {
2892
2920
  file: _constants.CALL_FILE,
2893
2921
  method: _constants.METHODS.COMPLETE_TRANSFER
2894
2922
  });
2895
- errData = _context22.t0;
2923
+ errData = _context24.t0;
2896
2924
  (0, _Utils.handleCallErrors)(function (error) {
2897
- _this12.emit(_types3.CALL_EVENT_KEYS.TRANSFER_ERROR, error);
2898
- _this12.submitCallErrorMetric(error, _types5.TRANSFER_ACTION.BLIND);
2925
+ _this11.emit(_types3.CALL_EVENT_KEYS.TRANSFER_ERROR, error);
2926
+ _this11.submitCallErrorMetric(error, _types5.TRANSFER_ACTION.BLIND);
2899
2927
  }, _types.ERROR_LAYER.CALL_CONTROL,
2900
2928
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
2901
2929
  /* istanbul ignore next */
2902
2930
  function (interval) {
2903
2931
  return undefined;
2904
2932
  }, this.getCorrelationId(), errData, _constants.METHODS.COMPLETE_TRANSFER, _constants.CALL_FILE);
2905
- _context22.next = 17;
2933
+ _context24.next = 17;
2906
2934
  return (0, _Utils.uploadLogs)({
2907
2935
  correlationId: this.correlationId,
2908
2936
  callId: this.callId,
2909
2937
  broadworksCorrelationInfo: this.broadworksCorrelationInfo
2910
2938
  });
2911
2939
  case 17:
2912
- _context22.next = 39;
2940
+ _context24.next = 39;
2913
2941
  break;
2914
2942
  case 19:
2915
2943
  if (!(transferType === _types4.TransferType.CONSULT && transferCallId)) {
2916
- _context22.next = 38;
2944
+ _context24.next = 38;
2917
2945
  break;
2918
2946
  }
2919
2947
  /* Consult transfer */
@@ -2922,46 +2950,46 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2922
2950
  file: _constants.CALL_FILE,
2923
2951
  method: _constants.METHODS.COMPLETE_TRANSFER
2924
2952
  });
2925
- _context21 = {
2953
+ _context23 = {
2926
2954
  transferorCallId: this.getCallId(),
2927
2955
  transferToCallId: transferCallId
2928
2956
  };
2929
- _context22.prev = 22;
2930
- _context22.next = 25;
2931
- return this.postSSRequest(_context21, _types3.SUPPLEMENTARY_SERVICES.TRANSFER);
2957
+ _context24.prev = 22;
2958
+ _context24.next = 25;
2959
+ return this.postSSRequest(_context23, _types3.SUPPLEMENTARY_SERVICES.TRANSFER);
2932
2960
  case 25:
2933
2961
  _Logger.default.info("Consult Transfer completed for correlationId ".concat(this.getCorrelationId()), {
2934
2962
  file: _constants.CALL_FILE,
2935
2963
  method: _constants.METHODS.COMPLETE_TRANSFER
2936
2964
  });
2937
2965
  this.metricManager.submitCallMetric(_types5.METRIC_EVENT.CALL, _types5.TRANSFER_ACTION.CONSULT, _types5.METRIC_TYPE.BEHAVIORAL, this.getCallId(), this.getCorrelationId(), undefined);
2938
- _context22.next = 36;
2966
+ _context24.next = 36;
2939
2967
  break;
2940
2968
  case 29:
2941
- _context22.prev = 29;
2942
- _context22.t1 = _context22["catch"](22);
2969
+ _context24.prev = 29;
2970
+ _context24.t1 = _context24["catch"](22);
2943
2971
  _Logger.default.warn("Consult Transfer failed for correlationId ".concat(this.getCorrelationId()), {
2944
2972
  file: _constants.CALL_FILE,
2945
2973
  method: _constants.METHODS.COMPLETE_TRANSFER
2946
2974
  });
2947
- _errData = _context22.t1;
2975
+ _errData = _context24.t1;
2948
2976
  (0, _Utils.handleCallErrors)(function (error) {
2949
- _this12.emit(_types3.CALL_EVENT_KEYS.TRANSFER_ERROR, error);
2950
- _this12.submitCallErrorMetric(error, _types5.TRANSFER_ACTION.CONSULT);
2977
+ _this11.emit(_types3.CALL_EVENT_KEYS.TRANSFER_ERROR, error);
2978
+ _this11.submitCallErrorMetric(error, _types5.TRANSFER_ACTION.CONSULT);
2951
2979
  }, _types.ERROR_LAYER.CALL_CONTROL,
2952
2980
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
2953
2981
  /* istanbul ignore next */
2954
2982
  function (interval) {
2955
2983
  return undefined;
2956
2984
  }, this.getCorrelationId(), _errData, _constants.METHODS.COMPLETE_TRANSFER, _constants.CALL_FILE);
2957
- _context22.next = 36;
2985
+ _context24.next = 36;
2958
2986
  return (0, _Utils.uploadLogs)({
2959
2987
  correlationId: this.correlationId,
2960
2988
  callId: this.callId,
2961
2989
  broadworksCorrelationInfo: this.broadworksCorrelationInfo
2962
2990
  });
2963
2991
  case 36:
2964
- _context22.next = 39;
2992
+ _context24.next = 39;
2965
2993
  break;
2966
2994
  case 38:
2967
2995
  _Logger.default.warn("Invalid information received, transfer failed for correlationId: ".concat(this.getCorrelationId()), {
@@ -2970,11 +2998,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2970
2998
  });
2971
2999
  case 39:
2972
3000
  case "end":
2973
- return _context22.stop();
3001
+ return _context24.stop();
2974
3002
  }
2975
- }, _callee21, this, [[3, 10], [22, 29]]);
3003
+ }, _callee23, this, [[3, 10], [22, 29]]);
2976
3004
  }));
2977
- function completeTransfer(_x22, _x23, _x24) {
3005
+ function completeTransfer(_x23, _x24, _x25) {
2978
3006
  return _completeTransfer.apply(this, arguments);
2979
3007
  }
2980
3008
  return completeTransfer;
@@ -2986,32 +3014,32 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
2986
3014
  }, {
2987
3015
  key: "getCallStats",
2988
3016
  value: (function () {
2989
- var _getCallStats = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
3017
+ var _getCallStats = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24() {
2990
3018
  var stats;
2991
- return _regenerator.default.wrap(function _callee22$(_context23) {
2992
- while (1) switch (_context23.prev = _context23.next) {
3019
+ return _regenerator.default.wrap(function _callee24$(_context25) {
3020
+ while (1) switch (_context25.prev = _context25.next) {
2993
3021
  case 0:
2994
- _context23.prev = 0;
2995
- _context23.next = 3;
3022
+ _context25.prev = 0;
3023
+ _context25.next = 3;
2996
3024
  return this.mediaConnection.getStats();
2997
3025
  case 3:
2998
- stats = _context23.sent;
2999
- _context23.next = 9;
3026
+ stats = _context25.sent;
3027
+ _context25.next = 9;
3000
3028
  break;
3001
3029
  case 6:
3002
- _context23.prev = 6;
3003
- _context23.t0 = _context23["catch"](0);
3030
+ _context25.prev = 6;
3031
+ _context25.t0 = _context25["catch"](0);
3004
3032
  _Logger.default.warn('Stats collection failed, using dummy stats', {
3005
3033
  file: _constants.CALL_FILE,
3006
3034
  method: _constants.METHODS.GET_CALL_STATS
3007
3035
  });
3008
3036
  case 9:
3009
- return _context23.abrupt("return", (0, _Utils.parseMediaQualityStatistics)(stats));
3037
+ return _context25.abrupt("return", (0, _Utils.parseMediaQualityStatistics)(stats));
3010
3038
  case 10:
3011
3039
  case "end":
3012
- return _context23.stop();
3040
+ return _context25.stop();
3013
3041
  }
3014
- }, _callee22, this, [[0, 6]]);
3042
+ }, _callee24, this, [[0, 6]]);
3015
3043
  }));
3016
3044
  function getCallStats() {
3017
3045
  return _getCallStats.apply(this, arguments);
@@ -3027,15 +3055,15 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
3027
3055
  }, {
3028
3056
  key: "postMedia",
3029
3057
  value: (function () {
3030
- var _postMedia = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23(roapMessage) {
3031
- return _regenerator.default.wrap(function _callee23$(_context24) {
3032
- while (1) switch (_context24.prev = _context24.next) {
3058
+ var _postMedia = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25(roapMessage) {
3059
+ return _regenerator.default.wrap(function _callee25$(_context26) {
3060
+ while (1) switch (_context26.prev = _context26.next) {
3033
3061
  case 0:
3034
3062
  _Logger.default.log('Posting message to Webex Calling', {
3035
3063
  file: _constants.CALL_FILE,
3036
3064
  method: _constants.METHODS.POST_MEDIA
3037
3065
  });
3038
- return _context24.abrupt("return", this.webex.request({
3066
+ return _context26.abrupt("return", this.webex.request({
3039
3067
  uri: "".concat(this.mobiusUrl).concat(_constants.DEVICES_ENDPOINT_RESOURCE, "/").concat(this.deviceId, "/").concat(_constants.CALLS_ENDPOINT_RESOURCE, "/").concat(this.callId, "/").concat(_constants.MEDIA_ENDPOINT_RESOURCE),
3040
3068
  method: _types2.HTTP_METHODS.POST,
3041
3069
  service: _types2.ALLOWED_SERVICES.MOBIUS,
@@ -3054,11 +3082,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
3054
3082
  }));
3055
3083
  case 2:
3056
3084
  case "end":
3057
- return _context24.stop();
3085
+ return _context26.stop();
3058
3086
  }
3059
- }, _callee23, this);
3087
+ }, _callee25, this);
3060
3088
  }));
3061
- function postMedia(_x25) {
3089
+ function postMedia(_x26) {
3062
3090
  return _postMedia.apply(this, arguments);
3063
3091
  }
3064
3092
  return postMedia;
@@ -3071,16 +3099,16 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
3071
3099
  }, {
3072
3100
  key: "mediaRoapEventsListener",
3073
3101
  value: function mediaRoapEventsListener() {
3074
- var _this13 = this;
3102
+ var _this12 = this;
3075
3103
  this.mediaConnection.on(_internalMediaCore.MediaConnectionEventNames.ROAP_MESSAGE_TO_SEND,
3076
3104
  /*#__PURE__*/
3077
3105
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3078
3106
  function () {
3079
- var _ref8 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24(event) {
3107
+ var _ref0 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26(event) {
3080
3108
  var _event$roapMessage, _event$roapMessage2;
3081
3109
  var mediaOk, sdpVideoPortZero;
3082
- return _regenerator.default.wrap(function _callee24$(_context25) {
3083
- while (1) switch (_context25.prev = _context25.next) {
3110
+ return _regenerator.default.wrap(function _callee26$(_context27) {
3111
+ while (1) switch (_context27.prev = _context27.next) {
3084
3112
  case 0:
3085
3113
  _Logger.default.info("ROAP message to send (rcv from MEDIA-SDK) :\n \n type: ".concat((_event$roapMessage = event.roapMessage) === null || _event$roapMessage === void 0 ? void 0 : _event$roapMessage.messageType, ", seq: ").concat(event.roapMessage.seq, " , version: ").concat(event.roapMessage.version), {
3086
3114
  file: _constants.CALL_FILE,
@@ -3090,19 +3118,19 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
3090
3118
  file: _constants.CALL_FILE,
3091
3119
  method: _constants.METHODS.MEDIA_ROAP_EVENTS_LISTENER
3092
3120
  });
3093
- _context25.t0 = event.roapMessage.messageType;
3094
- _context25.next = _context25.t0 === _types4.RoapScenario.OK ? 5 : _context25.t0 === _types4.RoapScenario.OFFER ? 8 : _context25.t0 === _types4.RoapScenario.ANSWER ? 16 : _context25.t0 === _types4.RoapScenario.ERROR ? 20 : _context25.t0 === _types4.RoapScenario.OFFER_RESPONSE ? 22 : 26;
3121
+ _context27.t0 = event.roapMessage.messageType;
3122
+ _context27.next = _context27.t0 === _types4.RoapScenario.OK ? 5 : _context27.t0 === _types4.RoapScenario.OFFER ? 8 : _context27.t0 === _types4.RoapScenario.ANSWER ? 16 : _context27.t0 === _types4.RoapScenario.ERROR ? 20 : _context27.t0 === _types4.RoapScenario.OFFER_RESPONSE ? 22 : 26;
3095
3123
  break;
3096
3124
  case 5:
3097
3125
  mediaOk = {
3098
3126
  received: false,
3099
3127
  message: event.roapMessage
3100
3128
  };
3101
- _this13.sendMediaStateMachineEvt({
3129
+ _this12.sendMediaStateMachineEvt({
3102
3130
  type: 'E_ROAP_OK',
3103
3131
  data: mediaOk
3104
3132
  });
3105
- return _context25.abrupt("break", 26);
3133
+ return _context27.abrupt("break", 26);
3106
3134
  case 8:
3107
3135
  // TODO: Remove these after the Media-Core adds the fix
3108
3136
  // Check if at least one IPv6 "c=" line is present
@@ -3117,42 +3145,42 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
3117
3145
  method: _constants.METHODS.MEDIA_ROAP_EVENTS_LISTENER
3118
3146
  });
3119
3147
  event.roapMessage.sdp = sdpVideoPortZero;
3120
- _this13.localRoapMessage = event.roapMessage;
3121
- _this13.sendCallStateMachineEvt({
3148
+ _this12.localRoapMessage = event.roapMessage;
3149
+ _this12.sendCallStateMachineEvt({
3122
3150
  type: 'E_SEND_CALL_SETUP',
3123
3151
  data: event.roapMessage
3124
3152
  });
3125
- return _context25.abrupt("break", 26);
3153
+ return _context27.abrupt("break", 26);
3126
3154
  case 16:
3127
3155
  event.roapMessage.sdp = (0, _Utils.modifySdpForIPv4)(event.roapMessage.sdp);
3128
- _this13.localRoapMessage = event.roapMessage;
3129
- _this13.sendMediaStateMachineEvt({
3156
+ _this12.localRoapMessage = event.roapMessage;
3157
+ _this12.sendMediaStateMachineEvt({
3130
3158
  type: 'E_SEND_ROAP_ANSWER',
3131
3159
  data: event.roapMessage
3132
3160
  });
3133
- return _context25.abrupt("break", 26);
3161
+ return _context27.abrupt("break", 26);
3134
3162
  case 20:
3135
- _this13.sendMediaStateMachineEvt({
3163
+ _this12.sendMediaStateMachineEvt({
3136
3164
  type: 'E_ROAP_ERROR',
3137
3165
  data: event.roapMessage
3138
3166
  });
3139
- return _context25.abrupt("break", 26);
3167
+ return _context27.abrupt("break", 26);
3140
3168
  case 22:
3141
3169
  event.roapMessage.sdp = (0, _Utils.modifySdpForIPv4)(event.roapMessage.sdp);
3142
- _this13.localRoapMessage = event.roapMessage;
3143
- _this13.sendMediaStateMachineEvt({
3170
+ _this12.localRoapMessage = event.roapMessage;
3171
+ _this12.sendMediaStateMachineEvt({
3144
3172
  type: 'E_SEND_ROAP_OFFER',
3145
3173
  data: event.roapMessage
3146
3174
  });
3147
- return _context25.abrupt("break", 26);
3175
+ return _context27.abrupt("break", 26);
3148
3176
  case 26:
3149
3177
  case "end":
3150
- return _context25.stop();
3178
+ return _context27.stop();
3151
3179
  }
3152
- }, _callee24);
3180
+ }, _callee26);
3153
3181
  }));
3154
- return function (_x26) {
3155
- return _ref8.apply(this, arguments);
3182
+ return function (_x27) {
3183
+ return _ref0.apply(this, arguments);
3156
3184
  };
3157
3185
  }());
3158
3186
  }
@@ -3164,11 +3192,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
3164
3192
  }, {
3165
3193
  key: "mediaTrackListener",
3166
3194
  value: function mediaTrackListener() {
3167
- var _this14 = this;
3195
+ var _this13 = this;
3168
3196
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3169
3197
  this.mediaConnection.on(_internalMediaCore.MediaConnectionEventNames.REMOTE_TRACK_ADDED, function (e) {
3170
3198
  if (e.type === _types3.MEDIA_CONNECTION_EVENT_KEYS.MEDIA_TYPE_AUDIO) {
3171
- _this14.emit(_types3.CALL_EVENT_KEYS.REMOTE_MEDIA, e.track);
3199
+ _this13.emit(_types3.CALL_EVENT_KEYS.REMOTE_MEDIA, e.track);
3172
3200
  }
3173
3201
  });
3174
3202
  }
@@ -3202,16 +3230,16 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
3202
3230
  }, {
3203
3231
  key: "delete",
3204
3232
  value: function () {
3205
- var _delete2 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
3233
+ var _delete2 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27() {
3206
3234
  var disconnectMetrics;
3207
- return _regenerator.default.wrap(function _callee25$(_context26) {
3208
- while (1) switch (_context26.prev = _context26.next) {
3235
+ return _regenerator.default.wrap(function _callee27$(_context28) {
3236
+ while (1) switch (_context28.prev = _context28.next) {
3209
3237
  case 0:
3210
- _context26.next = 2;
3238
+ _context28.next = 2;
3211
3239
  return this.getCallStats();
3212
3240
  case 2:
3213
- disconnectMetrics = _context26.sent;
3214
- return _context26.abrupt("return", this.webex.request({
3241
+ disconnectMetrics = _context28.sent;
3242
+ return _context28.abrupt("return", this.webex.request({
3215
3243
  uri: "".concat(this.mobiusUrl).concat(_constants.DEVICES_ENDPOINT_RESOURCE, "/").concat(this.deviceId, "/").concat(_constants.CALLS_ENDPOINT_RESOURCE, "/").concat(this.callId),
3216
3244
  method: _types2.HTTP_METHODS.DELETE,
3217
3245
  service: _types2.ALLOWED_SERVICES.MOBIUS,
@@ -3229,9 +3257,9 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
3229
3257
  }));
3230
3258
  case 4:
3231
3259
  case "end":
3232
- return _context26.stop();
3260
+ return _context28.stop();
3233
3261
  }
3234
- }, _callee25, this);
3262
+ }, _callee27, this);
3235
3263
  }));
3236
3264
  function _delete() {
3237
3265
  return _delete2.apply(this, arguments);
@@ -3409,10 +3437,10 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
3409
3437
  }, {
3410
3438
  key: "handleTimeout",
3411
3439
  value: (function () {
3412
- var _handleTimeout = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26() {
3440
+ var _handleTimeout = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28() {
3413
3441
  var response;
3414
- return _regenerator.default.wrap(function _callee26$(_context27) {
3415
- while (1) switch (_context27.prev = _context27.next) {
3442
+ return _regenerator.default.wrap(function _callee28$(_context29) {
3443
+ while (1) switch (_context29.prev = _context29.next) {
3416
3444
  case 0:
3417
3445
  _Logger.default.warn("Call timed out", {
3418
3446
  file: _constants.CALL_FILE,
@@ -3420,19 +3448,19 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
3420
3448
  });
3421
3449
  this.deleteCb(this.getCorrelationId());
3422
3450
  this.emit(_types3.CALL_EVENT_KEYS.DISCONNECT, this.getCorrelationId());
3423
- _context27.next = 5;
3451
+ _context29.next = 5;
3424
3452
  return this.delete();
3425
3453
  case 5:
3426
- response = _context27.sent;
3454
+ response = _context29.sent;
3427
3455
  _Logger.default.log("Response code: ".concat(response.statusCode), {
3428
3456
  file: _constants.CALL_FILE,
3429
3457
  method: _constants.METHODS.HANDLE_TIMEOUT
3430
3458
  });
3431
3459
  case 7:
3432
3460
  case "end":
3433
- return _context27.stop();
3461
+ return _context29.stop();
3434
3462
  }
3435
- }, _callee26, this);
3463
+ }, _callee28, this);
3436
3464
  }));
3437
3465
  function handleTimeout() {
3438
3466
  return _handleTimeout.apply(this, arguments);