@webex/calling 3.9.0-next.7 → 3.9.0-next.9

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 (171) hide show
  1. package/dist/CallHistory/CallHistory.js +51 -46
  2. package/dist/CallHistory/CallHistory.js.map +1 -1
  3. package/dist/CallHistory/CallHistory.test.js +146 -147
  4. package/dist/CallHistory/CallHistory.test.js.map +1 -1
  5. package/dist/CallHistory/callHistoryFixtures.js.map +1 -1
  6. package/dist/CallHistory/constants.js.map +1 -1
  7. package/dist/CallHistory/types.js.map +1 -1
  8. package/dist/CallSettings/CallSettings.js +8 -8
  9. package/dist/CallSettings/CallSettings.js.map +1 -1
  10. package/dist/CallSettings/CallSettings.test.js +1 -1
  11. package/dist/CallSettings/CallSettings.test.js.map +1 -1
  12. package/dist/CallSettings/UcmBackendConnector.js +12 -11
  13. package/dist/CallSettings/UcmBackendConnector.js.map +1 -1
  14. package/dist/CallSettings/UcmBackendConnector.test.js +9 -10
  15. package/dist/CallSettings/UcmBackendConnector.test.js.map +1 -1
  16. package/dist/CallSettings/WxCallBackendConnector.js +66 -59
  17. package/dist/CallSettings/WxCallBackendConnector.js.map +1 -1
  18. package/dist/CallSettings/WxCallBackendConnector.test.js +108 -109
  19. package/dist/CallSettings/WxCallBackendConnector.test.js.map +1 -1
  20. package/dist/CallSettings/constants.js.map +1 -1
  21. package/dist/CallSettings/testFixtures.js.map +1 -1
  22. package/dist/CallSettings/types.js.map +1 -1
  23. package/dist/CallingClient/CallingClient.js +142 -85
  24. package/dist/CallingClient/CallingClient.js.map +1 -1
  25. package/dist/CallingClient/CallingClient.test.js +184 -173
  26. package/dist/CallingClient/CallingClient.test.js.map +1 -1
  27. package/dist/CallingClient/callRecordFixtures.js.map +1 -1
  28. package/dist/CallingClient/calling/CallerId/index.js +2 -2
  29. package/dist/CallingClient/calling/CallerId/index.js.map +1 -1
  30. package/dist/CallingClient/calling/CallerId/index.test.js +8 -7
  31. package/dist/CallingClient/calling/CallerId/index.test.js.map +1 -1
  32. package/dist/CallingClient/calling/CallerId/types.js.map +1 -1
  33. package/dist/CallingClient/calling/call.js +343 -320
  34. package/dist/CallingClient/calling/call.js.map +1 -1
  35. package/dist/CallingClient/calling/call.test.js +405 -406
  36. package/dist/CallingClient/calling/call.test.js.map +1 -1
  37. package/dist/CallingClient/calling/callManager.js +3 -4
  38. package/dist/CallingClient/calling/callManager.js.map +1 -1
  39. package/dist/CallingClient/calling/callManager.test.js +67 -68
  40. package/dist/CallingClient/calling/callManager.test.js.map +1 -1
  41. package/dist/CallingClient/calling/index.js.map +1 -1
  42. package/dist/CallingClient/calling/types.js.map +1 -1
  43. package/dist/CallingClient/callingClientFixtures.js.map +1 -1
  44. package/dist/CallingClient/constants.js +2 -1
  45. package/dist/CallingClient/constants.js.map +1 -1
  46. package/dist/CallingClient/line/index.js +7 -7
  47. package/dist/CallingClient/line/index.js.map +1 -1
  48. package/dist/CallingClient/line/line.test.js +6 -6
  49. package/dist/CallingClient/line/line.test.js.map +1 -1
  50. package/dist/CallingClient/line/types.js.map +1 -1
  51. package/dist/CallingClient/registration/index.js.map +1 -1
  52. package/dist/CallingClient/registration/register.js +239 -230
  53. package/dist/CallingClient/registration/register.js.map +1 -1
  54. package/dist/CallingClient/registration/register.test.js +172 -173
  55. package/dist/CallingClient/registration/register.test.js.map +1 -1
  56. package/dist/CallingClient/registration/registerFixtures.js.map +1 -1
  57. package/dist/CallingClient/registration/types.js.map +1 -1
  58. package/dist/CallingClient/registration/webWorker.js +5 -4
  59. package/dist/CallingClient/registration/webWorker.js.map +1 -1
  60. package/dist/CallingClient/registration/webWorker.test.js +14 -14
  61. package/dist/CallingClient/registration/webWorker.test.js.map +1 -1
  62. package/dist/CallingClient/registration/webWorkerStr.js.map +1 -1
  63. package/dist/CallingClient/types.js.map +1 -1
  64. package/dist/CallingClient/windowsChromiumIceWarmupUtils.js +2 -6
  65. package/dist/CallingClient/windowsChromiumIceWarmupUtils.js.map +1 -1
  66. package/dist/Contacts/ContactsClient.js +244 -238
  67. package/dist/Contacts/ContactsClient.js.map +1 -1
  68. package/dist/Contacts/ContactsClient.test.js +89 -90
  69. package/dist/Contacts/ContactsClient.test.js.map +1 -1
  70. package/dist/Contacts/constants.js +2 -2
  71. package/dist/Contacts/constants.js.map +1 -1
  72. package/dist/Contacts/contactFixtures.js.map +1 -1
  73. package/dist/Contacts/types.js.map +1 -1
  74. package/dist/Errors/catalog/CallError.js +2 -2
  75. package/dist/Errors/catalog/CallError.js.map +1 -1
  76. package/dist/Errors/catalog/CallingDeviceError.js +2 -2
  77. package/dist/Errors/catalog/CallingDeviceError.js.map +1 -1
  78. package/dist/Errors/catalog/ExtendedError.js +3 -3
  79. package/dist/Errors/catalog/ExtendedError.js.map +1 -1
  80. package/dist/Errors/catalog/LineError.js +2 -2
  81. package/dist/Errors/catalog/LineError.js.map +1 -1
  82. package/dist/Errors/index.js.map +1 -1
  83. package/dist/Errors/types.js.map +1 -1
  84. package/dist/Events/impl/index.js +2 -2
  85. package/dist/Events/impl/index.js.map +1 -1
  86. package/dist/Events/types.js.map +1 -1
  87. package/dist/Logger/index.js.map +1 -1
  88. package/dist/Logger/index.test.js.map +1 -1
  89. package/dist/Logger/types.js.map +1 -1
  90. package/dist/Metrics/index.js +109 -46
  91. package/dist/Metrics/index.js.map +1 -1
  92. package/dist/Metrics/index.test.js.map +1 -1
  93. package/dist/Metrics/types.js +8 -1
  94. package/dist/Metrics/types.js.map +1 -1
  95. package/dist/SDKConnector/index.js +0 -1
  96. package/dist/SDKConnector/index.js.map +1 -1
  97. package/dist/SDKConnector/index.test.js.map +1 -1
  98. package/dist/SDKConnector/types.js.map +1 -1
  99. package/dist/SDKConnector/utils.js.map +1 -1
  100. package/dist/SDKConnector/utils.test.js.map +1 -1
  101. package/dist/Voicemail/BroadworksBackendConnector.js +42 -39
  102. package/dist/Voicemail/BroadworksBackendConnector.js.map +1 -1
  103. package/dist/Voicemail/BroadworksBackendConnector.test.js +119 -120
  104. package/dist/Voicemail/BroadworksBackendConnector.test.js.map +1 -1
  105. package/dist/Voicemail/UcmBackendConnector.js +54 -47
  106. package/dist/Voicemail/UcmBackendConnector.js.map +1 -1
  107. package/dist/Voicemail/UcmBackendConnector.test.js +73 -74
  108. package/dist/Voicemail/UcmBackendConnector.test.js.map +1 -1
  109. package/dist/Voicemail/Voicemail.js +12 -11
  110. package/dist/Voicemail/Voicemail.js.map +1 -1
  111. package/dist/Voicemail/Voicemail.test.js +2 -2
  112. package/dist/Voicemail/Voicemail.test.js.map +1 -1
  113. package/dist/Voicemail/WxCallBackendConnector.js +78 -70
  114. package/dist/Voicemail/WxCallBackendConnector.js.map +1 -1
  115. package/dist/Voicemail/WxCallBackendConnector.test.js +184 -185
  116. package/dist/Voicemail/WxCallBackendConnector.test.js.map +1 -1
  117. package/dist/Voicemail/constants.js.map +1 -1
  118. package/dist/Voicemail/types.js.map +1 -1
  119. package/dist/Voicemail/voicemailFixture.js.map +1 -1
  120. package/dist/api.js.map +1 -1
  121. package/dist/common/Utils.js +80 -63
  122. package/dist/common/Utils.js.map +1 -1
  123. package/dist/common/Utils.test.js +95 -104
  124. package/dist/common/Utils.test.js.map +1 -1
  125. package/dist/common/constants.js.map +1 -1
  126. package/dist/common/index.js.map +1 -1
  127. package/dist/common/testUtil.js +1 -1
  128. package/dist/common/testUtil.js.map +1 -1
  129. package/dist/common/types.js.map +1 -1
  130. package/dist/index.js +5 -5
  131. package/dist/index.js.map +1 -1
  132. package/dist/module/CallHistory/CallHistory.js +4 -0
  133. package/dist/module/CallSettings/UcmBackendConnector.js +1 -0
  134. package/dist/module/CallSettings/WxCallBackendConnector.js +7 -0
  135. package/dist/module/CallingClient/CallingClient.js +62 -20
  136. package/dist/module/CallingClient/calling/call.js +66 -43
  137. package/dist/module/CallingClient/constants.js +2 -1
  138. package/dist/module/CallingClient/registration/register.js +6 -3
  139. package/dist/module/CallingClient/registration/webWorker.js +2 -1
  140. package/dist/module/CallingClient/windowsChromiumIceWarmupUtils.js +1 -4
  141. package/dist/module/Contacts/ContactsClient.js +23 -17
  142. package/dist/module/Contacts/constants.js +1 -1
  143. package/dist/module/Metrics/index.js +42 -0
  144. package/dist/module/Metrics/types.js +7 -0
  145. package/dist/module/Voicemail/BroadworksBackendConnector.js +3 -0
  146. package/dist/module/Voicemail/UcmBackendConnector.js +6 -0
  147. package/dist/module/Voicemail/WxCallBackendConnector.js +8 -0
  148. package/dist/module/common/Utils.js +22 -8
  149. package/dist/types/CallHistory/CallHistory.d.ts.map +1 -1
  150. package/dist/types/CallSettings/UcmBackendConnector.d.ts.map +1 -1
  151. package/dist/types/CallSettings/WxCallBackendConnector.d.ts.map +1 -1
  152. package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
  153. package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
  154. package/dist/types/CallingClient/constants.d.ts +2 -1
  155. package/dist/types/CallingClient/constants.d.ts.map +1 -1
  156. package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
  157. package/dist/types/CallingClient/registration/webWorker.d.ts +2 -1
  158. package/dist/types/CallingClient/registration/webWorker.d.ts.map +1 -1
  159. package/dist/types/CallingClient/windowsChromiumIceWarmupUtils.d.ts +2 -4
  160. package/dist/types/CallingClient/windowsChromiumIceWarmupUtils.d.ts.map +1 -1
  161. package/dist/types/Contacts/ContactsClient.d.ts.map +1 -1
  162. package/dist/types/Contacts/constants.d.ts +1 -1
  163. package/dist/types/Contacts/constants.d.ts.map +1 -1
  164. package/dist/types/Metrics/index.d.ts.map +1 -1
  165. package/dist/types/Metrics/types.d.ts +10 -2
  166. package/dist/types/Metrics/types.d.ts.map +1 -1
  167. package/dist/types/Voicemail/BroadworksBackendConnector.d.ts.map +1 -1
  168. package/dist/types/Voicemail/UcmBackendConnector.d.ts.map +1 -1
  169. package/dist/types/Voicemail/WxCallBackendConnector.d.ts.map +1 -1
  170. package/dist/types/common/Utils.d.ts.map +1 -1
  171. package/package.json +9 -7
@@ -41,13 +41,12 @@ var _line = _interopRequireDefault(require("./line"));
41
41
  var _types4 = require("../Metrics/types");
42
42
  var _Metrics = require("../Metrics");
43
43
  var _windowsChromiumIceWarmupUtils = _interopRequireDefault(require("./windowsChromiumIceWarmupUtils"));
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); }
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; }
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; } } }; }
47
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
48
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
49
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
50
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /* eslint-disable no-underscore-dangle */ /* eslint-disable valid-jsdoc */ /* eslint-disable @typescript-eslint/no-shadow */
44
+ function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
45
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof _Symbol && r[_Symbol$iterator] || r["@@iterator"]; if (!t) { if (_Array$isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
46
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? _Array$from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
47
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
48
+ function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = _Reflect$construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
49
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /* eslint-disable no-underscore-dangle */ /* eslint-disable valid-jsdoc */ /* eslint-disable @typescript-eslint/no-shadow */
51
50
  /**
52
51
  * The `CallingClient` module provides a set of APIs for line registration and calling functionalities within the SDK.
53
52
  *
@@ -88,7 +87,7 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
88
87
  * will be attempted here on receiving a notification from callManager that all
89
88
  * calls are cleaned up.
90
89
  */
91
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "callsClearedHandler", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
90
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "callsClearedHandler", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
92
91
  var registration;
93
92
  return _regenerator.default.wrap(function _callee2$(_context2) {
94
93
  while (1) switch (_context2.prev = _context2.next) {
@@ -105,7 +104,7 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
105
104
  break;
106
105
  }
107
106
  _context2.next = 5;
108
- return _this.mutex.runExclusive( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
107
+ return _this.mutex.runExclusive(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
109
108
  return _regenerator.default.wrap(function _callee$(_context) {
110
109
  while (1) switch (_context.prev = _context.next) {
111
110
  case 0:
@@ -138,7 +137,6 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
138
137
  if (config !== null && config !== void 0 && (_config$logger = config.logger) !== null && _config$logger !== void 0 && _config$logger.level && webex.logger.config) {
139
138
  webex.logger.config.level = config.logger.level; // override the webex logger level
140
139
  }
141
-
142
140
  _Logger.default.setWebexLogger(webex.logger);
143
141
  }
144
142
  _this.mutex = new _asyncMutex.Mutex();
@@ -240,42 +238,59 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
240
238
  (0, _createClass2.default)(CallingClient, [{
241
239
  key: "init",
242
240
  value: function () {
243
- var _init = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
241
+ var _init = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3() {
242
+ var _window, _window$navigator;
243
+ var ua;
244
244
  return _regenerator.default.wrap(function _callee3$(_context3) {
245
245
  while (1) switch (_context3.prev = _context3.next) {
246
246
  case 0:
247
- _context3.prev = 0;
248
- _context3.next = 3;
247
+ if (!(typeof window !== 'undefined' && (_window = window) !== null && _window !== void 0 && (_window$navigator = _window.navigator) !== null && _window$navigator !== void 0 && _window$navigator.userAgent)) {
248
+ _context3.next = 13;
249
+ break;
250
+ }
251
+ ua = window.navigator.userAgent;
252
+ if (!ua.toLowerCase().includes('windows')) {
253
+ _context3.next = 13;
254
+ break;
255
+ }
256
+ _Logger.default.info('Starting ICE warmup for Windows Chromium based browser', {
257
+ file: _constants2.CALLING_CLIENT_FILE,
258
+ method: 'init'
259
+ });
260
+ _context3.prev = 4;
261
+ _context3.next = 7;
249
262
  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
- }],
263
+ iceServers: [],
255
264
  timeoutMs: 1000
256
265
  });
257
- case 3:
258
- _Logger.default.info("ICE warmup completed", '');
259
- _context3.next = 9;
266
+ case 7:
267
+ _Logger.default.info("ICE warmup completed", {
268
+ file: _constants2.CALLING_CLIENT_FILE,
269
+ method: 'init'
270
+ });
271
+ _context3.next = 13;
260
272
  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;
273
+ case 10:
274
+ _context3.prev = 10;
275
+ _context3.t0 = _context3["catch"](4);
276
+ _Logger.default.warn("ICE warmup failed: ".concat(_context3.t0), {
277
+ file: _constants2.CALLING_CLIENT_FILE,
278
+ method: 'init'
279
+ });
280
+ case 13:
281
+ _context3.next = 15;
267
282
  return this.getMobiusServers();
268
- case 11:
269
- _context3.next = 13;
283
+ case 15:
284
+ _context3.next = 17;
270
285
  return this.createLine();
271
- case 13:
286
+ case 17:
272
287
  /* Better to run the timer once rather than after every registration */
273
288
  this.detectNetworkChange();
274
- case 14:
289
+ case 18:
275
290
  case "end":
276
291
  return _context3.stop();
277
292
  }
278
- }, _callee3, this, [[0, 6]]);
293
+ }, _callee3, this, [[4, 10]]);
279
294
  }));
280
295
  function init() {
281
296
  return _init.apply(this, arguments);
@@ -288,7 +303,7 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
288
303
  }, {
289
304
  key: "detectNetworkChange",
290
305
  value: (function () {
291
- var _detectNetworkChange = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
306
+ var _detectNetworkChange = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
292
307
  var _this2 = this;
293
308
  var retry, line;
294
309
  return _regenerator.default.wrap(function _callee5$(_context5) {
@@ -301,7 +316,7 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
301
316
  retry = false; // this is a temporary logic to get registration obj
302
317
  // it will change once we have proper lineId and multiple lines as well
303
318
  line = (0, _values.default)(this.lineDict)[0];
304
- setInterval( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
319
+ setInterval(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4() {
305
320
  return _regenerator.default.wrap(function _callee4$(_context4) {
306
321
  while (1) switch (_context4.prev = _context4.next) {
307
322
  case 0:
@@ -353,7 +368,7 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
353
368
  }, {
354
369
  key: "getClientRegionInfo",
355
370
  value: (function () {
356
- var _getClientRegionInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
371
+ var _getClientRegionInfo = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6() {
357
372
  var _this3 = this;
358
373
  var abort, regionInfo, _iterator, _step, _loop, _ret;
359
374
  return _regenerator.default.wrap(function _callee6$(_context7) {
@@ -367,7 +382,7 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
367
382
  _iterator = _createForOfIteratorHelper(this.mobiusClusters);
368
383
  _context7.prev = 3;
369
384
  _loop = /*#__PURE__*/_regenerator.default.mark(function _loop() {
370
- var mobius, temp, myIP, response, clientRegionInfo, extendedError;
385
+ var mobius, _temp$headers, _response$headers, _response$headers2, _response$headers$tra, _response$headers3, temp, myIP, response, clientRegionInfo, extendedError;
371
386
  return _regenerator.default.wrap(function _loop$(_context6) {
372
387
  while (1) switch (_context6.prev = _context6.next) {
373
388
  case 0:
@@ -387,22 +402,37 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
387
402
  });
388
403
  case 5:
389
404
  temp = _context6.sent;
405
+ _Logger.default.log("Response trackingId: ".concat(temp === null || temp === void 0 ? void 0 : (_temp$headers = temp.headers) === null || _temp$headers === void 0 ? void 0 : _temp$headers.trackingid), {
406
+ file: _constants2.CALLING_CLIENT_FILE,
407
+ method: _constants2.METHODS.GET_CLIENT_REGION_INFO
408
+ });
390
409
  myIP = temp.body.ipv4; // eslint-disable-next-line no-await-in-loop
391
- _context6.next = 9;
410
+ _context6.next = 10;
392
411
  return _this3.webex.request({
393
412
  uri: "".concat(_constants2.DISCOVERY_URL, "/").concat(myIP),
394
413
  method: _types3.HTTP_METHODS.GET,
395
414
  addAuthHeader: false,
396
415
  headers: (0, _defineProperty2.default)({}, _constants2.SPARK_USER_AGENT, null)
397
416
  });
398
- case 9:
417
+ case 10:
399
418
  response = _context6.sent;
419
+ _Logger.default.log("Response trackingId: ".concat(response === null || response === void 0 ? void 0 : (_response$headers = response.headers) === null || _response$headers === void 0 ? void 0 : _response$headers.trackingid), {
420
+ file: _constants2.CALLING_CLIENT_FILE,
421
+ method: _constants2.METHODS.GET_CLIENT_REGION_INFO
422
+ });
400
423
  clientRegionInfo = response.body;
401
424
  regionInfo.clientRegion = clientRegionInfo !== null && clientRegionInfo !== void 0 && clientRegionInfo.clientRegion ? clientRegionInfo.clientRegion : '';
402
425
  regionInfo.countryCode = clientRegionInfo !== null && clientRegionInfo !== void 0 && clientRegionInfo.countryCode ? clientRegionInfo.countryCode : '';
426
+ _Logger.default.log("Successfully fetched Client region info: ".concat(regionInfo.clientRegion, ", countryCode: ").concat(regionInfo.countryCode, ", and response trackingid: ").concat(response === null || response === void 0 ? void 0 : (_response$headers2 = response.headers) === null || _response$headers2 === void 0 ? void 0 : _response$headers2.trackingid), {
427
+ file: _constants2.CALLING_CLIENT_FILE,
428
+ method: _constants2.METHODS.GET_CLIENT_REGION_INFO
429
+ });
430
+
431
+ // Metrics for region info - trying clusters in loop
432
+ _this3.metricManager.submitRegionInfoMetric(_types4.METRIC_EVENT.MOBIUS_DISCOVERY, _types4.MOBIUS_SERVER_ACTION.REGION_INFO, _types4.METRIC_TYPE.BEHAVIORAL, _this3.mobiusHost, clientRegionInfo.clientRegion, clientRegionInfo.countryCode, (_response$headers$tra = response === null || response === void 0 ? void 0 : (_response$headers3 = response.headers) === null || _response$headers3 === void 0 ? void 0 : _response$headers3.trackingid) !== null && _response$headers$tra !== void 0 ? _response$headers$tra : '');
403
433
  return _context6.abrupt("return", 0);
404
- case 16:
405
- _context6.prev = 16;
434
+ case 20:
435
+ _context6.prev = 20;
406
436
  _context6.t0 = _context6["catch"](2);
407
437
  extendedError = new Error("Failed to get client region info: ".concat(_context6.t0));
408
438
  _Logger.default.error(extendedError, {
@@ -411,7 +441,7 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
411
441
  });
412
442
 
413
443
  // eslint-disable-next-line no-await-in-loop
414
- _context6.next = 22;
444
+ _context6.next = 26;
415
445
  return (0, _Utils.handleCallingClientErrors)(_context6.t0, function (clientError) {
416
446
  var _headers$trackingId, _headers3;
417
447
  _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);
@@ -420,22 +450,25 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
420
450
  method: _constants2.GET_MOBIUS_SERVERS_UTIL,
421
451
  file: _constants2.CALLING_CLIENT_FILE
422
452
  });
423
- case 22:
453
+ case 26:
424
454
  abort = _context6.sent;
425
455
  regionInfo.clientRegion = '';
426
456
  regionInfo.countryCode = '';
427
457
  if (!abort) {
428
- _context6.next = 27;
458
+ _context6.next = 33;
429
459
  break;
430
460
  }
461
+ _context6.next = 32;
462
+ return (0, _Utils.uploadLogs)();
463
+ case 32:
431
464
  return _context6.abrupt("return", {
432
465
  v: regionInfo
433
466
  });
434
- case 27:
467
+ case 33:
435
468
  case "end":
436
469
  return _context6.stop();
437
470
  }
438
- }, _loop, null, [[2, 16]]);
471
+ }, _loop, null, [[2, 20]]);
439
472
  });
440
473
  _iterator.s();
441
474
  case 6:
@@ -491,13 +524,13 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
491
524
  }, {
492
525
  key: "getMobiusServers",
493
526
  value: (function () {
494
- var _getMobiusServers = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
527
+ var _getMobiusServers = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7() {
495
528
  var _this$sdkConfig3,
496
529
  _this$sdkConfig3$disc,
497
530
  _this$sdkConfig4,
498
531
  _this$sdkConfig4$disc,
499
532
  _this4 = this;
500
- var useDefault, clientRegion, countryCode, _this$sdkConfig5, _this$sdkConfig5$disc, _this$sdkConfig6, _this$sdkConfig6$disc, regionInfo, temp, mobiusServers, mobiusUris, extendedError;
533
+ var useDefault, clientRegion, countryCode, _this$sdkConfig5, _this$sdkConfig5$disc, _this$sdkConfig6, _this$sdkConfig6$disc, regionInfo, _response$headers4, _response$headers$tra2, _response$headers5, response, mobiusServers, mobiusUris, extendedError, abort;
501
534
  return _regenerator.default.wrap(function _callee7$(_context8) {
502
535
  while (1) switch (_context8.prev = _context8.next) {
503
536
  case 0:
@@ -539,10 +572,13 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
539
572
  countryCode = regionInfo.countryCode;
540
573
  case 15:
541
574
  if (!(clientRegion && countryCode)) {
542
- _context8.next = 37;
575
+ _context8.next = 43;
543
576
  break;
544
577
  }
545
- _Logger.default.log("Found Region: ".concat(clientRegion, " and country: ").concat(countryCode, ", going to fetch Mobius server"), '');
578
+ _Logger.default.log("Found Region: ".concat(clientRegion, " and country: ").concat(countryCode, ", going to fetch Mobius server"), {
579
+ file: _constants2.CALLING_CLIENT_FILE,
580
+ method: _constants2.GET_MOBIUS_SERVERS_UTIL
581
+ });
546
582
  _context8.prev = 17;
547
583
  _context8.next = 20;
548
584
  return this.webex.request({
@@ -552,25 +588,34 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
552
588
  service: _types3.ALLOWED_SERVICES.MOBIUS
553
589
  });
554
590
  case 20:
555
- temp = _context8.sent;
556
- _Logger.default.log('Mobius Server found for the region', '');
557
- mobiusServers = temp.body;
591
+ response = _context8.sent;
592
+ _Logger.default.log("Mobius Server found for the region. Response trackingId: ".concat(response === null || response === void 0 ? void 0 : (_response$headers4 = response.headers) === null || _response$headers4 === void 0 ? void 0 : _response$headers4.trackingid), {
593
+ file: _constants2.CALLING_CLIENT_FILE,
594
+ method: _constants2.GET_MOBIUS_SERVERS_UTIL
595
+ });
596
+ mobiusServers = response.body; // Metrics for mobius servers
597
+ this.metricManager.submitMobiusServersMetric(_types4.METRIC_EVENT.MOBIUS_DISCOVERY, _types4.MOBIUS_SERVER_ACTION.MOBIUS_SERVERS, _types4.METRIC_TYPE.BEHAVIORAL, mobiusServers, (_response$headers$tra2 = response === null || response === void 0 ? void 0 : (_response$headers5 = response.headers) === null || _response$headers5 === void 0 ? void 0 : _response$headers5.trackingid) !== null && _response$headers$tra2 !== void 0 ? _response$headers$tra2 : '');
598
+
558
599
  /* update arrays of Mobius Uris. */
559
600
  mobiusUris = (0, _Utils.filterMobiusUris)(mobiusServers, this.mobiusHost);
560
601
  this.primaryMobiusUris = mobiusUris.primary;
561
602
  this.backupMobiusUris = mobiusUris.backup;
562
- _Logger.default.info("Final list of Mobius Servers, primary: ".concat(mobiusUris.primary, " and backup: ").concat(mobiusUris.backup), '');
563
- _context8.next = 35;
603
+ _Logger.default.log("Final list of Mobius Servers, primary: ".concat(mobiusUris.primary, " and backup: ").concat(mobiusUris.backup), {
604
+ file: _constants2.CALLING_CLIENT_FILE,
605
+ method: _constants2.GET_MOBIUS_SERVERS_UTIL
606
+ });
607
+ _context8.next = 41;
564
608
  break;
565
- case 29:
566
- _context8.prev = 29;
609
+ case 30:
610
+ _context8.prev = 30;
567
611
  _context8.t0 = _context8["catch"](17);
568
612
  extendedError = new Error("Failed to get Mobius servers: ".concat(_context8.t0));
569
613
  _Logger.default.error(extendedError, {
570
614
  method: _constants2.METHODS.GET_MOBIUS_SERVERS,
571
615
  file: _constants2.CALLING_CLIENT_FILE
572
616
  });
573
- (0, _Utils.handleCallingClientErrors)(_context8.t0, function (clientError) {
617
+ _context8.next = 36;
618
+ return (0, _Utils.handleCallingClientErrors)(_context8.t0, function (clientError) {
574
619
  var _headers$trackingId2, _headers5;
575
620
  _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);
576
621
  _this4.emit(_types2.CALLING_CLIENT_EVENT_KEYS.ERROR, clientError);
@@ -578,28 +623,40 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
578
623
  method: _constants2.GET_MOBIUS_SERVERS_UTIL,
579
624
  file: _constants2.CALLING_CLIENT_FILE
580
625
  });
626
+ case 36:
627
+ abort = _context8.sent;
628
+ if (!abort) {
629
+ _context8.next = 40;
630
+ break;
631
+ }
632
+ _context8.next = 40;
633
+ return (0, _Utils.uploadLogs)();
634
+ case 40:
581
635
  useDefault = true;
582
- case 35:
583
- _context8.next = 38;
636
+ case 41:
637
+ _context8.next = 44;
584
638
  break;
585
- case 37:
639
+ case 43:
586
640
  /* Setting this to true because region info is possibly undefined */
587
641
  useDefault = true;
588
- case 38:
642
+ case 44:
589
643
  /* Use a default URL if Mobius discovery fails either because of region info failure
590
644
  * or because the discovered Mobius couldn't be reached
591
645
  */
592
646
 
593
647
  if (useDefault) {
594
- _Logger.default.warn("Couldn't resolve the region and country code. Defaulting to the catalog entries to discover mobius servers", '');
648
+ _Logger.default.warn("Couldn't resolve the region and country code. Defaulting to the catalog entries to discover mobius servers", {
649
+ file: _constants2.CALLING_CLIENT_FILE,
650
+ method: _constants2.GET_MOBIUS_SERVERS_UTIL
651
+ });
595
652
  this.mobiusHost = "https://".concat(this.mobiusClusters[0].host).concat(_constants2.API_V1);
596
653
  this.primaryMobiusUris = ["".concat(this.mobiusHost).concat(_constants2.URL_ENDPOINT)];
597
654
  }
598
- case 39:
655
+ case 45:
599
656
  case "end":
600
657
  return _context8.stop();
601
658
  }
602
- }, _callee7, this, [[17, 29]]);
659
+ }, _callee7, this, [[17, 30]]);
603
660
  }));
604
661
  function getMobiusServers() {
605
662
  return _getMobiusServers.apply(this, arguments);
@@ -650,7 +707,7 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
650
707
  method: _constants2.METHODS.REGISTER_SESSIONS_LISTENER
651
708
  });
652
709
  this.sdkConnector.registerListener(_types2.MOBIUS_EVENT_KEYS.CALL_SESSION_EVENT_INCLUSIVE, /*#__PURE__*/function () {
653
- var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8(event) {
710
+ var _ref4 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8(event) {
654
711
  var sessionArr, i;
655
712
  return _regenerator.default.wrap(function _callee8$(_context9) {
656
713
  while (1) switch (_context9.prev = _context9.next) {
@@ -695,11 +752,11 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
695
752
  }, {
696
753
  key: "createLine",
697
754
  value: (function () {
698
- var _createLine = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
755
+ var _createLine = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee9() {
699
756
  var _this$sdkConfig7, _this$sdkConfig8;
700
757
  var line;
701
- return _regenerator.default.wrap(function _callee9$(_context10) {
702
- while (1) switch (_context10.prev = _context10.next) {
758
+ return _regenerator.default.wrap(function _callee9$(_context0) {
759
+ while (1) switch (_context0.prev = _context0.next) {
703
760
  case 0:
704
761
  _Logger.default.info(_constants.METHOD_START_MESSAGE, {
705
762
  file: _constants2.CALLING_CLIENT_FILE,
@@ -709,7 +766,7 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
709
766
  this.lineDict[line.lineId] = line;
710
767
  case 3:
711
768
  case "end":
712
- return _context10.stop();
769
+ return _context0.stop();
713
770
  }
714
771
  }, _callee9, this);
715
772
  }));
@@ -776,27 +833,27 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
776
833
  }, {
777
834
  key: "uploadLogs",
778
835
  value: (function () {
779
- var _uploadLogs2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
836
+ var _uploadLogs2 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee0() {
780
837
  var result;
781
- return _regenerator.default.wrap(function _callee10$(_context11) {
782
- while (1) switch (_context11.prev = _context11.next) {
838
+ return _regenerator.default.wrap(function _callee0$(_context1) {
839
+ while (1) switch (_context1.prev = _context1.next) {
783
840
  case 0:
784
- _context11.next = 2;
841
+ _context1.next = 2;
785
842
  return (0, _Utils.uploadLogs)({}, true);
786
843
  case 2:
787
- result = _context11.sent;
844
+ result = _context1.sent;
788
845
  if (result) {
789
- _context11.next = 5;
846
+ _context1.next = 5;
790
847
  break;
791
848
  }
792
849
  throw new Error('Failed to upload logs: No response received.');
793
850
  case 5:
794
- return _context11.abrupt("return", result);
851
+ return _context1.abrupt("return", result);
795
852
  case 6:
796
853
  case "end":
797
- return _context11.stop();
854
+ return _context1.stop();
798
855
  }
799
- }, _callee10);
856
+ }, _callee0);
800
857
  }));
801
858
  function uploadLogs() {
802
859
  return _uploadLogs2.apply(this, arguments);
@@ -812,21 +869,21 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
812
869
  * @param config - Config to start the CallingClient with.
813
870
  */
814
871
  var createClient = exports.createClient = /*#__PURE__*/function () {
815
- var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(webex, config) {
872
+ var _ref5 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1(webex, config) {
816
873
  var callingClientInstance;
817
- return _regenerator.default.wrap(function _callee11$(_context12) {
818
- while (1) switch (_context12.prev = _context12.next) {
874
+ return _regenerator.default.wrap(function _callee1$(_context10) {
875
+ while (1) switch (_context10.prev = _context10.next) {
819
876
  case 0:
820
877
  callingClientInstance = new CallingClient(webex, config);
821
- _context12.next = 3;
878
+ _context10.next = 3;
822
879
  return callingClientInstance.init();
823
880
  case 3:
824
- return _context12.abrupt("return", callingClientInstance);
881
+ return _context10.abrupt("return", callingClientInstance);
825
882
  case 4:
826
883
  case "end":
827
- return _context12.stop();
884
+ return _context10.stop();
828
885
  }
829
- }, _callee11);
886
+ }, _callee1);
830
887
  }));
831
888
  return function createClient(_x2, _x3) {
832
889
  return _ref5.apply(this, arguments);