@webex/calling 3.10.0-next.8 → 3.10.0-webex-services-ready.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CallHistory/CallHistory.js +118 -124
- package/dist/CallHistory/CallHistory.js.map +1 -1
- package/dist/CallHistory/CallHistory.test.js +189 -201
- package/dist/CallHistory/CallHistory.test.js.map +1 -1
- package/dist/CallSettings/CallSettings.js +17 -18
- package/dist/CallSettings/CallSettings.js.map +1 -1
- package/dist/CallSettings/CallSettings.test.js +14 -14
- package/dist/CallSettings/CallSettings.test.js.map +1 -1
- package/dist/CallSettings/UcmBackendConnector.js +71 -24
- package/dist/CallSettings/UcmBackendConnector.js.map +1 -1
- package/dist/CallSettings/UcmBackendConnector.test.js +136 -47
- package/dist/CallSettings/UcmBackendConnector.test.js.map +1 -1
- package/dist/CallSettings/WxCallBackendConnector.js +135 -137
- package/dist/CallSettings/WxCallBackendConnector.js.map +1 -1
- package/dist/CallSettings/WxCallBackendConnector.test.js +145 -149
- package/dist/CallSettings/WxCallBackendConnector.test.js.map +1 -1
- package/dist/CallingClient/CallingClient.js +198 -201
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +168 -168
- package/dist/CallingClient/CallingClient.test.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/index.js +7 -8
- package/dist/CallingClient/calling/CallerId/index.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/index.test.js +24 -24
- package/dist/CallingClient/calling/CallerId/index.test.js.map +1 -1
- package/dist/CallingClient/calling/call.js +654 -610
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +701 -556
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/CallingClient/calling/callManager.js +15 -18
- package/dist/CallingClient/calling/callManager.js.map +1 -1
- package/dist/CallingClient/calling/callManager.test.js +113 -113
- package/dist/CallingClient/calling/callManager.test.js.map +1 -1
- package/dist/CallingClient/constants.js +5 -1
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/CallingClient/line/index.js +57 -74
- package/dist/CallingClient/line/index.js.map +1 -1
- package/dist/CallingClient/line/line.test.js +22 -22
- package/dist/CallingClient/line/line.test.js.map +1 -1
- package/dist/CallingClient/registration/register.js +657 -526
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +657 -309
- package/dist/CallingClient/registration/register.test.js.map +1 -1
- package/dist/CallingClient/registration/types.js.map +1 -1
- package/dist/CallingClient/registration/webWorker.js +24 -24
- package/dist/CallingClient/registration/webWorker.js.map +1 -1
- package/dist/CallingClient/registration/webWorker.test.js +20 -20
- package/dist/CallingClient/registration/webWorker.test.js.map +1 -1
- package/dist/CallingClient/windowsChromiumIceWarmupUtils.js +28 -28
- package/dist/CallingClient/windowsChromiumIceWarmupUtils.js.map +1 -1
- package/dist/Contacts/ContactsClient.js +250 -253
- package/dist/Contacts/ContactsClient.js.map +1 -1
- package/dist/Contacts/ContactsClient.test.js +60 -60
- package/dist/Contacts/ContactsClient.test.js.map +1 -1
- package/dist/Errors/catalog/CallError.js +7 -10
- package/dist/Errors/catalog/CallError.js.map +1 -1
- package/dist/Errors/catalog/CallingDeviceError.js +6 -9
- package/dist/Errors/catalog/CallingDeviceError.js.map +1 -1
- package/dist/Errors/catalog/ExtendedError.js +6 -8
- package/dist/Errors/catalog/ExtendedError.js.map +1 -1
- package/dist/Errors/catalog/LineError.js +6 -9
- package/dist/Errors/catalog/LineError.js.map +1 -1
- package/dist/Events/impl/index.js +11 -13
- package/dist/Events/impl/index.js.map +1 -1
- package/dist/Metrics/index.js +1 -2
- package/dist/Metrics/index.js.map +1 -1
- package/dist/SDKConnector/index.js +1 -2
- package/dist/SDKConnector/index.js.map +1 -1
- package/dist/SDKConnector/types.js.map +1 -1
- package/dist/Voicemail/BroadworksBackendConnector.js +126 -127
- package/dist/Voicemail/BroadworksBackendConnector.js.map +1 -1
- package/dist/Voicemail/BroadworksBackendConnector.test.js +98 -98
- package/dist/Voicemail/BroadworksBackendConnector.test.js.map +1 -1
- package/dist/Voicemail/UcmBackendConnector.js +84 -85
- package/dist/Voicemail/UcmBackendConnector.js.map +1 -1
- package/dist/Voicemail/UcmBackendConnector.test.js +72 -72
- package/dist/Voicemail/UcmBackendConnector.test.js.map +1 -1
- package/dist/Voicemail/Voicemail.js +58 -61
- package/dist/Voicemail/Voicemail.js.map +1 -1
- package/dist/Voicemail/Voicemail.test.js +20 -20
- package/dist/Voicemail/Voicemail.test.js.map +1 -1
- package/dist/Voicemail/WxCallBackendConnector.js +116 -117
- package/dist/Voicemail/WxCallBackendConnector.js.map +1 -1
- package/dist/Voicemail/WxCallBackendConnector.test.js +140 -140
- package/dist/Voicemail/WxCallBackendConnector.test.js.map +1 -1
- package/dist/common/Utils.js +195 -165
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +432 -183
- package/dist/common/Utils.test.js.map +1 -1
- package/dist/common/constants.js +3 -1
- package/dist/common/constants.js.map +1 -1
- package/dist/common/testUtil.js +3 -3
- package/dist/common/testUtil.js.map +1 -1
- package/dist/module/CallSettings/UcmBackendConnector.js +20 -6
- package/dist/module/CallingClient/calling/call.js +59 -38
- package/dist/module/CallingClient/constants.js +3 -0
- package/dist/module/CallingClient/registration/register.js +82 -2
- package/dist/module/common/Utils.js +27 -3
- package/dist/module/common/constants.js +2 -0
- package/dist/types/CallSettings/UcmBackendConnector.d.ts +1 -0
- package/dist/types/CallSettings/UcmBackendConnector.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/call.d.ts +4 -0
- package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
- package/dist/types/CallingClient/constants.d.ts +3 -0
- package/dist/types/CallingClient/constants.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/register.d.ts +4 -0
- package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/types.d.ts +6 -0
- package/dist/types/CallingClient/registration/types.d.ts.map +1 -1
- package/dist/types/SDKConnector/types.d.ts +6 -0
- package/dist/types/SDKConnector/types.d.ts.map +1 -1
- package/dist/types/common/Utils.d.ts +1 -1
- package/dist/types/common/Utils.d.ts.map +1 -1
- package/dist/types/common/constants.d.ts +2 -0
- package/dist/types/common/constants.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -21,10 +21,9 @@ var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/
|
|
|
21
21
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
22
22
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
|
|
23
23
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
|
|
24
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/assertThisInitialized"));
|
|
25
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));
|
|
26
24
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
|
|
27
25
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));
|
|
26
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));
|
|
28
27
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
|
29
28
|
var Media = _interopRequireWildcard(require("@webex/internal-media-core"));
|
|
30
29
|
var _asyncMutex = require("async-mutex");
|
|
@@ -42,11 +41,11 @@ var _line = _interopRequireDefault(require("./line"));
|
|
|
42
41
|
var _types4 = require("../Metrics/types");
|
|
43
42
|
var _Metrics = require("../Metrics");
|
|
44
43
|
var _windowsChromiumIceWarmupUtils = _interopRequireDefault(require("./windowsChromiumIceWarmupUtils"));
|
|
45
|
-
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
|
|
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 _t7 in e) "default" !== _t7 && {}.hasOwnProperty.call(e, _t7) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t7)) && (i.get || i.set) ? o(f, _t7, i) : f[_t7] = e[_t7]); return f; })(e, t); }
|
|
46
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; } } }; }
|
|
47
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; } }
|
|
48
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; }
|
|
49
|
-
function
|
|
48
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
50
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.
|
|
@@ -59,8 +58,6 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
59
58
|
* ```
|
|
60
59
|
*/
|
|
61
60
|
var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
62
|
-
(0, _inherits2.default)(CallingClient, _Eventing);
|
|
63
|
-
var _super = _createSuper(CallingClient);
|
|
64
61
|
/**
|
|
65
62
|
* @ignore
|
|
66
63
|
*/
|
|
@@ -68,33 +65,33 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
68
65
|
var _this$sdkConfig, _this$sdkConfig$servi, _this$sdkConfig2, _this$sdkConfig2$logg;
|
|
69
66
|
var _this;
|
|
70
67
|
(0, _classCallCheck2.default)(this, CallingClient);
|
|
71
|
-
_this =
|
|
72
|
-
(0, _defineProperty2.default)(
|
|
73
|
-
(0, _defineProperty2.default)(
|
|
74
|
-
(0, _defineProperty2.default)(
|
|
75
|
-
(0, _defineProperty2.default)(
|
|
76
|
-
(0, _defineProperty2.default)(
|
|
77
|
-
(0, _defineProperty2.default)(
|
|
78
|
-
(0, _defineProperty2.default)(
|
|
79
|
-
(0, _defineProperty2.default)(
|
|
80
|
-
(0, _defineProperty2.default)(
|
|
81
|
-
(0, _defineProperty2.default)(
|
|
82
|
-
(0, _defineProperty2.default)(
|
|
83
|
-
(0, _defineProperty2.default)(
|
|
84
|
-
(0, _defineProperty2.default)(
|
|
85
|
-
(0, _defineProperty2.default)(
|
|
86
|
-
(0, _defineProperty2.default)(
|
|
87
|
-
(0, _defineProperty2.default)(
|
|
88
|
-
(0, _defineProperty2.default)(
|
|
89
|
-
(0, _defineProperty2.default)(
|
|
68
|
+
_this = _callSuper(this, CallingClient);
|
|
69
|
+
(0, _defineProperty2.default)(_this, "sdkConnector", void 0);
|
|
70
|
+
(0, _defineProperty2.default)(_this, "webex", void 0);
|
|
71
|
+
(0, _defineProperty2.default)(_this, "mutex", void 0);
|
|
72
|
+
(0, _defineProperty2.default)(_this, "callManager", void 0);
|
|
73
|
+
(0, _defineProperty2.default)(_this, "metricManager", void 0);
|
|
74
|
+
(0, _defineProperty2.default)(_this, "sdkConfig", void 0);
|
|
75
|
+
(0, _defineProperty2.default)(_this, "primaryMobiusUris", void 0);
|
|
76
|
+
(0, _defineProperty2.default)(_this, "backupMobiusUris", void 0);
|
|
77
|
+
(0, _defineProperty2.default)(_this, "mobiusClusters", void 0);
|
|
78
|
+
(0, _defineProperty2.default)(_this, "mobiusHost", void 0);
|
|
79
|
+
(0, _defineProperty2.default)(_this, "mediaEngine", void 0);
|
|
80
|
+
(0, _defineProperty2.default)(_this, "lineDict", {});
|
|
81
|
+
(0, _defineProperty2.default)(_this, "isNetworkDown", false);
|
|
82
|
+
(0, _defineProperty2.default)(_this, "networkDownTimestamp", '');
|
|
83
|
+
(0, _defineProperty2.default)(_this, "networkUpTimestamp", '');
|
|
84
|
+
(0, _defineProperty2.default)(_this, "mercuryDownTimestamp", '');
|
|
85
|
+
(0, _defineProperty2.default)(_this, "mercuryUpTimestamp", '');
|
|
86
|
+
(0, _defineProperty2.default)(_this, "handleNetworkOffline", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
90
87
|
var line;
|
|
91
|
-
return _regenerator.default.wrap(function
|
|
88
|
+
return _regenerator.default.wrap(function (_context) {
|
|
92
89
|
while (1) switch (_context.prev = _context.next) {
|
|
93
90
|
case 0:
|
|
94
91
|
_this.networkDownTimestamp = new Date().toISOString();
|
|
95
|
-
_context.next =
|
|
92
|
+
_context.next = 1;
|
|
96
93
|
return _this.checkNetworkReachability();
|
|
97
|
-
case
|
|
94
|
+
case 1:
|
|
98
95
|
_this.isNetworkDown = !_context.sent;
|
|
99
96
|
_Logger.default.warn("Network has gone down, wait for it to come back up", {
|
|
100
97
|
file: _constants2.CALLING_CLIENT_FILE,
|
|
@@ -104,21 +101,21 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
104
101
|
line = (0, _values.default)(_this.lineDict)[0];
|
|
105
102
|
line.registration.clearKeepaliveTimer();
|
|
106
103
|
}
|
|
107
|
-
case
|
|
104
|
+
case 2:
|
|
108
105
|
case "end":
|
|
109
106
|
return _context.stop();
|
|
110
107
|
}
|
|
111
108
|
}, _callee);
|
|
112
109
|
})));
|
|
113
110
|
// Wondering if we should keep this for timestamp recording purpose
|
|
114
|
-
(0, _defineProperty2.default)(
|
|
111
|
+
(0, _defineProperty2.default)(_this, "handleNetworkOnline", function () {
|
|
115
112
|
_Logger.default.info(_constants.METHOD_START_MESSAGE, {
|
|
116
113
|
file: _constants2.CALLING_CLIENT_FILE,
|
|
117
114
|
method: _constants2.METHODS.NETWORK_ONLINE
|
|
118
115
|
});
|
|
119
116
|
_this.networkUpTimestamp = new Date().toISOString();
|
|
120
117
|
});
|
|
121
|
-
(0, _defineProperty2.default)(
|
|
118
|
+
(0, _defineProperty2.default)(_this, "handleMercuryOffline", function () {
|
|
122
119
|
_Logger.default.warn("Mercury down, waiting for connection to be up", {
|
|
123
120
|
file: _constants2.CALLING_CLIENT_FILE,
|
|
124
121
|
method: _constants2.METHODS.MERCURY_OFFLINE
|
|
@@ -126,9 +123,9 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
126
123
|
_this.mercuryDownTimestamp = new Date().toISOString();
|
|
127
124
|
_this.metricManager.submitConnectionMetrics(_types4.METRIC_EVENT.CONNECTION_ERROR, _types4.CONNECTION_ACTION.MERCURY_DOWN, _types4.METRIC_TYPE.BEHAVIORAL, _this.mercuryDownTimestamp, _this.mercuryUpTimestamp);
|
|
128
125
|
});
|
|
129
|
-
(0, _defineProperty2.default)(
|
|
126
|
+
(0, _defineProperty2.default)(_this, "handleMercuryOnline", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
130
127
|
var callCheckInterval;
|
|
131
|
-
return _regenerator.default.wrap(function
|
|
128
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
132
129
|
while (1) switch (_context3.prev = _context3.next) {
|
|
133
130
|
case 0:
|
|
134
131
|
_Logger.default.info(_constants.METHOD_START_MESSAGE, {
|
|
@@ -137,58 +134,58 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
137
134
|
});
|
|
138
135
|
_this.mercuryUpTimestamp = new Date().toISOString();
|
|
139
136
|
if (!_this.isNetworkDown) {
|
|
140
|
-
_context3.next =
|
|
137
|
+
_context3.next = 2;
|
|
141
138
|
break;
|
|
142
139
|
}
|
|
143
140
|
callCheckInterval = setInterval(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
144
141
|
var line;
|
|
145
|
-
return _regenerator.default.wrap(function
|
|
142
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
146
143
|
while (1) switch (_context2.prev = _context2.next) {
|
|
147
144
|
case 0:
|
|
148
145
|
if ((0, _keys.default)(_this.callManager.getActiveCalls()).length) {
|
|
149
|
-
_context2.next =
|
|
146
|
+
_context2.next = 3;
|
|
150
147
|
break;
|
|
151
148
|
}
|
|
152
149
|
clearInterval(callCheckInterval);
|
|
153
150
|
line = (0, _values.default)(_this.lineDict)[0];
|
|
154
151
|
if (!(line.getStatus() !== _types3.RegistrationStatus.IDLE)) {
|
|
155
|
-
_context2.next =
|
|
152
|
+
_context2.next = 2;
|
|
156
153
|
break;
|
|
157
154
|
}
|
|
158
|
-
_context2.next =
|
|
155
|
+
_context2.next = 1;
|
|
159
156
|
return line.registration.handleConnectionRestoration(_this.isNetworkDown);
|
|
160
|
-
case
|
|
157
|
+
case 1:
|
|
161
158
|
_this.isNetworkDown = _context2.sent;
|
|
162
|
-
_context2.next =
|
|
159
|
+
_context2.next = 3;
|
|
163
160
|
break;
|
|
164
|
-
case
|
|
161
|
+
case 2:
|
|
165
162
|
_this.isNetworkDown = false;
|
|
166
|
-
case
|
|
163
|
+
case 3:
|
|
167
164
|
case "end":
|
|
168
165
|
return _context2.stop();
|
|
169
166
|
}
|
|
170
167
|
}, _callee2);
|
|
171
168
|
})), _constants2.NETWORK_FLAP_TIMEOUT);
|
|
172
169
|
if (!(0, _keys.default)(_this.callManager.getActiveCalls()).length) {
|
|
173
|
-
_context3.next =
|
|
170
|
+
_context3.next = 1;
|
|
174
171
|
break;
|
|
175
172
|
}
|
|
176
|
-
_context3.next =
|
|
173
|
+
_context3.next = 1;
|
|
177
174
|
return _this.checkCallStatus();
|
|
178
|
-
case
|
|
175
|
+
case 1:
|
|
179
176
|
_this.metricManager.submitConnectionMetrics(_types4.METRIC_EVENT.CONNECTION_ERROR, _types4.CONNECTION_ACTION.NETWORK_FLAP, _types4.METRIC_TYPE.BEHAVIORAL, _this.networkDownTimestamp, _this.networkUpTimestamp);
|
|
180
|
-
_context3.next =
|
|
177
|
+
_context3.next = 4;
|
|
181
178
|
break;
|
|
182
|
-
case
|
|
179
|
+
case 2:
|
|
183
180
|
if (!(0, _keys.default)(_this.callManager.getActiveCalls()).length) {
|
|
184
|
-
_context3.next =
|
|
181
|
+
_context3.next = 3;
|
|
185
182
|
break;
|
|
186
183
|
}
|
|
187
|
-
_context3.next =
|
|
184
|
+
_context3.next = 3;
|
|
188
185
|
return _this.checkCallStatus();
|
|
189
|
-
case
|
|
186
|
+
case 3:
|
|
190
187
|
_this.metricManager.submitConnectionMetrics(_types4.METRIC_EVENT.CONNECTION_ERROR, _types4.CONNECTION_ACTION.MERCURY_UP, _types4.METRIC_TYPE.BEHAVIORAL, _this.mercuryDownTimestamp, _this.mercuryUpTimestamp);
|
|
191
|
-
case
|
|
188
|
+
case 4:
|
|
192
189
|
case "end":
|
|
193
190
|
return _context3.stop();
|
|
194
191
|
}
|
|
@@ -201,9 +198,9 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
201
198
|
* will be attempted here on receiving a notification from callManager that all
|
|
202
199
|
* calls are cleaned up.
|
|
203
200
|
*/
|
|
204
|
-
(0, _defineProperty2.default)(
|
|
201
|
+
(0, _defineProperty2.default)(_this, "callsClearedHandler", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
205
202
|
var registration;
|
|
206
|
-
return _regenerator.default.wrap(function
|
|
203
|
+
return _regenerator.default.wrap(function (_context5) {
|
|
207
204
|
while (1) switch (_context5.prev = _context5.next) {
|
|
208
205
|
case 0:
|
|
209
206
|
_Logger.default.info(_constants.METHOD_START_MESSAGE, {
|
|
@@ -214,31 +211,31 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
214
211
|
// it will change once we have proper lineId and multiple lines as well
|
|
215
212
|
registration = (0, _values.default)(_this.lineDict)[0].registration;
|
|
216
213
|
if (registration.isDeviceRegistered()) {
|
|
217
|
-
_context5.next =
|
|
214
|
+
_context5.next = 1;
|
|
218
215
|
break;
|
|
219
216
|
}
|
|
220
|
-
_context5.next =
|
|
217
|
+
_context5.next = 1;
|
|
221
218
|
return _this.mutex.runExclusive(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
222
|
-
return _regenerator.default.wrap(function
|
|
219
|
+
return _regenerator.default.wrap(function (_context4) {
|
|
223
220
|
while (1) switch (_context4.prev = _context4.next) {
|
|
224
221
|
case 0:
|
|
225
222
|
if (!registration.isReconnectPending()) {
|
|
226
|
-
_context4.next =
|
|
223
|
+
_context4.next = 1;
|
|
227
224
|
break;
|
|
228
225
|
}
|
|
229
226
|
_Logger.default.info('All calls cleared, reconnecting', {
|
|
230
227
|
file: _constants2.CALLING_CLIENT_FILE,
|
|
231
228
|
method: _constants2.CALLS_CLEARED_HANDLER_UTIL
|
|
232
229
|
});
|
|
233
|
-
_context4.next =
|
|
230
|
+
_context4.next = 1;
|
|
234
231
|
return registration.reconnectOnFailure(_constants2.CALLS_CLEARED_HANDLER_UTIL);
|
|
235
|
-
case
|
|
232
|
+
case 1:
|
|
236
233
|
case "end":
|
|
237
234
|
return _context4.stop();
|
|
238
235
|
}
|
|
239
236
|
}, _callee4);
|
|
240
237
|
})));
|
|
241
|
-
case
|
|
238
|
+
case 1:
|
|
242
239
|
case "end":
|
|
243
240
|
return _context5.stop();
|
|
244
241
|
}
|
|
@@ -326,61 +323,62 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
326
323
|
* @returns A promise that resolves when the initialization is complete.
|
|
327
324
|
* @ignore
|
|
328
325
|
*/
|
|
329
|
-
(0,
|
|
326
|
+
(0, _inherits2.default)(CallingClient, _Eventing);
|
|
327
|
+
return (0, _createClass2.default)(CallingClient, [{
|
|
330
328
|
key: "init",
|
|
331
329
|
value: (function () {
|
|
332
330
|
var _init = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
333
331
|
var _window, _window$navigator;
|
|
334
|
-
var ua;
|
|
335
|
-
return _regenerator.default.wrap(function
|
|
332
|
+
var ua, _t;
|
|
333
|
+
return _regenerator.default.wrap(function (_context6) {
|
|
336
334
|
while (1) switch (_context6.prev = _context6.next) {
|
|
337
335
|
case 0:
|
|
338
336
|
if (!(typeof window !== 'undefined' && (_window = window) !== null && _window !== void 0 && (_window$navigator = _window.navigator) !== null && _window$navigator !== void 0 && _window$navigator.userAgent)) {
|
|
339
|
-
_context6.next =
|
|
337
|
+
_context6.next = 4;
|
|
340
338
|
break;
|
|
341
339
|
}
|
|
342
340
|
ua = window.navigator.userAgent;
|
|
343
341
|
if (!ua.toLowerCase().includes('windows')) {
|
|
344
|
-
_context6.next =
|
|
342
|
+
_context6.next = 4;
|
|
345
343
|
break;
|
|
346
344
|
}
|
|
347
345
|
_Logger.default.info('Starting ICE warmup for Windows Chromium based browser', {
|
|
348
346
|
file: _constants2.CALLING_CLIENT_FILE,
|
|
349
347
|
method: 'init'
|
|
350
348
|
});
|
|
351
|
-
_context6.prev =
|
|
352
|
-
_context6.next =
|
|
349
|
+
_context6.prev = 1;
|
|
350
|
+
_context6.next = 2;
|
|
353
351
|
return (0, _windowsChromiumIceWarmupUtils.default)({
|
|
354
352
|
iceServers: [],
|
|
355
353
|
timeoutMs: 1000
|
|
356
354
|
});
|
|
357
|
-
case
|
|
355
|
+
case 2:
|
|
358
356
|
_Logger.default.info("ICE warmup completed", {
|
|
359
357
|
file: _constants2.CALLING_CLIENT_FILE,
|
|
360
358
|
method: 'init'
|
|
361
359
|
});
|
|
362
|
-
_context6.next =
|
|
360
|
+
_context6.next = 4;
|
|
363
361
|
break;
|
|
364
|
-
case
|
|
365
|
-
_context6.prev =
|
|
366
|
-
|
|
367
|
-
_Logger.default.warn("ICE warmup failed: ".concat(
|
|
362
|
+
case 3:
|
|
363
|
+
_context6.prev = 3;
|
|
364
|
+
_t = _context6["catch"](1);
|
|
365
|
+
_Logger.default.warn("ICE warmup failed: ".concat(_t), {
|
|
368
366
|
file: _constants2.CALLING_CLIENT_FILE,
|
|
369
367
|
method: 'init'
|
|
370
368
|
});
|
|
371
|
-
case
|
|
372
|
-
_context6.next =
|
|
369
|
+
case 4:
|
|
370
|
+
_context6.next = 5;
|
|
373
371
|
return this.getMobiusServers();
|
|
374
|
-
case
|
|
375
|
-
_context6.next =
|
|
372
|
+
case 5:
|
|
373
|
+
_context6.next = 6;
|
|
376
374
|
return this.createLine();
|
|
377
|
-
case
|
|
375
|
+
case 6:
|
|
378
376
|
this.setupNetworkEventListeners();
|
|
379
|
-
case
|
|
377
|
+
case 7:
|
|
380
378
|
case "end":
|
|
381
379
|
return _context6.stop();
|
|
382
380
|
}
|
|
383
|
-
}, _callee6, this, [[
|
|
381
|
+
}, _callee6, this, [[1, 3]]);
|
|
384
382
|
}));
|
|
385
383
|
function init() {
|
|
386
384
|
return _init.apply(this, arguments);
|
|
@@ -395,8 +393,8 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
395
393
|
key: "checkNetworkReachability",
|
|
396
394
|
value: (function () {
|
|
397
395
|
var _checkNetworkReachability = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7() {
|
|
398
|
-
var controller, timeoutId;
|
|
399
|
-
return _regenerator.default.wrap(function
|
|
396
|
+
var controller, timeoutId, _t2;
|
|
397
|
+
return _regenerator.default.wrap(function (_context7) {
|
|
400
398
|
while (1) switch (_context7.prev = _context7.next) {
|
|
401
399
|
case 0:
|
|
402
400
|
_context7.prev = 0;
|
|
@@ -405,29 +403,29 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
405
403
|
return controller.abort();
|
|
406
404
|
}, 3000); // Using a common connectivity check endpoint that returns 204 with minimal payload.
|
|
407
405
|
// no-cors mode yields an opaque response but a successful fetch implies reachability.
|
|
408
|
-
_context7.next =
|
|
406
|
+
_context7.next = 1;
|
|
409
407
|
return fetch('https://www.google.com/generate_204', {
|
|
410
408
|
method: 'GET',
|
|
411
409
|
cache: 'no-cache',
|
|
412
410
|
mode: 'no-cors',
|
|
413
411
|
signal: controller.signal
|
|
414
412
|
});
|
|
415
|
-
case
|
|
413
|
+
case 1:
|
|
416
414
|
clearTimeout(timeoutId);
|
|
417
415
|
return _context7.abrupt("return", true);
|
|
418
|
-
case
|
|
419
|
-
_context7.prev =
|
|
420
|
-
|
|
421
|
-
_Logger.default.warn("Network connectivity probe failed: ".concat(
|
|
416
|
+
case 2:
|
|
417
|
+
_context7.prev = 2;
|
|
418
|
+
_t2 = _context7["catch"](0);
|
|
419
|
+
_Logger.default.warn("Network connectivity probe failed: ".concat(_t2), {
|
|
422
420
|
file: _constants2.CALLING_CLIENT_FILE,
|
|
423
421
|
method: 'pingExternal'
|
|
424
422
|
});
|
|
425
423
|
return _context7.abrupt("return", false);
|
|
426
|
-
case
|
|
424
|
+
case 3:
|
|
427
425
|
case "end":
|
|
428
426
|
return _context7.stop();
|
|
429
427
|
}
|
|
430
|
-
}, _callee7, null, [[0,
|
|
428
|
+
}, _callee7, null, [[0, 2]]);
|
|
431
429
|
}));
|
|
432
430
|
function checkNetworkReachability() {
|
|
433
431
|
return _checkNetworkReachability.apply(this, arguments);
|
|
@@ -438,8 +436,8 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
438
436
|
key: "checkCallStatus",
|
|
439
437
|
value: function () {
|
|
440
438
|
var _checkCallStatus = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
441
|
-
var loggerContext, calls, _iterator, _step, _loop;
|
|
442
|
-
return _regenerator.default.wrap(function
|
|
439
|
+
var loggerContext, calls, _iterator, _step, _loop, _t3;
|
|
440
|
+
return _regenerator.default.wrap(function (_context9) {
|
|
443
441
|
while (1) switch (_context9.prev = _context9.next) {
|
|
444
442
|
case 0:
|
|
445
443
|
loggerContext = {
|
|
@@ -448,10 +446,10 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
448
446
|
};
|
|
449
447
|
calls = (0, _values.default)(this.callManager.getActiveCalls());
|
|
450
448
|
_iterator = _createForOfIteratorHelper(calls);
|
|
451
|
-
_context9.prev =
|
|
449
|
+
_context9.prev = 1;
|
|
452
450
|
_loop = /*#__PURE__*/_regenerator.default.mark(function _loop() {
|
|
453
451
|
var call;
|
|
454
|
-
return _regenerator.default.wrap(function
|
|
452
|
+
return _regenerator.default.wrap(function (_context8) {
|
|
455
453
|
while (1) switch (_context8.prev = _context8.next) {
|
|
456
454
|
case 0:
|
|
457
455
|
call = _step.value;
|
|
@@ -467,38 +465,38 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
467
465
|
type: 'E_SEND_CALL_DISCONNECT'
|
|
468
466
|
});
|
|
469
467
|
});
|
|
470
|
-
case
|
|
468
|
+
case 1:
|
|
471
469
|
case "end":
|
|
472
470
|
return _context8.stop();
|
|
473
471
|
}
|
|
474
472
|
}, _loop);
|
|
475
473
|
});
|
|
476
474
|
_iterator.s();
|
|
477
|
-
case
|
|
475
|
+
case 2:
|
|
478
476
|
if ((_step = _iterator.n()).done) {
|
|
479
|
-
_context9.next =
|
|
477
|
+
_context9.next = 4;
|
|
480
478
|
break;
|
|
481
479
|
}
|
|
482
|
-
return _context9.delegateYield(_loop(), "t0",
|
|
483
|
-
case
|
|
484
|
-
_context9.next =
|
|
480
|
+
return _context9.delegateYield(_loop(), "t0", 3);
|
|
481
|
+
case 3:
|
|
482
|
+
_context9.next = 2;
|
|
485
483
|
break;
|
|
486
|
-
case
|
|
487
|
-
_context9.next =
|
|
484
|
+
case 4:
|
|
485
|
+
_context9.next = 6;
|
|
488
486
|
break;
|
|
489
|
-
case
|
|
490
|
-
_context9.prev =
|
|
491
|
-
|
|
492
|
-
_iterator.e(
|
|
493
|
-
case
|
|
494
|
-
_context9.prev =
|
|
487
|
+
case 5:
|
|
488
|
+
_context9.prev = 5;
|
|
489
|
+
_t3 = _context9["catch"](1);
|
|
490
|
+
_iterator.e(_t3);
|
|
491
|
+
case 6:
|
|
492
|
+
_context9.prev = 6;
|
|
495
493
|
_iterator.f();
|
|
496
|
-
return _context9.finish(
|
|
497
|
-
case
|
|
494
|
+
return _context9.finish(6);
|
|
495
|
+
case 7:
|
|
498
496
|
case "end":
|
|
499
497
|
return _context9.stop();
|
|
500
498
|
}
|
|
501
|
-
}, _callee8, this, [[
|
|
499
|
+
}, _callee8, this, [[1, 5, 6, 7]]);
|
|
502
500
|
}));
|
|
503
501
|
function checkCallStatus() {
|
|
504
502
|
return _checkCallStatus.apply(this, arguments);
|
|
@@ -529,8 +527,8 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
529
527
|
value: (function () {
|
|
530
528
|
var _getClientRegionInfo = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
531
529
|
var _this3 = this;
|
|
532
|
-
var abort, regionInfo, _response$headers, _response$headers$tra, _response$headers2, response, clientRegionInfo;
|
|
533
|
-
return _regenerator.default.wrap(function
|
|
530
|
+
var abort, regionInfo, _response$headers, _response$headers$tra, _response$headers2, response, clientRegionInfo, _t4;
|
|
531
|
+
return _regenerator.default.wrap(function (_context0) {
|
|
534
532
|
while (1) switch (_context0.prev = _context0.next) {
|
|
535
533
|
case 0:
|
|
536
534
|
_Logger.default.info(_constants.METHOD_START_MESSAGE, {
|
|
@@ -538,15 +536,15 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
538
536
|
method: _constants2.METHODS.GET_CLIENT_REGION_INFO
|
|
539
537
|
});
|
|
540
538
|
regionInfo = {};
|
|
541
|
-
_context0.prev =
|
|
542
|
-
_context0.next =
|
|
539
|
+
_context0.prev = 1;
|
|
540
|
+
_context0.next = 2;
|
|
543
541
|
return this.webex.request({
|
|
544
542
|
uri: "".concat(_constants2.DISCOVERY_URL),
|
|
545
543
|
method: _types3.HTTP_METHODS.GET,
|
|
546
544
|
addAuthHeader: false,
|
|
547
545
|
headers: (0, _defineProperty2.default)({}, _constants2.SPARK_USER_AGENT, null)
|
|
548
546
|
});
|
|
549
|
-
case
|
|
547
|
+
case 2:
|
|
550
548
|
response = _context0.sent;
|
|
551
549
|
clientRegionInfo = response.body;
|
|
552
550
|
regionInfo.clientRegion = (clientRegionInfo === null || clientRegionInfo === void 0 ? void 0 : clientRegionInfo.clientRegion) || '';
|
|
@@ -556,45 +554,45 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
556
554
|
method: _constants2.METHODS.GET_CLIENT_REGION_INFO
|
|
557
555
|
});
|
|
558
556
|
this.metricManager.submitRegionInfoMetric(_types4.METRIC_EVENT.MOBIUS_DISCOVERY, _types4.MOBIUS_SERVER_ACTION.REGION_INFO, _types4.METRIC_TYPE.BEHAVIORAL, this.mobiusHost, clientRegionInfo.clientRegion, clientRegionInfo.countryCode, (_response$headers$tra = response === null || response === void 0 ? void 0 : (_response$headers2 = response.headers) === null || _response$headers2 === void 0 ? void 0 : _response$headers2.trackingid) !== null && _response$headers$tra !== void 0 ? _response$headers$tra : '');
|
|
559
|
-
_context0.next =
|
|
557
|
+
_context0.next = 6;
|
|
560
558
|
break;
|
|
561
|
-
case
|
|
562
|
-
_context0.prev =
|
|
563
|
-
|
|
564
|
-
_Logger.default.error("Failed to get client region info: ".concat((0, _stringify.default)(
|
|
559
|
+
case 3:
|
|
560
|
+
_context0.prev = 3;
|
|
561
|
+
_t4 = _context0["catch"](1);
|
|
562
|
+
_Logger.default.error("Failed to get client region info: ".concat((0, _stringify.default)(_t4)), {
|
|
565
563
|
method: _constants2.METHODS.GET_CLIENT_REGION_INFO,
|
|
566
564
|
file: _constants2.CALLING_CLIENT_FILE
|
|
567
565
|
});
|
|
568
566
|
|
|
569
567
|
// eslint-disable-next-line no-await-in-loop
|
|
570
|
-
_context0.next =
|
|
571
|
-
return (0, _Utils.handleCallingClientErrors)(
|
|
568
|
+
_context0.next = 4;
|
|
569
|
+
return (0, _Utils.handleCallingClientErrors)(_t4, function (clientError) {
|
|
572
570
|
var _headers$trackingId, _headers2;
|
|
573
|
-
_this3.metricManager.submitRegistrationMetric(_types4.METRIC_EVENT.REGISTRATION_ERROR, _types4.REG_ACTION.REGISTER, _types4.METRIC_TYPE.BEHAVIORAL, _constants2.GET_MOBIUS_SERVERS_UTIL, 'UNKNOWN', (_headers$trackingId = (_headers2 =
|
|
571
|
+
_this3.metricManager.submitRegistrationMetric(_types4.METRIC_EVENT.REGISTRATION_ERROR, _types4.REG_ACTION.REGISTER, _types4.METRIC_TYPE.BEHAVIORAL, _constants2.GET_MOBIUS_SERVERS_UTIL, 'UNKNOWN', (_headers$trackingId = (_headers2 = _t4.headers) === null || _headers2 === void 0 ? void 0 : _headers2.trackingId) !== null && _headers$trackingId !== void 0 ? _headers$trackingId : '', undefined, clientError);
|
|
574
572
|
_this3.emit(_types2.CALLING_CLIENT_EVENT_KEYS.ERROR, clientError);
|
|
575
573
|
}, {
|
|
576
574
|
method: _constants2.GET_MOBIUS_SERVERS_UTIL,
|
|
577
575
|
file: _constants2.CALLING_CLIENT_FILE
|
|
578
576
|
});
|
|
579
|
-
case
|
|
577
|
+
case 4:
|
|
580
578
|
abort = _context0.sent;
|
|
581
579
|
regionInfo.clientRegion = '';
|
|
582
580
|
regionInfo.countryCode = '';
|
|
583
581
|
if (!abort) {
|
|
584
|
-
_context0.next =
|
|
582
|
+
_context0.next = 6;
|
|
585
583
|
break;
|
|
586
584
|
}
|
|
587
|
-
_context0.next =
|
|
585
|
+
_context0.next = 5;
|
|
588
586
|
return (0, _Utils.uploadLogs)();
|
|
589
|
-
case
|
|
587
|
+
case 5:
|
|
590
588
|
return _context0.abrupt("return", regionInfo);
|
|
591
|
-
case
|
|
589
|
+
case 6:
|
|
592
590
|
return _context0.abrupt("return", regionInfo);
|
|
593
|
-
case
|
|
591
|
+
case 7:
|
|
594
592
|
case "end":
|
|
595
593
|
return _context0.stop();
|
|
596
594
|
}
|
|
597
|
-
}, _callee9, this, [[
|
|
595
|
+
}, _callee9, this, [[1, 3]]);
|
|
598
596
|
}));
|
|
599
597
|
function getClientRegionInfo() {
|
|
600
598
|
return _getClientRegionInfo.apply(this, arguments);
|
|
@@ -614,8 +612,8 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
614
612
|
_this$sdkConfig4,
|
|
615
613
|
_this$sdkConfig4$disc,
|
|
616
614
|
_this4 = this;
|
|
617
|
-
var useDefault, clientRegion, countryCode, _this$sdkConfig5, _this$sdkConfig5$disc, _this$sdkConfig6, _this$sdkConfig6$disc, _this$webex$internal$, regionInfo, _iterator2, _step2, _loop2, _ret;
|
|
618
|
-
return _regenerator.default.wrap(function
|
|
615
|
+
var useDefault, clientRegion, countryCode, _this$sdkConfig5, _this$sdkConfig5$disc, _this$sdkConfig6, _this$sdkConfig6$disc, _this$webex$internal$, regionInfo, _iterator2, _step2, _loop2, _ret, _t6;
|
|
616
|
+
return _regenerator.default.wrap(function (_context10) {
|
|
619
617
|
while (1) switch (_context10.prev = _context10.next) {
|
|
620
618
|
case 0:
|
|
621
619
|
_Logger.default.info(_constants.METHOD_START_MESSAGE, {
|
|
@@ -631,7 +629,7 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
631
629
|
*/
|
|
632
630
|
useDefault = false;
|
|
633
631
|
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)) {
|
|
634
|
-
_context10.next =
|
|
632
|
+
_context10.next = 1;
|
|
635
633
|
break;
|
|
636
634
|
}
|
|
637
635
|
_Logger.default.log('Updating region and country from the SDK config', {
|
|
@@ -641,22 +639,22 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
641
639
|
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;
|
|
642
640
|
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;
|
|
643
641
|
this.mobiusHost = ((_this$webex$internal$ = this.webex.internal.services._serviceUrls) === null || _this$webex$internal$ === void 0 ? void 0 : _this$webex$internal$.mobius) || this.webex.internal.services.get(this.webex.internal.services._activeServices.mobius);
|
|
644
|
-
_context10.next =
|
|
642
|
+
_context10.next = 3;
|
|
645
643
|
break;
|
|
646
|
-
case
|
|
644
|
+
case 1:
|
|
647
645
|
_Logger.default.log('Updating region and country through Region discovery', {
|
|
648
646
|
file: _constants2.CALLING_CLIENT_FILE,
|
|
649
647
|
method: _constants2.GET_MOBIUS_SERVERS_UTIL
|
|
650
648
|
});
|
|
651
|
-
_context10.next =
|
|
649
|
+
_context10.next = 2;
|
|
652
650
|
return this.getClientRegionInfo();
|
|
653
|
-
case
|
|
651
|
+
case 2:
|
|
654
652
|
regionInfo = _context10.sent;
|
|
655
653
|
clientRegion = regionInfo.clientRegion;
|
|
656
654
|
countryCode = regionInfo.countryCode;
|
|
657
|
-
case
|
|
655
|
+
case 3:
|
|
658
656
|
if (!(clientRegion && countryCode)) {
|
|
659
|
-
_context10.next =
|
|
657
|
+
_context10.next = 12;
|
|
660
658
|
break;
|
|
661
659
|
}
|
|
662
660
|
_Logger.default.log("Found Region: ".concat(clientRegion, " and country: ").concat(countryCode, ", going to fetch Mobius server"), {
|
|
@@ -664,10 +662,10 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
664
662
|
method: _constants2.GET_MOBIUS_SERVERS_UTIL
|
|
665
663
|
});
|
|
666
664
|
_iterator2 = _createForOfIteratorHelper(this.mobiusClusters);
|
|
667
|
-
_context10.prev =
|
|
665
|
+
_context10.prev = 4;
|
|
668
666
|
_loop2 = /*#__PURE__*/_regenerator.default.mark(function _loop2() {
|
|
669
|
-
var mobius, _response$headers3, _response$headers$tra2, _response$headers4, response, mobiusServers, mobiusUris, abort;
|
|
670
|
-
return _regenerator.default.wrap(function
|
|
667
|
+
var mobius, _response$headers3, _response$headers$tra2, _response$headers4, response, mobiusServers, mobiusUris, abort, _t5;
|
|
668
|
+
return _regenerator.default.wrap(function (_context1) {
|
|
671
669
|
while (1) switch (_context1.prev = _context1.next) {
|
|
672
670
|
case 0:
|
|
673
671
|
mobius = _step2.value;
|
|
@@ -676,15 +674,15 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
676
674
|
} else {
|
|
677
675
|
_this4.mobiusHost = mobius;
|
|
678
676
|
}
|
|
679
|
-
_context1.prev =
|
|
680
|
-
_context1.next =
|
|
677
|
+
_context1.prev = 1;
|
|
678
|
+
_context1.next = 2;
|
|
681
679
|
return _this4.webex.request({
|
|
682
680
|
uri: "".concat(_this4.mobiusHost).concat(_constants2.URL_ENDPOINT, "?regionCode=").concat(clientRegion, "&countryCode=").concat(countryCode),
|
|
683
681
|
method: _types3.HTTP_METHODS.GET,
|
|
684
682
|
headers: (0, _defineProperty2.default)((0, _defineProperty2.default)({}, _constants2.CISCO_DEVICE_URL, _this4.webex.internal.device.url), _constants2.SPARK_USER_AGENT, _constants2.CALLING_USER_AGENT),
|
|
685
683
|
service: _types3.ALLOWED_SERVICES.MOBIUS
|
|
686
684
|
});
|
|
687
|
-
case
|
|
685
|
+
case 2:
|
|
688
686
|
response = _context1.sent;
|
|
689
687
|
_Logger.default.log("Mobius Server found for the region. Response trackingId: ".concat(response === null || response === void 0 ? void 0 : (_response$headers3 = response.headers) === null || _response$headers3 === void 0 ? void 0 : _response$headers3.trackingid), {
|
|
690
688
|
file: _constants2.CALLING_CLIENT_FILE,
|
|
@@ -702,77 +700,77 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
702
700
|
method: _constants2.GET_MOBIUS_SERVERS_UTIL
|
|
703
701
|
});
|
|
704
702
|
return _context1.abrupt("return", 0);
|
|
705
|
-
case
|
|
706
|
-
_context1.prev =
|
|
707
|
-
|
|
708
|
-
_Logger.default.error("Failed to get Mobius servers: ".concat((0, _stringify.default)(
|
|
703
|
+
case 3:
|
|
704
|
+
_context1.prev = 3;
|
|
705
|
+
_t5 = _context1["catch"](1);
|
|
706
|
+
_Logger.default.error("Failed to get Mobius servers: ".concat((0, _stringify.default)(_t5)), {
|
|
709
707
|
method: _constants2.METHODS.GET_MOBIUS_SERVERS,
|
|
710
708
|
file: _constants2.CALLING_CLIENT_FILE
|
|
711
709
|
});
|
|
712
710
|
|
|
713
711
|
// eslint-disable-next-line no-await-in-loop
|
|
714
|
-
_context1.next =
|
|
715
|
-
return (0, _Utils.handleCallingClientErrors)(
|
|
712
|
+
_context1.next = 4;
|
|
713
|
+
return (0, _Utils.handleCallingClientErrors)(_t5, function (clientError) {
|
|
716
714
|
var _headers$trackingId2, _headers4;
|
|
717
|
-
_this4.metricManager.submitRegistrationMetric(_types4.METRIC_EVENT.REGISTRATION_ERROR, _types4.REG_ACTION.REGISTER, _types4.METRIC_TYPE.BEHAVIORAL, _constants2.GET_MOBIUS_SERVERS_UTIL, 'UNKNOWN', (_headers$trackingId2 = (_headers4 =
|
|
715
|
+
_this4.metricManager.submitRegistrationMetric(_types4.METRIC_EVENT.REGISTRATION_ERROR, _types4.REG_ACTION.REGISTER, _types4.METRIC_TYPE.BEHAVIORAL, _constants2.GET_MOBIUS_SERVERS_UTIL, 'UNKNOWN', (_headers$trackingId2 = (_headers4 = _t5.headers) === null || _headers4 === void 0 ? void 0 : _headers4.trackingId) !== null && _headers$trackingId2 !== void 0 ? _headers$trackingId2 : '', undefined, clientError);
|
|
718
716
|
_this4.emit(_types2.CALLING_CLIENT_EVENT_KEYS.ERROR, clientError);
|
|
719
717
|
}, {
|
|
720
718
|
method: _constants2.GET_MOBIUS_SERVERS_UTIL,
|
|
721
719
|
file: _constants2.CALLING_CLIENT_FILE
|
|
722
720
|
});
|
|
723
|
-
case
|
|
721
|
+
case 4:
|
|
724
722
|
abort = _context1.sent;
|
|
725
723
|
if (!abort) {
|
|
726
|
-
_context1.next =
|
|
724
|
+
_context1.next = 6;
|
|
727
725
|
break;
|
|
728
726
|
}
|
|
729
727
|
useDefault = true;
|
|
730
728
|
// eslint-disable-next-line no-await-in-loop
|
|
731
|
-
_context1.next =
|
|
729
|
+
_context1.next = 5;
|
|
732
730
|
return (0, _Utils.uploadLogs)();
|
|
733
|
-
case
|
|
731
|
+
case 5:
|
|
734
732
|
return _context1.abrupt("return", 0);
|
|
735
|
-
case
|
|
733
|
+
case 6:
|
|
736
734
|
case "end":
|
|
737
735
|
return _context1.stop();
|
|
738
736
|
}
|
|
739
|
-
}, _loop2, null, [[
|
|
737
|
+
}, _loop2, null, [[1, 3]]);
|
|
740
738
|
});
|
|
741
739
|
_iterator2.s();
|
|
742
|
-
case
|
|
740
|
+
case 5:
|
|
743
741
|
if ((_step2 = _iterator2.n()).done) {
|
|
744
|
-
_context10.next =
|
|
742
|
+
_context10.next = 8;
|
|
745
743
|
break;
|
|
746
744
|
}
|
|
747
|
-
return _context10.delegateYield(_loop2(), "t0",
|
|
748
|
-
case
|
|
745
|
+
return _context10.delegateYield(_loop2(), "t0", 6);
|
|
746
|
+
case 6:
|
|
749
747
|
_ret = _context10.t0;
|
|
750
748
|
if (!(_ret === 0)) {
|
|
751
|
-
_context10.next =
|
|
749
|
+
_context10.next = 7;
|
|
752
750
|
break;
|
|
753
751
|
}
|
|
754
|
-
return _context10.abrupt("
|
|
755
|
-
case
|
|
756
|
-
_context10.next =
|
|
752
|
+
return _context10.abrupt("continue", 8);
|
|
753
|
+
case 7:
|
|
754
|
+
_context10.next = 5;
|
|
757
755
|
break;
|
|
758
|
-
case
|
|
759
|
-
_context10.next =
|
|
756
|
+
case 8:
|
|
757
|
+
_context10.next = 10;
|
|
760
758
|
break;
|
|
761
|
-
case
|
|
762
|
-
_context10.prev =
|
|
763
|
-
|
|
764
|
-
_iterator2.e(
|
|
765
|
-
case
|
|
766
|
-
_context10.prev =
|
|
759
|
+
case 9:
|
|
760
|
+
_context10.prev = 9;
|
|
761
|
+
_t6 = _context10["catch"](4);
|
|
762
|
+
_iterator2.e(_t6);
|
|
763
|
+
case 10:
|
|
764
|
+
_context10.prev = 10;
|
|
767
765
|
_iterator2.f();
|
|
768
|
-
return _context10.finish(
|
|
769
|
-
case
|
|
770
|
-
_context10.next =
|
|
766
|
+
return _context10.finish(10);
|
|
767
|
+
case 11:
|
|
768
|
+
_context10.next = 13;
|
|
771
769
|
break;
|
|
772
|
-
case
|
|
770
|
+
case 12:
|
|
773
771
|
/* Setting this to true because region info is possibly undefined */
|
|
774
772
|
useDefault = true;
|
|
775
|
-
case
|
|
773
|
+
case 13:
|
|
776
774
|
/* Use a default URL if Mobius discovery fails either because of region info failure
|
|
777
775
|
* or because the discovered Mobius couldn't be reached
|
|
778
776
|
*/
|
|
@@ -785,11 +783,11 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
785
783
|
this.mobiusHost = "https://".concat(this.mobiusClusters[0].host).concat(_constants2.API_V1);
|
|
786
784
|
this.primaryMobiusUris = ["".concat(this.mobiusHost).concat(_constants2.URL_ENDPOINT)];
|
|
787
785
|
}
|
|
788
|
-
case
|
|
786
|
+
case 14:
|
|
789
787
|
case "end":
|
|
790
788
|
return _context10.stop();
|
|
791
789
|
}
|
|
792
|
-
}, _callee0, this, [[
|
|
790
|
+
}, _callee0, this, [[4, 9, 10, 11]]);
|
|
793
791
|
}));
|
|
794
792
|
function getMobiusServers() {
|
|
795
793
|
return _getMobiusServers.apply(this, arguments);
|
|
@@ -842,31 +840,31 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
842
840
|
this.sdkConnector.registerListener(_types2.MOBIUS_EVENT_KEYS.CALL_SESSION_EVENT_INCLUSIVE, /*#__PURE__*/function () {
|
|
843
841
|
var _ref6 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1(event) {
|
|
844
842
|
var sessionArr, i;
|
|
845
|
-
return _regenerator.default.wrap(function
|
|
843
|
+
return _regenerator.default.wrap(function (_context11) {
|
|
846
844
|
while (1) switch (_context11.prev = _context11.next) {
|
|
847
845
|
case 0:
|
|
848
846
|
if (!(event && event.data.userSessions.userSessions)) {
|
|
849
|
-
_context11.next =
|
|
847
|
+
_context11.next = 2;
|
|
850
848
|
break;
|
|
851
849
|
}
|
|
852
850
|
sessionArr = event === null || event === void 0 ? void 0 : event.data.userSessions.userSessions;
|
|
853
851
|
if (!(sessionArr.length === 1)) {
|
|
854
|
-
_context11.next =
|
|
852
|
+
_context11.next = 1;
|
|
855
853
|
break;
|
|
856
854
|
}
|
|
857
855
|
if (!(sessionArr[0].sessionType !== _types2.SessionType.WEBEX_CALLING)) {
|
|
858
|
-
_context11.next =
|
|
856
|
+
_context11.next = 1;
|
|
859
857
|
break;
|
|
860
858
|
}
|
|
861
859
|
return _context11.abrupt("return");
|
|
862
|
-
case
|
|
860
|
+
case 1:
|
|
863
861
|
for (i = 0; i < sessionArr.length; i += 1) {
|
|
864
862
|
if (sessionArr[i].sessionType !== _types2.SessionType.WEBEX_CALLING) {
|
|
865
863
|
sessionArr.splice(i, 1);
|
|
866
864
|
}
|
|
867
865
|
}
|
|
868
866
|
_this5.emit(_types2.CALLING_CLIENT_EVENT_KEYS.USER_SESSION_INFO, event);
|
|
869
|
-
case
|
|
867
|
+
case 2:
|
|
870
868
|
case "end":
|
|
871
869
|
return _context11.stop();
|
|
872
870
|
}
|
|
@@ -888,7 +886,7 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
888
886
|
var _createLine = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10() {
|
|
889
887
|
var _this$sdkConfig7, _this$sdkConfig8;
|
|
890
888
|
var line;
|
|
891
|
-
return _regenerator.default.wrap(function
|
|
889
|
+
return _regenerator.default.wrap(function (_context12) {
|
|
892
890
|
while (1) switch (_context12.prev = _context12.next) {
|
|
893
891
|
case 0:
|
|
894
892
|
_Logger.default.info(_constants.METHOD_START_MESSAGE, {
|
|
@@ -897,7 +895,7 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
897
895
|
});
|
|
898
896
|
line = new _line.default(this.webex.internal.device.userId, this.webex.internal.device.url, this.mutex, this.primaryMobiusUris, this.backupMobiusUris, this.getLoggingLevel(), (_this$sdkConfig7 = this.sdkConfig) === null || _this$sdkConfig7 === void 0 ? void 0 : _this$sdkConfig7.serviceData, (_this$sdkConfig8 = this.sdkConfig) === null || _this$sdkConfig8 === void 0 ? void 0 : _this$sdkConfig8.jwe);
|
|
899
897
|
this.lineDict[line.lineId] = line;
|
|
900
|
-
case
|
|
898
|
+
case 1:
|
|
901
899
|
case "end":
|
|
902
900
|
return _context12.stop();
|
|
903
901
|
}
|
|
@@ -968,21 +966,21 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
968
966
|
value: (function () {
|
|
969
967
|
var _uploadLogs2 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11() {
|
|
970
968
|
var result;
|
|
971
|
-
return _regenerator.default.wrap(function
|
|
969
|
+
return _regenerator.default.wrap(function (_context13) {
|
|
972
970
|
while (1) switch (_context13.prev = _context13.next) {
|
|
973
971
|
case 0:
|
|
974
|
-
_context13.next =
|
|
972
|
+
_context13.next = 1;
|
|
975
973
|
return (0, _Utils.uploadLogs)({}, true);
|
|
976
|
-
case
|
|
974
|
+
case 1:
|
|
977
975
|
result = _context13.sent;
|
|
978
976
|
if (result) {
|
|
979
|
-
_context13.next =
|
|
977
|
+
_context13.next = 2;
|
|
980
978
|
break;
|
|
981
979
|
}
|
|
982
980
|
throw new Error('Failed to upload logs: No response received.');
|
|
983
|
-
case
|
|
981
|
+
case 2:
|
|
984
982
|
return _context13.abrupt("return", result);
|
|
985
|
-
case
|
|
983
|
+
case 3:
|
|
986
984
|
case "end":
|
|
987
985
|
return _context13.stop();
|
|
988
986
|
}
|
|
@@ -994,7 +992,6 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
994
992
|
return uploadLogs;
|
|
995
993
|
}())
|
|
996
994
|
}]);
|
|
997
|
-
return CallingClient;
|
|
998
995
|
}(_impl.Eventing);
|
|
999
996
|
/**
|
|
1000
997
|
* Create the `CallingClient` instance using the `webex` object and callingSdk `config`
|
|
@@ -1004,15 +1001,15 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
1004
1001
|
var createClient = exports.createClient = /*#__PURE__*/function () {
|
|
1005
1002
|
var _ref7 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12(webex, config) {
|
|
1006
1003
|
var callingClientInstance;
|
|
1007
|
-
return _regenerator.default.wrap(function
|
|
1004
|
+
return _regenerator.default.wrap(function (_context14) {
|
|
1008
1005
|
while (1) switch (_context14.prev = _context14.next) {
|
|
1009
1006
|
case 0:
|
|
1010
1007
|
callingClientInstance = new CallingClient(webex, config);
|
|
1011
|
-
_context14.next =
|
|
1008
|
+
_context14.next = 1;
|
|
1012
1009
|
return callingClientInstance.init();
|
|
1013
|
-
case
|
|
1010
|
+
case 1:
|
|
1014
1011
|
return _context14.abrupt("return", callingClientInstance);
|
|
1015
|
-
case
|
|
1012
|
+
case 2:
|
|
1016
1013
|
case "end":
|
|
1017
1014
|
return _context14.stop();
|
|
1018
1015
|
}
|