@webex/calling 3.12.0-next.11 → 3.12.0-next.111
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/CallRecording/CallRecording.js +160 -0
- package/dist/CallRecording/CallRecording.js.map +1 -0
- package/dist/CallRecording/CallRecording.test.js +257 -0
- package/dist/CallRecording/CallRecording.test.js.map +1 -0
- package/dist/CallRecording/WxcCallRecordingConnector.js +577 -0
- package/dist/CallRecording/WxcCallRecordingConnector.js.map +1 -0
- package/dist/CallRecording/WxcCallRecordingConnector.test.js +652 -0
- package/dist/CallRecording/WxcCallRecordingConnector.test.js.map +1 -0
- package/dist/CallRecording/callRecordingFixtures.js +235 -0
- package/dist/CallRecording/callRecordingFixtures.js.map +1 -0
- package/dist/CallRecording/constants.js +50 -0
- package/dist/CallRecording/constants.js.map +1 -0
- package/dist/CallRecording/types.js +137 -0
- package/dist/CallRecording/types.js.map +1 -0
- package/dist/CallRecording/utils.js +42 -0
- package/dist/CallRecording/utils.js.map +1 -0
- package/dist/CallRecording/utils.test.js +97 -0
- package/dist/CallRecording/utils.test.js.map +1 -0
- package/dist/CallingClient/CallingClient.js +469 -233
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +736 -179
- package/dist/CallingClient/CallingClient.test.js.map +1 -1
- package/dist/CallingClient/calling/call.js +645 -458
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +928 -498
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/CallingClient/calling/callManager.js +106 -35
- package/dist/CallingClient/calling/callManager.js.map +1 -1
- package/dist/CallingClient/calling/callManager.test.js +140 -0
- package/dist/CallingClient/calling/callManager.test.js.map +1 -1
- package/dist/CallingClient/calling/types.js +5 -0
- package/dist/CallingClient/calling/types.js.map +1 -1
- package/dist/CallingClient/constants.js +33 -3
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/CallingClient/line/index.js +27 -3
- package/dist/CallingClient/line/index.js.map +1 -1
- package/dist/CallingClient/line/line.test.js +102 -17
- package/dist/CallingClient/line/line.test.js.map +1 -1
- package/dist/CallingClient/registration/register.js +971 -506
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +946 -61
- package/dist/CallingClient/registration/register.test.js.map +1 -1
- package/dist/CallingClient/registration/types.js +26 -0
- package/dist/CallingClient/registration/types.js.map +1 -1
- package/dist/CallingClient/registration/webWorker.js +41 -104
- package/dist/CallingClient/registration/webWorker.js.map +1 -1
- package/dist/CallingClient/registration/webWorker.test.js +39 -153
- 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 +7 -0
- package/dist/CallingClient/types.js.map +1 -1
- package/dist/CallingClient/utils/constants.js +58 -0
- package/dist/CallingClient/utils/constants.js.map +1 -0
- package/dist/CallingClient/utils/index.js +63 -0
- package/dist/CallingClient/utils/index.js.map +1 -0
- package/dist/CallingClient/utils/mobiusSocketMapper.js +122 -0
- package/dist/CallingClient/utils/mobiusSocketMapper.js.map +1 -0
- package/dist/CallingClient/utils/mobiusSocketMapper.test.js +221 -0
- package/dist/CallingClient/utils/mobiusSocketMapper.test.js.map +1 -0
- package/dist/CallingClient/utils/request.js +435 -0
- package/dist/CallingClient/utils/request.js.map +1 -0
- package/dist/CallingClient/utils/request.test.js +999 -0
- package/dist/CallingClient/utils/request.test.js.map +1 -0
- package/dist/CallingClient/utils/types.js +7 -0
- package/dist/CallingClient/utils/types.js.map +1 -0
- package/dist/CallingClient/utils/wsFeatureFlag.js +70 -0
- package/dist/CallingClient/utils/wsFeatureFlag.js.map +1 -0
- package/dist/CallingClient/utils/wsFeatureFlag.test.js +139 -0
- package/dist/CallingClient/utils/wsFeatureFlag.test.js.map +1 -0
- package/dist/Contacts/ContactsClient.js +13 -11
- package/dist/Contacts/ContactsClient.js.map +1 -1
- package/dist/Contacts/ContactsClient.test.js +3 -8
- package/dist/Contacts/ContactsClient.test.js.map +1 -1
- package/dist/Errors/types.js +2 -0
- package/dist/Errors/types.js.map +1 -1
- package/dist/Events/types.js +38 -1
- package/dist/Events/types.js.map +1 -1
- package/dist/Metrics/index.js +63 -2
- package/dist/Metrics/index.js.map +1 -1
- package/dist/Metrics/index.test.js +357 -1
- package/dist/Metrics/index.test.js.map +1 -1
- package/dist/Metrics/types.js +19 -1
- package/dist/Metrics/types.js.map +1 -1
- package/dist/SDKConnector/types.js.map +1 -1
- package/dist/api.js +56 -0
- package/dist/api.js.map +1 -1
- package/dist/common/Utils.js +198 -124
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +414 -229
- package/dist/common/Utils.test.js.map +1 -1
- package/dist/common/callUtils.js +187 -0
- package/dist/common/callUtils.js.map +1 -0
- package/dist/common/callUtils.test.js +313 -0
- package/dist/common/callUtils.test.js.map +1 -0
- package/dist/common/constants.js +18 -1
- package/dist/common/constants.js.map +1 -1
- package/dist/common/index.js +11 -0
- package/dist/common/index.js.map +1 -1
- package/dist/common/testUtil.js +10 -5
- package/dist/common/testUtil.js.map +1 -1
- package/dist/common/types.js +3 -0
- package/dist/common/types.js.map +1 -1
- package/dist/index.js +171 -40
- package/dist/index.js.map +1 -1
- package/dist/mobius-socket/config.js +24 -0
- package/dist/mobius-socket/config.js.map +1 -0
- package/dist/mobius-socket/errors.js +143 -0
- package/dist/mobius-socket/errors.js.map +1 -0
- package/dist/mobius-socket/errors.test.js +20 -0
- package/dist/mobius-socket/errors.test.js.map +1 -0
- package/dist/mobius-socket/index.js +57 -0
- package/dist/mobius-socket/index.js.map +1 -0
- package/dist/mobius-socket/mobius-socket-events.test.js +492 -0
- package/dist/mobius-socket/mobius-socket-events.test.js.map +1 -0
- package/dist/mobius-socket/mobius-socket.js +849 -0
- package/dist/mobius-socket/mobius-socket.js.map +1 -0
- package/dist/mobius-socket/mobius-socket.test.js +1898 -0
- package/dist/mobius-socket/mobius-socket.test.js.map +1 -0
- package/dist/mobius-socket/socket/constants.js +55 -0
- package/dist/mobius-socket/socket/constants.js.map +1 -0
- package/dist/mobius-socket/socket/index.js +15 -0
- package/dist/mobius-socket/socket/index.js.map +1 -0
- package/dist/mobius-socket/socket/socket-base.js +604 -0
- package/dist/mobius-socket/socket/socket-base.js.map +1 -0
- package/dist/mobius-socket/socket/socket.js +19 -0
- package/dist/mobius-socket/socket/socket.js.map +1 -0
- package/dist/mobius-socket/socket/socket.shim.js +26 -0
- package/dist/mobius-socket/socket/socket.shim.js.map +1 -0
- package/dist/mobius-socket/socket/types.js +7 -0
- package/dist/mobius-socket/socket/types.js.map +1 -0
- package/dist/mobius-socket/socket.test.js +727 -0
- package/dist/mobius-socket/socket.test.js.map +1 -0
- package/dist/mobius-socket/test/mocha-helpers.js +23 -0
- package/dist/mobius-socket/test/mocha-helpers.js.map +1 -0
- package/dist/mobius-socket/test/promise-tick.js +28 -0
- package/dist/mobius-socket/test/promise-tick.js.map +1 -0
- package/dist/mobius-socket/types.js +7 -0
- package/dist/mobius-socket/types.js.map +1 -0
- package/dist/module/CallRecording/CallRecording.js +56 -0
- package/dist/module/CallRecording/WxcCallRecordingConnector.js +257 -0
- package/dist/module/CallRecording/callRecordingFixtures.js +201 -0
- package/dist/module/CallRecording/constants.js +28 -0
- package/dist/module/CallRecording/types.js +19 -0
- package/dist/module/CallRecording/utils.js +14 -0
- package/dist/module/CallingClient/CallingClient.js +137 -20
- package/dist/module/CallingClient/calling/call.js +207 -68
- package/dist/module/CallingClient/calling/callManager.js +51 -11
- package/dist/module/CallingClient/calling/types.js +2 -0
- package/dist/module/CallingClient/constants.js +28 -0
- package/dist/module/CallingClient/line/index.js +11 -3
- package/dist/module/CallingClient/registration/register.js +297 -68
- package/dist/module/CallingClient/registration/types.js +5 -1
- package/dist/module/CallingClient/registration/webWorker.js +42 -61
- package/dist/module/CallingClient/registration/webWorkerStr.js +47 -82
- package/dist/module/CallingClient/utils/constants.js +36 -0
- package/dist/module/CallingClient/utils/index.js +5 -0
- package/dist/module/CallingClient/utils/mobiusSocketMapper.js +72 -0
- package/dist/module/CallingClient/utils/request.js +211 -0
- package/dist/module/CallingClient/utils/types.js +1 -0
- package/dist/module/CallingClient/utils/wsFeatureFlag.js +41 -0
- package/dist/module/Contacts/ContactsClient.js +1 -1
- package/dist/module/Errors/types.js +2 -0
- package/dist/module/Events/types.js +23 -0
- package/dist/module/Metrics/index.js +48 -1
- package/dist/module/Metrics/types.js +18 -0
- package/dist/module/api.js +3 -2
- package/dist/module/common/Utils.js +77 -56
- package/dist/module/common/callUtils.js +90 -0
- package/dist/module/common/constants.js +5 -0
- package/dist/module/common/index.js +1 -0
- package/dist/module/common/testUtil.js +6 -1
- package/dist/module/common/types.js +3 -0
- package/dist/module/index.js +7 -3
- package/dist/module/mobius-socket/config.js +15 -0
- package/dist/module/mobius-socket/errors.js +58 -0
- package/dist/module/mobius-socket/index.js +24 -0
- package/dist/module/mobius-socket/mobius-socket.js +593 -0
- package/dist/module/mobius-socket/socket/constants.js +26 -0
- package/dist/module/mobius-socket/socket/index.js +4 -0
- package/dist/module/mobius-socket/socket/socket-base.js +368 -0
- package/dist/module/mobius-socket/socket/socket.js +9 -0
- package/dist/module/mobius-socket/socket/socket.shim.js +12 -0
- package/dist/module/mobius-socket/socket/types.js +1 -0
- package/dist/module/mobius-socket/types.js +1 -0
- package/dist/types/CallRecording/CallRecording.d.ts +18 -0
- package/dist/types/CallRecording/CallRecording.d.ts.map +1 -0
- package/dist/types/CallRecording/WxcCallRecordingConnector.d.ts +23 -0
- package/dist/types/CallRecording/WxcCallRecordingConnector.d.ts.map +1 -0
- package/dist/types/CallRecording/callRecordingFixtures.d.ts +61 -0
- package/dist/types/CallRecording/callRecordingFixtures.d.ts.map +1 -0
- package/dist/types/CallRecording/constants.d.ts +29 -0
- package/dist/types/CallRecording/constants.d.ts.map +1 -0
- package/dist/types/CallRecording/types.d.ts +176 -0
- package/dist/types/CallRecording/types.d.ts.map +1 -0
- package/dist/types/CallRecording/utils.d.ts +3 -0
- package/dist/types/CallRecording/utils.d.ts.map +1 -0
- package/dist/types/CallingClient/CallingClient.d.ts +8 -0
- package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/call.d.ts +17 -3
- package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/callManager.d.ts +8 -4
- package/dist/types/CallingClient/calling/callManager.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/types.d.ts +38 -9
- package/dist/types/CallingClient/calling/types.d.ts.map +1 -1
- package/dist/types/CallingClient/constants.d.ts +28 -0
- package/dist/types/CallingClient/constants.d.ts.map +1 -1
- package/dist/types/CallingClient/line/index.d.ts +3 -2
- package/dist/types/CallingClient/line/index.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/register.d.ts +9 -1
- package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/types.d.ts +26 -2
- package/dist/types/CallingClient/registration/types.d.ts.map +1 -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/types.d.ts +6 -2
- package/dist/types/CallingClient/types.d.ts.map +1 -1
- package/dist/types/CallingClient/utils/constants.d.ts +35 -0
- package/dist/types/CallingClient/utils/constants.d.ts.map +1 -0
- package/dist/types/CallingClient/utils/index.d.ts +6 -0
- package/dist/types/CallingClient/utils/index.d.ts.map +1 -0
- package/dist/types/CallingClient/utils/mobiusSocketMapper.d.ts +5 -0
- package/dist/types/CallingClient/utils/mobiusSocketMapper.d.ts.map +1 -0
- package/dist/types/CallingClient/utils/request.d.ts +28 -0
- package/dist/types/CallingClient/utils/request.d.ts.map +1 -0
- package/dist/types/CallingClient/utils/types.d.ts +34 -0
- package/dist/types/CallingClient/utils/types.d.ts.map +1 -0
- package/dist/types/CallingClient/utils/wsFeatureFlag.d.ts +4 -0
- package/dist/types/CallingClient/utils/wsFeatureFlag.d.ts.map +1 -0
- package/dist/types/Errors/types.d.ts +2 -0
- package/dist/types/Errors/types.d.ts.map +1 -1
- package/dist/types/Events/types.d.ts +80 -6
- package/dist/types/Events/types.d.ts.map +1 -1
- package/dist/types/Metrics/index.d.ts.map +1 -1
- package/dist/types/Metrics/types.d.ts +19 -2
- package/dist/types/Metrics/types.d.ts.map +1 -1
- package/dist/types/SDKConnector/types.d.ts +39 -12
- package/dist/types/SDKConnector/types.d.ts.map +1 -1
- package/dist/types/api.d.ts +6 -4
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/common/Utils.d.ts +9 -5
- package/dist/types/common/Utils.d.ts.map +1 -1
- package/dist/types/common/callUtils.d.ts +6 -0
- package/dist/types/common/callUtils.d.ts.map +1 -0
- package/dist/types/common/constants.d.ts +5 -0
- package/dist/types/common/constants.d.ts.map +1 -1
- package/dist/types/common/index.d.ts +1 -0
- package/dist/types/common/index.d.ts.map +1 -1
- package/dist/types/common/testUtil.d.ts +5 -1
- package/dist/types/common/testUtil.d.ts.map +1 -1
- package/dist/types/common/types.d.ts +5 -1
- package/dist/types/common/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +9 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/mobius-socket/config.d.ts +17 -0
- package/dist/types/mobius-socket/config.d.ts.map +1 -0
- package/dist/types/mobius-socket/errors.d.ts +32 -0
- package/dist/types/mobius-socket/errors.d.ts.map +1 -0
- package/dist/types/mobius-socket/index.d.ts +14 -0
- package/dist/types/mobius-socket/index.d.ts.map +1 -0
- package/dist/types/mobius-socket/mobius-socket.d.ts +48 -0
- package/dist/types/mobius-socket/mobius-socket.d.ts.map +1 -0
- package/dist/types/mobius-socket/socket/constants.d.ts +27 -0
- package/dist/types/mobius-socket/socket/constants.d.ts.map +1 -0
- package/dist/types/mobius-socket/socket/index.d.ts +5 -0
- package/dist/types/mobius-socket/socket/index.d.ts.map +1 -0
- package/dist/types/mobius-socket/socket/socket-base.d.ts +43 -0
- package/dist/types/mobius-socket/socket/socket-base.d.ts.map +1 -0
- package/dist/types/mobius-socket/socket/socket.d.ts +6 -0
- package/dist/types/mobius-socket/socket/socket.d.ts.map +1 -0
- package/dist/types/mobius-socket/socket/socket.shim.d.ts +6 -0
- package/dist/types/mobius-socket/socket/socket.shim.d.ts.map +1 -0
- package/dist/types/mobius-socket/socket/types.d.ts +61 -0
- package/dist/types/mobius-socket/socket/types.d.ts.map +1 -0
- package/dist/types/mobius-socket/types.d.ts +21 -0
- package/dist/types/mobius-socket/types.d.ts.map +1 -0
- package/package.json +20 -7
- package/src/mobius-socket/socket/socket.shim.ts +22 -0
- package/src/mobius-socket/socket/socket.ts +14 -0
package/dist/common/Utils.js
CHANGED
|
@@ -27,10 +27,12 @@ exports.handleCallErrors = handleCallErrors;
|
|
|
27
27
|
exports.handleCallingClientErrors = handleCallingClientErrors;
|
|
28
28
|
exports.handleRegistrationErrors = handleRegistrationErrors;
|
|
29
29
|
exports.inferIdFromUuid = inferIdFromUuid;
|
|
30
|
-
exports.
|
|
30
|
+
exports.isValidServiceDomain = isValidServiceDomain;
|
|
31
|
+
exports.normalizeMobiusUris = normalizeMobiusUris;
|
|
31
32
|
exports.parseMediaQualityStatistics = parseMediaQualityStatistics;
|
|
32
33
|
exports.resolveCallerIdByName = resolveCallerIdByName;
|
|
33
34
|
exports.resolveCallerIdDisplay = resolveCallerIdDisplay;
|
|
35
|
+
exports.resolveCallingBackend = resolveCallingBackend;
|
|
34
36
|
exports.resolveContact = resolveContact;
|
|
35
37
|
exports.scimQuery = scimQuery;
|
|
36
38
|
exports.serviceErrorCodeHandler = serviceErrorCodeHandler;
|
|
@@ -43,7 +45,6 @@ var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/objec
|
|
|
43
45
|
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
|
|
44
46
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
|
|
45
47
|
var _values = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/values"));
|
|
46
|
-
var _parseInt2 = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/parse-int"));
|
|
47
48
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
|
48
49
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
49
50
|
var platform = _interopRequireWildcard(require("platform"));
|
|
@@ -66,13 +67,15 @@ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof _Symbo
|
|
|
66
67
|
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; } }
|
|
67
68
|
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; } /* eslint-disable no-fallthrough */ /* eslint-disable no-underscore-dangle */ /* eslint-disable @typescript-eslint/no-shadow */
|
|
68
69
|
function filterMobiusUris(mobiusServers, defaultMobiusUrl) {
|
|
69
|
-
var _mobiusServers$primar, _mobiusServers$backup;
|
|
70
|
+
var _mobiusServers$primar, _mobiusServers$primar2, _mobiusServers$backup, _mobiusServers$backup2;
|
|
70
71
|
var logContext = {
|
|
71
72
|
file: _constants.UTILS_FILE,
|
|
72
73
|
method: 'filterMobiusUris'
|
|
73
74
|
};
|
|
74
75
|
var urisArrayPrimary = [];
|
|
75
76
|
var urisArrayBackup = [];
|
|
77
|
+
var wssArrayPrimary = [];
|
|
78
|
+
var wssArrayBackup = [];
|
|
76
79
|
if (mobiusServers !== null && mobiusServers !== void 0 && (_mobiusServers$primar = mobiusServers.primary) !== null && _mobiusServers$primar !== void 0 && _mobiusServers$primar.uris) {
|
|
77
80
|
_Logger.default.info('Adding Primary uris', logContext);
|
|
78
81
|
var _iterator = _createForOfIteratorHelper(mobiusServers.primary.uris),
|
|
@@ -88,14 +91,14 @@ function filterMobiusUris(mobiusServers, defaultMobiusUrl) {
|
|
|
88
91
|
_iterator.f();
|
|
89
92
|
}
|
|
90
93
|
}
|
|
91
|
-
if (mobiusServers !== null && mobiusServers !== void 0 && (_mobiusServers$
|
|
92
|
-
_Logger.default.info('Adding
|
|
93
|
-
var _iterator2 = _createForOfIteratorHelper(mobiusServers.
|
|
94
|
+
if (mobiusServers !== null && mobiusServers !== void 0 && (_mobiusServers$primar2 = mobiusServers.primary) !== null && _mobiusServers$primar2 !== void 0 && _mobiusServers$primar2.wss) {
|
|
95
|
+
_Logger.default.info('Adding Primary wss uris', logContext);
|
|
96
|
+
var _iterator2 = _createForOfIteratorHelper(mobiusServers.primary.wss),
|
|
94
97
|
_step2;
|
|
95
98
|
try {
|
|
96
99
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
97
|
-
var
|
|
98
|
-
|
|
100
|
+
var wssUri = _step2.value;
|
|
101
|
+
wssArrayPrimary.push(wssUri);
|
|
99
102
|
}
|
|
100
103
|
} catch (err) {
|
|
101
104
|
_iterator2.e(err);
|
|
@@ -103,6 +106,36 @@ function filterMobiusUris(mobiusServers, defaultMobiusUrl) {
|
|
|
103
106
|
_iterator2.f();
|
|
104
107
|
}
|
|
105
108
|
}
|
|
109
|
+
if (mobiusServers !== null && mobiusServers !== void 0 && (_mobiusServers$backup = mobiusServers.backup) !== null && _mobiusServers$backup !== void 0 && _mobiusServers$backup.uris) {
|
|
110
|
+
_Logger.default.info('Adding Backup uris', logContext);
|
|
111
|
+
var _iterator3 = _createForOfIteratorHelper(mobiusServers.backup.uris),
|
|
112
|
+
_step3;
|
|
113
|
+
try {
|
|
114
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
115
|
+
var _uri = _step3.value;
|
|
116
|
+
urisArrayBackup.push("".concat(_uri).concat(_constants.URL_ENDPOINT));
|
|
117
|
+
}
|
|
118
|
+
} catch (err) {
|
|
119
|
+
_iterator3.e(err);
|
|
120
|
+
} finally {
|
|
121
|
+
_iterator3.f();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
if (mobiusServers !== null && mobiusServers !== void 0 && (_mobiusServers$backup2 = mobiusServers.backup) !== null && _mobiusServers$backup2 !== void 0 && _mobiusServers$backup2.wss) {
|
|
125
|
+
_Logger.default.info('Adding Backup wss uris', logContext);
|
|
126
|
+
var _iterator4 = _createForOfIteratorHelper(mobiusServers.backup.wss),
|
|
127
|
+
_step4;
|
|
128
|
+
try {
|
|
129
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
130
|
+
var _wssUri = _step4.value;
|
|
131
|
+
wssArrayBackup.push(_wssUri);
|
|
132
|
+
}
|
|
133
|
+
} catch (err) {
|
|
134
|
+
_iterator4.e(err);
|
|
135
|
+
} finally {
|
|
136
|
+
_iterator4.f();
|
|
137
|
+
}
|
|
138
|
+
}
|
|
106
139
|
|
|
107
140
|
/*
|
|
108
141
|
* If there are no entries in both primary and backup arrays then add the default
|
|
@@ -116,6 +149,8 @@ function filterMobiusUris(mobiusServers, defaultMobiusUrl) {
|
|
|
116
149
|
}
|
|
117
150
|
var primaryUris = [];
|
|
118
151
|
var backupUris = [];
|
|
152
|
+
var primaryWss = [];
|
|
153
|
+
var backupWss = [];
|
|
119
154
|
|
|
120
155
|
/* Remove duplicates from primary by keeping the order intact */
|
|
121
156
|
for (var i = 0; i < urisArrayPrimary.length; i += 1) {
|
|
@@ -130,9 +165,25 @@ function filterMobiusUris(mobiusServers, defaultMobiusUrl) {
|
|
|
130
165
|
backupUris.push(urisArrayBackup[_i]);
|
|
131
166
|
}
|
|
132
167
|
}
|
|
168
|
+
|
|
169
|
+
/* Remove duplicates from primary wss by keeping the order intact */
|
|
170
|
+
for (var _i2 = 0; _i2 < wssArrayPrimary.length; _i2 += 1) {
|
|
171
|
+
if (primaryWss.indexOf(wssArrayPrimary[_i2]) === -1) {
|
|
172
|
+
primaryWss.push(wssArrayPrimary[_i2]);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/* Remove duplicates from backup wss by keeping the order intact */
|
|
177
|
+
for (var _i3 = 0; _i3 < wssArrayBackup.length; _i3 += 1) {
|
|
178
|
+
if (backupWss.indexOf(wssArrayBackup[_i3]) === -1) {
|
|
179
|
+
backupWss.push(wssArrayBackup[_i3]);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
133
182
|
return {
|
|
134
183
|
primary: primaryUris,
|
|
135
|
-
backup: backupUris
|
|
184
|
+
backup: backupUris,
|
|
185
|
+
primaryWss: primaryWss,
|
|
186
|
+
backupWss: backupWss
|
|
136
187
|
};
|
|
137
188
|
}
|
|
138
189
|
|
|
@@ -196,9 +247,9 @@ function updateErrorContext(errContext, type, message, clientError) {
|
|
|
196
247
|
* @param caller - Method which called this handler.
|
|
197
248
|
* @param file - File name from where error got reported.
|
|
198
249
|
*/
|
|
199
|
-
function emitFinalFailure(emitterCb, loggerContext) {
|
|
200
|
-
var clientError = (0, _LineError.createLineError)('', {}, _types2.ERROR_TYPE.DEFAULT, _types3.RegistrationStatus.INACTIVE);
|
|
201
|
-
updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.SERVICE_UNAVAILABLE, 'An unknown error occurred. Wait a moment and try again. Please contact the administrator if the problem persists.', _types3.RegistrationStatus.INACTIVE, clientError);
|
|
250
|
+
function emitFinalFailure(emitterCb, loggerContext, message) {
|
|
251
|
+
var clientError = (0, _LineError.createLineError)(message || '', {}, _types2.ERROR_TYPE.DEFAULT, _types3.RegistrationStatus.INACTIVE);
|
|
252
|
+
updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.SERVICE_UNAVAILABLE, message || 'An unknown error occurred. Wait a moment and try again. Please contact the administrator if the problem persists.', _types3.RegistrationStatus.INACTIVE, clientError);
|
|
202
253
|
emitterCb(clientError);
|
|
203
254
|
}
|
|
204
255
|
|
|
@@ -207,7 +258,9 @@ function emitFinalFailure(emitterCb, loggerContext) {
|
|
|
207
258
|
* @param err - Error body.
|
|
208
259
|
* @param emitterCb - LineErrorEmitterCallback
|
|
209
260
|
* @param loggerContext - Logging context that has method and file name
|
|
210
|
-
* @param
|
|
261
|
+
* @param handlers - Specialized per-status-code handlers the caller opts into, as
|
|
262
|
+
* {@link RegistrationErrorHandlers}.
|
|
263
|
+
* @param serverCount - Number of servers in the list.
|
|
211
264
|
*
|
|
212
265
|
* In emitterCb,
|
|
213
266
|
* For non final error scenarios in registration flow,
|
|
@@ -218,7 +271,7 @@ function emitFinalFailure(emitterCb, loggerContext) {
|
|
|
218
271
|
* be scheduled to attempt registration again.
|
|
219
272
|
*
|
|
220
273
|
*/
|
|
221
|
-
function handleRegistrationErrors(_x, _x2, _x3
|
|
274
|
+
function handleRegistrationErrors(_x, _x2, _x3) {
|
|
222
275
|
return _handleRegistrationErrors.apply(this, arguments);
|
|
223
276
|
}
|
|
224
277
|
/**
|
|
@@ -229,112 +282,174 @@ function handleRegistrationErrors(_x, _x2, _x3, _x4, _x5) {
|
|
|
229
282
|
* @param restoreRegCb - Callback which will try restoring resgistration in case of 403
|
|
230
283
|
*/
|
|
231
284
|
function _handleRegistrationErrors() {
|
|
232
|
-
_handleRegistrationErrors = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(err, emitterCb, loggerContext
|
|
233
|
-
var
|
|
285
|
+
_handleRegistrationErrors = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(err, emitterCb, loggerContext) {
|
|
286
|
+
var handlers,
|
|
287
|
+
serverCount,
|
|
288
|
+
retry429Cb,
|
|
289
|
+
restoreRegCb,
|
|
290
|
+
sessionSupersededCb,
|
|
291
|
+
shouldDisconnect,
|
|
292
|
+
lineError,
|
|
293
|
+
errorCode,
|
|
294
|
+
finalError,
|
|
295
|
+
caller,
|
|
296
|
+
retryAfter,
|
|
297
|
+
errorBody,
|
|
298
|
+
code,
|
|
299
|
+
errorMessage,
|
|
300
|
+
_caller,
|
|
301
|
+
_errorMessage,
|
|
302
|
+
_errorMessage2,
|
|
303
|
+
_errorMessage3,
|
|
304
|
+
_args = arguments,
|
|
305
|
+
_t,
|
|
306
|
+
_t2;
|
|
234
307
|
return _regenerator.default.wrap(function (_context) {
|
|
235
308
|
while (1) switch (_context.prev = _context.next) {
|
|
236
309
|
case 0:
|
|
310
|
+
handlers = _args.length > 3 && _args[3] !== undefined ? _args[3] : {};
|
|
311
|
+
serverCount = _args.length > 4 && _args[4] !== undefined ? _args[4] : 1;
|
|
312
|
+
retry429Cb = handlers.retry429Cb, restoreRegCb = handlers.restoreRegCb, sessionSupersededCb = handlers.sessionSupersededCb;
|
|
313
|
+
shouldDisconnect = false;
|
|
237
314
|
lineError = (0, _LineError.createLineError)('', {}, _types2.ERROR_TYPE.DEFAULT, _types3.RegistrationStatus.INACTIVE);
|
|
238
315
|
errorCode = Number(err.statusCode);
|
|
239
316
|
finalError = false;
|
|
240
317
|
_Logger.default.warn("Status code: -> ".concat(errorCode), loggerContext);
|
|
241
318
|
_t = errorCode;
|
|
242
|
-
_context.next = _t === _types2.ERROR_CODE.BAD_REQUEST ? 1 : _t === _types2.ERROR_CODE.UNAUTHORIZED ? 2 : _t === _types2.ERROR_CODE.DEVICE_NOT_FOUND ? 3 : _t === _types2.ERROR_CODE.
|
|
319
|
+
_context.next = _t === _types2.ERROR_CODE.BAD_REQUEST ? 1 : _t === _types2.ERROR_CODE.UNAUTHORIZED ? 2 : _t === _types2.ERROR_CODE.DEVICE_NOT_FOUND ? 3 : _t === _types2.ERROR_CODE.CONFLICT ? 4 : _t === _types2.ERROR_CODE.TOO_MANY_REQUESTS ? 7 : _t === _types2.ERROR_CODE.INTERNAL_SERVER_ERROR ? 9 : _t === _types2.ERROR_CODE.SERVICE_UNAVAILABLE ? 10 : _t === _types2.ERROR_CODE.FORBIDDEN ? 11 : 19;
|
|
243
320
|
break;
|
|
244
321
|
case 1:
|
|
245
322
|
finalError = true;
|
|
246
323
|
_Logger.default.warn("400 Bad Request", loggerContext);
|
|
247
324
|
updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.BAD_REQUEST, 'Invalid input. Please verify the required parameters, sign out and then sign back in with the valid data', _types3.RegistrationStatus.INACTIVE, lineError);
|
|
248
325
|
emitterCb(lineError, finalError);
|
|
249
|
-
|
|
326
|
+
shouldDisconnect = serverCount > 1;
|
|
327
|
+
return _context.abrupt("continue", 20);
|
|
250
328
|
case 2:
|
|
251
329
|
// Return it to the Caller
|
|
252
330
|
finalError = true;
|
|
253
331
|
_Logger.default.warn("401 Unauthorized", loggerContext);
|
|
254
332
|
updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.TOKEN_ERROR, 'User is unauthorized due to an expired token. Sign out, then sign back in.', _types3.RegistrationStatus.INACTIVE, lineError);
|
|
255
333
|
emitterCb(lineError, finalError);
|
|
256
|
-
|
|
334
|
+
shouldDisconnect = serverCount > 1;
|
|
335
|
+
return _context.abrupt("continue", 20);
|
|
257
336
|
case 3:
|
|
258
337
|
finalError = true;
|
|
259
338
|
_Logger.default.warn("404 Device Not Found", loggerContext);
|
|
260
339
|
updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.NOT_FOUND, 'Webex Calling is unable to find your device. Sign out, then sign back in', _types3.RegistrationStatus.INACTIVE, lineError);
|
|
261
340
|
emitterCb(lineError, finalError);
|
|
262
|
-
|
|
341
|
+
shouldDisconnect = serverCount > 1;
|
|
342
|
+
return _context.abrupt("continue", 20);
|
|
263
343
|
case 4:
|
|
344
|
+
if (sessionSupersededCb) {
|
|
345
|
+
_context.next = 5;
|
|
346
|
+
break;
|
|
347
|
+
}
|
|
348
|
+
_Logger.default.warn("409 Conflict: ignored, caller does not handle a superseded session", loggerContext);
|
|
349
|
+
return _context.abrupt("continue", 20);
|
|
350
|
+
case 5:
|
|
351
|
+
finalError = true;
|
|
352
|
+
_Logger.default.warn("409 Conflict: session superseded by another device for this user", loggerContext);
|
|
353
|
+
updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.SESSION_SUPERSEDED, _constants.SESSION_SUPERSEDED_MESSAGE, _types3.RegistrationStatus.INACTIVE, lineError);
|
|
354
|
+
_context.next = 6;
|
|
355
|
+
return sessionSupersededCb(lineError);
|
|
356
|
+
case 6:
|
|
357
|
+
shouldDisconnect = false;
|
|
358
|
+
return _context.abrupt("continue", 20);
|
|
359
|
+
case 7:
|
|
264
360
|
_Logger.default.warn("429 Too Many Requests", loggerContext);
|
|
265
361
|
updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.TOO_MANY_REQUESTS, 'Server is handling too many request at the time. Wait a moment and try again', _types3.RegistrationStatus.INACTIVE, lineError);
|
|
266
362
|
caller = loggerContext.method || 'handleErrors';
|
|
267
|
-
if (retry429Cb && err.headers) {
|
|
268
|
-
|
|
269
|
-
|
|
363
|
+
if (!(retry429Cb && err.headers)) {
|
|
364
|
+
_context.next = 8;
|
|
365
|
+
break;
|
|
270
366
|
}
|
|
271
|
-
|
|
272
|
-
|
|
367
|
+
retryAfter = Number(err.headers['retry-after']);
|
|
368
|
+
_context.next = 8;
|
|
369
|
+
return retry429Cb(retryAfter, caller);
|
|
370
|
+
case 8:
|
|
371
|
+
shouldDisconnect = false;
|
|
372
|
+
return _context.abrupt("continue", 20);
|
|
373
|
+
case 9:
|
|
273
374
|
_Logger.default.warn("500 Internal Server Error", loggerContext);
|
|
274
375
|
updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.SERVER_ERROR, 'An unknown error occurred while placing the request. Wait a moment and try again.', _types3.RegistrationStatus.INACTIVE, lineError);
|
|
275
376
|
emitterCb(lineError, finalError);
|
|
276
|
-
|
|
277
|
-
|
|
377
|
+
shouldDisconnect = serverCount > 1;
|
|
378
|
+
return _context.abrupt("continue", 20);
|
|
379
|
+
case 10:
|
|
278
380
|
_Logger.default.warn("503 Service Unavailable", loggerContext);
|
|
279
381
|
updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.SERVICE_UNAVAILABLE, 'An error occurred on the server while processing the request. Wait a moment and try again.', _types3.RegistrationStatus.INACTIVE, lineError);
|
|
280
382
|
emitterCb(lineError, finalError);
|
|
281
|
-
|
|
282
|
-
|
|
383
|
+
shouldDisconnect = serverCount > 1;
|
|
384
|
+
return _context.abrupt("continue", 20);
|
|
385
|
+
case 11:
|
|
283
386
|
_Logger.default.warn("403 Forbidden", loggerContext);
|
|
284
387
|
errorBody = err.body;
|
|
285
388
|
if (errorBody) {
|
|
286
|
-
_context.next =
|
|
389
|
+
_context.next = 12;
|
|
287
390
|
break;
|
|
288
391
|
}
|
|
289
392
|
_Logger.default.warn('Error response has no body, throwing default error', loggerContext);
|
|
290
393
|
updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.FORBIDDEN_ERROR, 'An unauthorized action has been received. This action has been blocked. Please contact the administrator if this persists.', _types3.RegistrationStatus.INACTIVE, lineError);
|
|
291
394
|
emitterCb(lineError, finalError);
|
|
292
|
-
|
|
293
|
-
|
|
395
|
+
shouldDisconnect = serverCount > 1;
|
|
396
|
+
return _context.abrupt("return", {
|
|
397
|
+
finalError: finalError,
|
|
398
|
+
shouldDisconnect: shouldDisconnect
|
|
399
|
+
});
|
|
400
|
+
case 12:
|
|
294
401
|
code = Number(errorBody.errorCode);
|
|
295
402
|
_Logger.default.warn("Error code found : ".concat(code), loggerContext);
|
|
296
403
|
_t2 = code;
|
|
297
|
-
_context.next = _t2 === _types2.DEVICE_ERROR_CODE.DEVICE_LIMIT_EXCEEDED ?
|
|
404
|
+
_context.next = _t2 === _types2.DEVICE_ERROR_CODE.DEVICE_LIMIT_EXCEEDED ? 13 : _t2 === _types2.DEVICE_ERROR_CODE.DEVICE_CREATION_DISABLED ? 15 : _t2 === _types2.DEVICE_ERROR_CODE.DEVICE_CREATION_FAILED ? 16 : 17;
|
|
298
405
|
break;
|
|
299
|
-
case
|
|
406
|
+
case 13:
|
|
300
407
|
errorMessage = 'User device limit exceeded';
|
|
301
408
|
_Logger.default.warn(errorMessage, loggerContext);
|
|
302
409
|
if (!restoreRegCb) {
|
|
303
|
-
_context.next =
|
|
410
|
+
_context.next = 14;
|
|
304
411
|
break;
|
|
305
412
|
}
|
|
306
413
|
_caller = loggerContext.method || 'handleErrors';
|
|
307
|
-
_context.next =
|
|
414
|
+
_context.next = 14;
|
|
308
415
|
return restoreRegCb(errorBody, _caller);
|
|
309
|
-
case
|
|
310
|
-
|
|
311
|
-
|
|
416
|
+
case 14:
|
|
417
|
+
shouldDisconnect = false;
|
|
418
|
+
return _context.abrupt("continue", 18);
|
|
419
|
+
case 15:
|
|
312
420
|
_errorMessage = 'User is not configured for WebRTC calling. Please contact the administrator to resolve this issue.';
|
|
313
421
|
finalError = true;
|
|
314
422
|
updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.FORBIDDEN_ERROR, _errorMessage, _types3.RegistrationStatus.INACTIVE, lineError);
|
|
315
423
|
_Logger.default.warn(_errorMessage, loggerContext);
|
|
316
424
|
emitterCb(lineError, true);
|
|
317
|
-
|
|
318
|
-
|
|
425
|
+
shouldDisconnect = true;
|
|
426
|
+
return _context.abrupt("continue", 18);
|
|
427
|
+
case 16:
|
|
319
428
|
_errorMessage2 = 'An unknown error occurred while provisioning the device. Wait a moment and try again.';
|
|
320
429
|
updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.FORBIDDEN_ERROR, _errorMessage2, _types3.RegistrationStatus.INACTIVE, lineError);
|
|
321
430
|
_Logger.default.warn(_errorMessage2, loggerContext);
|
|
322
431
|
emitterCb(lineError, finalError);
|
|
323
|
-
|
|
324
|
-
|
|
432
|
+
shouldDisconnect = serverCount > 1;
|
|
433
|
+
return _context.abrupt("continue", 18);
|
|
434
|
+
case 17:
|
|
325
435
|
_errorMessage3 = 'An unknown error occurred. Wait a moment and try again. Please contact the administrator if the problem persists.';
|
|
326
436
|
updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.FORBIDDEN_ERROR, _errorMessage3, _types3.RegistrationStatus.INACTIVE, lineError);
|
|
327
437
|
_Logger.default.warn(_errorMessage3, loggerContext);
|
|
328
438
|
emitterCb(lineError, finalError);
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
439
|
+
shouldDisconnect = serverCount > 1;
|
|
440
|
+
case 18:
|
|
441
|
+
return _context.abrupt("continue", 20);
|
|
442
|
+
case 19:
|
|
332
443
|
updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.DEFAULT, 'Unknown error', _types3.RegistrationStatus.INACTIVE, lineError);
|
|
333
444
|
_Logger.default.warn("Unknown Error", loggerContext);
|
|
334
445
|
emitterCb(lineError, finalError);
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
446
|
+
shouldDisconnect = serverCount > 1;
|
|
447
|
+
case 20:
|
|
448
|
+
return _context.abrupt("return", {
|
|
449
|
+
finalError: finalError,
|
|
450
|
+
shouldDisconnect: shouldDisconnect
|
|
451
|
+
});
|
|
452
|
+
case 21:
|
|
338
453
|
case "end":
|
|
339
454
|
return _context.stop();
|
|
340
455
|
}
|
|
@@ -342,7 +457,7 @@ function _handleRegistrationErrors() {
|
|
|
342
457
|
}));
|
|
343
458
|
return _handleRegistrationErrors.apply(this, arguments);
|
|
344
459
|
}
|
|
345
|
-
function handleCallingClientErrors(
|
|
460
|
+
function handleCallingClientErrors(_x4, _x5, _x6) {
|
|
346
461
|
return _handleCallingClientErrors.apply(this, arguments);
|
|
347
462
|
}
|
|
348
463
|
/**
|
|
@@ -400,7 +515,7 @@ function _handleCallingClientErrors() {
|
|
|
400
515
|
}));
|
|
401
516
|
return _handleCallingClientErrors.apply(this, arguments);
|
|
402
517
|
}
|
|
403
|
-
function handleCallErrors(_x9, _x0, _x1, _x10, _x11
|
|
518
|
+
function handleCallErrors(_x7, _x8, _x9, _x0, _x1, _x10, _x11) {
|
|
404
519
|
return _handleCallErrors.apply(this, arguments);
|
|
405
520
|
}
|
|
406
521
|
/**
|
|
@@ -541,7 +656,7 @@ function _handleCallErrors() {
|
|
|
541
656
|
}));
|
|
542
657
|
return _handleCallErrors.apply(this, arguments);
|
|
543
658
|
}
|
|
544
|
-
function serviceErrorCodeHandler(
|
|
659
|
+
function serviceErrorCodeHandler(_x12, _x13) {
|
|
545
660
|
return _serviceErrorCodeHandler.apply(this, arguments);
|
|
546
661
|
}
|
|
547
662
|
/**
|
|
@@ -878,15 +993,15 @@ var waitForMsecs = exports.waitForMsecs = function waitForMsecs(msec) {
|
|
|
878
993
|
};
|
|
879
994
|
|
|
880
995
|
/**
|
|
881
|
-
*
|
|
996
|
+
* Determine the calling backend from the device object.
|
|
882
997
|
*
|
|
883
|
-
* @param
|
|
998
|
+
* @param device - The device object containing callingBehavior and entitlement features.
|
|
884
999
|
* @returns CallingBackEnd.
|
|
885
1000
|
*/
|
|
886
|
-
function
|
|
887
|
-
var entModels =
|
|
1001
|
+
function resolveCallingBackend(device) {
|
|
1002
|
+
var entModels = device.features.entitlement.models;
|
|
888
1003
|
var callingBackend;
|
|
889
|
-
if (
|
|
1004
|
+
if (device.callingBehavior === _constants2.NATIVE_WEBEX_TEAMS_CALLING) {
|
|
890
1005
|
for (var i = 0; i < entModels.length; i += 1) {
|
|
891
1006
|
if (entModels[i][_constants2.VALUES][_constants2.KEY] === _constants2.ENTITLEMENT_BASIC || entModels[i][_constants2.VALUES][_constants2.KEY] === _constants2.ENTITLEMENT_STANDARD) {
|
|
892
1007
|
callingBackend = _types3.CALLING_BACKEND.WXC;
|
|
@@ -896,12 +1011,22 @@ function getCallingBackEnd(webex) {
|
|
|
896
1011
|
break;
|
|
897
1012
|
}
|
|
898
1013
|
}
|
|
899
|
-
} else if (
|
|
1014
|
+
} else if (device.callingBehavior === _constants2.NATIVE_SIP_CALL_TO_UCM) {
|
|
900
1015
|
callingBackend = _types3.CALLING_BACKEND.UCM;
|
|
901
1016
|
} else {
|
|
902
1017
|
callingBackend = _types3.CALLING_BACKEND.INVALID;
|
|
903
1018
|
}
|
|
904
|
-
return callingBackend;
|
|
1019
|
+
return callingBackend || _types3.CALLING_BACKEND.INVALID;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
/**
|
|
1023
|
+
* Register calling backend.
|
|
1024
|
+
*
|
|
1025
|
+
* @param webex -.
|
|
1026
|
+
* @returns CallingBackEnd.
|
|
1027
|
+
*/
|
|
1028
|
+
function getCallingBackEnd(webex) {
|
|
1029
|
+
return resolveCallingBackend(webex.internal.device);
|
|
905
1030
|
}
|
|
906
1031
|
|
|
907
1032
|
/**
|
|
@@ -912,7 +1037,7 @@ function getCallingBackEnd(webex) {
|
|
|
912
1037
|
* @param callingBackend -.
|
|
913
1038
|
* @returns Promise.
|
|
914
1039
|
*/
|
|
915
|
-
function getXsiActionEndpoint(
|
|
1040
|
+
function getXsiActionEndpoint(_x14, _x15, _x16) {
|
|
916
1041
|
return _getXsiActionEndpoint.apply(this, arguments);
|
|
917
1042
|
}
|
|
918
1043
|
/**
|
|
@@ -924,7 +1049,7 @@ function getXsiActionEndpoint(_x16, _x17, _x18) {
|
|
|
924
1049
|
*/
|
|
925
1050
|
function _getXsiActionEndpoint() {
|
|
926
1051
|
_getXsiActionEndpoint = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5(webex, loggerContext, callingBackend) {
|
|
927
|
-
var _userIdResponse$heade, userIdResponse, response, xsiEndpoint, _bwTokenResponse$head, bwTokenResponse, _response, _xsiEndpoint, xsiUrl, errorInfo, _t7, _t8;
|
|
1052
|
+
var _webex$internal$servi, _userIdResponse$heade, hydraEndpoint, userIdResponse, response, xsiEndpoint, _bwTokenResponse$head, bwTokenResponse, _response, _xsiEndpoint, xsiUrl, errorInfo, _t7, _t8;
|
|
928
1053
|
return _regenerator.default.wrap(function (_context5) {
|
|
929
1054
|
while (1) switch (_context5.prev = _context5.next) {
|
|
930
1055
|
case 0:
|
|
@@ -933,9 +1058,10 @@ function _getXsiActionEndpoint() {
|
|
|
933
1058
|
_context5.next = _t7 === _types3.CALLING_BACKEND.WXC ? 1 : _t7 === _types3.CALLING_BACKEND.BWRKS ? 3 : 5;
|
|
934
1059
|
break;
|
|
935
1060
|
case 1:
|
|
1061
|
+
hydraEndpoint = ((_webex$internal$servi = webex.internal.services._serviceUrls) === null || _webex$internal$servi === void 0 ? void 0 : _webex$internal$servi.hydra) || webex.internal.services.get(webex.internal.services._activeServices.hydra);
|
|
936
1062
|
_context5.next = 2;
|
|
937
1063
|
return webex.request({
|
|
938
|
-
uri: "".concat(
|
|
1064
|
+
uri: "".concat(hydraEndpoint, "/").concat(_constants2.XSI_ACTION_ENDPOINT_ORG_URL_PARAM),
|
|
939
1065
|
method: _types3.HTTP_METHODS.GET
|
|
940
1066
|
});
|
|
941
1067
|
case 2:
|
|
@@ -1026,7 +1152,7 @@ function getSortedVoicemailList(voiceMessageList, sortOrder) {
|
|
|
1026
1152
|
* @param filter - A filter for the query.
|
|
1027
1153
|
* @returns - Promise.
|
|
1028
1154
|
*/
|
|
1029
|
-
function scimQuery(
|
|
1155
|
+
function scimQuery(_x17) {
|
|
1030
1156
|
return _scimQuery.apply(this, arguments);
|
|
1031
1157
|
}
|
|
1032
1158
|
/**
|
|
@@ -1072,7 +1198,7 @@ function _scimQuery() {
|
|
|
1072
1198
|
}));
|
|
1073
1199
|
return _scimQuery.apply(this, arguments);
|
|
1074
1200
|
}
|
|
1075
|
-
function resolveCallerIdDisplay(
|
|
1201
|
+
function resolveCallerIdDisplay(_x18) {
|
|
1076
1202
|
return _resolveCallerIdDisplay.apply(this, arguments);
|
|
1077
1203
|
}
|
|
1078
1204
|
/**
|
|
@@ -1149,7 +1275,7 @@ function _resolveCallerIdDisplay() {
|
|
|
1149
1275
|
}));
|
|
1150
1276
|
return _resolveCallerIdDisplay.apply(this, arguments);
|
|
1151
1277
|
}
|
|
1152
|
-
function resolveCallerIdByName(
|
|
1278
|
+
function resolveCallerIdByName(_x19) {
|
|
1153
1279
|
return _resolveCallerIdByName.apply(this, arguments);
|
|
1154
1280
|
}
|
|
1155
1281
|
/**
|
|
@@ -1213,7 +1339,7 @@ function _resolveCallerIdByName() {
|
|
|
1213
1339
|
}));
|
|
1214
1340
|
return _resolveCallerIdByName.apply(this, arguments);
|
|
1215
1341
|
}
|
|
1216
|
-
function resolveContact(
|
|
1342
|
+
function resolveContact(_x20) {
|
|
1217
1343
|
return _resolveContact.apply(this, arguments);
|
|
1218
1344
|
}
|
|
1219
1345
|
/**
|
|
@@ -1328,7 +1454,7 @@ function isValidServiceDomain(serviceData) {
|
|
|
1328
1454
|
}
|
|
1329
1455
|
|
|
1330
1456
|
/**
|
|
1331
|
-
* Validates service data object(indicator
|
|
1457
|
+
* Validates service data object(indicator) and throws
|
|
1332
1458
|
* exception with a message indicating the reason for validation
|
|
1333
1459
|
* failure.
|
|
1334
1460
|
*
|
|
@@ -1340,63 +1466,6 @@ function validateServiceData(serviceData) {
|
|
|
1340
1466
|
if (!isValidServiceIndicator(serviceData.indicator)) {
|
|
1341
1467
|
throw new Error("Invalid service indicator, Allowed values are: ".concat(formattedValues));
|
|
1342
1468
|
}
|
|
1343
|
-
if (!isValidServiceDomain(serviceData)) {
|
|
1344
|
-
throw new Error('Invalid service domain.');
|
|
1345
|
-
}
|
|
1346
|
-
}
|
|
1347
|
-
|
|
1348
|
-
/**
|
|
1349
|
-
* Modifies SDP to replace IPv6 "c=" lines with IPv4.And adds an IPv4 candidate if none exists.
|
|
1350
|
-
*
|
|
1351
|
-
* @param sdp - Session Description Protocol string.
|
|
1352
|
-
* @returns Modified SDP string.
|
|
1353
|
-
*/
|
|
1354
|
-
function modifySdpForIPv4(sdp) {
|
|
1355
|
-
try {
|
|
1356
|
-
// Normalize line endings to avoid issues
|
|
1357
|
-
sdp = sdp.replace(/\r\n|\r/g, '\n');
|
|
1358
|
-
|
|
1359
|
-
// Ensure consistent spacing without removing intentional indentation
|
|
1360
|
-
sdp = sdp.replace(/^[ \t]+/gm, '');
|
|
1361
|
-
|
|
1362
|
-
// Check if at least one IPv6 "c=" line is present
|
|
1363
|
-
var ipv6CLineMatches = sdp.match(/c=IN IP6 [\da-f:.]+/gi) || [];
|
|
1364
|
-
var hasIPv6CLine = ipv6CLineMatches.length > 0;
|
|
1365
|
-
if (hasIPv6CLine) {
|
|
1366
|
-
_Logger.default.info('Modifying SDP for IPv4 compatibility', {
|
|
1367
|
-
file: _constants.UTILS_FILE,
|
|
1368
|
-
method: 'modifySdpForIPv4'
|
|
1369
|
-
});
|
|
1370
|
-
|
|
1371
|
-
// Extract an existing IPv4 candidate's IP, if available
|
|
1372
|
-
var ipv4CandidateMatch = sdp.match(/a=candidate:\d+ \d+ \w+ \d+ ([\d.]+) \d+ typ \w+/);
|
|
1373
|
-
var ipv4Address = (ipv4CandidateMatch === null || ipv4CandidateMatch === void 0 ? void 0 : ipv4CandidateMatch[1]) || '192.1.1.1'; // Default fallback
|
|
1374
|
-
|
|
1375
|
-
// Replace all IPv6 "c=" lines with IPv4 using the extracted IP (or default)
|
|
1376
|
-
sdp = sdp.replace(/c=IN IP6 [\da-f:.]+/gi, "c=IN IP4 ".concat(ipv4Address));
|
|
1377
|
-
|
|
1378
|
-
// Ensure newline separation between candidate lines
|
|
1379
|
-
if (!ipv4CandidateMatch) {
|
|
1380
|
-
var ipv4CandidateAdded = false;
|
|
1381
|
-
sdp = sdp.replace(/(a=candidate:(\d+) (\d+) (\w+) (\d+) ([\da-f:.]+) (\d+) typ (\w+)[^\n]*)/g, function (match, full, foundation, componentId, transport, priority, connectionAddress, port, candidateType) {
|
|
1382
|
-
if (!ipv4CandidateAdded && connectionAddress.includes(':')) {
|
|
1383
|
-
// Ensure it's IPv6 and only add once
|
|
1384
|
-
ipv4CandidateAdded = true;
|
|
1385
|
-
var newFoundation = ((0, _parseInt2.default)(foundation, 10) + 1).toString();
|
|
1386
|
-
return "".concat(full, "\n") + "a=candidate:".concat(newFoundation, " ").concat(componentId, " ").concat(transport, " ").concat(priority, " ").concat(ipv4Address, " ").concat(port, " typ ").concat(candidateType, " generation 0 network-id 1 network-cost 10");
|
|
1387
|
-
}
|
|
1388
|
-
return match;
|
|
1389
|
-
});
|
|
1390
|
-
}
|
|
1391
|
-
}
|
|
1392
|
-
return sdp;
|
|
1393
|
-
} catch (error) {
|
|
1394
|
-
_Logger.default.warn("Error modifying SDP for IPv4 compatibility: ".concat(error), {
|
|
1395
|
-
file: _constants.UTILS_FILE,
|
|
1396
|
-
method: 'modifySdpForIPv4'
|
|
1397
|
-
});
|
|
1398
|
-
return sdp; // Return original SDP in case of an error
|
|
1399
|
-
}
|
|
1400
1469
|
}
|
|
1401
1470
|
|
|
1402
1471
|
/**
|
|
@@ -1480,4 +1549,9 @@ function _uploadLogs() {
|
|
|
1480
1549
|
}));
|
|
1481
1550
|
return _uploadLogs.apply(this, arguments);
|
|
1482
1551
|
}
|
|
1552
|
+
function normalizeMobiusUris(urls) {
|
|
1553
|
+
return urls.map(function (url) {
|
|
1554
|
+
return !url.endsWith('/') ? "".concat(url, "/") : url;
|
|
1555
|
+
});
|
|
1556
|
+
}
|
|
1483
1557
|
//# sourceMappingURL=Utils.js.map
|