@webex/calling 3.0.0-next.2 → 3.0.0-next.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1403 -0
- package/README.md +74 -74
- package/dist/module/CallHistory/CallHistory.js +81 -81
- package/dist/module/CallHistory/callHistoryFixtures.js +307 -307
- package/dist/module/CallHistory/constants.js +9 -9
- package/dist/module/CallHistory/types.js +1 -1
- package/dist/module/CallSettings/CallSettings.js +65 -65
- package/dist/module/CallSettings/UcmBackendConnector.js +100 -100
- package/dist/module/CallSettings/WxCallBackendConnector.js +287 -287
- package/dist/module/CallSettings/constants.js +11 -11
- package/dist/module/CallSettings/testFixtures.js +62 -62
- package/dist/module/CallSettings/types.js +1 -1
- package/dist/module/CallingClient/CallingClient.js +248 -248
- package/dist/module/CallingClient/callRecordFixtures.js +93 -93
- package/dist/module/CallingClient/calling/CallerId/index.js +169 -169
- package/dist/module/CallingClient/calling/CallerId/types.js +1 -1
- package/dist/module/CallingClient/calling/call.js +1658 -1658
- package/dist/module/CallingClient/calling/callManager.js +284 -284
- package/dist/module/CallingClient/calling/index.js +2 -2
- package/dist/module/CallingClient/calling/types.js +53 -53
- package/dist/module/CallingClient/callingClientFixtures.js +38 -38
- package/dist/module/CallingClient/constants.js +122 -122
- package/dist/module/CallingClient/line/index.js +158 -158
- package/dist/module/CallingClient/line/types.js +15 -15
- package/dist/module/CallingClient/registration/index.js +1 -1
- package/dist/module/CallingClient/registration/register.js +507 -507
- package/dist/module/CallingClient/registration/registerFixtures.js +28 -28
- package/dist/module/CallingClient/registration/types.js +1 -1
- package/dist/module/CallingClient/types.js +1 -1
- package/dist/module/Contacts/ContactsClient.js +484 -484
- package/dist/module/Contacts/constants.js +20 -20
- package/dist/module/Contacts/contactFixtures.js +284 -284
- package/dist/module/Contacts/types.js +10 -10
- package/dist/module/Errors/catalog/CallError.js +26 -26
- package/dist/module/Errors/catalog/CallingDeviceError.js +18 -18
- package/dist/module/Errors/catalog/ExtendedError.js +10 -10
- package/dist/module/Errors/catalog/LineError.js +24 -24
- package/dist/module/Errors/index.js +2 -2
- package/dist/module/Errors/types.js +48 -48
- package/dist/module/Events/impl/index.js +19 -19
- package/dist/module/Events/types.js +83 -83
- package/dist/module/Logger/index.js +114 -114
- package/dist/module/Logger/types.js +25 -25
- package/dist/module/Metrics/index.js +232 -232
- package/dist/module/Metrics/types.js +37 -37
- package/dist/module/SDKConnector/index.js +39 -39
- package/dist/module/SDKConnector/types.js +1 -1
- package/dist/module/SDKConnector/utils.js +12 -12
- package/dist/module/Voicemail/BroadworksBackendConnector.js +291 -291
- package/dist/module/Voicemail/UcmBackendConnector.js +279 -279
- package/dist/module/Voicemail/Voicemail.js +110 -110
- package/dist/module/Voicemail/WxCallBackendConnector.js +279 -279
- package/dist/module/Voicemail/constants.js +29 -29
- package/dist/module/Voicemail/types.js +1 -1
- package/dist/module/Voicemail/voicemailFixture.js +510 -510
- package/dist/module/api.js +6 -6
- package/dist/module/common/Utils.js +802 -802
- package/dist/module/common/constants.js +41 -41
- package/dist/module/common/index.js +1 -1
- package/dist/module/common/testUtil.js +938 -938
- package/dist/module/common/types.js +57 -57
- package/dist/module/index.js +8 -8
- package/dist/types/CallHistory/CallHistory.d.ts +17 -17
- package/dist/types/CallHistory/callHistoryFixtures.d.ts +94 -94
- package/dist/types/CallHistory/constants.d.ts +9 -9
- package/dist/types/CallHistory/types.d.ts +18 -18
- package/dist/types/CallSettings/CallSettings.d.ts +19 -19
- package/dist/types/CallSettings/UcmBackendConnector.d.ts +19 -19
- package/dist/types/CallSettings/WxCallBackendConnector.d.ts +21 -21
- package/dist/types/CallSettings/constants.d.ts +11 -11
- package/dist/types/CallSettings/testFixtures.d.ts +15 -15
- package/dist/types/CallSettings/types.d.ts +107 -107
- package/dist/types/CallingClient/CallingClient.d.ts +35 -35
- package/dist/types/CallingClient/callRecordFixtures.d.ts +3 -3
- package/dist/types/CallingClient/calling/CallerId/index.d.ts +17 -17
- package/dist/types/CallingClient/calling/CallerId/types.d.ts +41 -41
- package/dist/types/CallingClient/calling/call.d.ts +96 -96
- package/dist/types/CallingClient/calling/callManager.d.ts +25 -25
- package/dist/types/CallingClient/calling/index.d.ts +2 -2
- package/dist/types/CallingClient/calling/types.d.ts +206 -206
- package/dist/types/CallingClient/callingClientFixtures.d.ts +18 -18
- package/dist/types/CallingClient/constants.d.ts +122 -122
- package/dist/types/CallingClient/line/index.d.ts +43 -43
- package/dist/types/CallingClient/line/types.d.ts +55 -55
- package/dist/types/CallingClient/registration/index.d.ts +1 -1
- package/dist/types/CallingClient/registration/register.d.ts +64 -64
- package/dist/types/CallingClient/registration/registerFixtures.d.ts +28 -28
- package/dist/types/CallingClient/registration/types.d.ts +20 -20
- package/dist/types/CallingClient/types.d.ts +29 -29
- package/dist/types/Contacts/ContactsClient.d.ts +26 -26
- package/dist/types/Contacts/constants.d.ts +19 -19
- package/dist/types/Contacts/contactFixtures.d.ts +280 -280
- package/dist/types/Contacts/types.d.ts +72 -72
- package/dist/types/Errors/catalog/CallError.d.ts +11 -11
- package/dist/types/Errors/catalog/CallingDeviceError.d.ts +10 -10
- package/dist/types/Errors/catalog/ExtendedError.d.ts +6 -6
- package/dist/types/Errors/catalog/LineError.d.ts +10 -10
- package/dist/types/Errors/index.d.ts +2 -2
- package/dist/types/Errors/types.d.ts +60 -60
- package/dist/types/Events/impl/index.d.ts +8 -8
- package/dist/types/Events/types.d.ts +288 -288
- package/dist/types/Logger/index.d.ts +12 -12
- package/dist/types/Logger/types.d.ts +25 -25
- package/dist/types/Metrics/index.d.ts +5 -5
- package/dist/types/Metrics/types.d.ts +42 -42
- package/dist/types/SDKConnector/index.d.ts +12 -12
- package/dist/types/SDKConnector/types.d.ts +128 -128
- package/dist/types/SDKConnector/utils.d.ts +5 -5
- package/dist/types/Voicemail/BroadworksBackendConnector.d.ts +27 -27
- package/dist/types/Voicemail/UcmBackendConnector.d.ts +34 -34
- package/dist/types/Voicemail/Voicemail.d.ts +27 -27
- package/dist/types/Voicemail/WxCallBackendConnector.d.ts +23 -23
- package/dist/types/Voicemail/constants.d.ts +29 -29
- package/dist/types/Voicemail/types.d.ts +133 -133
- package/dist/types/Voicemail/voicemailFixture.d.ts +417 -417
- package/dist/types/api.d.ts +16 -16
- package/dist/types/common/Utils.d.ts +34 -34
- package/dist/types/common/constants.d.ts +41 -41
- package/dist/types/common/index.d.ts +1 -1
- package/dist/types/common/testUtil.d.ts +3611 -3611
- package/dist/types/common/types.d.ts +191 -191
- package/dist/types/index.d.ts +8 -8
- package/package.json +4 -4
- package/dist/CallHistory/CallHistory.js +0 -203
- package/dist/CallHistory/CallHistory.js.map +0 -1
- package/dist/CallHistory/CallHistory.test.js +0 -133
- package/dist/CallHistory/CallHistory.test.js.map +0 -1
- package/dist/CallHistory/callHistoryFixtures.js +0 -310
- package/dist/CallHistory/callHistoryFixtures.js.map +0 -1
- package/dist/CallHistory/constants.js +0 -26
- package/dist/CallHistory/constants.js.map +0 -1
- package/dist/CallHistory/types.js +0 -7
- package/dist/CallHistory/types.js.map +0 -1
- package/dist/CallSettings/CallSettings.js +0 -276
- package/dist/CallSettings/CallSettings.js.map +0 -1
- package/dist/CallSettings/CallSettings.test.js +0 -122
- package/dist/CallSettings/CallSettings.test.js.map +0 -1
- package/dist/CallSettings/UcmBackendConnector.js +0 -217
- package/dist/CallSettings/UcmBackendConnector.js.map +0 -1
- package/dist/CallSettings/UcmBackendConnector.test.js +0 -227
- package/dist/CallSettings/UcmBackendConnector.test.js.map +0 -1
- package/dist/CallSettings/WxCallBackendConnector.js +0 -541
- package/dist/CallSettings/WxCallBackendConnector.js.map +0 -1
- package/dist/CallSettings/WxCallBackendConnector.test.js +0 -802
- package/dist/CallSettings/WxCallBackendConnector.test.js.map +0 -1
- package/dist/CallSettings/constants.js +0 -30
- package/dist/CallSettings/constants.js.map +0 -1
- package/dist/CallSettings/testFixtures.js +0 -72
- package/dist/CallSettings/testFixtures.js.map +0 -1
- package/dist/CallSettings/types.js +0 -7
- package/dist/CallSettings/types.js.map +0 -1
- package/dist/CallingClient/CallingClient.js +0 -572
- package/dist/CallingClient/CallingClient.js.map +0 -1
- package/dist/CallingClient/CallingClient.test.js +0 -931
- package/dist/CallingClient/CallingClient.test.js.map +0 -1
- package/dist/CallingClient/callRecordFixtures.js +0 -103
- package/dist/CallingClient/callRecordFixtures.js.map +0 -1
- package/dist/CallingClient/calling/CallerId/index.js +0 -287
- package/dist/CallingClient/calling/CallerId/index.js.map +0 -1
- package/dist/CallingClient/calling/CallerId/index.test.js +0 -274
- package/dist/CallingClient/calling/CallerId/index.test.js.map +0 -1
- package/dist/CallingClient/calling/CallerId/types.js +0 -7
- package/dist/CallingClient/calling/CallerId/types.js.map +0 -1
- package/dist/CallingClient/calling/call.js +0 -2995
- package/dist/CallingClient/calling/call.js.map +0 -1
- package/dist/CallingClient/calling/call.test.js +0 -2614
- package/dist/CallingClient/calling/call.test.js.map +0 -1
- package/dist/CallingClient/calling/callManager.js +0 -443
- package/dist/CallingClient/calling/callManager.js.map +0 -1
- package/dist/CallingClient/calling/callManager.test.js +0 -683
- package/dist/CallingClient/calling/callManager.test.js.map +0 -1
- package/dist/CallingClient/calling/index.js +0 -30
- package/dist/CallingClient/calling/index.js.map +0 -1
- package/dist/CallingClient/calling/types.js +0 -71
- package/dist/CallingClient/calling/types.js.map +0 -1
- package/dist/CallingClient/callingClientFixtures.js +0 -53
- package/dist/CallingClient/callingClientFixtures.js.map +0 -1
- package/dist/CallingClient/constants.js +0 -226
- package/dist/CallingClient/constants.js.map +0 -1
- package/dist/CallingClient/line/index.js +0 -312
- package/dist/CallingClient/line/index.js.map +0 -1
- package/dist/CallingClient/line/line.test.js +0 -270
- package/dist/CallingClient/line/line.test.js.map +0 -1
- package/dist/CallingClient/line/types.js +0 -25
- package/dist/CallingClient/line/types.js.map +0 -1
- package/dist/CallingClient/registration/index.js +0 -19
- package/dist/CallingClient/registration/index.js.map +0 -1
- package/dist/CallingClient/registration/register.js +0 -1295
- package/dist/CallingClient/registration/register.js.map +0 -1
- package/dist/CallingClient/registration/register.test.js +0 -838
- package/dist/CallingClient/registration/register.test.js.map +0 -1
- package/dist/CallingClient/registration/registerFixtures.js +0 -41
- package/dist/CallingClient/registration/registerFixtures.js.map +0 -1
- package/dist/CallingClient/registration/types.js +0 -7
- package/dist/CallingClient/registration/types.js.map +0 -1
- package/dist/CallingClient/types.js +0 -7
- package/dist/CallingClient/types.js.map +0 -1
- package/dist/Contacts/ContactsClient.js +0 -1139
- package/dist/Contacts/ContactsClient.js.map +0 -1
- package/dist/Contacts/ContactsClient.test.js +0 -725
- package/dist/Contacts/ContactsClient.test.js.map +0 -1
- package/dist/Contacts/constants.js +0 -36
- package/dist/Contacts/constants.js.map +0 -1
- package/dist/Contacts/contactFixtures.js +0 -340
- package/dist/Contacts/contactFixtures.js.map +0 -1
- package/dist/Contacts/types.js +0 -20
- package/dist/Contacts/types.js.map +0 -1
- package/dist/Errors/catalog/CallError.js +0 -94
- package/dist/Errors/catalog/CallError.js.map +0 -1
- package/dist/Errors/catalog/CallingDeviceError.js +0 -88
- package/dist/Errors/catalog/CallingDeviceError.js.map +0 -1
- package/dist/Errors/catalog/ExtendedError.js +0 -45
- package/dist/Errors/catalog/ExtendedError.js.map +0 -1
- package/dist/Errors/catalog/LineError.js +0 -90
- package/dist/Errors/catalog/LineError.js.map +0 -1
- package/dist/Errors/index.js +0 -21
- package/dist/Errors/index.js.map +0 -1
- package/dist/Errors/types.js +0 -62
- package/dist/Errors/types.js.map +0 -1
- package/dist/Events/impl/index.js +0 -82
- package/dist/Events/impl/index.js.map +0 -1
- package/dist/Events/types.js +0 -111
- package/dist/Events/types.js.map +0 -1
- package/dist/Logger/index.js +0 -221
- package/dist/Logger/index.js.map +0 -1
- package/dist/Logger/index.test.js +0 -62
- package/dist/Logger/index.test.js.map +0 -1
- package/dist/Logger/types.js +0 -37
- package/dist/Logger/types.js.map +0 -1
- package/dist/Metrics/index.js +0 -329
- package/dist/Metrics/index.js.map +0 -1
- package/dist/Metrics/index.test.js +0 -291
- package/dist/Metrics/index.test.js.map +0 -1
- package/dist/Metrics/types.js +0 -50
- package/dist/Metrics/types.js.map +0 -1
- package/dist/SDKConnector/index.js +0 -105
- package/dist/SDKConnector/index.js.map +0 -1
- package/dist/SDKConnector/index.test.js +0 -9
- package/dist/SDKConnector/index.test.js.map +0 -1
- package/dist/SDKConnector/types.js +0 -7
- package/dist/SDKConnector/types.js.map +0 -1
- package/dist/SDKConnector/utils.js +0 -40
- package/dist/SDKConnector/utils.js.map +0 -1
- package/dist/SDKConnector/utils.test.js +0 -9
- package/dist/SDKConnector/utils.test.js.map +0 -1
- package/dist/Voicemail/BroadworksBackendConnector.js +0 -632
- package/dist/Voicemail/BroadworksBackendConnector.js.map +0 -1
- package/dist/Voicemail/BroadworksBackendConnector.test.js +0 -733
- package/dist/Voicemail/BroadworksBackendConnector.test.js.map +0 -1
- package/dist/Voicemail/UcmBackendConnector.js +0 -566
- package/dist/Voicemail/UcmBackendConnector.js.map +0 -1
- package/dist/Voicemail/UcmBackendConnector.test.js +0 -628
- package/dist/Voicemail/UcmBackendConnector.test.js.map +0 -1
- package/dist/Voicemail/Voicemail.js +0 -378
- package/dist/Voicemail/Voicemail.js.map +0 -1
- package/dist/Voicemail/Voicemail.test.js +0 -226
- package/dist/Voicemail/Voicemail.test.js.map +0 -1
- package/dist/Voicemail/WxCallBackendConnector.js +0 -540
- package/dist/Voicemail/WxCallBackendConnector.js.map +0 -1
- package/dist/Voicemail/WxCallBackendConnector.test.js +0 -942
- package/dist/Voicemail/WxCallBackendConnector.test.js.map +0 -1
- package/dist/Voicemail/constants.js +0 -66
- package/dist/Voicemail/constants.js.map +0 -1
- package/dist/Voicemail/types.js +0 -7
- package/dist/Voicemail/types.js.map +0 -1
- package/dist/Voicemail/voicemailFixture.js +0 -559
- package/dist/Voicemail/voicemailFixture.js.map +0 -1
- package/dist/api.js +0 -134
- package/dist/api.js.map +0 -1
- package/dist/common/Utils.js +0 -1264
- package/dist/common/Utils.js.map +0 -1
- package/dist/common/Utils.test.js +0 -1227
- package/dist/common/Utils.test.js.map +0 -1
- package/dist/common/constants.js +0 -90
- package/dist/common/constants.js.map +0 -1
- package/dist/common/index.js +0 -19
- package/dist/common/index.js.map +0 -1
- package/dist/common/testUtil.js +0 -968
- package/dist/common/testUtil.js.map +0 -1
- package/dist/common/types.js +0 -75
- package/dist/common/types.js.map +0 -1
- package/dist/index.js +0 -63
- package/dist/index.js.map +0 -1
|
@@ -1,287 +1,287 @@
|
|
|
1
|
-
import SDKConnector from '../SDKConnector';
|
|
2
|
-
import log from '../Logger';
|
|
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 { CALL_SETTINGS_FILE, CALL_WAITING_ENDPOINT, CF_ENDPOINT, DND_ENDPOINT, ORG_ENDPOINT, PEOPLE_ENDPOINT, USER_ENDPOINT, VM_ENDPOINT, XSI_VERSION, } from './constants';
|
|
6
|
-
import { getXsiActionEndpoint, inferIdFromUuid, serviceErrorCodeHandler } from '../common/Utils';
|
|
7
|
-
export class WxCallBackendConnector {
|
|
8
|
-
sdkConnector;
|
|
9
|
-
webex;
|
|
10
|
-
userId;
|
|
11
|
-
personId;
|
|
12
|
-
orgId;
|
|
13
|
-
xsiEndpoint;
|
|
14
|
-
hydraEndpoint;
|
|
15
|
-
VOICEMAIL = 'VOICEMAIL';
|
|
16
|
-
constructor(webex, logger) {
|
|
17
|
-
this.sdkConnector = SDKConnector;
|
|
18
|
-
if (!this.sdkConnector.getWebex()) {
|
|
19
|
-
SDKConnector.setWebex(webex);
|
|
20
|
-
}
|
|
21
|
-
this.webex = this.sdkConnector.getWebex();
|
|
22
|
-
this.hydraEndpoint = this.webex.internal.services._serviceUrls.hydra;
|
|
23
|
-
log.setLogger(logger.level, WEBEX_CALLING_CONNECTOR_FILE);
|
|
24
|
-
this.userId = this.webex.internal.device.userId;
|
|
25
|
-
this.personId = inferIdFromUuid(this.webex.internal.device.userId, DecodeType.PEOPLE);
|
|
26
|
-
this.orgId = inferIdFromUuid(this.webex.internal.device.orgId, DecodeType.ORGANIZATION);
|
|
27
|
-
}
|
|
28
|
-
async getCallWaitingSetting() {
|
|
29
|
-
const loggerContext = {
|
|
30
|
-
file: CALL_SETTINGS_FILE,
|
|
31
|
-
method: 'getCallWaitingSetting',
|
|
32
|
-
};
|
|
33
|
-
try {
|
|
34
|
-
if (!this.xsiEndpoint) {
|
|
35
|
-
this.xsiEndpoint = await getXsiActionEndpoint(this.webex, loggerContext, CALLING_BACKEND.WXC);
|
|
36
|
-
log.info(`xsiEndpoint: ${this.xsiEndpoint}`, loggerContext);
|
|
37
|
-
}
|
|
38
|
-
const callWaitingUrl = `${this.xsiEndpoint}/${XSI_VERSION}/${USER_ENDPOINT}/${this.userId}/${SERVICES_ENDPOINT}/${CALL_WAITING_ENDPOINT}`;
|
|
39
|
-
const response = await fetch(`${callWaitingUrl}`, {
|
|
40
|
-
method: HTTP_METHODS.GET,
|
|
41
|
-
headers: {
|
|
42
|
-
Authorization: await this.webex.credentials.getUserToken(),
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
if (!response.ok) {
|
|
46
|
-
throw new Error(`${response.status}`);
|
|
47
|
-
}
|
|
48
|
-
const xmlData = await response.text();
|
|
49
|
-
const parser = new DOMParser();
|
|
50
|
-
const xmlDOM = parser.parseFromString(xmlData, XML_TYPE);
|
|
51
|
-
const callWaitingDetails = xmlDOM.getElementsByTagName('active');
|
|
52
|
-
const status = callWaitingDetails[0].childNodes[0].textContent;
|
|
53
|
-
const toggleSetting = {
|
|
54
|
-
enabled: status === 'true',
|
|
55
|
-
};
|
|
56
|
-
const responseDetails = {
|
|
57
|
-
statusCode: 200,
|
|
58
|
-
data: {
|
|
59
|
-
callSetting: toggleSetting,
|
|
60
|
-
},
|
|
61
|
-
message: SUCCESS_MESSAGE,
|
|
62
|
-
};
|
|
63
|
-
return responseDetails;
|
|
64
|
-
}
|
|
65
|
-
catch (err) {
|
|
66
|
-
const errorInfo = {
|
|
67
|
-
statusCode: err instanceof Error ? Number(err.message) : '',
|
|
68
|
-
};
|
|
69
|
-
const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);
|
|
70
|
-
return errorStatus;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
async getDoNotDisturbSetting() {
|
|
74
|
-
const loggerContext = {
|
|
75
|
-
file: CALL_SETTINGS_FILE,
|
|
76
|
-
method: 'getDoNotDisturbSetting',
|
|
77
|
-
};
|
|
78
|
-
try {
|
|
79
|
-
const resp = await this.webex.request({
|
|
80
|
-
uri: `${this.hydraEndpoint}/${PEOPLE_ENDPOINT}/${this.personId}/${DND_ENDPOINT}?${ORG_ENDPOINT}=${this.orgId}`,
|
|
81
|
-
method: HTTP_METHODS.GET,
|
|
82
|
-
});
|
|
83
|
-
const dndSettingResponse = resp.body;
|
|
84
|
-
const responseDetails = {
|
|
85
|
-
statusCode: Number(resp[STATUS_CODE]),
|
|
86
|
-
data: {
|
|
87
|
-
callSetting: dndSettingResponse,
|
|
88
|
-
},
|
|
89
|
-
message: SUCCESS_MESSAGE,
|
|
90
|
-
};
|
|
91
|
-
return responseDetails;
|
|
92
|
-
}
|
|
93
|
-
catch (err) {
|
|
94
|
-
const errorInfo = err;
|
|
95
|
-
const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);
|
|
96
|
-
return errorStatus;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
async setDoNotDisturbSetting(enabled) {
|
|
100
|
-
const loggerContext = {
|
|
101
|
-
file: CALL_SETTINGS_FILE,
|
|
102
|
-
method: 'setDoNotDisturbSetting',
|
|
103
|
-
};
|
|
104
|
-
try {
|
|
105
|
-
const dndRequestBody = {
|
|
106
|
-
enabled,
|
|
107
|
-
ringSplashEnabled: false,
|
|
108
|
-
};
|
|
109
|
-
const resp = await this.webex.request({
|
|
110
|
-
uri: `${this.hydraEndpoint}/${PEOPLE_ENDPOINT}/${this.personId}/${DND_ENDPOINT}?${ORG_ENDPOINT}=${this.orgId}`,
|
|
111
|
-
method: HTTP_METHODS.PUT,
|
|
112
|
-
body: dndRequestBody,
|
|
113
|
-
});
|
|
114
|
-
const responseDetails = {
|
|
115
|
-
statusCode: Number(resp[STATUS_CODE]),
|
|
116
|
-
data: {
|
|
117
|
-
callSetting: dndRequestBody,
|
|
118
|
-
},
|
|
119
|
-
message: SUCCESS_MESSAGE,
|
|
120
|
-
};
|
|
121
|
-
return responseDetails;
|
|
122
|
-
}
|
|
123
|
-
catch (err) {
|
|
124
|
-
const errorInfo = err;
|
|
125
|
-
const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);
|
|
126
|
-
return errorStatus;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
async getCallForwardSetting() {
|
|
130
|
-
const loggerContext = {
|
|
131
|
-
file: CALL_SETTINGS_FILE,
|
|
132
|
-
method: 'getCallForwardingSetting',
|
|
133
|
-
};
|
|
134
|
-
try {
|
|
135
|
-
const resp = await this.webex.request({
|
|
136
|
-
uri: `${this.hydraEndpoint}/${PEOPLE_ENDPOINT}/${this.personId}/${CF_ENDPOINT}?${ORG_ENDPOINT}=${this.orgId}`,
|
|
137
|
-
method: HTTP_METHODS.GET,
|
|
138
|
-
});
|
|
139
|
-
const cfResponse = resp.body;
|
|
140
|
-
const responseDetails = {
|
|
141
|
-
statusCode: Number(resp[STATUS_CODE]),
|
|
142
|
-
data: {
|
|
143
|
-
callSetting: cfResponse,
|
|
144
|
-
},
|
|
145
|
-
message: SUCCESS_MESSAGE,
|
|
146
|
-
};
|
|
147
|
-
return responseDetails;
|
|
148
|
-
}
|
|
149
|
-
catch (err) {
|
|
150
|
-
const errorInfo = err;
|
|
151
|
-
const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);
|
|
152
|
-
return errorStatus;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
async setCallForwardSetting(callForwardingRequest) {
|
|
156
|
-
const loggerContext = {
|
|
157
|
-
file: CALL_SETTINGS_FILE,
|
|
158
|
-
method: 'setCallForwardingSetting',
|
|
159
|
-
};
|
|
160
|
-
try {
|
|
161
|
-
const resp = await this.webex.request({
|
|
162
|
-
uri: `${this.hydraEndpoint}/${PEOPLE_ENDPOINT}/${this.personId}/${CF_ENDPOINT}?${ORG_ENDPOINT}=${this.orgId}`,
|
|
163
|
-
method: HTTP_METHODS.PUT,
|
|
164
|
-
body: callForwardingRequest,
|
|
165
|
-
});
|
|
166
|
-
const responseDetails = {
|
|
167
|
-
statusCode: Number(resp[STATUS_CODE]),
|
|
168
|
-
data: {
|
|
169
|
-
callSetting: callForwardingRequest,
|
|
170
|
-
},
|
|
171
|
-
message: SUCCESS_MESSAGE,
|
|
172
|
-
};
|
|
173
|
-
return responseDetails;
|
|
174
|
-
}
|
|
175
|
-
catch (err) {
|
|
176
|
-
const errorInfo = err;
|
|
177
|
-
const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);
|
|
178
|
-
return errorStatus;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
async getVoicemailSetting() {
|
|
182
|
-
const loggerContext = {
|
|
183
|
-
file: CALL_SETTINGS_FILE,
|
|
184
|
-
method: 'getVoicemailSetting',
|
|
185
|
-
};
|
|
186
|
-
try {
|
|
187
|
-
const resp = await this.webex.request({
|
|
188
|
-
uri: `${this.hydraEndpoint}/${PEOPLE_ENDPOINT}/${this.personId}/${VM_ENDPOINT}?${ORG_ENDPOINT}=${this.orgId}`,
|
|
189
|
-
method: HTTP_METHODS.GET,
|
|
190
|
-
});
|
|
191
|
-
const vmResponse = resp.body;
|
|
192
|
-
const responseDetails = {
|
|
193
|
-
statusCode: Number(resp[STATUS_CODE]),
|
|
194
|
-
data: {
|
|
195
|
-
callSetting: vmResponse,
|
|
196
|
-
},
|
|
197
|
-
message: SUCCESS_MESSAGE,
|
|
198
|
-
};
|
|
199
|
-
return responseDetails;
|
|
200
|
-
}
|
|
201
|
-
catch (err) {
|
|
202
|
-
const errorInfo = err;
|
|
203
|
-
const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);
|
|
204
|
-
return errorStatus;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
async setVoicemailSetting(voicemailRequest) {
|
|
208
|
-
const loggerContext = {
|
|
209
|
-
file: CALL_SETTINGS_FILE,
|
|
210
|
-
method: 'setVoicemailSetting',
|
|
211
|
-
};
|
|
212
|
-
try {
|
|
213
|
-
const resp = await this.webex.request({
|
|
214
|
-
uri: `${this.hydraEndpoint}/${PEOPLE_ENDPOINT}/${this.personId}/${VM_ENDPOINT}?${ORG_ENDPOINT}=${this.orgId}`,
|
|
215
|
-
method: HTTP_METHODS.PUT,
|
|
216
|
-
body: voicemailRequest,
|
|
217
|
-
});
|
|
218
|
-
const responseDetails = {
|
|
219
|
-
statusCode: Number(resp[STATUS_CODE]),
|
|
220
|
-
data: {
|
|
221
|
-
callSetting: voicemailRequest,
|
|
222
|
-
},
|
|
223
|
-
message: SUCCESS_MESSAGE,
|
|
224
|
-
};
|
|
225
|
-
return responseDetails;
|
|
226
|
-
}
|
|
227
|
-
catch (err) {
|
|
228
|
-
const errorInfo = err;
|
|
229
|
-
const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);
|
|
230
|
-
return errorStatus;
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
async getCallForwardAlwaysSetting() {
|
|
234
|
-
const loggerContext = {
|
|
235
|
-
file: WEBEX_CALLING_CONNECTOR_FILE,
|
|
236
|
-
method: this.getCallForwardAlwaysSetting.name,
|
|
237
|
-
};
|
|
238
|
-
const cfResponse = await this.getCallForwardSetting();
|
|
239
|
-
if (cfResponse.statusCode === 200) {
|
|
240
|
-
const cfa = cfResponse.data.callSetting.callForwarding.always;
|
|
241
|
-
if (cfa.enabled) {
|
|
242
|
-
if (cfa.destination) {
|
|
243
|
-
const response = {
|
|
244
|
-
...cfResponse,
|
|
245
|
-
data: {
|
|
246
|
-
callSetting: cfa,
|
|
247
|
-
},
|
|
248
|
-
};
|
|
249
|
-
return response;
|
|
250
|
-
}
|
|
251
|
-
log.warn(`CFA is enabled, but destination is not set`, loggerContext);
|
|
252
|
-
}
|
|
253
|
-
const vmResponse = await this.getVoicemailSetting();
|
|
254
|
-
if (vmResponse.statusCode === 200) {
|
|
255
|
-
const vm = vmResponse.data.callSetting;
|
|
256
|
-
if (vm.enabled && vm.sendAllCalls.enabled) {
|
|
257
|
-
const response = {
|
|
258
|
-
...cfResponse,
|
|
259
|
-
data: {
|
|
260
|
-
callSetting: {
|
|
261
|
-
...cfa,
|
|
262
|
-
enabled: true,
|
|
263
|
-
destination: this.VOICEMAIL,
|
|
264
|
-
},
|
|
265
|
-
},
|
|
266
|
-
};
|
|
267
|
-
return response;
|
|
268
|
-
}
|
|
269
|
-
const response = {
|
|
270
|
-
...cfResponse,
|
|
271
|
-
data: {
|
|
272
|
-
callSetting: {
|
|
273
|
-
...cfa,
|
|
274
|
-
enabled: false,
|
|
275
|
-
destination: undefined,
|
|
276
|
-
},
|
|
277
|
-
},
|
|
278
|
-
};
|
|
279
|
-
return response;
|
|
280
|
-
}
|
|
281
|
-
log.warn(`Unable to retrieve voicemail settings.`, loggerContext);
|
|
282
|
-
vmResponse.data.error = 'Unable to retrieve voicemail settings.';
|
|
283
|
-
return vmResponse;
|
|
284
|
-
}
|
|
285
|
-
return cfResponse;
|
|
286
|
-
}
|
|
287
|
-
}
|
|
1
|
+
import SDKConnector from '../SDKConnector';
|
|
2
|
+
import log from '../Logger';
|
|
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 { CALL_SETTINGS_FILE, CALL_WAITING_ENDPOINT, CF_ENDPOINT, DND_ENDPOINT, ORG_ENDPOINT, PEOPLE_ENDPOINT, USER_ENDPOINT, VM_ENDPOINT, XSI_VERSION, } from './constants';
|
|
6
|
+
import { getXsiActionEndpoint, inferIdFromUuid, serviceErrorCodeHandler } from '../common/Utils';
|
|
7
|
+
export class WxCallBackendConnector {
|
|
8
|
+
sdkConnector;
|
|
9
|
+
webex;
|
|
10
|
+
userId;
|
|
11
|
+
personId;
|
|
12
|
+
orgId;
|
|
13
|
+
xsiEndpoint;
|
|
14
|
+
hydraEndpoint;
|
|
15
|
+
VOICEMAIL = 'VOICEMAIL';
|
|
16
|
+
constructor(webex, logger) {
|
|
17
|
+
this.sdkConnector = SDKConnector;
|
|
18
|
+
if (!this.sdkConnector.getWebex()) {
|
|
19
|
+
SDKConnector.setWebex(webex);
|
|
20
|
+
}
|
|
21
|
+
this.webex = this.sdkConnector.getWebex();
|
|
22
|
+
this.hydraEndpoint = this.webex.internal.services._serviceUrls.hydra;
|
|
23
|
+
log.setLogger(logger.level, WEBEX_CALLING_CONNECTOR_FILE);
|
|
24
|
+
this.userId = this.webex.internal.device.userId;
|
|
25
|
+
this.personId = inferIdFromUuid(this.webex.internal.device.userId, DecodeType.PEOPLE);
|
|
26
|
+
this.orgId = inferIdFromUuid(this.webex.internal.device.orgId, DecodeType.ORGANIZATION);
|
|
27
|
+
}
|
|
28
|
+
async getCallWaitingSetting() {
|
|
29
|
+
const loggerContext = {
|
|
30
|
+
file: CALL_SETTINGS_FILE,
|
|
31
|
+
method: 'getCallWaitingSetting',
|
|
32
|
+
};
|
|
33
|
+
try {
|
|
34
|
+
if (!this.xsiEndpoint) {
|
|
35
|
+
this.xsiEndpoint = await getXsiActionEndpoint(this.webex, loggerContext, CALLING_BACKEND.WXC);
|
|
36
|
+
log.info(`xsiEndpoint: ${this.xsiEndpoint}`, loggerContext);
|
|
37
|
+
}
|
|
38
|
+
const callWaitingUrl = `${this.xsiEndpoint}/${XSI_VERSION}/${USER_ENDPOINT}/${this.userId}/${SERVICES_ENDPOINT}/${CALL_WAITING_ENDPOINT}`;
|
|
39
|
+
const response = await fetch(`${callWaitingUrl}`, {
|
|
40
|
+
method: HTTP_METHODS.GET,
|
|
41
|
+
headers: {
|
|
42
|
+
Authorization: await this.webex.credentials.getUserToken(),
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
if (!response.ok) {
|
|
46
|
+
throw new Error(`${response.status}`);
|
|
47
|
+
}
|
|
48
|
+
const xmlData = await response.text();
|
|
49
|
+
const parser = new DOMParser();
|
|
50
|
+
const xmlDOM = parser.parseFromString(xmlData, XML_TYPE);
|
|
51
|
+
const callWaitingDetails = xmlDOM.getElementsByTagName('active');
|
|
52
|
+
const status = callWaitingDetails[0].childNodes[0].textContent;
|
|
53
|
+
const toggleSetting = {
|
|
54
|
+
enabled: status === 'true',
|
|
55
|
+
};
|
|
56
|
+
const responseDetails = {
|
|
57
|
+
statusCode: 200,
|
|
58
|
+
data: {
|
|
59
|
+
callSetting: toggleSetting,
|
|
60
|
+
},
|
|
61
|
+
message: SUCCESS_MESSAGE,
|
|
62
|
+
};
|
|
63
|
+
return responseDetails;
|
|
64
|
+
}
|
|
65
|
+
catch (err) {
|
|
66
|
+
const errorInfo = {
|
|
67
|
+
statusCode: err instanceof Error ? Number(err.message) : '',
|
|
68
|
+
};
|
|
69
|
+
const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);
|
|
70
|
+
return errorStatus;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
async getDoNotDisturbSetting() {
|
|
74
|
+
const loggerContext = {
|
|
75
|
+
file: CALL_SETTINGS_FILE,
|
|
76
|
+
method: 'getDoNotDisturbSetting',
|
|
77
|
+
};
|
|
78
|
+
try {
|
|
79
|
+
const resp = await this.webex.request({
|
|
80
|
+
uri: `${this.hydraEndpoint}/${PEOPLE_ENDPOINT}/${this.personId}/${DND_ENDPOINT}?${ORG_ENDPOINT}=${this.orgId}`,
|
|
81
|
+
method: HTTP_METHODS.GET,
|
|
82
|
+
});
|
|
83
|
+
const dndSettingResponse = resp.body;
|
|
84
|
+
const responseDetails = {
|
|
85
|
+
statusCode: Number(resp[STATUS_CODE]),
|
|
86
|
+
data: {
|
|
87
|
+
callSetting: dndSettingResponse,
|
|
88
|
+
},
|
|
89
|
+
message: SUCCESS_MESSAGE,
|
|
90
|
+
};
|
|
91
|
+
return responseDetails;
|
|
92
|
+
}
|
|
93
|
+
catch (err) {
|
|
94
|
+
const errorInfo = err;
|
|
95
|
+
const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);
|
|
96
|
+
return errorStatus;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
async setDoNotDisturbSetting(enabled) {
|
|
100
|
+
const loggerContext = {
|
|
101
|
+
file: CALL_SETTINGS_FILE,
|
|
102
|
+
method: 'setDoNotDisturbSetting',
|
|
103
|
+
};
|
|
104
|
+
try {
|
|
105
|
+
const dndRequestBody = {
|
|
106
|
+
enabled,
|
|
107
|
+
ringSplashEnabled: false,
|
|
108
|
+
};
|
|
109
|
+
const resp = await this.webex.request({
|
|
110
|
+
uri: `${this.hydraEndpoint}/${PEOPLE_ENDPOINT}/${this.personId}/${DND_ENDPOINT}?${ORG_ENDPOINT}=${this.orgId}`,
|
|
111
|
+
method: HTTP_METHODS.PUT,
|
|
112
|
+
body: dndRequestBody,
|
|
113
|
+
});
|
|
114
|
+
const responseDetails = {
|
|
115
|
+
statusCode: Number(resp[STATUS_CODE]),
|
|
116
|
+
data: {
|
|
117
|
+
callSetting: dndRequestBody,
|
|
118
|
+
},
|
|
119
|
+
message: SUCCESS_MESSAGE,
|
|
120
|
+
};
|
|
121
|
+
return responseDetails;
|
|
122
|
+
}
|
|
123
|
+
catch (err) {
|
|
124
|
+
const errorInfo = err;
|
|
125
|
+
const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);
|
|
126
|
+
return errorStatus;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
async getCallForwardSetting() {
|
|
130
|
+
const loggerContext = {
|
|
131
|
+
file: CALL_SETTINGS_FILE,
|
|
132
|
+
method: 'getCallForwardingSetting',
|
|
133
|
+
};
|
|
134
|
+
try {
|
|
135
|
+
const resp = await this.webex.request({
|
|
136
|
+
uri: `${this.hydraEndpoint}/${PEOPLE_ENDPOINT}/${this.personId}/${CF_ENDPOINT}?${ORG_ENDPOINT}=${this.orgId}`,
|
|
137
|
+
method: HTTP_METHODS.GET,
|
|
138
|
+
});
|
|
139
|
+
const cfResponse = resp.body;
|
|
140
|
+
const responseDetails = {
|
|
141
|
+
statusCode: Number(resp[STATUS_CODE]),
|
|
142
|
+
data: {
|
|
143
|
+
callSetting: cfResponse,
|
|
144
|
+
},
|
|
145
|
+
message: SUCCESS_MESSAGE,
|
|
146
|
+
};
|
|
147
|
+
return responseDetails;
|
|
148
|
+
}
|
|
149
|
+
catch (err) {
|
|
150
|
+
const errorInfo = err;
|
|
151
|
+
const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);
|
|
152
|
+
return errorStatus;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
async setCallForwardSetting(callForwardingRequest) {
|
|
156
|
+
const loggerContext = {
|
|
157
|
+
file: CALL_SETTINGS_FILE,
|
|
158
|
+
method: 'setCallForwardingSetting',
|
|
159
|
+
};
|
|
160
|
+
try {
|
|
161
|
+
const resp = await this.webex.request({
|
|
162
|
+
uri: `${this.hydraEndpoint}/${PEOPLE_ENDPOINT}/${this.personId}/${CF_ENDPOINT}?${ORG_ENDPOINT}=${this.orgId}`,
|
|
163
|
+
method: HTTP_METHODS.PUT,
|
|
164
|
+
body: callForwardingRequest,
|
|
165
|
+
});
|
|
166
|
+
const responseDetails = {
|
|
167
|
+
statusCode: Number(resp[STATUS_CODE]),
|
|
168
|
+
data: {
|
|
169
|
+
callSetting: callForwardingRequest,
|
|
170
|
+
},
|
|
171
|
+
message: SUCCESS_MESSAGE,
|
|
172
|
+
};
|
|
173
|
+
return responseDetails;
|
|
174
|
+
}
|
|
175
|
+
catch (err) {
|
|
176
|
+
const errorInfo = err;
|
|
177
|
+
const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);
|
|
178
|
+
return errorStatus;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
async getVoicemailSetting() {
|
|
182
|
+
const loggerContext = {
|
|
183
|
+
file: CALL_SETTINGS_FILE,
|
|
184
|
+
method: 'getVoicemailSetting',
|
|
185
|
+
};
|
|
186
|
+
try {
|
|
187
|
+
const resp = await this.webex.request({
|
|
188
|
+
uri: `${this.hydraEndpoint}/${PEOPLE_ENDPOINT}/${this.personId}/${VM_ENDPOINT}?${ORG_ENDPOINT}=${this.orgId}`,
|
|
189
|
+
method: HTTP_METHODS.GET,
|
|
190
|
+
});
|
|
191
|
+
const vmResponse = resp.body;
|
|
192
|
+
const responseDetails = {
|
|
193
|
+
statusCode: Number(resp[STATUS_CODE]),
|
|
194
|
+
data: {
|
|
195
|
+
callSetting: vmResponse,
|
|
196
|
+
},
|
|
197
|
+
message: SUCCESS_MESSAGE,
|
|
198
|
+
};
|
|
199
|
+
return responseDetails;
|
|
200
|
+
}
|
|
201
|
+
catch (err) {
|
|
202
|
+
const errorInfo = err;
|
|
203
|
+
const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);
|
|
204
|
+
return errorStatus;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
async setVoicemailSetting(voicemailRequest) {
|
|
208
|
+
const loggerContext = {
|
|
209
|
+
file: CALL_SETTINGS_FILE,
|
|
210
|
+
method: 'setVoicemailSetting',
|
|
211
|
+
};
|
|
212
|
+
try {
|
|
213
|
+
const resp = await this.webex.request({
|
|
214
|
+
uri: `${this.hydraEndpoint}/${PEOPLE_ENDPOINT}/${this.personId}/${VM_ENDPOINT}?${ORG_ENDPOINT}=${this.orgId}`,
|
|
215
|
+
method: HTTP_METHODS.PUT,
|
|
216
|
+
body: voicemailRequest,
|
|
217
|
+
});
|
|
218
|
+
const responseDetails = {
|
|
219
|
+
statusCode: Number(resp[STATUS_CODE]),
|
|
220
|
+
data: {
|
|
221
|
+
callSetting: voicemailRequest,
|
|
222
|
+
},
|
|
223
|
+
message: SUCCESS_MESSAGE,
|
|
224
|
+
};
|
|
225
|
+
return responseDetails;
|
|
226
|
+
}
|
|
227
|
+
catch (err) {
|
|
228
|
+
const errorInfo = err;
|
|
229
|
+
const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);
|
|
230
|
+
return errorStatus;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
async getCallForwardAlwaysSetting() {
|
|
234
|
+
const loggerContext = {
|
|
235
|
+
file: WEBEX_CALLING_CONNECTOR_FILE,
|
|
236
|
+
method: this.getCallForwardAlwaysSetting.name,
|
|
237
|
+
};
|
|
238
|
+
const cfResponse = await this.getCallForwardSetting();
|
|
239
|
+
if (cfResponse.statusCode === 200) {
|
|
240
|
+
const cfa = cfResponse.data.callSetting.callForwarding.always;
|
|
241
|
+
if (cfa.enabled) {
|
|
242
|
+
if (cfa.destination) {
|
|
243
|
+
const response = {
|
|
244
|
+
...cfResponse,
|
|
245
|
+
data: {
|
|
246
|
+
callSetting: cfa,
|
|
247
|
+
},
|
|
248
|
+
};
|
|
249
|
+
return response;
|
|
250
|
+
}
|
|
251
|
+
log.warn(`CFA is enabled, but destination is not set`, loggerContext);
|
|
252
|
+
}
|
|
253
|
+
const vmResponse = await this.getVoicemailSetting();
|
|
254
|
+
if (vmResponse.statusCode === 200) {
|
|
255
|
+
const vm = vmResponse.data.callSetting;
|
|
256
|
+
if (vm.enabled && vm.sendAllCalls.enabled) {
|
|
257
|
+
const response = {
|
|
258
|
+
...cfResponse,
|
|
259
|
+
data: {
|
|
260
|
+
callSetting: {
|
|
261
|
+
...cfa,
|
|
262
|
+
enabled: true,
|
|
263
|
+
destination: this.VOICEMAIL,
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
};
|
|
267
|
+
return response;
|
|
268
|
+
}
|
|
269
|
+
const response = {
|
|
270
|
+
...cfResponse,
|
|
271
|
+
data: {
|
|
272
|
+
callSetting: {
|
|
273
|
+
...cfa,
|
|
274
|
+
enabled: false,
|
|
275
|
+
destination: undefined,
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
};
|
|
279
|
+
return response;
|
|
280
|
+
}
|
|
281
|
+
log.warn(`Unable to retrieve voicemail settings.`, loggerContext);
|
|
282
|
+
vmResponse.data.error = 'Unable to retrieve voicemail settings.';
|
|
283
|
+
return vmResponse;
|
|
284
|
+
}
|
|
285
|
+
return cfResponse;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export const CALL_SETTINGS_FILE = 'CallSettings';
|
|
2
|
-
export const PEOPLE_ENDPOINT = 'people';
|
|
3
|
-
export const USER_ENDPOINT = 'user';
|
|
4
|
-
export const ORG_ENDPOINT = 'orgId';
|
|
5
|
-
export const DND_ENDPOINT = 'features/doNotDisturb';
|
|
6
|
-
export const CF_ENDPOINT = 'features/callForwarding';
|
|
7
|
-
export const VM_ENDPOINT = 'features/voicemail';
|
|
8
|
-
export const CALL_WAITING_ENDPOINT = 'CallWaiting';
|
|
9
|
-
export const XSI_VERSION = 'v2.0';
|
|
10
|
-
export const WEBEX_APIS_INT_URL = 'https://integration.webexapis.com/v1/uc/config';
|
|
11
|
-
export const WEBEX_APIS_PROD_URL = 'https://webexapis.com/v1/uc/config';
|
|
1
|
+
export const CALL_SETTINGS_FILE = 'CallSettings';
|
|
2
|
+
export const PEOPLE_ENDPOINT = 'people';
|
|
3
|
+
export const USER_ENDPOINT = 'user';
|
|
4
|
+
export const ORG_ENDPOINT = 'orgId';
|
|
5
|
+
export const DND_ENDPOINT = 'features/doNotDisturb';
|
|
6
|
+
export const CF_ENDPOINT = 'features/callForwarding';
|
|
7
|
+
export const VM_ENDPOINT = 'features/voicemail';
|
|
8
|
+
export const CALL_WAITING_ENDPOINT = 'CallWaiting';
|
|
9
|
+
export const XSI_VERSION = 'v2.0';
|
|
10
|
+
export const WEBEX_APIS_INT_URL = 'https://integration.webexapis.com/v1/uc/config';
|
|
11
|
+
export const WEBEX_APIS_PROD_URL = 'https://webexapis.com/v1/uc/config';
|