@webex/calling 3.8.0 → 3.8.1-next.2
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 +100 -63
- package/dist/CallHistory/CallHistory.js.map +1 -1
- package/dist/CallHistory/CallHistory.test.js +115 -19
- package/dist/CallHistory/CallHistory.test.js.map +1 -1
- package/dist/CallHistory/constants.js +9 -1
- package/dist/CallHistory/constants.js.map +1 -1
- package/dist/CallSettings/CallSettings.js +46 -13
- package/dist/CallSettings/CallSettings.js.map +1 -1
- package/dist/CallSettings/UcmBackendConnector.js +62 -18
- package/dist/CallSettings/UcmBackendConnector.js.map +1 -1
- package/dist/CallSettings/UcmBackendConnector.test.js +70 -7
- package/dist/CallSettings/UcmBackendConnector.test.js.map +1 -1
- package/dist/CallSettings/WxCallBackendConnector.js +153 -103
- package/dist/CallSettings/WxCallBackendConnector.js.map +1 -1
- package/dist/CallSettings/WxCallBackendConnector.test.js +52 -15
- package/dist/CallSettings/WxCallBackendConnector.test.js.map +1 -1
- package/dist/CallSettings/constants.js +15 -1
- package/dist/CallSettings/constants.js.map +1 -1
- package/dist/CallingClient/CallingClient.js +220 -159
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +53 -24
- package/dist/CallingClient/CallingClient.test.js.map +1 -1
- package/dist/CallingClient/calling/call.js +251 -189
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +96 -41
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/CallingClient/calling/callManager.js +73 -48
- package/dist/CallingClient/calling/callManager.js.map +1 -1
- package/dist/CallingClient/calling/callManager.test.js +96 -37
- package/dist/CallingClient/calling/callManager.test.js.map +1 -1
- package/dist/CallingClient/constants.js +105 -3
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/CallingClient/line/index.js +47 -18
- package/dist/CallingClient/line/index.js.map +1 -1
- package/dist/CallingClient/line/line.test.js +2 -2
- package/dist/CallingClient/line/line.test.js.map +1 -1
- package/dist/CallingClient/registration/register.js +359 -297
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +561 -163
- package/dist/CallingClient/registration/register.test.js.map +1 -1
- package/dist/CallingClient/registration/types.js.map +1 -1
- package/dist/Contacts/ContactsClient.js +156 -102
- package/dist/Contacts/ContactsClient.js.map +1 -1
- package/dist/Contacts/ContactsClient.test.js +197 -49
- package/dist/Contacts/ContactsClient.test.js.map +1 -1
- package/dist/Contacts/constants.js +11 -1
- package/dist/Contacts/constants.js.map +1 -1
- package/dist/Errors/types.js +2 -0
- package/dist/Errors/types.js.map +1 -1
- package/dist/Events/impl/index.js +1 -1
- package/dist/Events/impl/index.js.map +1 -1
- package/dist/Metrics/index.js +102 -41
- package/dist/Metrics/index.js.map +1 -1
- package/dist/Metrics/index.test.js +10 -4
- package/dist/Metrics/index.test.js.map +1 -1
- package/dist/Metrics/types.js +4 -1
- package/dist/Metrics/types.js.map +1 -1
- package/dist/SDKConnector/types.js.map +1 -1
- package/dist/Voicemail/BroadworksBackendConnector.js +154 -91
- package/dist/Voicemail/BroadworksBackendConnector.js.map +1 -1
- package/dist/Voicemail/BroadworksBackendConnector.test.js +99 -19
- package/dist/Voicemail/BroadworksBackendConnector.test.js.map +1 -1
- package/dist/Voicemail/UcmBackendConnector.js +105 -54
- package/dist/Voicemail/UcmBackendConnector.js.map +1 -1
- package/dist/Voicemail/UcmBackendConnector.test.js +127 -17
- package/dist/Voicemail/UcmBackendConnector.test.js.map +1 -1
- package/dist/Voicemail/Voicemail.js +198 -79
- package/dist/Voicemail/Voicemail.js.map +1 -1
- package/dist/Voicemail/Voicemail.test.js +188 -23
- package/dist/Voicemail/Voicemail.test.js.map +1 -1
- package/dist/Voicemail/WxCallBackendConnector.js +277 -161
- package/dist/Voicemail/WxCallBackendConnector.js.map +1 -1
- package/dist/Voicemail/WxCallBackendConnector.test.js +268 -10
- package/dist/Voicemail/WxCallBackendConnector.test.js.map +1 -1
- package/dist/Voicemail/constants.js +25 -1
- package/dist/Voicemail/constants.js.map +1 -1
- package/dist/Voicemail/types.js.map +1 -1
- package/dist/common/Utils.js +168 -104
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +199 -35
- package/dist/common/Utils.test.js.map +1 -1
- package/dist/common/constants.js +2 -1
- package/dist/common/constants.js.map +1 -1
- package/dist/common/testUtil.js +3 -0
- package/dist/common/testUtil.js.map +1 -1
- package/dist/common/types.js.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/module/CallHistory/CallHistory.js +32 -13
- package/dist/module/CallHistory/constants.js +6 -0
- package/dist/module/CallSettings/CallSettings.js +36 -3
- package/dist/module/CallSettings/UcmBackendConnector.js +50 -5
- package/dist/module/CallSettings/WxCallBackendConnector.js +54 -18
- package/dist/module/CallSettings/constants.js +12 -0
- package/dist/module/CallingClient/CallingClient.js +54 -16
- package/dist/module/CallingClient/calling/call.js +172 -121
- package/dist/module/CallingClient/calling/callManager.js +51 -26
- package/dist/module/CallingClient/constants.js +102 -2
- package/dist/module/CallingClient/line/index.js +37 -8
- package/dist/module/CallingClient/registration/register.js +103 -64
- package/dist/module/Contacts/ContactsClient.js +65 -21
- package/dist/module/Contacts/constants.js +10 -0
- package/dist/module/Errors/types.js +2 -0
- package/dist/module/Events/impl/index.js +1 -1
- package/dist/module/Metrics/index.js +57 -2
- package/dist/module/Metrics/types.js +3 -0
- package/dist/module/Voicemail/BroadworksBackendConnector.js +66 -17
- package/dist/module/Voicemail/UcmBackendConnector.js +51 -11
- package/dist/module/Voicemail/Voicemail.js +109 -9
- package/dist/module/Voicemail/WxCallBackendConnector.js +67 -18
- package/dist/module/Voicemail/constants.js +21 -0
- package/dist/module/common/Utils.js +51 -12
- package/dist/module/common/constants.js +1 -0
- package/dist/module/common/testUtil.js +3 -0
- package/dist/module/index.js +1 -0
- package/dist/types/CallHistory/CallHistory.d.ts.map +1 -1
- package/dist/types/CallHistory/constants.d.ts +6 -0
- package/dist/types/CallHistory/constants.d.ts.map +1 -1
- package/dist/types/CallSettings/CallSettings.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/constants.d.ts +12 -0
- package/dist/types/CallSettings/constants.d.ts.map +1 -1
- package/dist/types/CallingClient/CallingClient.d.ts +2 -3
- 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/callManager.d.ts.map +1 -1
- package/dist/types/CallingClient/constants.d.ts +102 -2
- 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 +3 -1
- package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/types.d.ts +1 -0
- package/dist/types/CallingClient/registration/types.d.ts.map +1 -1
- package/dist/types/Contacts/ContactsClient.d.ts.map +1 -1
- package/dist/types/Contacts/constants.d.ts +10 -0
- package/dist/types/Contacts/constants.d.ts.map +1 -1
- package/dist/types/Errors/types.d.ts +2 -0
- package/dist/types/Errors/types.d.ts.map +1 -1
- package/dist/types/Metrics/index.d.ts +1 -1
- package/dist/types/Metrics/index.d.ts.map +1 -1
- package/dist/types/Metrics/types.d.ts +7 -2
- package/dist/types/Metrics/types.d.ts.map +1 -1
- package/dist/types/SDKConnector/types.d.ts +11 -2
- package/dist/types/SDKConnector/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/Voicemail.d.ts +1 -1
- package/dist/types/Voicemail/Voicemail.d.ts.map +1 -1
- package/dist/types/Voicemail/WxCallBackendConnector.d.ts +3 -1
- package/dist/types/Voicemail/WxCallBackendConnector.d.ts.map +1 -1
- package/dist/types/Voicemail/constants.d.ts +21 -0
- package/dist/types/Voicemail/constants.d.ts.map +1 -1
- package/dist/types/Voicemail/types.d.ts +1 -1
- package/dist/types/Voicemail/types.d.ts.map +1 -1
- package/dist/types/common/Utils.d.ts +4 -4
- package/dist/types/common/Utils.d.ts.map +1 -1
- package/dist/types/common/constants.d.ts +1 -0
- package/dist/types/common/constants.d.ts.map +1 -1
- package/dist/types/common/testUtil.d.ts +3 -0
- package/dist/types/common/testUtil.d.ts.map +1 -1
- package/dist/types/common/types.d.ts +12 -0
- package/dist/types/common/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +4 -3
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { METHOD_START_MESSAGE } from '../common/constants';
|
|
1
2
|
import { getCallingBackEnd } from '../common/Utils';
|
|
2
3
|
import SDKConnector from '../SDKConnector';
|
|
3
4
|
import log from '../Logger';
|
|
4
5
|
import { CALLING_BACKEND } from '../common/types';
|
|
5
6
|
import { WxCallBackendConnector } from './WxCallBackendConnector';
|
|
6
|
-
import { CALL_SETTINGS_FILE } from './constants';
|
|
7
|
+
import { CALL_SETTINGS_FILE, METHODS } from './constants';
|
|
7
8
|
import { UcmBackendConnector } from './UcmBackendConnector';
|
|
8
9
|
export class CallSettings {
|
|
9
10
|
sdkConnector;
|
|
@@ -21,9 +22,9 @@ export class CallSettings {
|
|
|
21
22
|
}
|
|
22
23
|
initializeBackendConnector(logger, useProdWebexApis) {
|
|
23
24
|
this.callingBackend = getCallingBackEnd(this.webex);
|
|
24
|
-
log.info(
|
|
25
|
+
log.info(`${METHOD_START_MESSAGE} with ${this.callingBackend} backend`, {
|
|
25
26
|
file: CALL_SETTINGS_FILE,
|
|
26
|
-
method:
|
|
27
|
+
method: METHODS.INITIALIZE_BACKEND_CONNECTOR,
|
|
27
28
|
});
|
|
28
29
|
switch (this.callingBackend) {
|
|
29
30
|
case CALLING_BACKEND.BWRKS:
|
|
@@ -38,27 +39,59 @@ export class CallSettings {
|
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
async getCallWaitingSetting() {
|
|
42
|
+
log.info(METHOD_START_MESSAGE, {
|
|
43
|
+
file: CALL_SETTINGS_FILE,
|
|
44
|
+
method: METHODS.GET_CALL_WAITING_SETTING,
|
|
45
|
+
});
|
|
41
46
|
return this.backendConnector.getCallWaitingSetting();
|
|
42
47
|
}
|
|
43
48
|
async getDoNotDisturbSetting() {
|
|
49
|
+
log.info(METHOD_START_MESSAGE, {
|
|
50
|
+
file: CALL_SETTINGS_FILE,
|
|
51
|
+
method: METHODS.GET_DO_NOT_DISTURB_SETTING,
|
|
52
|
+
});
|
|
44
53
|
return this.backendConnector.getDoNotDisturbSetting();
|
|
45
54
|
}
|
|
46
55
|
async setDoNotDisturbSetting(enabled) {
|
|
56
|
+
log.info(METHOD_START_MESSAGE, {
|
|
57
|
+
file: CALL_SETTINGS_FILE,
|
|
58
|
+
method: METHODS.SET_DO_NOT_DISTURB_SETTING,
|
|
59
|
+
});
|
|
47
60
|
return this.backendConnector.setDoNotDisturbSetting(enabled);
|
|
48
61
|
}
|
|
49
62
|
async getCallForwardSetting() {
|
|
63
|
+
log.info(METHOD_START_MESSAGE, {
|
|
64
|
+
file: CALL_SETTINGS_FILE,
|
|
65
|
+
method: METHODS.GET_CALL_FORWARD_SETTING,
|
|
66
|
+
});
|
|
50
67
|
return this.backendConnector.getCallForwardSetting();
|
|
51
68
|
}
|
|
52
69
|
async setCallForwardSetting(callForwardingRequest) {
|
|
70
|
+
log.info(METHOD_START_MESSAGE, {
|
|
71
|
+
file: CALL_SETTINGS_FILE,
|
|
72
|
+
method: METHODS.SET_CALL_FORWARD_SETTING,
|
|
73
|
+
});
|
|
53
74
|
return this.backendConnector.setCallForwardSetting(callForwardingRequest);
|
|
54
75
|
}
|
|
55
76
|
async getVoicemailSetting() {
|
|
77
|
+
log.info(METHOD_START_MESSAGE, {
|
|
78
|
+
file: CALL_SETTINGS_FILE,
|
|
79
|
+
method: METHODS.GET_VOICEMAIL_SETTING,
|
|
80
|
+
});
|
|
56
81
|
return this.backendConnector.getVoicemailSetting();
|
|
57
82
|
}
|
|
58
83
|
async setVoicemailSetting(voicemailRequest) {
|
|
84
|
+
log.info(METHOD_START_MESSAGE, {
|
|
85
|
+
file: CALL_SETTINGS_FILE,
|
|
86
|
+
method: METHODS.SET_VOICEMAIL_SETTING,
|
|
87
|
+
});
|
|
59
88
|
return this.backendConnector.setVoicemailSetting(voicemailRequest);
|
|
60
89
|
}
|
|
61
90
|
async getCallForwardAlwaysSetting(directoryNumber) {
|
|
91
|
+
log.info(METHOD_START_MESSAGE, {
|
|
92
|
+
file: CALL_SETTINGS_FILE,
|
|
93
|
+
method: METHODS.GET_CALL_FORWARD_ALWAYS_SETTING,
|
|
94
|
+
});
|
|
62
95
|
return this.backendConnector.getCallForwardAlwaysSetting(directoryNumber);
|
|
63
96
|
}
|
|
64
97
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import log from '../Logger';
|
|
2
2
|
import SDKConnector from '../SDKConnector';
|
|
3
|
-
import { serviceErrorCodeHandler } from '../common/Utils';
|
|
4
|
-
import { FAILURE_MESSAGE, STATUS_CODE, SUCCESS_MESSAGE, UCM_CONNECTOR_FILE, VOICEMAIL, WEBEX_API_CONFIG_INT_URL, WEBEX_API_CONFIG_PROD_URL, } from '../common/constants';
|
|
3
|
+
import { serviceErrorCodeHandler, uploadLogs } from '../common/Utils';
|
|
4
|
+
import { FAILURE_MESSAGE, METHOD_START_MESSAGE, STATUS_CODE, SUCCESS_MESSAGE, UCM_CONNECTOR_FILE, VOICEMAIL, WEBEX_API_CONFIG_INT_URL, WEBEX_API_CONFIG_PROD_URL, } from '../common/constants';
|
|
5
5
|
import { HTTP_METHODS } from '../common/types';
|
|
6
|
-
import { CF_ENDPOINT, ORG_ENDPOINT, PEOPLE_ENDPOINT } from './constants';
|
|
6
|
+
import { CF_ENDPOINT, METHODS, ORG_ENDPOINT, PEOPLE_ENDPOINT } from './constants';
|
|
7
7
|
export class UcmBackendConnector {
|
|
8
8
|
sdkConnector;
|
|
9
9
|
webex;
|
|
@@ -22,35 +22,76 @@ export class UcmBackendConnector {
|
|
|
22
22
|
this.useProdWebexApis = useProdWebexApis;
|
|
23
23
|
}
|
|
24
24
|
getCallWaitingSetting() {
|
|
25
|
+
const loggerContext = {
|
|
26
|
+
file: UCM_CONNECTOR_FILE,
|
|
27
|
+
method: METHODS.GET_CALL_WAITING_SETTING,
|
|
28
|
+
};
|
|
29
|
+
log.info(METHOD_START_MESSAGE, loggerContext);
|
|
25
30
|
return this.getMethodNotSupportedResponse();
|
|
26
31
|
}
|
|
27
32
|
getDoNotDisturbSetting() {
|
|
33
|
+
const loggerContext = {
|
|
34
|
+
file: UCM_CONNECTOR_FILE,
|
|
35
|
+
method: METHODS.GET_DO_NOT_DISTURB_SETTING,
|
|
36
|
+
};
|
|
37
|
+
log.info(METHOD_START_MESSAGE, loggerContext);
|
|
28
38
|
return this.getMethodNotSupportedResponse();
|
|
29
39
|
}
|
|
30
40
|
setDoNotDisturbSetting() {
|
|
41
|
+
const loggerContext = {
|
|
42
|
+
file: UCM_CONNECTOR_FILE,
|
|
43
|
+
method: METHODS.SET_DO_NOT_DISTURB_SETTING,
|
|
44
|
+
};
|
|
45
|
+
log.info(METHOD_START_MESSAGE, loggerContext);
|
|
31
46
|
return this.getMethodNotSupportedResponse();
|
|
32
47
|
}
|
|
33
48
|
getCallForwardSetting() {
|
|
49
|
+
const loggerContext = {
|
|
50
|
+
file: UCM_CONNECTOR_FILE,
|
|
51
|
+
method: METHODS.GET_CALL_FORWARD_SETTING,
|
|
52
|
+
};
|
|
53
|
+
log.info(METHOD_START_MESSAGE, loggerContext);
|
|
34
54
|
return this.getMethodNotSupportedResponse();
|
|
35
55
|
}
|
|
36
56
|
setCallForwardSetting() {
|
|
57
|
+
const loggerContext = {
|
|
58
|
+
file: UCM_CONNECTOR_FILE,
|
|
59
|
+
method: METHODS.SET_CALL_FORWARD_SETTING,
|
|
60
|
+
};
|
|
61
|
+
log.info(METHOD_START_MESSAGE, loggerContext);
|
|
37
62
|
return this.getMethodNotSupportedResponse();
|
|
38
63
|
}
|
|
39
64
|
getVoicemailSetting() {
|
|
65
|
+
const loggerContext = {
|
|
66
|
+
file: UCM_CONNECTOR_FILE,
|
|
67
|
+
method: METHODS.GET_VOICEMAIL_SETTING,
|
|
68
|
+
};
|
|
69
|
+
log.info(METHOD_START_MESSAGE, loggerContext);
|
|
40
70
|
return this.getMethodNotSupportedResponse();
|
|
41
71
|
}
|
|
42
72
|
setVoicemailSetting() {
|
|
73
|
+
const loggerContext = {
|
|
74
|
+
file: UCM_CONNECTOR_FILE,
|
|
75
|
+
method: METHODS.SET_VOICEMAIL_SETTING,
|
|
76
|
+
};
|
|
77
|
+
log.info(METHOD_START_MESSAGE, loggerContext);
|
|
43
78
|
return this.getMethodNotSupportedResponse();
|
|
44
79
|
}
|
|
45
80
|
getMethodNotSupportedResponse() {
|
|
46
|
-
const
|
|
81
|
+
const loggerContext = {
|
|
82
|
+
file: UCM_CONNECTOR_FILE,
|
|
83
|
+
method: METHODS.GET_METHOD_NOT_SUPPORTED_RESPONSE,
|
|
84
|
+
};
|
|
85
|
+
log.info(METHOD_START_MESSAGE, loggerContext);
|
|
86
|
+
const response = serviceErrorCodeHandler({ statusCode: 501 }, loggerContext);
|
|
47
87
|
return Promise.resolve(response);
|
|
48
88
|
}
|
|
49
89
|
async getCallForwardAlwaysSetting(directoryNumber) {
|
|
50
90
|
const loggerContext = {
|
|
51
91
|
file: UCM_CONNECTOR_FILE,
|
|
52
|
-
method:
|
|
92
|
+
method: METHODS.GET_CALL_FORWARD_ALWAYS_SETTING,
|
|
53
93
|
};
|
|
94
|
+
log.info(directoryNumber ? `${METHOD_START_MESSAGE} with ${directoryNumber}` : METHOD_START_MESSAGE, loggerContext);
|
|
54
95
|
const webexApisUrl = this.useProdWebexApis
|
|
55
96
|
? WEBEX_API_CONFIG_PROD_URL
|
|
56
97
|
: WEBEX_API_CONFIG_INT_URL;
|
|
@@ -73,6 +114,7 @@ export class UcmBackendConnector {
|
|
|
73
114
|
},
|
|
74
115
|
},
|
|
75
116
|
};
|
|
117
|
+
log.log(`Successfully retrieved call forward always setting for directory number: ${directoryNumber}`, loggerContext);
|
|
76
118
|
return response;
|
|
77
119
|
}
|
|
78
120
|
const response = {
|
|
@@ -95,6 +137,9 @@ export class UcmBackendConnector {
|
|
|
95
137
|
}
|
|
96
138
|
catch (err) {
|
|
97
139
|
const errorInfo = err;
|
|
140
|
+
const extendedError = new Error(`Failed to get call forward always setting: ${err}`);
|
|
141
|
+
log.error(extendedError, loggerContext);
|
|
142
|
+
await uploadLogs();
|
|
98
143
|
const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);
|
|
99
144
|
return errorStatus;
|
|
100
145
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import SDKConnector from '../SDKConnector';
|
|
2
2
|
import log from '../Logger';
|
|
3
3
|
import { HTTP_METHODS, DecodeType, CALLING_BACKEND } from '../common/types';
|
|
4
|
-
import { SERVICES_ENDPOINT, STATUS_CODE, SUCCESS_MESSAGE, XML_TYPE, WEBEX_CALLING_CONNECTOR_FILE, } from '../common/constants';
|
|
5
|
-
import {
|
|
6
|
-
import { getXsiActionEndpoint, inferIdFromUuid, serviceErrorCodeHandler } from '../common/Utils';
|
|
4
|
+
import { SERVICES_ENDPOINT, STATUS_CODE, SUCCESS_MESSAGE, XML_TYPE, WEBEX_CALLING_CONNECTOR_FILE, METHOD_START_MESSAGE, } from '../common/constants';
|
|
5
|
+
import { CALL_WAITING_ENDPOINT, CF_ENDPOINT, DND_ENDPOINT, METHODS, ORG_ENDPOINT, PEOPLE_ENDPOINT, USER_ENDPOINT, VM_ENDPOINT, XSI_VERSION, } from './constants';
|
|
6
|
+
import { getXsiActionEndpoint, inferIdFromUuid, serviceErrorCodeHandler, uploadLogs, } from '../common/Utils';
|
|
7
7
|
export class WxCallBackendConnector {
|
|
8
8
|
sdkConnector;
|
|
9
9
|
webex;
|
|
@@ -27,9 +27,10 @@ export class WxCallBackendConnector {
|
|
|
27
27
|
}
|
|
28
28
|
async getCallWaitingSetting() {
|
|
29
29
|
const loggerContext = {
|
|
30
|
-
file:
|
|
31
|
-
method:
|
|
30
|
+
file: WEBEX_CALLING_CONNECTOR_FILE,
|
|
31
|
+
method: METHODS.GET_CALL_WAITING_SETTING,
|
|
32
32
|
};
|
|
33
|
+
log.info(METHOD_START_MESSAGE, loggerContext);
|
|
33
34
|
try {
|
|
34
35
|
if (!this.xsiEndpoint) {
|
|
35
36
|
this.xsiEndpoint = await getXsiActionEndpoint(this.webex, loggerContext, CALLING_BACKEND.WXC);
|
|
@@ -60,9 +61,13 @@ export class WxCallBackendConnector {
|
|
|
60
61
|
},
|
|
61
62
|
message: SUCCESS_MESSAGE,
|
|
62
63
|
};
|
|
64
|
+
log.log(`Successfully got Call Waiting settings, personId: ${this.personId}`, loggerContext);
|
|
63
65
|
return responseDetails;
|
|
64
66
|
}
|
|
65
67
|
catch (err) {
|
|
68
|
+
const extendedError = new Error(`Failed to get call waiting setting: ${err}`);
|
|
69
|
+
log.error(extendedError, loggerContext);
|
|
70
|
+
await uploadLogs();
|
|
66
71
|
const errorInfo = {
|
|
67
72
|
statusCode: err instanceof Error ? Number(err.message) : '',
|
|
68
73
|
};
|
|
@@ -72,9 +77,10 @@ export class WxCallBackendConnector {
|
|
|
72
77
|
}
|
|
73
78
|
async getDoNotDisturbSetting() {
|
|
74
79
|
const loggerContext = {
|
|
75
|
-
file:
|
|
76
|
-
method:
|
|
80
|
+
file: WEBEX_CALLING_CONNECTOR_FILE,
|
|
81
|
+
method: METHODS.GET_DO_NOT_DISTURB_SETTING,
|
|
77
82
|
};
|
|
83
|
+
log.info(METHOD_START_MESSAGE, loggerContext);
|
|
78
84
|
try {
|
|
79
85
|
const resp = await this.webex.request({
|
|
80
86
|
uri: `${this.hydraEndpoint}/${PEOPLE_ENDPOINT}/${this.personId}/${DND_ENDPOINT}?${ORG_ENDPOINT}=${this.orgId}`,
|
|
@@ -88,9 +94,13 @@ export class WxCallBackendConnector {
|
|
|
88
94
|
},
|
|
89
95
|
message: SUCCESS_MESSAGE,
|
|
90
96
|
};
|
|
97
|
+
log.log(`Successfully got Do Not Disturb settings, personId: ${this.personId}`, loggerContext);
|
|
91
98
|
return responseDetails;
|
|
92
99
|
}
|
|
93
100
|
catch (err) {
|
|
101
|
+
const extendedError = new Error(`Failed to get DoNotDisturb setting: ${err}`);
|
|
102
|
+
log.error(extendedError, loggerContext);
|
|
103
|
+
await uploadLogs();
|
|
94
104
|
const errorInfo = err;
|
|
95
105
|
const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);
|
|
96
106
|
return errorStatus;
|
|
@@ -98,9 +108,10 @@ export class WxCallBackendConnector {
|
|
|
98
108
|
}
|
|
99
109
|
async setDoNotDisturbSetting(enabled) {
|
|
100
110
|
const loggerContext = {
|
|
101
|
-
file:
|
|
102
|
-
method:
|
|
111
|
+
file: WEBEX_CALLING_CONNECTOR_FILE,
|
|
112
|
+
method: METHODS.SET_DO_NOT_DISTURB_SETTING,
|
|
103
113
|
};
|
|
114
|
+
log.info(METHOD_START_MESSAGE, loggerContext);
|
|
104
115
|
try {
|
|
105
116
|
const dndRequestBody = {
|
|
106
117
|
enabled,
|
|
@@ -118,9 +129,13 @@ export class WxCallBackendConnector {
|
|
|
118
129
|
},
|
|
119
130
|
message: SUCCESS_MESSAGE,
|
|
120
131
|
};
|
|
132
|
+
log.log(`Successfully set Do Not Disturb settings, personId: ${this.personId}`, loggerContext);
|
|
121
133
|
return responseDetails;
|
|
122
134
|
}
|
|
123
135
|
catch (err) {
|
|
136
|
+
const extendedError = new Error(`Failed to set DoNotDisturb setting: ${err}`);
|
|
137
|
+
log.error(extendedError, loggerContext);
|
|
138
|
+
await uploadLogs();
|
|
124
139
|
const errorInfo = err;
|
|
125
140
|
const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);
|
|
126
141
|
return errorStatus;
|
|
@@ -128,9 +143,10 @@ export class WxCallBackendConnector {
|
|
|
128
143
|
}
|
|
129
144
|
async getCallForwardSetting() {
|
|
130
145
|
const loggerContext = {
|
|
131
|
-
file:
|
|
132
|
-
method:
|
|
146
|
+
file: WEBEX_CALLING_CONNECTOR_FILE,
|
|
147
|
+
method: METHODS.GET_CALL_FORWARD_SETTING,
|
|
133
148
|
};
|
|
149
|
+
log.info(METHOD_START_MESSAGE, loggerContext);
|
|
134
150
|
try {
|
|
135
151
|
const resp = await this.webex.request({
|
|
136
152
|
uri: `${this.hydraEndpoint}/${PEOPLE_ENDPOINT}/${this.personId}/${CF_ENDPOINT}?${ORG_ENDPOINT}=${this.orgId}`,
|
|
@@ -144,9 +160,13 @@ export class WxCallBackendConnector {
|
|
|
144
160
|
},
|
|
145
161
|
message: SUCCESS_MESSAGE,
|
|
146
162
|
};
|
|
163
|
+
log.log(`Successfully got Call Forward settings, personId: ${this.personId}`, loggerContext);
|
|
147
164
|
return responseDetails;
|
|
148
165
|
}
|
|
149
166
|
catch (err) {
|
|
167
|
+
const extendedError = new Error(`Failed to get Call Forward setting: ${err}`);
|
|
168
|
+
log.error(extendedError, loggerContext);
|
|
169
|
+
await uploadLogs();
|
|
150
170
|
const errorInfo = err;
|
|
151
171
|
const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);
|
|
152
172
|
return errorStatus;
|
|
@@ -154,9 +174,10 @@ export class WxCallBackendConnector {
|
|
|
154
174
|
}
|
|
155
175
|
async setCallForwardSetting(callForwardingRequest) {
|
|
156
176
|
const loggerContext = {
|
|
157
|
-
file:
|
|
158
|
-
method:
|
|
177
|
+
file: WEBEX_CALLING_CONNECTOR_FILE,
|
|
178
|
+
method: METHODS.SET_CALL_FORWARD_SETTING,
|
|
159
179
|
};
|
|
180
|
+
log.info(METHOD_START_MESSAGE, loggerContext);
|
|
160
181
|
try {
|
|
161
182
|
const resp = await this.webex.request({
|
|
162
183
|
uri: `${this.hydraEndpoint}/${PEOPLE_ENDPOINT}/${this.personId}/${CF_ENDPOINT}?${ORG_ENDPOINT}=${this.orgId}`,
|
|
@@ -170,9 +191,13 @@ export class WxCallBackendConnector {
|
|
|
170
191
|
},
|
|
171
192
|
message: SUCCESS_MESSAGE,
|
|
172
193
|
};
|
|
194
|
+
log.log(`Successfully set Call Forward settings, personId: ${this.personId}`, loggerContext);
|
|
173
195
|
return responseDetails;
|
|
174
196
|
}
|
|
175
197
|
catch (err) {
|
|
198
|
+
const extendedError = new Error(`Failed to set Call Forward setting: ${err}`);
|
|
199
|
+
log.error(extendedError, loggerContext);
|
|
200
|
+
await uploadLogs();
|
|
176
201
|
const errorInfo = err;
|
|
177
202
|
const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);
|
|
178
203
|
return errorStatus;
|
|
@@ -180,9 +205,10 @@ export class WxCallBackendConnector {
|
|
|
180
205
|
}
|
|
181
206
|
async getVoicemailSetting() {
|
|
182
207
|
const loggerContext = {
|
|
183
|
-
file:
|
|
184
|
-
method:
|
|
208
|
+
file: WEBEX_CALLING_CONNECTOR_FILE,
|
|
209
|
+
method: METHODS.GET_VOICEMAIL_SETTING,
|
|
185
210
|
};
|
|
211
|
+
log.info(METHOD_START_MESSAGE, loggerContext);
|
|
186
212
|
try {
|
|
187
213
|
const resp = await this.webex.request({
|
|
188
214
|
uri: `${this.hydraEndpoint}/${PEOPLE_ENDPOINT}/${this.personId}/${VM_ENDPOINT}?${ORG_ENDPOINT}=${this.orgId}`,
|
|
@@ -196,9 +222,13 @@ export class WxCallBackendConnector {
|
|
|
196
222
|
},
|
|
197
223
|
message: SUCCESS_MESSAGE,
|
|
198
224
|
};
|
|
225
|
+
log.log(`Successfully got Voicemail settings, personId: ${this.personId}`, loggerContext);
|
|
199
226
|
return responseDetails;
|
|
200
227
|
}
|
|
201
228
|
catch (err) {
|
|
229
|
+
const extendedError = new Error(`Failed to get Voicemail setting: ${err}`);
|
|
230
|
+
log.error(extendedError, loggerContext);
|
|
231
|
+
await uploadLogs();
|
|
202
232
|
const errorInfo = err;
|
|
203
233
|
const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);
|
|
204
234
|
return errorStatus;
|
|
@@ -206,9 +236,10 @@ export class WxCallBackendConnector {
|
|
|
206
236
|
}
|
|
207
237
|
async setVoicemailSetting(voicemailRequest) {
|
|
208
238
|
const loggerContext = {
|
|
209
|
-
file:
|
|
210
|
-
method:
|
|
239
|
+
file: WEBEX_CALLING_CONNECTOR_FILE,
|
|
240
|
+
method: METHODS.SET_VOICEMAIL_SETTING,
|
|
211
241
|
};
|
|
242
|
+
log.info(METHOD_START_MESSAGE, loggerContext);
|
|
212
243
|
try {
|
|
213
244
|
const resp = await this.webex.request({
|
|
214
245
|
uri: `${this.hydraEndpoint}/${PEOPLE_ENDPOINT}/${this.personId}/${VM_ENDPOINT}?${ORG_ENDPOINT}=${this.orgId}`,
|
|
@@ -222,9 +253,13 @@ export class WxCallBackendConnector {
|
|
|
222
253
|
},
|
|
223
254
|
message: SUCCESS_MESSAGE,
|
|
224
255
|
};
|
|
256
|
+
log.log(`Successfully set Voicemail settings, personId: ${this.personId}`, loggerContext);
|
|
225
257
|
return responseDetails;
|
|
226
258
|
}
|
|
227
259
|
catch (err) {
|
|
260
|
+
const extendedError = new Error(`Failed to set Voicemail setting: ${err}`);
|
|
261
|
+
log.error(extendedError, loggerContext);
|
|
262
|
+
await uploadLogs();
|
|
228
263
|
const errorInfo = err;
|
|
229
264
|
const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);
|
|
230
265
|
return errorStatus;
|
|
@@ -233,8 +268,9 @@ export class WxCallBackendConnector {
|
|
|
233
268
|
async getCallForwardAlwaysSetting() {
|
|
234
269
|
const loggerContext = {
|
|
235
270
|
file: WEBEX_CALLING_CONNECTOR_FILE,
|
|
236
|
-
method:
|
|
271
|
+
method: METHODS.GET_CALL_FORWARD_ALWAYS_SETTING,
|
|
237
272
|
};
|
|
273
|
+
log.info(METHOD_START_MESSAGE, loggerContext);
|
|
238
274
|
const cfResponse = await this.getCallForwardSetting();
|
|
239
275
|
if (cfResponse.statusCode === 200) {
|
|
240
276
|
const cfa = cfResponse.data.callSetting.callForwarding.always;
|
|
@@ -7,3 +7,15 @@ export const CF_ENDPOINT = 'features/callForwarding';
|
|
|
7
7
|
export const VM_ENDPOINT = 'features/voicemail';
|
|
8
8
|
export const CALL_WAITING_ENDPOINT = 'CallWaiting';
|
|
9
9
|
export const XSI_VERSION = 'v2.0';
|
|
10
|
+
export const METHODS = {
|
|
11
|
+
INITIALIZE_BACKEND_CONNECTOR: 'initializeBackendConnector',
|
|
12
|
+
GET_CALL_WAITING_SETTING: 'getCallWaitingSetting',
|
|
13
|
+
GET_DO_NOT_DISTURB_SETTING: 'getDoNotDisturbSetting',
|
|
14
|
+
SET_DO_NOT_DISTURB_SETTING: 'setDoNotDisturbSetting',
|
|
15
|
+
GET_CALL_FORWARD_SETTING: 'getCallForwardSetting',
|
|
16
|
+
SET_CALL_FORWARD_SETTING: 'setCallForwardSetting',
|
|
17
|
+
GET_VOICEMAIL_SETTING: 'getVoicemailSetting',
|
|
18
|
+
SET_VOICEMAIL_SETTING: 'setVoicemailSetting',
|
|
19
|
+
GET_CALL_FORWARD_ALWAYS_SETTING: 'getCallForwardAlwaysSetting',
|
|
20
|
+
GET_METHOD_NOT_SUPPORTED_RESPONSE: 'getMethodNotSupportedResponse',
|
|
21
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Media from '@webex/internal-media-core';
|
|
2
2
|
import { Mutex } from 'async-mutex';
|
|
3
|
-
import {
|
|
3
|
+
import { METHOD_START_MESSAGE } from '../common/constants';
|
|
4
4
|
import { filterMobiusUris, handleCallingClientErrors, uploadLogs, validateServiceData, } from '../common/Utils';
|
|
5
5
|
import { LOGGER } from '../Logger/types';
|
|
6
6
|
import SDKConnector from '../SDKConnector';
|
|
@@ -9,7 +9,7 @@ import { MOBIUS_EVENT_KEYS, SessionType, CALLING_CLIENT_EVENT_KEYS, } from '../E
|
|
|
9
9
|
import { ServiceIndicator, ALLOWED_SERVICES, HTTP_METHODS, RegistrationStatus, } from '../common/types';
|
|
10
10
|
import log from '../Logger';
|
|
11
11
|
import { getCallManager } from './calling/callManager';
|
|
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, } from './constants';
|
|
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
14
|
import { METRIC_EVENT, REG_ACTION, METRIC_TYPE } from '../Metrics/types';
|
|
15
15
|
import { getMetricManager } from '../Metrics';
|
|
@@ -31,6 +31,10 @@ export class CallingClient extends Eventing {
|
|
|
31
31
|
this.sdkConnector = SDKConnector;
|
|
32
32
|
if (!this.sdkConnector.getWebex()) {
|
|
33
33
|
SDKConnector.setWebex(webex);
|
|
34
|
+
if (config?.logger?.level && webex.logger.config) {
|
|
35
|
+
webex.logger.config.level = config.logger.level;
|
|
36
|
+
}
|
|
37
|
+
log.setWebexLogger(webex.logger);
|
|
34
38
|
}
|
|
35
39
|
this.mutex = new Mutex();
|
|
36
40
|
this.webex = this.sdkConnector.getWebex();
|
|
@@ -81,6 +85,10 @@ export class CallingClient extends Eventing {
|
|
|
81
85
|
this.detectNetworkChange();
|
|
82
86
|
}
|
|
83
87
|
async detectNetworkChange() {
|
|
88
|
+
log.info(METHOD_START_MESSAGE, {
|
|
89
|
+
file: CALLING_CLIENT_FILE,
|
|
90
|
+
method: METHODS.DETECT_NETWORK_CHANGE,
|
|
91
|
+
});
|
|
84
92
|
let retry = false;
|
|
85
93
|
const line = Object.values(this.lineDict)[0];
|
|
86
94
|
setInterval(async () => {
|
|
@@ -89,7 +97,7 @@ export class CallingClient extends Eventing {
|
|
|
89
97
|
!Object.keys(this.callManager.getActiveCalls()).length) {
|
|
90
98
|
log.warn(`Network has flapped, waiting for mercury connection to be up`, {
|
|
91
99
|
file: CALLING_CLIENT_FILE,
|
|
92
|
-
method:
|
|
100
|
+
method: METHODS.DETECT_NETWORK_CHANGE,
|
|
93
101
|
});
|
|
94
102
|
line.registration.clearKeepaliveTimer();
|
|
95
103
|
retry = true;
|
|
@@ -105,6 +113,10 @@ export class CallingClient extends Eventing {
|
|
|
105
113
|
}, NETWORK_FLAP_TIMEOUT);
|
|
106
114
|
}
|
|
107
115
|
async getClientRegionInfo() {
|
|
116
|
+
log.info(METHOD_START_MESSAGE, {
|
|
117
|
+
file: CALLING_CLIENT_FILE,
|
|
118
|
+
method: METHODS.GET_CLIENT_REGION_INFO,
|
|
119
|
+
});
|
|
108
120
|
const regionInfo = {};
|
|
109
121
|
for (const mobius of this.mobiusClusters) {
|
|
110
122
|
this.mobiusHost = `https://${mobius.host}${API_V1}`;
|
|
@@ -135,8 +147,13 @@ export class CallingClient extends Eventing {
|
|
|
135
147
|
break;
|
|
136
148
|
}
|
|
137
149
|
catch (err) {
|
|
150
|
+
const extendedError = new Error(`Failed to get client region info: ${err}`);
|
|
151
|
+
log.error(extendedError, {
|
|
152
|
+
method: METHODS.GET_CLIENT_REGION_INFO,
|
|
153
|
+
file: CALLING_CLIENT_FILE,
|
|
154
|
+
});
|
|
138
155
|
handleCallingClientErrors(err, (clientError) => {
|
|
139
|
-
this.metricManager.submitRegistrationMetric(METRIC_EVENT.REGISTRATION_ERROR, REG_ACTION.REGISTER, METRIC_TYPE.BEHAVIORAL, clientError);
|
|
156
|
+
this.metricManager.submitRegistrationMetric(METRIC_EVENT.REGISTRATION_ERROR, REG_ACTION.REGISTER, METRIC_TYPE.BEHAVIORAL, GET_MOBIUS_SERVERS_UTIL, 'UNKNOWN', err.headers?.trackingId ?? '', undefined, clientError);
|
|
140
157
|
this.emit(CALLING_CLIENT_EVENT_KEYS.ERROR, clientError);
|
|
141
158
|
}, { method: GET_MOBIUS_SERVERS_UTIL, file: CALLING_CLIENT_FILE });
|
|
142
159
|
regionInfo.clientRegion = '';
|
|
@@ -146,11 +163,15 @@ export class CallingClient extends Eventing {
|
|
|
146
163
|
return regionInfo;
|
|
147
164
|
}
|
|
148
165
|
async getMobiusServers() {
|
|
166
|
+
log.info(METHOD_START_MESSAGE, {
|
|
167
|
+
file: CALLING_CLIENT_FILE,
|
|
168
|
+
method: METHODS.GET_MOBIUS_SERVERS,
|
|
169
|
+
});
|
|
149
170
|
let useDefault = false;
|
|
150
171
|
let clientRegion;
|
|
151
172
|
let countryCode;
|
|
152
173
|
if (this.sdkConfig?.discovery?.country && this.sdkConfig?.discovery?.region) {
|
|
153
|
-
log.
|
|
174
|
+
log.log('Updating region and country from the SDK config', {
|
|
154
175
|
file: CALLING_CLIENT_FILE,
|
|
155
176
|
method: GET_MOBIUS_SERVERS_UTIL,
|
|
156
177
|
});
|
|
@@ -159,7 +180,7 @@ export class CallingClient extends Eventing {
|
|
|
159
180
|
this.mobiusHost = this.webex.internal.services._serviceUrls.mobius;
|
|
160
181
|
}
|
|
161
182
|
else {
|
|
162
|
-
log.
|
|
183
|
+
log.log('Updating region and country through Region discovery', {
|
|
163
184
|
file: CALLING_CLIENT_FILE,
|
|
164
185
|
method: GET_MOBIUS_SERVERS_UTIL,
|
|
165
186
|
});
|
|
@@ -187,8 +208,13 @@ export class CallingClient extends Eventing {
|
|
|
187
208
|
log.info(`Final list of Mobius Servers, primary: ${mobiusUris.primary} and backup: ${mobiusUris.backup}`, '');
|
|
188
209
|
}
|
|
189
210
|
catch (err) {
|
|
211
|
+
const extendedError = new Error(`Failed to get Mobius servers: ${err}`);
|
|
212
|
+
log.error(extendedError, {
|
|
213
|
+
method: METHODS.GET_MOBIUS_SERVERS,
|
|
214
|
+
file: CALLING_CLIENT_FILE,
|
|
215
|
+
});
|
|
190
216
|
handleCallingClientErrors(err, (clientError) => {
|
|
191
|
-
this.metricManager.submitRegistrationMetric(METRIC_EVENT.REGISTRATION_ERROR, REG_ACTION.REGISTER, METRIC_TYPE.BEHAVIORAL, clientError);
|
|
217
|
+
this.metricManager.submitRegistrationMetric(METRIC_EVENT.REGISTRATION_ERROR, REG_ACTION.REGISTER, METRIC_TYPE.BEHAVIORAL, GET_MOBIUS_SERVERS_UTIL, 'UNKNOWN', err.headers?.trackingId ?? '', undefined, clientError);
|
|
192
218
|
this.emit(CALLING_CLIENT_EVENT_KEYS.ERROR, clientError);
|
|
193
219
|
}, { method: GET_MOBIUS_SERVERS_UTIL, file: CALLING_CLIENT_FILE });
|
|
194
220
|
useDefault = true;
|
|
@@ -204,19 +230,22 @@ export class CallingClient extends Eventing {
|
|
|
204
230
|
}
|
|
205
231
|
}
|
|
206
232
|
registerCallsClearedListener() {
|
|
207
|
-
|
|
233
|
+
log.info(METHOD_START_MESSAGE, {
|
|
208
234
|
file: CALLING_CLIENT_FILE,
|
|
209
|
-
method:
|
|
210
|
-
};
|
|
211
|
-
log.log('Registering listener for all calls cleared event', logContext);
|
|
235
|
+
method: METHODS.REGISTER_CALLS_CLEARED_LISTENER,
|
|
236
|
+
});
|
|
212
237
|
this.callManager.on(CALLING_CLIENT_EVENT_KEYS.ALL_CALLS_CLEARED, this.callsClearedHandler);
|
|
213
238
|
}
|
|
214
239
|
callsClearedHandler = async () => {
|
|
240
|
+
log.info(METHOD_START_MESSAGE, {
|
|
241
|
+
file: CALLING_CLIENT_FILE,
|
|
242
|
+
method: METHODS.CALLS_CLEARED_HANDLER,
|
|
243
|
+
});
|
|
215
244
|
const { registration } = Object.values(this.lineDict)[0];
|
|
216
245
|
if (!registration.isDeviceRegistered()) {
|
|
217
246
|
await this.mutex.runExclusive(async () => {
|
|
218
247
|
if (registration.isReconnectPending()) {
|
|
219
|
-
log.
|
|
248
|
+
log.info('All calls cleared, reconnecting', {
|
|
220
249
|
file: CALLING_CLIENT_FILE,
|
|
221
250
|
method: CALLS_CLEARED_HANDLER_UTIL,
|
|
222
251
|
});
|
|
@@ -232,6 +261,10 @@ export class CallingClient extends Eventing {
|
|
|
232
261
|
return this.sdkConnector;
|
|
233
262
|
}
|
|
234
263
|
registerSessionsListener() {
|
|
264
|
+
log.info(METHOD_START_MESSAGE, {
|
|
265
|
+
file: CALLING_CLIENT_FILE,
|
|
266
|
+
method: METHODS.REGISTER_SESSIONS_LISTENER,
|
|
267
|
+
});
|
|
235
268
|
this.sdkConnector.registerListener(MOBIUS_EVENT_KEYS.CALL_SESSION_EVENT_INCLUSIVE, async (event) => {
|
|
236
269
|
if (event && event.data.userSessions.userSessions) {
|
|
237
270
|
const sessionArr = event?.data.userSessions.userSessions;
|
|
@@ -250,6 +283,10 @@ export class CallingClient extends Eventing {
|
|
|
250
283
|
});
|
|
251
284
|
}
|
|
252
285
|
async createLine() {
|
|
286
|
+
log.info(METHOD_START_MESSAGE, {
|
|
287
|
+
file: CALLING_CLIENT_FILE,
|
|
288
|
+
method: METHODS.CREATE_LINE,
|
|
289
|
+
});
|
|
253
290
|
const line = new Line(this.webex.internal.device.userId, this.webex.internal.device.url, this.mutex, this.primaryMobiusUris, this.backupMobiusUris, this.getLoggingLevel(), this.sdkConfig?.serviceData, this.sdkConfig?.jwe);
|
|
254
291
|
this.lineDict[line.lineId] = line;
|
|
255
292
|
}
|
|
@@ -278,11 +315,12 @@ export class CallingClient extends Eventing {
|
|
|
278
315
|
});
|
|
279
316
|
return connectCall;
|
|
280
317
|
}
|
|
281
|
-
async uploadLogs(
|
|
282
|
-
|
|
283
|
-
|
|
318
|
+
async uploadLogs() {
|
|
319
|
+
const result = await uploadLogs({}, true);
|
|
320
|
+
if (!result) {
|
|
321
|
+
throw new Error('Failed to upload logs: No response received.');
|
|
284
322
|
}
|
|
285
|
-
return
|
|
323
|
+
return result;
|
|
286
324
|
}
|
|
287
325
|
}
|
|
288
326
|
export const createClient = async (webex, config) => {
|