@webex/calling 3.9.0-next.7 → 3.9.0-next.9
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/CallHistory/CallHistory.js +51 -46
- package/dist/CallHistory/CallHistory.js.map +1 -1
- package/dist/CallHistory/CallHistory.test.js +146 -147
- package/dist/CallHistory/CallHistory.test.js.map +1 -1
- package/dist/CallHistory/callHistoryFixtures.js.map +1 -1
- package/dist/CallHistory/constants.js.map +1 -1
- package/dist/CallHistory/types.js.map +1 -1
- package/dist/CallSettings/CallSettings.js +8 -8
- package/dist/CallSettings/CallSettings.js.map +1 -1
- package/dist/CallSettings/CallSettings.test.js +1 -1
- package/dist/CallSettings/CallSettings.test.js.map +1 -1
- package/dist/CallSettings/UcmBackendConnector.js +12 -11
- package/dist/CallSettings/UcmBackendConnector.js.map +1 -1
- package/dist/CallSettings/UcmBackendConnector.test.js +9 -10
- package/dist/CallSettings/UcmBackendConnector.test.js.map +1 -1
- package/dist/CallSettings/WxCallBackendConnector.js +66 -59
- package/dist/CallSettings/WxCallBackendConnector.js.map +1 -1
- package/dist/CallSettings/WxCallBackendConnector.test.js +108 -109
- package/dist/CallSettings/WxCallBackendConnector.test.js.map +1 -1
- package/dist/CallSettings/constants.js.map +1 -1
- package/dist/CallSettings/testFixtures.js.map +1 -1
- package/dist/CallSettings/types.js.map +1 -1
- package/dist/CallingClient/CallingClient.js +142 -85
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +184 -173
- package/dist/CallingClient/CallingClient.test.js.map +1 -1
- package/dist/CallingClient/callRecordFixtures.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/index.js +2 -2
- package/dist/CallingClient/calling/CallerId/index.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/index.test.js +8 -7
- package/dist/CallingClient/calling/CallerId/index.test.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/types.js.map +1 -1
- package/dist/CallingClient/calling/call.js +343 -320
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +405 -406
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/CallingClient/calling/callManager.js +3 -4
- package/dist/CallingClient/calling/callManager.js.map +1 -1
- package/dist/CallingClient/calling/callManager.test.js +67 -68
- package/dist/CallingClient/calling/callManager.test.js.map +1 -1
- package/dist/CallingClient/calling/index.js.map +1 -1
- package/dist/CallingClient/calling/types.js.map +1 -1
- package/dist/CallingClient/callingClientFixtures.js.map +1 -1
- package/dist/CallingClient/constants.js +2 -1
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/CallingClient/line/index.js +7 -7
- package/dist/CallingClient/line/index.js.map +1 -1
- package/dist/CallingClient/line/line.test.js +6 -6
- package/dist/CallingClient/line/line.test.js.map +1 -1
- package/dist/CallingClient/line/types.js.map +1 -1
- package/dist/CallingClient/registration/index.js.map +1 -1
- package/dist/CallingClient/registration/register.js +239 -230
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +172 -173
- package/dist/CallingClient/registration/register.test.js.map +1 -1
- package/dist/CallingClient/registration/registerFixtures.js.map +1 -1
- package/dist/CallingClient/registration/types.js.map +1 -1
- package/dist/CallingClient/registration/webWorker.js +5 -4
- package/dist/CallingClient/registration/webWorker.js.map +1 -1
- package/dist/CallingClient/registration/webWorker.test.js +14 -14
- package/dist/CallingClient/registration/webWorker.test.js.map +1 -1
- package/dist/CallingClient/registration/webWorkerStr.js.map +1 -1
- package/dist/CallingClient/types.js.map +1 -1
- package/dist/CallingClient/windowsChromiumIceWarmupUtils.js +2 -6
- package/dist/CallingClient/windowsChromiumIceWarmupUtils.js.map +1 -1
- package/dist/Contacts/ContactsClient.js +244 -238
- package/dist/Contacts/ContactsClient.js.map +1 -1
- package/dist/Contacts/ContactsClient.test.js +89 -90
- package/dist/Contacts/ContactsClient.test.js.map +1 -1
- package/dist/Contacts/constants.js +2 -2
- package/dist/Contacts/constants.js.map +1 -1
- package/dist/Contacts/contactFixtures.js.map +1 -1
- package/dist/Contacts/types.js.map +1 -1
- package/dist/Errors/catalog/CallError.js +2 -2
- package/dist/Errors/catalog/CallError.js.map +1 -1
- package/dist/Errors/catalog/CallingDeviceError.js +2 -2
- package/dist/Errors/catalog/CallingDeviceError.js.map +1 -1
- package/dist/Errors/catalog/ExtendedError.js +3 -3
- package/dist/Errors/catalog/ExtendedError.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.map +1 -1
- package/dist/Errors/types.js.map +1 -1
- package/dist/Events/impl/index.js +2 -2
- package/dist/Events/impl/index.js.map +1 -1
- package/dist/Events/types.js.map +1 -1
- package/dist/Logger/index.js.map +1 -1
- package/dist/Logger/index.test.js.map +1 -1
- package/dist/Logger/types.js.map +1 -1
- package/dist/Metrics/index.js +109 -46
- package/dist/Metrics/index.js.map +1 -1
- package/dist/Metrics/index.test.js.map +1 -1
- package/dist/Metrics/types.js +8 -1
- package/dist/Metrics/types.js.map +1 -1
- package/dist/SDKConnector/index.js +0 -1
- package/dist/SDKConnector/index.js.map +1 -1
- package/dist/SDKConnector/index.test.js.map +1 -1
- package/dist/SDKConnector/types.js.map +1 -1
- package/dist/SDKConnector/utils.js.map +1 -1
- package/dist/SDKConnector/utils.test.js.map +1 -1
- package/dist/Voicemail/BroadworksBackendConnector.js +42 -39
- package/dist/Voicemail/BroadworksBackendConnector.js.map +1 -1
- package/dist/Voicemail/BroadworksBackendConnector.test.js +119 -120
- package/dist/Voicemail/BroadworksBackendConnector.test.js.map +1 -1
- package/dist/Voicemail/UcmBackendConnector.js +54 -47
- package/dist/Voicemail/UcmBackendConnector.js.map +1 -1
- package/dist/Voicemail/UcmBackendConnector.test.js +73 -74
- package/dist/Voicemail/UcmBackendConnector.test.js.map +1 -1
- package/dist/Voicemail/Voicemail.js +12 -11
- package/dist/Voicemail/Voicemail.js.map +1 -1
- package/dist/Voicemail/Voicemail.test.js +2 -2
- package/dist/Voicemail/Voicemail.test.js.map +1 -1
- package/dist/Voicemail/WxCallBackendConnector.js +78 -70
- package/dist/Voicemail/WxCallBackendConnector.js.map +1 -1
- package/dist/Voicemail/WxCallBackendConnector.test.js +184 -185
- package/dist/Voicemail/WxCallBackendConnector.test.js.map +1 -1
- package/dist/Voicemail/constants.js.map +1 -1
- package/dist/Voicemail/types.js.map +1 -1
- package/dist/Voicemail/voicemailFixture.js.map +1 -1
- package/dist/api.js.map +1 -1
- package/dist/common/Utils.js +80 -63
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +95 -104
- package/dist/common/Utils.test.js.map +1 -1
- package/dist/common/constants.js.map +1 -1
- package/dist/common/index.js.map +1 -1
- package/dist/common/testUtil.js +1 -1
- package/dist/common/testUtil.js.map +1 -1
- package/dist/common/types.js.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/module/CallHistory/CallHistory.js +4 -0
- package/dist/module/CallSettings/UcmBackendConnector.js +1 -0
- package/dist/module/CallSettings/WxCallBackendConnector.js +7 -0
- package/dist/module/CallingClient/CallingClient.js +62 -20
- package/dist/module/CallingClient/calling/call.js +66 -43
- package/dist/module/CallingClient/constants.js +2 -1
- package/dist/module/CallingClient/registration/register.js +6 -3
- package/dist/module/CallingClient/registration/webWorker.js +2 -1
- package/dist/module/CallingClient/windowsChromiumIceWarmupUtils.js +1 -4
- package/dist/module/Contacts/ContactsClient.js +23 -17
- package/dist/module/Contacts/constants.js +1 -1
- package/dist/module/Metrics/index.js +42 -0
- package/dist/module/Metrics/types.js +7 -0
- package/dist/module/Voicemail/BroadworksBackendConnector.js +3 -0
- package/dist/module/Voicemail/UcmBackendConnector.js +6 -0
- package/dist/module/Voicemail/WxCallBackendConnector.js +8 -0
- package/dist/module/common/Utils.js +22 -8
- package/dist/types/CallHistory/CallHistory.d.ts.map +1 -1
- package/dist/types/CallSettings/UcmBackendConnector.d.ts.map +1 -1
- package/dist/types/CallSettings/WxCallBackendConnector.d.ts.map +1 -1
- package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
- package/dist/types/CallingClient/constants.d.ts +2 -1
- package/dist/types/CallingClient/constants.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/webWorker.d.ts +2 -1
- package/dist/types/CallingClient/registration/webWorker.d.ts.map +1 -1
- package/dist/types/CallingClient/windowsChromiumIceWarmupUtils.d.ts +2 -4
- package/dist/types/CallingClient/windowsChromiumIceWarmupUtils.d.ts.map +1 -1
- package/dist/types/Contacts/ContactsClient.d.ts.map +1 -1
- package/dist/types/Contacts/constants.d.ts +1 -1
- package/dist/types/Contacts/constants.d.ts.map +1 -1
- package/dist/types/Metrics/index.d.ts.map +1 -1
- package/dist/types/Metrics/types.d.ts +10 -2
- package/dist/types/Metrics/types.d.ts.map +1 -1
- package/dist/types/Voicemail/BroadworksBackendConnector.d.ts.map +1 -1
- package/dist/types/Voicemail/UcmBackendConnector.d.ts.map +1 -1
- package/dist/types/Voicemail/WxCallBackendConnector.d.ts.map +1 -1
- package/dist/types/common/Utils.d.ts.map +1 -1
- package/package.json +9 -7
|
@@ -11,7 +11,7 @@ import log from '../Logger';
|
|
|
11
11
|
import { getCallManager } from './calling/callManager';
|
|
12
12
|
import { CALLING_CLIENT_FILE, CALLS_CLEARED_HANDLER_UTIL, CALLING_USER_AGENT, CISCO_DEVICE_URL, DISCOVERY_URL, GET_MOBIUS_SERVERS_UTIL, IP_ENDPOINT, SPARK_USER_AGENT, URL_ENDPOINT, NETWORK_FLAP_TIMEOUT, API_V1, MOBIUS_US_PROD, MOBIUS_EU_PROD, MOBIUS_US_INT, MOBIUS_EU_INT, METHODS, } from './constants';
|
|
13
13
|
import Line from './line';
|
|
14
|
-
import { METRIC_EVENT, REG_ACTION, METRIC_TYPE } from '../Metrics/types';
|
|
14
|
+
import { METRIC_EVENT, REG_ACTION, METRIC_TYPE, MOBIUS_SERVER_ACTION, } from '../Metrics/types';
|
|
15
15
|
import { getMetricManager } from '../Metrics';
|
|
16
16
|
import windowsChromiumIceWarmup from './windowsChromiumIceWarmupUtils';
|
|
17
17
|
export class CallingClient extends Eventing {
|
|
@@ -87,18 +87,30 @@ export class CallingClient extends Eventing {
|
|
|
87
87
|
this.registerCallsClearedListener();
|
|
88
88
|
}
|
|
89
89
|
async init() {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
90
|
+
if (typeof window !== 'undefined' && window?.navigator?.userAgent) {
|
|
91
|
+
const ua = window.navigator.userAgent;
|
|
92
|
+
if (ua.toLowerCase().includes('windows')) {
|
|
93
|
+
log.info('Starting ICE warmup for Windows Chromium based browser', {
|
|
94
|
+
file: CALLING_CLIENT_FILE,
|
|
95
|
+
method: 'init',
|
|
96
|
+
});
|
|
97
|
+
try {
|
|
98
|
+
await windowsChromiumIceWarmup({
|
|
99
|
+
iceServers: [],
|
|
100
|
+
timeoutMs: 1000,
|
|
101
|
+
});
|
|
102
|
+
log.info(`ICE warmup completed`, {
|
|
103
|
+
file: CALLING_CLIENT_FILE,
|
|
104
|
+
method: 'init',
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
catch (err) {
|
|
108
|
+
log.warn(`ICE warmup failed: ${err}`, {
|
|
109
|
+
file: CALLING_CLIENT_FILE,
|
|
110
|
+
method: 'init',
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
102
114
|
}
|
|
103
115
|
await this.getMobiusServers();
|
|
104
116
|
await this.createLine();
|
|
@@ -156,6 +168,10 @@ export class CallingClient extends Eventing {
|
|
|
156
168
|
},
|
|
157
169
|
service: ALLOWED_SERVICES.MOBIUS,
|
|
158
170
|
});
|
|
171
|
+
log.log(`Response trackingId: ${temp?.headers?.trackingid}`, {
|
|
172
|
+
file: CALLING_CLIENT_FILE,
|
|
173
|
+
method: METHODS.GET_CLIENT_REGION_INFO,
|
|
174
|
+
});
|
|
159
175
|
const myIP = temp.body.ipv4;
|
|
160
176
|
const response = await this.webex.request({
|
|
161
177
|
uri: `${DISCOVERY_URL}/${myIP}`,
|
|
@@ -165,11 +181,20 @@ export class CallingClient extends Eventing {
|
|
|
165
181
|
[SPARK_USER_AGENT]: null,
|
|
166
182
|
},
|
|
167
183
|
});
|
|
184
|
+
log.log(`Response trackingId: ${response?.headers?.trackingid}`, {
|
|
185
|
+
file: CALLING_CLIENT_FILE,
|
|
186
|
+
method: METHODS.GET_CLIENT_REGION_INFO,
|
|
187
|
+
});
|
|
168
188
|
const clientRegionInfo = response.body;
|
|
169
189
|
regionInfo.clientRegion = clientRegionInfo?.clientRegion
|
|
170
190
|
? clientRegionInfo.clientRegion
|
|
171
191
|
: '';
|
|
172
192
|
regionInfo.countryCode = clientRegionInfo?.countryCode ? clientRegionInfo.countryCode : '';
|
|
193
|
+
log.log(`Successfully fetched Client region info: ${regionInfo.clientRegion}, countryCode: ${regionInfo.countryCode}, and response trackingid: ${response?.headers?.trackingid}`, {
|
|
194
|
+
file: CALLING_CLIENT_FILE,
|
|
195
|
+
method: METHODS.GET_CLIENT_REGION_INFO,
|
|
196
|
+
});
|
|
197
|
+
this.metricManager.submitRegionInfoMetric(METRIC_EVENT.MOBIUS_DISCOVERY, MOBIUS_SERVER_ACTION.REGION_INFO, METRIC_TYPE.BEHAVIORAL, this.mobiusHost, clientRegionInfo.clientRegion, clientRegionInfo.countryCode, response?.headers?.trackingid ?? '');
|
|
173
198
|
break;
|
|
174
199
|
}
|
|
175
200
|
catch (err) {
|
|
@@ -185,6 +210,7 @@ export class CallingClient extends Eventing {
|
|
|
185
210
|
regionInfo.clientRegion = '';
|
|
186
211
|
regionInfo.countryCode = '';
|
|
187
212
|
if (abort) {
|
|
213
|
+
await uploadLogs();
|
|
188
214
|
return regionInfo;
|
|
189
215
|
}
|
|
190
216
|
}
|
|
@@ -218,9 +244,12 @@ export class CallingClient extends Eventing {
|
|
|
218
244
|
countryCode = regionInfo.countryCode;
|
|
219
245
|
}
|
|
220
246
|
if (clientRegion && countryCode) {
|
|
221
|
-
log.log(`Found Region: ${clientRegion} and country: ${countryCode}, going to fetch Mobius server`,
|
|
247
|
+
log.log(`Found Region: ${clientRegion} and country: ${countryCode}, going to fetch Mobius server`, {
|
|
248
|
+
file: CALLING_CLIENT_FILE,
|
|
249
|
+
method: GET_MOBIUS_SERVERS_UTIL,
|
|
250
|
+
});
|
|
222
251
|
try {
|
|
223
|
-
const
|
|
252
|
+
const response = await this.webex.request({
|
|
224
253
|
uri: `${this.mobiusHost}${URL_ENDPOINT}?regionCode=${clientRegion}&countryCode=${countryCode}`,
|
|
225
254
|
method: HTTP_METHODS.GET,
|
|
226
255
|
headers: {
|
|
@@ -229,12 +258,19 @@ export class CallingClient extends Eventing {
|
|
|
229
258
|
},
|
|
230
259
|
service: ALLOWED_SERVICES.MOBIUS,
|
|
231
260
|
});
|
|
232
|
-
log.log(
|
|
233
|
-
|
|
261
|
+
log.log(`Mobius Server found for the region. Response trackingId: ${response?.headers?.trackingid}`, {
|
|
262
|
+
file: CALLING_CLIENT_FILE,
|
|
263
|
+
method: GET_MOBIUS_SERVERS_UTIL,
|
|
264
|
+
});
|
|
265
|
+
const mobiusServers = response.body;
|
|
266
|
+
this.metricManager.submitMobiusServersMetric(METRIC_EVENT.MOBIUS_DISCOVERY, MOBIUS_SERVER_ACTION.MOBIUS_SERVERS, METRIC_TYPE.BEHAVIORAL, mobiusServers, response?.headers?.trackingid ?? '');
|
|
234
267
|
const mobiusUris = filterMobiusUris(mobiusServers, this.mobiusHost);
|
|
235
268
|
this.primaryMobiusUris = mobiusUris.primary;
|
|
236
269
|
this.backupMobiusUris = mobiusUris.backup;
|
|
237
|
-
log.
|
|
270
|
+
log.log(`Final list of Mobius Servers, primary: ${mobiusUris.primary} and backup: ${mobiusUris.backup}`, {
|
|
271
|
+
file: CALLING_CLIENT_FILE,
|
|
272
|
+
method: GET_MOBIUS_SERVERS_UTIL,
|
|
273
|
+
});
|
|
238
274
|
}
|
|
239
275
|
catch (err) {
|
|
240
276
|
const extendedError = new Error(`Failed to get Mobius servers: ${err}`);
|
|
@@ -242,10 +278,13 @@ export class CallingClient extends Eventing {
|
|
|
242
278
|
method: METHODS.GET_MOBIUS_SERVERS,
|
|
243
279
|
file: CALLING_CLIENT_FILE,
|
|
244
280
|
});
|
|
245
|
-
handleCallingClientErrors(err, (clientError) => {
|
|
281
|
+
const abort = await handleCallingClientErrors(err, (clientError) => {
|
|
246
282
|
this.metricManager.submitRegistrationMetric(METRIC_EVENT.REGISTRATION_ERROR, REG_ACTION.REGISTER, METRIC_TYPE.BEHAVIORAL, GET_MOBIUS_SERVERS_UTIL, 'UNKNOWN', err.headers?.trackingId ?? '', undefined, clientError);
|
|
247
283
|
this.emit(CALLING_CLIENT_EVENT_KEYS.ERROR, clientError);
|
|
248
284
|
}, { method: GET_MOBIUS_SERVERS_UTIL, file: CALLING_CLIENT_FILE });
|
|
285
|
+
if (abort) {
|
|
286
|
+
await uploadLogs();
|
|
287
|
+
}
|
|
249
288
|
useDefault = true;
|
|
250
289
|
}
|
|
251
290
|
}
|
|
@@ -253,7 +292,10 @@ export class CallingClient extends Eventing {
|
|
|
253
292
|
useDefault = true;
|
|
254
293
|
}
|
|
255
294
|
if (useDefault) {
|
|
256
|
-
log.warn(`Couldn't resolve the region and country code. Defaulting to the catalog entries to discover mobius servers`,
|
|
295
|
+
log.warn(`Couldn't resolve the region and country code. Defaulting to the catalog entries to discover mobius servers`, {
|
|
296
|
+
file: CALLING_CLIENT_FILE,
|
|
297
|
+
method: GET_MOBIUS_SERVERS_UTIL,
|
|
298
|
+
});
|
|
257
299
|
this.mobiusHost = `https://${this.mobiusClusters[0].host}${API_V1}`;
|
|
258
300
|
this.primaryMobiusUris = [`${this.mobiusHost}${URL_ENDPOINT}`];
|
|
259
301
|
}
|
|
@@ -709,14 +709,14 @@ export class Call extends Eventing {
|
|
|
709
709
|
const response = await this.postSSRequest(undefined, SUPPLEMENTARY_SERVICES.RESUME);
|
|
710
710
|
log.log(`Response code: ${response.statusCode}`, {
|
|
711
711
|
file: CALL_FILE,
|
|
712
|
-
method:
|
|
712
|
+
method: METHODS.HANDLE_CALL_RESUME,
|
|
713
713
|
});
|
|
714
714
|
if (this.isHeld() === true) {
|
|
715
715
|
this.supplementaryServicesTimer = setTimeout(async () => {
|
|
716
|
-
const errorContext = { file: CALL_FILE, method:
|
|
716
|
+
const errorContext = { file: CALL_FILE, method: METHODS.HANDLE_CALL_RESUME };
|
|
717
717
|
log.warn('Resume response timed out', {
|
|
718
718
|
file: CALL_FILE,
|
|
719
|
-
method:
|
|
719
|
+
method: METHODS.HANDLE_CALL_RESUME,
|
|
720
720
|
});
|
|
721
721
|
const callError = createCallError('An error occurred while resuming the call. Wait a moment and try again.', errorContext, ERROR_TYPE.TIMEOUT, this.getCorrelationId(), ERROR_LAYER.CALL_CONTROL);
|
|
722
722
|
this.emit(CALL_EVENT_KEYS.RESUME_ERROR, callError);
|
|
@@ -728,14 +728,14 @@ export class Call extends Eventing {
|
|
|
728
728
|
const extendedError = new Error(`Failed to resume the call: ${e}`);
|
|
729
729
|
log.error(extendedError, {
|
|
730
730
|
file: CALL_FILE,
|
|
731
|
-
method:
|
|
731
|
+
method: METHODS.HANDLE_CALL_RESUME,
|
|
732
732
|
});
|
|
733
733
|
const errData = e;
|
|
734
734
|
handleCallErrors((error) => {
|
|
735
735
|
this.emit(CALL_EVENT_KEYS.RESUME_ERROR, error);
|
|
736
736
|
this.submitCallErrorMetric(error);
|
|
737
737
|
this.sendCallStateMachineEvt({ type: 'E_CALL_ESTABLISHED', data: errData });
|
|
738
|
-
}, ERROR_LAYER.CALL_CONTROL, (interval) => undefined, this.getCorrelationId(), errData,
|
|
738
|
+
}, ERROR_LAYER.CALL_CONTROL, (interval) => undefined, this.getCorrelationId(), errData, METHODS.HANDLE_CALL_RESUME, CALL_FILE);
|
|
739
739
|
await uploadLogs({
|
|
740
740
|
correlationId: this.correlationId,
|
|
741
741
|
callId: this.callId,
|
|
@@ -752,20 +752,20 @@ export class Call extends Eventing {
|
|
|
752
752
|
if (data?.callProgressData?.inbandMedia) {
|
|
753
753
|
log.log('Inband media present. Setting Early Media flag', {
|
|
754
754
|
file: CALL_FILE,
|
|
755
|
-
method:
|
|
755
|
+
method: METHODS.HANDLE_INCOMING_CALL_PROGRESS,
|
|
756
756
|
});
|
|
757
757
|
this.earlyMedia = true;
|
|
758
758
|
}
|
|
759
759
|
else {
|
|
760
760
|
log.log('Inband media not present.', {
|
|
761
761
|
file: CALL_FILE,
|
|
762
|
-
method:
|
|
762
|
+
method: METHODS.HANDLE_INCOMING_CALL_PROGRESS,
|
|
763
763
|
});
|
|
764
764
|
}
|
|
765
765
|
if (data?.callerId) {
|
|
766
766
|
log.info('Processing Caller-Id data', {
|
|
767
767
|
file: CALL_FILE,
|
|
768
|
-
method:
|
|
768
|
+
method: METHODS.HANDLE_INCOMING_CALL_PROGRESS,
|
|
769
769
|
});
|
|
770
770
|
this.startCallerIdResolution(data.callerId);
|
|
771
771
|
}
|
|
@@ -780,19 +780,19 @@ export class Call extends Eventing {
|
|
|
780
780
|
if (!this.mediaConnection) {
|
|
781
781
|
log.info('Media connection is not up, buffer the remote Offer Request for later handling', {
|
|
782
782
|
file: CALL_FILE,
|
|
783
|
-
method:
|
|
783
|
+
method: METHODS.HANDLE_INCOMING_ROAP_OFFER_REQUEST,
|
|
784
784
|
});
|
|
785
785
|
this.seq = message.seq;
|
|
786
786
|
log.info(`Setting Sequence No: ${this.seq}`, {
|
|
787
787
|
file: CALL_FILE,
|
|
788
|
-
method:
|
|
788
|
+
method: METHODS.HANDLE_INCOMING_ROAP_OFFER_REQUEST,
|
|
789
789
|
});
|
|
790
790
|
this.remoteRoapMessage = message;
|
|
791
791
|
}
|
|
792
792
|
else if (this.receivedRoapOKSeq === message.seq - 2) {
|
|
793
793
|
log.info('Waiting for Roap OK, buffer the remote Offer Request for later handling', {
|
|
794
794
|
file: CALL_FILE,
|
|
795
|
-
method:
|
|
795
|
+
method: METHODS.HANDLE_INCOMING_ROAP_OFFER_REQUEST,
|
|
796
796
|
});
|
|
797
797
|
this.remoteRoapMessage = message;
|
|
798
798
|
}
|
|
@@ -811,21 +811,21 @@ export class Call extends Eventing {
|
|
|
811
811
|
const res = await this.patch(MobiusCallState.ALERTING);
|
|
812
812
|
log.log(`PATCH response: ${res.statusCode}`, {
|
|
813
813
|
file: CALL_FILE,
|
|
814
|
-
method:
|
|
814
|
+
method: METHODS.HANDLE_OUTGOING_CALL_ALERTING,
|
|
815
815
|
});
|
|
816
816
|
}
|
|
817
817
|
catch (err) {
|
|
818
818
|
const extendedError = new Error(`Failed to signal call progression: ${err}`);
|
|
819
819
|
log.error(extendedError, {
|
|
820
820
|
file: CALL_FILE,
|
|
821
|
-
method:
|
|
821
|
+
method: METHODS.HANDLE_OUTGOING_CALL_ALERTING,
|
|
822
822
|
});
|
|
823
823
|
const errData = err;
|
|
824
824
|
handleCallErrors((error) => {
|
|
825
825
|
this.emit(CALL_EVENT_KEYS.CALL_ERROR, error);
|
|
826
826
|
this.submitCallErrorMetric(error);
|
|
827
827
|
this.sendCallStateMachineEvt({ type: 'E_UNKNOWN', data: errData });
|
|
828
|
-
}, ERROR_LAYER.CALL_CONTROL, (interval) => undefined, this.getCorrelationId(), errData,
|
|
828
|
+
}, ERROR_LAYER.CALL_CONTROL, (interval) => undefined, this.getCorrelationId(), errData, METHODS.HANDLE_OUTGOING_CALL_ALERTING, CALL_FILE);
|
|
829
829
|
await uploadLogs({
|
|
830
830
|
correlationId: this.correlationId,
|
|
831
831
|
callId: this.callId,
|
|
@@ -852,7 +852,7 @@ export class Call extends Eventing {
|
|
|
852
852
|
if (!this.remoteRoapMessage) {
|
|
853
853
|
log.warn('Offer not yet received from remote end... Exiting', {
|
|
854
854
|
file: CALL_FILE,
|
|
855
|
-
method:
|
|
855
|
+
method: METHODS.HANDLE_OUTGOING_CALL_CONNECT,
|
|
856
856
|
});
|
|
857
857
|
return;
|
|
858
858
|
}
|
|
@@ -861,21 +861,21 @@ export class Call extends Eventing {
|
|
|
861
861
|
const res = await this.patch(MobiusCallState.CONNECTED);
|
|
862
862
|
log.log(`PATCH response: ${res.statusCode}`, {
|
|
863
863
|
file: CALL_FILE,
|
|
864
|
-
method:
|
|
864
|
+
method: METHODS.HANDLE_OUTGOING_CALL_CONNECT,
|
|
865
865
|
});
|
|
866
866
|
}
|
|
867
867
|
catch (err) {
|
|
868
868
|
const extendedError = new Error(`Failed to connect the call: ${err}`);
|
|
869
869
|
log.error(extendedError, {
|
|
870
870
|
file: CALL_FILE,
|
|
871
|
-
method:
|
|
871
|
+
method: METHODS.HANDLE_OUTGOING_CALL_CONNECT,
|
|
872
872
|
});
|
|
873
873
|
const errData = err;
|
|
874
874
|
handleCallErrors((error) => {
|
|
875
875
|
this.emit(CALL_EVENT_KEYS.CALL_ERROR, error);
|
|
876
876
|
this.submitCallErrorMetric(error);
|
|
877
877
|
this.sendCallStateMachineEvt({ type: 'E_UNKNOWN', data: errData });
|
|
878
|
-
}, ERROR_LAYER.CALL_CONTROL, (interval) => undefined, this.getCorrelationId(), errData,
|
|
878
|
+
}, ERROR_LAYER.CALL_CONTROL, (interval) => undefined, this.getCorrelationId(), errData, METHODS.HANDLE_OUTGOING_CALL_CONNECT, CALL_FILE);
|
|
879
879
|
await uploadLogs({
|
|
880
880
|
correlationId: this.correlationId,
|
|
881
881
|
callId: this.callId,
|
|
@@ -901,6 +901,11 @@ export class Call extends Eventing {
|
|
|
901
901
|
file: CALL_FILE,
|
|
902
902
|
method: METHODS.HANDLE_OUTGOING_CALL_DISCONNECT,
|
|
903
903
|
});
|
|
904
|
+
uploadLogs({
|
|
905
|
+
correlationId: this.correlationId,
|
|
906
|
+
callId: this.callId,
|
|
907
|
+
broadworksCorrelationInfo: this.broadworksCorrelationInfo,
|
|
908
|
+
});
|
|
904
909
|
}
|
|
905
910
|
this.deleteCb(this.correlationId);
|
|
906
911
|
this.unregisterListeners();
|
|
@@ -940,6 +945,11 @@ export class Call extends Eventing {
|
|
|
940
945
|
file: CALL_FILE,
|
|
941
946
|
method: METHODS.HANDLE_OUTGOING_CALL_DISCONNECT,
|
|
942
947
|
});
|
|
948
|
+
uploadLogs({
|
|
949
|
+
correlationId: this.correlationId,
|
|
950
|
+
callId: this.callId,
|
|
951
|
+
broadworksCorrelationInfo: this.broadworksCorrelationInfo,
|
|
952
|
+
});
|
|
943
953
|
}
|
|
944
954
|
this.deleteCb(this.correlationId);
|
|
945
955
|
this.unregisterListeners();
|
|
@@ -1016,7 +1026,7 @@ export class Call extends Eventing {
|
|
|
1016
1026
|
try {
|
|
1017
1027
|
this.setDisconnectReason();
|
|
1018
1028
|
const response = await this.delete();
|
|
1019
|
-
log.log(`
|
|
1029
|
+
log.log(`Response code: ${response.statusCode}`, {
|
|
1020
1030
|
file: CALL_FILE,
|
|
1021
1031
|
method: METHODS.HANDLE_UNKNOWN_STATE,
|
|
1022
1032
|
});
|
|
@@ -1026,6 +1036,11 @@ export class Call extends Eventing {
|
|
|
1026
1036
|
file: CALL_FILE,
|
|
1027
1037
|
method: METHODS.HANDLE_UNKNOWN_STATE,
|
|
1028
1038
|
});
|
|
1039
|
+
uploadLogs({
|
|
1040
|
+
correlationId: this.correlationId,
|
|
1041
|
+
callId: this.callId,
|
|
1042
|
+
broadworksCorrelationInfo: this.broadworksCorrelationInfo,
|
|
1043
|
+
});
|
|
1029
1044
|
}
|
|
1030
1045
|
this.deleteCb(this.correlationId);
|
|
1031
1046
|
if (this.sessionTimer) {
|
|
@@ -1191,22 +1206,22 @@ export class Call extends Eventing {
|
|
|
1191
1206
|
if (!message?.sdp) {
|
|
1192
1207
|
log.info('Initializing Offer...', {
|
|
1193
1208
|
file: CALL_FILE,
|
|
1194
|
-
method:
|
|
1209
|
+
method: METHODS.HANDLE_OUTGOING_ROAP_OFFER,
|
|
1195
1210
|
});
|
|
1196
1211
|
this.mediaConnection.initiateOffer();
|
|
1197
1212
|
return;
|
|
1198
1213
|
}
|
|
1199
1214
|
try {
|
|
1200
1215
|
const res = await this.postMedia(message);
|
|
1201
|
-
log.log(`
|
|
1216
|
+
log.log(`Response code: ${res.statusCode}`, {
|
|
1202
1217
|
file: CALL_FILE,
|
|
1203
|
-
method:
|
|
1218
|
+
method: METHODS.HANDLE_OUTGOING_ROAP_OFFER,
|
|
1204
1219
|
});
|
|
1205
1220
|
}
|
|
1206
1221
|
catch (err) {
|
|
1207
1222
|
log.warn('Failed to process MediaOk request', {
|
|
1208
1223
|
file: CALL_FILE,
|
|
1209
|
-
method:
|
|
1224
|
+
method: METHODS.HANDLE_OUTGOING_ROAP_OFFER,
|
|
1210
1225
|
});
|
|
1211
1226
|
const errData = err;
|
|
1212
1227
|
handleCallErrors(this.getEmitterCallback(errData), ERROR_LAYER.MEDIA, (interval) => {
|
|
@@ -1215,7 +1230,7 @@ export class Call extends Eventing {
|
|
|
1215
1230
|
this.sendMediaStateMachineEvt({ type: 'E_SEND_ROAP_OFFER', data: event.data });
|
|
1216
1231
|
}, interval * 1000);
|
|
1217
1232
|
}
|
|
1218
|
-
}, this.getCorrelationId(), errData,
|
|
1233
|
+
}, this.getCorrelationId(), errData, METHODS.HANDLE_OUTGOING_ROAP_OFFER, CALL_FILE);
|
|
1219
1234
|
await uploadLogs({
|
|
1220
1235
|
correlationId: this.correlationId,
|
|
1221
1236
|
callId: this.callId,
|
|
@@ -1232,15 +1247,15 @@ export class Call extends Eventing {
|
|
|
1232
1247
|
try {
|
|
1233
1248
|
message.seq = this.seq;
|
|
1234
1249
|
const res = await this.postMedia(message);
|
|
1235
|
-
log.log(`
|
|
1250
|
+
log.log(`Response code: ${res.statusCode}`, {
|
|
1236
1251
|
file: CALL_FILE,
|
|
1237
|
-
method:
|
|
1252
|
+
method: METHODS.HANDLE_OUTGOING_ROAP_ANSWER,
|
|
1238
1253
|
});
|
|
1239
1254
|
}
|
|
1240
1255
|
catch (err) {
|
|
1241
1256
|
log.warn('Failed to send MediaAnswer request', {
|
|
1242
1257
|
file: CALL_FILE,
|
|
1243
|
-
method:
|
|
1258
|
+
method: METHODS.HANDLE_OUTGOING_ROAP_ANSWER,
|
|
1244
1259
|
});
|
|
1245
1260
|
const errData = err;
|
|
1246
1261
|
handleCallErrors(this.getEmitterCallback(errData), ERROR_LAYER.MEDIA, (interval) => {
|
|
@@ -1249,7 +1264,7 @@ export class Call extends Eventing {
|
|
|
1249
1264
|
this.sendMediaStateMachineEvt({ type: 'E_SEND_ROAP_ANSWER', data: event.data });
|
|
1250
1265
|
}, interval * 1000);
|
|
1251
1266
|
}
|
|
1252
|
-
}, this.getCorrelationId(), errData,
|
|
1267
|
+
}, this.getCorrelationId(), errData, METHODS.HANDLE_OUTGOING_ROAP_ANSWER, CALL_FILE);
|
|
1253
1268
|
await uploadLogs({
|
|
1254
1269
|
correlationId: this.correlationId,
|
|
1255
1270
|
callId: this.callId,
|
|
@@ -1267,25 +1282,25 @@ export class Call extends Eventing {
|
|
|
1267
1282
|
if (!this.mediaConnection) {
|
|
1268
1283
|
log.info('Media connection is not up, buffer the remote offer for later handling', {
|
|
1269
1284
|
file: CALL_FILE,
|
|
1270
|
-
method:
|
|
1285
|
+
method: METHODS.HANDLE_INCOMING_ROAP_OFFER,
|
|
1271
1286
|
});
|
|
1272
1287
|
this.seq = message.seq;
|
|
1273
1288
|
log.info(`Setting Sequence No: ${this.seq}`, {
|
|
1274
1289
|
file: CALL_FILE,
|
|
1275
|
-
method:
|
|
1290
|
+
method: METHODS.HANDLE_INCOMING_ROAP_OFFER,
|
|
1276
1291
|
});
|
|
1277
1292
|
}
|
|
1278
1293
|
else if (this.receivedRoapOKSeq === message.seq - 2) {
|
|
1279
1294
|
log.info('Waiting for Roap OK, buffer the remote offer for later handling', {
|
|
1280
1295
|
file: CALL_FILE,
|
|
1281
|
-
method:
|
|
1296
|
+
method: METHODS.HANDLE_INCOMING_ROAP_OFFER,
|
|
1282
1297
|
});
|
|
1283
1298
|
this.remoteRoapMessage = message;
|
|
1284
1299
|
}
|
|
1285
1300
|
else {
|
|
1286
1301
|
log.info('Handling new offer...', {
|
|
1287
1302
|
file: CALL_FILE,
|
|
1288
|
-
method:
|
|
1303
|
+
method: METHODS.HANDLE_INCOMING_ROAP_OFFER,
|
|
1289
1304
|
});
|
|
1290
1305
|
this.seq = message.seq;
|
|
1291
1306
|
if (this.mediaConnection) {
|
|
@@ -1476,7 +1491,7 @@ export class Call extends Eventing {
|
|
|
1476
1491
|
async patch(state) {
|
|
1477
1492
|
log.info(`Send a PATCH for ${state} to Webex Calling`, {
|
|
1478
1493
|
file: CALL_FILE,
|
|
1479
|
-
method:
|
|
1494
|
+
method: 'patch',
|
|
1480
1495
|
});
|
|
1481
1496
|
return this.webex.request({
|
|
1482
1497
|
uri: `${this.mobiusUrl}${DEVICES_ENDPOINT_RESOURCE}/${this.deviceId}/${CALLS_ENDPOINT_RESOURCE}/${this.callId}`,
|
|
@@ -1539,7 +1554,7 @@ export class Call extends Eventing {
|
|
|
1539
1554
|
default: {
|
|
1540
1555
|
log.warn(`Unknown type for PUT request: ${type}`, {
|
|
1541
1556
|
file: CALL_FILE,
|
|
1542
|
-
method:
|
|
1557
|
+
method: METHODS.POST_SS_REQUEST,
|
|
1543
1558
|
});
|
|
1544
1559
|
}
|
|
1545
1560
|
}
|
|
@@ -1567,7 +1582,7 @@ export class Call extends Eventing {
|
|
|
1567
1582
|
if (transferType === TransferType.BLIND && transferTarget) {
|
|
1568
1583
|
log.info(`Initiating Blind transfer with : ${transferTarget}`, {
|
|
1569
1584
|
file: CALL_FILE,
|
|
1570
|
-
method:
|
|
1585
|
+
method: METHODS.COMPLETE_TRANSFER,
|
|
1571
1586
|
});
|
|
1572
1587
|
const context = {
|
|
1573
1588
|
transferorCallId: this.getCallId(),
|
|
@@ -1575,18 +1590,22 @@ export class Call extends Eventing {
|
|
|
1575
1590
|
};
|
|
1576
1591
|
try {
|
|
1577
1592
|
await this.postSSRequest(context, SUPPLEMENTARY_SERVICES.TRANSFER);
|
|
1593
|
+
log.info(`Blind Transfer completed for correlationId ${this.getCorrelationId()}`, {
|
|
1594
|
+
file: CALL_FILE,
|
|
1595
|
+
method: METHODS.COMPLETE_TRANSFER,
|
|
1596
|
+
});
|
|
1578
1597
|
this.metricManager.submitCallMetric(METRIC_EVENT.CALL, TRANSFER_ACTION.BLIND, METRIC_TYPE.BEHAVIORAL, this.getCallId(), this.getCorrelationId(), undefined);
|
|
1579
1598
|
}
|
|
1580
1599
|
catch (e) {
|
|
1581
1600
|
log.warn(`Blind Transfer failed for correlationId ${this.getCorrelationId()}`, {
|
|
1582
1601
|
file: CALL_FILE,
|
|
1583
|
-
method:
|
|
1602
|
+
method: METHODS.COMPLETE_TRANSFER,
|
|
1584
1603
|
});
|
|
1585
1604
|
const errData = e;
|
|
1586
1605
|
handleCallErrors((error) => {
|
|
1587
1606
|
this.emit(CALL_EVENT_KEYS.TRANSFER_ERROR, error);
|
|
1588
1607
|
this.submitCallErrorMetric(error, TRANSFER_ACTION.BLIND);
|
|
1589
|
-
}, ERROR_LAYER.CALL_CONTROL, (interval) => undefined, this.getCorrelationId(), errData,
|
|
1608
|
+
}, ERROR_LAYER.CALL_CONTROL, (interval) => undefined, this.getCorrelationId(), errData, METHODS.COMPLETE_TRANSFER, CALL_FILE);
|
|
1590
1609
|
await uploadLogs({
|
|
1591
1610
|
correlationId: this.correlationId,
|
|
1592
1611
|
callId: this.callId,
|
|
@@ -1597,7 +1616,7 @@ export class Call extends Eventing {
|
|
|
1597
1616
|
else if (transferType === TransferType.CONSULT && transferCallId) {
|
|
1598
1617
|
log.info(`Initiating Consult transfer between : ${this.callId} and ${transferCallId}`, {
|
|
1599
1618
|
file: CALL_FILE,
|
|
1600
|
-
method:
|
|
1619
|
+
method: METHODS.COMPLETE_TRANSFER,
|
|
1601
1620
|
});
|
|
1602
1621
|
const context = {
|
|
1603
1622
|
transferorCallId: this.getCallId(),
|
|
@@ -1605,18 +1624,22 @@ export class Call extends Eventing {
|
|
|
1605
1624
|
};
|
|
1606
1625
|
try {
|
|
1607
1626
|
await this.postSSRequest(context, SUPPLEMENTARY_SERVICES.TRANSFER);
|
|
1627
|
+
log.info(`Consult Transfer completed for correlationId ${this.getCorrelationId()}`, {
|
|
1628
|
+
file: CALL_FILE,
|
|
1629
|
+
method: METHODS.COMPLETE_TRANSFER,
|
|
1630
|
+
});
|
|
1608
1631
|
this.metricManager.submitCallMetric(METRIC_EVENT.CALL, TRANSFER_ACTION.CONSULT, METRIC_TYPE.BEHAVIORAL, this.getCallId(), this.getCorrelationId(), undefined);
|
|
1609
1632
|
}
|
|
1610
1633
|
catch (e) {
|
|
1611
1634
|
log.warn(`Consult Transfer failed for correlationId ${this.getCorrelationId()}`, {
|
|
1612
1635
|
file: CALL_FILE,
|
|
1613
|
-
method:
|
|
1636
|
+
method: METHODS.COMPLETE_TRANSFER,
|
|
1614
1637
|
});
|
|
1615
1638
|
const errData = e;
|
|
1616
1639
|
handleCallErrors((error) => {
|
|
1617
1640
|
this.emit(CALL_EVENT_KEYS.TRANSFER_ERROR, error);
|
|
1618
1641
|
this.submitCallErrorMetric(error, TRANSFER_ACTION.CONSULT);
|
|
1619
|
-
}, ERROR_LAYER.CALL_CONTROL, (interval) => undefined, this.getCorrelationId(), errData,
|
|
1642
|
+
}, ERROR_LAYER.CALL_CONTROL, (interval) => undefined, this.getCorrelationId(), errData, METHODS.COMPLETE_TRANSFER, CALL_FILE);
|
|
1620
1643
|
await uploadLogs({
|
|
1621
1644
|
correlationId: this.correlationId,
|
|
1622
1645
|
callId: this.callId,
|
|
@@ -1627,7 +1650,7 @@ export class Call extends Eventing {
|
|
|
1627
1650
|
else {
|
|
1628
1651
|
log.warn(`Invalid information received, transfer failed for correlationId: ${this.getCorrelationId()}`, {
|
|
1629
1652
|
file: CALL_FILE,
|
|
1630
|
-
method:
|
|
1653
|
+
method: METHODS.COMPLETE_TRANSFER,
|
|
1631
1654
|
});
|
|
1632
1655
|
}
|
|
1633
1656
|
}
|
|
@@ -1690,13 +1713,13 @@ export class Call extends Eventing {
|
|
|
1690
1713
|
case RoapScenario.OFFER: {
|
|
1691
1714
|
log.info(`before modifying sdp: ${event.roapMessage.sdp}`, {
|
|
1692
1715
|
file: CALL_FILE,
|
|
1693
|
-
method:
|
|
1716
|
+
method: METHODS.MEDIA_ROAP_EVENTS_LISTENER,
|
|
1694
1717
|
});
|
|
1695
1718
|
event.roapMessage.sdp = modifySdpForIPv4(event.roapMessage.sdp);
|
|
1696
1719
|
const sdpVideoPortZero = event.roapMessage.sdp.replace(/^m=(video) (?:\d+) /gim, 'm=$1 0 ');
|
|
1697
1720
|
log.info(`after modification sdp: ${sdpVideoPortZero}`, {
|
|
1698
1721
|
file: CALL_FILE,
|
|
1699
|
-
method:
|
|
1722
|
+
method: METHODS.MEDIA_ROAP_EVENTS_LISTENER,
|
|
1700
1723
|
});
|
|
1701
1724
|
event.roapMessage.sdp = sdpVideoPortZero;
|
|
1702
1725
|
this.localRoapMessage = event.roapMessage;
|
|
@@ -61,7 +61,7 @@ export const WEB_AGENT = '(web)';
|
|
|
61
61
|
export const WEBEX = 'webex';
|
|
62
62
|
export const WEBEX_WEB_CLIENT = 'webex-web-client';
|
|
63
63
|
export const CALLER_ID_FILE = 'CallerId';
|
|
64
|
-
export const UTILS_FILE = '
|
|
64
|
+
export const UTILS_FILE = 'src/common/Utils.ts';
|
|
65
65
|
export const CALLING_CLIENT_FILE = 'CallingClient';
|
|
66
66
|
export const LINE_FILE = 'line';
|
|
67
67
|
export const CALL_FILE = 'call';
|
|
@@ -200,6 +200,7 @@ export const METHODS = {
|
|
|
200
200
|
GET_CALL_RTP_STATS: 'getCallRtpStats',
|
|
201
201
|
REGISTER: 'register',
|
|
202
202
|
DEREGISTER: 'deregister',
|
|
203
|
+
DELETE_REGISTRATION: 'deleteRegistration',
|
|
203
204
|
NORMALIZE_LINE: 'normalizeLine',
|
|
204
205
|
LINE_EMITTER: 'lineEmitter',
|
|
205
206
|
GET_LOGGING_LEVEL: 'getLoggingLevel',
|
|
@@ -90,8 +90,9 @@ export class Registration {
|
|
|
90
90
|
catch (error) {
|
|
91
91
|
log.warn(`Delete failed with Mobius ${error}`, {
|
|
92
92
|
file: REGISTRATION_FILE,
|
|
93
|
-
method: METHODS.
|
|
93
|
+
method: METHODS.DELETE_REGISTRATION,
|
|
94
94
|
});
|
|
95
|
+
await uploadLogs();
|
|
95
96
|
}
|
|
96
97
|
this.setStatus(RegistrationStatus.INACTIVE);
|
|
97
98
|
this.lineEmitter(LINE_EVENTS.UNREGISTERED);
|
|
@@ -435,7 +436,7 @@ export class Registration {
|
|
|
435
436
|
this.registrationStatus = RegistrationStatus.ACTIVE;
|
|
436
437
|
this.setActiveMobiusUrl(url);
|
|
437
438
|
this.lineEmitter(LINE_EVENTS.REGISTERED, resp.body);
|
|
438
|
-
log.log(`Registration successful for deviceId: ${this.deviceInfo.device?.deviceId} userId: ${this.userId}`, {
|
|
439
|
+
log.log(`Registration successful for deviceId: ${this.deviceInfo.device?.deviceId} userId: ${this.userId} responseTrackingId: ${resp.headers?.trackingid}`, {
|
|
439
440
|
file: REGISTRATION_FILE,
|
|
440
441
|
method: METHODS.REGISTER,
|
|
441
442
|
});
|
|
@@ -466,6 +467,7 @@ export class Registration {
|
|
|
466
467
|
}
|
|
467
468
|
if (abort) {
|
|
468
469
|
this.setStatus(RegistrationStatus.INACTIVE);
|
|
470
|
+
await uploadLogs();
|
|
469
471
|
break;
|
|
470
472
|
}
|
|
471
473
|
}
|
|
@@ -507,7 +509,7 @@ export class Registration {
|
|
|
507
509
|
if (finalError) {
|
|
508
510
|
this.lineEmitter(LINE_EVENTS.ERROR, undefined, clientError);
|
|
509
511
|
}
|
|
510
|
-
this.metricManager.submitRegistrationMetric(METRIC_EVENT.
|
|
512
|
+
this.metricManager.submitRegistrationMetric(METRIC_EVENT.KEEPALIVE_ERROR, REG_ACTION.KEEPALIVE_FAILURE, METRIC_TYPE.BEHAVIORAL, KEEPALIVE_UTIL, serverType, error.headers?.trackingid ?? '', event.data.keepAliveRetryCount, clientError);
|
|
511
513
|
}, { method: KEEPALIVE_UTIL, file: REGISTRATION_FILE });
|
|
512
514
|
if (abort || event.data.keepAliveRetryCount >= RETRY_COUNT_THRESHOLD) {
|
|
513
515
|
this.failoverImmediately = this.isCCFlow;
|
|
@@ -515,6 +517,7 @@ export class Registration {
|
|
|
515
517
|
this.clearKeepaliveTimer();
|
|
516
518
|
this.clearFailbackTimer();
|
|
517
519
|
this.lineEmitter(LINE_EVENTS.UNREGISTERED);
|
|
520
|
+
await uploadLogs();
|
|
518
521
|
if (!abort) {
|
|
519
522
|
await this.reconnectOnFailure(KEEPALIVE_UTIL);
|
|
520
523
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { v4 as uuid } from 'uuid';
|
|
2
2
|
import { HTTP_METHODS, WorkerMessageType } from '../../common/types';
|
|
3
3
|
let keepaliveTimer;
|
|
4
|
-
|
|
4
|
+
const messageHandler = (event) => {
|
|
5
5
|
const { type } = event.data;
|
|
6
6
|
const postKeepAlive = async (accessToken, deviceUrl, url) => {
|
|
7
7
|
const response = await fetch(`${url}/status`, {
|
|
@@ -57,3 +57,4 @@ export const messageHandler = (event) => {
|
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
59
|
self.addEventListener('message', messageHandler);
|
|
60
|
+
export default messageHandler;
|
|
@@ -26,10 +26,7 @@ function waitForIceComplete(pc, timeoutMs) {
|
|
|
26
26
|
}, timeoutMs);
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
export default async function windowsChromiumIceWarmup({ iceServers = [
|
|
30
|
-
{ urls: 'stun:stun01a-us.bcld.webex.com:5004' },
|
|
31
|
-
{ urls: 'stun:stun02a-us.bcld.webex.com:5004' },
|
|
32
|
-
], timeoutMs = 1000, }) {
|
|
29
|
+
export default async function windowsChromiumIceWarmup({ iceServers = [], timeoutMs = 1000 }) {
|
|
33
30
|
const pc1 = new RTCPeerConnection({ iceServers, iceCandidatePoolSize: 1 });
|
|
34
31
|
const pc2 = new RTCPeerConnection({ iceServers, iceCandidatePoolSize: 1 });
|
|
35
32
|
const candidates = { pc1: [], pc2: [] };
|