@wazo/sdk 0.37.18 → 0.37.19
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 +13 -5
- package/esm/__tests__/api-client.test.js +9 -5
- package/esm/__tests__/web-rtc-client.test.js +10 -6
- package/esm/api/agentd.js +2 -2
- package/esm/api/amid.js +2 -2
- package/esm/api/application.js +2 -2
- package/esm/api/auth.js +4 -3
- package/esm/api/call-logd.js +4 -4
- package/esm/api/calld.js +2 -2
- package/esm/api/chatd.js +2 -2
- package/esm/api/confd.js +8 -4
- package/esm/api/ctid-ng.js +2 -2
- package/esm/api/dird.js +2 -2
- package/esm/api/webhookd.js +2 -2
- package/esm/api-client.js +11 -7
- package/esm/checker/Checker.js +11 -7
- package/esm/checker/checks/aor.js +11 -7
- package/esm/checker/checks/api.js +11 -7
- package/esm/checker/checks/ice-ipv4.js +1 -1
- package/esm/checker/checks/index.js +12 -8
- package/esm/checker/checks/symmetric-nat.js +1 -1
- package/esm/checker/checks/wazo-websocket.js +2 -2
- package/esm/checker/checks/webrtc-transport.js +12 -8
- package/esm/checker/checks/webrtc.js +12 -8
- package/esm/domain/AdHocAPIConference.js +11 -7
- package/esm/domain/Agent.js +1 -1
- package/esm/domain/BadResponse.js +1 -1
- package/esm/domain/Call.js +1 -1
- package/esm/domain/CallLog.js +3 -3
- package/esm/domain/CallSession.js +1 -1
- package/esm/domain/ChatMessage.js +1 -1
- package/esm/domain/ChatRoom.js +1 -1
- package/esm/domain/Contact.js +2 -1
- package/esm/domain/Country.js +1 -1
- package/esm/domain/Device/DebugDevice.js +1 -1
- package/esm/domain/ExternalApp.js +1 -1
- package/esm/domain/Features.js +11 -6
- package/esm/domain/ForwardOption.js +2 -1
- package/esm/domain/IndirectTransfer.js +1 -1
- package/esm/domain/Line.js +1 -1
- package/esm/domain/Meeting.js +7 -3
- package/esm/domain/NotificationOptions.js +1 -1
- package/esm/domain/Phone/CTIPhone.js +12 -7
- package/esm/domain/Phone/WebRTCPhone.js +3 -2
- package/esm/domain/Profile.js +2 -1
- package/esm/domain/Recording.js +2 -2
- package/esm/domain/Relocation.js +1 -1
- package/esm/domain/Room.js +1 -1
- package/esm/domain/ServerError.js +1 -1
- package/esm/domain/Session.js +2 -2
- package/esm/domain/SipLine.js +1 -1
- package/esm/domain/Subscription.js +1 -1
- package/esm/domain/SwitchboardCall.js +1 -1
- package/esm/domain/Voicemail.js +1 -1
- package/esm/domain/__tests__/CallLog.test.js +2 -2
- package/esm/index.js +12 -8
- package/esm/lib/WazoSessionDescriptionHandler.js +3 -2
- package/esm/service/CallApi.js +11 -7
- package/esm/service/IssueReporter.js +2 -2
- package/esm/service/__tests__/IssueReporter.test.js +1 -1
- package/esm/service/getApiClient.js +12 -7
- package/esm/simple/Auth.js +12 -7
- package/esm/simple/Configuration.js +11 -7
- package/esm/simple/Directory.js +10 -6
- package/esm/simple/Phone.js +11 -7
- package/esm/simple/Websocket.js +2 -2
- package/esm/simple/index.js +11 -7
- package/esm/simple/room/LocalParticipant.js +24 -24
- package/esm/simple/room/Participant.js +23 -21
- package/esm/simple/room/RemoteParticipant.js +25 -25
- package/esm/simple/room/Room.js +24 -21
- package/esm/simple/room/SipRoom.js +12 -10
- package/esm/simple/room/Stream.js +12 -10
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +10 -6
- package/esm/simple/utils.js +10 -6
- package/esm/utils/Emitter.js +1 -1
- package/esm/utils/Heartbeat.js +1 -1
- package/esm/utils/__tests__/api-requester.test.js +1 -1
- package/esm/utils/api-requester.js +3 -2
- package/esm/utils/compare-version.js +1 -1
- package/esm/utils/isMobile.js +1 -1
- package/esm/utils/new-from.js +1 -1
- package/esm/utils/once.js +1 -1
- package/esm/utils/update-from.js +1 -1
- package/esm/web-rtc-client.js +13 -8
- package/esm/websocket-client.js +3 -2
- package/lib/__tests__/api-client.test.js +18 -14
- package/lib/__tests__/web-rtc-client.test.js +27 -23
- package/lib/api/agentd.js +2 -2
- package/lib/api/amid.js +2 -2
- package/lib/api/application.js +2 -2
- package/lib/api/auth.js +3 -3
- package/lib/api/call-logd.js +9 -9
- package/lib/api/calld.js +5 -5
- package/lib/api/chatd.js +3 -3
- package/lib/api/confd.js +8 -4
- package/lib/api/ctid-ng.js +5 -5
- package/lib/api/dird.js +2 -2
- package/lib/api/webhookd.js +2 -2
- package/lib/api-client.js +18 -14
- package/lib/checker/Checker.js +28 -24
- package/lib/checker/checks/aor.js +18 -14
- package/lib/checker/checks/api.js +18 -14
- package/lib/checker/checks/index.js +28 -24
- package/lib/checker/checks/wazo-websocket.js +4 -4
- package/lib/checker/checks/webrtc-transport.js +27 -23
- package/lib/checker/checks/webrtc.js +27 -23
- package/lib/domain/AdHocAPIConference.js +18 -14
- package/lib/domain/Call.js +1 -1
- package/lib/domain/CallLog.js +7 -7
- package/lib/domain/ChatMessage.js +1 -1
- package/lib/domain/Contact.js +1 -1
- package/lib/domain/Features.js +19 -15
- package/lib/domain/ForwardOption.js +1 -1
- package/lib/domain/Meeting.js +6 -2
- package/lib/domain/Phone/CTIPhone.js +20 -16
- package/lib/domain/Phone/WebRTCPhone.js +4 -4
- package/lib/domain/Profile.js +1 -1
- package/lib/domain/Recording.js +3 -3
- package/lib/domain/Voicemail.js +1 -1
- package/lib/domain/__tests__/Call.test.js +1 -1
- package/lib/domain/__tests__/CallLog.test.js +13 -13
- package/lib/domain/__tests__/Voicemail.test.js +1 -1
- package/lib/index.js +31 -27
- package/lib/lib/WazoSessionDescriptionHandler.js +7 -7
- package/lib/service/CallApi.js +18 -14
- package/lib/service/IssueReporter.js +2 -2
- package/lib/service/__tests__/IssueReporter.test.js +2 -2
- package/lib/service/getApiClient.js +19 -15
- package/lib/simple/Auth.js +30 -26
- package/lib/simple/Configuration.js +29 -25
- package/lib/simple/Directory.js +18 -14
- package/lib/simple/Phone.js +29 -25
- package/lib/simple/Websocket.js +4 -4
- package/lib/simple/index.js +29 -25
- package/lib/simple/room/LocalParticipant.js +43 -43
- package/lib/simple/room/Participant.js +41 -39
- package/lib/simple/room/RemoteParticipant.js +44 -44
- package/lib/simple/room/Room.js +42 -40
- package/lib/simple/room/SipRoom.js +31 -29
- package/lib/simple/room/Stream.js +31 -29
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +29 -25
- package/lib/simple/utils.js +29 -25
- package/lib/utils/Emitter.js +1 -1
- package/lib/utils/PhoneNumberUtil.js +2 -2
- package/lib/utils/__tests__/PhoneNumberUtil.test.js +2 -2
- package/lib/utils/__tests__/api-requester.test.js +2 -2
- package/lib/utils/__tests__/sdp.test.js +12 -12
- package/lib/utils/api-requester.js +3 -3
- package/lib/utils/sdp.js +10 -10
- package/lib/web-rtc-client.js +28 -24
- package/lib/websocket-client.js +5 -5
- package/package.json +1 -1
- package/src/domain/CallLog.js +1 -1
- package/src/domain/Meeting.js +6 -2
- package/src/domain/Recording.js +1 -1
- package/src/service/IssueReporter.js +1 -1
- package/src/web-rtc-client.js +1 -1
package/lib/api-client.js
CHANGED
|
@@ -211,7 +211,7 @@ class IssueReporter {
|
|
|
211
211
|
args.splice(1, 1);
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
const date = moment__default[
|
|
214
|
+
const date = moment__default['default']().format('YYYY-MM-DD HH:mm:ss.SSS');
|
|
215
215
|
const message = args.join(', ');
|
|
216
216
|
let consoleMessage = message;
|
|
217
217
|
|
|
@@ -388,7 +388,7 @@ class IssueReporter {
|
|
|
388
388
|
payload._retry = retry + 1;
|
|
389
389
|
}
|
|
390
390
|
|
|
391
|
-
this._sendDebugToGrafana(
|
|
391
|
+
this._sendDebugToGrafana(payload, retry + 1);
|
|
392
392
|
}, 5000 + retry * 1000);
|
|
393
393
|
});
|
|
394
394
|
}
|
|
@@ -2591,7 +2591,8 @@ class ExternalApp {
|
|
|
2591
2591
|
|
|
2592
2592
|
|
|
2593
2593
|
|
|
2594
|
-
|
|
2594
|
+
|
|
2595
|
+
|
|
2595
2596
|
|
|
2596
2597
|
|
|
2597
2598
|
class Meeting {
|
|
@@ -2603,6 +2604,7 @@ class Meeting {
|
|
|
2603
2604
|
|
|
2604
2605
|
|
|
2605
2606
|
|
|
2607
|
+
|
|
2606
2608
|
|
|
2607
2609
|
|
|
2608
2610
|
static parse(plain ) {
|
|
@@ -2614,6 +2616,7 @@ class Meeting {
|
|
|
2614
2616
|
port: plain.port,
|
|
2615
2617
|
uuid: plain.uuid,
|
|
2616
2618
|
number: plain.number,
|
|
2619
|
+
persistent: plain.persistent,
|
|
2617
2620
|
});
|
|
2618
2621
|
}
|
|
2619
2622
|
|
|
@@ -2621,7 +2624,7 @@ class Meeting {
|
|
|
2621
2624
|
return newFrom(meeting, Meeting);
|
|
2622
2625
|
}
|
|
2623
2626
|
|
|
2624
|
-
constructor({ uuid, name, guestSipAuthorization, ownerUuids, port, uri, number } = {}) {
|
|
2627
|
+
constructor({ uuid, name, guestSipAuthorization, ownerUuids, port, uri, number, persistent } = {}) {
|
|
2625
2628
|
this.guestSipAuthorization = guestSipAuthorization;
|
|
2626
2629
|
this.uri = uri;
|
|
2627
2630
|
this.name = name;
|
|
@@ -2629,6 +2632,7 @@ class Meeting {
|
|
|
2629
2632
|
this.port = port;
|
|
2630
2633
|
this.uuid = uuid;
|
|
2631
2634
|
this.number = number;
|
|
2635
|
+
this.persistent = persistent;
|
|
2632
2636
|
|
|
2633
2637
|
// Useful to compare instead of instanceof with minified code
|
|
2634
2638
|
this.type = 'Meeting';
|
|
@@ -2809,7 +2813,7 @@ class ChatMessage {
|
|
|
2809
2813
|
static parse(plain ) {
|
|
2810
2814
|
return new ChatMessage({
|
|
2811
2815
|
uuid: plain.uuid,
|
|
2812
|
-
date: moment__default[
|
|
2816
|
+
date: moment__default['default'](plain.created_at).toDate(),
|
|
2813
2817
|
content: plain.content,
|
|
2814
2818
|
alias: plain.alias,
|
|
2815
2819
|
userUuid: plain.user_uuid,
|
|
@@ -2901,7 +2905,7 @@ class Voicemail {
|
|
|
2901
2905
|
static parse(plain ) {
|
|
2902
2906
|
return new Voicemail({
|
|
2903
2907
|
id: plain.id,
|
|
2904
|
-
date: moment__default[
|
|
2908
|
+
date: moment__default['default'](plain.timestamp * 1000).toDate(),
|
|
2905
2909
|
duration: plain.duration * 1000,
|
|
2906
2910
|
caller: {
|
|
2907
2911
|
name: plain.caller_id_name,
|
|
@@ -3038,7 +3042,7 @@ class Call {
|
|
|
3038
3042
|
onHold: plain.on_hold,
|
|
3039
3043
|
status: plain.status,
|
|
3040
3044
|
lineId: plain.line_id,
|
|
3041
|
-
startingTime: moment__default[
|
|
3045
|
+
startingTime: moment__default['default'](plain.creation_time).toDate(),
|
|
3042
3046
|
talkingToIds: Object.keys(plain.talking_to || {}),
|
|
3043
3047
|
recording: plain.record_state === RECORD_STATE_ACTIVE,
|
|
3044
3048
|
});
|
|
@@ -3192,7 +3196,7 @@ class Recording {
|
|
|
3192
3196
|
|
|
3193
3197
|
|
|
3194
3198
|
|
|
3195
|
-
static parseMany(recordings
|
|
3199
|
+
static parseMany(recordings = []) {
|
|
3196
3200
|
return recordings.map(item => Recording.parse(item));
|
|
3197
3201
|
}
|
|
3198
3202
|
|
|
@@ -3200,8 +3204,8 @@ class Recording {
|
|
|
3200
3204
|
return new Recording({
|
|
3201
3205
|
deleted: plain.deleted,
|
|
3202
3206
|
fileName: plain.filename,
|
|
3203
|
-
end: plain.end_time ? moment__default[
|
|
3204
|
-
start: moment__default[
|
|
3207
|
+
end: plain.end_time ? moment__default['default'](plain.end_time).toDate() : null,
|
|
3208
|
+
start: moment__default['default'](plain.start_time).toDate(),
|
|
3205
3209
|
uuid: plain.uuid,
|
|
3206
3210
|
});
|
|
3207
3211
|
}
|
|
@@ -3299,7 +3303,7 @@ class CallLog {
|
|
|
3299
3303
|
|
|
3300
3304
|
static parse(plain ) {
|
|
3301
3305
|
return new CallLog({
|
|
3302
|
-
answer: plain.answer ? moment__default[
|
|
3306
|
+
answer: plain.answer ? moment__default['default'](plain.answer).toDate() : null,
|
|
3303
3307
|
answered: plain.answered,
|
|
3304
3308
|
callDirection: plain.call_direction,
|
|
3305
3309
|
destination: {
|
|
@@ -3316,9 +3320,9 @@ class CallLog {
|
|
|
3316
3320
|
},
|
|
3317
3321
|
id: plain.id,
|
|
3318
3322
|
duration: (plain.duration || 0) * 1000, // duration is in seconds
|
|
3319
|
-
start: moment__default[
|
|
3320
|
-
end: plain.end ? moment__default[
|
|
3321
|
-
recordings: Recording.parseMany(plain.recordings),
|
|
3323
|
+
start: moment__default['default'](plain.start).toDate(),
|
|
3324
|
+
end: plain.end ? moment__default['default'](plain.end).toDate() : null,
|
|
3325
|
+
recordings: Recording.parseMany(plain.recordings || []),
|
|
3322
3326
|
});
|
|
3323
3327
|
}
|
|
3324
3328
|
|
package/lib/checker/Checker.js
CHANGED
|
@@ -233,7 +233,7 @@ class IssueReporter {
|
|
|
233
233
|
args.splice(1, 1);
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
-
const date = moment__default[
|
|
236
|
+
const date = moment__default['default']().format('YYYY-MM-DD HH:mm:ss.SSS');
|
|
237
237
|
const message = args.join(', ');
|
|
238
238
|
let consoleMessage = message;
|
|
239
239
|
|
|
@@ -410,7 +410,7 @@ class IssueReporter {
|
|
|
410
410
|
payload._retry = retry + 1;
|
|
411
411
|
}
|
|
412
412
|
|
|
413
|
-
this._sendDebugToGrafana(
|
|
413
|
+
this._sendDebugToGrafana(payload, retry + 1);
|
|
414
414
|
}, 5000 + retry * 1000);
|
|
415
415
|
});
|
|
416
416
|
}
|
|
@@ -2613,7 +2613,8 @@ class ExternalApp {
|
|
|
2613
2613
|
|
|
2614
2614
|
|
|
2615
2615
|
|
|
2616
|
-
|
|
2616
|
+
|
|
2617
|
+
|
|
2617
2618
|
|
|
2618
2619
|
|
|
2619
2620
|
class Meeting {
|
|
@@ -2625,6 +2626,7 @@ class Meeting {
|
|
|
2625
2626
|
|
|
2626
2627
|
|
|
2627
2628
|
|
|
2629
|
+
|
|
2628
2630
|
|
|
2629
2631
|
|
|
2630
2632
|
static parse(plain ) {
|
|
@@ -2636,6 +2638,7 @@ class Meeting {
|
|
|
2636
2638
|
port: plain.port,
|
|
2637
2639
|
uuid: plain.uuid,
|
|
2638
2640
|
number: plain.number,
|
|
2641
|
+
persistent: plain.persistent,
|
|
2639
2642
|
});
|
|
2640
2643
|
}
|
|
2641
2644
|
|
|
@@ -2643,7 +2646,7 @@ class Meeting {
|
|
|
2643
2646
|
return newFrom(meeting, Meeting);
|
|
2644
2647
|
}
|
|
2645
2648
|
|
|
2646
|
-
constructor({ uuid, name, guestSipAuthorization, ownerUuids, port, uri, number } = {}) {
|
|
2649
|
+
constructor({ uuid, name, guestSipAuthorization, ownerUuids, port, uri, number, persistent } = {}) {
|
|
2647
2650
|
this.guestSipAuthorization = guestSipAuthorization;
|
|
2648
2651
|
this.uri = uri;
|
|
2649
2652
|
this.name = name;
|
|
@@ -2651,6 +2654,7 @@ class Meeting {
|
|
|
2651
2654
|
this.port = port;
|
|
2652
2655
|
this.uuid = uuid;
|
|
2653
2656
|
this.number = number;
|
|
2657
|
+
this.persistent = persistent;
|
|
2654
2658
|
|
|
2655
2659
|
// Useful to compare instead of instanceof with minified code
|
|
2656
2660
|
this.type = 'Meeting';
|
|
@@ -2831,7 +2835,7 @@ class ChatMessage {
|
|
|
2831
2835
|
static parse(plain ) {
|
|
2832
2836
|
return new ChatMessage({
|
|
2833
2837
|
uuid: plain.uuid,
|
|
2834
|
-
date: moment__default[
|
|
2838
|
+
date: moment__default['default'](plain.created_at).toDate(),
|
|
2835
2839
|
content: plain.content,
|
|
2836
2840
|
alias: plain.alias,
|
|
2837
2841
|
userUuid: plain.user_uuid,
|
|
@@ -2923,7 +2927,7 @@ class Voicemail {
|
|
|
2923
2927
|
static parse(plain ) {
|
|
2924
2928
|
return new Voicemail({
|
|
2925
2929
|
id: plain.id,
|
|
2926
|
-
date: moment__default[
|
|
2930
|
+
date: moment__default['default'](plain.timestamp * 1000).toDate(),
|
|
2927
2931
|
duration: plain.duration * 1000,
|
|
2928
2932
|
caller: {
|
|
2929
2933
|
name: plain.caller_id_name,
|
|
@@ -3060,7 +3064,7 @@ class Call {
|
|
|
3060
3064
|
onHold: plain.on_hold,
|
|
3061
3065
|
status: plain.status,
|
|
3062
3066
|
lineId: plain.line_id,
|
|
3063
|
-
startingTime: moment__default[
|
|
3067
|
+
startingTime: moment__default['default'](plain.creation_time).toDate(),
|
|
3064
3068
|
talkingToIds: Object.keys(plain.talking_to || {}),
|
|
3065
3069
|
recording: plain.record_state === RECORD_STATE_ACTIVE,
|
|
3066
3070
|
});
|
|
@@ -3195,7 +3199,7 @@ class Emitter {
|
|
|
3195
3199
|
|
|
3196
3200
|
|
|
3197
3201
|
constructor() {
|
|
3198
|
-
this.eventEmitter = new EventEmitter__default[
|
|
3202
|
+
this.eventEmitter = new EventEmitter__default['default']();
|
|
3199
3203
|
}
|
|
3200
3204
|
|
|
3201
3205
|
on(event , callback ) {
|
|
@@ -3240,7 +3244,7 @@ class Recording {
|
|
|
3240
3244
|
|
|
3241
3245
|
|
|
3242
3246
|
|
|
3243
|
-
static parseMany(recordings
|
|
3247
|
+
static parseMany(recordings = []) {
|
|
3244
3248
|
return recordings.map(item => Recording.parse(item));
|
|
3245
3249
|
}
|
|
3246
3250
|
|
|
@@ -3248,8 +3252,8 @@ class Recording {
|
|
|
3248
3252
|
return new Recording({
|
|
3249
3253
|
deleted: plain.deleted,
|
|
3250
3254
|
fileName: plain.filename,
|
|
3251
|
-
end: plain.end_time ? moment__default[
|
|
3252
|
-
start: moment__default[
|
|
3255
|
+
end: plain.end_time ? moment__default['default'](plain.end_time).toDate() : null,
|
|
3256
|
+
start: moment__default['default'](plain.start_time).toDate(),
|
|
3253
3257
|
uuid: plain.uuid,
|
|
3254
3258
|
});
|
|
3255
3259
|
}
|
|
@@ -3347,7 +3351,7 @@ class CallLog {
|
|
|
3347
3351
|
|
|
3348
3352
|
static parse(plain ) {
|
|
3349
3353
|
return new CallLog({
|
|
3350
|
-
answer: plain.answer ? moment__default[
|
|
3354
|
+
answer: plain.answer ? moment__default['default'](plain.answer).toDate() : null,
|
|
3351
3355
|
answered: plain.answered,
|
|
3352
3356
|
callDirection: plain.call_direction,
|
|
3353
3357
|
destination: {
|
|
@@ -3364,9 +3368,9 @@ class CallLog {
|
|
|
3364
3368
|
},
|
|
3365
3369
|
id: plain.id,
|
|
3366
3370
|
duration: (plain.duration || 0) * 1000, // duration is in seconds
|
|
3367
|
-
start: moment__default[
|
|
3368
|
-
end: plain.end ? moment__default[
|
|
3369
|
-
recordings: Recording.parseMany(plain.recordings),
|
|
3371
|
+
start: moment__default['default'](plain.start).toDate(),
|
|
3372
|
+
end: plain.end ? moment__default['default'](plain.end).toDate() : null,
|
|
3373
|
+
recordings: Recording.parseMany(plain.recordings || []),
|
|
3370
3374
|
});
|
|
3371
3375
|
}
|
|
3372
3376
|
|
|
@@ -4968,7 +4972,7 @@ class WebSocketClient extends Emitter {
|
|
|
4968
4972
|
|
|
4969
4973
|
connect() {
|
|
4970
4974
|
logger$2.info('connect method started', { host: this.host, token: this.token });
|
|
4971
|
-
this.socket = new ReconnectingWebSocket__default[
|
|
4975
|
+
this.socket = new ReconnectingWebSocket__default['default'](this._getUrl.bind(this), [], this.options);
|
|
4972
4976
|
if (this.options.binaryType) {
|
|
4973
4977
|
this.socket.binaryType = this.options.binaryType;
|
|
4974
4978
|
}
|
|
@@ -5305,7 +5309,7 @@ const parseCandidate$1 = (candidate ) => {
|
|
|
5305
5309
|
if (!candidate) {
|
|
5306
5310
|
return null;
|
|
5307
5311
|
}
|
|
5308
|
-
const result = sdpParser__default[
|
|
5312
|
+
const result = sdpParser__default['default'].parse(candidate.indexOf('a=') === 0 ? candidate : `a=${candidate}`);
|
|
5309
5313
|
|
|
5310
5314
|
return result.candidates ? result.candidates[0] : null;
|
|
5311
5315
|
};
|
|
@@ -5319,7 +5323,7 @@ const areCandidateValid = (candidates ) =>
|
|
|
5319
5323
|
.length > 0;
|
|
5320
5324
|
|
|
5321
5325
|
const getVideoDirection = (sdp ) => {
|
|
5322
|
-
const parsedSdp = sdpParser__default[
|
|
5326
|
+
const parsedSdp = sdpParser__default['default'].parse(sdp);
|
|
5323
5327
|
const videoMedia = parsedSdp.media.find(media => media.type === 'video');
|
|
5324
5328
|
if (!videoMedia) {
|
|
5325
5329
|
return null;
|
|
@@ -5333,14 +5337,14 @@ const hasAnActiveVideo = (sdp ) => {
|
|
|
5333
5337
|
return false;
|
|
5334
5338
|
}
|
|
5335
5339
|
|
|
5336
|
-
const parsedSdp = sdpParser__default[
|
|
5340
|
+
const parsedSdp = sdpParser__default['default'].parse(sdp);
|
|
5337
5341
|
|
|
5338
5342
|
return !!parsedSdp.media.find(media =>
|
|
5339
5343
|
media.type === 'video' && media.port > 10 && (!media.direction || media.direction !== 'inactive'));
|
|
5340
5344
|
};
|
|
5341
5345
|
|
|
5342
5346
|
const fixSdp = (sdp , candidates , forcePort = true) => {
|
|
5343
|
-
const parsedSdp = sdpParser__default[
|
|
5347
|
+
const parsedSdp = sdpParser__default['default'].parse(sdp);
|
|
5344
5348
|
const mainCandidate = getSrflxOrRelay(candidates)[0];
|
|
5345
5349
|
const ip = mainCandidate ? mainCandidate.ip : null;
|
|
5346
5350
|
|
|
@@ -5358,7 +5362,7 @@ const fixSdp = (sdp , candidates , forcePort = true)
|
|
|
5358
5362
|
};
|
|
5359
5363
|
});
|
|
5360
5364
|
|
|
5361
|
-
let fixed = sdpParser__default[
|
|
5365
|
+
let fixed = sdpParser__default['default'].write(parsedSdp);
|
|
5362
5366
|
|
|
5363
5367
|
if (ip) {
|
|
5364
5368
|
fixed = fixed.replace(/IN IP4 0.0.0.0/g, `IN IP4 ${ip}`);
|
|
@@ -5404,7 +5408,7 @@ class WazoSessionDescriptionHandler extends sessionDescriptionHandler.SessionDes
|
|
|
5404
5408
|
) {
|
|
5405
5409
|
super(logger, mediaStreamFactory, sessionDescriptionHandlerConfiguration);
|
|
5406
5410
|
|
|
5407
|
-
this.eventEmitter = new EventEmitter__default[
|
|
5411
|
+
this.eventEmitter = new EventEmitter__default['default']();
|
|
5408
5412
|
this.isWeb = isWeb;
|
|
5409
5413
|
this.session = session;
|
|
5410
5414
|
}
|
|
@@ -6623,7 +6627,7 @@ class WebRTCClient extends Emitter {
|
|
|
6623
6627
|
// We search for the last transceiver without `video-` in the mid (video- means remote transceiver)
|
|
6624
6628
|
const transceivers = pc.getTransceivers();
|
|
6625
6629
|
const transceiverIdx = lastIndexOf(transceivers, transceiver =>
|
|
6626
|
-
transceiver.sender.track === null && transceiver.mid.indexOf('video') === -1);
|
|
6630
|
+
transceiver.sender.track === null && transceiver.mid && transceiver.mid.indexOf('video') === -1);
|
|
6627
6631
|
|
|
6628
6632
|
videoSender = transceiverIdx !== -1 ? transceivers[transceiverIdx].sender : null;
|
|
6629
6633
|
} else {
|
|
@@ -7828,7 +7832,7 @@ class WebRTCClient extends Emitter {
|
|
|
7828
7832
|
}
|
|
7829
7833
|
const sessionId = this.getSipSessionId(session);
|
|
7830
7834
|
|
|
7831
|
-
getStats__default[
|
|
7835
|
+
getStats__default['default'](pc, (result ) => {
|
|
7832
7836
|
const { results, internal, nomore, ...stats } = result;
|
|
7833
7837
|
this.statsIntervals[sessionId] = nomore;
|
|
7834
7838
|
|
|
@@ -211,7 +211,7 @@ class IssueReporter {
|
|
|
211
211
|
args.splice(1, 1);
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
const date = moment__default[
|
|
214
|
+
const date = moment__default['default']().format('YYYY-MM-DD HH:mm:ss.SSS');
|
|
215
215
|
const message = args.join(', ');
|
|
216
216
|
let consoleMessage = message;
|
|
217
217
|
|
|
@@ -388,7 +388,7 @@ class IssueReporter {
|
|
|
388
388
|
payload._retry = retry + 1;
|
|
389
389
|
}
|
|
390
390
|
|
|
391
|
-
this._sendDebugToGrafana(
|
|
391
|
+
this._sendDebugToGrafana(payload, retry + 1);
|
|
392
392
|
}, 5000 + retry * 1000);
|
|
393
393
|
});
|
|
394
394
|
}
|
|
@@ -2591,7 +2591,8 @@ class ExternalApp {
|
|
|
2591
2591
|
|
|
2592
2592
|
|
|
2593
2593
|
|
|
2594
|
-
|
|
2594
|
+
|
|
2595
|
+
|
|
2595
2596
|
|
|
2596
2597
|
|
|
2597
2598
|
class Meeting {
|
|
@@ -2603,6 +2604,7 @@ class Meeting {
|
|
|
2603
2604
|
|
|
2604
2605
|
|
|
2605
2606
|
|
|
2607
|
+
|
|
2606
2608
|
|
|
2607
2609
|
|
|
2608
2610
|
static parse(plain ) {
|
|
@@ -2614,6 +2616,7 @@ class Meeting {
|
|
|
2614
2616
|
port: plain.port,
|
|
2615
2617
|
uuid: plain.uuid,
|
|
2616
2618
|
number: plain.number,
|
|
2619
|
+
persistent: plain.persistent,
|
|
2617
2620
|
});
|
|
2618
2621
|
}
|
|
2619
2622
|
|
|
@@ -2621,7 +2624,7 @@ class Meeting {
|
|
|
2621
2624
|
return newFrom(meeting, Meeting);
|
|
2622
2625
|
}
|
|
2623
2626
|
|
|
2624
|
-
constructor({ uuid, name, guestSipAuthorization, ownerUuids, port, uri, number } = {}) {
|
|
2627
|
+
constructor({ uuid, name, guestSipAuthorization, ownerUuids, port, uri, number, persistent } = {}) {
|
|
2625
2628
|
this.guestSipAuthorization = guestSipAuthorization;
|
|
2626
2629
|
this.uri = uri;
|
|
2627
2630
|
this.name = name;
|
|
@@ -2629,6 +2632,7 @@ class Meeting {
|
|
|
2629
2632
|
this.port = port;
|
|
2630
2633
|
this.uuid = uuid;
|
|
2631
2634
|
this.number = number;
|
|
2635
|
+
this.persistent = persistent;
|
|
2632
2636
|
|
|
2633
2637
|
// Useful to compare instead of instanceof with minified code
|
|
2634
2638
|
this.type = 'Meeting';
|
|
@@ -2809,7 +2813,7 @@ class ChatMessage {
|
|
|
2809
2813
|
static parse(plain ) {
|
|
2810
2814
|
return new ChatMessage({
|
|
2811
2815
|
uuid: plain.uuid,
|
|
2812
|
-
date: moment__default[
|
|
2816
|
+
date: moment__default['default'](plain.created_at).toDate(),
|
|
2813
2817
|
content: plain.content,
|
|
2814
2818
|
alias: plain.alias,
|
|
2815
2819
|
userUuid: plain.user_uuid,
|
|
@@ -2901,7 +2905,7 @@ class Voicemail {
|
|
|
2901
2905
|
static parse(plain ) {
|
|
2902
2906
|
return new Voicemail({
|
|
2903
2907
|
id: plain.id,
|
|
2904
|
-
date: moment__default[
|
|
2908
|
+
date: moment__default['default'](plain.timestamp * 1000).toDate(),
|
|
2905
2909
|
duration: plain.duration * 1000,
|
|
2906
2910
|
caller: {
|
|
2907
2911
|
name: plain.caller_id_name,
|
|
@@ -3038,7 +3042,7 @@ class Call {
|
|
|
3038
3042
|
onHold: plain.on_hold,
|
|
3039
3043
|
status: plain.status,
|
|
3040
3044
|
lineId: plain.line_id,
|
|
3041
|
-
startingTime: moment__default[
|
|
3045
|
+
startingTime: moment__default['default'](plain.creation_time).toDate(),
|
|
3042
3046
|
talkingToIds: Object.keys(plain.talking_to || {}),
|
|
3043
3047
|
recording: plain.record_state === RECORD_STATE_ACTIVE,
|
|
3044
3048
|
});
|
|
@@ -3192,7 +3196,7 @@ class Recording {
|
|
|
3192
3196
|
|
|
3193
3197
|
|
|
3194
3198
|
|
|
3195
|
-
static parseMany(recordings
|
|
3199
|
+
static parseMany(recordings = []) {
|
|
3196
3200
|
return recordings.map(item => Recording.parse(item));
|
|
3197
3201
|
}
|
|
3198
3202
|
|
|
@@ -3200,8 +3204,8 @@ class Recording {
|
|
|
3200
3204
|
return new Recording({
|
|
3201
3205
|
deleted: plain.deleted,
|
|
3202
3206
|
fileName: plain.filename,
|
|
3203
|
-
end: plain.end_time ? moment__default[
|
|
3204
|
-
start: moment__default[
|
|
3207
|
+
end: plain.end_time ? moment__default['default'](plain.end_time).toDate() : null,
|
|
3208
|
+
start: moment__default['default'](plain.start_time).toDate(),
|
|
3205
3209
|
uuid: plain.uuid,
|
|
3206
3210
|
});
|
|
3207
3211
|
}
|
|
@@ -3299,7 +3303,7 @@ class CallLog {
|
|
|
3299
3303
|
|
|
3300
3304
|
static parse(plain ) {
|
|
3301
3305
|
return new CallLog({
|
|
3302
|
-
answer: plain.answer ? moment__default[
|
|
3306
|
+
answer: plain.answer ? moment__default['default'](plain.answer).toDate() : null,
|
|
3303
3307
|
answered: plain.answered,
|
|
3304
3308
|
callDirection: plain.call_direction,
|
|
3305
3309
|
destination: {
|
|
@@ -3316,9 +3320,9 @@ class CallLog {
|
|
|
3316
3320
|
},
|
|
3317
3321
|
id: plain.id,
|
|
3318
3322
|
duration: (plain.duration || 0) * 1000, // duration is in seconds
|
|
3319
|
-
start: moment__default[
|
|
3320
|
-
end: plain.end ? moment__default[
|
|
3321
|
-
recordings: Recording.parseMany(plain.recordings),
|
|
3323
|
+
start: moment__default['default'](plain.start).toDate(),
|
|
3324
|
+
end: plain.end ? moment__default['default'](plain.end).toDate() : null,
|
|
3325
|
+
recordings: Recording.parseMany(plain.recordings || []),
|
|
3322
3326
|
});
|
|
3323
3327
|
}
|
|
3324
3328
|
|
|
@@ -211,7 +211,7 @@ class IssueReporter {
|
|
|
211
211
|
args.splice(1, 1);
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
const date = moment__default[
|
|
214
|
+
const date = moment__default['default']().format('YYYY-MM-DD HH:mm:ss.SSS');
|
|
215
215
|
const message = args.join(', ');
|
|
216
216
|
let consoleMessage = message;
|
|
217
217
|
|
|
@@ -388,7 +388,7 @@ class IssueReporter {
|
|
|
388
388
|
payload._retry = retry + 1;
|
|
389
389
|
}
|
|
390
390
|
|
|
391
|
-
this._sendDebugToGrafana(
|
|
391
|
+
this._sendDebugToGrafana(payload, retry + 1);
|
|
392
392
|
}, 5000 + retry * 1000);
|
|
393
393
|
});
|
|
394
394
|
}
|
|
@@ -2591,7 +2591,8 @@ class ExternalApp {
|
|
|
2591
2591
|
|
|
2592
2592
|
|
|
2593
2593
|
|
|
2594
|
-
|
|
2594
|
+
|
|
2595
|
+
|
|
2595
2596
|
|
|
2596
2597
|
|
|
2597
2598
|
class Meeting {
|
|
@@ -2603,6 +2604,7 @@ class Meeting {
|
|
|
2603
2604
|
|
|
2604
2605
|
|
|
2605
2606
|
|
|
2607
|
+
|
|
2606
2608
|
|
|
2607
2609
|
|
|
2608
2610
|
static parse(plain ) {
|
|
@@ -2614,6 +2616,7 @@ class Meeting {
|
|
|
2614
2616
|
port: plain.port,
|
|
2615
2617
|
uuid: plain.uuid,
|
|
2616
2618
|
number: plain.number,
|
|
2619
|
+
persistent: plain.persistent,
|
|
2617
2620
|
});
|
|
2618
2621
|
}
|
|
2619
2622
|
|
|
@@ -2621,7 +2624,7 @@ class Meeting {
|
|
|
2621
2624
|
return newFrom(meeting, Meeting);
|
|
2622
2625
|
}
|
|
2623
2626
|
|
|
2624
|
-
constructor({ uuid, name, guestSipAuthorization, ownerUuids, port, uri, number } = {}) {
|
|
2627
|
+
constructor({ uuid, name, guestSipAuthorization, ownerUuids, port, uri, number, persistent } = {}) {
|
|
2625
2628
|
this.guestSipAuthorization = guestSipAuthorization;
|
|
2626
2629
|
this.uri = uri;
|
|
2627
2630
|
this.name = name;
|
|
@@ -2629,6 +2632,7 @@ class Meeting {
|
|
|
2629
2632
|
this.port = port;
|
|
2630
2633
|
this.uuid = uuid;
|
|
2631
2634
|
this.number = number;
|
|
2635
|
+
this.persistent = persistent;
|
|
2632
2636
|
|
|
2633
2637
|
// Useful to compare instead of instanceof with minified code
|
|
2634
2638
|
this.type = 'Meeting';
|
|
@@ -2809,7 +2813,7 @@ class ChatMessage {
|
|
|
2809
2813
|
static parse(plain ) {
|
|
2810
2814
|
return new ChatMessage({
|
|
2811
2815
|
uuid: plain.uuid,
|
|
2812
|
-
date: moment__default[
|
|
2816
|
+
date: moment__default['default'](plain.created_at).toDate(),
|
|
2813
2817
|
content: plain.content,
|
|
2814
2818
|
alias: plain.alias,
|
|
2815
2819
|
userUuid: plain.user_uuid,
|
|
@@ -2901,7 +2905,7 @@ class Voicemail {
|
|
|
2901
2905
|
static parse(plain ) {
|
|
2902
2906
|
return new Voicemail({
|
|
2903
2907
|
id: plain.id,
|
|
2904
|
-
date: moment__default[
|
|
2908
|
+
date: moment__default['default'](plain.timestamp * 1000).toDate(),
|
|
2905
2909
|
duration: plain.duration * 1000,
|
|
2906
2910
|
caller: {
|
|
2907
2911
|
name: plain.caller_id_name,
|
|
@@ -3038,7 +3042,7 @@ class Call {
|
|
|
3038
3042
|
onHold: plain.on_hold,
|
|
3039
3043
|
status: plain.status,
|
|
3040
3044
|
lineId: plain.line_id,
|
|
3041
|
-
startingTime: moment__default[
|
|
3045
|
+
startingTime: moment__default['default'](plain.creation_time).toDate(),
|
|
3042
3046
|
talkingToIds: Object.keys(plain.talking_to || {}),
|
|
3043
3047
|
recording: plain.record_state === RECORD_STATE_ACTIVE,
|
|
3044
3048
|
});
|
|
@@ -3192,7 +3196,7 @@ class Recording {
|
|
|
3192
3196
|
|
|
3193
3197
|
|
|
3194
3198
|
|
|
3195
|
-
static parseMany(recordings
|
|
3199
|
+
static parseMany(recordings = []) {
|
|
3196
3200
|
return recordings.map(item => Recording.parse(item));
|
|
3197
3201
|
}
|
|
3198
3202
|
|
|
@@ -3200,8 +3204,8 @@ class Recording {
|
|
|
3200
3204
|
return new Recording({
|
|
3201
3205
|
deleted: plain.deleted,
|
|
3202
3206
|
fileName: plain.filename,
|
|
3203
|
-
end: plain.end_time ? moment__default[
|
|
3204
|
-
start: moment__default[
|
|
3207
|
+
end: plain.end_time ? moment__default['default'](plain.end_time).toDate() : null,
|
|
3208
|
+
start: moment__default['default'](plain.start_time).toDate(),
|
|
3205
3209
|
uuid: plain.uuid,
|
|
3206
3210
|
});
|
|
3207
3211
|
}
|
|
@@ -3299,7 +3303,7 @@ class CallLog {
|
|
|
3299
3303
|
|
|
3300
3304
|
static parse(plain ) {
|
|
3301
3305
|
return new CallLog({
|
|
3302
|
-
answer: plain.answer ? moment__default[
|
|
3306
|
+
answer: plain.answer ? moment__default['default'](plain.answer).toDate() : null,
|
|
3303
3307
|
answered: plain.answered,
|
|
3304
3308
|
callDirection: plain.call_direction,
|
|
3305
3309
|
destination: {
|
|
@@ -3316,9 +3320,9 @@ class CallLog {
|
|
|
3316
3320
|
},
|
|
3317
3321
|
id: plain.id,
|
|
3318
3322
|
duration: (plain.duration || 0) * 1000, // duration is in seconds
|
|
3319
|
-
start: moment__default[
|
|
3320
|
-
end: plain.end ? moment__default[
|
|
3321
|
-
recordings: Recording.parseMany(plain.recordings),
|
|
3323
|
+
start: moment__default['default'](plain.start).toDate(),
|
|
3324
|
+
end: plain.end ? moment__default['default'](plain.end).toDate() : null,
|
|
3325
|
+
recordings: Recording.parseMany(plain.recordings || []),
|
|
3322
3326
|
});
|
|
3323
3327
|
}
|
|
3324
3328
|
|