@webex/calling 3.9.0 → 3.10.0-next.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 +43 -43
- package/dist/CallHistory/CallHistory.js.map +1 -1
- package/dist/CallHistory/CallHistory.test.js +157 -152
- package/dist/CallHistory/CallHistory.test.js.map +1 -1
- package/dist/CallHistory/callHistoryFixtures.js.map +1 -1
- package/dist/CallHistory/constants.js.map +1 -1
- package/dist/CallHistory/types.js.map +1 -1
- package/dist/CallSettings/CallSettings.js +8 -8
- package/dist/CallSettings/CallSettings.js.map +1 -1
- package/dist/CallSettings/CallSettings.test.js +1 -1
- package/dist/CallSettings/CallSettings.test.js.map +1 -1
- package/dist/CallSettings/UcmBackendConnector.js +12 -11
- package/dist/CallSettings/UcmBackendConnector.js.map +1 -1
- package/dist/CallSettings/UcmBackendConnector.test.js +11 -11
- package/dist/CallSettings/UcmBackendConnector.test.js.map +1 -1
- package/dist/CallSettings/WxCallBackendConnector.js +53 -52
- package/dist/CallSettings/WxCallBackendConnector.js.map +1 -1
- package/dist/CallSettings/WxCallBackendConnector.test.js +112 -110
- package/dist/CallSettings/WxCallBackendConnector.test.js.map +1 -1
- package/dist/CallSettings/constants.js.map +1 -1
- package/dist/CallSettings/testFixtures.js.map +1 -1
- package/dist/CallSettings/types.js.map +1 -1
- package/dist/CallingClient/CallingClient.js +458 -203
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +458 -315
- package/dist/CallingClient/CallingClient.test.js.map +1 -1
- package/dist/CallingClient/callRecordFixtures.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/index.js +2 -2
- package/dist/CallingClient/calling/CallerId/index.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/index.test.js +8 -7
- package/dist/CallingClient/calling/CallerId/index.test.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/types.js.map +1 -1
- package/dist/CallingClient/calling/call.js +405 -372
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +411 -410
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/CallingClient/calling/callManager.js +3 -4
- package/dist/CallingClient/calling/callManager.js.map +1 -1
- package/dist/CallingClient/calling/callManager.test.js +68 -69
- package/dist/CallingClient/calling/callManager.test.js.map +1 -1
- package/dist/CallingClient/calling/index.js.map +1 -1
- package/dist/CallingClient/calling/types.js.map +1 -1
- package/dist/CallingClient/callingClientFixtures.js.map +1 -1
- package/dist/CallingClient/constants.js +9 -6
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/CallingClient/line/index.js +10 -11
- package/dist/CallingClient/line/index.js.map +1 -1
- package/dist/CallingClient/line/line.test.js +10 -9
- package/dist/CallingClient/line/line.test.js.map +1 -1
- package/dist/CallingClient/line/types.js.map +1 -1
- package/dist/CallingClient/registration/index.js.map +1 -1
- package/dist/CallingClient/registration/register.js +285 -205
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +251 -180
- package/dist/CallingClient/registration/register.test.js.map +1 -1
- package/dist/CallingClient/registration/registerFixtures.js.map +1 -1
- package/dist/CallingClient/registration/types.js.map +1 -1
- package/dist/CallingClient/registration/webWorker.js +25 -10
- package/dist/CallingClient/registration/webWorker.js.map +1 -1
- package/dist/CallingClient/registration/webWorker.test.js +85 -38
- package/dist/CallingClient/registration/webWorker.test.js.map +1 -1
- package/dist/CallingClient/registration/webWorkerStr.js +1 -1
- package/dist/CallingClient/registration/webWorkerStr.js.map +1 -1
- package/dist/CallingClient/types.js.map +1 -1
- package/dist/CallingClient/windowsChromiumIceWarmupUtils.js +142 -0
- package/dist/CallingClient/windowsChromiumIceWarmupUtils.js.map +1 -0
- package/dist/Contacts/ContactsClient.js +244 -247
- package/dist/Contacts/ContactsClient.js.map +1 -1
- package/dist/Contacts/ContactsClient.test.js +93 -93
- package/dist/Contacts/ContactsClient.test.js.map +1 -1
- package/dist/Contacts/constants.js +2 -2
- package/dist/Contacts/constants.js.map +1 -1
- package/dist/Contacts/contactFixtures.js.map +1 -1
- package/dist/Contacts/types.js.map +1 -1
- package/dist/Errors/catalog/CallError.js +2 -2
- package/dist/Errors/catalog/CallError.js.map +1 -1
- package/dist/Errors/catalog/CallingDeviceError.js +2 -2
- package/dist/Errors/catalog/CallingDeviceError.js.map +1 -1
- package/dist/Errors/catalog/ExtendedError.js +3 -3
- package/dist/Errors/catalog/ExtendedError.js.map +1 -1
- package/dist/Errors/catalog/LineError.js +2 -2
- package/dist/Errors/catalog/LineError.js.map +1 -1
- package/dist/Errors/index.js.map +1 -1
- package/dist/Errors/types.js.map +1 -1
- package/dist/Events/impl/index.js +4 -3
- package/dist/Events/impl/index.js.map +1 -1
- package/dist/Events/types.js.map +1 -1
- package/dist/Logger/index.js +3 -3
- package/dist/Logger/index.js.map +1 -1
- package/dist/Logger/index.test.js +1 -1
- package/dist/Logger/index.test.js.map +1 -1
- package/dist/Logger/types.js.map +1 -1
- package/dist/Metrics/index.js +221 -104
- package/dist/Metrics/index.js.map +1 -1
- package/dist/Metrics/index.test.js +112 -23
- package/dist/Metrics/index.test.js.map +1 -1
- package/dist/Metrics/types.js +15 -1
- package/dist/Metrics/types.js.map +1 -1
- package/dist/SDKConnector/index.js +0 -1
- package/dist/SDKConnector/index.js.map +1 -1
- package/dist/SDKConnector/index.test.js.map +1 -1
- package/dist/SDKConnector/types.js.map +1 -1
- package/dist/SDKConnector/utils.js.map +1 -1
- package/dist/SDKConnector/utils.test.js.map +1 -1
- package/dist/Voicemail/BroadworksBackendConnector.js +55 -61
- package/dist/Voicemail/BroadworksBackendConnector.js.map +1 -1
- package/dist/Voicemail/BroadworksBackendConnector.test.js +129 -122
- package/dist/Voicemail/BroadworksBackendConnector.test.js.map +1 -1
- package/dist/Voicemail/UcmBackendConnector.js +53 -50
- package/dist/Voicemail/UcmBackendConnector.js.map +1 -1
- package/dist/Voicemail/UcmBackendConnector.test.js +73 -74
- package/dist/Voicemail/UcmBackendConnector.test.js.map +1 -1
- package/dist/Voicemail/Voicemail.js +89 -113
- package/dist/Voicemail/Voicemail.js.map +1 -1
- package/dist/Voicemail/Voicemail.test.js +2 -2
- package/dist/Voicemail/Voicemail.test.js.map +1 -1
- package/dist/Voicemail/WxCallBackendConnector.js +87 -92
- package/dist/Voicemail/WxCallBackendConnector.js.map +1 -1
- package/dist/Voicemail/WxCallBackendConnector.test.js +228 -203
- package/dist/Voicemail/WxCallBackendConnector.test.js.map +1 -1
- package/dist/Voicemail/constants.js.map +1 -1
- package/dist/Voicemail/types.js.map +1 -1
- package/dist/Voicemail/voicemailFixture.js.map +1 -1
- package/dist/api.js.map +1 -1
- package/dist/common/Utils.js +85 -66
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +113 -123
- package/dist/common/Utils.test.js.map +1 -1
- package/dist/common/constants.js.map +1 -1
- package/dist/common/index.js.map +1 -1
- package/dist/common/testUtil.js +1 -1
- package/dist/common/testUtil.js.map +1 -1
- package/dist/common/types.js.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/module/CallHistory/CallHistory.js +17 -8
- package/dist/module/CallSettings/UcmBackendConnector.js +2 -2
- package/dist/module/CallSettings/WxCallBackendConnector.js +14 -14
- package/dist/module/CallingClient/CallingClient.js +176 -36
- package/dist/module/CallingClient/calling/call.js +91 -61
- package/dist/module/CallingClient/constants.js +8 -4
- package/dist/module/CallingClient/line/index.js +3 -3
- package/dist/module/CallingClient/registration/register.js +37 -13
- package/dist/module/CallingClient/registration/webWorker.js +17 -3
- package/dist/module/CallingClient/registration/webWorkerStr.js +19 -3
- package/dist/module/CallingClient/windowsChromiumIceWarmupUtils.js +59 -0
- package/dist/module/Contacts/ContactsClient.js +33 -37
- package/dist/module/Contacts/constants.js +1 -1
- package/dist/module/Events/impl/index.js +2 -1
- package/dist/module/Logger/index.js +2 -2
- package/dist/module/Metrics/index.js +142 -55
- package/dist/module/Metrics/types.js +14 -0
- package/dist/module/Voicemail/BroadworksBackendConnector.js +10 -17
- package/dist/module/Voicemail/UcmBackendConnector.js +11 -10
- package/dist/module/Voicemail/Voicemail.js +42 -68
- package/dist/module/Voicemail/WxCallBackendConnector.js +22 -28
- package/dist/module/common/Utils.js +29 -12
- package/dist/types/CallHistory/CallHistory.d.ts.map +1 -1
- package/dist/types/CallSettings/UcmBackendConnector.d.ts.map +1 -1
- package/dist/types/CallSettings/WxCallBackendConnector.d.ts.map +1 -1
- package/dist/types/CallingClient/CallingClient.d.ts +12 -1
- package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/types.d.ts +2 -1
- package/dist/types/CallingClient/calling/types.d.ts.map +1 -1
- package/dist/types/CallingClient/constants.d.ts +8 -4
- package/dist/types/CallingClient/constants.d.ts.map +1 -1
- package/dist/types/CallingClient/line/index.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/register.d.ts +1 -0
- package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/webWorker.d.ts +2 -1
- package/dist/types/CallingClient/registration/webWorker.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/webWorkerStr.d.ts +1 -1
- package/dist/types/CallingClient/registration/webWorkerStr.d.ts.map +1 -1
- package/dist/types/CallingClient/windowsChromiumIceWarmupUtils.d.ts +5 -0
- package/dist/types/CallingClient/windowsChromiumIceWarmupUtils.d.ts.map +1 -0
- package/dist/types/Contacts/ContactsClient.d.ts.map +1 -1
- package/dist/types/Contacts/constants.d.ts +1 -1
- package/dist/types/Contacts/constants.d.ts.map +1 -1
- package/dist/types/Events/impl/index.d.ts.map +1 -1
- package/dist/types/Logger/index.d.ts +1 -2
- package/dist/types/Logger/index.d.ts.map +1 -1
- package/dist/types/Metrics/index.d.ts.map +1 -1
- package/dist/types/Metrics/types.d.ts +18 -3
- package/dist/types/Metrics/types.d.ts.map +1 -1
- package/dist/types/Voicemail/BroadworksBackendConnector.d.ts.map +1 -1
- package/dist/types/Voicemail/UcmBackendConnector.d.ts.map +1 -1
- package/dist/types/Voicemail/Voicemail.d.ts.map +1 -1
- package/dist/types/Voicemail/WxCallBackendConnector.d.ts.map +1 -1
- package/dist/types/common/Utils.d.ts.map +1 -1
- package/dist/types/common/types.d.ts +1 -0
- package/dist/types/common/types.d.ts.map +1 -1
- package/package.json +10 -8
|
@@ -17,6 +17,7 @@ exports.createClient = exports.CallingClient = void 0;
|
|
|
17
17
|
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
|
|
18
18
|
var _values = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/values"));
|
|
19
19
|
var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
|
|
20
|
+
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
|
|
20
21
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
21
22
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
|
|
22
23
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
|
|
@@ -40,13 +41,13 @@ var _constants2 = require("./constants");
|
|
|
40
41
|
var _line = _interopRequireDefault(require("./line"));
|
|
41
42
|
var _types4 = require("../Metrics/types");
|
|
42
43
|
var _Metrics = require("../Metrics");
|
|
43
|
-
|
|
44
|
-
function _interopRequireWildcard(e, r) { if (!
|
|
45
|
-
function _createForOfIteratorHelper(
|
|
46
|
-
function _unsupportedIterableToArray(
|
|
47
|
-
function _arrayLikeToArray(
|
|
48
|
-
function _createSuper(
|
|
49
|
-
function _isNativeReflectConstruct() {
|
|
44
|
+
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 _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); }
|
|
46
|
+
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
|
+
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
|
+
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 _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); }; }
|
|
50
|
+
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 */
|
|
50
51
|
/**
|
|
51
52
|
* The `CallingClient` module provides a set of APIs for line registration and calling functionalities within the SDK.
|
|
52
53
|
*
|
|
@@ -80,6 +81,119 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
80
81
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "mobiusHost", void 0);
|
|
81
82
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "mediaEngine", void 0);
|
|
82
83
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "lineDict", {});
|
|
84
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "isNetworkDown", false);
|
|
85
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "networkDownTimestamp", '');
|
|
86
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "networkUpTimestamp", '');
|
|
87
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "mercuryDownTimestamp", '');
|
|
88
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "mercuryUpTimestamp", '');
|
|
89
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleNetworkOffline", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
90
|
+
var line;
|
|
91
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
92
|
+
while (1) switch (_context.prev = _context.next) {
|
|
93
|
+
case 0:
|
|
94
|
+
_this.networkDownTimestamp = new Date().toISOString();
|
|
95
|
+
_context.next = 3;
|
|
96
|
+
return _this.checkNetworkReachability();
|
|
97
|
+
case 3:
|
|
98
|
+
_this.isNetworkDown = !_context.sent;
|
|
99
|
+
_Logger.default.warn("Network has gone down, wait for it to come back up", {
|
|
100
|
+
file: _constants2.CALLING_CLIENT_FILE,
|
|
101
|
+
method: _constants2.METHODS.NETWORK_OFFLINE
|
|
102
|
+
});
|
|
103
|
+
if (_this.isNetworkDown) {
|
|
104
|
+
line = (0, _values.default)(_this.lineDict)[0];
|
|
105
|
+
line.registration.clearKeepaliveTimer();
|
|
106
|
+
}
|
|
107
|
+
case 6:
|
|
108
|
+
case "end":
|
|
109
|
+
return _context.stop();
|
|
110
|
+
}
|
|
111
|
+
}, _callee);
|
|
112
|
+
})));
|
|
113
|
+
// Wondering if we should keep this for timestamp recording purpose
|
|
114
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleNetworkOnline", function () {
|
|
115
|
+
_Logger.default.info(_constants.METHOD_START_MESSAGE, {
|
|
116
|
+
file: _constants2.CALLING_CLIENT_FILE,
|
|
117
|
+
method: _constants2.METHODS.NETWORK_ONLINE
|
|
118
|
+
});
|
|
119
|
+
_this.networkUpTimestamp = new Date().toISOString();
|
|
120
|
+
});
|
|
121
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleMercuryOffline", function () {
|
|
122
|
+
_Logger.default.warn("Mercury down, waiting for connection to be up", {
|
|
123
|
+
file: _constants2.CALLING_CLIENT_FILE,
|
|
124
|
+
method: _constants2.METHODS.MERCURY_OFFLINE
|
|
125
|
+
});
|
|
126
|
+
_this.mercuryDownTimestamp = new Date().toISOString();
|
|
127
|
+
_this.metricManager.submitConnectionMetrics(_types4.METRIC_EVENT.CONNECTION_ERROR, _types4.CONNECTION_ACTION.MERCURY_DOWN, _types4.METRIC_TYPE.BEHAVIORAL, _this.mercuryDownTimestamp, _this.mercuryUpTimestamp);
|
|
128
|
+
});
|
|
129
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleMercuryOnline", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
130
|
+
var callCheckInterval;
|
|
131
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
132
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
133
|
+
case 0:
|
|
134
|
+
_Logger.default.info(_constants.METHOD_START_MESSAGE, {
|
|
135
|
+
file: _constants2.CALLING_CLIENT_FILE,
|
|
136
|
+
method: _constants2.METHODS.MERCURY_ONLINE
|
|
137
|
+
});
|
|
138
|
+
_this.mercuryUpTimestamp = new Date().toISOString();
|
|
139
|
+
if (!_this.isNetworkDown) {
|
|
140
|
+
_context3.next = 10;
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
callCheckInterval = setInterval(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
144
|
+
var line;
|
|
145
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
146
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
147
|
+
case 0:
|
|
148
|
+
if ((0, _keys.default)(_this.callManager.getActiveCalls()).length) {
|
|
149
|
+
_context2.next = 10;
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
clearInterval(callCheckInterval);
|
|
153
|
+
line = (0, _values.default)(_this.lineDict)[0];
|
|
154
|
+
if (!(line.getStatus() !== _types3.RegistrationStatus.IDLE)) {
|
|
155
|
+
_context2.next = 9;
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
_context2.next = 6;
|
|
159
|
+
return line.registration.handleConnectionRestoration(_this.isNetworkDown);
|
|
160
|
+
case 6:
|
|
161
|
+
_this.isNetworkDown = _context2.sent;
|
|
162
|
+
_context2.next = 10;
|
|
163
|
+
break;
|
|
164
|
+
case 9:
|
|
165
|
+
_this.isNetworkDown = false;
|
|
166
|
+
case 10:
|
|
167
|
+
case "end":
|
|
168
|
+
return _context2.stop();
|
|
169
|
+
}
|
|
170
|
+
}, _callee2);
|
|
171
|
+
})), _constants2.NETWORK_FLAP_TIMEOUT);
|
|
172
|
+
if (!(0, _keys.default)(_this.callManager.getActiveCalls()).length) {
|
|
173
|
+
_context3.next = 7;
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
_context3.next = 7;
|
|
177
|
+
return _this.checkCallStatus();
|
|
178
|
+
case 7:
|
|
179
|
+
_this.metricManager.submitConnectionMetrics(_types4.METRIC_EVENT.CONNECTION_ERROR, _types4.CONNECTION_ACTION.NETWORK_FLAP, _types4.METRIC_TYPE.BEHAVIORAL, _this.networkDownTimestamp, _this.networkUpTimestamp);
|
|
180
|
+
_context3.next = 14;
|
|
181
|
+
break;
|
|
182
|
+
case 10:
|
|
183
|
+
if (!(0, _keys.default)(_this.callManager.getActiveCalls()).length) {
|
|
184
|
+
_context3.next = 13;
|
|
185
|
+
break;
|
|
186
|
+
}
|
|
187
|
+
_context3.next = 13;
|
|
188
|
+
return _this.checkCallStatus();
|
|
189
|
+
case 13:
|
|
190
|
+
_this.metricManager.submitConnectionMetrics(_types4.METRIC_EVENT.CONNECTION_ERROR, _types4.CONNECTION_ACTION.MERCURY_UP, _types4.METRIC_TYPE.BEHAVIORAL, _this.mercuryDownTimestamp, _this.mercuryUpTimestamp);
|
|
191
|
+
case 14:
|
|
192
|
+
case "end":
|
|
193
|
+
return _context3.stop();
|
|
194
|
+
}
|
|
195
|
+
}, _callee3);
|
|
196
|
+
})));
|
|
83
197
|
/**
|
|
84
198
|
* Handler registered for ALL_CALLS_CLEARED event emitted by callManager.
|
|
85
199
|
*
|
|
@@ -87,10 +201,10 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
87
201
|
* will be attempted here on receiving a notification from callManager that all
|
|
88
202
|
* calls are cleaned up.
|
|
89
203
|
*/
|
|
90
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "callsClearedHandler", /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
204
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "callsClearedHandler", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
91
205
|
var registration;
|
|
92
|
-
return _regenerator.default.wrap(function
|
|
93
|
-
while (1) switch (
|
|
206
|
+
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
207
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
94
208
|
case 0:
|
|
95
209
|
_Logger.default.info(_constants.METHOD_START_MESSAGE, {
|
|
96
210
|
file: _constants2.CALLING_CLIENT_FILE,
|
|
@@ -100,35 +214,35 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
100
214
|
// it will change once we have proper lineId and multiple lines as well
|
|
101
215
|
registration = (0, _values.default)(_this.lineDict)[0].registration;
|
|
102
216
|
if (registration.isDeviceRegistered()) {
|
|
103
|
-
|
|
217
|
+
_context5.next = 5;
|
|
104
218
|
break;
|
|
105
219
|
}
|
|
106
|
-
|
|
107
|
-
return _this.mutex.runExclusive(
|
|
108
|
-
return _regenerator.default.wrap(function
|
|
109
|
-
while (1) switch (
|
|
220
|
+
_context5.next = 5;
|
|
221
|
+
return _this.mutex.runExclusive(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
222
|
+
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
223
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
110
224
|
case 0:
|
|
111
225
|
if (!registration.isReconnectPending()) {
|
|
112
|
-
|
|
226
|
+
_context4.next = 4;
|
|
113
227
|
break;
|
|
114
228
|
}
|
|
115
229
|
_Logger.default.info('All calls cleared, reconnecting', {
|
|
116
230
|
file: _constants2.CALLING_CLIENT_FILE,
|
|
117
231
|
method: _constants2.CALLS_CLEARED_HANDLER_UTIL
|
|
118
232
|
});
|
|
119
|
-
|
|
233
|
+
_context4.next = 4;
|
|
120
234
|
return registration.reconnectOnFailure(_constants2.CALLS_CLEARED_HANDLER_UTIL);
|
|
121
235
|
case 4:
|
|
122
236
|
case "end":
|
|
123
|
-
return
|
|
237
|
+
return _context4.stop();
|
|
124
238
|
}
|
|
125
|
-
},
|
|
239
|
+
}, _callee4);
|
|
126
240
|
})));
|
|
127
241
|
case 5:
|
|
128
242
|
case "end":
|
|
129
|
-
return
|
|
243
|
+
return _context5.stop();
|
|
130
244
|
}
|
|
131
|
-
},
|
|
245
|
+
}, _callee5);
|
|
132
246
|
})));
|
|
133
247
|
_this.sdkConnector = _SDKConnector.default;
|
|
134
248
|
if (!_this.sdkConnector.getWebex()) {
|
|
@@ -137,7 +251,6 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
137
251
|
if (config !== null && config !== void 0 && (_config$logger = config.logger) !== null && _config$logger !== void 0 && _config$logger.level && webex.logger.config) {
|
|
138
252
|
webex.logger.config.level = config.logger.level; // override the webex logger level
|
|
139
253
|
}
|
|
140
|
-
|
|
141
254
|
_Logger.default.setWebexLogger(webex.logger);
|
|
142
255
|
}
|
|
143
256
|
_this.mutex = new _asyncMutex.Mutex();
|
|
@@ -222,8 +335,6 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
222
335
|
return _this;
|
|
223
336
|
}
|
|
224
337
|
|
|
225
|
-
// async calls required to run after constructor
|
|
226
|
-
|
|
227
338
|
/**
|
|
228
339
|
* Initializes the `CallingClient` by performing the following steps:
|
|
229
340
|
*
|
|
@@ -238,24 +349,59 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
238
349
|
*/
|
|
239
350
|
(0, _createClass2.default)(CallingClient, [{
|
|
240
351
|
key: "init",
|
|
241
|
-
value: function () {
|
|
242
|
-
var _init = (0, _asyncToGenerator2.default)(
|
|
243
|
-
|
|
244
|
-
|
|
352
|
+
value: (function () {
|
|
353
|
+
var _init = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
354
|
+
var _window, _window$navigator;
|
|
355
|
+
var ua;
|
|
356
|
+
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
357
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
245
358
|
case 0:
|
|
246
|
-
|
|
359
|
+
if (!(typeof window !== 'undefined' && (_window = window) !== null && _window !== void 0 && (_window$navigator = _window.navigator) !== null && _window$navigator !== void 0 && _window$navigator.userAgent)) {
|
|
360
|
+
_context6.next = 13;
|
|
361
|
+
break;
|
|
362
|
+
}
|
|
363
|
+
ua = window.navigator.userAgent;
|
|
364
|
+
if (!ua.toLowerCase().includes('windows')) {
|
|
365
|
+
_context6.next = 13;
|
|
366
|
+
break;
|
|
367
|
+
}
|
|
368
|
+
_Logger.default.info('Starting ICE warmup for Windows Chromium based browser', {
|
|
369
|
+
file: _constants2.CALLING_CLIENT_FILE,
|
|
370
|
+
method: 'init'
|
|
371
|
+
});
|
|
372
|
+
_context6.prev = 4;
|
|
373
|
+
_context6.next = 7;
|
|
374
|
+
return (0, _windowsChromiumIceWarmupUtils.default)({
|
|
375
|
+
iceServers: [],
|
|
376
|
+
timeoutMs: 1000
|
|
377
|
+
});
|
|
378
|
+
case 7:
|
|
379
|
+
_Logger.default.info("ICE warmup completed", {
|
|
380
|
+
file: _constants2.CALLING_CLIENT_FILE,
|
|
381
|
+
method: 'init'
|
|
382
|
+
});
|
|
383
|
+
_context6.next = 13;
|
|
384
|
+
break;
|
|
385
|
+
case 10:
|
|
386
|
+
_context6.prev = 10;
|
|
387
|
+
_context6.t0 = _context6["catch"](4);
|
|
388
|
+
_Logger.default.warn("ICE warmup failed: ".concat(_context6.t0), {
|
|
389
|
+
file: _constants2.CALLING_CLIENT_FILE,
|
|
390
|
+
method: 'init'
|
|
391
|
+
});
|
|
392
|
+
case 13:
|
|
393
|
+
_context6.next = 15;
|
|
247
394
|
return this.getMobiusServers();
|
|
248
|
-
case
|
|
249
|
-
|
|
395
|
+
case 15:
|
|
396
|
+
_context6.next = 17;
|
|
250
397
|
return this.createLine();
|
|
251
|
-
case
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
case 5:
|
|
398
|
+
case 17:
|
|
399
|
+
this.setupNetworkEventListeners();
|
|
400
|
+
case 18:
|
|
255
401
|
case "end":
|
|
256
|
-
return
|
|
402
|
+
return _context6.stop();
|
|
257
403
|
}
|
|
258
|
-
},
|
|
404
|
+
}, _callee6, this, [[4, 10]]);
|
|
259
405
|
}));
|
|
260
406
|
function init() {
|
|
261
407
|
return _init.apply(this, arguments);
|
|
@@ -263,102 +409,171 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
263
409
|
return init;
|
|
264
410
|
}()
|
|
265
411
|
/**
|
|
266
|
-
*
|
|
412
|
+
* Ping a reliable external endpoint with a short timeout to infer connectivity.
|
|
267
413
|
*/
|
|
414
|
+
)
|
|
268
415
|
}, {
|
|
269
|
-
key: "
|
|
416
|
+
key: "checkNetworkReachability",
|
|
270
417
|
value: (function () {
|
|
271
|
-
var
|
|
272
|
-
var
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
while (1) switch (_context5.prev = _context5.next) {
|
|
418
|
+
var _checkNetworkReachability = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7() {
|
|
419
|
+
var controller, timeoutId;
|
|
420
|
+
return _regenerator.default.wrap(function _callee7$(_context7) {
|
|
421
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
276
422
|
case 0:
|
|
277
|
-
|
|
423
|
+
_context7.prev = 0;
|
|
424
|
+
controller = new AbortController();
|
|
425
|
+
timeoutId = setTimeout(function () {
|
|
426
|
+
return controller.abort();
|
|
427
|
+
}, 3000); // Using a common connectivity check endpoint that returns 204 with minimal payload.
|
|
428
|
+
// no-cors mode yields an opaque response but a successful fetch implies reachability.
|
|
429
|
+
_context7.next = 5;
|
|
430
|
+
return fetch('https://www.google.com/generate_204', {
|
|
431
|
+
method: 'GET',
|
|
432
|
+
cache: 'no-cache',
|
|
433
|
+
mode: 'no-cors',
|
|
434
|
+
signal: controller.signal
|
|
435
|
+
});
|
|
436
|
+
case 5:
|
|
437
|
+
clearTimeout(timeoutId);
|
|
438
|
+
return _context7.abrupt("return", true);
|
|
439
|
+
case 9:
|
|
440
|
+
_context7.prev = 9;
|
|
441
|
+
_context7.t0 = _context7["catch"](0);
|
|
442
|
+
_Logger.default.warn("Network connectivity probe failed: ".concat(_context7.t0), {
|
|
278
443
|
file: _constants2.CALLING_CLIENT_FILE,
|
|
279
|
-
method:
|
|
444
|
+
method: 'pingExternal'
|
|
280
445
|
});
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
446
|
+
return _context7.abrupt("return", false);
|
|
447
|
+
case 13:
|
|
448
|
+
case "end":
|
|
449
|
+
return _context7.stop();
|
|
450
|
+
}
|
|
451
|
+
}, _callee7, null, [[0, 9]]);
|
|
452
|
+
}));
|
|
453
|
+
function checkNetworkReachability() {
|
|
454
|
+
return _checkNetworkReachability.apply(this, arguments);
|
|
455
|
+
}
|
|
456
|
+
return checkNetworkReachability;
|
|
457
|
+
}())
|
|
458
|
+
}, {
|
|
459
|
+
key: "checkCallStatus",
|
|
460
|
+
value: function () {
|
|
461
|
+
var _checkCallStatus = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
462
|
+
var loggerContext, calls, _iterator, _step, _loop;
|
|
463
|
+
return _regenerator.default.wrap(function _callee8$(_context9) {
|
|
464
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
465
|
+
case 0:
|
|
466
|
+
loggerContext = {
|
|
467
|
+
file: _constants2.CALLING_CLIENT_FILE,
|
|
468
|
+
method: 'checkCallStatus'
|
|
469
|
+
};
|
|
470
|
+
calls = (0, _values.default)(this.callManager.getActiveCalls());
|
|
471
|
+
_iterator = _createForOfIteratorHelper(calls);
|
|
472
|
+
_context9.prev = 3;
|
|
473
|
+
_loop = /*#__PURE__*/_regenerator.default.mark(function _loop() {
|
|
474
|
+
var call;
|
|
475
|
+
return _regenerator.default.wrap(function _loop$(_context8) {
|
|
476
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
287
477
|
case 0:
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
478
|
+
call = _step.value;
|
|
479
|
+
call.postStatus().then(function () {
|
|
480
|
+
_Logger.default.info("Call is active", loggerContext);
|
|
481
|
+
/*
|
|
482
|
+
* Media Renegotiation Possibility if call keepalive succeeds,
|
|
483
|
+
* for cases like WebRTC disconnect and media inactivity.
|
|
484
|
+
*/
|
|
485
|
+
}).catch(function (err) {
|
|
486
|
+
_Logger.default.warn("Call Keepalive failed: ".concat(err), loggerContext);
|
|
487
|
+
call.sendCallStateMachineEvt({
|
|
488
|
+
type: 'E_SEND_CALL_DISCONNECT'
|
|
292
489
|
});
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
}
|
|
296
|
-
if (!(retry && _this2.webex.internal.mercury.connected)) {
|
|
297
|
-
_context4.next = 9;
|
|
298
|
-
break;
|
|
299
|
-
}
|
|
300
|
-
if (!(line.getStatus() !== _types3.RegistrationStatus.IDLE)) {
|
|
301
|
-
_context4.next = 8;
|
|
302
|
-
break;
|
|
303
|
-
}
|
|
304
|
-
_context4.next = 5;
|
|
305
|
-
return line.registration.handleConnectionRestoration(retry);
|
|
306
|
-
case 5:
|
|
307
|
-
retry = _context4.sent;
|
|
308
|
-
_context4.next = 9;
|
|
309
|
-
break;
|
|
310
|
-
case 8:
|
|
311
|
-
retry = false;
|
|
312
|
-
case 9:
|
|
490
|
+
});
|
|
491
|
+
case 2:
|
|
313
492
|
case "end":
|
|
314
|
-
return
|
|
493
|
+
return _context8.stop();
|
|
315
494
|
}
|
|
316
|
-
},
|
|
317
|
-
})
|
|
318
|
-
|
|
495
|
+
}, _loop);
|
|
496
|
+
});
|
|
497
|
+
_iterator.s();
|
|
498
|
+
case 6:
|
|
499
|
+
if ((_step = _iterator.n()).done) {
|
|
500
|
+
_context9.next = 10;
|
|
501
|
+
break;
|
|
502
|
+
}
|
|
503
|
+
return _context9.delegateYield(_loop(), "t0", 8);
|
|
504
|
+
case 8:
|
|
505
|
+
_context9.next = 6;
|
|
506
|
+
break;
|
|
507
|
+
case 10:
|
|
508
|
+
_context9.next = 15;
|
|
509
|
+
break;
|
|
510
|
+
case 12:
|
|
511
|
+
_context9.prev = 12;
|
|
512
|
+
_context9.t1 = _context9["catch"](3);
|
|
513
|
+
_iterator.e(_context9.t1);
|
|
514
|
+
case 15:
|
|
515
|
+
_context9.prev = 15;
|
|
516
|
+
_iterator.f();
|
|
517
|
+
return _context9.finish(15);
|
|
518
|
+
case 18:
|
|
319
519
|
case "end":
|
|
320
|
-
return
|
|
520
|
+
return _context9.stop();
|
|
321
521
|
}
|
|
322
|
-
},
|
|
522
|
+
}, _callee8, this, [[3, 12, 15, 18]]);
|
|
323
523
|
}));
|
|
324
|
-
function
|
|
325
|
-
return
|
|
524
|
+
function checkCallStatus() {
|
|
525
|
+
return _checkCallStatus.apply(this, arguments);
|
|
326
526
|
}
|
|
327
|
-
return
|
|
527
|
+
return checkCallStatus;
|
|
328
528
|
}()
|
|
529
|
+
}, {
|
|
530
|
+
key: "setupNetworkEventListeners",
|
|
531
|
+
value: function setupNetworkEventListeners() {
|
|
532
|
+
var _this2 = this;
|
|
533
|
+
if (typeof window !== 'undefined' && window.addEventListener) {
|
|
534
|
+
window.addEventListener('online', this.handleNetworkOnline);
|
|
535
|
+
window.addEventListener('offline', this.handleNetworkOffline);
|
|
536
|
+
}
|
|
537
|
+
this.webex.internal.mercury.on('offline', function () {
|
|
538
|
+
_this2.handleMercuryOffline();
|
|
539
|
+
});
|
|
540
|
+
this.webex.internal.mercury.on('online', function () {
|
|
541
|
+
_this2.handleMercuryOnline();
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
|
|
329
545
|
/**
|
|
330
546
|
* Fetches countryCode and region of the client.
|
|
331
547
|
*/
|
|
332
|
-
)
|
|
333
548
|
}, {
|
|
334
549
|
key: "getClientRegionInfo",
|
|
335
550
|
value: (function () {
|
|
336
|
-
var _getClientRegionInfo = (0, _asyncToGenerator2.default)(
|
|
551
|
+
var _getClientRegionInfo = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
337
552
|
var _this3 = this;
|
|
338
|
-
var abort, regionInfo,
|
|
339
|
-
return _regenerator.default.wrap(function
|
|
340
|
-
while (1) switch (
|
|
553
|
+
var abort, regionInfo, _iterator2, _step2, _loop2, _ret;
|
|
554
|
+
return _regenerator.default.wrap(function _callee9$(_context1) {
|
|
555
|
+
while (1) switch (_context1.prev = _context1.next) {
|
|
341
556
|
case 0:
|
|
342
557
|
_Logger.default.info(_constants.METHOD_START_MESSAGE, {
|
|
343
558
|
file: _constants2.CALLING_CLIENT_FILE,
|
|
344
559
|
method: _constants2.METHODS.GET_CLIENT_REGION_INFO
|
|
345
560
|
});
|
|
346
561
|
regionInfo = {};
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
var mobius, temp, myIP, response, clientRegionInfo
|
|
351
|
-
return _regenerator.default.wrap(function
|
|
352
|
-
while (1) switch (
|
|
562
|
+
_iterator2 = _createForOfIteratorHelper(this.mobiusClusters);
|
|
563
|
+
_context1.prev = 3;
|
|
564
|
+
_loop2 = /*#__PURE__*/_regenerator.default.mark(function _loop2() {
|
|
565
|
+
var mobius, _temp$headers, _response$headers, _response$headers2, _response$headers$tra, _response$headers3, temp, myIP, response, clientRegionInfo;
|
|
566
|
+
return _regenerator.default.wrap(function _loop2$(_context0) {
|
|
567
|
+
while (1) switch (_context0.prev = _context0.next) {
|
|
353
568
|
case 0:
|
|
354
|
-
mobius =
|
|
569
|
+
mobius = _step2.value;
|
|
355
570
|
if (mobius.host) {
|
|
356
571
|
_this3.mobiusHost = "https://".concat(mobius.host).concat(_constants2.API_V1);
|
|
357
572
|
} else {
|
|
358
573
|
_this3.mobiusHost = mobius;
|
|
359
574
|
}
|
|
360
|
-
|
|
361
|
-
|
|
575
|
+
_context0.prev = 2;
|
|
576
|
+
_context0.next = 5;
|
|
362
577
|
return _this3.webex.request({
|
|
363
578
|
uri: "".concat(_this3.mobiusHost).concat(_constants2.URL_ENDPOINT).concat(_constants2.IP_ENDPOINT),
|
|
364
579
|
method: _types3.HTTP_METHODS.GET,
|
|
@@ -366,98 +581,115 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
366
581
|
service: _types3.ALLOWED_SERVICES.MOBIUS
|
|
367
582
|
});
|
|
368
583
|
case 5:
|
|
369
|
-
temp =
|
|
584
|
+
temp = _context0.sent;
|
|
585
|
+
_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), {
|
|
586
|
+
file: _constants2.CALLING_CLIENT_FILE,
|
|
587
|
+
method: _constants2.METHODS.GET_CLIENT_REGION_INFO
|
|
588
|
+
});
|
|
370
589
|
myIP = temp.body.ipv4; // eslint-disable-next-line no-await-in-loop
|
|
371
|
-
|
|
590
|
+
_context0.next = 10;
|
|
372
591
|
return _this3.webex.request({
|
|
373
592
|
uri: "".concat(_constants2.DISCOVERY_URL, "/").concat(myIP),
|
|
374
593
|
method: _types3.HTTP_METHODS.GET,
|
|
375
594
|
addAuthHeader: false,
|
|
376
595
|
headers: (0, _defineProperty2.default)({}, _constants2.SPARK_USER_AGENT, null)
|
|
377
596
|
});
|
|
378
|
-
case
|
|
379
|
-
response =
|
|
597
|
+
case 10:
|
|
598
|
+
response = _context0.sent;
|
|
599
|
+
_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), {
|
|
600
|
+
file: _constants2.CALLING_CLIENT_FILE,
|
|
601
|
+
method: _constants2.METHODS.GET_CLIENT_REGION_INFO
|
|
602
|
+
});
|
|
380
603
|
clientRegionInfo = response.body;
|
|
381
604
|
regionInfo.clientRegion = clientRegionInfo !== null && clientRegionInfo !== void 0 && clientRegionInfo.clientRegion ? clientRegionInfo.clientRegion : '';
|
|
382
605
|
regionInfo.countryCode = clientRegionInfo !== null && clientRegionInfo !== void 0 && clientRegionInfo.countryCode ? clientRegionInfo.countryCode : '';
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
606
|
+
_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), {
|
|
607
|
+
file: _constants2.CALLING_CLIENT_FILE,
|
|
608
|
+
method: _constants2.METHODS.GET_CLIENT_REGION_INFO
|
|
609
|
+
});
|
|
610
|
+
|
|
611
|
+
// Metrics for region info - trying clusters in loop
|
|
612
|
+
_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 : '');
|
|
613
|
+
return _context0.abrupt("return", 0);
|
|
614
|
+
case 20:
|
|
615
|
+
_context0.prev = 20;
|
|
616
|
+
_context0.t0 = _context0["catch"](2);
|
|
617
|
+
_Logger.default.error("Failed to get client region info: ".concat((0, _stringify.default)(_context0.t0)), {
|
|
389
618
|
method: _constants2.METHODS.GET_CLIENT_REGION_INFO,
|
|
390
619
|
file: _constants2.CALLING_CLIENT_FILE
|
|
391
620
|
});
|
|
392
621
|
|
|
393
622
|
// eslint-disable-next-line no-await-in-loop
|
|
394
|
-
|
|
395
|
-
return (0, _Utils.handleCallingClientErrors)(
|
|
623
|
+
_context0.next = 25;
|
|
624
|
+
return (0, _Utils.handleCallingClientErrors)(_context0.t0, function (clientError) {
|
|
396
625
|
var _headers$trackingId, _headers3;
|
|
397
|
-
_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 =
|
|
626
|
+
_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 = _context0.t0.headers) === null || _headers3 === void 0 ? void 0 : _headers3.trackingId) !== null && _headers$trackingId !== void 0 ? _headers$trackingId : '', undefined, clientError);
|
|
398
627
|
_this3.emit(_types2.CALLING_CLIENT_EVENT_KEYS.ERROR, clientError);
|
|
399
628
|
}, {
|
|
400
629
|
method: _constants2.GET_MOBIUS_SERVERS_UTIL,
|
|
401
630
|
file: _constants2.CALLING_CLIENT_FILE
|
|
402
631
|
});
|
|
403
|
-
case
|
|
404
|
-
abort =
|
|
632
|
+
case 25:
|
|
633
|
+
abort = _context0.sent;
|
|
405
634
|
regionInfo.clientRegion = '';
|
|
406
635
|
regionInfo.countryCode = '';
|
|
407
636
|
if (!abort) {
|
|
408
|
-
|
|
637
|
+
_context0.next = 32;
|
|
409
638
|
break;
|
|
410
639
|
}
|
|
411
|
-
|
|
640
|
+
_context0.next = 31;
|
|
641
|
+
return (0, _Utils.uploadLogs)();
|
|
642
|
+
case 31:
|
|
643
|
+
return _context0.abrupt("return", {
|
|
412
644
|
v: regionInfo
|
|
413
645
|
});
|
|
414
|
-
case
|
|
646
|
+
case 32:
|
|
415
647
|
case "end":
|
|
416
|
-
return
|
|
648
|
+
return _context0.stop();
|
|
417
649
|
}
|
|
418
|
-
},
|
|
650
|
+
}, _loop2, null, [[2, 20]]);
|
|
419
651
|
});
|
|
420
|
-
|
|
652
|
+
_iterator2.s();
|
|
421
653
|
case 6:
|
|
422
|
-
if ((
|
|
423
|
-
|
|
654
|
+
if ((_step2 = _iterator2.n()).done) {
|
|
655
|
+
_context1.next = 15;
|
|
424
656
|
break;
|
|
425
657
|
}
|
|
426
|
-
return
|
|
658
|
+
return _context1.delegateYield(_loop2(), "t0", 8);
|
|
427
659
|
case 8:
|
|
428
|
-
_ret =
|
|
660
|
+
_ret = _context1.t0;
|
|
429
661
|
if (!(_ret === 0)) {
|
|
430
|
-
|
|
662
|
+
_context1.next = 11;
|
|
431
663
|
break;
|
|
432
664
|
}
|
|
433
|
-
return
|
|
665
|
+
return _context1.abrupt("break", 15);
|
|
434
666
|
case 11:
|
|
435
667
|
if (!_ret) {
|
|
436
|
-
|
|
668
|
+
_context1.next = 13;
|
|
437
669
|
break;
|
|
438
670
|
}
|
|
439
|
-
return
|
|
671
|
+
return _context1.abrupt("return", _ret.v);
|
|
440
672
|
case 13:
|
|
441
|
-
|
|
673
|
+
_context1.next = 6;
|
|
442
674
|
break;
|
|
443
675
|
case 15:
|
|
444
|
-
|
|
676
|
+
_context1.next = 20;
|
|
445
677
|
break;
|
|
446
678
|
case 17:
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
679
|
+
_context1.prev = 17;
|
|
680
|
+
_context1.t1 = _context1["catch"](3);
|
|
681
|
+
_iterator2.e(_context1.t1);
|
|
450
682
|
case 20:
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
return
|
|
683
|
+
_context1.prev = 20;
|
|
684
|
+
_iterator2.f();
|
|
685
|
+
return _context1.finish(20);
|
|
454
686
|
case 23:
|
|
455
|
-
return
|
|
687
|
+
return _context1.abrupt("return", regionInfo);
|
|
456
688
|
case 24:
|
|
457
689
|
case "end":
|
|
458
|
-
return
|
|
690
|
+
return _context1.stop();
|
|
459
691
|
}
|
|
460
|
-
},
|
|
692
|
+
}, _callee9, this, [[3, 17, 20, 23]]);
|
|
461
693
|
}));
|
|
462
694
|
function getClientRegionInfo() {
|
|
463
695
|
return _getClientRegionInfo.apply(this, arguments);
|
|
@@ -471,15 +703,15 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
471
703
|
}, {
|
|
472
704
|
key: "getMobiusServers",
|
|
473
705
|
value: (function () {
|
|
474
|
-
var _getMobiusServers = (0, _asyncToGenerator2.default)(
|
|
706
|
+
var _getMobiusServers = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee0() {
|
|
475
707
|
var _this$sdkConfig3,
|
|
476
708
|
_this$sdkConfig3$disc,
|
|
477
709
|
_this$sdkConfig4,
|
|
478
710
|
_this$sdkConfig4$disc,
|
|
479
711
|
_this4 = this;
|
|
480
|
-
var useDefault, clientRegion, countryCode, _this$sdkConfig5, _this$sdkConfig5$disc, _this$sdkConfig6, _this$sdkConfig6$disc, regionInfo,
|
|
481
|
-
return _regenerator.default.wrap(function
|
|
482
|
-
while (1) switch (
|
|
712
|
+
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, abort;
|
|
713
|
+
return _regenerator.default.wrap(function _callee0$(_context10) {
|
|
714
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
483
715
|
case 0:
|
|
484
716
|
_Logger.default.info(_constants.METHOD_START_MESSAGE, {
|
|
485
717
|
file: _constants2.CALLING_CLIENT_FILE,
|
|
@@ -494,7 +726,7 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
494
726
|
*/
|
|
495
727
|
useDefault = false;
|
|
496
728
|
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)) {
|
|
497
|
-
|
|
729
|
+
_context10.next = 9;
|
|
498
730
|
break;
|
|
499
731
|
}
|
|
500
732
|
_Logger.default.log('Updating region and country from the SDK config', {
|
|
@@ -504,27 +736,30 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
504
736
|
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;
|
|
505
737
|
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;
|
|
506
738
|
this.mobiusHost = this.webex.internal.services._serviceUrls.mobius;
|
|
507
|
-
|
|
739
|
+
_context10.next = 15;
|
|
508
740
|
break;
|
|
509
741
|
case 9:
|
|
510
742
|
_Logger.default.log('Updating region and country through Region discovery', {
|
|
511
743
|
file: _constants2.CALLING_CLIENT_FILE,
|
|
512
744
|
method: _constants2.GET_MOBIUS_SERVERS_UTIL
|
|
513
745
|
});
|
|
514
|
-
|
|
746
|
+
_context10.next = 12;
|
|
515
747
|
return this.getClientRegionInfo();
|
|
516
748
|
case 12:
|
|
517
|
-
regionInfo =
|
|
749
|
+
regionInfo = _context10.sent;
|
|
518
750
|
clientRegion = regionInfo.clientRegion;
|
|
519
751
|
countryCode = regionInfo.countryCode;
|
|
520
752
|
case 15:
|
|
521
753
|
if (!(clientRegion && countryCode)) {
|
|
522
|
-
|
|
754
|
+
_context10.next = 42;
|
|
523
755
|
break;
|
|
524
756
|
}
|
|
525
|
-
_Logger.default.log("Found Region: ".concat(clientRegion, " and country: ").concat(countryCode, ", going to fetch Mobius server"),
|
|
526
|
-
|
|
527
|
-
|
|
757
|
+
_Logger.default.log("Found Region: ".concat(clientRegion, " and country: ").concat(countryCode, ", going to fetch Mobius server"), {
|
|
758
|
+
file: _constants2.CALLING_CLIENT_FILE,
|
|
759
|
+
method: _constants2.GET_MOBIUS_SERVERS_UTIL
|
|
760
|
+
});
|
|
761
|
+
_context10.prev = 17;
|
|
762
|
+
_context10.next = 20;
|
|
528
763
|
return this.webex.request({
|
|
529
764
|
uri: "".concat(this.mobiusHost).concat(_constants2.URL_ENDPOINT, "?regionCode=").concat(clientRegion, "&countryCode=").concat(countryCode),
|
|
530
765
|
method: _types3.HTTP_METHODS.GET,
|
|
@@ -532,54 +767,74 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
532
767
|
service: _types3.ALLOWED_SERVICES.MOBIUS
|
|
533
768
|
});
|
|
534
769
|
case 20:
|
|
535
|
-
|
|
536
|
-
_Logger.default.log(
|
|
537
|
-
|
|
770
|
+
response = _context10.sent;
|
|
771
|
+
_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), {
|
|
772
|
+
file: _constants2.CALLING_CLIENT_FILE,
|
|
773
|
+
method: _constants2.GET_MOBIUS_SERVERS_UTIL
|
|
774
|
+
});
|
|
775
|
+
mobiusServers = response.body; // Metrics for mobius servers
|
|
776
|
+
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 : '');
|
|
777
|
+
|
|
538
778
|
/* update arrays of Mobius Uris. */
|
|
539
779
|
mobiusUris = (0, _Utils.filterMobiusUris)(mobiusServers, this.mobiusHost);
|
|
540
780
|
this.primaryMobiusUris = mobiusUris.primary;
|
|
541
781
|
this.backupMobiusUris = mobiusUris.backup;
|
|
542
|
-
_Logger.default.
|
|
543
|
-
|
|
782
|
+
_Logger.default.log("Final list of Mobius Servers, primary: ".concat(mobiusUris.primary, " and backup: ").concat(mobiusUris.backup), {
|
|
783
|
+
file: _constants2.CALLING_CLIENT_FILE,
|
|
784
|
+
method: _constants2.GET_MOBIUS_SERVERS_UTIL
|
|
785
|
+
});
|
|
786
|
+
_context10.next = 40;
|
|
544
787
|
break;
|
|
545
|
-
case
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
_Logger.default.error(extendedError, {
|
|
788
|
+
case 30:
|
|
789
|
+
_context10.prev = 30;
|
|
790
|
+
_context10.t0 = _context10["catch"](17);
|
|
791
|
+
_Logger.default.error("Failed to get Mobius servers: ".concat((0, _stringify.default)(_context10.t0)), {
|
|
550
792
|
method: _constants2.METHODS.GET_MOBIUS_SERVERS,
|
|
551
793
|
file: _constants2.CALLING_CLIENT_FILE
|
|
552
794
|
});
|
|
553
|
-
|
|
795
|
+
_context10.next = 35;
|
|
796
|
+
return (0, _Utils.handleCallingClientErrors)(_context10.t0, function (clientError) {
|
|
554
797
|
var _headers$trackingId2, _headers5;
|
|
555
|
-
_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 =
|
|
798
|
+
_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 = _context10.t0.headers) === null || _headers5 === void 0 ? void 0 : _headers5.trackingId) !== null && _headers$trackingId2 !== void 0 ? _headers$trackingId2 : '', undefined, clientError);
|
|
556
799
|
_this4.emit(_types2.CALLING_CLIENT_EVENT_KEYS.ERROR, clientError);
|
|
557
800
|
}, {
|
|
558
801
|
method: _constants2.GET_MOBIUS_SERVERS_UTIL,
|
|
559
802
|
file: _constants2.CALLING_CLIENT_FILE
|
|
560
803
|
});
|
|
561
|
-
useDefault = true;
|
|
562
804
|
case 35:
|
|
563
|
-
|
|
805
|
+
abort = _context10.sent;
|
|
806
|
+
if (!abort) {
|
|
807
|
+
_context10.next = 39;
|
|
808
|
+
break;
|
|
809
|
+
}
|
|
810
|
+
_context10.next = 39;
|
|
811
|
+
return (0, _Utils.uploadLogs)();
|
|
812
|
+
case 39:
|
|
813
|
+
useDefault = true;
|
|
814
|
+
case 40:
|
|
815
|
+
_context10.next = 43;
|
|
564
816
|
break;
|
|
565
|
-
case
|
|
817
|
+
case 42:
|
|
566
818
|
/* Setting this to true because region info is possibly undefined */
|
|
567
819
|
useDefault = true;
|
|
568
|
-
case
|
|
820
|
+
case 43:
|
|
569
821
|
/* Use a default URL if Mobius discovery fails either because of region info failure
|
|
570
822
|
* or because the discovered Mobius couldn't be reached
|
|
571
823
|
*/
|
|
572
824
|
|
|
573
825
|
if (useDefault) {
|
|
574
|
-
_Logger.default.warn("Couldn't resolve the region and country code. Defaulting to the catalog entries to discover mobius servers",
|
|
826
|
+
_Logger.default.warn("Couldn't resolve the region and country code. Defaulting to the catalog entries to discover mobius servers", {
|
|
827
|
+
file: _constants2.CALLING_CLIENT_FILE,
|
|
828
|
+
method: _constants2.GET_MOBIUS_SERVERS_UTIL
|
|
829
|
+
});
|
|
575
830
|
this.mobiusHost = "https://".concat(this.mobiusClusters[0].host).concat(_constants2.API_V1);
|
|
576
831
|
this.primaryMobiusUris = ["".concat(this.mobiusHost).concat(_constants2.URL_ENDPOINT)];
|
|
577
832
|
}
|
|
578
|
-
case
|
|
833
|
+
case 44:
|
|
579
834
|
case "end":
|
|
580
|
-
return
|
|
835
|
+
return _context10.stop();
|
|
581
836
|
}
|
|
582
|
-
},
|
|
837
|
+
}, _callee0, this, [[17, 30]]);
|
|
583
838
|
}));
|
|
584
839
|
function getMobiusServers() {
|
|
585
840
|
return _getMobiusServers.apply(this, arguments);
|
|
@@ -630,25 +885,25 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
630
885
|
method: _constants2.METHODS.REGISTER_SESSIONS_LISTENER
|
|
631
886
|
});
|
|
632
887
|
this.sdkConnector.registerListener(_types2.MOBIUS_EVENT_KEYS.CALL_SESSION_EVENT_INCLUSIVE, /*#__PURE__*/function () {
|
|
633
|
-
var
|
|
888
|
+
var _ref6 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1(event) {
|
|
634
889
|
var sessionArr, i;
|
|
635
|
-
return _regenerator.default.wrap(function
|
|
636
|
-
while (1) switch (
|
|
890
|
+
return _regenerator.default.wrap(function _callee1$(_context11) {
|
|
891
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
637
892
|
case 0:
|
|
638
893
|
if (!(event && event.data.userSessions.userSessions)) {
|
|
639
|
-
|
|
894
|
+
_context11.next = 7;
|
|
640
895
|
break;
|
|
641
896
|
}
|
|
642
897
|
sessionArr = event === null || event === void 0 ? void 0 : event.data.userSessions.userSessions;
|
|
643
898
|
if (!(sessionArr.length === 1)) {
|
|
644
|
-
|
|
899
|
+
_context11.next = 5;
|
|
645
900
|
break;
|
|
646
901
|
}
|
|
647
902
|
if (!(sessionArr[0].sessionType !== _types2.SessionType.WEBEX_CALLING)) {
|
|
648
|
-
|
|
903
|
+
_context11.next = 5;
|
|
649
904
|
break;
|
|
650
905
|
}
|
|
651
|
-
return
|
|
906
|
+
return _context11.abrupt("return");
|
|
652
907
|
case 5:
|
|
653
908
|
for (i = 0; i < sessionArr.length; i += 1) {
|
|
654
909
|
if (sessionArr[i].sessionType !== _types2.SessionType.WEBEX_CALLING) {
|
|
@@ -658,12 +913,12 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
658
913
|
_this5.emit(_types2.CALLING_CLIENT_EVENT_KEYS.USER_SESSION_INFO, event);
|
|
659
914
|
case 7:
|
|
660
915
|
case "end":
|
|
661
|
-
return
|
|
916
|
+
return _context11.stop();
|
|
662
917
|
}
|
|
663
|
-
},
|
|
918
|
+
}, _callee1);
|
|
664
919
|
}));
|
|
665
920
|
return function (_x) {
|
|
666
|
-
return
|
|
921
|
+
return _ref6.apply(this, arguments);
|
|
667
922
|
};
|
|
668
923
|
}());
|
|
669
924
|
}
|
|
@@ -675,11 +930,11 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
675
930
|
}, {
|
|
676
931
|
key: "createLine",
|
|
677
932
|
value: (function () {
|
|
678
|
-
var _createLine = (0, _asyncToGenerator2.default)(
|
|
933
|
+
var _createLine = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10() {
|
|
679
934
|
var _this$sdkConfig7, _this$sdkConfig8;
|
|
680
935
|
var line;
|
|
681
|
-
return _regenerator.default.wrap(function
|
|
682
|
-
while (1) switch (
|
|
936
|
+
return _regenerator.default.wrap(function _callee10$(_context12) {
|
|
937
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
683
938
|
case 0:
|
|
684
939
|
_Logger.default.info(_constants.METHOD_START_MESSAGE, {
|
|
685
940
|
file: _constants2.CALLING_CLIENT_FILE,
|
|
@@ -689,9 +944,9 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
689
944
|
this.lineDict[line.lineId] = line;
|
|
690
945
|
case 3:
|
|
691
946
|
case "end":
|
|
692
|
-
return
|
|
947
|
+
return _context12.stop();
|
|
693
948
|
}
|
|
694
|
-
},
|
|
949
|
+
}, _callee10, this);
|
|
695
950
|
}));
|
|
696
951
|
function createLine() {
|
|
697
952
|
return _createLine.apply(this, arguments);
|
|
@@ -756,27 +1011,27 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
756
1011
|
}, {
|
|
757
1012
|
key: "uploadLogs",
|
|
758
1013
|
value: (function () {
|
|
759
|
-
var _uploadLogs2 = (0, _asyncToGenerator2.default)(
|
|
1014
|
+
var _uploadLogs2 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11() {
|
|
760
1015
|
var result;
|
|
761
|
-
return _regenerator.default.wrap(function
|
|
762
|
-
while (1) switch (
|
|
1016
|
+
return _regenerator.default.wrap(function _callee11$(_context13) {
|
|
1017
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
763
1018
|
case 0:
|
|
764
|
-
|
|
1019
|
+
_context13.next = 2;
|
|
765
1020
|
return (0, _Utils.uploadLogs)({}, true);
|
|
766
1021
|
case 2:
|
|
767
|
-
result =
|
|
1022
|
+
result = _context13.sent;
|
|
768
1023
|
if (result) {
|
|
769
|
-
|
|
1024
|
+
_context13.next = 5;
|
|
770
1025
|
break;
|
|
771
1026
|
}
|
|
772
1027
|
throw new Error('Failed to upload logs: No response received.');
|
|
773
1028
|
case 5:
|
|
774
|
-
return
|
|
1029
|
+
return _context13.abrupt("return", result);
|
|
775
1030
|
case 6:
|
|
776
1031
|
case "end":
|
|
777
|
-
return
|
|
1032
|
+
return _context13.stop();
|
|
778
1033
|
}
|
|
779
|
-
},
|
|
1034
|
+
}, _callee11);
|
|
780
1035
|
}));
|
|
781
1036
|
function uploadLogs() {
|
|
782
1037
|
return _uploadLogs2.apply(this, arguments);
|
|
@@ -792,24 +1047,24 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
792
1047
|
* @param config - Config to start the CallingClient with.
|
|
793
1048
|
*/
|
|
794
1049
|
var createClient = exports.createClient = /*#__PURE__*/function () {
|
|
795
|
-
var
|
|
1050
|
+
var _ref7 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12(webex, config) {
|
|
796
1051
|
var callingClientInstance;
|
|
797
|
-
return _regenerator.default.wrap(function
|
|
798
|
-
while (1) switch (
|
|
1052
|
+
return _regenerator.default.wrap(function _callee12$(_context14) {
|
|
1053
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
799
1054
|
case 0:
|
|
800
1055
|
callingClientInstance = new CallingClient(webex, config);
|
|
801
|
-
|
|
1056
|
+
_context14.next = 3;
|
|
802
1057
|
return callingClientInstance.init();
|
|
803
1058
|
case 3:
|
|
804
|
-
return
|
|
1059
|
+
return _context14.abrupt("return", callingClientInstance);
|
|
805
1060
|
case 4:
|
|
806
1061
|
case "end":
|
|
807
|
-
return
|
|
1062
|
+
return _context14.stop();
|
|
808
1063
|
}
|
|
809
|
-
},
|
|
1064
|
+
}, _callee12);
|
|
810
1065
|
}));
|
|
811
1066
|
return function createClient(_x2, _x3) {
|
|
812
|
-
return
|
|
1067
|
+
return _ref7.apply(this, arguments);
|
|
813
1068
|
};
|
|
814
1069
|
}();
|
|
815
1070
|
//# sourceMappingURL=CallingClient.js.map
|