@webex/calling 3.12.0-next.6 → 3.12.0-next.61
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 +158 -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 +576 -0
- package/dist/CallRecording/WxcCallRecordingConnector.js.map +1 -0
- package/dist/CallRecording/WxcCallRecordingConnector.test.js +651 -0
- package/dist/CallRecording/WxcCallRecordingConnector.test.js.map +1 -0
- package/dist/CallRecording/callRecordingFixtures.js +235 -0
- package/dist/CallRecording/callRecordingFixtures.js.map +1 -0
- package/dist/CallRecording/constants.js +49 -0
- package/dist/CallRecording/constants.js.map +1 -0
- package/dist/CallRecording/types.js +136 -0
- package/dist/CallRecording/types.js.map +1 -0
- package/dist/CallRecording/utils.js +42 -0
- package/dist/CallRecording/utils.js.map +1 -0
- package/dist/CallRecording/utils.test.js +97 -0
- package/dist/CallRecording/utils.test.js.map +1 -0
- package/dist/CallingClient/CallingClient.js +454 -224
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +513 -154
- package/dist/CallingClient/CallingClient.test.js.map +1 -1
- package/dist/CallingClient/calling/call.js +589 -445
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +695 -445
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/CallingClient/calling/callManager.js +81 -31
- package/dist/CallingClient/calling/callManager.js.map +1 -1
- package/dist/CallingClient/calling/callManager.test.js +123 -0
- package/dist/CallingClient/calling/callManager.test.js.map +1 -1
- package/dist/CallingClient/calling/types.js +2 -0
- package/dist/CallingClient/calling/types.js.map +1 -1
- package/dist/CallingClient/constants.js +28 -3
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/CallingClient/line/index.js +4 -1
- package/dist/CallingClient/line/index.js.map +1 -1
- package/dist/CallingClient/line/line.test.js +16 -1
- package/dist/CallingClient/line/line.test.js.map +1 -1
- package/dist/CallingClient/registration/register.js +724 -407
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +380 -58
- package/dist/CallingClient/registration/register.test.js.map +1 -1
- 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.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/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 +156 -51
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +79 -0
- package/dist/common/Utils.test.js.map +1 -1
- package/dist/common/testUtil.js +10 -5
- package/dist/common/testUtil.js.map +1 -1
- package/dist/common/types.js +3 -0
- package/dist/common/types.js.map +1 -1
- package/dist/index.js +165 -40
- package/dist/index.js.map +1 -1
- package/dist/mobius-socket/config.js +24 -0
- package/dist/mobius-socket/config.js.map +1 -0
- package/dist/mobius-socket/errors.js +143 -0
- package/dist/mobius-socket/errors.js.map +1 -0
- package/dist/mobius-socket/errors.test.js +20 -0
- package/dist/mobius-socket/errors.test.js.map +1 -0
- package/dist/mobius-socket/index.js +57 -0
- package/dist/mobius-socket/index.js.map +1 -0
- package/dist/mobius-socket/mobius-socket-events.test.js +492 -0
- package/dist/mobius-socket/mobius-socket-events.test.js.map +1 -0
- package/dist/mobius-socket/mobius-socket.js +849 -0
- package/dist/mobius-socket/mobius-socket.js.map +1 -0
- package/dist/mobius-socket/mobius-socket.test.js +1898 -0
- package/dist/mobius-socket/mobius-socket.test.js.map +1 -0
- package/dist/mobius-socket/socket/constants.js +55 -0
- package/dist/mobius-socket/socket/constants.js.map +1 -0
- package/dist/mobius-socket/socket/index.js +15 -0
- package/dist/mobius-socket/socket/index.js.map +1 -0
- package/dist/mobius-socket/socket/socket-base.js +604 -0
- package/dist/mobius-socket/socket/socket-base.js.map +1 -0
- package/dist/mobius-socket/socket/socket.js +19 -0
- package/dist/mobius-socket/socket/socket.js.map +1 -0
- package/dist/mobius-socket/socket/socket.shim.js +26 -0
- package/dist/mobius-socket/socket/socket.shim.js.map +1 -0
- package/dist/mobius-socket/socket/types.js +7 -0
- package/dist/mobius-socket/socket/types.js.map +1 -0
- package/dist/mobius-socket/socket.test.js +727 -0
- package/dist/mobius-socket/socket.test.js.map +1 -0
- package/dist/mobius-socket/test/mocha-helpers.js +23 -0
- package/dist/mobius-socket/test/mocha-helpers.js.map +1 -0
- package/dist/mobius-socket/test/promise-tick.js +28 -0
- package/dist/mobius-socket/test/promise-tick.js.map +1 -0
- package/dist/mobius-socket/types.js +7 -0
- package/dist/mobius-socket/types.js.map +1 -0
- package/dist/module/CallRecording/CallRecording.js +56 -0
- package/dist/module/CallRecording/WxcCallRecordingConnector.js +264 -0
- package/dist/module/CallRecording/callRecordingFixtures.js +201 -0
- package/dist/module/CallRecording/constants.js +27 -0
- package/dist/module/CallRecording/types.js +19 -0
- package/dist/module/CallRecording/utils.js +14 -0
- package/dist/module/CallingClient/CallingClient.js +126 -10
- package/dist/module/CallingClient/calling/call.js +177 -61
- package/dist/module/CallingClient/calling/callManager.js +39 -7
- package/dist/module/CallingClient/calling/types.js +2 -0
- package/dist/module/CallingClient/constants.js +24 -0
- package/dist/module/CallingClient/line/index.js +2 -2
- package/dist/module/CallingClient/registration/register.js +239 -63
- 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/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 +60 -17
- package/dist/module/common/testUtil.js +6 -1
- package/dist/module/common/types.js +3 -0
- package/dist/module/index.js +7 -3
- package/dist/module/mobius-socket/config.js +15 -0
- package/dist/module/mobius-socket/errors.js +58 -0
- package/dist/module/mobius-socket/index.js +24 -0
- package/dist/module/mobius-socket/mobius-socket.js +593 -0
- package/dist/module/mobius-socket/socket/constants.js +26 -0
- package/dist/module/mobius-socket/socket/index.js +4 -0
- package/dist/module/mobius-socket/socket/socket-base.js +368 -0
- package/dist/module/mobius-socket/socket/socket.js +9 -0
- package/dist/module/mobius-socket/socket/socket.shim.js +12 -0
- package/dist/module/mobius-socket/socket/types.js +1 -0
- package/dist/module/mobius-socket/types.js +1 -0
- package/dist/types/CallRecording/CallRecording.d.ts +18 -0
- package/dist/types/CallRecording/CallRecording.d.ts.map +1 -0
- package/dist/types/CallRecording/WxcCallRecordingConnector.d.ts +23 -0
- package/dist/types/CallRecording/WxcCallRecordingConnector.d.ts.map +1 -0
- package/dist/types/CallRecording/callRecordingFixtures.d.ts +61 -0
- package/dist/types/CallRecording/callRecordingFixtures.d.ts.map +1 -0
- package/dist/types/CallRecording/constants.d.ts +28 -0
- package/dist/types/CallRecording/constants.d.ts.map +1 -0
- package/dist/types/CallRecording/types.d.ts +176 -0
- package/dist/types/CallRecording/types.d.ts.map +1 -0
- package/dist/types/CallRecording/utils.d.ts +3 -0
- package/dist/types/CallRecording/utils.d.ts.map +1 -0
- package/dist/types/CallingClient/CallingClient.d.ts +8 -0
- package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/call.d.ts +12 -0
- package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/callManager.d.ts +4 -2
- package/dist/types/CallingClient/calling/callManager.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/types.d.ts +34 -9
- package/dist/types/CallingClient/calling/types.d.ts.map +1 -1
- package/dist/types/CallingClient/constants.d.ts +24 -0
- package/dist/types/CallingClient/constants.d.ts.map +1 -1
- package/dist/types/CallingClient/line/index.d.ts +1 -1
- package/dist/types/CallingClient/line/index.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/register.d.ts +7 -1
- package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/types.d.ts +4 -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 +1 -0
- 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/Events/types.d.ts +79 -15
- package/dist/types/Events/types.d.ts.map +1 -1
- package/dist/types/Metrics/index.d.ts.map +1 -1
- package/dist/types/Metrics/types.d.ts +19 -2
- package/dist/types/Metrics/types.d.ts.map +1 -1
- package/dist/types/SDKConnector/types.d.ts +39 -12
- package/dist/types/SDKConnector/types.d.ts.map +1 -1
- package/dist/types/api.d.ts +6 -4
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/common/Utils.d.ts +11 -3
- package/dist/types/common/Utils.d.ts.map +1 -1
- package/dist/types/common/testUtil.d.ts +5 -1
- package/dist/types/common/testUtil.d.ts.map +1 -1
- package/dist/types/common/types.d.ts +5 -1
- package/dist/types/common/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +8 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/mobius-socket/config.d.ts +17 -0
- package/dist/types/mobius-socket/config.d.ts.map +1 -0
- package/dist/types/mobius-socket/errors.d.ts +32 -0
- package/dist/types/mobius-socket/errors.d.ts.map +1 -0
- package/dist/types/mobius-socket/index.d.ts +14 -0
- package/dist/types/mobius-socket/index.d.ts.map +1 -0
- package/dist/types/mobius-socket/mobius-socket.d.ts +48 -0
- package/dist/types/mobius-socket/mobius-socket.d.ts.map +1 -0
- package/dist/types/mobius-socket/socket/constants.d.ts +27 -0
- package/dist/types/mobius-socket/socket/constants.d.ts.map +1 -0
- package/dist/types/mobius-socket/socket/index.d.ts +5 -0
- package/dist/types/mobius-socket/socket/index.d.ts.map +1 -0
- package/dist/types/mobius-socket/socket/socket-base.d.ts +43 -0
- package/dist/types/mobius-socket/socket/socket-base.d.ts.map +1 -0
- package/dist/types/mobius-socket/socket/socket.d.ts +6 -0
- package/dist/types/mobius-socket/socket/socket.d.ts.map +1 -0
- package/dist/types/mobius-socket/socket/socket.shim.d.ts +6 -0
- package/dist/types/mobius-socket/socket/socket.shim.d.ts.map +1 -0
- package/dist/types/mobius-socket/socket/types.d.ts +61 -0
- package/dist/types/mobius-socket/socket/types.d.ts.map +1 -0
- package/dist/types/mobius-socket/types.d.ts +21 -0
- package/dist/types/mobius-socket/types.d.ts.map +1 -0
- package/package.json +20 -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
|
@@ -27,10 +27,13 @@ exports.handleCallErrors = handleCallErrors;
|
|
|
27
27
|
exports.handleCallingClientErrors = handleCallingClientErrors;
|
|
28
28
|
exports.handleRegistrationErrors = handleRegistrationErrors;
|
|
29
29
|
exports.inferIdFromUuid = inferIdFromUuid;
|
|
30
|
+
exports.isValidServiceDomain = isValidServiceDomain;
|
|
30
31
|
exports.modifySdpForIPv4 = modifySdpForIPv4;
|
|
32
|
+
exports.normalizeMobiusUris = normalizeMobiusUris;
|
|
31
33
|
exports.parseMediaQualityStatistics = parseMediaQualityStatistics;
|
|
32
34
|
exports.resolveCallerIdByName = resolveCallerIdByName;
|
|
33
35
|
exports.resolveCallerIdDisplay = resolveCallerIdDisplay;
|
|
36
|
+
exports.resolveCallingBackend = resolveCallingBackend;
|
|
34
37
|
exports.resolveContact = resolveContact;
|
|
35
38
|
exports.scimQuery = scimQuery;
|
|
36
39
|
exports.serviceErrorCodeHandler = serviceErrorCodeHandler;
|
|
@@ -66,13 +69,15 @@ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof _Symbo
|
|
|
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 */
|
|
68
71
|
function filterMobiusUris(mobiusServers, defaultMobiusUrl) {
|
|
69
|
-
var _mobiusServers$primar, _mobiusServers$backup;
|
|
72
|
+
var _mobiusServers$primar, _mobiusServers$primar2, _mobiusServers$backup, _mobiusServers$backup2;
|
|
70
73
|
var logContext = {
|
|
71
74
|
file: _constants.UTILS_FILE,
|
|
72
75
|
method: 'filterMobiusUris'
|
|
73
76
|
};
|
|
74
77
|
var urisArrayPrimary = [];
|
|
75
78
|
var urisArrayBackup = [];
|
|
79
|
+
var wssArrayPrimary = [];
|
|
80
|
+
var wssArrayBackup = [];
|
|
76
81
|
if (mobiusServers !== null && mobiusServers !== void 0 && (_mobiusServers$primar = mobiusServers.primary) !== null && _mobiusServers$primar !== void 0 && _mobiusServers$primar.uris) {
|
|
77
82
|
_Logger.default.info('Adding Primary uris', logContext);
|
|
78
83
|
var _iterator = _createForOfIteratorHelper(mobiusServers.primary.uris),
|
|
@@ -88,14 +93,14 @@ function filterMobiusUris(mobiusServers, defaultMobiusUrl) {
|
|
|
88
93
|
_iterator.f();
|
|
89
94
|
}
|
|
90
95
|
}
|
|
91
|
-
if (mobiusServers !== null && mobiusServers !== void 0 && (_mobiusServers$
|
|
92
|
-
_Logger.default.info('Adding
|
|
93
|
-
var _iterator2 = _createForOfIteratorHelper(mobiusServers.
|
|
96
|
+
if (mobiusServers !== null && mobiusServers !== void 0 && (_mobiusServers$primar2 = mobiusServers.primary) !== null && _mobiusServers$primar2 !== void 0 && _mobiusServers$primar2.wss) {
|
|
97
|
+
_Logger.default.info('Adding Primary wss uris', logContext);
|
|
98
|
+
var _iterator2 = _createForOfIteratorHelper(mobiusServers.primary.wss),
|
|
94
99
|
_step2;
|
|
95
100
|
try {
|
|
96
101
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
97
|
-
var
|
|
98
|
-
|
|
102
|
+
var wssUri = _step2.value;
|
|
103
|
+
wssArrayPrimary.push(wssUri);
|
|
99
104
|
}
|
|
100
105
|
} catch (err) {
|
|
101
106
|
_iterator2.e(err);
|
|
@@ -103,6 +108,36 @@ function filterMobiusUris(mobiusServers, defaultMobiusUrl) {
|
|
|
103
108
|
_iterator2.f();
|
|
104
109
|
}
|
|
105
110
|
}
|
|
111
|
+
if (mobiusServers !== null && mobiusServers !== void 0 && (_mobiusServers$backup = mobiusServers.backup) !== null && _mobiusServers$backup !== void 0 && _mobiusServers$backup.uris) {
|
|
112
|
+
_Logger.default.info('Adding Backup uris', logContext);
|
|
113
|
+
var _iterator3 = _createForOfIteratorHelper(mobiusServers.backup.uris),
|
|
114
|
+
_step3;
|
|
115
|
+
try {
|
|
116
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
117
|
+
var _uri = _step3.value;
|
|
118
|
+
urisArrayBackup.push("".concat(_uri).concat(_constants.URL_ENDPOINT));
|
|
119
|
+
}
|
|
120
|
+
} catch (err) {
|
|
121
|
+
_iterator3.e(err);
|
|
122
|
+
} finally {
|
|
123
|
+
_iterator3.f();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (mobiusServers !== null && mobiusServers !== void 0 && (_mobiusServers$backup2 = mobiusServers.backup) !== null && _mobiusServers$backup2 !== void 0 && _mobiusServers$backup2.wss) {
|
|
127
|
+
_Logger.default.info('Adding Backup wss uris', logContext);
|
|
128
|
+
var _iterator4 = _createForOfIteratorHelper(mobiusServers.backup.wss),
|
|
129
|
+
_step4;
|
|
130
|
+
try {
|
|
131
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
132
|
+
var _wssUri = _step4.value;
|
|
133
|
+
wssArrayBackup.push(_wssUri);
|
|
134
|
+
}
|
|
135
|
+
} catch (err) {
|
|
136
|
+
_iterator4.e(err);
|
|
137
|
+
} finally {
|
|
138
|
+
_iterator4.f();
|
|
139
|
+
}
|
|
140
|
+
}
|
|
106
141
|
|
|
107
142
|
/*
|
|
108
143
|
* If there are no entries in both primary and backup arrays then add the default
|
|
@@ -116,6 +151,8 @@ function filterMobiusUris(mobiusServers, defaultMobiusUrl) {
|
|
|
116
151
|
}
|
|
117
152
|
var primaryUris = [];
|
|
118
153
|
var backupUris = [];
|
|
154
|
+
var primaryWss = [];
|
|
155
|
+
var backupWss = [];
|
|
119
156
|
|
|
120
157
|
/* Remove duplicates from primary by keeping the order intact */
|
|
121
158
|
for (var i = 0; i < urisArrayPrimary.length; i += 1) {
|
|
@@ -130,9 +167,25 @@ function filterMobiusUris(mobiusServers, defaultMobiusUrl) {
|
|
|
130
167
|
backupUris.push(urisArrayBackup[_i]);
|
|
131
168
|
}
|
|
132
169
|
}
|
|
170
|
+
|
|
171
|
+
/* Remove duplicates from primary wss by keeping the order intact */
|
|
172
|
+
for (var _i2 = 0; _i2 < wssArrayPrimary.length; _i2 += 1) {
|
|
173
|
+
if (primaryWss.indexOf(wssArrayPrimary[_i2]) === -1) {
|
|
174
|
+
primaryWss.push(wssArrayPrimary[_i2]);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/* Remove duplicates from backup wss by keeping the order intact */
|
|
179
|
+
for (var _i3 = 0; _i3 < wssArrayBackup.length; _i3 += 1) {
|
|
180
|
+
if (backupWss.indexOf(wssArrayBackup[_i3]) === -1) {
|
|
181
|
+
backupWss.push(wssArrayBackup[_i3]);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
133
184
|
return {
|
|
134
185
|
primary: primaryUris,
|
|
135
|
-
backup: backupUris
|
|
186
|
+
backup: backupUris,
|
|
187
|
+
primaryWss: primaryWss,
|
|
188
|
+
backupWss: backupWss
|
|
136
189
|
};
|
|
137
190
|
}
|
|
138
191
|
|
|
@@ -196,9 +249,9 @@ function updateErrorContext(errContext, type, message, clientError) {
|
|
|
196
249
|
* @param caller - Method which called this handler.
|
|
197
250
|
* @param file - File name from where error got reported.
|
|
198
251
|
*/
|
|
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);
|
|
252
|
+
function emitFinalFailure(emitterCb, loggerContext, message) {
|
|
253
|
+
var clientError = (0, _LineError.createLineError)(message || '', {}, _types2.ERROR_TYPE.DEFAULT, _types3.RegistrationStatus.INACTIVE);
|
|
254
|
+
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
255
|
emitterCb(clientError);
|
|
203
256
|
}
|
|
204
257
|
|
|
@@ -230,111 +283,151 @@ function handleRegistrationErrors(_x, _x2, _x3, _x4, _x5) {
|
|
|
230
283
|
*/
|
|
231
284
|
function _handleRegistrationErrors() {
|
|
232
285
|
_handleRegistrationErrors = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(err, emitterCb, loggerContext, retry429Cb, restoreRegCb) {
|
|
233
|
-
var
|
|
286
|
+
var serverCount,
|
|
287
|
+
shouldDisconnect,
|
|
288
|
+
lineError,
|
|
289
|
+
errorCode,
|
|
290
|
+
finalError,
|
|
291
|
+
caller,
|
|
292
|
+
retryAfter,
|
|
293
|
+
errorBody,
|
|
294
|
+
code,
|
|
295
|
+
errorMessage,
|
|
296
|
+
_caller,
|
|
297
|
+
_errorMessage,
|
|
298
|
+
_errorMessage2,
|
|
299
|
+
_errorMessage3,
|
|
300
|
+
_args = arguments,
|
|
301
|
+
_t,
|
|
302
|
+
_t2;
|
|
234
303
|
return _regenerator.default.wrap(function (_context) {
|
|
235
304
|
while (1) switch (_context.prev = _context.next) {
|
|
236
305
|
case 0:
|
|
306
|
+
serverCount = _args.length > 5 && _args[5] !== undefined ? _args[5] : 1;
|
|
307
|
+
shouldDisconnect = false;
|
|
237
308
|
lineError = (0, _LineError.createLineError)('', {}, _types2.ERROR_TYPE.DEFAULT, _types3.RegistrationStatus.INACTIVE);
|
|
238
309
|
errorCode = Number(err.statusCode);
|
|
239
310
|
finalError = false;
|
|
240
311
|
_Logger.default.warn("Status code: -> ".concat(errorCode), loggerContext);
|
|
241
312
|
_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.TOO_MANY_REQUESTS ? 4 : _t === _types2.ERROR_CODE.INTERNAL_SERVER_ERROR ?
|
|
313
|
+
_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.TOO_MANY_REQUESTS ? 4 : _t === _types2.ERROR_CODE.INTERNAL_SERVER_ERROR ? 6 : _t === _types2.ERROR_CODE.SERVICE_UNAVAILABLE ? 7 : _t === _types2.ERROR_CODE.FORBIDDEN ? 8 : 16;
|
|
243
314
|
break;
|
|
244
315
|
case 1:
|
|
245
316
|
finalError = true;
|
|
246
317
|
_Logger.default.warn("400 Bad Request", loggerContext);
|
|
247
318
|
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
319
|
emitterCb(lineError, finalError);
|
|
249
|
-
|
|
320
|
+
shouldDisconnect = serverCount > 1;
|
|
321
|
+
return _context.abrupt("continue", 17);
|
|
250
322
|
case 2:
|
|
251
323
|
// Return it to the Caller
|
|
252
324
|
finalError = true;
|
|
253
325
|
_Logger.default.warn("401 Unauthorized", loggerContext);
|
|
254
326
|
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
327
|
emitterCb(lineError, finalError);
|
|
256
|
-
|
|
328
|
+
shouldDisconnect = serverCount > 1;
|
|
329
|
+
return _context.abrupt("continue", 17);
|
|
257
330
|
case 3:
|
|
258
331
|
finalError = true;
|
|
259
332
|
_Logger.default.warn("404 Device Not Found", loggerContext);
|
|
260
333
|
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
334
|
emitterCb(lineError, finalError);
|
|
262
|
-
|
|
335
|
+
shouldDisconnect = serverCount > 1;
|
|
336
|
+
return _context.abrupt("continue", 17);
|
|
263
337
|
case 4:
|
|
264
338
|
_Logger.default.warn("429 Too Many Requests", loggerContext);
|
|
265
339
|
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
340
|
caller = loggerContext.method || 'handleErrors';
|
|
267
|
-
if (retry429Cb && err.headers) {
|
|
268
|
-
|
|
269
|
-
|
|
341
|
+
if (!(retry429Cb && err.headers)) {
|
|
342
|
+
_context.next = 5;
|
|
343
|
+
break;
|
|
270
344
|
}
|
|
271
|
-
|
|
345
|
+
retryAfter = Number(err.headers['retry-after']);
|
|
346
|
+
_context.next = 5;
|
|
347
|
+
return retry429Cb(retryAfter, caller);
|
|
272
348
|
case 5:
|
|
349
|
+
shouldDisconnect = false;
|
|
350
|
+
return _context.abrupt("continue", 17);
|
|
351
|
+
case 6:
|
|
273
352
|
_Logger.default.warn("500 Internal Server Error", loggerContext);
|
|
274
353
|
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
354
|
emitterCb(lineError, finalError);
|
|
276
|
-
|
|
277
|
-
|
|
355
|
+
shouldDisconnect = serverCount > 1;
|
|
356
|
+
return _context.abrupt("continue", 17);
|
|
357
|
+
case 7:
|
|
278
358
|
_Logger.default.warn("503 Service Unavailable", loggerContext);
|
|
279
359
|
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
360
|
emitterCb(lineError, finalError);
|
|
281
|
-
|
|
282
|
-
|
|
361
|
+
shouldDisconnect = serverCount > 1;
|
|
362
|
+
return _context.abrupt("continue", 17);
|
|
363
|
+
case 8:
|
|
283
364
|
_Logger.default.warn("403 Forbidden", loggerContext);
|
|
284
365
|
errorBody = err.body;
|
|
285
366
|
if (errorBody) {
|
|
286
|
-
_context.next =
|
|
367
|
+
_context.next = 9;
|
|
287
368
|
break;
|
|
288
369
|
}
|
|
289
370
|
_Logger.default.warn('Error response has no body, throwing default error', loggerContext);
|
|
290
371
|
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
372
|
emitterCb(lineError, finalError);
|
|
292
|
-
|
|
293
|
-
|
|
373
|
+
shouldDisconnect = serverCount > 1;
|
|
374
|
+
return _context.abrupt("return", {
|
|
375
|
+
finalError: finalError,
|
|
376
|
+
shouldDisconnect: shouldDisconnect
|
|
377
|
+
});
|
|
378
|
+
case 9:
|
|
294
379
|
code = Number(errorBody.errorCode);
|
|
295
380
|
_Logger.default.warn("Error code found : ".concat(code), loggerContext);
|
|
296
381
|
_t2 = code;
|
|
297
|
-
_context.next = _t2 === _types2.DEVICE_ERROR_CODE.DEVICE_LIMIT_EXCEEDED ?
|
|
382
|
+
_context.next = _t2 === _types2.DEVICE_ERROR_CODE.DEVICE_LIMIT_EXCEEDED ? 10 : _t2 === _types2.DEVICE_ERROR_CODE.DEVICE_CREATION_DISABLED ? 12 : _t2 === _types2.DEVICE_ERROR_CODE.DEVICE_CREATION_FAILED ? 13 : 14;
|
|
298
383
|
break;
|
|
299
|
-
case
|
|
384
|
+
case 10:
|
|
300
385
|
errorMessage = 'User device limit exceeded';
|
|
301
386
|
_Logger.default.warn(errorMessage, loggerContext);
|
|
302
387
|
if (!restoreRegCb) {
|
|
303
|
-
_context.next =
|
|
388
|
+
_context.next = 11;
|
|
304
389
|
break;
|
|
305
390
|
}
|
|
306
391
|
_caller = loggerContext.method || 'handleErrors';
|
|
307
|
-
_context.next =
|
|
392
|
+
_context.next = 11;
|
|
308
393
|
return restoreRegCb(errorBody, _caller);
|
|
309
|
-
case 10:
|
|
310
|
-
return _context.abrupt("continue", 14);
|
|
311
394
|
case 11:
|
|
395
|
+
shouldDisconnect = false;
|
|
396
|
+
return _context.abrupt("continue", 15);
|
|
397
|
+
case 12:
|
|
312
398
|
_errorMessage = 'User is not configured for WebRTC calling. Please contact the administrator to resolve this issue.';
|
|
313
399
|
finalError = true;
|
|
314
400
|
updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.FORBIDDEN_ERROR, _errorMessage, _types3.RegistrationStatus.INACTIVE, lineError);
|
|
315
401
|
_Logger.default.warn(_errorMessage, loggerContext);
|
|
316
402
|
emitterCb(lineError, true);
|
|
317
|
-
|
|
318
|
-
|
|
403
|
+
shouldDisconnect = true;
|
|
404
|
+
return _context.abrupt("continue", 15);
|
|
405
|
+
case 13:
|
|
319
406
|
_errorMessage2 = 'An unknown error occurred while provisioning the device. Wait a moment and try again.';
|
|
320
407
|
updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.FORBIDDEN_ERROR, _errorMessage2, _types3.RegistrationStatus.INACTIVE, lineError);
|
|
321
408
|
_Logger.default.warn(_errorMessage2, loggerContext);
|
|
322
409
|
emitterCb(lineError, finalError);
|
|
323
|
-
|
|
324
|
-
|
|
410
|
+
shouldDisconnect = serverCount > 1;
|
|
411
|
+
return _context.abrupt("continue", 15);
|
|
412
|
+
case 14:
|
|
325
413
|
_errorMessage3 = 'An unknown error occurred. Wait a moment and try again. Please contact the administrator if the problem persists.';
|
|
326
414
|
updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.FORBIDDEN_ERROR, _errorMessage3, _types3.RegistrationStatus.INACTIVE, lineError);
|
|
327
415
|
_Logger.default.warn(_errorMessage3, loggerContext);
|
|
328
416
|
emitterCb(lineError, finalError);
|
|
329
|
-
|
|
330
|
-
return _context.abrupt("continue", 16);
|
|
417
|
+
shouldDisconnect = serverCount > 1;
|
|
331
418
|
case 15:
|
|
419
|
+
return _context.abrupt("continue", 17);
|
|
420
|
+
case 16:
|
|
332
421
|
updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.DEFAULT, 'Unknown error', _types3.RegistrationStatus.INACTIVE, lineError);
|
|
333
422
|
_Logger.default.warn("Unknown Error", loggerContext);
|
|
334
423
|
emitterCb(lineError, finalError);
|
|
335
|
-
|
|
336
|
-
return _context.abrupt("return", finalError);
|
|
424
|
+
shouldDisconnect = serverCount > 1;
|
|
337
425
|
case 17:
|
|
426
|
+
return _context.abrupt("return", {
|
|
427
|
+
finalError: finalError,
|
|
428
|
+
shouldDisconnect: shouldDisconnect
|
|
429
|
+
});
|
|
430
|
+
case 18:
|
|
338
431
|
case "end":
|
|
339
432
|
return _context.stop();
|
|
340
433
|
}
|
|
@@ -878,15 +971,15 @@ var waitForMsecs = exports.waitForMsecs = function waitForMsecs(msec) {
|
|
|
878
971
|
};
|
|
879
972
|
|
|
880
973
|
/**
|
|
881
|
-
*
|
|
974
|
+
* Determine the calling backend from the device object.
|
|
882
975
|
*
|
|
883
|
-
* @param
|
|
976
|
+
* @param device - The device object containing callingBehavior and entitlement features.
|
|
884
977
|
* @returns CallingBackEnd.
|
|
885
978
|
*/
|
|
886
|
-
function
|
|
887
|
-
var entModels =
|
|
979
|
+
function resolveCallingBackend(device) {
|
|
980
|
+
var entModels = device.features.entitlement.models;
|
|
888
981
|
var callingBackend;
|
|
889
|
-
if (
|
|
982
|
+
if (device.callingBehavior === _constants2.NATIVE_WEBEX_TEAMS_CALLING) {
|
|
890
983
|
for (var i = 0; i < entModels.length; i += 1) {
|
|
891
984
|
if (entModels[i][_constants2.VALUES][_constants2.KEY] === _constants2.ENTITLEMENT_BASIC || entModels[i][_constants2.VALUES][_constants2.KEY] === _constants2.ENTITLEMENT_STANDARD) {
|
|
892
985
|
callingBackend = _types3.CALLING_BACKEND.WXC;
|
|
@@ -896,12 +989,22 @@ function getCallingBackEnd(webex) {
|
|
|
896
989
|
break;
|
|
897
990
|
}
|
|
898
991
|
}
|
|
899
|
-
} else if (
|
|
992
|
+
} else if (device.callingBehavior === _constants2.NATIVE_SIP_CALL_TO_UCM) {
|
|
900
993
|
callingBackend = _types3.CALLING_BACKEND.UCM;
|
|
901
994
|
} else {
|
|
902
995
|
callingBackend = _types3.CALLING_BACKEND.INVALID;
|
|
903
996
|
}
|
|
904
|
-
return callingBackend;
|
|
997
|
+
return callingBackend || _types3.CALLING_BACKEND.INVALID;
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
/**
|
|
1001
|
+
* Register calling backend.
|
|
1002
|
+
*
|
|
1003
|
+
* @param webex -.
|
|
1004
|
+
* @returns CallingBackEnd.
|
|
1005
|
+
*/
|
|
1006
|
+
function getCallingBackEnd(webex) {
|
|
1007
|
+
return resolveCallingBackend(webex.internal.device);
|
|
905
1008
|
}
|
|
906
1009
|
|
|
907
1010
|
/**
|
|
@@ -1328,7 +1431,7 @@ function isValidServiceDomain(serviceData) {
|
|
|
1328
1431
|
}
|
|
1329
1432
|
|
|
1330
1433
|
/**
|
|
1331
|
-
* Validates service data object(indicator
|
|
1434
|
+
* Validates service data object(indicator) and throws
|
|
1332
1435
|
* exception with a message indicating the reason for validation
|
|
1333
1436
|
* failure.
|
|
1334
1437
|
*
|
|
@@ -1340,9 +1443,6 @@ function validateServiceData(serviceData) {
|
|
|
1340
1443
|
if (!isValidServiceIndicator(serviceData.indicator)) {
|
|
1341
1444
|
throw new Error("Invalid service indicator, Allowed values are: ".concat(formattedValues));
|
|
1342
1445
|
}
|
|
1343
|
-
if (!isValidServiceDomain(serviceData)) {
|
|
1344
|
-
throw new Error('Invalid service domain.');
|
|
1345
|
-
}
|
|
1346
1446
|
}
|
|
1347
1447
|
|
|
1348
1448
|
/**
|
|
@@ -1480,4 +1580,9 @@ function _uploadLogs() {
|
|
|
1480
1580
|
}));
|
|
1481
1581
|
return _uploadLogs.apply(this, arguments);
|
|
1482
1582
|
}
|
|
1583
|
+
function normalizeMobiusUris(urls) {
|
|
1584
|
+
return urls.map(function (url) {
|
|
1585
|
+
return !url.endsWith('/') ? "".concat(url, "/") : url;
|
|
1586
|
+
});
|
|
1587
|
+
}
|
|
1483
1588
|
//# sourceMappingURL=Utils.js.map
|