@webex/calling 3.0.0-next.2 → 3.0.0-next.21
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/CHANGELOG.md +1403 -0
- package/dist/CallHistory/CallHistory.js +1 -3
- package/dist/CallHistory/CallHistory.js.map +1 -1
- package/dist/CallHistory/callHistoryFixtures.js +9 -0
- package/dist/CallHistory/callHistoryFixtures.js.map +1 -1
- package/dist/CallHistory/types.js.map +1 -1
- package/dist/CallSettings/CallSettings.js +0 -2
- package/dist/CallSettings/CallSettings.js.map +1 -1
- package/dist/CallSettings/types.js.map +1 -1
- package/dist/CallingClient/CallingClient.js +119 -62
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +161 -102
- package/dist/CallingClient/CallingClient.test.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/index.js +3 -23
- package/dist/CallingClient/calling/CallerId/index.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/types.js.map +1 -1
- package/dist/CallingClient/calling/call.js +78 -33
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +483 -351
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/CallingClient/calling/callManager.js +0 -9
- package/dist/CallingClient/calling/callManager.js.map +1 -1
- package/dist/CallingClient/calling/callManager.test.js +1 -1
- package/dist/CallingClient/calling/callManager.test.js.map +1 -1
- package/dist/CallingClient/calling/types.js.map +1 -1
- package/dist/CallingClient/callingClientFixtures.js +107 -1
- package/dist/CallingClient/callingClientFixtures.js.map +1 -1
- package/dist/CallingClient/constants.js +14 -6
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/CallingClient/line/index.js +12 -12
- package/dist/CallingClient/line/index.js.map +1 -1
- package/dist/CallingClient/line/line.test.js +9 -9
- package/dist/CallingClient/line/line.test.js.map +1 -1
- package/dist/CallingClient/line/types.js +4 -7
- package/dist/CallingClient/line/types.js.map +1 -1
- package/dist/CallingClient/registration/register.js +62 -80
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +28 -28
- package/dist/CallingClient/registration/register.test.js.map +1 -1
- package/dist/CallingClient/registration/types.js.map +1 -1
- package/dist/CallingClient/types.js.map +1 -1
- package/dist/Contacts/ContactsClient.js +8 -2
- package/dist/Contacts/ContactsClient.js.map +1 -1
- package/dist/Contacts/types.js +3 -0
- package/dist/Contacts/types.js.map +1 -1
- package/dist/Errors/catalog/CallingDeviceError.js +1 -1
- package/dist/Errors/catalog/CallingDeviceError.js.map +1 -1
- package/dist/Errors/catalog/LineError.js +2 -2
- package/dist/Errors/catalog/LineError.js.map +1 -1
- package/dist/Errors/index.js +7 -0
- package/dist/Errors/index.js.map +1 -1
- package/dist/Errors/types.js.map +1 -1
- package/dist/Events/types.js +0 -1
- package/dist/Events/types.js.map +1 -1
- package/dist/Metrics/index.test.js +1 -1
- package/dist/Metrics/index.test.js.map +1 -1
- package/dist/SDKConnector/types.js.map +1 -1
- package/dist/Voicemail/Voicemail.js +18 -21
- package/dist/Voicemail/Voicemail.js.map +1 -1
- package/dist/Voicemail/WxCallBackendConnector.js +1 -1
- package/dist/Voicemail/WxCallBackendConnector.js.map +1 -1
- package/dist/Voicemail/types.js.map +1 -1
- package/dist/api.js +43 -20
- package/dist/api.js.map +1 -1
- package/dist/common/Utils.js +13 -18
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +1 -1
- package/dist/common/Utils.test.js.map +1 -1
- package/dist/common/testUtil.js +2 -1
- package/dist/common/testUtil.js.map +1 -1
- package/dist/common/types.js +8 -7
- package/dist/common/types.js.map +1 -1
- package/dist/index.js +233 -0
- package/dist/index.js.map +1 -1
- package/dist/module/CallHistory/callHistoryFixtures.js +9 -0
- package/dist/module/CallingClient/CallingClient.js +59 -42
- package/dist/module/CallingClient/calling/CallerId/index.js +3 -23
- package/dist/module/CallingClient/calling/call.js +54 -17
- package/dist/module/CallingClient/calling/callManager.js +0 -6
- package/dist/module/CallingClient/callingClientFixtures.js +119 -1
- package/dist/module/CallingClient/constants.js +8 -4
- package/dist/module/CallingClient/line/index.js +7 -10
- package/dist/module/CallingClient/line/types.js +0 -5
- package/dist/module/CallingClient/registration/register.js +28 -20
- package/dist/module/Contacts/ContactsClient.js +3 -0
- package/dist/module/Errors/catalog/CallingDeviceError.js +2 -2
- package/dist/module/Errors/catalog/LineError.js +2 -2
- package/dist/module/Errors/index.js +1 -0
- package/dist/module/api.js +6 -5
- package/dist/module/common/Utils.js +14 -19
- package/dist/module/common/testUtil.js +2 -1
- package/dist/module/common/types.js +6 -5
- package/dist/module/index.js +7 -0
- package/dist/types/CallHistory/CallHistory.d.ts.map +1 -1
- package/dist/types/CallHistory/callHistoryFixtures.d.ts.map +1 -1
- package/dist/types/CallSettings/CallSettings.d.ts.map +1 -1
- package/dist/types/CallSettings/types.d.ts.map +1 -1
- package/dist/types/CallingClient/CallingClient.d.ts +2 -0
- package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/CallerId/index.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/CallerId/types.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/call.d.ts +2 -0
- package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/callManager.d.ts +0 -1
- package/dist/types/CallingClient/calling/callManager.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/types.d.ts +30 -30
- package/dist/types/CallingClient/calling/types.d.ts.map +1 -1
- package/dist/types/CallingClient/callingClientFixtures.d.ts +69 -1
- package/dist/types/CallingClient/callingClientFixtures.d.ts.map +1 -1
- package/dist/types/CallingClient/constants.d.ts +7 -3
- package/dist/types/CallingClient/constants.d.ts.map +1 -1
- package/dist/types/CallingClient/line/index.d.ts +4 -5
- package/dist/types/CallingClient/line/index.d.ts.map +1 -1
- package/dist/types/CallingClient/line/types.d.ts +8 -13
- package/dist/types/CallingClient/line/types.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/register.d.ts +3 -3
- package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/types.d.ts +14 -14
- package/dist/types/CallingClient/registration/types.d.ts.map +1 -1
- package/dist/types/CallingClient/types.d.ts +6 -4
- package/dist/types/CallingClient/types.d.ts.map +1 -1
- package/dist/types/Contacts/ContactsClient.d.ts +3 -2
- package/dist/types/Contacts/ContactsClient.d.ts.map +1 -1
- package/dist/types/Contacts/types.d.ts +2 -0
- package/dist/types/Contacts/types.d.ts.map +1 -1
- package/dist/types/Errors/catalog/CallingDeviceError.d.ts +4 -4
- package/dist/types/Errors/catalog/CallingDeviceError.d.ts.map +1 -1
- package/dist/types/Errors/catalog/LineError.d.ts +4 -4
- package/dist/types/Errors/catalog/LineError.d.ts.map +1 -1
- package/dist/types/Errors/index.d.ts +1 -0
- package/dist/types/Errors/index.d.ts.map +1 -1
- package/dist/types/Errors/types.d.ts +2 -3
- package/dist/types/Errors/types.d.ts.map +1 -1
- package/dist/types/Events/types.d.ts +11 -0
- package/dist/types/Events/types.d.ts.map +1 -1
- package/dist/types/SDKConnector/types.d.ts +2 -1
- package/dist/types/SDKConnector/types.d.ts.map +1 -1
- package/dist/types/Voicemail/UcmBackendConnector.d.ts +1 -1
- package/dist/types/Voicemail/Voicemail.d.ts.map +1 -1
- package/dist/types/Voicemail/WxCallBackendConnector.d.ts +1 -1
- package/dist/types/Voicemail/types.d.ts +10 -10
- package/dist/types/Voicemail/types.d.ts.map +1 -1
- package/dist/types/api.d.ts +10 -10
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/common/Utils.d.ts.map +1 -1
- package/dist/types/common/testUtil.d.ts +1 -0
- package/dist/types/common/testUtil.d.ts.map +1 -1
- package/dist/types/common/types.d.ts +3 -2
- package/dist/types/common/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +11 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +6 -5
|
@@ -36,11 +36,6 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
36
36
|
*/
|
|
37
37
|
var Registration = /*#__PURE__*/function () {
|
|
38
38
|
/**
|
|
39
|
-
* @param webex - A webex instance.
|
|
40
|
-
* @param serviceData - indicates whether the backend service is calling or contactcentre
|
|
41
|
-
* @param mutex - mutex which is used to run any registration scenario exclusively
|
|
42
|
-
* @param lineEmitter - Line emitter for registration related events
|
|
43
|
-
* @param logLevel - log level option for registration module
|
|
44
39
|
*/
|
|
45
40
|
function Registration(webex, serviceData, mutex, lineEmitter, logLevel) {
|
|
46
41
|
(0, _classCallCheck2.default)(this, Registration);
|
|
@@ -71,7 +66,7 @@ var Registration = /*#__PURE__*/function () {
|
|
|
71
66
|
}
|
|
72
67
|
this.webex = this.sdkConnector.getWebex();
|
|
73
68
|
this.userId = this.webex.internal.device.userId;
|
|
74
|
-
this.registrationStatus = _types3.
|
|
69
|
+
this.registrationStatus = _types3.RegistrationStatus.IDLE;
|
|
75
70
|
this.failback429RetryAttempts = 0;
|
|
76
71
|
_Logger.default.setLogger(logLevel, _constants.REGISTRATION_FILE);
|
|
77
72
|
this.rehomingIntervalMin = _constants.DEFAULT_REHOMING_INTERVAL_MIN;
|
|
@@ -108,8 +103,6 @@ var Registration = /*#__PURE__*/function () {
|
|
|
108
103
|
/**
|
|
109
104
|
* Implementation of sending keepalive.
|
|
110
105
|
*
|
|
111
|
-
* @param url - Entire device url.
|
|
112
|
-
* @returns Promise<boolean>.
|
|
113
106
|
*/
|
|
114
107
|
}, {
|
|
115
108
|
key: "postKeepAlive",
|
|
@@ -139,19 +132,17 @@ var Registration = /*#__PURE__*/function () {
|
|
|
139
132
|
/**
|
|
140
133
|
* Implementation of delete device.
|
|
141
134
|
*
|
|
142
|
-
* @param url -.
|
|
143
|
-
* @param deviceId -.
|
|
144
|
-
* @param deviceUrl -.
|
|
145
135
|
*/
|
|
146
136
|
}, {
|
|
147
137
|
key: "deleteRegistration",
|
|
148
138
|
value: function () {
|
|
149
139
|
var _deleteRegistration = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(url, deviceId, deviceUrl) {
|
|
150
|
-
var
|
|
151
|
-
var response;
|
|
140
|
+
var _response;
|
|
141
|
+
var response, _headers2;
|
|
152
142
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
153
143
|
while (1) switch (_context2.prev = _context2.next) {
|
|
154
144
|
case 0:
|
|
145
|
+
_context2.prev = 0;
|
|
155
146
|
_context2.t0 = fetch;
|
|
156
147
|
_context2.t1 = "".concat(url).concat(_constants.DEVICES_ENDPOINT_RESOURCE, "/").concat(deviceId);
|
|
157
148
|
_context2.t2 = _types3.HTTP_METHODS.DELETE;
|
|
@@ -159,9 +150,9 @@ var Registration = /*#__PURE__*/function () {
|
|
|
159
150
|
(0, _defineProperty2.default)(_headers2, _constants.CISCO_DEVICE_URL, deviceUrl);
|
|
160
151
|
_context2.t3 = _defineProperty2.default;
|
|
161
152
|
_context2.t4 = _headers2;
|
|
162
|
-
_context2.next =
|
|
153
|
+
_context2.next = 10;
|
|
163
154
|
return this.webex.credentials.getUserToken();
|
|
164
|
-
case
|
|
155
|
+
case 10:
|
|
165
156
|
_context2.t5 = _context2.sent;
|
|
166
157
|
(0, _context2.t3)(_context2.t4, "Authorization", _context2.t5);
|
|
167
158
|
(0, _defineProperty2.default)(_headers2, "trackingId", "".concat(_constants.WEBEX_WEB_CLIENT, "_").concat((0, _uuid.v4)()));
|
|
@@ -171,17 +162,25 @@ var Registration = /*#__PURE__*/function () {
|
|
|
171
162
|
method: _context2.t2,
|
|
172
163
|
headers: _context2.t6
|
|
173
164
|
};
|
|
174
|
-
_context2.next =
|
|
165
|
+
_context2.next = 18;
|
|
175
166
|
return (0, _context2.t0)(_context2.t1, _context2.t7);
|
|
176
|
-
case
|
|
167
|
+
case 18:
|
|
177
168
|
response = _context2.sent;
|
|
169
|
+
_context2.next = 24;
|
|
170
|
+
break;
|
|
171
|
+
case 21:
|
|
172
|
+
_context2.prev = 21;
|
|
173
|
+
_context2.t8 = _context2["catch"](0);
|
|
174
|
+
_Logger.default.warn("Delete failed with Mobius", {});
|
|
175
|
+
case 24:
|
|
176
|
+
this.setStatus(_types3.RegistrationStatus.INACTIVE);
|
|
178
177
|
this.lineEmitter(_types4.LINE_EVENTS.UNREGISTERED);
|
|
179
|
-
return _context2.abrupt("return", response.json());
|
|
180
|
-
case
|
|
178
|
+
return _context2.abrupt("return", (_response = response) === null || _response === void 0 ? void 0 : _response.json());
|
|
179
|
+
case 27:
|
|
181
180
|
case "end":
|
|
182
181
|
return _context2.stop();
|
|
183
182
|
}
|
|
184
|
-
}, _callee2, this);
|
|
183
|
+
}, _callee2, this, [[0, 21]]);
|
|
185
184
|
}));
|
|
186
185
|
function deleteRegistration(_x2, _x3, _x4) {
|
|
187
186
|
return _deleteRegistration.apply(this, arguments);
|
|
@@ -191,7 +190,6 @@ var Registration = /*#__PURE__*/function () {
|
|
|
191
190
|
/**
|
|
192
191
|
* Implementation of POST request for device registration.
|
|
193
192
|
*
|
|
194
|
-
* @param url - backend service url for registration
|
|
195
193
|
*/
|
|
196
194
|
}, {
|
|
197
195
|
key: "postRegistration",
|
|
@@ -228,7 +226,6 @@ var Registration = /*#__PURE__*/function () {
|
|
|
228
226
|
/**
|
|
229
227
|
* Re-attempts registration with the mobius url it was last registered
|
|
230
228
|
* to, that mobius url is expected to be updated already in this.activeMobiusUrl.
|
|
231
|
-
* @param caller - Caller of this method.
|
|
232
229
|
*/
|
|
233
230
|
}, {
|
|
234
231
|
key: "restorePreviousRegistration",
|
|
@@ -313,7 +310,6 @@ var Registration = /*#__PURE__*/function () {
|
|
|
313
310
|
* Calculates and returns a random interval value using input argument
|
|
314
311
|
* attempt as the variable factor.
|
|
315
312
|
*
|
|
316
|
-
* @param attempt - Number of times registration has been
|
|
317
313
|
* attempted already.
|
|
318
314
|
*/
|
|
319
315
|
}, {
|
|
@@ -329,8 +325,6 @@ var Registration = /*#__PURE__*/function () {
|
|
|
329
325
|
* Once the time taken since the beginning of retry attempt exceeds the
|
|
330
326
|
* retry threshold, it switches over to backup mobius servers.
|
|
331
327
|
*
|
|
332
|
-
* @param attempt - Number of times registration has been attempted already.
|
|
333
|
-
* @param timeElapsed - Time elapsed since the first registration attempt.
|
|
334
328
|
*/
|
|
335
329
|
}, {
|
|
336
330
|
key: "startFailoverTimer",
|
|
@@ -514,7 +508,6 @@ var Registration = /*#__PURE__*/function () {
|
|
|
514
508
|
/**
|
|
515
509
|
* Starts failback timer with the interval value received.
|
|
516
510
|
*
|
|
517
|
-
* @param intervalInSeconds - Failback timer interval value in seconds.
|
|
518
511
|
*/
|
|
519
512
|
}, {
|
|
520
513
|
key: "startFailbackTimer",
|
|
@@ -633,7 +626,6 @@ var Registration = /*#__PURE__*/function () {
|
|
|
633
626
|
* if received in registration response from a primary mobius
|
|
634
627
|
* server.
|
|
635
628
|
*
|
|
636
|
-
* @param deviceInfo - Line info.
|
|
637
629
|
*/
|
|
638
630
|
}, {
|
|
639
631
|
key: "setIntervalValues",
|
|
@@ -643,6 +635,11 @@ var Registration = /*#__PURE__*/function () {
|
|
|
643
635
|
this.rehomingIntervalMax = deviceInfo !== null && deviceInfo !== void 0 && deviceInfo.rehomingIntervalMax ? deviceInfo.rehomingIntervalMax : _constants.DEFAULT_REHOMING_INTERVAL_MAX;
|
|
644
636
|
}
|
|
645
637
|
}
|
|
638
|
+
|
|
639
|
+
/**
|
|
640
|
+
* Retrieves information about the device as {@link IDeviceInfo}.
|
|
641
|
+
*
|
|
642
|
+
*/
|
|
646
643
|
}, {
|
|
647
644
|
key: "getDeviceInfo",
|
|
648
645
|
value: function getDeviceInfo() {
|
|
@@ -650,16 +647,15 @@ var Registration = /*#__PURE__*/function () {
|
|
|
650
647
|
}
|
|
651
648
|
|
|
652
649
|
/**
|
|
653
|
-
* .
|
|
650
|
+
* Checks if the device is currently registered.
|
|
654
651
|
*
|
|
655
|
-
* @returns True if this device is in registered state
|
|
656
652
|
* by checking if isRegistered state is set to
|
|
657
653
|
* ACTIVE, else false.
|
|
658
654
|
*/
|
|
659
655
|
}, {
|
|
660
656
|
key: "isDeviceRegistered",
|
|
661
657
|
value: function isDeviceRegistered() {
|
|
662
|
-
return this.registrationStatus === _types3.
|
|
658
|
+
return this.registrationStatus === _types3.RegistrationStatus.ACTIVE;
|
|
663
659
|
}
|
|
664
660
|
}, {
|
|
665
661
|
key: "getStatus",
|
|
@@ -676,7 +672,6 @@ var Registration = /*#__PURE__*/function () {
|
|
|
676
672
|
* Start fresh registration cycle with the mobius
|
|
677
673
|
* server list already present.
|
|
678
674
|
*
|
|
679
|
-
* @param caller - Caller of this method.
|
|
680
675
|
*/
|
|
681
676
|
}, {
|
|
682
677
|
key: "restartRegistration",
|
|
@@ -713,6 +708,11 @@ var Registration = /*#__PURE__*/function () {
|
|
|
713
708
|
}
|
|
714
709
|
return restartRegistration;
|
|
715
710
|
}()
|
|
711
|
+
/**
|
|
712
|
+
* Restores the connection and attempts refreshing existing registration with server.
|
|
713
|
+
* Allows retry if not restored in the first attempt.
|
|
714
|
+
*
|
|
715
|
+
*/
|
|
716
716
|
}, {
|
|
717
717
|
key: "handleConnectionRestoration",
|
|
718
718
|
value: function () {
|
|
@@ -731,7 +731,7 @@ var Registration = /*#__PURE__*/function () {
|
|
|
731
731
|
_context15.next = 14;
|
|
732
732
|
break;
|
|
733
733
|
}
|
|
734
|
-
_Logger.default.info('Mercury connection is up again,
|
|
734
|
+
_Logger.default.info('Mercury connection is up again, re-registering with Webex Calling if needed', {
|
|
735
735
|
file: _constants.REGISTRATION_FILE,
|
|
736
736
|
method: _this4.handleConnectionRestoration.name
|
|
737
737
|
});
|
|
@@ -882,9 +882,6 @@ var Registration = /*#__PURE__*/function () {
|
|
|
882
882
|
* argument one by one until registration either succeeds with
|
|
883
883
|
* one or all of them are tried.
|
|
884
884
|
*
|
|
885
|
-
* @param caller - Caller of this method.
|
|
886
|
-
* @param servers - List of mobius server urls to try.
|
|
887
|
-
* @returns Promise resolving to a boolean carrying true if registration
|
|
888
885
|
* attempt has hit a final error and a retry should not be scheduled
|
|
889
886
|
* else false.
|
|
890
887
|
*/
|
|
@@ -923,13 +920,13 @@ var Registration = /*#__PURE__*/function () {
|
|
|
923
920
|
_iterator.s();
|
|
924
921
|
case 8:
|
|
925
922
|
if ((_step = _iterator.n()).done) {
|
|
926
|
-
_context19.next =
|
|
923
|
+
_context19.next = 53;
|
|
927
924
|
break;
|
|
928
925
|
}
|
|
929
926
|
url = _step.value;
|
|
930
927
|
_context19.prev = 10;
|
|
931
928
|
abort = false;
|
|
932
|
-
this.registrationStatus = _types3.
|
|
929
|
+
this.registrationStatus = _types3.RegistrationStatus.INACTIVE;
|
|
933
930
|
this.lineEmitter(_types4.LINE_EVENTS.CONNECTING);
|
|
934
931
|
_Logger.default.log("[".concat(caller, "] : Mobius url to contact: ").concat(url), {
|
|
935
932
|
file: _constants.REGISTRATION_FILE,
|
|
@@ -942,14 +939,14 @@ var Registration = /*#__PURE__*/function () {
|
|
|
942
939
|
resp = _context19.sent;
|
|
943
940
|
this.deviceInfo = resp.body;
|
|
944
941
|
this.lineEmitter(_types4.LINE_EVENTS.REGISTERED, resp.body);
|
|
945
|
-
this.registrationStatus = _types3.
|
|
942
|
+
this.registrationStatus = _types3.RegistrationStatus.ACTIVE;
|
|
946
943
|
this.setActiveMobiusUrl(url);
|
|
947
944
|
this.setIntervalValues(this.deviceInfo);
|
|
948
945
|
this.metricManager.setDeviceInfo(this.deviceInfo);
|
|
949
946
|
this.metricManager.submitRegistrationMetric(_types2.METRIC_EVENT.REGISTRATION, _types2.REG_ACTION.REGISTER, _types2.METRIC_TYPE.BEHAVIORAL, undefined);
|
|
950
947
|
this.startKeepaliveTimer((_this$deviceInfo$devi = this.deviceInfo.device) === null || _this$deviceInfo$devi === void 0 ? void 0 : _this$deviceInfo$devi.uri, this.deviceInfo.keepaliveInterval);
|
|
951
948
|
this.initiateFailback();
|
|
952
|
-
return _context19.abrupt("break",
|
|
949
|
+
return _context19.abrupt("break", 53);
|
|
953
950
|
case 30:
|
|
954
951
|
_context19.prev = 30;
|
|
955
952
|
_context19.t0 = _context19["catch"](10);
|
|
@@ -968,7 +965,7 @@ var Registration = /*#__PURE__*/function () {
|
|
|
968
965
|
}, this.restoreRegistrationCallBack());
|
|
969
966
|
case 35:
|
|
970
967
|
abort = _context19.sent;
|
|
971
|
-
if (!(this.registrationStatus === _types3.
|
|
968
|
+
if (!(this.registrationStatus === _types3.RegistrationStatus.ACTIVE)) {
|
|
972
969
|
_context19.next = 39;
|
|
973
970
|
break;
|
|
974
971
|
}
|
|
@@ -976,49 +973,50 @@ var Registration = /*#__PURE__*/function () {
|
|
|
976
973
|
file: _constants.REGISTRATION_FILE,
|
|
977
974
|
method: this.attemptRegistrationWithServers.name
|
|
978
975
|
});
|
|
979
|
-
return _context19.abrupt("break",
|
|
976
|
+
return _context19.abrupt("break", 53);
|
|
980
977
|
case 39:
|
|
981
978
|
if (!abort) {
|
|
982
|
-
_context19.next =
|
|
979
|
+
_context19.next = 44;
|
|
983
980
|
break;
|
|
984
981
|
}
|
|
985
|
-
|
|
986
|
-
|
|
982
|
+
this.setStatus(_types3.RegistrationStatus.INACTIVE);
|
|
983
|
+
return _context19.abrupt("break", 53);
|
|
984
|
+
case 44:
|
|
987
985
|
if (!(caller === this.executeFailback.name)) {
|
|
988
|
-
_context19.next =
|
|
986
|
+
_context19.next = 51;
|
|
989
987
|
break;
|
|
990
988
|
}
|
|
991
989
|
error = body.statusCode;
|
|
992
990
|
if (!(error === _types.ERROR_CODE.TOO_MANY_REQUESTS)) {
|
|
993
|
-
_context19.next =
|
|
991
|
+
_context19.next = 51;
|
|
994
992
|
break;
|
|
995
993
|
}
|
|
996
|
-
_context19.next =
|
|
994
|
+
_context19.next = 49;
|
|
997
995
|
return this.scheduleFailback429Retry();
|
|
998
|
-
case
|
|
996
|
+
case 49:
|
|
999
997
|
abort = true;
|
|
1000
|
-
return _context19.abrupt("break",
|
|
1001
|
-
case
|
|
998
|
+
return _context19.abrupt("break", 53);
|
|
999
|
+
case 51:
|
|
1002
1000
|
_context19.next = 8;
|
|
1003
1001
|
break;
|
|
1004
|
-
case
|
|
1005
|
-
_context19.next =
|
|
1002
|
+
case 53:
|
|
1003
|
+
_context19.next = 58;
|
|
1006
1004
|
break;
|
|
1007
|
-
case
|
|
1008
|
-
_context19.prev =
|
|
1005
|
+
case 55:
|
|
1006
|
+
_context19.prev = 55;
|
|
1009
1007
|
_context19.t1 = _context19["catch"](6);
|
|
1010
1008
|
_iterator.e(_context19.t1);
|
|
1011
|
-
case
|
|
1012
|
-
_context19.prev =
|
|
1009
|
+
case 58:
|
|
1010
|
+
_context19.prev = 58;
|
|
1013
1011
|
_iterator.f();
|
|
1014
|
-
return _context19.finish(
|
|
1015
|
-
case 60:
|
|
1016
|
-
return _context19.abrupt("return", abort);
|
|
1012
|
+
return _context19.finish(58);
|
|
1017
1013
|
case 61:
|
|
1014
|
+
return _context19.abrupt("return", abort);
|
|
1015
|
+
case 62:
|
|
1018
1016
|
case "end":
|
|
1019
1017
|
return _context19.stop();
|
|
1020
1018
|
}
|
|
1021
|
-
}, _callee19, this, [[6,
|
|
1019
|
+
}, _callee19, this, [[6, 55, 58, 61], [10, 30]]);
|
|
1022
1020
|
}));
|
|
1023
1021
|
function attemptRegistrationWithServers(_x11) {
|
|
1024
1022
|
return _attemptRegistrationWithServers.apply(this, arguments);
|
|
@@ -1028,11 +1026,6 @@ var Registration = /*#__PURE__*/function () {
|
|
|
1028
1026
|
/**
|
|
1029
1027
|
* This method sets up a timer to periodically send keep-alive requests to maintain a connection.
|
|
1030
1028
|
* It handles retries, error handling, and re-registration attempts based on the response, ensuring continuous connectivity with the server.
|
|
1031
|
-
* @param keepAliveRetryCount
|
|
1032
|
-
* @param url
|
|
1033
|
-
* @param logContext
|
|
1034
|
-
* @param interval
|
|
1035
|
-
* @returns
|
|
1036
1029
|
*/
|
|
1037
1030
|
}, {
|
|
1038
1031
|
key: "startKeepaliveTimer",
|
|
@@ -1093,7 +1086,7 @@ var Registration = /*#__PURE__*/function () {
|
|
|
1093
1086
|
_context20.next = 28;
|
|
1094
1087
|
break;
|
|
1095
1088
|
}
|
|
1096
|
-
_this7.setStatus(_types3.
|
|
1089
|
+
_this7.setStatus(_types3.RegistrationStatus.INACTIVE);
|
|
1097
1090
|
_this7.clearKeepaliveTimer();
|
|
1098
1091
|
_this7.clearFailbackTimer();
|
|
1099
1092
|
_this7.lineEmitter(_types4.LINE_EVENTS.UNREGISTERED);
|
|
@@ -1158,7 +1151,7 @@ var Registration = /*#__PURE__*/function () {
|
|
|
1158
1151
|
_Logger.default.warn("Delete failed with Mobius", {});
|
|
1159
1152
|
case 8:
|
|
1160
1153
|
this.clearKeepaliveTimer();
|
|
1161
|
-
this.setStatus(_types3.
|
|
1154
|
+
this.setStatus(_types3.RegistrationStatus.INACTIVE);
|
|
1162
1155
|
case 10:
|
|
1163
1156
|
case "end":
|
|
1164
1157
|
return _context22.stop();
|
|
@@ -1171,7 +1164,6 @@ var Registration = /*#__PURE__*/function () {
|
|
|
1171
1164
|
return deregister;
|
|
1172
1165
|
}()
|
|
1173
1166
|
/**
|
|
1174
|
-
* @returns The value of instance variable registerRetry.
|
|
1175
1167
|
* Indicates whether the calling client is in a mode
|
|
1176
1168
|
* to retry registration.
|
|
1177
1169
|
*/
|
|
@@ -1185,7 +1177,6 @@ var Registration = /*#__PURE__*/function () {
|
|
|
1185
1177
|
* Sets the received value in instance variable
|
|
1186
1178
|
* registerRetry for registration retry cases.
|
|
1187
1179
|
*
|
|
1188
|
-
* @param value - for registerRetry
|
|
1189
1180
|
*/
|
|
1190
1181
|
}, {
|
|
1191
1182
|
key: "setRegRetry",
|
|
@@ -1196,9 +1187,6 @@ var Registration = /*#__PURE__*/function () {
|
|
|
1196
1187
|
/**
|
|
1197
1188
|
* Restores the deviceInfo object in callingClient when receiving a 403 with error code 101.
|
|
1198
1189
|
*
|
|
1199
|
-
* @param callingClient - Instance of CallingClient.
|
|
1200
|
-
* @param restoreData - Data from Mobius with existing device information.
|
|
1201
|
-
* @returns Boolean.
|
|
1202
1190
|
*/
|
|
1203
1191
|
}, {
|
|
1204
1192
|
key: "getExistingDevice",
|
|
@@ -1214,7 +1202,7 @@ var Registration = /*#__PURE__*/function () {
|
|
|
1214
1202
|
var stringToReplace = "".concat(_constants.DEVICES_ENDPOINT_RESOURCE, "/").concat(restoreData.devices[0].deviceId);
|
|
1215
1203
|
var uri = restoreData.devices[0].uri.replace(stringToReplace, '');
|
|
1216
1204
|
this.setActiveMobiusUrl(uri);
|
|
1217
|
-
this.registrationStatus = _types3.
|
|
1205
|
+
this.registrationStatus = _types3.RegistrationStatus.ACTIVE;
|
|
1218
1206
|
return true;
|
|
1219
1207
|
}
|
|
1220
1208
|
return false;
|
|
@@ -1228,7 +1216,6 @@ var Registration = /*#__PURE__*/function () {
|
|
|
1228
1216
|
* invoked again on receiving all calls cleared event from
|
|
1229
1217
|
* callManager.
|
|
1230
1218
|
*
|
|
1231
|
-
* @param caller - Caller of this method.
|
|
1232
1219
|
*/
|
|
1233
1220
|
}, {
|
|
1234
1221
|
key: "reconnectOnFailure",
|
|
@@ -1280,12 +1267,7 @@ var Registration = /*#__PURE__*/function () {
|
|
|
1280
1267
|
}]);
|
|
1281
1268
|
return Registration;
|
|
1282
1269
|
}();
|
|
1283
|
-
|
|
1284
|
-
* @param webex - A webex instance.
|
|
1285
|
-
* @param serviceData - indicates whether the backend service is calling or contactcentre
|
|
1286
|
-
* @param mutex - mutex which is used to run any registration scenario exclusively
|
|
1287
|
-
* @param lineEmitter - Line emitter for registration related events
|
|
1288
|
-
* @param logLevel - log level option for registration module
|
|
1270
|
+
/*
|
|
1289
1271
|
*/
|
|
1290
1272
|
exports.Registration = Registration;
|
|
1291
1273
|
var createRegistration = function createRegistration(webex, serviceData, mutex, lineEmitter, logLevel) {
|