@wazo/sdk 0.37.0 → 0.37.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/dist/wazo-sdk.js +5 -5
- package/esm/__tests__/api-client.test.js +91 -23
- package/esm/__tests__/web-rtc-client.test.js +165 -56
- package/esm/api/agentd.js +7 -1
- package/esm/api/amid.js +7 -1
- package/esm/api/application.js +7 -1
- package/esm/api/auth.js +7 -1
- package/esm/api/call-logd.js +17 -23
- package/esm/api/calld.js +10 -18
- package/esm/api/chatd.js +7 -1
- package/esm/api/confd.js +78 -1
- package/esm/api/ctid-ng.js +7 -1
- package/esm/api/dird.js +7 -1
- package/esm/api/webhookd.js +7 -1
- package/esm/api-client.js +91 -23
- package/esm/checker/Checker.js +169 -56
- package/esm/checker/checks/aor.js +91 -23
- package/esm/checker/checks/api.js +91 -23
- package/esm/checker/checks/index.js +169 -56
- package/esm/checker/checks/wazo-websocket.js +11 -1
- package/esm/checker/checks/webrtc-transport.js +165 -56
- package/esm/checker/checks/webrtc.js +165 -56
- package/esm/domain/AdHocAPIConference.js +1722 -1654
- package/esm/domain/CallLog.js +10 -22
- package/esm/domain/CallSession.js +1 -18
- package/esm/domain/Features.js +91 -23
- package/esm/domain/IndirectTransfer.js +0 -17
- package/esm/domain/Meeting.js +71 -0
- package/esm/domain/Phone/CTIPhone.js +98 -26
- package/esm/domain/Phone/Phone.js +0 -17
- package/esm/domain/Phone/WebRTCPhone.js +47 -27
- package/esm/domain/Room.js +0 -17
- package/esm/domain/SwitchboardCall.js +0 -17
- package/esm/domain/__tests__/CallLog.test.js +10 -22
- package/esm/domain/__tests__/CallSession.test.js +1 -18
- package/esm/domain/__tests__/IndirectTransfer.test.js +1 -18
- package/esm/domain/__tests__/Room.test.js +1 -18
- package/esm/index.js +3880 -3111
- package/esm/lib/WazoSessionDescriptionHandler.js +24 -10
- package/esm/service/CallApi.js +91 -23
- package/esm/service/IssueReporter.js +7 -1
- package/esm/service/__tests__/IssueReporter.test.js +9 -1
- package/esm/service/getApiClient.js +91 -23
- package/esm/simple/Auth.js +1126 -360
- package/esm/simple/Configuration.js +1126 -360
- package/esm/simple/Directory.js +91 -23
- package/esm/simple/Phone.js +3724 -2958
- package/esm/simple/Websocket.js +13 -1
- package/esm/simple/index.js +1128 -362
- package/esm/simple/room/LocalParticipant.js +1097 -331
- package/esm/simple/room/Participant.js +1097 -331
- package/esm/simple/room/RemoteParticipant.js +1097 -331
- package/esm/simple/room/Room.js +1097 -331
- package/esm/simple/room/SipRoom.js +12996 -0
- package/esm/simple/room/Stream.js +1128 -362
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +5157 -4389
- package/esm/simple/utils.js +1128 -362
- package/esm/utils/__tests__/api-requester.test.js +7 -1
- package/esm/utils/api-requester.js +7 -1
- package/esm/web-rtc-client.js +165 -56
- package/esm/websocket-client.js +12 -2
- package/lib/__tests__/api-client.test.js +91 -23
- package/lib/__tests__/web-rtc-client.test.js +165 -56
- package/lib/api/agentd.js +7 -1
- package/lib/api/amid.js +7 -1
- package/lib/api/application.js +7 -1
- package/lib/api/auth.js +7 -1
- package/lib/api/call-logd.js +17 -23
- package/lib/api/calld.js +10 -18
- package/lib/api/chatd.js +7 -1
- package/lib/api/confd.js +78 -1
- package/lib/api/ctid-ng.js +7 -1
- package/lib/api/dird.js +7 -1
- package/lib/api/webhookd.js +7 -1
- package/lib/api-client.js +91 -23
- package/lib/checker/Checker.js +169 -56
- package/lib/checker/checks/aor.js +91 -23
- package/lib/checker/checks/api.js +91 -23
- package/lib/checker/checks/index.js +169 -56
- package/lib/checker/checks/wazo-websocket.js +11 -1
- package/lib/checker/checks/webrtc-transport.js +165 -56
- package/lib/checker/checks/webrtc.js +165 -56
- package/lib/domain/AdHocAPIConference.js +1722 -1654
- package/lib/domain/CallLog.js +10 -22
- package/lib/domain/CallSession.js +1 -18
- package/lib/domain/Features.js +91 -23
- package/lib/domain/IndirectTransfer.js +0 -17
- package/lib/domain/Meeting.js +73 -0
- package/lib/domain/Phone/CTIPhone.js +98 -26
- package/lib/domain/Phone/Phone.js +0 -16
- package/lib/domain/Phone/WebRTCPhone.js +47 -27
- package/lib/domain/Room.js +0 -17
- package/lib/domain/SwitchboardCall.js +0 -17
- package/lib/domain/__tests__/CallLog.test.js +10 -22
- package/lib/domain/__tests__/CallSession.test.js +1 -18
- package/lib/domain/__tests__/IndirectTransfer.test.js +1 -18
- package/lib/domain/__tests__/Room.test.js +1 -18
- package/lib/index.js +3880 -3111
- package/lib/lib/WazoSessionDescriptionHandler.js +24 -10
- package/lib/service/CallApi.js +91 -23
- package/lib/service/IssueReporter.js +7 -1
- package/lib/service/__tests__/IssueReporter.test.js +9 -1
- package/lib/service/getApiClient.js +91 -23
- package/lib/simple/Auth.js +1126 -360
- package/lib/simple/Configuration.js +1126 -360
- package/lib/simple/Directory.js +91 -23
- package/lib/simple/Phone.js +3724 -2958
- package/lib/simple/Websocket.js +13 -1
- package/lib/simple/index.js +1128 -362
- package/lib/simple/room/LocalParticipant.js +1097 -331
- package/lib/simple/room/Participant.js +1097 -331
- package/lib/simple/room/RemoteParticipant.js +1097 -331
- package/lib/simple/room/Room.js +1097 -331
- package/lib/simple/room/SipRoom.js +13006 -0
- package/lib/simple/room/Stream.js +1128 -362
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +5157 -4389
- package/lib/simple/utils.js +1128 -362
- package/lib/utils/__tests__/api-requester.test.js +7 -1
- package/lib/utils/api-requester.js +7 -1
- package/lib/web-rtc-client.js +165 -56
- package/lib/websocket-client.js +13 -1
- package/package.json +1 -1
- package/src/api/calld.js +3 -0
- package/src/api/confd.js +13 -0
- package/src/domain/CallLog.js +10 -22
- package/src/domain/CallSession.js +1 -2
- package/src/domain/Meeting.js +59 -0
- package/src/domain/Phone/CTIPhone.js +6 -2
- package/src/domain/Phone/Phone.js +2 -0
- package/src/domain/Phone/WebRTCPhone.js +22 -8
- package/src/index.js +6 -0
- package/src/lib/WazoSessionDescriptionHandler.js +17 -9
- package/src/service/IssueReporter.js +7 -1
- package/src/service/__tests__/IssueReporter.test.js +2 -0
- package/src/simple/Phone.js +13 -4
- package/src/simple/index.js +8 -0
- package/src/simple/room/Participant.js +7 -0
- package/src/simple/room/Room.js +157 -79
- package/src/simple/room/SipRoom.js +147 -0
- package/src/simple/room/Stream.js +1 -3
- package/src/simple/room/__tests__/RemoteParticipant.test.js +3 -2
- package/src/types/WebSocketMessage.js +21 -0
- package/src/web-rtc-client.js +57 -24
- package/src/websocket-client.js +4 -0
package/lib/domain/CallLog.js
CHANGED
|
@@ -168,7 +168,11 @@ class CallLog {
|
|
|
168
168
|
answered: plain.answered,
|
|
169
169
|
callDirection: plain.call_direction,
|
|
170
170
|
destination: {
|
|
171
|
-
|
|
171
|
+
// @TEMP: Temporarily assuming empty numbers are meetings
|
|
172
|
+
// which is admittedly a very dangerous assumption. Did i mention it was temporary?
|
|
173
|
+
extension: plain.requested_extension
|
|
174
|
+
|| plain.destination_extension
|
|
175
|
+
|| `meeting-${plain.requested_name || plain.destination_name || ''}`,
|
|
172
176
|
name: plain.requested_name || plain.destination_name || '',
|
|
173
177
|
},
|
|
174
178
|
source: {
|
|
@@ -184,27 +188,11 @@ class CallLog {
|
|
|
184
188
|
}
|
|
185
189
|
|
|
186
190
|
static parseNew(plain , session ) {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
extension: plain.requested_extension || plain.destination_extension,
|
|
193
|
-
name: plain.requested_name || plain.destination_name || '',
|
|
194
|
-
},
|
|
195
|
-
source: {
|
|
196
|
-
extension: plain.source_extension,
|
|
197
|
-
name: plain.source_name,
|
|
198
|
-
},
|
|
199
|
-
id: plain.id,
|
|
200
|
-
duration: (plain.duration || 0) * 1000, // duration is in seconds
|
|
201
|
-
start: moment__default['default'](plain.start).toDate(),
|
|
202
|
-
end: plain.end ? moment__default['default'](plain.end).toDate() : null,
|
|
203
|
-
recordings: Recording.parseMany(plain.recordings),
|
|
204
|
-
// @TODO: FIXME add verification declined vs missed call
|
|
205
|
-
newMissedCall: session
|
|
206
|
-
&& session.hasExtension(plain.requested_extension || plain.destination_extension) && !plain.answered,
|
|
207
|
-
});
|
|
191
|
+
const callLog = CallLog.parse(plain);
|
|
192
|
+
// @TODO: FIXME add verification declined vs missed call
|
|
193
|
+
callLog.newMissedCall = session
|
|
194
|
+
&& session.hasExtension(plain.requested_extension || plain.destination_extension) && !plain.answered;
|
|
195
|
+
return callLog;
|
|
208
196
|
}
|
|
209
197
|
|
|
210
198
|
static newFrom(profile ) {
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var sessionState = require('sip.js/lib/api/session-state');
|
|
4
4
|
require('moment');
|
|
5
|
-
var jsrsasign = require('jsrsasign');
|
|
6
5
|
|
|
7
6
|
//
|
|
8
7
|
|
|
@@ -15,22 +14,6 @@ var newFrom = (instance , ToClass ) => {
|
|
|
15
14
|
return new ToClass(args);
|
|
16
15
|
};
|
|
17
16
|
|
|
18
|
-
//
|
|
19
|
-
|
|
20
|
-
const swarmPublicKey = `-----BEGIN PUBLIC KEY-----
|
|
21
|
-
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmkXOuNfY8u5xoTiIhkb8
|
|
22
|
-
djnbIwG/Wrz3vpo8BZir8L5e1a1nSy740qBjP7ZINBQoALDhFfmdOfJnCyEGiHuz
|
|
23
|
-
ZW6jbG6C3PryE3Bu6GKwqSmD6k3q4Zk27fpwYAnNl+rWhYYM563rJZBda/INyHNN
|
|
24
|
-
pK7M1mixWi7gNdjjXwoEXSSBx+VpYMkY6LiAB2mvHXTY9M1qI14dvgGoQISZQoKi
|
|
25
|
-
NMTRCg5UP2ic0Dd9nSz/XpcOxGfa+0fwIl1F7RC1tJXOqvkGGPTOV4LLfg/Yta3h
|
|
26
|
-
nUPX9EZZDIX6vO/0IBV1LzjSl2A1bYFYAjJfowv3i1CpvONBOClHjSY5t9Y8MH6p
|
|
27
|
-
BwIDAQAB
|
|
28
|
-
-----END PUBLIC KEY-----`;
|
|
29
|
-
|
|
30
|
-
//
|
|
31
|
-
|
|
32
|
-
jsrsasign.KEYUTIL.getKey(swarmPublicKey);
|
|
33
|
-
|
|
34
17
|
//
|
|
35
18
|
/* eslint-disable no-param-reassign */
|
|
36
19
|
|
|
@@ -354,7 +337,7 @@ class CallSession {
|
|
|
354
337
|
return newFrom(callSession, CallSession);
|
|
355
338
|
}
|
|
356
339
|
|
|
357
|
-
static parseCall(
|
|
340
|
+
static parseCall(call ) {
|
|
358
341
|
return new CallSession({
|
|
359
342
|
callId: call.id,
|
|
360
343
|
sipCallId: call.sipCallId,
|
package/lib/domain/Features.js
CHANGED
|
@@ -317,7 +317,13 @@ class IssueReporter {
|
|
|
317
317
|
}
|
|
318
318
|
|
|
319
319
|
_isLevelAbove(level1 , level2 ) {
|
|
320
|
-
|
|
320
|
+
const index1 = LOG_LEVELS.indexOf(level1);
|
|
321
|
+
const index2 = LOG_LEVELS.indexOf(level2);
|
|
322
|
+
if (index1 === -1 || index2 === -1) {
|
|
323
|
+
return false;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
return index1 > index2;
|
|
321
327
|
}
|
|
322
328
|
|
|
323
329
|
_makeCategory(category ) {
|
|
@@ -2495,6 +2501,65 @@ class ExternalApp {
|
|
|
2495
2501
|
}
|
|
2496
2502
|
}
|
|
2497
2503
|
|
|
2504
|
+
//
|
|
2505
|
+
|
|
2506
|
+
|
|
2507
|
+
|
|
2508
|
+
|
|
2509
|
+
|
|
2510
|
+
|
|
2511
|
+
|
|
2512
|
+
|
|
2513
|
+
|
|
2514
|
+
|
|
2515
|
+
|
|
2516
|
+
class Meeting {
|
|
2517
|
+
|
|
2518
|
+
|
|
2519
|
+
|
|
2520
|
+
|
|
2521
|
+
|
|
2522
|
+
|
|
2523
|
+
|
|
2524
|
+
|
|
2525
|
+
|
|
2526
|
+
|
|
2527
|
+
static parse(plain ) {
|
|
2528
|
+
return new Meeting({
|
|
2529
|
+
guestSipAuthorization: plain.guest_sip_authorization,
|
|
2530
|
+
hostname: plain.hostname,
|
|
2531
|
+
name: plain.name,
|
|
2532
|
+
ownerUuids: plain.owner_uuids,
|
|
2533
|
+
port: plain.port,
|
|
2534
|
+
uuid: plain.uuid,
|
|
2535
|
+
number: plain.number,
|
|
2536
|
+
});
|
|
2537
|
+
}
|
|
2538
|
+
|
|
2539
|
+
static newFrom(meeting ) {
|
|
2540
|
+
return newFrom(meeting, Meeting);
|
|
2541
|
+
}
|
|
2542
|
+
|
|
2543
|
+
constructor({ uuid, name, guestSipAuthorization, ownerUuids, port, hostname, number } = {}) {
|
|
2544
|
+
this.guestSipAuthorization = guestSipAuthorization;
|
|
2545
|
+
this.hostname = hostname;
|
|
2546
|
+
this.name = name;
|
|
2547
|
+
this.ownerUuids = ownerUuids;
|
|
2548
|
+
this.port = port;
|
|
2549
|
+
this.uuid = uuid;
|
|
2550
|
+
this.number = number;
|
|
2551
|
+
|
|
2552
|
+
// Useful to compare instead of instanceof with minified code
|
|
2553
|
+
this.type = 'Meeting';
|
|
2554
|
+
}
|
|
2555
|
+
|
|
2556
|
+
getGuestSipCredentials() {
|
|
2557
|
+
// eslint-disable-next-line no-undef
|
|
2558
|
+
const [username, secret] = atob(this.guestSipAuthorization).split(':');
|
|
2559
|
+
return { username, secret };
|
|
2560
|
+
}
|
|
2561
|
+
}
|
|
2562
|
+
|
|
2498
2563
|
/* */
|
|
2499
2564
|
|
|
2500
2565
|
var confdMethods = (client , baseUrl ) => ({
|
|
@@ -2559,6 +2624,18 @@ var confdMethods = (client , baseUrl ) => ({
|
|
|
2559
2624
|
return null;
|
|
2560
2625
|
}
|
|
2561
2626
|
},
|
|
2627
|
+
|
|
2628
|
+
createMyMeeting: (name ) =>
|
|
2629
|
+
client.post(`${baseUrl}/users/me/meetings`, { name }).then(Meeting.parse),
|
|
2630
|
+
|
|
2631
|
+
deleteMyMeeting: (meetingUuid ) =>
|
|
2632
|
+
client.delete(`${baseUrl}/users/me/meetings/${meetingUuid}`, null),
|
|
2633
|
+
|
|
2634
|
+
getMeeting: (meetingUuid ) =>
|
|
2635
|
+
client.get(`${baseUrl}/meetings/${meetingUuid}`, null).then(Meeting.parse),
|
|
2636
|
+
|
|
2637
|
+
guestGetMeeting: (meetingUuid ) =>
|
|
2638
|
+
client.get(`${baseUrl}/guests/me/meetings/${meetingUuid}`, null).then(Meeting.parse),
|
|
2562
2639
|
});
|
|
2563
2640
|
|
|
2564
2641
|
//
|
|
@@ -3143,7 +3220,11 @@ class CallLog {
|
|
|
3143
3220
|
answered: plain.answered,
|
|
3144
3221
|
callDirection: plain.call_direction,
|
|
3145
3222
|
destination: {
|
|
3146
|
-
|
|
3223
|
+
// @TEMP: Temporarily assuming empty numbers are meetings
|
|
3224
|
+
// which is admittedly a very dangerous assumption. Did i mention it was temporary?
|
|
3225
|
+
extension: plain.requested_extension
|
|
3226
|
+
|| plain.destination_extension
|
|
3227
|
+
|| `meeting-${plain.requested_name || plain.destination_name || ''}`,
|
|
3147
3228
|
name: plain.requested_name || plain.destination_name || '',
|
|
3148
3229
|
},
|
|
3149
3230
|
source: {
|
|
@@ -3159,27 +3240,11 @@ class CallLog {
|
|
|
3159
3240
|
}
|
|
3160
3241
|
|
|
3161
3242
|
static parseNew(plain , session ) {
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
extension: plain.requested_extension || plain.destination_extension,
|
|
3168
|
-
name: plain.requested_name || plain.destination_name || '',
|
|
3169
|
-
},
|
|
3170
|
-
source: {
|
|
3171
|
-
extension: plain.source_extension,
|
|
3172
|
-
name: plain.source_name,
|
|
3173
|
-
},
|
|
3174
|
-
id: plain.id,
|
|
3175
|
-
duration: (plain.duration || 0) * 1000, // duration is in seconds
|
|
3176
|
-
start: moment__default['default'](plain.start).toDate(),
|
|
3177
|
-
end: plain.end ? moment__default['default'](plain.end).toDate() : null,
|
|
3178
|
-
recordings: Recording.parseMany(plain.recordings),
|
|
3179
|
-
// @TODO: FIXME add verification declined vs missed call
|
|
3180
|
-
newMissedCall: session
|
|
3181
|
-
&& session.hasExtension(plain.requested_extension || plain.destination_extension) && !plain.answered,
|
|
3182
|
-
});
|
|
3243
|
+
const callLog = CallLog.parse(plain);
|
|
3244
|
+
// @TODO: FIXME add verification declined vs missed call
|
|
3245
|
+
callLog.newMissedCall = session
|
|
3246
|
+
&& session.hasExtension(plain.requested_extension || plain.destination_extension) && !plain.answered;
|
|
3247
|
+
return callLog;
|
|
3183
3248
|
}
|
|
3184
3249
|
|
|
3185
3250
|
static newFrom(profile ) {
|
|
@@ -3921,6 +3986,9 @@ var calldMethods = (client , baseUrl ) => ({
|
|
|
3921
3986
|
getConferenceParticipantsAsUser: async (conferenceId ) =>
|
|
3922
3987
|
client.get(`${baseUrl}/users/me/conferences/${conferenceId}/participants`),
|
|
3923
3988
|
|
|
3989
|
+
getMeetingParticipantsAsUser: async (meetingUuid ) =>
|
|
3990
|
+
client.get(`${baseUrl}/users/me/meetings/${meetingUuid}/participants`),
|
|
3991
|
+
|
|
3924
3992
|
listTrunks: () => client.get(`${baseUrl}/trunks`),
|
|
3925
3993
|
|
|
3926
3994
|
mute: (callId ) =>
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
require('sip.js/lib/api/session-state');
|
|
4
4
|
require('moment');
|
|
5
|
-
var jsrsasign = require('jsrsasign');
|
|
6
5
|
|
|
7
6
|
//
|
|
8
7
|
|
|
@@ -15,22 +14,6 @@ var newFrom = (instance , ToClass ) => {
|
|
|
15
14
|
return new ToClass(args);
|
|
16
15
|
};
|
|
17
16
|
|
|
18
|
-
//
|
|
19
|
-
|
|
20
|
-
const swarmPublicKey = `-----BEGIN PUBLIC KEY-----
|
|
21
|
-
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmkXOuNfY8u5xoTiIhkb8
|
|
22
|
-
djnbIwG/Wrz3vpo8BZir8L5e1a1nSy740qBjP7ZINBQoALDhFfmdOfJnCyEGiHuz
|
|
23
|
-
ZW6jbG6C3PryE3Bu6GKwqSmD6k3q4Zk27fpwYAnNl+rWhYYM563rJZBda/INyHNN
|
|
24
|
-
pK7M1mixWi7gNdjjXwoEXSSBx+VpYMkY6LiAB2mvHXTY9M1qI14dvgGoQISZQoKi
|
|
25
|
-
NMTRCg5UP2ic0Dd9nSz/XpcOxGfa+0fwIl1F7RC1tJXOqvkGGPTOV4LLfg/Yta3h
|
|
26
|
-
nUPX9EZZDIX6vO/0IBV1LzjSl2A1bYFYAjJfowv3i1CpvONBOClHjSY5t9Y8MH6p
|
|
27
|
-
BwIDAQAB
|
|
28
|
-
-----END PUBLIC KEY-----`;
|
|
29
|
-
|
|
30
|
-
//
|
|
31
|
-
|
|
32
|
-
jsrsasign.KEYUTIL.getKey(swarmPublicKey);
|
|
33
|
-
|
|
34
17
|
//
|
|
35
18
|
/* eslint-disable no-param-reassign */
|
|
36
19
|
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
var newFrom = (instance , ToClass ) => {
|
|
6
|
+
const args = {};
|
|
7
|
+
Object.getOwnPropertyNames(instance).forEach(prop => {
|
|
8
|
+
args[prop] = instance[prop];
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
return new ToClass(args);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
//
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class Meeting {
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
static parse(plain ) {
|
|
38
|
+
return new Meeting({
|
|
39
|
+
guestSipAuthorization: plain.guest_sip_authorization,
|
|
40
|
+
hostname: plain.hostname,
|
|
41
|
+
name: plain.name,
|
|
42
|
+
ownerUuids: plain.owner_uuids,
|
|
43
|
+
port: plain.port,
|
|
44
|
+
uuid: plain.uuid,
|
|
45
|
+
number: plain.number,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static newFrom(meeting ) {
|
|
50
|
+
return newFrom(meeting, Meeting);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
constructor({ uuid, name, guestSipAuthorization, ownerUuids, port, hostname, number } = {}) {
|
|
54
|
+
this.guestSipAuthorization = guestSipAuthorization;
|
|
55
|
+
this.hostname = hostname;
|
|
56
|
+
this.name = name;
|
|
57
|
+
this.ownerUuids = ownerUuids;
|
|
58
|
+
this.port = port;
|
|
59
|
+
this.uuid = uuid;
|
|
60
|
+
this.number = number;
|
|
61
|
+
|
|
62
|
+
// Useful to compare instead of instanceof with minified code
|
|
63
|
+
this.type = 'Meeting';
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
getGuestSipCredentials() {
|
|
67
|
+
// eslint-disable-next-line no-undef
|
|
68
|
+
const [username, secret] = atob(this.guestSipAuthorization).split(':');
|
|
69
|
+
return { username, secret };
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
module.exports = Meeting;
|
|
@@ -2008,7 +2008,7 @@ class CallSession {
|
|
|
2008
2008
|
return newFrom(callSession, CallSession);
|
|
2009
2009
|
}
|
|
2010
2010
|
|
|
2011
|
-
static parseCall(
|
|
2011
|
+
static parseCall(call ) {
|
|
2012
2012
|
return new CallSession({
|
|
2013
2013
|
callId: call.id,
|
|
2014
2014
|
sipCallId: call.sipCallId,
|
|
@@ -2193,7 +2193,11 @@ class CallLog {
|
|
|
2193
2193
|
answered: plain.answered,
|
|
2194
2194
|
callDirection: plain.call_direction,
|
|
2195
2195
|
destination: {
|
|
2196
|
-
|
|
2196
|
+
// @TEMP: Temporarily assuming empty numbers are meetings
|
|
2197
|
+
// which is admittedly a very dangerous assumption. Did i mention it was temporary?
|
|
2198
|
+
extension: plain.requested_extension
|
|
2199
|
+
|| plain.destination_extension
|
|
2200
|
+
|| `meeting-${plain.requested_name || plain.destination_name || ''}`,
|
|
2197
2201
|
name: plain.requested_name || plain.destination_name || '',
|
|
2198
2202
|
},
|
|
2199
2203
|
source: {
|
|
@@ -2209,27 +2213,11 @@ class CallLog {
|
|
|
2209
2213
|
}
|
|
2210
2214
|
|
|
2211
2215
|
static parseNew(plain , session ) {
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
extension: plain.requested_extension || plain.destination_extension,
|
|
2218
|
-
name: plain.requested_name || plain.destination_name || '',
|
|
2219
|
-
},
|
|
2220
|
-
source: {
|
|
2221
|
-
extension: plain.source_extension,
|
|
2222
|
-
name: plain.source_name,
|
|
2223
|
-
},
|
|
2224
|
-
id: plain.id,
|
|
2225
|
-
duration: (plain.duration || 0) * 1000, // duration is in seconds
|
|
2226
|
-
start: moment__default['default'](plain.start).toDate(),
|
|
2227
|
-
end: plain.end ? moment__default['default'](plain.end).toDate() : null,
|
|
2228
|
-
recordings: Recording.parseMany(plain.recordings),
|
|
2229
|
-
// @TODO: FIXME add verification declined vs missed call
|
|
2230
|
-
newMissedCall: session
|
|
2231
|
-
&& session.hasExtension(plain.requested_extension || plain.destination_extension) && !plain.answered,
|
|
2232
|
-
});
|
|
2216
|
+
const callLog = CallLog.parse(plain);
|
|
2217
|
+
// @TODO: FIXME add verification declined vs missed call
|
|
2218
|
+
callLog.newMissedCall = session
|
|
2219
|
+
&& session.hasExtension(plain.requested_extension || plain.destination_extension) && !plain.answered;
|
|
2220
|
+
return callLog;
|
|
2233
2221
|
}
|
|
2234
2222
|
|
|
2235
2223
|
static newFrom(profile ) {
|
|
@@ -2685,7 +2673,13 @@ class IssueReporter {
|
|
|
2685
2673
|
}
|
|
2686
2674
|
|
|
2687
2675
|
_isLevelAbove(level1 , level2 ) {
|
|
2688
|
-
|
|
2676
|
+
const index1 = LOG_LEVELS.indexOf(level1);
|
|
2677
|
+
const index2 = LOG_LEVELS.indexOf(level2);
|
|
2678
|
+
if (index1 === -1 || index2 === -1) {
|
|
2679
|
+
return false;
|
|
2680
|
+
}
|
|
2681
|
+
|
|
2682
|
+
return index1 > index2;
|
|
2689
2683
|
}
|
|
2690
2684
|
|
|
2691
2685
|
_makeCategory(category ) {
|
|
@@ -3382,6 +3376,65 @@ class ExternalApp {
|
|
|
3382
3376
|
}
|
|
3383
3377
|
}
|
|
3384
3378
|
|
|
3379
|
+
//
|
|
3380
|
+
|
|
3381
|
+
|
|
3382
|
+
|
|
3383
|
+
|
|
3384
|
+
|
|
3385
|
+
|
|
3386
|
+
|
|
3387
|
+
|
|
3388
|
+
|
|
3389
|
+
|
|
3390
|
+
|
|
3391
|
+
class Meeting {
|
|
3392
|
+
|
|
3393
|
+
|
|
3394
|
+
|
|
3395
|
+
|
|
3396
|
+
|
|
3397
|
+
|
|
3398
|
+
|
|
3399
|
+
|
|
3400
|
+
|
|
3401
|
+
|
|
3402
|
+
static parse(plain ) {
|
|
3403
|
+
return new Meeting({
|
|
3404
|
+
guestSipAuthorization: plain.guest_sip_authorization,
|
|
3405
|
+
hostname: plain.hostname,
|
|
3406
|
+
name: plain.name,
|
|
3407
|
+
ownerUuids: plain.owner_uuids,
|
|
3408
|
+
port: plain.port,
|
|
3409
|
+
uuid: plain.uuid,
|
|
3410
|
+
number: plain.number,
|
|
3411
|
+
});
|
|
3412
|
+
}
|
|
3413
|
+
|
|
3414
|
+
static newFrom(meeting ) {
|
|
3415
|
+
return newFrom(meeting, Meeting);
|
|
3416
|
+
}
|
|
3417
|
+
|
|
3418
|
+
constructor({ uuid, name, guestSipAuthorization, ownerUuids, port, hostname, number } = {}) {
|
|
3419
|
+
this.guestSipAuthorization = guestSipAuthorization;
|
|
3420
|
+
this.hostname = hostname;
|
|
3421
|
+
this.name = name;
|
|
3422
|
+
this.ownerUuids = ownerUuids;
|
|
3423
|
+
this.port = port;
|
|
3424
|
+
this.uuid = uuid;
|
|
3425
|
+
this.number = number;
|
|
3426
|
+
|
|
3427
|
+
// Useful to compare instead of instanceof with minified code
|
|
3428
|
+
this.type = 'Meeting';
|
|
3429
|
+
}
|
|
3430
|
+
|
|
3431
|
+
getGuestSipCredentials() {
|
|
3432
|
+
// eslint-disable-next-line no-undef
|
|
3433
|
+
const [username, secret] = atob(this.guestSipAuthorization).split(':');
|
|
3434
|
+
return { username, secret };
|
|
3435
|
+
}
|
|
3436
|
+
}
|
|
3437
|
+
|
|
3385
3438
|
/* */
|
|
3386
3439
|
|
|
3387
3440
|
var confdMethods = (client , baseUrl ) => ({
|
|
@@ -3446,6 +3499,18 @@ var confdMethods = (client , baseUrl ) => ({
|
|
|
3446
3499
|
return null;
|
|
3447
3500
|
}
|
|
3448
3501
|
},
|
|
3502
|
+
|
|
3503
|
+
createMyMeeting: (name ) =>
|
|
3504
|
+
client.post(`${baseUrl}/users/me/meetings`, { name }).then(Meeting.parse),
|
|
3505
|
+
|
|
3506
|
+
deleteMyMeeting: (meetingUuid ) =>
|
|
3507
|
+
client.delete(`${baseUrl}/users/me/meetings/${meetingUuid}`, null),
|
|
3508
|
+
|
|
3509
|
+
getMeeting: (meetingUuid ) =>
|
|
3510
|
+
client.get(`${baseUrl}/meetings/${meetingUuid}`, null).then(Meeting.parse),
|
|
3511
|
+
|
|
3512
|
+
guestGetMeeting: (meetingUuid ) =>
|
|
3513
|
+
client.get(`${baseUrl}/guests/me/meetings/${meetingUuid}`, null).then(Meeting.parse),
|
|
3449
3514
|
});
|
|
3450
3515
|
|
|
3451
3516
|
//
|
|
@@ -4273,6 +4338,9 @@ var calldMethods = (client , baseUrl ) => ({
|
|
|
4273
4338
|
getConferenceParticipantsAsUser: async (conferenceId ) =>
|
|
4274
4339
|
client.get(`${baseUrl}/users/me/conferences/${conferenceId}/participants`),
|
|
4275
4340
|
|
|
4341
|
+
getMeetingParticipantsAsUser: async (meetingUuid ) =>
|
|
4342
|
+
client.get(`${baseUrl}/users/me/meetings/${meetingUuid}/participants`),
|
|
4343
|
+
|
|
4276
4344
|
listTrunks: () => client.get(`${baseUrl}/trunks`),
|
|
4277
4345
|
|
|
4278
4346
|
mute: (callId ) =>
|
|
@@ -4984,7 +5052,7 @@ class CTIPhone extends Emitter {
|
|
|
4984
5052
|
if (!this.currentCall) {
|
|
4985
5053
|
return null;
|
|
4986
5054
|
}
|
|
4987
|
-
const callSession = CallSession.parseCall(this.
|
|
5055
|
+
const callSession = CallSession.parseCall(this.currentCall);
|
|
4988
5056
|
this.eventEmitter.emit('onCallOutgoing', callSession);
|
|
4989
5057
|
|
|
4990
5058
|
return callSession;
|
|
@@ -5168,6 +5236,10 @@ class CTIPhone extends Emitter {
|
|
|
5168
5236
|
return null;
|
|
5169
5237
|
}
|
|
5170
5238
|
|
|
5239
|
+
getLocalVideoStream() {
|
|
5240
|
+
return null;
|
|
5241
|
+
}
|
|
5242
|
+
|
|
5171
5243
|
setActiveSipSession() {}
|
|
5172
5244
|
|
|
5173
5245
|
isRegistered() {
|
|
@@ -5183,7 +5255,7 @@ class CTIPhone extends Emitter {
|
|
|
5183
5255
|
}
|
|
5184
5256
|
|
|
5185
5257
|
getCurrentCallSession() {
|
|
5186
|
-
return this.currentCall ? CallSession.parseCall(this.
|
|
5258
|
+
return this.currentCall ? CallSession.parseCall(this.currentCall) : null;
|
|
5187
5259
|
}
|
|
5188
5260
|
|
|
5189
5261
|
enableRinging() {}
|
|
@@ -2,20 +2,4 @@
|
|
|
2
2
|
|
|
3
3
|
require('sip.js/lib/api/session-state');
|
|
4
4
|
require('moment');
|
|
5
|
-
var jsrsasign = require('jsrsasign');
|
|
6
5
|
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
const swarmPublicKey = `-----BEGIN PUBLIC KEY-----
|
|
10
|
-
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmkXOuNfY8u5xoTiIhkb8
|
|
11
|
-
djnbIwG/Wrz3vpo8BZir8L5e1a1nSy740qBjP7ZINBQoALDhFfmdOfJnCyEGiHuz
|
|
12
|
-
ZW6jbG6C3PryE3Bu6GKwqSmD6k3q4Zk27fpwYAnNl+rWhYYM563rJZBda/INyHNN
|
|
13
|
-
pK7M1mixWi7gNdjjXwoEXSSBx+VpYMkY6LiAB2mvHXTY9M1qI14dvgGoQISZQoKi
|
|
14
|
-
NMTRCg5UP2ic0Dd9nSz/XpcOxGfa+0fwIl1F7RC1tJXOqvkGGPTOV4LLfg/Yta3h
|
|
15
|
-
nUPX9EZZDIX6vO/0IBV1LzjSl2A1bYFYAjJfowv3i1CpvONBOClHjSY5t9Y8MH6p
|
|
16
|
-
BwIDAQAB
|
|
17
|
-
-----END PUBLIC KEY-----`;
|
|
18
|
-
|
|
19
|
-
//
|
|
20
|
-
|
|
21
|
-
jsrsasign.KEYUTIL.getKey(swarmPublicKey);
|