@webex/calling 3.8.1-web-workers-keepalive.2 → 3.9.0-multi-llms.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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 +68 -61
- package/dist/CallSettings/WxCallBackendConnector.js.map +1 -1
- package/dist/CallSettings/WxCallBackendConnector.test.js +168 -102
- 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 +491 -200
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +501 -294
- 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 +369 -333
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +411 -410
- 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 +10 -8
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/CallingClient/line/index.js +10 -11
- package/dist/CallingClient/line/index.js.map +1 -1
- package/dist/CallingClient/line/line.test.js +10 -9
- 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 +321 -232
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +242 -160
- 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 +142 -0
- package/dist/CallingClient/windowsChromiumIceWarmupUtils.js.map +1 -0
- 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 +166 -84
- package/dist/Metrics/index.js.map +1 -1
- package/dist/Metrics/index.test.js +60 -0
- package/dist/Metrics/index.test.js.map +1 -1
- package/dist/Metrics/types.js +15 -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 +97 -72
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +283 -143
- 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 +8 -1
- package/dist/module/CallingClient/CallingClient.js +197 -40
- package/dist/module/CallingClient/calling/call.js +79 -43
- package/dist/module/CallingClient/constants.js +9 -6
- package/dist/module/CallingClient/line/index.js +3 -3
- package/dist/module/CallingClient/registration/register.js +50 -14
- package/dist/module/CallingClient/registration/webWorker.js +2 -1
- package/dist/module/CallingClient/windowsChromiumIceWarmupUtils.js +59 -0
- package/dist/module/Contacts/ContactsClient.js +23 -17
- package/dist/module/Contacts/constants.js +1 -1
- package/dist/module/Metrics/index.js +86 -32
- package/dist/module/Metrics/types.js +14 -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 +35 -11
- 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/CallSettings/types.d.ts +1 -1
- package/dist/types/CallSettings/types.d.ts.map +1 -1
- package/dist/types/CallingClient/CallingClient.d.ts +12 -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/calling/types.d.ts +2 -1
- package/dist/types/CallingClient/calling/types.d.ts.map +1 -1
- package/dist/types/CallingClient/constants.d.ts +9 -6
- package/dist/types/CallingClient/constants.d.ts.map +1 -1
- package/dist/types/CallingClient/line/index.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/register.d.ts +1 -0
- package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/types.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 +5 -0
- package/dist/types/CallingClient/windowsChromiumIceWarmupUtils.d.ts.map +1 -0
- 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 +18 -3
- 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/dist/types/common/types.d.ts +1 -0
- package/dist/types/common/types.d.ts.map +1 -1
- package/package.json +10 -9
|
@@ -8,7 +8,7 @@ import { getCallManager } from '../calling';
|
|
|
8
8
|
import log from '../../Logger';
|
|
9
9
|
import SDKConnector from '../../SDKConnector';
|
|
10
10
|
import { ALLOWED_SERVICES, HTTP_METHODS, RegistrationStatus, ServiceIndicator, WorkerMessageType, } from '../../common/types';
|
|
11
|
-
import { CALLING_USER_AGENT, CISCO_DEVICE_URL, DEVICES_ENDPOINT_RESOURCE, SPARK_USER_AGENT, WEBEX_WEB_CLIENT, BASE_REG_RETRY_TIMER_VAL_IN_SEC, BASE_REG_TIMER_MFACTOR, SEC_TO_MSEC_MFACTOR, REG_RANDOM_T_FACTOR_UPPER_LIMIT, REG_TRY_BACKUP_TIMER_VAL_IN_SEC, MINUTES_TO_SEC_MFACTOR, REG_429_RETRY_UTIL, REG_FAILBACK_429_MAX_RETRIES, FAILBACK_UTIL, REGISTRATION_FILE, DEFAULT_REHOMING_INTERVAL_MIN, DEFAULT_REHOMING_INTERVAL_MAX, DEFAULT_KEEPALIVE_INTERVAL,
|
|
11
|
+
import { CALLING_USER_AGENT, CISCO_DEVICE_URL, DEVICES_ENDPOINT_RESOURCE, SPARK_USER_AGENT, WEBEX_WEB_CLIENT, BASE_REG_RETRY_TIMER_VAL_IN_SEC, BASE_REG_TIMER_MFACTOR, SEC_TO_MSEC_MFACTOR, REG_RANDOM_T_FACTOR_UPPER_LIMIT, REG_TRY_BACKUP_TIMER_VAL_IN_SEC, MINUTES_TO_SEC_MFACTOR, REG_429_RETRY_UTIL, REG_FAILBACK_429_MAX_RETRIES, FAILBACK_UTIL, REGISTRATION_FILE, DEFAULT_REHOMING_INTERVAL_MIN, DEFAULT_REHOMING_INTERVAL_MAX, DEFAULT_KEEPALIVE_INTERVAL, FAILOVER_UTIL, REGISTER_UTIL, RETRY_TIMER_UPPER_LIMIT, KEEPALIVE_UTIL, REGISTRATION_UTIL, METHODS, URL_ENDPOINT, } from '../constants';
|
|
12
12
|
import { LINE_EVENTS } from '../line/types';
|
|
13
13
|
export class Registration {
|
|
14
14
|
sdkConnector;
|
|
@@ -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);
|
|
@@ -157,9 +158,7 @@ export class Registration {
|
|
|
157
158
|
method: FAILOVER_UTIL,
|
|
158
159
|
};
|
|
159
160
|
let interval = this.getRegRetryInterval(attempt);
|
|
160
|
-
const TIMER_THRESHOLD =
|
|
161
|
-
? REG_TRY_BACKUP_TIMER_VAL_FOR_CC_IN_SEC
|
|
162
|
-
: REG_TRY_BACKUP_TIMER_VAL_IN_SEC;
|
|
161
|
+
const TIMER_THRESHOLD = REG_TRY_BACKUP_TIMER_VAL_IN_SEC;
|
|
163
162
|
if (timeElapsed + interval > TIMER_THRESHOLD) {
|
|
164
163
|
const excessVal = timeElapsed + interval - TIMER_THRESHOLD;
|
|
165
164
|
interval -= excessVal;
|
|
@@ -220,6 +219,40 @@ export class Registration {
|
|
|
220
219
|
this.failbackTimer = undefined;
|
|
221
220
|
}
|
|
222
221
|
}
|
|
222
|
+
async isPrimaryActive() {
|
|
223
|
+
let status;
|
|
224
|
+
for (const mobiusUrl of this.primaryMobiusUris) {
|
|
225
|
+
try {
|
|
226
|
+
const baseUri = mobiusUrl.replace(URL_ENDPOINT, '/');
|
|
227
|
+
const response = await this.webex.request({
|
|
228
|
+
uri: `${baseUri}ping`,
|
|
229
|
+
method: HTTP_METHODS.GET,
|
|
230
|
+
headers: {
|
|
231
|
+
[CISCO_DEVICE_URL]: this.webex.internal.device.url,
|
|
232
|
+
[SPARK_USER_AGENT]: CALLING_USER_AGENT,
|
|
233
|
+
},
|
|
234
|
+
service: ALLOWED_SERVICES.MOBIUS,
|
|
235
|
+
});
|
|
236
|
+
const { statusCode } = response;
|
|
237
|
+
if (statusCode === 200) {
|
|
238
|
+
log.info(`Ping successful for primary Mobius: ${mobiusUrl}`, {
|
|
239
|
+
file: REGISTRATION_FILE,
|
|
240
|
+
method: FAILBACK_UTIL,
|
|
241
|
+
});
|
|
242
|
+
status = 'up';
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
catch (error) {
|
|
247
|
+
log.warn(`Ping failed for primary Mobius: ${mobiusUrl} with error: ${error}`, {
|
|
248
|
+
file: REGISTRATION_FILE,
|
|
249
|
+
method: FAILBACK_UTIL,
|
|
250
|
+
});
|
|
251
|
+
status = 'down';
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
return status === 'up';
|
|
255
|
+
}
|
|
223
256
|
isFailbackRequired() {
|
|
224
257
|
return this.isDeviceRegistered() && this.primaryMobiusUris.indexOf(this.activeMobiusUrl) === -1;
|
|
225
258
|
}
|
|
@@ -250,7 +283,8 @@ export class Registration {
|
|
|
250
283
|
async executeFailback() {
|
|
251
284
|
await this.mutex.runExclusive(async () => {
|
|
252
285
|
if (this.isFailbackRequired()) {
|
|
253
|
-
|
|
286
|
+
const primaryServerStatus = await this.isPrimaryActive();
|
|
287
|
+
if (Object.keys(this.callManager.getActiveCalls()).length === 0 && primaryServerStatus) {
|
|
254
288
|
log.info(`Attempting failback to primary.`, {
|
|
255
289
|
file: REGISTRATION_FILE,
|
|
256
290
|
method: this.executeFailback.name,
|
|
@@ -274,7 +308,7 @@ export class Registration {
|
|
|
274
308
|
}
|
|
275
309
|
}
|
|
276
310
|
else {
|
|
277
|
-
log.info('Active calls present, deferring failback to next cycle.', {
|
|
311
|
+
log.info('Active calls present or primary Mobius is down, deferring failback to next cycle.', {
|
|
278
312
|
file: REGISTRATION_FILE,
|
|
279
313
|
method: this.executeFailback.name,
|
|
280
314
|
});
|
|
@@ -321,18 +355,18 @@ export class Registration {
|
|
|
321
355
|
});
|
|
322
356
|
await this.mutex.runExclusive(async () => {
|
|
323
357
|
if (retry) {
|
|
324
|
-
log.log('
|
|
358
|
+
log.log('Network is up again, re-registering with Webex Calling if needed', {
|
|
325
359
|
file: REGISTRATION_FILE,
|
|
326
|
-
method:
|
|
360
|
+
method: METHODS.HANDLE_CONNECTION_RESTORATION,
|
|
327
361
|
});
|
|
328
362
|
this.clearKeepaliveTimer();
|
|
329
363
|
if (this.isDeviceRegistered()) {
|
|
330
364
|
await this.deregister();
|
|
331
365
|
}
|
|
332
366
|
if (this.activeMobiusUrl) {
|
|
333
|
-
const abort = await this.restorePreviousRegistration(
|
|
367
|
+
const abort = await this.restorePreviousRegistration(METHODS.HANDLE_CONNECTION_RESTORATION);
|
|
334
368
|
if (!abort && !this.isDeviceRegistered()) {
|
|
335
|
-
await this.restartRegistration(
|
|
369
|
+
await this.restartRegistration(METHODS.HANDLE_CONNECTION_RESTORATION);
|
|
336
370
|
}
|
|
337
371
|
}
|
|
338
372
|
retry = false;
|
|
@@ -400,12 +434,12 @@ export class Registration {
|
|
|
400
434
|
const resp = await this.postRegistration(url);
|
|
401
435
|
this.deviceInfo = resp.body;
|
|
402
436
|
this.registrationStatus = RegistrationStatus.ACTIVE;
|
|
437
|
+
this.setActiveMobiusUrl(url);
|
|
403
438
|
this.lineEmitter(LINE_EVENTS.REGISTERED, resp.body);
|
|
404
|
-
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}`, {
|
|
405
440
|
file: REGISTRATION_FILE,
|
|
406
441
|
method: METHODS.REGISTER,
|
|
407
442
|
});
|
|
408
|
-
this.setActiveMobiusUrl(url);
|
|
409
443
|
this.setIntervalValues(this.deviceInfo);
|
|
410
444
|
this.metricManager.setDeviceInfo(this.deviceInfo);
|
|
411
445
|
this.metricManager.submitRegistrationMetric(METRIC_EVENT.REGISTRATION, REG_ACTION.REGISTER, METRIC_TYPE.BEHAVIORAL, caller, serverType, resp.headers?.trackingid ?? '', undefined, undefined);
|
|
@@ -433,6 +467,7 @@ export class Registration {
|
|
|
433
467
|
}
|
|
434
468
|
if (abort) {
|
|
435
469
|
this.setStatus(RegistrationStatus.INACTIVE);
|
|
470
|
+
await uploadLogs();
|
|
436
471
|
break;
|
|
437
472
|
}
|
|
438
473
|
}
|
|
@@ -474,7 +509,7 @@ export class Registration {
|
|
|
474
509
|
if (finalError) {
|
|
475
510
|
this.lineEmitter(LINE_EVENTS.ERROR, undefined, clientError);
|
|
476
511
|
}
|
|
477
|
-
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);
|
|
478
513
|
}, { method: KEEPALIVE_UTIL, file: REGISTRATION_FILE });
|
|
479
514
|
if (abort || event.data.keepAliveRetryCount >= RETRY_COUNT_THRESHOLD) {
|
|
480
515
|
this.failoverImmediately = this.isCCFlow;
|
|
@@ -482,6 +517,7 @@ export class Registration {
|
|
|
482
517
|
this.clearKeepaliveTimer();
|
|
483
518
|
this.clearFailbackTimer();
|
|
484
519
|
this.lineEmitter(LINE_EVENTS.UNREGISTERED);
|
|
520
|
+
await uploadLogs();
|
|
485
521
|
if (!abort) {
|
|
486
522
|
await this.reconnectOnFailure(KEEPALIVE_UTIL);
|
|
487
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;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
function waitForIceComplete(pc, timeoutMs) {
|
|
2
|
+
return new Promise((resolve) => {
|
|
3
|
+
if (!pc) {
|
|
4
|
+
resolve({ ok: false, reason: 'no-pc' });
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
if (pc.iceGatheringState === 'complete') {
|
|
8
|
+
resolve({ ok: true, reached: 'already' });
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
let done = false;
|
|
12
|
+
const onChange = () => {
|
|
13
|
+
if (pc.iceGatheringState === 'complete' && !done) {
|
|
14
|
+
done = true;
|
|
15
|
+
pc.removeEventListener('icegatheringstatechange', onChange);
|
|
16
|
+
resolve({ ok: true, reached: 'event' });
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
pc.addEventListener('icegatheringstatechange', onChange);
|
|
20
|
+
setTimeout(() => {
|
|
21
|
+
if (done)
|
|
22
|
+
return;
|
|
23
|
+
done = true;
|
|
24
|
+
pc.removeEventListener('icegatheringstatechange', onChange);
|
|
25
|
+
resolve({ ok: pc.iceGatheringState === 'complete', reached: 'timeout' });
|
|
26
|
+
}, timeoutMs);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
export default async function windowsChromiumIceWarmup({ iceServers = [], timeoutMs = 1000 }) {
|
|
30
|
+
const pc1 = new RTCPeerConnection({ iceServers, iceCandidatePoolSize: 1 });
|
|
31
|
+
const pc2 = new RTCPeerConnection({ iceServers, iceCandidatePoolSize: 1 });
|
|
32
|
+
const candidates = { pc1: [], pc2: [] };
|
|
33
|
+
pc1.onicecandidate = (e) => {
|
|
34
|
+
if (e.candidate && e.candidate.type !== 'host') {
|
|
35
|
+
candidates.pc1.push(e.candidate);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
await pc1.createDataChannel('warmup');
|
|
39
|
+
await pc1.addTransceiver('audio');
|
|
40
|
+
const offer = await pc1.createOffer();
|
|
41
|
+
await pc1.setLocalDescription(offer);
|
|
42
|
+
await waitForIceComplete(pc1, timeoutMs);
|
|
43
|
+
await pc2.setRemoteDescription(offer);
|
|
44
|
+
pc2.onicecandidate = (e) => {
|
|
45
|
+
if (e.candidate && e.candidate.type !== 'host') {
|
|
46
|
+
candidates.pc2.push(e.candidate);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const answer = await pc2.createAnswer();
|
|
50
|
+
await pc2.setLocalDescription(answer);
|
|
51
|
+
await pc1.setRemoteDescription(answer);
|
|
52
|
+
await waitForIceComplete(pc2, timeoutMs);
|
|
53
|
+
await Promise.all([
|
|
54
|
+
...candidates.pc1.map((candidate) => pc2.addIceCandidate(candidate).catch(console.error)),
|
|
55
|
+
...candidates.pc2.map((candidate) => pc1.addIceCandidate(candidate).catch(console.error)),
|
|
56
|
+
]);
|
|
57
|
+
pc1.close();
|
|
58
|
+
pc2.close();
|
|
59
|
+
}
|
|
@@ -2,7 +2,7 @@ import { FAILURE_MESSAGE, METHOD_START_MESSAGE, SCIM_ENTERPRISE_USER, SCIM_WEBEX
|
|
|
2
2
|
import { HTTP_METHODS } from '../common/types';
|
|
3
3
|
import SDKConnector from '../SDKConnector';
|
|
4
4
|
import log from '../Logger';
|
|
5
|
-
import {
|
|
5
|
+
import { CONTACTS_CLIENT, CONTACTS_SCHEMA, CONTACT_FILTER, DEFAULT_GROUP_NAME, ENCRYPT_FILTER, GROUP_FILTER, METHODS, OR, SCIM_ID_FILTER, USERS, encryptedFields, } from './constants';
|
|
6
6
|
import { ContactType, GroupType, } from './types';
|
|
7
7
|
import { scimQuery, serviceErrorCodeHandler, uploadLogs } from '../common/Utils';
|
|
8
8
|
export class ContactsClient {
|
|
@@ -22,7 +22,7 @@ export class ContactsClient {
|
|
|
22
22
|
this.groups = undefined;
|
|
23
23
|
this.contacts = undefined;
|
|
24
24
|
this.defaultGroupId = '';
|
|
25
|
-
log.setLogger(logger.level,
|
|
25
|
+
log.setLogger(logger.level, CONTACTS_CLIENT);
|
|
26
26
|
}
|
|
27
27
|
async decryptContactDetail(encryptionKeyUrl, contactDetails) {
|
|
28
28
|
const decryptedContactDetail = [...contactDetails];
|
|
@@ -130,7 +130,7 @@ export class ContactsClient {
|
|
|
130
130
|
}
|
|
131
131
|
resolveCloudContacts(contactsDataMap, inputList) {
|
|
132
132
|
const loggerContext = {
|
|
133
|
-
file:
|
|
133
|
+
file: CONTACTS_CLIENT,
|
|
134
134
|
method: 'resolveCloudContacts',
|
|
135
135
|
};
|
|
136
136
|
const finalContactList = [];
|
|
@@ -187,7 +187,7 @@ export class ContactsClient {
|
|
|
187
187
|
}
|
|
188
188
|
async getContacts() {
|
|
189
189
|
const loggerContext = {
|
|
190
|
-
file:
|
|
190
|
+
file: CONTACTS_CLIENT,
|
|
191
191
|
method: METHODS.GET_CONTACTS,
|
|
192
192
|
};
|
|
193
193
|
log.info(METHOD_START_MESSAGE, loggerContext);
|
|
@@ -198,6 +198,7 @@ export class ContactsClient {
|
|
|
198
198
|
uri: `${this.webex.internal.services._serviceUrls.contactsService}/${ENCRYPT_FILTER}/${USERS}/${CONTACT_FILTER}`,
|
|
199
199
|
method: HTTP_METHODS.GET,
|
|
200
200
|
});
|
|
201
|
+
log.log(`Response code: ${response.statusCode} and Response trackingId: ${response?.headers?.trackingid}`, loggerContext);
|
|
201
202
|
const responseBody = response.body;
|
|
202
203
|
if (!responseBody) {
|
|
203
204
|
throw new Error(`${response}`);
|
|
@@ -259,7 +260,7 @@ export class ContactsClient {
|
|
|
259
260
|
}
|
|
260
261
|
async createNewEncryptionKeyUrl() {
|
|
261
262
|
const loggerContext = {
|
|
262
|
-
file:
|
|
263
|
+
file: CONTACTS_CLIENT,
|
|
263
264
|
method: METHODS.CREATE_NEW_ENCRYPTION_KEY_URL,
|
|
264
265
|
};
|
|
265
266
|
log.info(METHOD_START_MESSAGE, loggerContext);
|
|
@@ -272,7 +273,7 @@ export class ContactsClient {
|
|
|
272
273
|
}
|
|
273
274
|
async fetchEncryptionKeyUrl() {
|
|
274
275
|
const loggerContext = {
|
|
275
|
-
file:
|
|
276
|
+
file: CONTACTS_CLIENT,
|
|
276
277
|
method: METHODS.FETCH_ENCRYPTION_KEY_URL,
|
|
277
278
|
};
|
|
278
279
|
log.info(METHOD_START_MESSAGE, loggerContext);
|
|
@@ -287,14 +288,14 @@ export class ContactsClient {
|
|
|
287
288
|
}
|
|
288
289
|
this.encryptionKeyUrl = await this.createNewEncryptionKeyUrl();
|
|
289
290
|
log.log(`Creating a default group: ${DEFAULT_GROUP_NAME}`, {
|
|
290
|
-
file:
|
|
291
|
+
file: CONTACTS_CLIENT,
|
|
291
292
|
method: this.fetchEncryptionKeyUrl.name,
|
|
292
293
|
});
|
|
293
294
|
const response = await this.createContactGroup(DEFAULT_GROUP_NAME, this.encryptionKeyUrl);
|
|
294
295
|
if (response.data.group?.groupId) {
|
|
295
296
|
this.defaultGroupId = response.data.group?.groupId;
|
|
296
297
|
log.log(`Successfully created default group with ID: ${this.defaultGroupId}`, {
|
|
297
|
-
file:
|
|
298
|
+
file: CONTACTS_CLIENT,
|
|
298
299
|
method: this.fetchEncryptionKeyUrl.name,
|
|
299
300
|
});
|
|
300
301
|
}
|
|
@@ -302,13 +303,13 @@ export class ContactsClient {
|
|
|
302
303
|
}
|
|
303
304
|
async fetchDefaultGroup() {
|
|
304
305
|
const loggerContext = {
|
|
305
|
-
file:
|
|
306
|
+
file: CONTACTS_CLIENT,
|
|
306
307
|
method: METHODS.FETCH_DEFAULT_GROUP,
|
|
307
308
|
};
|
|
308
309
|
log.info(METHOD_START_MESSAGE, loggerContext);
|
|
309
310
|
if (this.defaultGroupId) {
|
|
310
311
|
log.log(`Using existing default group with ID: ${this.defaultGroupId}`, {
|
|
311
|
-
file:
|
|
312
|
+
file: CONTACTS_CLIENT,
|
|
312
313
|
method: this.fetchDefaultGroup.name,
|
|
313
314
|
});
|
|
314
315
|
return this.defaultGroupId;
|
|
@@ -318,7 +319,7 @@ export class ContactsClient {
|
|
|
318
319
|
if (this.groups[i].displayName === DEFAULT_GROUP_NAME) {
|
|
319
320
|
this.defaultGroupId = this.groups[i].groupId;
|
|
320
321
|
log.log(`Found default group with ID: ${this.defaultGroupId}`, {
|
|
321
|
-
file:
|
|
322
|
+
file: CONTACTS_CLIENT,
|
|
322
323
|
method: this.fetchDefaultGroup.name,
|
|
323
324
|
});
|
|
324
325
|
return this.defaultGroupId;
|
|
@@ -326,7 +327,7 @@ export class ContactsClient {
|
|
|
326
327
|
}
|
|
327
328
|
}
|
|
328
329
|
log.log('No default group found.', {
|
|
329
|
-
file:
|
|
330
|
+
file: CONTACTS_CLIENT,
|
|
330
331
|
method: this.fetchDefaultGroup.name,
|
|
331
332
|
});
|
|
332
333
|
const response = await this.createContactGroup(DEFAULT_GROUP_NAME);
|
|
@@ -334,7 +335,7 @@ export class ContactsClient {
|
|
|
334
335
|
if (group) {
|
|
335
336
|
const groupId = group.groupId;
|
|
336
337
|
log.log(`Successfully created new default group with ID: ${groupId}`, {
|
|
337
|
-
file:
|
|
338
|
+
file: CONTACTS_CLIENT,
|
|
338
339
|
method: this.fetchDefaultGroup.name,
|
|
339
340
|
});
|
|
340
341
|
return groupId;
|
|
@@ -343,7 +344,7 @@ export class ContactsClient {
|
|
|
343
344
|
}
|
|
344
345
|
async createContactGroup(displayName, encryptionKeyUrl, groupType) {
|
|
345
346
|
const loggerContext = {
|
|
346
|
-
file:
|
|
347
|
+
file: CONTACTS_CLIENT,
|
|
347
348
|
method: METHODS.CREATE_CONTACT_GROUP,
|
|
348
349
|
};
|
|
349
350
|
log.info(`${METHOD_START_MESSAGE} with displayName: ${displayName}`, loggerContext);
|
|
@@ -377,6 +378,8 @@ export class ContactsClient {
|
|
|
377
378
|
method: HTTP_METHODS.POST,
|
|
378
379
|
body: groupInfo,
|
|
379
380
|
});
|
|
381
|
+
log.log(`Response code: ${response.statusCode}`, loggerContext);
|
|
382
|
+
log.log(`Response trackingId: ${response?.headers?.trackingid}`, loggerContext);
|
|
380
383
|
const group = response.body;
|
|
381
384
|
group.displayName = displayName;
|
|
382
385
|
const contactResponse = {
|
|
@@ -401,7 +404,7 @@ export class ContactsClient {
|
|
|
401
404
|
}
|
|
402
405
|
async deleteContactGroup(groupId) {
|
|
403
406
|
const loggerContext = {
|
|
404
|
-
file:
|
|
407
|
+
file: CONTACTS_CLIENT,
|
|
405
408
|
method: METHODS.DELETE_CONTACT_GROUP,
|
|
406
409
|
};
|
|
407
410
|
log.info(`${METHOD_START_MESSAGE} with groupId: ${groupId}`, loggerContext);
|
|
@@ -411,6 +414,7 @@ export class ContactsClient {
|
|
|
411
414
|
uri: `${this.webex.internal.services._serviceUrls.contactsService}/${ENCRYPT_FILTER}/${USERS}/${GROUP_FILTER}/${groupId}`,
|
|
412
415
|
method: HTTP_METHODS.DELETE,
|
|
413
416
|
});
|
|
417
|
+
log.log(`Response trackingId: ${response?.headers?.trackingid}`, loggerContext);
|
|
414
418
|
const contactResponse = {
|
|
415
419
|
statusCode: Number(response[STATUS_CODE]),
|
|
416
420
|
data: {},
|
|
@@ -437,7 +441,7 @@ export class ContactsClient {
|
|
|
437
441
|
}
|
|
438
442
|
async createContact(contactInfo) {
|
|
439
443
|
const loggerContext = {
|
|
440
|
-
file:
|
|
444
|
+
file: CONTACTS_CLIENT,
|
|
441
445
|
method: METHODS.CREATE_CONTACT,
|
|
442
446
|
};
|
|
443
447
|
log.info(`${METHOD_START_MESSAGE} with contactType: ${contactInfo.contactType}`, loggerContext);
|
|
@@ -487,6 +491,8 @@ export class ContactsClient {
|
|
|
487
491
|
method: HTTP_METHODS.POST,
|
|
488
492
|
body: requestBody,
|
|
489
493
|
});
|
|
494
|
+
log.log(`Response code: ${response.statusCode}`, loggerContext);
|
|
495
|
+
log.log(`Response trackingId: ${response?.headers?.trackingid}`, loggerContext);
|
|
490
496
|
const newContact = response.body;
|
|
491
497
|
contact.contactId = newContact.contactId;
|
|
492
498
|
const contactResponse = {
|
|
@@ -521,7 +527,7 @@ export class ContactsClient {
|
|
|
521
527
|
}
|
|
522
528
|
async deleteContact(contactId) {
|
|
523
529
|
const loggerContext = {
|
|
524
|
-
file:
|
|
530
|
+
file: CONTACTS_CLIENT,
|
|
525
531
|
method: METHODS.DELETE_CONTACT,
|
|
526
532
|
};
|
|
527
533
|
log.info(`${METHOD_START_MESSAGE} with contactId: ${contactId}`, loggerContext);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { METRIC_FILE, VERSION } from '../CallingClient/constants';
|
|
2
|
-
import {
|
|
2
|
+
import { ServiceIndicator } from '../common/types';
|
|
3
|
+
import { METRIC_EVENT, } from './types';
|
|
3
4
|
import log from '../Logger';
|
|
4
5
|
let metricManager;
|
|
5
6
|
class MetricManager {
|
|
@@ -11,48 +12,60 @@ class MetricManager {
|
|
|
11
12
|
this.webex = webex;
|
|
12
13
|
this.serviceIndicator = indicator;
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
+
submitConnectionMetrics(name, metricAction, type, downTimestamp, upTimestamp) {
|
|
16
|
+
const metricData = {
|
|
17
|
+
tags: {
|
|
18
|
+
metricAction,
|
|
19
|
+
device_id: this.deviceInfo?.device?.deviceId,
|
|
20
|
+
service_indicator: this.serviceIndicator,
|
|
21
|
+
},
|
|
22
|
+
fields: {
|
|
23
|
+
device_url: this.deviceInfo?.device?.clientDeviceUri,
|
|
24
|
+
mobius_url: this.deviceInfo?.device?.uri,
|
|
25
|
+
calling_sdk_version: process.env.CALLING_SDK_VERSION || VERSION,
|
|
26
|
+
downTimestamp,
|
|
27
|
+
upTimestamp,
|
|
28
|
+
},
|
|
29
|
+
type,
|
|
30
|
+
};
|
|
31
|
+
if (metricData) {
|
|
32
|
+
this.webex.internal.metrics.submitClientMetrics(name, metricData);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
submitUploadLogsMetric(name, action, type, trackingId, feedbackId, correlationId, stack, callId, broadworksCorrelationInfo) {
|
|
15
36
|
let data;
|
|
37
|
+
const commonData = {
|
|
38
|
+
tags: {
|
|
39
|
+
action,
|
|
40
|
+
device_id: this.deviceInfo?.device?.deviceId,
|
|
41
|
+
service_indicator: this.serviceIndicator,
|
|
42
|
+
},
|
|
43
|
+
fields: {
|
|
44
|
+
device_url: this.deviceInfo?.device?.clientDeviceUri,
|
|
45
|
+
mobius_url: this.deviceInfo?.device?.uri,
|
|
46
|
+
calling_sdk_version: process.env.CALLING_SDK_VERSION || VERSION,
|
|
47
|
+
correlation_id: correlationId,
|
|
48
|
+
broadworksCorrelationInfo,
|
|
49
|
+
tracking_id: trackingId,
|
|
50
|
+
feedback_id: feedbackId,
|
|
51
|
+
call_id: callId,
|
|
52
|
+
},
|
|
53
|
+
type,
|
|
54
|
+
};
|
|
16
55
|
switch (name) {
|
|
17
56
|
case METRIC_EVENT.UPLOAD_LOGS_SUCCESS: {
|
|
18
|
-
data =
|
|
19
|
-
tags: {
|
|
20
|
-
action,
|
|
21
|
-
device_id: this.deviceInfo?.device?.deviceId,
|
|
22
|
-
service_indicator: this.serviceIndicator,
|
|
23
|
-
},
|
|
24
|
-
fields: {
|
|
25
|
-
device_url: this.deviceInfo?.device?.clientDeviceUri,
|
|
26
|
-
mobius_url: this.deviceInfo?.device?.uri,
|
|
27
|
-
calling_sdk_version: process.env.CALLING_SDK_VERSION || VERSION,
|
|
28
|
-
correlation_id: correlationId,
|
|
29
|
-
tracking_id: trackingId,
|
|
30
|
-
feedback_id: feedbackId,
|
|
31
|
-
call_id: callId,
|
|
32
|
-
},
|
|
33
|
-
type,
|
|
34
|
-
};
|
|
57
|
+
data = commonData;
|
|
35
58
|
break;
|
|
36
59
|
}
|
|
37
60
|
case METRIC_EVENT.UPLOAD_LOGS_FAILED: {
|
|
38
61
|
data = {
|
|
39
|
-
|
|
40
|
-
action,
|
|
41
|
-
device_id: this.deviceInfo?.device?.deviceId,
|
|
42
|
-
service_indicator: this.serviceIndicator,
|
|
43
|
-
},
|
|
62
|
+
...commonData,
|
|
44
63
|
fields: {
|
|
45
|
-
|
|
46
|
-
mobius_url: this.deviceInfo?.device?.uri,
|
|
47
|
-
calling_sdk_version: process.env.CALLING_SDK_VERSION || VERSION,
|
|
48
|
-
correlation_id: correlationId,
|
|
49
|
-
tracking_id: trackingId,
|
|
50
|
-
feedback_id: feedbackId,
|
|
64
|
+
...commonData.fields,
|
|
51
65
|
error: stack,
|
|
52
|
-
call_id: callId,
|
|
53
66
|
},
|
|
54
|
-
type,
|
|
55
67
|
};
|
|
68
|
+
break;
|
|
56
69
|
}
|
|
57
70
|
}
|
|
58
71
|
if (data) {
|
|
@@ -62,6 +75,47 @@ class MetricManager {
|
|
|
62
75
|
setDeviceInfo(deviceInfo) {
|
|
63
76
|
this.deviceInfo = deviceInfo;
|
|
64
77
|
}
|
|
78
|
+
submitRegionInfoMetric(name, metricAction, type, mobiusHost, clientRegion, countryCode, trackingId) {
|
|
79
|
+
const data = {
|
|
80
|
+
tags: {
|
|
81
|
+
action: metricAction,
|
|
82
|
+
device_id: this.deviceInfo?.device?.deviceId,
|
|
83
|
+
service_indicator: ServiceIndicator.CALLING,
|
|
84
|
+
},
|
|
85
|
+
fields: {
|
|
86
|
+
device_url: this.deviceInfo?.device?.clientDeviceUri,
|
|
87
|
+
mobius_url: this.deviceInfo?.device?.uri,
|
|
88
|
+
calling_sdk_version: process.env.CALLING_SDK_VERSION || VERSION,
|
|
89
|
+
mobius_host: mobiusHost,
|
|
90
|
+
client_region: clientRegion,
|
|
91
|
+
country_code: countryCode,
|
|
92
|
+
tracking_id: trackingId,
|
|
93
|
+
},
|
|
94
|
+
type,
|
|
95
|
+
};
|
|
96
|
+
this.webex.internal.metrics.submitClientMetrics(name, data);
|
|
97
|
+
}
|
|
98
|
+
submitMobiusServersMetric(name, metricAction, type, mobiusServers, trackingId) {
|
|
99
|
+
const data = {
|
|
100
|
+
tags: {
|
|
101
|
+
action: metricAction,
|
|
102
|
+
device_id: this.deviceInfo?.device?.deviceId,
|
|
103
|
+
service_indicator: ServiceIndicator.CALLING,
|
|
104
|
+
},
|
|
105
|
+
fields: {
|
|
106
|
+
device_url: this.deviceInfo?.device?.clientDeviceUri,
|
|
107
|
+
mobius_url: this.deviceInfo?.device?.uri,
|
|
108
|
+
calling_sdk_version: process.env.CALLING_SDK_VERSION || VERSION,
|
|
109
|
+
primary_mobius_servers_region: mobiusServers.primary.region,
|
|
110
|
+
primary_mobius_servers_uris: mobiusServers.primary.uris.join(','),
|
|
111
|
+
backup_mobius_servers_region: mobiusServers.backup.region,
|
|
112
|
+
backup_mobius_servers_uris: mobiusServers.backup.uris.join(','),
|
|
113
|
+
tracking_id: trackingId,
|
|
114
|
+
},
|
|
115
|
+
type,
|
|
116
|
+
};
|
|
117
|
+
this.webex.internal.metrics.submitClientMetrics(name, data);
|
|
118
|
+
}
|
|
65
119
|
submitRegistrationMetric(name, metricAction, type, caller, serverType, trackingId, keepaliveCount, clientError) {
|
|
66
120
|
let data;
|
|
67
121
|
switch (name) {
|
|
@@ -9,15 +9,23 @@ export var METRIC_EVENT;
|
|
|
9
9
|
METRIC_EVENT["BNR_DISABLED"] = "web-calling-sdk-bnr-disabled";
|
|
10
10
|
METRIC_EVENT["CALL"] = "web-calling-sdk-callcontrol";
|
|
11
11
|
METRIC_EVENT["CALL_ERROR"] = "web-calling-sdk-callcontrol-error";
|
|
12
|
+
METRIC_EVENT["CONNECTION_ERROR"] = "web-calling-sdk-connection";
|
|
12
13
|
METRIC_EVENT["MEDIA"] = "web-calling-sdk-media";
|
|
13
14
|
METRIC_EVENT["MEDIA_ERROR"] = "web-calling-sdk-media-error";
|
|
14
15
|
METRIC_EVENT["REGISTRATION"] = "web-calling-sdk-registration";
|
|
15
16
|
METRIC_EVENT["REGISTRATION_ERROR"] = "web-calling-sdk-registration-error";
|
|
17
|
+
METRIC_EVENT["KEEPALIVE_ERROR"] = "web-calling-sdk-keepalive-error";
|
|
16
18
|
METRIC_EVENT["VOICEMAIL"] = "web-calling-sdk-voicemail";
|
|
17
19
|
METRIC_EVENT["VOICEMAIL_ERROR"] = "web-calling-sdk-voicemail-error";
|
|
18
20
|
METRIC_EVENT["UPLOAD_LOGS_SUCCESS"] = "web-calling-sdk-upload-logs-success";
|
|
19
21
|
METRIC_EVENT["UPLOAD_LOGS_FAILED"] = "web-calling-sdk-upload-logs-failed";
|
|
22
|
+
METRIC_EVENT["MOBIUS_DISCOVERY"] = "web-calling-sdk-mobius-discovery";
|
|
20
23
|
})(METRIC_EVENT || (METRIC_EVENT = {}));
|
|
24
|
+
export var MOBIUS_SERVER_ACTION;
|
|
25
|
+
(function (MOBIUS_SERVER_ACTION) {
|
|
26
|
+
MOBIUS_SERVER_ACTION["REGION_INFO"] = "region-info";
|
|
27
|
+
MOBIUS_SERVER_ACTION["MOBIUS_SERVERS"] = "mobius-servers";
|
|
28
|
+
})(MOBIUS_SERVER_ACTION || (MOBIUS_SERVER_ACTION = {}));
|
|
21
29
|
export var REG_ACTION;
|
|
22
30
|
(function (REG_ACTION) {
|
|
23
31
|
REG_ACTION["REGISTER"] = "register";
|
|
@@ -40,3 +48,9 @@ export var VOICEMAIL_ACTION;
|
|
|
40
48
|
VOICEMAIL_ACTION["TRANSCRIPT"] = "transcript";
|
|
41
49
|
})(VOICEMAIL_ACTION || (VOICEMAIL_ACTION = {}));
|
|
42
50
|
export const UPLOAD_LOGS_ACTION = 'upload_logs';
|
|
51
|
+
export var CONNECTION_ACTION;
|
|
52
|
+
(function (CONNECTION_ACTION) {
|
|
53
|
+
CONNECTION_ACTION["NETWORK_FLAP"] = "network_flap";
|
|
54
|
+
CONNECTION_ACTION["MERCURY_DOWN"] = "mercury_down";
|
|
55
|
+
CONNECTION_ACTION["MERCURY_UP"] = "mercury_up";
|
|
56
|
+
})(CONNECTION_ACTION || (CONNECTION_ACTION = {}));
|
|
@@ -128,6 +128,7 @@ export class BroadworksBackendConnector {
|
|
|
128
128
|
throw new Error(`${response.status}`);
|
|
129
129
|
}
|
|
130
130
|
const voicemailListResponse = (await response.json());
|
|
131
|
+
log.log(`Response trackingId: ${response.headers?.get('trackingid')}`, loggerContext);
|
|
131
132
|
if (Object.keys(voicemailListResponse?.VoiceMessagingMessages?.messageInfoList).length === 0) {
|
|
132
133
|
messageinfo = [];
|
|
133
134
|
}
|
|
@@ -181,6 +182,7 @@ export class BroadworksBackendConnector {
|
|
|
181
182
|
throw new Error(`${response.status}`);
|
|
182
183
|
}
|
|
183
184
|
const xmlData = await response.text();
|
|
185
|
+
log.log(`Response trackingId: ${response.headers?.get('trackingid')}`, loggerContext);
|
|
184
186
|
const parser = new DOMParser();
|
|
185
187
|
const xmlDOM = parser.parseFromString(xmlData, XML_TYPE);
|
|
186
188
|
const mediaDetails = xmlDOM.getElementsByTagName(MESSAGE_MEDIA_CONTENT)[0];
|
|
@@ -232,6 +234,7 @@ export class BroadworksBackendConnector {
|
|
|
232
234
|
throw new Error(`${response.status}`);
|
|
233
235
|
}
|
|
234
236
|
log.log(`Successfully marked voicemail with ID ${messageId} as read`, loggerContext);
|
|
237
|
+
log.log(`Response trackingId: ${response.headers?.get('trackingid')}`, loggerContext);
|
|
235
238
|
const responseDetails = {
|
|
236
239
|
statusCode: response.status,
|
|
237
240
|
data: {},
|
|
@@ -59,6 +59,7 @@ export class UcmBackendConnector {
|
|
|
59
59
|
orgId: this.orgId,
|
|
60
60
|
},
|
|
61
61
|
});
|
|
62
|
+
log.log(`Response trackingId: ${response?.headers?.trackingid}`, loggerContext);
|
|
62
63
|
const msgInfo = response.body;
|
|
63
64
|
const messageinfoArray = [];
|
|
64
65
|
const ucmVmMsgInfo = msgInfo.Message;
|
|
@@ -186,6 +187,8 @@ export class UcmBackendConnector {
|
|
|
186
187
|
mercuryHostname: mercuryApi,
|
|
187
188
|
},
|
|
188
189
|
});
|
|
190
|
+
log.log(`Response code: ${response.statusCode}`, loggerContext);
|
|
191
|
+
log.log(`Response trackingId: ${response?.headers?.trackingid}`, loggerContext);
|
|
189
192
|
const contentInfo = response?.body;
|
|
190
193
|
const respHeaders = response.headers;
|
|
191
194
|
const statusCode = response.statusCode;
|
|
@@ -224,6 +227,7 @@ export class UcmBackendConnector {
|
|
|
224
227
|
read: 'true',
|
|
225
228
|
},
|
|
226
229
|
});
|
|
230
|
+
log.log(`Response trackingId: ${response?.headers?.trackingid}`, loggerContext);
|
|
227
231
|
const responseDetails = {
|
|
228
232
|
statusCode: Number(response.statusCode),
|
|
229
233
|
data: {},
|
|
@@ -259,6 +263,7 @@ export class UcmBackendConnector {
|
|
|
259
263
|
read: 'false',
|
|
260
264
|
},
|
|
261
265
|
});
|
|
266
|
+
log.log(`Response trackingId: ${response?.headers?.trackingid}`, loggerContext);
|
|
262
267
|
const responseDetails = {
|
|
263
268
|
statusCode: Number(response.statusCode),
|
|
264
269
|
data: {},
|
|
@@ -291,6 +296,7 @@ export class UcmBackendConnector {
|
|
|
291
296
|
orgId: this.orgId,
|
|
292
297
|
},
|
|
293
298
|
});
|
|
299
|
+
log.log(`Response trackingId: ${response?.headers?.trackingid}`, loggerContext);
|
|
294
300
|
const responseDetails = {
|
|
295
301
|
statusCode: Number(response.statusCode),
|
|
296
302
|
data: {},
|