@webex/calling 3.8.1 → 3.9.0-multipleLLM.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/CallSettings/WxCallBackendConnector.js +2 -2
  2. package/dist/CallSettings/WxCallBackendConnector.js.map +1 -1
  3. package/dist/CallSettings/WxCallBackendConnector.test.js +94 -27
  4. package/dist/CallSettings/WxCallBackendConnector.test.js.map +1 -1
  5. package/dist/CallSettings/types.js.map +1 -1
  6. package/dist/CallingClient/CallingClient.js +186 -111
  7. package/dist/CallingClient/CallingClient.js.map +1 -1
  8. package/dist/CallingClient/CallingClient.test.js +258 -102
  9. package/dist/CallingClient/CallingClient.test.js.map +1 -1
  10. package/dist/CallingClient/calling/call.js +26 -13
  11. package/dist/CallingClient/calling/call.js.map +1 -1
  12. package/dist/CallingClient/calling/call.test.js +8 -6
  13. package/dist/CallingClient/calling/call.test.js.map +1 -1
  14. package/dist/CallingClient/constants.js +4 -3
  15. package/dist/CallingClient/constants.js.map +1 -1
  16. package/dist/CallingClient/line/index.js +3 -4
  17. package/dist/CallingClient/line/index.js.map +1 -1
  18. package/dist/CallingClient/line/line.test.js +6 -11
  19. package/dist/CallingClient/line/line.test.js.map +1 -1
  20. package/dist/CallingClient/registration/register.js +486 -380
  21. package/dist/CallingClient/registration/register.js.map +1 -1
  22. package/dist/CallingClient/registration/register.test.js +441 -309
  23. package/dist/CallingClient/registration/register.test.js.map +1 -1
  24. package/dist/CallingClient/registration/types.js.map +1 -1
  25. package/dist/CallingClient/registration/webWorker.js +115 -0
  26. package/dist/CallingClient/registration/webWorker.js.map +1 -0
  27. package/dist/CallingClient/registration/webWorker.test.js +256 -0
  28. package/dist/CallingClient/registration/webWorker.test.js.map +1 -0
  29. package/dist/CallingClient/registration/webWorkerStr.js +15 -0
  30. package/dist/CallingClient/registration/webWorkerStr.js.map +1 -0
  31. package/dist/CallingClient/windowsChromiumIceWarmupUtils.js +146 -0
  32. package/dist/CallingClient/windowsChromiumIceWarmupUtils.js.map +1 -0
  33. package/dist/Errors/types.js +2 -0
  34. package/dist/Errors/types.js.map +1 -1
  35. package/dist/Metrics/index.js +77 -74
  36. package/dist/Metrics/index.js.map +1 -1
  37. package/dist/Metrics/index.test.js +70 -4
  38. package/dist/Metrics/index.test.js.map +1 -1
  39. package/dist/Metrics/types.js.map +1 -1
  40. package/dist/common/Utils.js +46 -37
  41. package/dist/common/Utils.js.map +1 -1
  42. package/dist/common/Utils.test.js +281 -132
  43. package/dist/common/Utils.test.js.map +1 -1
  44. package/dist/common/types.js +8 -1
  45. package/dist/common/types.js.map +1 -1
  46. package/dist/module/CallSettings/WxCallBackendConnector.js +1 -1
  47. package/dist/module/CallingClient/CallingClient.js +39 -10
  48. package/dist/module/CallingClient/calling/call.js +13 -0
  49. package/dist/module/CallingClient/constants.js +3 -2
  50. package/dist/module/CallingClient/line/index.js +3 -3
  51. package/dist/module/CallingClient/registration/register.js +102 -66
  52. package/dist/module/CallingClient/registration/webWorker.js +59 -0
  53. package/dist/module/CallingClient/registration/webWorkerStr.js +93 -0
  54. package/dist/module/CallingClient/windowsChromiumIceWarmupUtils.js +62 -0
  55. package/dist/module/Errors/types.js +2 -0
  56. package/dist/module/Metrics/index.js +31 -32
  57. package/dist/module/common/Utils.js +15 -4
  58. package/dist/module/common/types.js +7 -0
  59. package/dist/types/CallSettings/types.d.ts +1 -1
  60. package/dist/types/CallSettings/types.d.ts.map +1 -1
  61. package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
  62. package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
  63. package/dist/types/CallingClient/constants.d.ts +3 -2
  64. package/dist/types/CallingClient/constants.d.ts.map +1 -1
  65. package/dist/types/CallingClient/line/index.d.ts.map +1 -1
  66. package/dist/types/CallingClient/registration/register.d.ts +2 -2
  67. package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
  68. package/dist/types/CallingClient/registration/types.d.ts.map +1 -1
  69. package/dist/types/CallingClient/registration/webWorker.d.ts +2 -0
  70. package/dist/types/CallingClient/registration/webWorker.d.ts.map +1 -0
  71. package/dist/types/CallingClient/registration/webWorkerStr.d.ts +3 -0
  72. package/dist/types/CallingClient/registration/webWorkerStr.d.ts.map +1 -0
  73. package/dist/types/CallingClient/windowsChromiumIceWarmupUtils.d.ts +7 -0
  74. package/dist/types/CallingClient/windowsChromiumIceWarmupUtils.d.ts.map +1 -0
  75. package/dist/types/Errors/types.d.ts +2 -0
  76. package/dist/types/Errors/types.d.ts.map +1 -1
  77. package/dist/types/Metrics/index.d.ts.map +1 -1
  78. package/dist/types/Metrics/types.d.ts +3 -2
  79. package/dist/types/Metrics/types.d.ts.map +1 -1
  80. package/dist/types/common/Utils.d.ts.map +1 -1
  81. package/dist/types/common/types.d.ts +13 -0
  82. package/dist/types/common/types.d.ts.map +1 -1
  83. package/package.json +4 -4
@@ -40,6 +40,7 @@ var _constants2 = require("./constants");
40
40
  var _line = _interopRequireDefault(require("./line"));
41
41
  var _types4 = require("../Metrics/types");
42
42
  var _Metrics = require("../Metrics");
43
+ var _windowsChromiumIceWarmupUtils = _interopRequireDefault(require("./windowsChromiumIceWarmupUtils"));
43
44
  function _getRequireWildcardCache(e) { if ("function" != typeof _WeakMap) return null; var r = new _WeakMap(), t = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
44
45
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? _Object$getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? _Object$defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
45
46
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && o[_Symbol$iterator] || o["@@iterator"]; if (!it) { if (_Array$isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
@@ -203,7 +204,19 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
203
204
  method: _this.constructor.name
204
205
  });
205
206
  }
206
- _this.mobiusClusters = mobiusServiceHost && _this.webex.internal.services._hostCatalog[mobiusServiceHost] || _this.webex.internal.services._hostCatalog[_constants2.MOBIUS_US_PROD] || _this.webex.internal.services._hostCatalog[_constants2.MOBIUS_EU_PROD] || _this.webex.internal.services._hostCatalog[_constants2.MOBIUS_US_INT] || _this.webex.internal.services._hostCatalog[_constants2.MOBIUS_EU_INT];
207
+
208
+ // TODO: This is a temp fix - https://jira-eng-sjc12.cisco.com/jira/browse/CAI-6809
209
+ if (_this.webex.internal.services._hostCatalog) {
210
+ _this.mobiusClusters = mobiusServiceHost && _this.webex.internal.services._hostCatalog[mobiusServiceHost] || _this.webex.internal.services._hostCatalog[_constants2.MOBIUS_US_PROD] || _this.webex.internal.services._hostCatalog[_constants2.MOBIUS_EU_PROD] || _this.webex.internal.services._hostCatalog[_constants2.MOBIUS_US_INT] || _this.webex.internal.services._hostCatalog[_constants2.MOBIUS_EU_INT];
211
+ } else {
212
+ // @ts-ignore
213
+ var mobiusObject = _this.webex.internal.services._services.find(
214
+ // @ts-ignore
215
+ function (item) {
216
+ return item.serviceName === 'mobius';
217
+ });
218
+ _this.mobiusClusters = [mobiusObject.serviceUrls[0].baseUrl];
219
+ }
207
220
  _this.mobiusHost = '';
208
221
  _this.registerSessionsListener();
209
222
  _this.registerCallsClearedListener();
@@ -231,19 +244,38 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
231
244
  return _regenerator.default.wrap(function _callee3$(_context3) {
232
245
  while (1) switch (_context3.prev = _context3.next) {
233
246
  case 0:
234
- _context3.next = 2;
247
+ _context3.prev = 0;
248
+ _context3.next = 3;
249
+ return (0, _windowsChromiumIceWarmupUtils.default)({
250
+ iceServers: [{
251
+ urls: 'stun:stun01a-us.bcld.webex.com:5004'
252
+ }, {
253
+ urls: 'stun:stun02a-us.bcld.webex.com:5004'
254
+ }],
255
+ timeoutMs: 1000
256
+ });
257
+ case 3:
258
+ _Logger.default.info("ICE warmup completed", '');
259
+ _context3.next = 9;
260
+ break;
261
+ case 6:
262
+ _context3.prev = 6;
263
+ _context3.t0 = _context3["catch"](0);
264
+ _Logger.default.warn("ICE warmup failed: ".concat(_context3.t0), '');
265
+ case 9:
266
+ _context3.next = 11;
235
267
  return this.getMobiusServers();
236
- case 2:
237
- _context3.next = 4;
268
+ case 11:
269
+ _context3.next = 13;
238
270
  return this.createLine();
239
- case 4:
271
+ case 13:
240
272
  /* Better to run the timer once rather than after every registration */
241
273
  this.detectNetworkChange();
242
- case 5:
274
+ case 14:
243
275
  case "end":
244
276
  return _context3.stop();
245
277
  }
246
- }, _callee3, this);
278
+ }, _callee3, this, [[0, 6]]);
247
279
  }));
248
280
  function init() {
249
281
  return _init.apply(this, arguments);
@@ -323,9 +355,9 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
323
355
  value: (function () {
324
356
  var _getClientRegionInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
325
357
  var _this3 = this;
326
- var regionInfo, _iterator, _step, mobius, temp, myIP, response, clientRegionInfo, extendedError;
327
- return _regenerator.default.wrap(function _callee6$(_context6) {
328
- while (1) switch (_context6.prev = _context6.next) {
358
+ var abort, regionInfo, _iterator, _step, _loop, _ret;
359
+ return _regenerator.default.wrap(function _callee6$(_context7) {
360
+ while (1) switch (_context7.prev = _context7.next) {
329
361
  case 0:
330
362
  _Logger.default.info(_constants.METHOD_START_MESSAGE, {
331
363
  file: _constants2.CALLING_CLIENT_FILE,
@@ -333,77 +365,119 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
333
365
  });
334
366
  regionInfo = {};
335
367
  _iterator = _createForOfIteratorHelper(this.mobiusClusters);
336
- _context6.prev = 3;
368
+ _context7.prev = 3;
369
+ _loop = /*#__PURE__*/_regenerator.default.mark(function _loop() {
370
+ var mobius, temp, myIP, response, clientRegionInfo, extendedError;
371
+ return _regenerator.default.wrap(function _loop$(_context6) {
372
+ while (1) switch (_context6.prev = _context6.next) {
373
+ case 0:
374
+ mobius = _step.value;
375
+ if (mobius.host) {
376
+ _this3.mobiusHost = "https://".concat(mobius.host).concat(_constants2.API_V1);
377
+ } else {
378
+ _this3.mobiusHost = mobius;
379
+ }
380
+ _context6.prev = 2;
381
+ _context6.next = 5;
382
+ return _this3.webex.request({
383
+ uri: "".concat(_this3.mobiusHost).concat(_constants2.URL_ENDPOINT).concat(_constants2.IP_ENDPOINT),
384
+ method: _types3.HTTP_METHODS.GET,
385
+ headers: (0, _defineProperty2.default)((0, _defineProperty2.default)({}, _constants2.CISCO_DEVICE_URL, _this3.webex.internal.device.url), _constants2.SPARK_USER_AGENT, _constants2.CALLING_USER_AGENT),
386
+ service: _types3.ALLOWED_SERVICES.MOBIUS
387
+ });
388
+ case 5:
389
+ temp = _context6.sent;
390
+ myIP = temp.body.ipv4; // eslint-disable-next-line no-await-in-loop
391
+ _context6.next = 9;
392
+ return _this3.webex.request({
393
+ uri: "".concat(_constants2.DISCOVERY_URL, "/").concat(myIP),
394
+ method: _types3.HTTP_METHODS.GET,
395
+ addAuthHeader: false,
396
+ headers: (0, _defineProperty2.default)({}, _constants2.SPARK_USER_AGENT, null)
397
+ });
398
+ case 9:
399
+ response = _context6.sent;
400
+ clientRegionInfo = response.body;
401
+ regionInfo.clientRegion = clientRegionInfo !== null && clientRegionInfo !== void 0 && clientRegionInfo.clientRegion ? clientRegionInfo.clientRegion : '';
402
+ regionInfo.countryCode = clientRegionInfo !== null && clientRegionInfo !== void 0 && clientRegionInfo.countryCode ? clientRegionInfo.countryCode : '';
403
+ return _context6.abrupt("return", 0);
404
+ case 16:
405
+ _context6.prev = 16;
406
+ _context6.t0 = _context6["catch"](2);
407
+ extendedError = new Error("Failed to get client region info: ".concat(_context6.t0));
408
+ _Logger.default.error(extendedError, {
409
+ method: _constants2.METHODS.GET_CLIENT_REGION_INFO,
410
+ file: _constants2.CALLING_CLIENT_FILE
411
+ });
412
+
413
+ // eslint-disable-next-line no-await-in-loop
414
+ _context6.next = 22;
415
+ return (0, _Utils.handleCallingClientErrors)(_context6.t0, function (clientError) {
416
+ var _headers$trackingId, _headers3;
417
+ _this3.metricManager.submitRegistrationMetric(_types4.METRIC_EVENT.REGISTRATION_ERROR, _types4.REG_ACTION.REGISTER, _types4.METRIC_TYPE.BEHAVIORAL, _constants2.GET_MOBIUS_SERVERS_UTIL, 'UNKNOWN', (_headers$trackingId = (_headers3 = _context6.t0.headers) === null || _headers3 === void 0 ? void 0 : _headers3.trackingId) !== null && _headers$trackingId !== void 0 ? _headers$trackingId : '', undefined, clientError);
418
+ _this3.emit(_types2.CALLING_CLIENT_EVENT_KEYS.ERROR, clientError);
419
+ }, {
420
+ method: _constants2.GET_MOBIUS_SERVERS_UTIL,
421
+ file: _constants2.CALLING_CLIENT_FILE
422
+ });
423
+ case 22:
424
+ abort = _context6.sent;
425
+ regionInfo.clientRegion = '';
426
+ regionInfo.countryCode = '';
427
+ if (!abort) {
428
+ _context6.next = 27;
429
+ break;
430
+ }
431
+ return _context6.abrupt("return", {
432
+ v: regionInfo
433
+ });
434
+ case 27:
435
+ case "end":
436
+ return _context6.stop();
437
+ }
438
+ }, _loop, null, [[2, 16]]);
439
+ });
337
440
  _iterator.s();
338
- case 5:
441
+ case 6:
339
442
  if ((_step = _iterator.n()).done) {
340
- _context6.next = 31;
443
+ _context7.next = 15;
341
444
  break;
342
445
  }
343
- mobius = _step.value;
344
- this.mobiusHost = "https://".concat(mobius.host).concat(_constants2.API_V1);
345
- _context6.prev = 8;
346
- _context6.next = 11;
347
- return this.webex.request({
348
- uri: "".concat(this.mobiusHost).concat(_constants2.URL_ENDPOINT).concat(_constants2.IP_ENDPOINT),
349
- method: _types3.HTTP_METHODS.GET,
350
- headers: (0, _defineProperty2.default)((0, _defineProperty2.default)({}, _constants2.CISCO_DEVICE_URL, this.webex.internal.device.url), _constants2.SPARK_USER_AGENT, _constants2.CALLING_USER_AGENT),
351
- service: _types3.ALLOWED_SERVICES.MOBIUS
352
- });
446
+ return _context7.delegateYield(_loop(), "t0", 8);
447
+ case 8:
448
+ _ret = _context7.t0;
449
+ if (!(_ret === 0)) {
450
+ _context7.next = 11;
451
+ break;
452
+ }
453
+ return _context7.abrupt("break", 15);
353
454
  case 11:
354
- temp = _context6.sent;
355
- myIP = temp.body.ipv4; // eslint-disable-next-line no-await-in-loop
356
- _context6.next = 15;
357
- return this.webex.request({
358
- uri: "".concat(_constants2.DISCOVERY_URL, "/").concat(myIP),
359
- method: _types3.HTTP_METHODS.GET,
360
- addAuthHeader: false,
361
- headers: (0, _defineProperty2.default)({}, _constants2.SPARK_USER_AGENT, null)
362
- });
363
- case 15:
364
- response = _context6.sent;
365
- clientRegionInfo = response.body;
366
- regionInfo.clientRegion = clientRegionInfo !== null && clientRegionInfo !== void 0 && clientRegionInfo.clientRegion ? clientRegionInfo.clientRegion : '';
367
- regionInfo.countryCode = clientRegionInfo !== null && clientRegionInfo !== void 0 && clientRegionInfo.countryCode ? clientRegionInfo.countryCode : '';
368
- return _context6.abrupt("break", 31);
369
- case 22:
370
- _context6.prev = 22;
371
- _context6.t0 = _context6["catch"](8);
372
- extendedError = new Error("Failed to get client region info: ".concat(_context6.t0));
373
- _Logger.default.error(extendedError, {
374
- method: _constants2.METHODS.GET_CLIENT_REGION_INFO,
375
- file: _constants2.CALLING_CLIENT_FILE
376
- });
377
- (0, _Utils.handleCallingClientErrors)(_context6.t0, function (clientError) {
378
- _this3.metricManager.submitRegistrationMetric(_types4.METRIC_EVENT.REGISTRATION_ERROR, _types4.REG_ACTION.REGISTER, _types4.METRIC_TYPE.BEHAVIORAL, clientError);
379
- _this3.emit(_types2.CALLING_CLIENT_EVENT_KEYS.ERROR, clientError);
380
- }, {
381
- method: _constants2.GET_MOBIUS_SERVERS_UTIL,
382
- file: _constants2.CALLING_CLIENT_FILE
383
- });
384
- regionInfo.clientRegion = '';
385
- regionInfo.countryCode = '';
386
- case 29:
387
- _context6.next = 5;
455
+ if (!_ret) {
456
+ _context7.next = 13;
457
+ break;
458
+ }
459
+ return _context7.abrupt("return", _ret.v);
460
+ case 13:
461
+ _context7.next = 6;
388
462
  break;
389
- case 31:
390
- _context6.next = 36;
463
+ case 15:
464
+ _context7.next = 20;
391
465
  break;
392
- case 33:
393
- _context6.prev = 33;
394
- _context6.t1 = _context6["catch"](3);
395
- _iterator.e(_context6.t1);
396
- case 36:
397
- _context6.prev = 36;
466
+ case 17:
467
+ _context7.prev = 17;
468
+ _context7.t1 = _context7["catch"](3);
469
+ _iterator.e(_context7.t1);
470
+ case 20:
471
+ _context7.prev = 20;
398
472
  _iterator.f();
399
- return _context6.finish(36);
400
- case 39:
401
- return _context6.abrupt("return", regionInfo);
402
- case 40:
473
+ return _context7.finish(20);
474
+ case 23:
475
+ return _context7.abrupt("return", regionInfo);
476
+ case 24:
403
477
  case "end":
404
- return _context6.stop();
478
+ return _context7.stop();
405
479
  }
406
- }, _callee6, this, [[3, 33, 36, 39], [8, 22]]);
480
+ }, _callee6, this, [[3, 17, 20, 23]]);
407
481
  }));
408
482
  function getClientRegionInfo() {
409
483
  return _getClientRegionInfo.apply(this, arguments);
@@ -424,8 +498,8 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
424
498
  _this$sdkConfig4$disc,
425
499
  _this4 = this;
426
500
  var useDefault, clientRegion, countryCode, _this$sdkConfig5, _this$sdkConfig5$disc, _this$sdkConfig6, _this$sdkConfig6$disc, regionInfo, temp, mobiusServers, mobiusUris, extendedError;
427
- return _regenerator.default.wrap(function _callee7$(_context7) {
428
- while (1) switch (_context7.prev = _context7.next) {
501
+ return _regenerator.default.wrap(function _callee7$(_context8) {
502
+ while (1) switch (_context8.prev = _context8.next) {
429
503
  case 0:
430
504
  _Logger.default.info(_constants.METHOD_START_MESSAGE, {
431
505
  file: _constants2.CALLING_CLIENT_FILE,
@@ -440,7 +514,7 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
440
514
  */
441
515
  useDefault = false;
442
516
  if (!((_this$sdkConfig3 = this.sdkConfig) !== null && _this$sdkConfig3 !== void 0 && (_this$sdkConfig3$disc = _this$sdkConfig3.discovery) !== null && _this$sdkConfig3$disc !== void 0 && _this$sdkConfig3$disc.country && (_this$sdkConfig4 = this.sdkConfig) !== null && _this$sdkConfig4 !== void 0 && (_this$sdkConfig4$disc = _this$sdkConfig4.discovery) !== null && _this$sdkConfig4$disc !== void 0 && _this$sdkConfig4$disc.region)) {
443
- _context7.next = 9;
517
+ _context8.next = 9;
444
518
  break;
445
519
  }
446
520
  _Logger.default.log('Updating region and country from the SDK config', {
@@ -450,27 +524,27 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
450
524
  clientRegion = (_this$sdkConfig5 = this.sdkConfig) === null || _this$sdkConfig5 === void 0 ? void 0 : (_this$sdkConfig5$disc = _this$sdkConfig5.discovery) === null || _this$sdkConfig5$disc === void 0 ? void 0 : _this$sdkConfig5$disc.region;
451
525
  countryCode = (_this$sdkConfig6 = this.sdkConfig) === null || _this$sdkConfig6 === void 0 ? void 0 : (_this$sdkConfig6$disc = _this$sdkConfig6.discovery) === null || _this$sdkConfig6$disc === void 0 ? void 0 : _this$sdkConfig6$disc.country;
452
526
  this.mobiusHost = this.webex.internal.services._serviceUrls.mobius;
453
- _context7.next = 15;
527
+ _context8.next = 15;
454
528
  break;
455
529
  case 9:
456
530
  _Logger.default.log('Updating region and country through Region discovery', {
457
531
  file: _constants2.CALLING_CLIENT_FILE,
458
532
  method: _constants2.GET_MOBIUS_SERVERS_UTIL
459
533
  });
460
- _context7.next = 12;
534
+ _context8.next = 12;
461
535
  return this.getClientRegionInfo();
462
536
  case 12:
463
- regionInfo = _context7.sent;
537
+ regionInfo = _context8.sent;
464
538
  clientRegion = regionInfo.clientRegion;
465
539
  countryCode = regionInfo.countryCode;
466
540
  case 15:
467
541
  if (!(clientRegion && countryCode)) {
468
- _context7.next = 37;
542
+ _context8.next = 37;
469
543
  break;
470
544
  }
471
545
  _Logger.default.log("Found Region: ".concat(clientRegion, " and country: ").concat(countryCode, ", going to fetch Mobius server"), '');
472
- _context7.prev = 17;
473
- _context7.next = 20;
546
+ _context8.prev = 17;
547
+ _context8.next = 20;
474
548
  return this.webex.request({
475
549
  uri: "".concat(this.mobiusHost).concat(_constants2.URL_ENDPOINT, "?regionCode=").concat(clientRegion, "&countryCode=").concat(countryCode),
476
550
  method: _types3.HTTP_METHODS.GET,
@@ -478,7 +552,7 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
478
552
  service: _types3.ALLOWED_SERVICES.MOBIUS
479
553
  });
480
554
  case 20:
481
- temp = _context7.sent;
555
+ temp = _context8.sent;
482
556
  _Logger.default.log('Mobius Server found for the region', '');
483
557
  mobiusServers = temp.body;
484
558
  /* update arrays of Mobius Uris. */
@@ -486,18 +560,19 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
486
560
  this.primaryMobiusUris = mobiusUris.primary;
487
561
  this.backupMobiusUris = mobiusUris.backup;
488
562
  _Logger.default.info("Final list of Mobius Servers, primary: ".concat(mobiusUris.primary, " and backup: ").concat(mobiusUris.backup), '');
489
- _context7.next = 35;
563
+ _context8.next = 35;
490
564
  break;
491
565
  case 29:
492
- _context7.prev = 29;
493
- _context7.t0 = _context7["catch"](17);
494
- extendedError = new Error("Failed to get Mobius servers: ".concat(_context7.t0));
566
+ _context8.prev = 29;
567
+ _context8.t0 = _context8["catch"](17);
568
+ extendedError = new Error("Failed to get Mobius servers: ".concat(_context8.t0));
495
569
  _Logger.default.error(extendedError, {
496
570
  method: _constants2.METHODS.GET_MOBIUS_SERVERS,
497
571
  file: _constants2.CALLING_CLIENT_FILE
498
572
  });
499
- (0, _Utils.handleCallingClientErrors)(_context7.t0, function (clientError) {
500
- _this4.metricManager.submitRegistrationMetric(_types4.METRIC_EVENT.REGISTRATION_ERROR, _types4.REG_ACTION.REGISTER, _types4.METRIC_TYPE.BEHAVIORAL, clientError);
573
+ (0, _Utils.handleCallingClientErrors)(_context8.t0, function (clientError) {
574
+ var _headers$trackingId2, _headers5;
575
+ _this4.metricManager.submitRegistrationMetric(_types4.METRIC_EVENT.REGISTRATION_ERROR, _types4.REG_ACTION.REGISTER, _types4.METRIC_TYPE.BEHAVIORAL, _constants2.GET_MOBIUS_SERVERS_UTIL, 'UNKNOWN', (_headers$trackingId2 = (_headers5 = _context8.t0.headers) === null || _headers5 === void 0 ? void 0 : _headers5.trackingId) !== null && _headers$trackingId2 !== void 0 ? _headers$trackingId2 : '', undefined, clientError);
501
576
  _this4.emit(_types2.CALLING_CLIENT_EVENT_KEYS.ERROR, clientError);
502
577
  }, {
503
578
  method: _constants2.GET_MOBIUS_SERVERS_UTIL,
@@ -505,7 +580,7 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
505
580
  });
506
581
  useDefault = true;
507
582
  case 35:
508
- _context7.next = 38;
583
+ _context8.next = 38;
509
584
  break;
510
585
  case 37:
511
586
  /* Setting this to true because region info is possibly undefined */
@@ -522,7 +597,7 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
522
597
  }
523
598
  case 39:
524
599
  case "end":
525
- return _context7.stop();
600
+ return _context8.stop();
526
601
  }
527
602
  }, _callee7, this, [[17, 29]]);
528
603
  }));
@@ -577,23 +652,23 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
577
652
  this.sdkConnector.registerListener(_types2.MOBIUS_EVENT_KEYS.CALL_SESSION_EVENT_INCLUSIVE, /*#__PURE__*/function () {
578
653
  var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8(event) {
579
654
  var sessionArr, i;
580
- return _regenerator.default.wrap(function _callee8$(_context8) {
581
- while (1) switch (_context8.prev = _context8.next) {
655
+ return _regenerator.default.wrap(function _callee8$(_context9) {
656
+ while (1) switch (_context9.prev = _context9.next) {
582
657
  case 0:
583
658
  if (!(event && event.data.userSessions.userSessions)) {
584
- _context8.next = 7;
659
+ _context9.next = 7;
585
660
  break;
586
661
  }
587
662
  sessionArr = event === null || event === void 0 ? void 0 : event.data.userSessions.userSessions;
588
663
  if (!(sessionArr.length === 1)) {
589
- _context8.next = 5;
664
+ _context9.next = 5;
590
665
  break;
591
666
  }
592
667
  if (!(sessionArr[0].sessionType !== _types2.SessionType.WEBEX_CALLING)) {
593
- _context8.next = 5;
668
+ _context9.next = 5;
594
669
  break;
595
670
  }
596
- return _context8.abrupt("return");
671
+ return _context9.abrupt("return");
597
672
  case 5:
598
673
  for (i = 0; i < sessionArr.length; i += 1) {
599
674
  if (sessionArr[i].sessionType !== _types2.SessionType.WEBEX_CALLING) {
@@ -603,7 +678,7 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
603
678
  _this5.emit(_types2.CALLING_CLIENT_EVENT_KEYS.USER_SESSION_INFO, event);
604
679
  case 7:
605
680
  case "end":
606
- return _context8.stop();
681
+ return _context9.stop();
607
682
  }
608
683
  }, _callee8);
609
684
  }));
@@ -623,8 +698,8 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
623
698
  var _createLine = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
624
699
  var _this$sdkConfig7, _this$sdkConfig8;
625
700
  var line;
626
- return _regenerator.default.wrap(function _callee9$(_context9) {
627
- while (1) switch (_context9.prev = _context9.next) {
701
+ return _regenerator.default.wrap(function _callee9$(_context10) {
702
+ while (1) switch (_context10.prev = _context10.next) {
628
703
  case 0:
629
704
  _Logger.default.info(_constants.METHOD_START_MESSAGE, {
630
705
  file: _constants2.CALLING_CLIENT_FILE,
@@ -634,7 +709,7 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
634
709
  this.lineDict[line.lineId] = line;
635
710
  case 3:
636
711
  case "end":
637
- return _context9.stop();
712
+ return _context10.stop();
638
713
  }
639
714
  }, _callee9, this);
640
715
  }));
@@ -703,23 +778,23 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
703
778
  value: (function () {
704
779
  var _uploadLogs2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
705
780
  var result;
706
- return _regenerator.default.wrap(function _callee10$(_context10) {
707
- while (1) switch (_context10.prev = _context10.next) {
781
+ return _regenerator.default.wrap(function _callee10$(_context11) {
782
+ while (1) switch (_context11.prev = _context11.next) {
708
783
  case 0:
709
- _context10.next = 2;
784
+ _context11.next = 2;
710
785
  return (0, _Utils.uploadLogs)({}, true);
711
786
  case 2:
712
- result = _context10.sent;
787
+ result = _context11.sent;
713
788
  if (result) {
714
- _context10.next = 5;
789
+ _context11.next = 5;
715
790
  break;
716
791
  }
717
792
  throw new Error('Failed to upload logs: No response received.');
718
793
  case 5:
719
- return _context10.abrupt("return", result);
794
+ return _context11.abrupt("return", result);
720
795
  case 6:
721
796
  case "end":
722
- return _context10.stop();
797
+ return _context11.stop();
723
798
  }
724
799
  }, _callee10);
725
800
  }));
@@ -739,17 +814,17 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
739
814
  var createClient = exports.createClient = /*#__PURE__*/function () {
740
815
  var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(webex, config) {
741
816
  var callingClientInstance;
742
- return _regenerator.default.wrap(function _callee11$(_context11) {
743
- while (1) switch (_context11.prev = _context11.next) {
817
+ return _regenerator.default.wrap(function _callee11$(_context12) {
818
+ while (1) switch (_context12.prev = _context12.next) {
744
819
  case 0:
745
820
  callingClientInstance = new CallingClient(webex, config);
746
- _context11.next = 3;
821
+ _context12.next = 3;
747
822
  return callingClientInstance.init();
748
823
  case 3:
749
- return _context11.abrupt("return", callingClientInstance);
824
+ return _context12.abrupt("return", callingClientInstance);
750
825
  case 4:
751
826
  case "end":
752
- return _context11.stop();
827
+ return _context12.stop();
753
828
  }
754
829
  }, _callee11);
755
830
  }));