@webex/calling 3.0.0-next.8 → 3.0.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 +49 -49
- package/dist/CallHistory/CallHistory.js.map +1 -1
- package/dist/CallHistory/CallHistory.test.js +9 -0
- package/dist/CallHistory/CallHistory.test.js.map +1 -1
- package/dist/CallHistory/callHistoryFixtures.js +63 -7
- package/dist/CallHistory/callHistoryFixtures.js.map +1 -1
- package/dist/CallHistory/constants.js +9 -18
- package/dist/CallHistory/constants.js.map +1 -1
- package/dist/CallHistory/types.js.map +1 -1
- package/dist/CallSettings/CallSettings.js +18 -13
- package/dist/CallSettings/CallSettings.js.map +1 -1
- package/dist/CallSettings/CallSettings.test.js.map +1 -1
- package/dist/CallSettings/UcmBackendConnector.js +7 -8
- package/dist/CallSettings/UcmBackendConnector.js.map +1 -1
- package/dist/CallSettings/UcmBackendConnector.test.js +69 -37
- package/dist/CallSettings/UcmBackendConnector.test.js.map +1 -1
- package/dist/CallSettings/WxCallBackendConnector.js +19 -13
- package/dist/CallSettings/WxCallBackendConnector.js.map +1 -1
- package/dist/CallSettings/WxCallBackendConnector.test.js +2 -2
- package/dist/CallSettings/WxCallBackendConnector.test.js.map +1 -1
- package/dist/CallSettings/constants.js +11 -22
- package/dist/CallSettings/constants.js.map +1 -1
- package/dist/CallSettings/testFixtures.js +4 -8
- package/dist/CallSettings/testFixtures.js.map +1 -1
- package/dist/CallSettings/types.js.map +1 -1
- package/dist/CallingClient/CallingClient.js +134 -75
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +170 -109
- package/dist/CallingClient/CallingClient.test.js.map +1 -1
- package/dist/CallingClient/callRecordFixtures.js +2 -4
- package/dist/CallingClient/callRecordFixtures.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/index.js +9 -29
- package/dist/CallingClient/calling/CallerId/index.js.map +1 -1
- 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 +140 -80
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +651 -409
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/CallingClient/calling/callManager.js +3 -14
- package/dist/CallingClient/calling/callManager.js.map +1 -1
- package/dist/CallingClient/calling/callManager.test.js +1 -1
- package/dist/CallingClient/calling/callManager.test.js.map +1 -1
- package/dist/CallingClient/calling/types.js +31 -33
- package/dist/CallingClient/calling/types.js.map +1 -1
- package/dist/CallingClient/callingClientFixtures.js +107 -17
- package/dist/CallingClient/callingClientFixtures.js.map +1 -1
- package/dist/CallingClient/constants.js +101 -193
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/CallingClient/line/index.js +20 -18
- package/dist/CallingClient/line/index.js.map +1 -1
- package/dist/CallingClient/line/line.test.js +13 -13
- package/dist/CallingClient/line/line.test.js.map +1 -1
- package/dist/CallingClient/line/types.js +7 -11
- package/dist/CallingClient/line/types.js.map +1 -1
- package/dist/CallingClient/registration/register.js +102 -111
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +33 -32
- package/dist/CallingClient/registration/register.test.js.map +1 -1
- package/dist/CallingClient/registration/registerFixtures.js +5 -10
- package/dist/CallingClient/registration/registerFixtures.js.map +1 -1
- package/dist/CallingClient/registration/types.js.map +1 -1
- package/dist/CallingClient/types.js.map +1 -1
- package/dist/Contacts/ContactsClient.js +30 -19
- package/dist/Contacts/ContactsClient.js.map +1 -1
- package/dist/Contacts/ContactsClient.test.js +4 -4
- package/dist/Contacts/ContactsClient.test.js.map +1 -1
- package/dist/Contacts/constants.js +10 -18
- package/dist/Contacts/constants.js.map +1 -1
- package/dist/Contacts/contactFixtures.js +26 -52
- package/dist/Contacts/contactFixtures.js.map +1 -1
- package/dist/Contacts/types.js +29 -9
- package/dist/Contacts/types.js.map +1 -1
- package/dist/Errors/catalog/CallError.js +3 -5
- package/dist/Errors/catalog/CallError.js.map +1 -1
- package/dist/Errors/catalog/CallingDeviceError.js +4 -6
- package/dist/Errors/catalog/CallingDeviceError.js.map +1 -1
- package/dist/Errors/catalog/ExtendedError.js +2 -3
- package/dist/Errors/catalog/ExtendedError.js.map +1 -1
- package/dist/Errors/catalog/LineError.js +5 -7
- package/dist/Errors/catalog/LineError.js.map +1 -1
- package/dist/Errors/index.js +7 -0
- package/dist/Errors/index.js.map +1 -1
- package/dist/Errors/types.js +15 -20
- package/dist/Errors/types.js.map +1 -1
- package/dist/Events/impl/index.js +2 -3
- package/dist/Events/impl/index.js.map +1 -1
- package/dist/Events/types.js +44 -52
- package/dist/Events/types.js.map +1 -1
- package/dist/Logger/index.js +1 -2
- package/dist/Logger/index.js.map +1 -1
- package/dist/Logger/index.test.js.map +1 -1
- package/dist/Logger/types.js +9 -12
- package/dist/Logger/types.js.map +1 -1
- package/dist/Metrics/index.js +2 -4
- package/dist/Metrics/index.js.map +1 -1
- package/dist/Metrics/index.test.js +3 -3
- package/dist/Metrics/index.test.js.map +1 -1
- package/dist/Metrics/types.js +15 -20
- package/dist/Metrics/types.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/SDKConnector/utils.js +1 -2
- package/dist/SDKConnector/utils.js.map +1 -1
- package/dist/Voicemail/BroadworksBackendConnector.js +21 -12
- package/dist/Voicemail/BroadworksBackendConnector.js.map +1 -1
- package/dist/Voicemail/BroadworksBackendConnector.test.js +2 -2
- package/dist/Voicemail/BroadworksBackendConnector.test.js.map +1 -1
- package/dist/Voicemail/UcmBackendConnector.js +19 -11
- package/dist/Voicemail/UcmBackendConnector.js.map +1 -1
- package/dist/Voicemail/UcmBackendConnector.test.js +5 -4
- package/dist/Voicemail/UcmBackendConnector.test.js.map +1 -1
- package/dist/Voicemail/Voicemail.js +35 -33
- package/dist/Voicemail/Voicemail.js.map +1 -1
- package/dist/Voicemail/Voicemail.test.js.map +1 -1
- package/dist/Voicemail/WxCallBackendConnector.js +18 -11
- package/dist/Voicemail/WxCallBackendConnector.js.map +1 -1
- package/dist/Voicemail/WxCallBackendConnector.test.js +4 -4
- package/dist/Voicemail/WxCallBackendConnector.test.js.map +1 -1
- package/dist/Voicemail/constants.js +29 -58
- package/dist/Voicemail/constants.js.map +1 -1
- package/dist/Voicemail/types.js.map +1 -1
- package/dist/Voicemail/voicemailFixture.js +35 -70
- package/dist/Voicemail/voicemailFixture.js.map +1 -1
- package/dist/api.js +13 -20
- package/dist/api.js.map +1 -1
- package/dist/common/Utils.js +18 -25
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +3 -3
- package/dist/common/Utils.test.js.map +1 -1
- package/dist/common/constants.js +41 -82
- package/dist/common/constants.js.map +1 -1
- package/dist/common/testUtil.js +12 -21
- package/dist/common/testUtil.js.map +1 -1
- package/dist/common/types.js +34 -43
- package/dist/common/types.js.map +1 -1
- package/dist/index.js +246 -0
- package/dist/index.js.map +1 -1
- package/dist/module/CallHistory/CallHistory.js +7 -5
- package/dist/module/CallHistory/callHistoryFixtures.js +59 -0
- package/dist/module/CallSettings/UcmBackendConnector.js +4 -4
- package/dist/module/CallingClient/CallingClient.js +59 -42
- package/dist/module/CallingClient/calling/CallerId/index.js +3 -23
- package/dist/module/CallingClient/calling/call.js +69 -26
- package/dist/module/CallingClient/calling/callManager.js +0 -6
- package/dist/module/CallingClient/callingClientFixtures.js +119 -1
- package/dist/module/CallingClient/constants.js +8 -4
- package/dist/module/CallingClient/line/index.js +9 -12
- package/dist/module/CallingClient/line/types.js +0 -5
- package/dist/module/CallingClient/registration/register.js +28 -20
- package/dist/module/Errors/catalog/CallingDeviceError.js +2 -2
- package/dist/module/Errors/catalog/LineError.js +2 -2
- package/dist/module/Errors/index.js +1 -0
- package/dist/module/Events/types.js +2 -0
- package/dist/module/common/Utils.js +14 -19
- package/dist/module/common/testUtil.js +2 -1
- package/dist/module/common/types.js +6 -5
- package/dist/module/index.js +9 -0
- package/dist/types/CallHistory/CallHistory.d.ts +2 -1
- package/dist/types/CallHistory/CallHistory.d.ts.map +1 -1
- package/dist/types/CallHistory/callHistoryFixtures.d.ts +1 -0
- package/dist/types/CallHistory/callHistoryFixtures.d.ts.map +1 -1
- package/dist/types/CallSettings/UcmBackendConnector.d.ts +1 -1
- package/dist/types/CallSettings/UcmBackendConnector.d.ts.map +1 -1
- package/dist/types/CallSettings/types.d.ts +1 -0
- package/dist/types/CallSettings/types.d.ts.map +1 -1
- package/dist/types/CallingClient/CallingClient.d.ts +2 -0
- package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/CallerId/index.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/CallerId/types.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/call.d.ts +2 -0
- package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/callManager.d.ts +0 -1
- package/dist/types/CallingClient/calling/callManager.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/types.d.ts +30 -30
- package/dist/types/CallingClient/calling/types.d.ts.map +1 -1
- package/dist/types/CallingClient/callingClientFixtures.d.ts +69 -1
- package/dist/types/CallingClient/callingClientFixtures.d.ts.map +1 -1
- package/dist/types/CallingClient/constants.d.ts +7 -3
- package/dist/types/CallingClient/constants.d.ts.map +1 -1
- package/dist/types/CallingClient/line/index.d.ts +6 -6
- package/dist/types/CallingClient/line/index.d.ts.map +1 -1
- package/dist/types/CallingClient/line/types.d.ts +11 -23
- package/dist/types/CallingClient/line/types.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/register.d.ts +3 -3
- package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/types.d.ts +14 -14
- package/dist/types/CallingClient/registration/types.d.ts.map +1 -1
- package/dist/types/CallingClient/types.d.ts +6 -4
- package/dist/types/CallingClient/types.d.ts.map +1 -1
- package/dist/types/Contacts/ContactsClient.d.ts +1 -1
- package/dist/types/Errors/catalog/CallingDeviceError.d.ts +4 -4
- package/dist/types/Errors/catalog/CallingDeviceError.d.ts.map +1 -1
- package/dist/types/Errors/catalog/LineError.d.ts +4 -4
- package/dist/types/Errors/catalog/LineError.d.ts.map +1 -1
- package/dist/types/Errors/index.d.ts +1 -0
- package/dist/types/Errors/index.d.ts.map +1 -1
- package/dist/types/Errors/types.d.ts +2 -3
- package/dist/types/Errors/types.d.ts.map +1 -1
- package/dist/types/Events/types.d.ts +28 -5
- package/dist/types/Events/types.d.ts.map +1 -1
- package/dist/types/SDKConnector/types.d.ts +2 -1
- package/dist/types/SDKConnector/types.d.ts.map +1 -1
- package/dist/types/Voicemail/UcmBackendConnector.d.ts +1 -1
- package/dist/types/Voicemail/Voicemail.d.ts.map +1 -1
- package/dist/types/Voicemail/WxCallBackendConnector.d.ts +1 -1
- package/dist/types/Voicemail/types.d.ts +10 -10
- package/dist/types/Voicemail/types.d.ts.map +1 -1
- package/dist/types/api.d.ts +4 -5
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/common/Utils.d.ts.map +1 -1
- package/dist/types/common/testUtil.d.ts +1 -0
- package/dist/types/common/testUtil.d.ts.map +1 -1
- package/dist/types/common/types.d.ts +3 -2
- package/dist/types/common/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +13 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
var _typeof = require("@babel/runtime-corejs2/helpers/typeof");
|
|
4
4
|
var _Reflect$construct = require("@babel/runtime-corejs2/core-js/reflect/construct");
|
|
5
|
+
var _Array$from = require("@babel/runtime-corejs2/core-js/array/from");
|
|
6
|
+
var _Symbol = require("@babel/runtime-corejs2/core-js/symbol");
|
|
7
|
+
var _Symbol$iterator = require("@babel/runtime-corejs2/core-js/symbol/iterator");
|
|
8
|
+
var _Array$isArray = require("@babel/runtime-corejs2/core-js/array/is-array");
|
|
5
9
|
var _WeakMap = require("@babel/runtime-corejs2/core-js/weak-map");
|
|
6
10
|
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
7
11
|
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptor");
|
|
@@ -33,22 +37,30 @@ var _Logger = _interopRequireDefault(require("../Logger"));
|
|
|
33
37
|
var _callManager = require("./calling/callManager");
|
|
34
38
|
var _constants = require("./constants");
|
|
35
39
|
var _line = _interopRequireDefault(require("./line"));
|
|
36
|
-
var _types4 = require("
|
|
37
|
-
var _types5 = require("../Metrics/types");
|
|
40
|
+
var _types4 = require("../Metrics/types");
|
|
38
41
|
var _Metrics = require("../Metrics");
|
|
39
|
-
function _getRequireWildcardCache(
|
|
40
|
-
function _interopRequireWildcard(
|
|
42
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof _WeakMap) return null; var r = new _WeakMap(), t = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
43
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? _Object$getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? _Object$defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
44
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && o[_Symbol$iterator] || o["@@iterator"]; if (!it) { if (_Array$isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
45
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
46
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
41
47
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
42
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
48
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /* eslint-disable no-underscore-dangle */ /* eslint-disable valid-jsdoc */ /* eslint-disable @typescript-eslint/no-shadow */
|
|
43
49
|
/**
|
|
50
|
+
* The `CallingClient` module provides a set of APIs for line registration and calling functionalities within the SDK.
|
|
44
51
|
*
|
|
52
|
+
* The following code snippet demonstrates how to create an instance of `CallingClient` using a `webex` instance and `callingConfig`:
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```javascript
|
|
56
|
+
* const callingClient = createClient(webex, callingConfig);
|
|
57
|
+
* ```
|
|
45
58
|
*/
|
|
46
|
-
var CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
59
|
+
var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
47
60
|
(0, _inherits2.default)(CallingClient, _Eventing);
|
|
48
61
|
var _super = _createSuper(CallingClient);
|
|
49
62
|
/**
|
|
50
|
-
* @
|
|
51
|
-
* @param config - Config to start the CallingClient with.
|
|
63
|
+
* @ignore
|
|
52
64
|
*/
|
|
53
65
|
function CallingClient(webex, config) {
|
|
54
66
|
var _this$sdkConfig, _this$sdkConfig$servi, _this$sdkConfig2, _this$sdkConfig2$logg;
|
|
@@ -63,6 +75,8 @@ var CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
63
75
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "sdkConfig", void 0);
|
|
64
76
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "primaryMobiusUris", void 0);
|
|
65
77
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "backupMobiusUris", void 0);
|
|
78
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "mobiusClusters", void 0);
|
|
79
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "mobiusHost", void 0);
|
|
66
80
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "mediaEngine", void 0);
|
|
67
81
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "lineDict", {});
|
|
68
82
|
/**
|
|
@@ -129,6 +143,8 @@ var CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
129
143
|
_this.mediaEngine = Media;
|
|
130
144
|
_this.primaryMobiusUris = [];
|
|
131
145
|
_this.backupMobiusUris = [];
|
|
146
|
+
_this.mobiusClusters = _this.webex.internal.services._hostCatalog[_constants.MOBIUS_US_PROD] || _this.webex.internal.services._hostCatalog[_constants.MOBIUS_EU_PROD] || _this.webex.internal.services._hostCatalog[_constants.MOBIUS_US_INT] || _this.webex.internal.services._hostCatalog[_constants.MOBIUS_EU_INT];
|
|
147
|
+
_this.mobiusHost = '';
|
|
132
148
|
_this.registerSessionsListener();
|
|
133
149
|
_Logger.default.setLogger(logLevel, _constants.CALLING_CLIENT_FILE);
|
|
134
150
|
_this.registerCallsClearedListener();
|
|
@@ -136,6 +152,19 @@ var CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
136
152
|
}
|
|
137
153
|
|
|
138
154
|
// async calls required to run after constructor
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Initializes the `CallingClient` by performing the following steps:
|
|
158
|
+
*
|
|
159
|
+
* 1. Retrieves list of servers.
|
|
160
|
+
* 2. Creates a line.
|
|
161
|
+
* 3. Sets up network change detection.
|
|
162
|
+
*
|
|
163
|
+
* This method should be called once to initialize the `callingClient`.
|
|
164
|
+
*
|
|
165
|
+
* @returns A promise that resolves when the initialization is complete.
|
|
166
|
+
* @ignore
|
|
167
|
+
*/
|
|
139
168
|
(0, _createClass2.default)(CallingClient, [{
|
|
140
169
|
key: "init",
|
|
141
170
|
value: function () {
|
|
@@ -167,7 +196,7 @@ var CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
167
196
|
*/
|
|
168
197
|
}, {
|
|
169
198
|
key: "detectNetworkChange",
|
|
170
|
-
value: function () {
|
|
199
|
+
value: (function () {
|
|
171
200
|
var _detectNetworkChange = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
172
201
|
var _this2 = this;
|
|
173
202
|
var retry, line;
|
|
@@ -186,19 +215,26 @@ var CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
186
215
|
file: _constants.CALLING_CLIENT_FILE,
|
|
187
216
|
method: _this2.detectNetworkChange.name
|
|
188
217
|
});
|
|
189
|
-
line.lineEmitter(_types4.LINE_EVENTS.UNREGISTERED);
|
|
190
218
|
line.registration.clearKeepaliveTimer();
|
|
191
219
|
retry = true;
|
|
192
220
|
}
|
|
193
221
|
if (!(retry && _this2.webex.internal.mercury.connected)) {
|
|
194
|
-
_context4.next =
|
|
222
|
+
_context4.next = 9;
|
|
195
223
|
break;
|
|
196
224
|
}
|
|
197
|
-
|
|
225
|
+
if (!(line.getStatus() !== _types3.RegistrationStatus.IDLE)) {
|
|
226
|
+
_context4.next = 8;
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
_context4.next = 5;
|
|
198
230
|
return line.registration.handleConnectionRestoration(retry);
|
|
199
|
-
case 4:
|
|
200
|
-
retry = _context4.sent;
|
|
201
231
|
case 5:
|
|
232
|
+
retry = _context4.sent;
|
|
233
|
+
_context4.next = 9;
|
|
234
|
+
break;
|
|
235
|
+
case 8:
|
|
236
|
+
retry = false;
|
|
237
|
+
case 9:
|
|
202
238
|
case "end":
|
|
203
239
|
return _context4.stop();
|
|
204
240
|
}
|
|
@@ -218,46 +254,56 @@ var CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
218
254
|
/**
|
|
219
255
|
* Fetches countryCode and region of the client.
|
|
220
256
|
*/
|
|
257
|
+
)
|
|
221
258
|
}, {
|
|
222
259
|
key: "getClientRegionInfo",
|
|
223
|
-
value: function () {
|
|
260
|
+
value: (function () {
|
|
224
261
|
var _getClientRegionInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
225
262
|
var _this3 = this;
|
|
226
|
-
var regionInfo,
|
|
263
|
+
var regionInfo, _iterator, _step, mobius, temp, myIP, response, clientRegionInfo;
|
|
227
264
|
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
228
265
|
while (1) switch (_context6.prev = _context6.next) {
|
|
229
266
|
case 0:
|
|
230
267
|
regionInfo = {};
|
|
231
|
-
|
|
232
|
-
_context6.
|
|
268
|
+
_iterator = _createForOfIteratorHelper(this.mobiusClusters);
|
|
269
|
+
_context6.prev = 2;
|
|
270
|
+
_iterator.s();
|
|
271
|
+
case 4:
|
|
272
|
+
if ((_step = _iterator.n()).done) {
|
|
273
|
+
_context6.next = 28;
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
276
|
+
mobius = _step.value;
|
|
277
|
+
this.mobiusHost = "https://".concat(mobius.host).concat(_constants.API_V1);
|
|
278
|
+
_context6.prev = 7;
|
|
279
|
+
_context6.next = 10;
|
|
233
280
|
return this.webex.request({
|
|
234
|
-
uri: "".concat(this.
|
|
281
|
+
uri: "".concat(this.mobiusHost).concat(_constants.URL_ENDPOINT).concat(_constants.IP_ENDPOINT),
|
|
235
282
|
method: _types3.HTTP_METHODS.GET,
|
|
236
|
-
headers: (
|
|
283
|
+
headers: (0, _defineProperty2.default)((0, _defineProperty2.default)({}, _constants.CISCO_DEVICE_URL, this.webex.internal.device.url), _constants.SPARK_USER_AGENT, _constants.CALLING_USER_AGENT),
|
|
237
284
|
service: _types3.ALLOWED_SERVICES.MOBIUS
|
|
238
285
|
});
|
|
239
|
-
case
|
|
286
|
+
case 10:
|
|
240
287
|
temp = _context6.sent;
|
|
241
|
-
myIP = temp.body.ipv4;
|
|
242
|
-
_context6.next =
|
|
288
|
+
myIP = temp.body.ipv4; // eslint-disable-next-line no-await-in-loop
|
|
289
|
+
_context6.next = 14;
|
|
243
290
|
return this.webex.request({
|
|
244
291
|
uri: "".concat(_constants.DISCOVERY_URL, "/").concat(myIP),
|
|
245
292
|
method: _types3.HTTP_METHODS.GET,
|
|
246
293
|
addAuthHeader: false,
|
|
247
294
|
headers: (0, _defineProperty2.default)({}, _constants.SPARK_USER_AGENT, null)
|
|
248
295
|
});
|
|
249
|
-
case
|
|
296
|
+
case 14:
|
|
250
297
|
response = _context6.sent;
|
|
251
298
|
clientRegionInfo = response.body;
|
|
252
299
|
regionInfo.clientRegion = clientRegionInfo !== null && clientRegionInfo !== void 0 && clientRegionInfo.clientRegion ? clientRegionInfo.clientRegion : '';
|
|
253
300
|
regionInfo.countryCode = clientRegionInfo !== null && clientRegionInfo !== void 0 && clientRegionInfo.countryCode ? clientRegionInfo.countryCode : '';
|
|
254
|
-
_context6.
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
_context6.
|
|
258
|
-
_context6.t0 = _context6["catch"](1);
|
|
301
|
+
return _context6.abrupt("break", 28);
|
|
302
|
+
case 21:
|
|
303
|
+
_context6.prev = 21;
|
|
304
|
+
_context6.t0 = _context6["catch"](7);
|
|
259
305
|
(0, _Utils.handleCallingClientErrors)(_context6.t0, function (clientError) {
|
|
260
|
-
_this3.metricManager.submitRegistrationMetric(
|
|
306
|
+
_this3.metricManager.submitRegistrationMetric(_types4.METRIC_EVENT.REGISTRATION_ERROR, _types4.REG_ACTION.REGISTER, _types4.METRIC_TYPE.BEHAVIORAL, clientError);
|
|
261
307
|
_this3.emit(_types2.CALLING_CLIENT_EVENT_KEYS.ERROR, clientError);
|
|
262
308
|
}, {
|
|
263
309
|
method: _constants.GET_MOBIUS_SERVERS_UTIL,
|
|
@@ -265,13 +311,27 @@ var CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
265
311
|
});
|
|
266
312
|
regionInfo.clientRegion = '';
|
|
267
313
|
regionInfo.countryCode = '';
|
|
268
|
-
case
|
|
314
|
+
case 26:
|
|
315
|
+
_context6.next = 4;
|
|
316
|
+
break;
|
|
317
|
+
case 28:
|
|
318
|
+
_context6.next = 33;
|
|
319
|
+
break;
|
|
320
|
+
case 30:
|
|
321
|
+
_context6.prev = 30;
|
|
322
|
+
_context6.t1 = _context6["catch"](2);
|
|
323
|
+
_iterator.e(_context6.t1);
|
|
324
|
+
case 33:
|
|
325
|
+
_context6.prev = 33;
|
|
326
|
+
_iterator.f();
|
|
327
|
+
return _context6.finish(33);
|
|
328
|
+
case 36:
|
|
269
329
|
return _context6.abrupt("return", regionInfo);
|
|
270
|
-
case
|
|
330
|
+
case 37:
|
|
271
331
|
case "end":
|
|
272
332
|
return _context6.stop();
|
|
273
333
|
}
|
|
274
|
-
}, _callee6, this, [[
|
|
334
|
+
}, _callee6, this, [[2, 30, 33, 36], [7, 21]]);
|
|
275
335
|
}));
|
|
276
336
|
function getClientRegionInfo() {
|
|
277
337
|
return _getClientRegionInfo.apply(this, arguments);
|
|
@@ -281,16 +341,17 @@ var CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
281
341
|
/**
|
|
282
342
|
* Local method for finding the mobius servers.
|
|
283
343
|
*/
|
|
344
|
+
)
|
|
284
345
|
}, {
|
|
285
346
|
key: "getMobiusServers",
|
|
286
|
-
value: function () {
|
|
347
|
+
value: (function () {
|
|
287
348
|
var _getMobiusServers = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
|
|
288
349
|
var _this$sdkConfig3,
|
|
289
350
|
_this$sdkConfig3$disc,
|
|
290
351
|
_this$sdkConfig4,
|
|
291
352
|
_this$sdkConfig4$disc,
|
|
292
353
|
_this4 = this;
|
|
293
|
-
var useDefault, clientRegion, countryCode, _this$sdkConfig5, _this$sdkConfig5$disc, _this$sdkConfig6, _this$sdkConfig6$disc, regionInfo,
|
|
354
|
+
var useDefault, clientRegion, countryCode, _this$sdkConfig5, _this$sdkConfig5$disc, _this$sdkConfig6, _this$sdkConfig6$disc, regionInfo, temp, mobiusServers, mobiusUris;
|
|
294
355
|
return _regenerator.default.wrap(function _callee7$(_context7) {
|
|
295
356
|
while (1) switch (_context7.prev = _context7.next) {
|
|
296
357
|
case 0:
|
|
@@ -303,7 +364,7 @@ var CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
303
364
|
*/
|
|
304
365
|
useDefault = false;
|
|
305
366
|
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)) {
|
|
306
|
-
_context7.next =
|
|
367
|
+
_context7.next = 8;
|
|
307
368
|
break;
|
|
308
369
|
}
|
|
309
370
|
_Logger.default.info('Updating region and country from the SDK config', {
|
|
@@ -312,75 +373,77 @@ var CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
312
373
|
});
|
|
313
374
|
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;
|
|
314
375
|
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;
|
|
315
|
-
|
|
376
|
+
this.mobiusHost = this.webex.internal.services._serviceUrls.mobius;
|
|
377
|
+
_context7.next = 14;
|
|
316
378
|
break;
|
|
317
|
-
case
|
|
379
|
+
case 8:
|
|
318
380
|
_Logger.default.info('Updating region and country through Region discovery', {
|
|
319
381
|
file: _constants.CALLING_CLIENT_FILE,
|
|
320
382
|
method: _constants.GET_MOBIUS_SERVERS_UTIL
|
|
321
383
|
});
|
|
322
|
-
_context7.next =
|
|
384
|
+
_context7.next = 11;
|
|
323
385
|
return this.getClientRegionInfo();
|
|
324
|
-
case
|
|
386
|
+
case 11:
|
|
325
387
|
regionInfo = _context7.sent;
|
|
326
388
|
clientRegion = regionInfo.clientRegion;
|
|
327
389
|
countryCode = regionInfo.countryCode;
|
|
328
|
-
case
|
|
390
|
+
case 14:
|
|
329
391
|
if (!(clientRegion && countryCode)) {
|
|
330
|
-
_context7.next =
|
|
392
|
+
_context7.next = 34;
|
|
331
393
|
break;
|
|
332
394
|
}
|
|
333
395
|
_Logger.default.log("Found Region: ".concat(clientRegion, " and country: ").concat(countryCode, ", going to fetch Mobius server"), '');
|
|
334
|
-
_context7.prev =
|
|
335
|
-
_context7.next =
|
|
396
|
+
_context7.prev = 16;
|
|
397
|
+
_context7.next = 19;
|
|
336
398
|
return this.webex.request({
|
|
337
|
-
uri: "".concat(this.
|
|
399
|
+
uri: "".concat(this.mobiusHost).concat(_constants.URL_ENDPOINT, "?regionCode=").concat(clientRegion, "&countryCode=").concat(countryCode),
|
|
338
400
|
method: _types3.HTTP_METHODS.GET,
|
|
339
|
-
headers: (
|
|
401
|
+
headers: (0, _defineProperty2.default)((0, _defineProperty2.default)({}, _constants.CISCO_DEVICE_URL, this.webex.internal.device.url), _constants.SPARK_USER_AGENT, _constants.CALLING_USER_AGENT),
|
|
340
402
|
service: _types3.ALLOWED_SERVICES.MOBIUS
|
|
341
403
|
});
|
|
342
|
-
case
|
|
404
|
+
case 19:
|
|
343
405
|
temp = _context7.sent;
|
|
344
406
|
_Logger.default.log('Mobius Server found for the region', '');
|
|
345
407
|
mobiusServers = temp.body;
|
|
346
408
|
/* update arrays of Mobius Uris. */
|
|
347
|
-
mobiusUris = (0, _Utils.filterMobiusUris)(mobiusServers, this.
|
|
409
|
+
mobiusUris = (0, _Utils.filterMobiusUris)(mobiusServers, this.mobiusHost);
|
|
348
410
|
this.primaryMobiusUris = mobiusUris.primary;
|
|
349
411
|
this.backupMobiusUris = mobiusUris.backup;
|
|
350
412
|
_Logger.default.info("Final list of Mobius Servers, primary: ".concat(mobiusUris.primary, " and backup: ").concat(mobiusUris.backup), '');
|
|
351
|
-
_context7.next =
|
|
413
|
+
_context7.next = 32;
|
|
352
414
|
break;
|
|
353
|
-
case
|
|
354
|
-
_context7.prev =
|
|
355
|
-
_context7.t0 = _context7["catch"](
|
|
415
|
+
case 28:
|
|
416
|
+
_context7.prev = 28;
|
|
417
|
+
_context7.t0 = _context7["catch"](16);
|
|
356
418
|
(0, _Utils.handleCallingClientErrors)(_context7.t0, function (clientError) {
|
|
357
|
-
_this4.metricManager.submitRegistrationMetric(
|
|
419
|
+
_this4.metricManager.submitRegistrationMetric(_types4.METRIC_EVENT.REGISTRATION_ERROR, _types4.REG_ACTION.REGISTER, _types4.METRIC_TYPE.BEHAVIORAL, clientError);
|
|
358
420
|
_this4.emit(_types2.CALLING_CLIENT_EVENT_KEYS.ERROR, clientError);
|
|
359
421
|
}, {
|
|
360
422
|
method: _constants.GET_MOBIUS_SERVERS_UTIL,
|
|
361
423
|
file: _constants.CALLING_CLIENT_FILE
|
|
362
424
|
});
|
|
363
425
|
useDefault = true;
|
|
364
|
-
case
|
|
365
|
-
_context7.next =
|
|
426
|
+
case 32:
|
|
427
|
+
_context7.next = 35;
|
|
366
428
|
break;
|
|
367
|
-
case
|
|
429
|
+
case 34:
|
|
368
430
|
/* Setting this to true because region info is possibly undefined */
|
|
369
431
|
useDefault = true;
|
|
370
|
-
case
|
|
432
|
+
case 35:
|
|
371
433
|
/* Use a default URL if Mobius discovery fails either because of region info failure
|
|
372
434
|
* or because the discovered Mobius couldn't be reached
|
|
373
435
|
*/
|
|
374
436
|
|
|
375
437
|
if (useDefault) {
|
|
376
|
-
_Logger.default.warn('
|
|
377
|
-
this.
|
|
438
|
+
_Logger.default.warn("Couldn't resolve the region and country code. Defaulting to the catalog entries to discover mobius servers", '');
|
|
439
|
+
this.mobiusHost = "https://".concat(this.mobiusClusters[0].host).concat(_constants.API_V1);
|
|
440
|
+
this.primaryMobiusUris = ["".concat(this.mobiusHost).concat(_constants.URL_ENDPOINT)];
|
|
378
441
|
}
|
|
379
|
-
case
|
|
442
|
+
case 36:
|
|
380
443
|
case "end":
|
|
381
444
|
return _context7.stop();
|
|
382
445
|
}
|
|
383
|
-
}, _callee7, this, [[
|
|
446
|
+
}, _callee7, this, [[16, 28]]);
|
|
384
447
|
}));
|
|
385
448
|
function getMobiusServers() {
|
|
386
449
|
return _getMobiusServers.apply(this, arguments);
|
|
@@ -392,6 +455,7 @@ var CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
392
455
|
* event emitted by callManager when all the calls
|
|
393
456
|
* present on sdk are cleaned up.
|
|
394
457
|
*/
|
|
458
|
+
)
|
|
395
459
|
}, {
|
|
396
460
|
key: "registerCallsClearedListener",
|
|
397
461
|
value: function registerCallsClearedListener() {
|
|
@@ -407,25 +471,21 @@ var CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
407
471
|
value:
|
|
408
472
|
/**
|
|
409
473
|
* To get the current log Level.
|
|
410
|
-
*
|
|
411
|
-
* @returns - Log level.
|
|
474
|
+
* @ignore
|
|
412
475
|
*/
|
|
413
476
|
function getLoggingLevel() {
|
|
414
477
|
return _Logger.default.getLogLevel();
|
|
415
478
|
}
|
|
416
479
|
|
|
417
480
|
/**
|
|
418
|
-
*
|
|
481
|
+
* To return the `sdkConnector` instance that was used during sdk initialisation.
|
|
482
|
+
* @ignore
|
|
419
483
|
*/
|
|
420
484
|
}, {
|
|
421
485
|
key: "getSDKConnector",
|
|
422
486
|
value: function getSDKConnector() {
|
|
423
487
|
return this.sdkConnector;
|
|
424
488
|
}
|
|
425
|
-
|
|
426
|
-
/**
|
|
427
|
-
*
|
|
428
|
-
*/
|
|
429
489
|
}, {
|
|
430
490
|
key: "registerSessionsListener",
|
|
431
491
|
value: function registerSessionsListener() {
|
|
@@ -475,14 +535,14 @@ var CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
475
535
|
*/
|
|
476
536
|
}, {
|
|
477
537
|
key: "createLine",
|
|
478
|
-
value: function () {
|
|
538
|
+
value: (function () {
|
|
479
539
|
var _createLine = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
480
540
|
var _this$sdkConfig7;
|
|
481
541
|
var line;
|
|
482
542
|
return _regenerator.default.wrap(function _callee9$(_context9) {
|
|
483
543
|
while (1) switch (_context9.prev = _context9.next) {
|
|
484
544
|
case 0:
|
|
485
|
-
line = new _line.default(this.webex.internal.device.userId, this.webex.internal.device.url,
|
|
545
|
+
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);
|
|
486
546
|
this.lineDict[line.lineId] = line;
|
|
487
547
|
case 2:
|
|
488
548
|
case "end":
|
|
@@ -496,10 +556,10 @@ var CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
496
556
|
return createLine;
|
|
497
557
|
}()
|
|
498
558
|
/**
|
|
499
|
-
* Retrieves details of all the
|
|
559
|
+
* Retrieves details of all the Line objects belonging to a User
|
|
500
560
|
* NOTE: currently multiple lines are not supported
|
|
501
|
-
* so this API will return a single line object
|
|
502
561
|
*/
|
|
562
|
+
)
|
|
503
563
|
}, {
|
|
504
564
|
key: "getLines",
|
|
505
565
|
value: function getLines() {
|
|
@@ -543,11 +603,11 @@ var CallingClient = /*#__PURE__*/function (_Eventing) {
|
|
|
543
603
|
return CallingClient;
|
|
544
604
|
}(_impl.Eventing);
|
|
545
605
|
/**
|
|
606
|
+
* Create the `CallingClient` instance using the `webex` object and callingSdk `config`
|
|
546
607
|
* @param webex - A webex instance.
|
|
547
608
|
* @param config - Config to start the CallingClient with.
|
|
548
609
|
*/
|
|
549
|
-
exports.
|
|
550
|
-
var createClient = /*#__PURE__*/function () {
|
|
610
|
+
var createClient = exports.createClient = /*#__PURE__*/function () {
|
|
551
611
|
var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(webex, config) {
|
|
552
612
|
var callingClientInstance;
|
|
553
613
|
return _regenerator.default.wrap(function _callee10$(_context10) {
|
|
@@ -568,5 +628,4 @@ var createClient = /*#__PURE__*/function () {
|
|
|
568
628
|
return _ref5.apply(this, arguments);
|
|
569
629
|
};
|
|
570
630
|
}();
|
|
571
|
-
exports.createClient = createClient;
|
|
572
631
|
//# sourceMappingURL=CallingClient.js.map
|