@webex/calling 3.12.0 → 3.13.0-next.10
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/README.md +1 -1
- package/dist/CallHistory/CallHistory.js +1 -1
- package/dist/CallHistory/CallHistory.js.map +1 -1
- package/dist/CallHistory/CallHistory.test.js +2 -1
- package/dist/CallHistory/CallHistory.test.js.map +1 -1
- package/dist/CallQueue/CallQueue.js +1322 -0
- package/dist/CallQueue/CallQueue.js.map +1 -0
- package/dist/CallQueue/CallQueue.test.js +3321 -0
- package/dist/CallQueue/CallQueue.test.js.map +1 -0
- package/dist/CallQueue/constants.js +65 -0
- package/dist/CallQueue/constants.js.map +1 -0
- package/dist/CallQueue/types.js +4 -0
- package/dist/CallQueue/types.js.map +1 -0
- package/dist/CallQueue/utils.js +370 -0
- package/dist/CallQueue/utils.js.map +1 -0
- package/dist/CallQueue/utils.test.js +548 -0
- package/dist/CallQueue/utils.test.js.map +1 -0
- 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 +34 -4
- 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 +1037 -116
- 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 +39 -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/Voicemail/Voicemail.js +10 -10
- package/dist/Voicemail/Voicemail.js.map +1 -1
- package/dist/Voicemail/Voicemail.test.js +40 -20
- package/dist/Voicemail/Voicemail.test.js.map +1 -1
- package/dist/api.js +95 -0
- package/dist/api.js.map +1 -1
- package/dist/common/Utils.js +259 -133
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +643 -298
- 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 +228 -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/CallHistory/CallHistory.js +1 -1
- package/dist/module/CallQueue/CallQueue.js +718 -0
- package/dist/module/CallQueue/constants.js +41 -0
- package/dist/module/CallQueue/types.js +1 -0
- package/dist/module/CallQueue/utils.js +253 -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 +29 -1
- 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 +24 -10
- package/dist/module/Metrics/index.js +48 -1
- package/dist/module/Metrics/types.js +18 -0
- package/dist/module/Voicemail/Voicemail.js +10 -10
- package/dist/module/api.js +6 -2
- package/dist/module/common/Utils.js +110 -63
- 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 +10 -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/CallQueue/CallQueue.d.ts +45 -0
- package/dist/types/CallQueue/CallQueue.d.ts.map +1 -0
- package/dist/types/CallQueue/constants.d.ts +37 -0
- package/dist/types/CallQueue/constants.d.ts.map +1 -0
- package/dist/types/CallQueue/types.d.ts +97 -0
- package/dist/types/CallQueue/types.d.ts.map +1 -0
- package/dist/types/CallQueue/utils.d.ts +19 -0
- package/dist/types/CallQueue/utils.d.ts.map +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 +29 -1
- 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 +81 -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 +41 -13
- package/dist/types/SDKConnector/types.d.ts.map +1 -1
- package/dist/types/api.d.ts +10 -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 +13 -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 -18
- 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,175 @@ 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
|
+
_err$headers$retryAf,
|
|
332
|
+
retryAfter,
|
|
333
|
+
errorBody,
|
|
334
|
+
code,
|
|
335
|
+
errorMessage,
|
|
336
|
+
_caller,
|
|
337
|
+
_errorMessage,
|
|
338
|
+
_errorMessage2,
|
|
339
|
+
_errorMessage3,
|
|
340
|
+
_args = arguments,
|
|
341
|
+
_t,
|
|
342
|
+
_t2;
|
|
234
343
|
return _regenerator.default.wrap(function (_context) {
|
|
235
344
|
while (1) switch (_context.prev = _context.next) {
|
|
236
345
|
case 0:
|
|
346
|
+
handlers = _args.length > 3 && _args[3] !== undefined ? _args[3] : {};
|
|
347
|
+
serverCount = _args.length > 4 && _args[4] !== undefined ? _args[4] : 1;
|
|
348
|
+
retry429Cb = handlers.retry429Cb, restoreRegCb = handlers.restoreRegCb, sessionSupersededCb = handlers.sessionSupersededCb;
|
|
349
|
+
shouldDisconnect = false;
|
|
237
350
|
lineError = (0, _LineError.createLineError)('', {}, _types2.ERROR_TYPE.DEFAULT, _types3.RegistrationStatus.INACTIVE);
|
|
238
351
|
errorCode = Number(err.statusCode);
|
|
239
352
|
finalError = false;
|
|
240
353
|
_Logger.default.warn("Status code: -> ".concat(errorCode), loggerContext);
|
|
241
354
|
_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.
|
|
355
|
+
_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
356
|
break;
|
|
244
357
|
case 1:
|
|
245
358
|
finalError = true;
|
|
246
359
|
_Logger.default.warn("400 Bad Request", loggerContext);
|
|
247
360
|
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
361
|
emitterCb(lineError, finalError);
|
|
249
|
-
|
|
362
|
+
shouldDisconnect = serverCount > 1;
|
|
363
|
+
return _context.abrupt("continue", 20);
|
|
250
364
|
case 2:
|
|
251
365
|
// Return it to the Caller
|
|
252
366
|
finalError = true;
|
|
253
367
|
_Logger.default.warn("401 Unauthorized", loggerContext);
|
|
254
368
|
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
369
|
emitterCb(lineError, finalError);
|
|
256
|
-
|
|
370
|
+
shouldDisconnect = serverCount > 1;
|
|
371
|
+
return _context.abrupt("continue", 20);
|
|
257
372
|
case 3:
|
|
258
373
|
finalError = true;
|
|
259
374
|
_Logger.default.warn("404 Device Not Found", loggerContext);
|
|
260
375
|
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
376
|
emitterCb(lineError, finalError);
|
|
262
|
-
|
|
377
|
+
shouldDisconnect = serverCount > 1;
|
|
378
|
+
return _context.abrupt("continue", 20);
|
|
263
379
|
case 4:
|
|
380
|
+
if (sessionSupersededCb) {
|
|
381
|
+
_context.next = 5;
|
|
382
|
+
break;
|
|
383
|
+
}
|
|
384
|
+
_Logger.default.warn("409 Conflict: ignored, caller does not handle a superseded session", loggerContext);
|
|
385
|
+
return _context.abrupt("continue", 20);
|
|
386
|
+
case 5:
|
|
387
|
+
finalError = true;
|
|
388
|
+
_Logger.default.warn("409 Conflict: session superseded by another device for this user", loggerContext);
|
|
389
|
+
updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.SESSION_SUPERSEDED, _constants.SESSION_SUPERSEDED_MESSAGE, _types3.RegistrationStatus.INACTIVE, lineError);
|
|
390
|
+
_context.next = 6;
|
|
391
|
+
return sessionSupersededCb(lineError);
|
|
392
|
+
case 6:
|
|
393
|
+
shouldDisconnect = false;
|
|
394
|
+
return _context.abrupt("continue", 20);
|
|
395
|
+
case 7:
|
|
264
396
|
_Logger.default.warn("429 Too Many Requests", loggerContext);
|
|
265
397
|
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
398
|
caller = loggerContext.method || 'handleErrors';
|
|
267
|
-
if (retry429Cb && err.headers) {
|
|
268
|
-
|
|
269
|
-
|
|
399
|
+
if (!(retry429Cb && err.headers)) {
|
|
400
|
+
_context.next = 8;
|
|
401
|
+
break;
|
|
270
402
|
}
|
|
271
|
-
|
|
272
|
-
|
|
403
|
+
retryAfter = Number((_err$headers$retryAf = err.headers['retry-after']) !== null && _err$headers$retryAf !== void 0 ? _err$headers$retryAf : err.headers['Retry-After']);
|
|
404
|
+
_context.next = 8;
|
|
405
|
+
return retry429Cb(retryAfter, caller);
|
|
406
|
+
case 8:
|
|
407
|
+
shouldDisconnect = false;
|
|
408
|
+
return _context.abrupt("continue", 20);
|
|
409
|
+
case 9:
|
|
273
410
|
_Logger.default.warn("500 Internal Server Error", loggerContext);
|
|
274
411
|
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
412
|
emitterCb(lineError, finalError);
|
|
276
|
-
|
|
277
|
-
|
|
413
|
+
shouldDisconnect = serverCount > 1;
|
|
414
|
+
return _context.abrupt("continue", 20);
|
|
415
|
+
case 10:
|
|
278
416
|
_Logger.default.warn("503 Service Unavailable", loggerContext);
|
|
279
417
|
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
418
|
emitterCb(lineError, finalError);
|
|
281
|
-
|
|
282
|
-
|
|
419
|
+
shouldDisconnect = serverCount > 1;
|
|
420
|
+
return _context.abrupt("continue", 20);
|
|
421
|
+
case 11:
|
|
283
422
|
_Logger.default.warn("403 Forbidden", loggerContext);
|
|
284
423
|
errorBody = err.body;
|
|
285
424
|
if (errorBody) {
|
|
286
|
-
_context.next =
|
|
425
|
+
_context.next = 12;
|
|
287
426
|
break;
|
|
288
427
|
}
|
|
289
428
|
_Logger.default.warn('Error response has no body, throwing default error', loggerContext);
|
|
290
429
|
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
430
|
emitterCb(lineError, finalError);
|
|
292
|
-
|
|
293
|
-
|
|
431
|
+
shouldDisconnect = serverCount > 1;
|
|
432
|
+
return _context.abrupt("return", {
|
|
433
|
+
finalError: finalError,
|
|
434
|
+
shouldDisconnect: shouldDisconnect
|
|
435
|
+
});
|
|
436
|
+
case 12:
|
|
294
437
|
code = Number(errorBody.errorCode);
|
|
295
438
|
_Logger.default.warn("Error code found : ".concat(code), loggerContext);
|
|
296
439
|
_t2 = code;
|
|
297
|
-
_context.next = _t2 === _types2.DEVICE_ERROR_CODE.DEVICE_LIMIT_EXCEEDED ?
|
|
440
|
+
_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
441
|
break;
|
|
299
|
-
case
|
|
442
|
+
case 13:
|
|
300
443
|
errorMessage = 'User device limit exceeded';
|
|
301
444
|
_Logger.default.warn(errorMessage, loggerContext);
|
|
302
445
|
if (!restoreRegCb) {
|
|
303
|
-
_context.next =
|
|
446
|
+
_context.next = 14;
|
|
304
447
|
break;
|
|
305
448
|
}
|
|
306
449
|
_caller = loggerContext.method || 'handleErrors';
|
|
307
|
-
_context.next =
|
|
450
|
+
_context.next = 14;
|
|
308
451
|
return restoreRegCb(errorBody, _caller);
|
|
309
|
-
case
|
|
310
|
-
|
|
311
|
-
|
|
452
|
+
case 14:
|
|
453
|
+
shouldDisconnect = false;
|
|
454
|
+
return _context.abrupt("continue", 18);
|
|
455
|
+
case 15:
|
|
312
456
|
_errorMessage = 'User is not configured for WebRTC calling. Please contact the administrator to resolve this issue.';
|
|
313
457
|
finalError = true;
|
|
314
458
|
updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.FORBIDDEN_ERROR, _errorMessage, _types3.RegistrationStatus.INACTIVE, lineError);
|
|
315
459
|
_Logger.default.warn(_errorMessage, loggerContext);
|
|
316
460
|
emitterCb(lineError, true);
|
|
317
|
-
|
|
318
|
-
|
|
461
|
+
shouldDisconnect = true;
|
|
462
|
+
return _context.abrupt("continue", 18);
|
|
463
|
+
case 16:
|
|
319
464
|
_errorMessage2 = 'An unknown error occurred while provisioning the device. Wait a moment and try again.';
|
|
320
465
|
updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.FORBIDDEN_ERROR, _errorMessage2, _types3.RegistrationStatus.INACTIVE, lineError);
|
|
321
466
|
_Logger.default.warn(_errorMessage2, loggerContext);
|
|
322
467
|
emitterCb(lineError, finalError);
|
|
323
|
-
|
|
324
|
-
|
|
468
|
+
shouldDisconnect = serverCount > 1;
|
|
469
|
+
return _context.abrupt("continue", 18);
|
|
470
|
+
case 17:
|
|
325
471
|
_errorMessage3 = 'An unknown error occurred. Wait a moment and try again. Please contact the administrator if the problem persists.';
|
|
326
472
|
updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.FORBIDDEN_ERROR, _errorMessage3, _types3.RegistrationStatus.INACTIVE, lineError);
|
|
327
473
|
_Logger.default.warn(_errorMessage3, loggerContext);
|
|
328
474
|
emitterCb(lineError, finalError);
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
475
|
+
shouldDisconnect = serverCount > 1;
|
|
476
|
+
case 18:
|
|
477
|
+
return _context.abrupt("continue", 20);
|
|
478
|
+
case 19:
|
|
332
479
|
updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.DEFAULT, 'Unknown error', _types3.RegistrationStatus.INACTIVE, lineError);
|
|
333
480
|
_Logger.default.warn("Unknown Error", loggerContext);
|
|
334
481
|
emitterCb(lineError, finalError);
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
482
|
+
shouldDisconnect = serverCount > 1;
|
|
483
|
+
case 20:
|
|
484
|
+
return _context.abrupt("return", {
|
|
485
|
+
finalError: finalError,
|
|
486
|
+
shouldDisconnect: shouldDisconnect
|
|
487
|
+
});
|
|
488
|
+
case 21:
|
|
338
489
|
case "end":
|
|
339
490
|
return _context.stop();
|
|
340
491
|
}
|
|
@@ -342,7 +493,7 @@ function _handleRegistrationErrors() {
|
|
|
342
493
|
}));
|
|
343
494
|
return _handleRegistrationErrors.apply(this, arguments);
|
|
344
495
|
}
|
|
345
|
-
function handleCallingClientErrors(
|
|
496
|
+
function handleCallingClientErrors(_x4, _x5, _x6) {
|
|
346
497
|
return _handleCallingClientErrors.apply(this, arguments);
|
|
347
498
|
}
|
|
348
499
|
/**
|
|
@@ -400,7 +551,7 @@ function _handleCallingClientErrors() {
|
|
|
400
551
|
}));
|
|
401
552
|
return _handleCallingClientErrors.apply(this, arguments);
|
|
402
553
|
}
|
|
403
|
-
function handleCallErrors(_x9, _x0, _x1, _x10, _x11
|
|
554
|
+
function handleCallErrors(_x7, _x8, _x9, _x0, _x1, _x10, _x11) {
|
|
404
555
|
return _handleCallErrors.apply(this, arguments);
|
|
405
556
|
}
|
|
406
557
|
/**
|
|
@@ -413,7 +564,7 @@ function handleCallErrors(_x9, _x0, _x1, _x10, _x11, _x12, _x13) {
|
|
|
413
564
|
*/
|
|
414
565
|
function _handleCallErrors() {
|
|
415
566
|
_handleCallErrors = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3(emitterCb, errorLayer, retryCb, correlationId, err, caller, file) {
|
|
416
|
-
var abort, loggerContext, callError, errorCode, isKeepalive, errorBody, retryInterval, code, message, _retryInterval, _t4, _t5;
|
|
567
|
+
var abort, loggerContext, callError, errorCode, isKeepalive, errorBody, _err$headers$retryAf2, retryInterval, code, message, _err$headers$retryAf3, _retryInterval, _t4, _t5;
|
|
417
568
|
return _regenerator.default.wrap(function (_context3) {
|
|
418
569
|
while (1) switch (_context3.prev = _context3.next) {
|
|
419
570
|
case 0:
|
|
@@ -457,11 +608,11 @@ function _handleCallErrors() {
|
|
|
457
608
|
emitterCb(callError);
|
|
458
609
|
return _context3.abrupt("return", abort);
|
|
459
610
|
case 4:
|
|
460
|
-
if (!(err.headers && 'retry-after' in err.headers && retryCb)) {
|
|
611
|
+
if (!(err.headers && ('retry-after' in err.headers || 'Retry-After' in err.headers) && retryCb)) {
|
|
461
612
|
_context3.next = 5;
|
|
462
613
|
break;
|
|
463
614
|
}
|
|
464
|
-
retryInterval = Number(err.headers['retry-after']);
|
|
615
|
+
retryInterval = Number((_err$headers$retryAf2 = err.headers['retry-after']) !== null && _err$headers$retryAf2 !== void 0 ? _err$headers$retryAf2 : err.headers['Retry-After']);
|
|
465
616
|
_Logger.default.warn("Retry Interval received: ".concat(retryInterval), loggerContext);
|
|
466
617
|
retryCb(retryInterval);
|
|
467
618
|
return _context3.abrupt("return", abort);
|
|
@@ -523,7 +674,7 @@ function _handleCallErrors() {
|
|
|
523
674
|
updateCallErrorContext(loggerContext, _types2.ERROR_TYPE.SERVER_ERROR, 'An unknown error occurred in the call. Wait a moment and try again.', correlationId, callError);
|
|
524
675
|
emitterCb(callError);
|
|
525
676
|
if (isKeepalive && retryCb) {
|
|
526
|
-
_retryInterval = err.headers && 'retry-after' in err.headers ? Number(err.headers['retry-after']) : _constants.DEFAULT_KEEPALIVE_INTERVAL;
|
|
677
|
+
_retryInterval = err.headers && ('retry-after' in err.headers || 'Retry-After' in err.headers) ? Number((_err$headers$retryAf3 = err.headers['retry-after']) !== null && _err$headers$retryAf3 !== void 0 ? _err$headers$retryAf3 : err.headers['Retry-After']) : _constants.DEFAULT_KEEPALIVE_INTERVAL;
|
|
527
678
|
retryCb(_retryInterval);
|
|
528
679
|
}
|
|
529
680
|
return _context3.abrupt("continue", 20);
|
|
@@ -541,7 +692,7 @@ function _handleCallErrors() {
|
|
|
541
692
|
}));
|
|
542
693
|
return _handleCallErrors.apply(this, arguments);
|
|
543
694
|
}
|
|
544
|
-
function serviceErrorCodeHandler(
|
|
695
|
+
function serviceErrorCodeHandler(_x12, _x13) {
|
|
545
696
|
return _serviceErrorCodeHandler.apply(this, arguments);
|
|
546
697
|
}
|
|
547
698
|
/**
|
|
@@ -878,15 +1029,15 @@ var waitForMsecs = exports.waitForMsecs = function waitForMsecs(msec) {
|
|
|
878
1029
|
};
|
|
879
1030
|
|
|
880
1031
|
/**
|
|
881
|
-
*
|
|
1032
|
+
* Determine the calling backend from the device object.
|
|
882
1033
|
*
|
|
883
|
-
* @param
|
|
1034
|
+
* @param device - The device object containing callingBehavior and entitlement features.
|
|
884
1035
|
* @returns CallingBackEnd.
|
|
885
1036
|
*/
|
|
886
|
-
function
|
|
887
|
-
var entModels =
|
|
1037
|
+
function resolveCallingBackend(device) {
|
|
1038
|
+
var entModels = device.features.entitlement.models;
|
|
888
1039
|
var callingBackend;
|
|
889
|
-
if (
|
|
1040
|
+
if (device.callingBehavior === _constants2.NATIVE_WEBEX_TEAMS_CALLING) {
|
|
890
1041
|
for (var i = 0; i < entModels.length; i += 1) {
|
|
891
1042
|
if (entModels[i][_constants2.VALUES][_constants2.KEY] === _constants2.ENTITLEMENT_BASIC || entModels[i][_constants2.VALUES][_constants2.KEY] === _constants2.ENTITLEMENT_STANDARD) {
|
|
892
1043
|
callingBackend = _types3.CALLING_BACKEND.WXC;
|
|
@@ -896,12 +1047,22 @@ function getCallingBackEnd(webex) {
|
|
|
896
1047
|
break;
|
|
897
1048
|
}
|
|
898
1049
|
}
|
|
899
|
-
} else if (
|
|
1050
|
+
} else if (device.callingBehavior === _constants2.NATIVE_SIP_CALL_TO_UCM) {
|
|
900
1051
|
callingBackend = _types3.CALLING_BACKEND.UCM;
|
|
901
1052
|
} else {
|
|
902
1053
|
callingBackend = _types3.CALLING_BACKEND.INVALID;
|
|
903
1054
|
}
|
|
904
|
-
return callingBackend;
|
|
1055
|
+
return callingBackend || _types3.CALLING_BACKEND.INVALID;
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
/**
|
|
1059
|
+
* Register calling backend.
|
|
1060
|
+
*
|
|
1061
|
+
* @param webex -.
|
|
1062
|
+
* @returns CallingBackEnd.
|
|
1063
|
+
*/
|
|
1064
|
+
function getCallingBackEnd(webex) {
|
|
1065
|
+
return resolveCallingBackend(webex.internal.device);
|
|
905
1066
|
}
|
|
906
1067
|
|
|
907
1068
|
/**
|
|
@@ -912,7 +1073,7 @@ function getCallingBackEnd(webex) {
|
|
|
912
1073
|
* @param callingBackend -.
|
|
913
1074
|
* @returns Promise.
|
|
914
1075
|
*/
|
|
915
|
-
function getXsiActionEndpoint(
|
|
1076
|
+
function getXsiActionEndpoint(_x14, _x15, _x16) {
|
|
916
1077
|
return _getXsiActionEndpoint.apply(this, arguments);
|
|
917
1078
|
}
|
|
918
1079
|
/**
|
|
@@ -924,7 +1085,7 @@ function getXsiActionEndpoint(_x16, _x17, _x18) {
|
|
|
924
1085
|
*/
|
|
925
1086
|
function _getXsiActionEndpoint() {
|
|
926
1087
|
_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;
|
|
1088
|
+
var _webex$internal$servi, _userIdResponse$heade, hydraEndpoint, userIdResponse, response, xsiEndpoint, _bwTokenResponse$head, bwTokenResponse, _response, _xsiEndpoint, xsiUrl, errorInfo, _t7, _t8;
|
|
928
1089
|
return _regenerator.default.wrap(function (_context5) {
|
|
929
1090
|
while (1) switch (_context5.prev = _context5.next) {
|
|
930
1091
|
case 0:
|
|
@@ -933,9 +1094,10 @@ function _getXsiActionEndpoint() {
|
|
|
933
1094
|
_context5.next = _t7 === _types3.CALLING_BACKEND.WXC ? 1 : _t7 === _types3.CALLING_BACKEND.BWRKS ? 3 : 5;
|
|
934
1095
|
break;
|
|
935
1096
|
case 1:
|
|
1097
|
+
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
1098
|
_context5.next = 2;
|
|
937
1099
|
return webex.request({
|
|
938
|
-
uri: "".concat(
|
|
1100
|
+
uri: "".concat(hydraEndpoint, "/").concat(_constants2.XSI_ACTION_ENDPOINT_ORG_URL_PARAM),
|
|
939
1101
|
method: _types3.HTTP_METHODS.GET
|
|
940
1102
|
});
|
|
941
1103
|
case 2:
|
|
@@ -1026,7 +1188,7 @@ function getSortedVoicemailList(voiceMessageList, sortOrder) {
|
|
|
1026
1188
|
* @param filter - A filter for the query.
|
|
1027
1189
|
* @returns - Promise.
|
|
1028
1190
|
*/
|
|
1029
|
-
function scimQuery(
|
|
1191
|
+
function scimQuery(_x17) {
|
|
1030
1192
|
return _scimQuery.apply(this, arguments);
|
|
1031
1193
|
}
|
|
1032
1194
|
/**
|
|
@@ -1072,7 +1234,7 @@ function _scimQuery() {
|
|
|
1072
1234
|
}));
|
|
1073
1235
|
return _scimQuery.apply(this, arguments);
|
|
1074
1236
|
}
|
|
1075
|
-
function resolveCallerIdDisplay(
|
|
1237
|
+
function resolveCallerIdDisplay(_x18) {
|
|
1076
1238
|
return _resolveCallerIdDisplay.apply(this, arguments);
|
|
1077
1239
|
}
|
|
1078
1240
|
/**
|
|
@@ -1149,13 +1311,19 @@ function _resolveCallerIdDisplay() {
|
|
|
1149
1311
|
}));
|
|
1150
1312
|
return _resolveCallerIdDisplay.apply(this, arguments);
|
|
1151
1313
|
}
|
|
1152
|
-
function resolveCallerIdByName(
|
|
1314
|
+
function resolveCallerIdByName(_x19) {
|
|
1153
1315
|
return _resolveCallerIdByName.apply(this, arguments);
|
|
1154
1316
|
}
|
|
1155
1317
|
/**
|
|
1156
|
-
*
|
|
1318
|
+
* Escapes SCIM filter-grammar metacharacters in an opaque identifier value.
|
|
1157
1319
|
*
|
|
1158
|
-
*
|
|
1320
|
+
* Prevents filter injection when a value is interpolated into `id eq "..."`.
|
|
1321
|
+
* Only the backslash and double-quote characters are significant in SCIM
|
|
1322
|
+
* quoted-string literals; all other characters are kept as-is so that
|
|
1323
|
+
* legitimate identifiers (UUIDs, SIP addresses, etc.) resolve unchanged.
|
|
1324
|
+
*
|
|
1325
|
+
* @param value - The raw identifier value to escape.
|
|
1326
|
+
* @returns The escaped value safe for use inside a SCIM quoted-string literal.
|
|
1159
1327
|
*/
|
|
1160
1328
|
function _resolveCallerIdByName() {
|
|
1161
1329
|
_resolveCallerIdByName = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8(name) {
|
|
@@ -1213,11 +1381,21 @@ function _resolveCallerIdByName() {
|
|
|
1213
1381
|
}));
|
|
1214
1382
|
return _resolveCallerIdByName.apply(this, arguments);
|
|
1215
1383
|
}
|
|
1216
|
-
function
|
|
1384
|
+
function escapeScimFilterValue(value) {
|
|
1385
|
+
// Escape backslash first (order matters: must precede quote escaping)
|
|
1386
|
+
return value.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
/**
|
|
1390
|
+
* Resolve the contact information.
|
|
1391
|
+
*
|
|
1392
|
+
* @param callingPartyInfo - Calling Party Info.
|
|
1393
|
+
*/
|
|
1394
|
+
function resolveContact(_x20) {
|
|
1217
1395
|
return _resolveContact.apply(this, arguments);
|
|
1218
1396
|
}
|
|
1219
1397
|
/**
|
|
1220
|
-
* Store
|
|
1398
|
+
* Store base64-encoded voicemailList in SessionStorage.
|
|
1221
1399
|
*
|
|
1222
1400
|
* @param context - Context for storage.
|
|
1223
1401
|
* @param voiceMessageList - List of voicemessage.
|
|
@@ -1231,7 +1409,7 @@ function _resolveContact() {
|
|
|
1231
1409
|
_context9.next = 1;
|
|
1232
1410
|
break;
|
|
1233
1411
|
}
|
|
1234
|
-
return _context9.abrupt("return", resolveCallerIdDisplay("id eq \"".concat(callingPartyInfo.userExternalId
|
|
1412
|
+
return _context9.abrupt("return", resolveCallerIdDisplay("id eq \"".concat(escapeScimFilterValue(callingPartyInfo.userExternalId.$), "\"")));
|
|
1235
1413
|
case 1:
|
|
1236
1414
|
if (!(callingPartyInfo.name && callingPartyInfo.name.$)) {
|
|
1237
1415
|
_context9.next = 2;
|
|
@@ -1254,7 +1432,7 @@ function storeVoicemailList(context, voiceMessageList) {
|
|
|
1254
1432
|
}
|
|
1255
1433
|
|
|
1256
1434
|
/**
|
|
1257
|
-
* Fetch
|
|
1435
|
+
* Fetch base64-decoded voicemailList from SessionStorage.
|
|
1258
1436
|
*
|
|
1259
1437
|
* @param context - Context for the storage.
|
|
1260
1438
|
* @param offset - Number of voicemail records to skip.
|
|
@@ -1328,7 +1506,7 @@ function isValidServiceDomain(serviceData) {
|
|
|
1328
1506
|
}
|
|
1329
1507
|
|
|
1330
1508
|
/**
|
|
1331
|
-
* Validates service data object(indicator
|
|
1509
|
+
* Validates service data object(indicator) and throws
|
|
1332
1510
|
* exception with a message indicating the reason for validation
|
|
1333
1511
|
* failure.
|
|
1334
1512
|
*
|
|
@@ -1340,63 +1518,6 @@ function validateServiceData(serviceData) {
|
|
|
1340
1518
|
if (!isValidServiceIndicator(serviceData.indicator)) {
|
|
1341
1519
|
throw new Error("Invalid service indicator, Allowed values are: ".concat(formattedValues));
|
|
1342
1520
|
}
|
|
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
1521
|
}
|
|
1401
1522
|
|
|
1402
1523
|
/**
|
|
@@ -1480,4 +1601,9 @@ function _uploadLogs() {
|
|
|
1480
1601
|
}));
|
|
1481
1602
|
return _uploadLogs.apply(this, arguments);
|
|
1482
1603
|
}
|
|
1604
|
+
function normalizeMobiusUris(urls) {
|
|
1605
|
+
return urls.map(function (url) {
|
|
1606
|
+
return !url.endsWith('/') ? "".concat(url, "/") : url;
|
|
1607
|
+
});
|
|
1608
|
+
}
|
|
1483
1609
|
//# sourceMappingURL=Utils.js.map
|