@webex/calling 3.0.0-next.4 → 3.0.0-next.5
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 -1403
- 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 +2 -2
package/README.md
CHANGED
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
### Table of Contents
|
|
2
|
-
- [Getting Started](#getting-started)
|
|
3
|
-
- [Developing](#developing)
|
|
4
|
-
- [Building](#building)
|
|
5
|
-
- [Testing](#testing)
|
|
6
|
-
- [Samples](#samples)
|
|
7
|
-
- [Consuming SDK](#consuming-sdk)
|
|
8
|
-
- [NPM](#npm)
|
|
9
|
-
- [CDN](#cdn)
|
|
10
|
-
- [Kitchen Sink App](#kitchen-sink-app)
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## Getting Started
|
|
14
|
-
With the Webex Calling SDK, you can effortlessly integrate fundamental audio calling capabilities into your solutions, enhancing the way your users connect.
|
|
15
|
-
|
|
16
|
-
- [Introduction to the Webex Web Calling SDK](https://github.com/webex/webex-js-sdk/wiki/Introducing-the-Webex-Web-Calling-SDK)
|
|
17
|
-
- [Quickstart guide](https://github.com/webex/webex-js-sdk/wiki/Quickstart-Guide-(Calling)).
|
|
18
|
-
|
|
19
|
-
## Developing
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
git clone https://github.com/\<your-fork\>/webex-js-sdk.git
|
|
23
|
-
cd web-js-sdk/
|
|
24
|
-
yarn install
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Building
|
|
28
|
-
|
|
29
|
-
If your project needs some additional steps for the developer to build the
|
|
30
|
-
project after some code changes, state them here:
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
yarn workspaces foreach --parallel --verbose run build:src
|
|
34
|
-
|
|
35
|
-
yarn build:local
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
## Testing
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
yarn workspace @webex/calling run test
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## Samples
|
|
45
|
-
```bash
|
|
46
|
-
yarn run samples:serve
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## Consuming SDK
|
|
50
|
-
To consume the latest stable version of the Calling SDK one can use NPM or CDN.
|
|
51
|
-
# NPM
|
|
52
|
-
```javascript
|
|
53
|
-
npm install @webex/calling
|
|
54
|
-
```
|
|
55
|
-
(or)
|
|
56
|
-
|
|
57
|
-
```javascript
|
|
58
|
-
yarn add @webex/calling
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
```javascript
|
|
62
|
-
import Calling from '@webex/calling'
|
|
63
|
-
```
|
|
64
|
-
# CDN
|
|
65
|
-
```javascript
|
|
66
|
-
<script src="../calling.min.js"></script>
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
### Kitchen Sink App
|
|
70
|
-
To test Calling SDK API, use this Kitchen Sink app: https://webex.github.io/webex-js-sdk/samples/calling/
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
1
|
+
### Table of Contents
|
|
2
|
+
- [Getting Started](#getting-started)
|
|
3
|
+
- [Developing](#developing)
|
|
4
|
+
- [Building](#building)
|
|
5
|
+
- [Testing](#testing)
|
|
6
|
+
- [Samples](#samples)
|
|
7
|
+
- [Consuming SDK](#consuming-sdk)
|
|
8
|
+
- [NPM](#npm)
|
|
9
|
+
- [CDN](#cdn)
|
|
10
|
+
- [Kitchen Sink App](#kitchen-sink-app)
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Getting Started
|
|
14
|
+
With the Webex Calling SDK, you can effortlessly integrate fundamental audio calling capabilities into your solutions, enhancing the way your users connect.
|
|
15
|
+
|
|
16
|
+
- [Introduction to the Webex Web Calling SDK](https://github.com/webex/webex-js-sdk/wiki/Introducing-the-Webex-Web-Calling-SDK)
|
|
17
|
+
- [Quickstart guide](https://github.com/webex/webex-js-sdk/wiki/Quickstart-Guide-(Calling)).
|
|
18
|
+
|
|
19
|
+
## Developing
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
git clone https://github.com/\<your-fork\>/webex-js-sdk.git
|
|
23
|
+
cd web-js-sdk/
|
|
24
|
+
yarn install
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Building
|
|
28
|
+
|
|
29
|
+
If your project needs some additional steps for the developer to build the
|
|
30
|
+
project after some code changes, state them here:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
yarn workspaces foreach --parallel --verbose run build:src
|
|
34
|
+
|
|
35
|
+
yarn build:local
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Testing
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
yarn workspace @webex/calling run test
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Samples
|
|
45
|
+
```bash
|
|
46
|
+
yarn run samples:serve
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Consuming SDK
|
|
50
|
+
To consume the latest stable version of the Calling SDK one can use NPM or CDN.
|
|
51
|
+
# NPM
|
|
52
|
+
```javascript
|
|
53
|
+
npm install @webex/calling
|
|
54
|
+
```
|
|
55
|
+
(or)
|
|
56
|
+
|
|
57
|
+
```javascript
|
|
58
|
+
yarn add @webex/calling
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
```javascript
|
|
62
|
+
import Calling from '@webex/calling'
|
|
63
|
+
```
|
|
64
|
+
# CDN
|
|
65
|
+
```javascript
|
|
66
|
+
<script src="../calling.min.js"></script>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Kitchen Sink App
|
|
70
|
+
To test Calling SDK API, use this Kitchen Sink app: https://webex.github.io/webex-js-sdk/samples/calling/
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
import SDKConnector from '../SDKConnector';
|
|
2
|
-
import { ALLOWED_SERVICES, HTTP_METHODS, SORT, SORT_BY } from '../common/types';
|
|
3
|
-
import log from '../Logger';
|
|
4
|
-
import { serviceErrorCodeHandler } from '../common/Utils';
|
|
5
|
-
import { CALL_HISTORY_FILE, FROM_DATE, HISTORY, LIMIT, NUMBER_OF_DAYS } from './constants';
|
|
6
|
-
import { STATUS_CODE, SUCCESS_MESSAGE, USER_SESSIONS } from '../common/constants';
|
|
7
|
-
import { COMMON_EVENT_KEYS, MOBIUS_EVENT_KEYS, } from '../Events/types';
|
|
8
|
-
import { Eventing } from '../Events/impl';
|
|
9
|
-
export class CallHistory extends Eventing {
|
|
10
|
-
sdkConnector;
|
|
11
|
-
webex;
|
|
12
|
-
janusUrl = '';
|
|
13
|
-
fromDate = '';
|
|
14
|
-
loggerContext = {
|
|
15
|
-
file: CALL_HISTORY_FILE,
|
|
16
|
-
method: 'getCallHistoryData',
|
|
17
|
-
};
|
|
18
|
-
userSessions;
|
|
19
|
-
constructor(webex, logger) {
|
|
20
|
-
super();
|
|
21
|
-
this.sdkConnector = SDKConnector;
|
|
22
|
-
if (!this.sdkConnector.getWebex()) {
|
|
23
|
-
SDKConnector.setWebex(webex);
|
|
24
|
-
}
|
|
25
|
-
this.webex = this.sdkConnector.getWebex();
|
|
26
|
-
this.janusUrl = this.webex.internal.services._serviceUrls.janus;
|
|
27
|
-
this.registerSessionsListener();
|
|
28
|
-
log.setLogger(logger.level, CALL_HISTORY_FILE);
|
|
29
|
-
}
|
|
30
|
-
async getCallHistoryData(days = NUMBER_OF_DAYS, limit = LIMIT, sort = SORT.DEFAULT, sortBy = SORT_BY.DEFAULT) {
|
|
31
|
-
const date = new Date();
|
|
32
|
-
date.setDate(date.getDate() - days);
|
|
33
|
-
this.fromDate = date.toISOString();
|
|
34
|
-
const sortByParam = Object.values(SORT_BY).includes(sortBy) ? sortBy : SORT_BY.DEFAULT;
|
|
35
|
-
const sortParam = Object.values(SORT).includes(sort) ? sort : SORT.DEFAULT;
|
|
36
|
-
log.log(`Janus API URL ${this.janusUrl}`, this.loggerContext);
|
|
37
|
-
log.info(`Call history from date : ${this.fromDate}`, this.loggerContext);
|
|
38
|
-
log.info(`Call history sort type : ${sortParam}`, this.loggerContext);
|
|
39
|
-
log.info(`Call history sortby type : ${sortByParam}`, this.loggerContext);
|
|
40
|
-
const url = `${this.janusUrl}/${HISTORY}/${USER_SESSIONS}${FROM_DATE}=${this.fromDate}&limit=${limit}&includeNewSessionTypes=true&sort=${sortParam}`;
|
|
41
|
-
try {
|
|
42
|
-
const janusResponse = await this.webex.request({
|
|
43
|
-
uri: `${url}`,
|
|
44
|
-
method: HTTP_METHODS.GET,
|
|
45
|
-
service: ALLOWED_SERVICES.JANUS,
|
|
46
|
-
});
|
|
47
|
-
this.userSessions = janusResponse.body;
|
|
48
|
-
if (sortByParam === SORT_BY.START_TIME) {
|
|
49
|
-
if (sortParam === SORT.DESC) {
|
|
50
|
-
this.userSessions[USER_SESSIONS].sort((element, compareElement) => new Date(compareElement[sortByParam]).getTime() -
|
|
51
|
-
new Date(element[sortByParam]).getTime());
|
|
52
|
-
}
|
|
53
|
-
else if (sortParam === SORT.ASC) {
|
|
54
|
-
this.userSessions[USER_SESSIONS].sort((element, compareElement) => new Date(element[sortByParam]).getTime() -
|
|
55
|
-
new Date(compareElement[sortByParam]).getTime());
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
const responseDetails = {
|
|
59
|
-
statusCode: this.userSessions[STATUS_CODE],
|
|
60
|
-
data: {
|
|
61
|
-
userSessions: this.userSessions[USER_SESSIONS],
|
|
62
|
-
},
|
|
63
|
-
message: SUCCESS_MESSAGE,
|
|
64
|
-
};
|
|
65
|
-
return responseDetails;
|
|
66
|
-
}
|
|
67
|
-
catch (err) {
|
|
68
|
-
const errorInfo = err;
|
|
69
|
-
const errorStatus = serviceErrorCodeHandler(errorInfo, this.loggerContext);
|
|
70
|
-
return errorStatus;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
registerSessionsListener() {
|
|
74
|
-
this.sdkConnector.registerListener(MOBIUS_EVENT_KEYS.CALL_SESSION_EVENT_INCLUSIVE, async (event) => {
|
|
75
|
-
if (event && event.data.userSessions.userSessions) {
|
|
76
|
-
this.emit(COMMON_EVENT_KEYS.CALL_HISTORY_USER_SESSION_INFO, event);
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
export const createCallHistoryClient = (webex, logger) => new CallHistory(webex, logger);
|
|
1
|
+
import SDKConnector from '../SDKConnector';
|
|
2
|
+
import { ALLOWED_SERVICES, HTTP_METHODS, SORT, SORT_BY } from '../common/types';
|
|
3
|
+
import log from '../Logger';
|
|
4
|
+
import { serviceErrorCodeHandler } from '../common/Utils';
|
|
5
|
+
import { CALL_HISTORY_FILE, FROM_DATE, HISTORY, LIMIT, NUMBER_OF_DAYS } from './constants';
|
|
6
|
+
import { STATUS_CODE, SUCCESS_MESSAGE, USER_SESSIONS } from '../common/constants';
|
|
7
|
+
import { COMMON_EVENT_KEYS, MOBIUS_EVENT_KEYS, } from '../Events/types';
|
|
8
|
+
import { Eventing } from '../Events/impl';
|
|
9
|
+
export class CallHistory extends Eventing {
|
|
10
|
+
sdkConnector;
|
|
11
|
+
webex;
|
|
12
|
+
janusUrl = '';
|
|
13
|
+
fromDate = '';
|
|
14
|
+
loggerContext = {
|
|
15
|
+
file: CALL_HISTORY_FILE,
|
|
16
|
+
method: 'getCallHistoryData',
|
|
17
|
+
};
|
|
18
|
+
userSessions;
|
|
19
|
+
constructor(webex, logger) {
|
|
20
|
+
super();
|
|
21
|
+
this.sdkConnector = SDKConnector;
|
|
22
|
+
if (!this.sdkConnector.getWebex()) {
|
|
23
|
+
SDKConnector.setWebex(webex);
|
|
24
|
+
}
|
|
25
|
+
this.webex = this.sdkConnector.getWebex();
|
|
26
|
+
this.janusUrl = this.webex.internal.services._serviceUrls.janus;
|
|
27
|
+
this.registerSessionsListener();
|
|
28
|
+
log.setLogger(logger.level, CALL_HISTORY_FILE);
|
|
29
|
+
}
|
|
30
|
+
async getCallHistoryData(days = NUMBER_OF_DAYS, limit = LIMIT, sort = SORT.DEFAULT, sortBy = SORT_BY.DEFAULT) {
|
|
31
|
+
const date = new Date();
|
|
32
|
+
date.setDate(date.getDate() - days);
|
|
33
|
+
this.fromDate = date.toISOString();
|
|
34
|
+
const sortByParam = Object.values(SORT_BY).includes(sortBy) ? sortBy : SORT_BY.DEFAULT;
|
|
35
|
+
const sortParam = Object.values(SORT).includes(sort) ? sort : SORT.DEFAULT;
|
|
36
|
+
log.log(`Janus API URL ${this.janusUrl}`, this.loggerContext);
|
|
37
|
+
log.info(`Call history from date : ${this.fromDate}`, this.loggerContext);
|
|
38
|
+
log.info(`Call history sort type : ${sortParam}`, this.loggerContext);
|
|
39
|
+
log.info(`Call history sortby type : ${sortByParam}`, this.loggerContext);
|
|
40
|
+
const url = `${this.janusUrl}/${HISTORY}/${USER_SESSIONS}${FROM_DATE}=${this.fromDate}&limit=${limit}&includeNewSessionTypes=true&sort=${sortParam}`;
|
|
41
|
+
try {
|
|
42
|
+
const janusResponse = await this.webex.request({
|
|
43
|
+
uri: `${url}`,
|
|
44
|
+
method: HTTP_METHODS.GET,
|
|
45
|
+
service: ALLOWED_SERVICES.JANUS,
|
|
46
|
+
});
|
|
47
|
+
this.userSessions = janusResponse.body;
|
|
48
|
+
if (sortByParam === SORT_BY.START_TIME) {
|
|
49
|
+
if (sortParam === SORT.DESC) {
|
|
50
|
+
this.userSessions[USER_SESSIONS].sort((element, compareElement) => new Date(compareElement[sortByParam]).getTime() -
|
|
51
|
+
new Date(element[sortByParam]).getTime());
|
|
52
|
+
}
|
|
53
|
+
else if (sortParam === SORT.ASC) {
|
|
54
|
+
this.userSessions[USER_SESSIONS].sort((element, compareElement) => new Date(element[sortByParam]).getTime() -
|
|
55
|
+
new Date(compareElement[sortByParam]).getTime());
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const responseDetails = {
|
|
59
|
+
statusCode: this.userSessions[STATUS_CODE],
|
|
60
|
+
data: {
|
|
61
|
+
userSessions: this.userSessions[USER_SESSIONS],
|
|
62
|
+
},
|
|
63
|
+
message: SUCCESS_MESSAGE,
|
|
64
|
+
};
|
|
65
|
+
return responseDetails;
|
|
66
|
+
}
|
|
67
|
+
catch (err) {
|
|
68
|
+
const errorInfo = err;
|
|
69
|
+
const errorStatus = serviceErrorCodeHandler(errorInfo, this.loggerContext);
|
|
70
|
+
return errorStatus;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
registerSessionsListener() {
|
|
74
|
+
this.sdkConnector.registerListener(MOBIUS_EVENT_KEYS.CALL_SESSION_EVENT_INCLUSIVE, async (event) => {
|
|
75
|
+
if (event && event.data.userSessions.userSessions) {
|
|
76
|
+
this.emit(COMMON_EVENT_KEYS.CALL_HISTORY_USER_SESSION_INFO, event);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
export const createCallHistoryClient = (webex, logger) => new CallHistory(webex, logger);
|