@webex/calling 3.12.0 → 3.13.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/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 +748 -0
- package/dist/CallRecording/WxcCallRecordingConnector.js.map +1 -0
- package/dist/CallRecording/WxcCallRecordingConnector.test.js +824 -0
- package/dist/CallRecording/WxcCallRecordingConnector.test.js.map +1 -0
- package/dist/CallRecording/callRecordingFixtures.js +266 -0
- package/dist/CallRecording/callRecordingFixtures.js.map +1 -0
- package/dist/CallRecording/constants.js +35 -0
- package/dist/CallRecording/constants.js.map +1 -0
- package/dist/CallRecording/types.js +142 -0
- package/dist/CallRecording/types.js.map +1 -0
- package/dist/CallRecording/userhub.js +117 -0
- package/dist/CallRecording/userhub.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/CallerId/index.js +3 -1
- package/dist/CallingClient/calling/CallerId/index.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/index.test.js +12 -2
- package/dist/CallingClient/calling/CallerId/index.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 -11
- 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 +252 -127
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +493 -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 +27 -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 +11 -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 +493 -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 +614 -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 +747 -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 +349 -0
- package/dist/module/CallRecording/callRecordingFixtures.js +231 -0
- package/dist/module/CallRecording/constants.js +27 -0
- package/dist/module/CallRecording/types.js +19 -0
- package/dist/module/CallRecording/userhub.js +100 -0
- package/dist/module/CallRecording/utils.js +14 -0
- package/dist/module/CallingClient/CallingClient.js +137 -20
- package/dist/module/CallingClient/calling/CallerId/index.js +2 -2
- 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 -10
- 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 +103 -58
- package/dist/module/common/callUtils.js +90 -0
- package/dist/module/common/constants.js +11 -0
- package/dist/module/common/index.js +1 -0
- package/dist/module/common/testUtil.js +7 -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 +376 -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 +27 -0
- package/dist/types/CallRecording/WxcCallRecordingConnector.d.ts.map +1 -0
- package/dist/types/CallRecording/callRecordingFixtures.d.ts +152 -0
- package/dist/types/CallRecording/callRecordingFixtures.d.ts.map +1 -0
- package/dist/types/CallRecording/constants.d.ts +28 -0
- package/dist/types/CallRecording/constants.d.ts.map +1 -0
- package/dist/types/CallRecording/types.d.ts +184 -0
- package/dist/types/CallRecording/types.d.ts.map +1 -0
- package/dist/types/CallRecording/userhub.d.ts +44 -0
- package/dist/types/CallRecording/userhub.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/CallerId/index.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 -16
- 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 +40 -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 +11 -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 +6 -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 +6 -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 +21 -5
- 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
|
@@ -17,6 +17,7 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
17
17
|
value: true
|
|
18
18
|
});
|
|
19
19
|
exports.emitFinalFailure = emitFinalFailure;
|
|
20
|
+
exports.escapeScimFilterValue = escapeScimFilterValue;
|
|
20
21
|
exports.fetchVoicemailList = fetchVoicemailList;
|
|
21
22
|
exports.filterMobiusUris = filterMobiusUris;
|
|
22
23
|
exports.getCallingBackEnd = getCallingBackEnd;
|
|
@@ -27,10 +28,13 @@ exports.handleCallErrors = handleCallErrors;
|
|
|
27
28
|
exports.handleCallingClientErrors = handleCallingClientErrors;
|
|
28
29
|
exports.handleRegistrationErrors = handleRegistrationErrors;
|
|
29
30
|
exports.inferIdFromUuid = inferIdFromUuid;
|
|
30
|
-
exports.
|
|
31
|
+
exports.isMobiusWssHostAllowed = isMobiusWssHostAllowed;
|
|
32
|
+
exports.isValidServiceDomain = isValidServiceDomain;
|
|
33
|
+
exports.normalizeMobiusUris = normalizeMobiusUris;
|
|
31
34
|
exports.parseMediaQualityStatistics = parseMediaQualityStatistics;
|
|
32
35
|
exports.resolveCallerIdByName = resolveCallerIdByName;
|
|
33
36
|
exports.resolveCallerIdDisplay = resolveCallerIdDisplay;
|
|
37
|
+
exports.resolveCallingBackend = resolveCallingBackend;
|
|
34
38
|
exports.resolveContact = resolveContact;
|
|
35
39
|
exports.scimQuery = scimQuery;
|
|
36
40
|
exports.serviceErrorCodeHandler = serviceErrorCodeHandler;
|
|
@@ -43,7 +47,6 @@ var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/objec
|
|
|
43
47
|
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
|
|
44
48
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
|
|
45
49
|
var _values = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/values"));
|
|
46
|
-
var _parseInt2 = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/parse-int"));
|
|
47
50
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
|
48
51
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
49
52
|
var platform = _interopRequireWildcard(require("platform"));
|
|
@@ -65,14 +68,39 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
65
68
|
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; } } }; }
|
|
66
69
|
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
70
|
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 */
|
|
71
|
+
/**
|
|
72
|
+
* Shared predicate for the Mobius WSS host allowlist (AC-2). Used by both
|
|
73
|
+
* `Socket#open` and `filterMobiusUris` so the two enforcement points cannot
|
|
74
|
+
* drift apart.
|
|
75
|
+
*/
|
|
76
|
+
function isMobiusWssHostAllowed(host) {
|
|
77
|
+
return _constants2.MOBIUS_WSS_ALLOWED_DOMAINS.some(function (domain) {
|
|
78
|
+
return host === domain || host.endsWith(".".concat(domain));
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Returns true when the hostname of the given WSS URI ends with one of the
|
|
84
|
+
* trusted Mobius/Webex domain suffixes. URIs with unparseable hostnames are
|
|
85
|
+
* dropped for safety.
|
|
86
|
+
*/
|
|
87
|
+
function isTrustedMobiusWssHost(wssUri) {
|
|
88
|
+
try {
|
|
89
|
+
return isMobiusWssHostAllowed(new URL(wssUri).hostname);
|
|
90
|
+
} catch (_unused) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
68
94
|
function filterMobiusUris(mobiusServers, defaultMobiusUrl) {
|
|
69
|
-
var _mobiusServers$primar, _mobiusServers$backup;
|
|
95
|
+
var _mobiusServers$primar, _mobiusServers$primar2, _mobiusServers$backup, _mobiusServers$backup2;
|
|
70
96
|
var logContext = {
|
|
71
97
|
file: _constants.UTILS_FILE,
|
|
72
98
|
method: 'filterMobiusUris'
|
|
73
99
|
};
|
|
74
100
|
var urisArrayPrimary = [];
|
|
75
101
|
var urisArrayBackup = [];
|
|
102
|
+
var wssArrayPrimary = [];
|
|
103
|
+
var wssArrayBackup = [];
|
|
76
104
|
if (mobiusServers !== null && mobiusServers !== void 0 && (_mobiusServers$primar = mobiusServers.primary) !== null && _mobiusServers$primar !== void 0 && _mobiusServers$primar.uris) {
|
|
77
105
|
_Logger.default.info('Adding Primary uris', logContext);
|
|
78
106
|
var _iterator = _createForOfIteratorHelper(mobiusServers.primary.uris),
|
|
@@ -88,14 +116,19 @@ function filterMobiusUris(mobiusServers, defaultMobiusUrl) {
|
|
|
88
116
|
_iterator.f();
|
|
89
117
|
}
|
|
90
118
|
}
|
|
91
|
-
if (mobiusServers !== null && mobiusServers !== void 0 && (_mobiusServers$
|
|
92
|
-
_Logger.default.info('Adding
|
|
93
|
-
var _iterator2 = _createForOfIteratorHelper(mobiusServers.
|
|
119
|
+
if (mobiusServers !== null && mobiusServers !== void 0 && (_mobiusServers$primar2 = mobiusServers.primary) !== null && _mobiusServers$primar2 !== void 0 && _mobiusServers$primar2.wss) {
|
|
120
|
+
_Logger.default.info('Adding Primary wss uris', logContext);
|
|
121
|
+
var _iterator2 = _createForOfIteratorHelper(mobiusServers.primary.wss),
|
|
94
122
|
_step2;
|
|
95
123
|
try {
|
|
96
124
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
97
|
-
var
|
|
98
|
-
|
|
125
|
+
var wssUri = _step2.value;
|
|
126
|
+
/* Drop WSS URIs whose host is not in the trusted allowlist (AC-2) */
|
|
127
|
+
if (isTrustedMobiusWssHost(wssUri)) {
|
|
128
|
+
wssArrayPrimary.push(wssUri);
|
|
129
|
+
} else {
|
|
130
|
+
_Logger.default.warn("Dropping untrusted primary WSS URI: host not in allowed domains", logContext);
|
|
131
|
+
}
|
|
99
132
|
}
|
|
100
133
|
} catch (err) {
|
|
101
134
|
_iterator2.e(err);
|
|
@@ -103,6 +136,41 @@ function filterMobiusUris(mobiusServers, defaultMobiusUrl) {
|
|
|
103
136
|
_iterator2.f();
|
|
104
137
|
}
|
|
105
138
|
}
|
|
139
|
+
if (mobiusServers !== null && mobiusServers !== void 0 && (_mobiusServers$backup = mobiusServers.backup) !== null && _mobiusServers$backup !== void 0 && _mobiusServers$backup.uris) {
|
|
140
|
+
_Logger.default.info('Adding Backup uris', logContext);
|
|
141
|
+
var _iterator3 = _createForOfIteratorHelper(mobiusServers.backup.uris),
|
|
142
|
+
_step3;
|
|
143
|
+
try {
|
|
144
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
145
|
+
var _uri = _step3.value;
|
|
146
|
+
urisArrayBackup.push("".concat(_uri).concat(_constants.URL_ENDPOINT));
|
|
147
|
+
}
|
|
148
|
+
} catch (err) {
|
|
149
|
+
_iterator3.e(err);
|
|
150
|
+
} finally {
|
|
151
|
+
_iterator3.f();
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
if (mobiusServers !== null && mobiusServers !== void 0 && (_mobiusServers$backup2 = mobiusServers.backup) !== null && _mobiusServers$backup2 !== void 0 && _mobiusServers$backup2.wss) {
|
|
155
|
+
_Logger.default.info('Adding Backup wss uris', logContext);
|
|
156
|
+
var _iterator4 = _createForOfIteratorHelper(mobiusServers.backup.wss),
|
|
157
|
+
_step4;
|
|
158
|
+
try {
|
|
159
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
160
|
+
var _wssUri = _step4.value;
|
|
161
|
+
/* Drop WSS URIs whose host is not in the trusted allowlist (AC-2) */
|
|
162
|
+
if (isTrustedMobiusWssHost(_wssUri)) {
|
|
163
|
+
wssArrayBackup.push(_wssUri);
|
|
164
|
+
} else {
|
|
165
|
+
_Logger.default.warn("Dropping untrusted backup WSS URI: host not in allowed domains", logContext);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
} catch (err) {
|
|
169
|
+
_iterator4.e(err);
|
|
170
|
+
} finally {
|
|
171
|
+
_iterator4.f();
|
|
172
|
+
}
|
|
173
|
+
}
|
|
106
174
|
|
|
107
175
|
/*
|
|
108
176
|
* If there are no entries in both primary and backup arrays then add the default
|
|
@@ -116,6 +184,8 @@ function filterMobiusUris(mobiusServers, defaultMobiusUrl) {
|
|
|
116
184
|
}
|
|
117
185
|
var primaryUris = [];
|
|
118
186
|
var backupUris = [];
|
|
187
|
+
var primaryWss = [];
|
|
188
|
+
var backupWss = [];
|
|
119
189
|
|
|
120
190
|
/* Remove duplicates from primary by keeping the order intact */
|
|
121
191
|
for (var i = 0; i < urisArrayPrimary.length; i += 1) {
|
|
@@ -130,9 +200,25 @@ function filterMobiusUris(mobiusServers, defaultMobiusUrl) {
|
|
|
130
200
|
backupUris.push(urisArrayBackup[_i]);
|
|
131
201
|
}
|
|
132
202
|
}
|
|
203
|
+
|
|
204
|
+
/* Remove duplicates from primary wss by keeping the order intact */
|
|
205
|
+
for (var _i2 = 0; _i2 < wssArrayPrimary.length; _i2 += 1) {
|
|
206
|
+
if (primaryWss.indexOf(wssArrayPrimary[_i2]) === -1) {
|
|
207
|
+
primaryWss.push(wssArrayPrimary[_i2]);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/* Remove duplicates from backup wss by keeping the order intact */
|
|
212
|
+
for (var _i3 = 0; _i3 < wssArrayBackup.length; _i3 += 1) {
|
|
213
|
+
if (backupWss.indexOf(wssArrayBackup[_i3]) === -1) {
|
|
214
|
+
backupWss.push(wssArrayBackup[_i3]);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
133
217
|
return {
|
|
134
218
|
primary: primaryUris,
|
|
135
|
-
backup: backupUris
|
|
219
|
+
backup: backupUris,
|
|
220
|
+
primaryWss: primaryWss,
|
|
221
|
+
backupWss: backupWss
|
|
136
222
|
};
|
|
137
223
|
}
|
|
138
224
|
|
|
@@ -196,9 +282,9 @@ function updateErrorContext(errContext, type, message, clientError) {
|
|
|
196
282
|
* @param caller - Method which called this handler.
|
|
197
283
|
* @param file - File name from where error got reported.
|
|
198
284
|
*/
|
|
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);
|
|
285
|
+
function emitFinalFailure(emitterCb, loggerContext, message) {
|
|
286
|
+
var clientError = (0, _LineError.createLineError)(message || '', {}, _types2.ERROR_TYPE.DEFAULT, _types3.RegistrationStatus.INACTIVE);
|
|
287
|
+
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
288
|
emitterCb(clientError);
|
|
203
289
|
}
|
|
204
290
|
|
|
@@ -207,7 +293,9 @@ function emitFinalFailure(emitterCb, loggerContext) {
|
|
|
207
293
|
* @param err - Error body.
|
|
208
294
|
* @param emitterCb - LineErrorEmitterCallback
|
|
209
295
|
* @param loggerContext - Logging context that has method and file name
|
|
210
|
-
* @param
|
|
296
|
+
* @param handlers - Specialized per-status-code handlers the caller opts into, as
|
|
297
|
+
* {@link RegistrationErrorHandlers}.
|
|
298
|
+
* @param serverCount - Number of servers in the list.
|
|
211
299
|
*
|
|
212
300
|
* In emitterCb,
|
|
213
301
|
* For non final error scenarios in registration flow,
|
|
@@ -218,7 +306,7 @@ function emitFinalFailure(emitterCb, loggerContext) {
|
|
|
218
306
|
* be scheduled to attempt registration again.
|
|
219
307
|
*
|
|
220
308
|
*/
|
|
221
|
-
function handleRegistrationErrors(_x, _x2, _x3
|
|
309
|
+
function handleRegistrationErrors(_x, _x2, _x3) {
|
|
222
310
|
return _handleRegistrationErrors.apply(this, arguments);
|
|
223
311
|
}
|
|
224
312
|
/**
|
|
@@ -229,112 +317,174 @@ function handleRegistrationErrors(_x, _x2, _x3, _x4, _x5) {
|
|
|
229
317
|
* @param restoreRegCb - Callback which will try restoring resgistration in case of 403
|
|
230
318
|
*/
|
|
231
319
|
function _handleRegistrationErrors() {
|
|
232
|
-
_handleRegistrationErrors = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(err, emitterCb, loggerContext
|
|
233
|
-
var
|
|
320
|
+
_handleRegistrationErrors = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(err, emitterCb, loggerContext) {
|
|
321
|
+
var handlers,
|
|
322
|
+
serverCount,
|
|
323
|
+
retry429Cb,
|
|
324
|
+
restoreRegCb,
|
|
325
|
+
sessionSupersededCb,
|
|
326
|
+
shouldDisconnect,
|
|
327
|
+
lineError,
|
|
328
|
+
errorCode,
|
|
329
|
+
finalError,
|
|
330
|
+
caller,
|
|
331
|
+
retryAfter,
|
|
332
|
+
errorBody,
|
|
333
|
+
code,
|
|
334
|
+
errorMessage,
|
|
335
|
+
_caller,
|
|
336
|
+
_errorMessage,
|
|
337
|
+
_errorMessage2,
|
|
338
|
+
_errorMessage3,
|
|
339
|
+
_args = arguments,
|
|
340
|
+
_t,
|
|
341
|
+
_t2;
|
|
234
342
|
return _regenerator.default.wrap(function (_context) {
|
|
235
343
|
while (1) switch (_context.prev = _context.next) {
|
|
236
344
|
case 0:
|
|
345
|
+
handlers = _args.length > 3 && _args[3] !== undefined ? _args[3] : {};
|
|
346
|
+
serverCount = _args.length > 4 && _args[4] !== undefined ? _args[4] : 1;
|
|
347
|
+
retry429Cb = handlers.retry429Cb, restoreRegCb = handlers.restoreRegCb, sessionSupersededCb = handlers.sessionSupersededCb;
|
|
348
|
+
shouldDisconnect = false;
|
|
237
349
|
lineError = (0, _LineError.createLineError)('', {}, _types2.ERROR_TYPE.DEFAULT, _types3.RegistrationStatus.INACTIVE);
|
|
238
350
|
errorCode = Number(err.statusCode);
|
|
239
351
|
finalError = false;
|
|
240
352
|
_Logger.default.warn("Status code: -> ".concat(errorCode), loggerContext);
|
|
241
353
|
_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.
|
|
354
|
+
_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
355
|
break;
|
|
244
356
|
case 1:
|
|
245
357
|
finalError = true;
|
|
246
358
|
_Logger.default.warn("400 Bad Request", loggerContext);
|
|
247
359
|
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
360
|
emitterCb(lineError, finalError);
|
|
249
|
-
|
|
361
|
+
shouldDisconnect = serverCount > 1;
|
|
362
|
+
return _context.abrupt("continue", 20);
|
|
250
363
|
case 2:
|
|
251
364
|
// Return it to the Caller
|
|
252
365
|
finalError = true;
|
|
253
366
|
_Logger.default.warn("401 Unauthorized", loggerContext);
|
|
254
367
|
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
368
|
emitterCb(lineError, finalError);
|
|
256
|
-
|
|
369
|
+
shouldDisconnect = serverCount > 1;
|
|
370
|
+
return _context.abrupt("continue", 20);
|
|
257
371
|
case 3:
|
|
258
372
|
finalError = true;
|
|
259
373
|
_Logger.default.warn("404 Device Not Found", loggerContext);
|
|
260
374
|
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
375
|
emitterCb(lineError, finalError);
|
|
262
|
-
|
|
376
|
+
shouldDisconnect = serverCount > 1;
|
|
377
|
+
return _context.abrupt("continue", 20);
|
|
263
378
|
case 4:
|
|
379
|
+
if (sessionSupersededCb) {
|
|
380
|
+
_context.next = 5;
|
|
381
|
+
break;
|
|
382
|
+
}
|
|
383
|
+
_Logger.default.warn("409 Conflict: ignored, caller does not handle a superseded session", loggerContext);
|
|
384
|
+
return _context.abrupt("continue", 20);
|
|
385
|
+
case 5:
|
|
386
|
+
finalError = true;
|
|
387
|
+
_Logger.default.warn("409 Conflict: session superseded by another device for this user", loggerContext);
|
|
388
|
+
updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.SESSION_SUPERSEDED, _constants.SESSION_SUPERSEDED_MESSAGE, _types3.RegistrationStatus.INACTIVE, lineError);
|
|
389
|
+
_context.next = 6;
|
|
390
|
+
return sessionSupersededCb(lineError);
|
|
391
|
+
case 6:
|
|
392
|
+
shouldDisconnect = false;
|
|
393
|
+
return _context.abrupt("continue", 20);
|
|
394
|
+
case 7:
|
|
264
395
|
_Logger.default.warn("429 Too Many Requests", loggerContext);
|
|
265
396
|
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
397
|
caller = loggerContext.method || 'handleErrors';
|
|
267
|
-
if (retry429Cb && err.headers) {
|
|
268
|
-
|
|
269
|
-
|
|
398
|
+
if (!(retry429Cb && err.headers)) {
|
|
399
|
+
_context.next = 8;
|
|
400
|
+
break;
|
|
270
401
|
}
|
|
271
|
-
|
|
272
|
-
|
|
402
|
+
retryAfter = Number(err.headers['retry-after']);
|
|
403
|
+
_context.next = 8;
|
|
404
|
+
return retry429Cb(retryAfter, caller);
|
|
405
|
+
case 8:
|
|
406
|
+
shouldDisconnect = false;
|
|
407
|
+
return _context.abrupt("continue", 20);
|
|
408
|
+
case 9:
|
|
273
409
|
_Logger.default.warn("500 Internal Server Error", loggerContext);
|
|
274
410
|
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
411
|
emitterCb(lineError, finalError);
|
|
276
|
-
|
|
277
|
-
|
|
412
|
+
shouldDisconnect = serverCount > 1;
|
|
413
|
+
return _context.abrupt("continue", 20);
|
|
414
|
+
case 10:
|
|
278
415
|
_Logger.default.warn("503 Service Unavailable", loggerContext);
|
|
279
416
|
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
417
|
emitterCb(lineError, finalError);
|
|
281
|
-
|
|
282
|
-
|
|
418
|
+
shouldDisconnect = serverCount > 1;
|
|
419
|
+
return _context.abrupt("continue", 20);
|
|
420
|
+
case 11:
|
|
283
421
|
_Logger.default.warn("403 Forbidden", loggerContext);
|
|
284
422
|
errorBody = err.body;
|
|
285
423
|
if (errorBody) {
|
|
286
|
-
_context.next =
|
|
424
|
+
_context.next = 12;
|
|
287
425
|
break;
|
|
288
426
|
}
|
|
289
427
|
_Logger.default.warn('Error response has no body, throwing default error', loggerContext);
|
|
290
428
|
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
429
|
emitterCb(lineError, finalError);
|
|
292
|
-
|
|
293
|
-
|
|
430
|
+
shouldDisconnect = serverCount > 1;
|
|
431
|
+
return _context.abrupt("return", {
|
|
432
|
+
finalError: finalError,
|
|
433
|
+
shouldDisconnect: shouldDisconnect
|
|
434
|
+
});
|
|
435
|
+
case 12:
|
|
294
436
|
code = Number(errorBody.errorCode);
|
|
295
437
|
_Logger.default.warn("Error code found : ".concat(code), loggerContext);
|
|
296
438
|
_t2 = code;
|
|
297
|
-
_context.next = _t2 === _types2.DEVICE_ERROR_CODE.DEVICE_LIMIT_EXCEEDED ?
|
|
439
|
+
_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
440
|
break;
|
|
299
|
-
case
|
|
441
|
+
case 13:
|
|
300
442
|
errorMessage = 'User device limit exceeded';
|
|
301
443
|
_Logger.default.warn(errorMessage, loggerContext);
|
|
302
444
|
if (!restoreRegCb) {
|
|
303
|
-
_context.next =
|
|
445
|
+
_context.next = 14;
|
|
304
446
|
break;
|
|
305
447
|
}
|
|
306
448
|
_caller = loggerContext.method || 'handleErrors';
|
|
307
|
-
_context.next =
|
|
449
|
+
_context.next = 14;
|
|
308
450
|
return restoreRegCb(errorBody, _caller);
|
|
309
|
-
case
|
|
310
|
-
|
|
311
|
-
|
|
451
|
+
case 14:
|
|
452
|
+
shouldDisconnect = false;
|
|
453
|
+
return _context.abrupt("continue", 18);
|
|
454
|
+
case 15:
|
|
312
455
|
_errorMessage = 'User is not configured for WebRTC calling. Please contact the administrator to resolve this issue.';
|
|
313
456
|
finalError = true;
|
|
314
457
|
updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.FORBIDDEN_ERROR, _errorMessage, _types3.RegistrationStatus.INACTIVE, lineError);
|
|
315
458
|
_Logger.default.warn(_errorMessage, loggerContext);
|
|
316
459
|
emitterCb(lineError, true);
|
|
317
|
-
|
|
318
|
-
|
|
460
|
+
shouldDisconnect = true;
|
|
461
|
+
return _context.abrupt("continue", 18);
|
|
462
|
+
case 16:
|
|
319
463
|
_errorMessage2 = 'An unknown error occurred while provisioning the device. Wait a moment and try again.';
|
|
320
464
|
updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.FORBIDDEN_ERROR, _errorMessage2, _types3.RegistrationStatus.INACTIVE, lineError);
|
|
321
465
|
_Logger.default.warn(_errorMessage2, loggerContext);
|
|
322
466
|
emitterCb(lineError, finalError);
|
|
323
|
-
|
|
324
|
-
|
|
467
|
+
shouldDisconnect = serverCount > 1;
|
|
468
|
+
return _context.abrupt("continue", 18);
|
|
469
|
+
case 17:
|
|
325
470
|
_errorMessage3 = 'An unknown error occurred. Wait a moment and try again. Please contact the administrator if the problem persists.';
|
|
326
471
|
updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.FORBIDDEN_ERROR, _errorMessage3, _types3.RegistrationStatus.INACTIVE, lineError);
|
|
327
472
|
_Logger.default.warn(_errorMessage3, loggerContext);
|
|
328
473
|
emitterCb(lineError, finalError);
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
474
|
+
shouldDisconnect = serverCount > 1;
|
|
475
|
+
case 18:
|
|
476
|
+
return _context.abrupt("continue", 20);
|
|
477
|
+
case 19:
|
|
332
478
|
updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.DEFAULT, 'Unknown error', _types3.RegistrationStatus.INACTIVE, lineError);
|
|
333
479
|
_Logger.default.warn("Unknown Error", loggerContext);
|
|
334
480
|
emitterCb(lineError, finalError);
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
481
|
+
shouldDisconnect = serverCount > 1;
|
|
482
|
+
case 20:
|
|
483
|
+
return _context.abrupt("return", {
|
|
484
|
+
finalError: finalError,
|
|
485
|
+
shouldDisconnect: shouldDisconnect
|
|
486
|
+
});
|
|
487
|
+
case 21:
|
|
338
488
|
case "end":
|
|
339
489
|
return _context.stop();
|
|
340
490
|
}
|
|
@@ -342,7 +492,7 @@ function _handleRegistrationErrors() {
|
|
|
342
492
|
}));
|
|
343
493
|
return _handleRegistrationErrors.apply(this, arguments);
|
|
344
494
|
}
|
|
345
|
-
function handleCallingClientErrors(
|
|
495
|
+
function handleCallingClientErrors(_x4, _x5, _x6) {
|
|
346
496
|
return _handleCallingClientErrors.apply(this, arguments);
|
|
347
497
|
}
|
|
348
498
|
/**
|
|
@@ -400,7 +550,7 @@ function _handleCallingClientErrors() {
|
|
|
400
550
|
}));
|
|
401
551
|
return _handleCallingClientErrors.apply(this, arguments);
|
|
402
552
|
}
|
|
403
|
-
function handleCallErrors(_x9, _x0, _x1, _x10, _x11
|
|
553
|
+
function handleCallErrors(_x7, _x8, _x9, _x0, _x1, _x10, _x11) {
|
|
404
554
|
return _handleCallErrors.apply(this, arguments);
|
|
405
555
|
}
|
|
406
556
|
/**
|
|
@@ -541,7 +691,7 @@ function _handleCallErrors() {
|
|
|
541
691
|
}));
|
|
542
692
|
return _handleCallErrors.apply(this, arguments);
|
|
543
693
|
}
|
|
544
|
-
function serviceErrorCodeHandler(
|
|
694
|
+
function serviceErrorCodeHandler(_x12, _x13) {
|
|
545
695
|
return _serviceErrorCodeHandler.apply(this, arguments);
|
|
546
696
|
}
|
|
547
697
|
/**
|
|
@@ -878,15 +1028,15 @@ var waitForMsecs = exports.waitForMsecs = function waitForMsecs(msec) {
|
|
|
878
1028
|
};
|
|
879
1029
|
|
|
880
1030
|
/**
|
|
881
|
-
*
|
|
1031
|
+
* Determine the calling backend from the device object.
|
|
882
1032
|
*
|
|
883
|
-
* @param
|
|
1033
|
+
* @param device - The device object containing callingBehavior and entitlement features.
|
|
884
1034
|
* @returns CallingBackEnd.
|
|
885
1035
|
*/
|
|
886
|
-
function
|
|
887
|
-
var entModels =
|
|
1036
|
+
function resolveCallingBackend(device) {
|
|
1037
|
+
var entModels = device.features.entitlement.models;
|
|
888
1038
|
var callingBackend;
|
|
889
|
-
if (
|
|
1039
|
+
if (device.callingBehavior === _constants2.NATIVE_WEBEX_TEAMS_CALLING) {
|
|
890
1040
|
for (var i = 0; i < entModels.length; i += 1) {
|
|
891
1041
|
if (entModels[i][_constants2.VALUES][_constants2.KEY] === _constants2.ENTITLEMENT_BASIC || entModels[i][_constants2.VALUES][_constants2.KEY] === _constants2.ENTITLEMENT_STANDARD) {
|
|
892
1042
|
callingBackend = _types3.CALLING_BACKEND.WXC;
|
|
@@ -896,12 +1046,22 @@ function getCallingBackEnd(webex) {
|
|
|
896
1046
|
break;
|
|
897
1047
|
}
|
|
898
1048
|
}
|
|
899
|
-
} else if (
|
|
1049
|
+
} else if (device.callingBehavior === _constants2.NATIVE_SIP_CALL_TO_UCM) {
|
|
900
1050
|
callingBackend = _types3.CALLING_BACKEND.UCM;
|
|
901
1051
|
} else {
|
|
902
1052
|
callingBackend = _types3.CALLING_BACKEND.INVALID;
|
|
903
1053
|
}
|
|
904
|
-
return callingBackend;
|
|
1054
|
+
return callingBackend || _types3.CALLING_BACKEND.INVALID;
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
/**
|
|
1058
|
+
* Register calling backend.
|
|
1059
|
+
*
|
|
1060
|
+
* @param webex -.
|
|
1061
|
+
* @returns CallingBackEnd.
|
|
1062
|
+
*/
|
|
1063
|
+
function getCallingBackEnd(webex) {
|
|
1064
|
+
return resolveCallingBackend(webex.internal.device);
|
|
905
1065
|
}
|
|
906
1066
|
|
|
907
1067
|
/**
|
|
@@ -912,7 +1072,7 @@ function getCallingBackEnd(webex) {
|
|
|
912
1072
|
* @param callingBackend -.
|
|
913
1073
|
* @returns Promise.
|
|
914
1074
|
*/
|
|
915
|
-
function getXsiActionEndpoint(
|
|
1075
|
+
function getXsiActionEndpoint(_x14, _x15, _x16) {
|
|
916
1076
|
return _getXsiActionEndpoint.apply(this, arguments);
|
|
917
1077
|
}
|
|
918
1078
|
/**
|
|
@@ -924,7 +1084,7 @@ function getXsiActionEndpoint(_x16, _x17, _x18) {
|
|
|
924
1084
|
*/
|
|
925
1085
|
function _getXsiActionEndpoint() {
|
|
926
1086
|
_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;
|
|
1087
|
+
var _webex$internal$servi, _userIdResponse$heade, hydraEndpoint, userIdResponse, response, xsiEndpoint, _bwTokenResponse$head, bwTokenResponse, _response, _xsiEndpoint, xsiUrl, errorInfo, _t7, _t8;
|
|
928
1088
|
return _regenerator.default.wrap(function (_context5) {
|
|
929
1089
|
while (1) switch (_context5.prev = _context5.next) {
|
|
930
1090
|
case 0:
|
|
@@ -933,9 +1093,10 @@ function _getXsiActionEndpoint() {
|
|
|
933
1093
|
_context5.next = _t7 === _types3.CALLING_BACKEND.WXC ? 1 : _t7 === _types3.CALLING_BACKEND.BWRKS ? 3 : 5;
|
|
934
1094
|
break;
|
|
935
1095
|
case 1:
|
|
1096
|
+
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
1097
|
_context5.next = 2;
|
|
937
1098
|
return webex.request({
|
|
938
|
-
uri: "".concat(
|
|
1099
|
+
uri: "".concat(hydraEndpoint, "/").concat(_constants2.XSI_ACTION_ENDPOINT_ORG_URL_PARAM),
|
|
939
1100
|
method: _types3.HTTP_METHODS.GET
|
|
940
1101
|
});
|
|
941
1102
|
case 2:
|
|
@@ -1026,7 +1187,7 @@ function getSortedVoicemailList(voiceMessageList, sortOrder) {
|
|
|
1026
1187
|
* @param filter - A filter for the query.
|
|
1027
1188
|
* @returns - Promise.
|
|
1028
1189
|
*/
|
|
1029
|
-
function scimQuery(
|
|
1190
|
+
function scimQuery(_x17) {
|
|
1030
1191
|
return _scimQuery.apply(this, arguments);
|
|
1031
1192
|
}
|
|
1032
1193
|
/**
|
|
@@ -1072,7 +1233,7 @@ function _scimQuery() {
|
|
|
1072
1233
|
}));
|
|
1073
1234
|
return _scimQuery.apply(this, arguments);
|
|
1074
1235
|
}
|
|
1075
|
-
function resolveCallerIdDisplay(
|
|
1236
|
+
function resolveCallerIdDisplay(_x18) {
|
|
1076
1237
|
return _resolveCallerIdDisplay.apply(this, arguments);
|
|
1077
1238
|
}
|
|
1078
1239
|
/**
|
|
@@ -1149,13 +1310,19 @@ function _resolveCallerIdDisplay() {
|
|
|
1149
1310
|
}));
|
|
1150
1311
|
return _resolveCallerIdDisplay.apply(this, arguments);
|
|
1151
1312
|
}
|
|
1152
|
-
function resolveCallerIdByName(
|
|
1313
|
+
function resolveCallerIdByName(_x19) {
|
|
1153
1314
|
return _resolveCallerIdByName.apply(this, arguments);
|
|
1154
1315
|
}
|
|
1155
1316
|
/**
|
|
1156
|
-
*
|
|
1317
|
+
* Escapes SCIM filter-grammar metacharacters in an opaque identifier value.
|
|
1157
1318
|
*
|
|
1158
|
-
*
|
|
1319
|
+
* Prevents filter injection when a value is interpolated into `id eq "..."`.
|
|
1320
|
+
* Only the backslash and double-quote characters are significant in SCIM
|
|
1321
|
+
* quoted-string literals; all other characters are kept as-is so that
|
|
1322
|
+
* legitimate identifiers (UUIDs, SIP addresses, etc.) resolve unchanged.
|
|
1323
|
+
*
|
|
1324
|
+
* @param value - The raw identifier value to escape.
|
|
1325
|
+
* @returns The escaped value safe for use inside a SCIM quoted-string literal.
|
|
1159
1326
|
*/
|
|
1160
1327
|
function _resolveCallerIdByName() {
|
|
1161
1328
|
_resolveCallerIdByName = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8(name) {
|
|
@@ -1213,7 +1380,17 @@ function _resolveCallerIdByName() {
|
|
|
1213
1380
|
}));
|
|
1214
1381
|
return _resolveCallerIdByName.apply(this, arguments);
|
|
1215
1382
|
}
|
|
1216
|
-
function
|
|
1383
|
+
function escapeScimFilterValue(value) {
|
|
1384
|
+
// Escape backslash first (order matters: must precede quote escaping)
|
|
1385
|
+
return value.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
/**
|
|
1389
|
+
* Resolve the contact information.
|
|
1390
|
+
*
|
|
1391
|
+
* @param callingPartyInfo - Calling Party Info.
|
|
1392
|
+
*/
|
|
1393
|
+
function resolveContact(_x20) {
|
|
1217
1394
|
return _resolveContact.apply(this, arguments);
|
|
1218
1395
|
}
|
|
1219
1396
|
/**
|
|
@@ -1231,7 +1408,7 @@ function _resolveContact() {
|
|
|
1231
1408
|
_context9.next = 1;
|
|
1232
1409
|
break;
|
|
1233
1410
|
}
|
|
1234
|
-
return _context9.abrupt("return", resolveCallerIdDisplay("id eq \"".concat(callingPartyInfo.userExternalId
|
|
1411
|
+
return _context9.abrupt("return", resolveCallerIdDisplay("id eq \"".concat(escapeScimFilterValue(callingPartyInfo.userExternalId.$), "\"")));
|
|
1235
1412
|
case 1:
|
|
1236
1413
|
if (!(callingPartyInfo.name && callingPartyInfo.name.$)) {
|
|
1237
1414
|
_context9.next = 2;
|
|
@@ -1328,7 +1505,7 @@ function isValidServiceDomain(serviceData) {
|
|
|
1328
1505
|
}
|
|
1329
1506
|
|
|
1330
1507
|
/**
|
|
1331
|
-
* Validates service data object(indicator
|
|
1508
|
+
* Validates service data object(indicator) and throws
|
|
1332
1509
|
* exception with a message indicating the reason for validation
|
|
1333
1510
|
* failure.
|
|
1334
1511
|
*
|
|
@@ -1340,63 +1517,6 @@ function validateServiceData(serviceData) {
|
|
|
1340
1517
|
if (!isValidServiceIndicator(serviceData.indicator)) {
|
|
1341
1518
|
throw new Error("Invalid service indicator, Allowed values are: ".concat(formattedValues));
|
|
1342
1519
|
}
|
|
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
1520
|
}
|
|
1401
1521
|
|
|
1402
1522
|
/**
|
|
@@ -1480,4 +1600,9 @@ function _uploadLogs() {
|
|
|
1480
1600
|
}));
|
|
1481
1601
|
return _uploadLogs.apply(this, arguments);
|
|
1482
1602
|
}
|
|
1603
|
+
function normalizeMobiusUris(urls) {
|
|
1604
|
+
return urls.map(function (url) {
|
|
1605
|
+
return !url.endsWith('/') ? "".concat(url, "/") : url;
|
|
1606
|
+
});
|
|
1607
|
+
}
|
|
1483
1608
|
//# sourceMappingURL=Utils.js.map
|