@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
|
@@ -40,7 +40,7 @@ class Emitter {
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
constructor() {
|
|
43
|
-
this.eventEmitter = new EventEmitter__default[
|
|
43
|
+
this.eventEmitter = new EventEmitter__default['default']();
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
on(event , callback ) {
|
|
@@ -525,7 +525,7 @@ class IssueReporter {
|
|
|
525
525
|
args.splice(1, 1);
|
|
526
526
|
}
|
|
527
527
|
|
|
528
|
-
const date = moment__default[
|
|
528
|
+
const date = moment__default['default']().format('YYYY-MM-DD HH:mm:ss.SSS');
|
|
529
529
|
const message = args.join(', ');
|
|
530
530
|
let consoleMessage = message;
|
|
531
531
|
|
|
@@ -702,7 +702,7 @@ class IssueReporter {
|
|
|
702
702
|
payload._retry = retry + 1;
|
|
703
703
|
}
|
|
704
704
|
|
|
705
|
-
this._sendDebugToGrafana(
|
|
705
|
+
this._sendDebugToGrafana(payload, retry + 1);
|
|
706
706
|
}, 5000 + retry * 1000);
|
|
707
707
|
});
|
|
708
708
|
}
|
|
@@ -2640,7 +2640,8 @@ class ExternalApp {
|
|
|
2640
2640
|
|
|
2641
2641
|
|
|
2642
2642
|
|
|
2643
|
-
|
|
2643
|
+
|
|
2644
|
+
|
|
2644
2645
|
|
|
2645
2646
|
|
|
2646
2647
|
class Meeting {
|
|
@@ -2652,6 +2653,7 @@ class Meeting {
|
|
|
2652
2653
|
|
|
2653
2654
|
|
|
2654
2655
|
|
|
2656
|
+
|
|
2655
2657
|
|
|
2656
2658
|
|
|
2657
2659
|
static parse(plain ) {
|
|
@@ -2663,6 +2665,7 @@ class Meeting {
|
|
|
2663
2665
|
port: plain.port,
|
|
2664
2666
|
uuid: plain.uuid,
|
|
2665
2667
|
number: plain.number,
|
|
2668
|
+
persistent: plain.persistent,
|
|
2666
2669
|
});
|
|
2667
2670
|
}
|
|
2668
2671
|
|
|
@@ -2670,7 +2673,7 @@ class Meeting {
|
|
|
2670
2673
|
return newFrom(meeting, Meeting);
|
|
2671
2674
|
}
|
|
2672
2675
|
|
|
2673
|
-
constructor({ uuid, name, guestSipAuthorization, ownerUuids, port, uri, number } = {}) {
|
|
2676
|
+
constructor({ uuid, name, guestSipAuthorization, ownerUuids, port, uri, number, persistent } = {}) {
|
|
2674
2677
|
this.guestSipAuthorization = guestSipAuthorization;
|
|
2675
2678
|
this.uri = uri;
|
|
2676
2679
|
this.name = name;
|
|
@@ -2678,6 +2681,7 @@ class Meeting {
|
|
|
2678
2681
|
this.port = port;
|
|
2679
2682
|
this.uuid = uuid;
|
|
2680
2683
|
this.number = number;
|
|
2684
|
+
this.persistent = persistent;
|
|
2681
2685
|
|
|
2682
2686
|
// Useful to compare instead of instanceof with minified code
|
|
2683
2687
|
this.type = 'Meeting';
|
|
@@ -2858,7 +2862,7 @@ class ChatMessage {
|
|
|
2858
2862
|
static parse(plain ) {
|
|
2859
2863
|
return new ChatMessage({
|
|
2860
2864
|
uuid: plain.uuid,
|
|
2861
|
-
date: moment__default[
|
|
2865
|
+
date: moment__default['default'](plain.created_at).toDate(),
|
|
2862
2866
|
content: plain.content,
|
|
2863
2867
|
alias: plain.alias,
|
|
2864
2868
|
userUuid: plain.user_uuid,
|
|
@@ -2950,7 +2954,7 @@ class Voicemail {
|
|
|
2950
2954
|
static parse(plain ) {
|
|
2951
2955
|
return new Voicemail({
|
|
2952
2956
|
id: plain.id,
|
|
2953
|
-
date: moment__default[
|
|
2957
|
+
date: moment__default['default'](plain.timestamp * 1000).toDate(),
|
|
2954
2958
|
duration: plain.duration * 1000,
|
|
2955
2959
|
caller: {
|
|
2956
2960
|
name: plain.caller_id_name,
|
|
@@ -3087,7 +3091,7 @@ class Call {
|
|
|
3087
3091
|
onHold: plain.on_hold,
|
|
3088
3092
|
status: plain.status,
|
|
3089
3093
|
lineId: plain.line_id,
|
|
3090
|
-
startingTime: moment__default[
|
|
3094
|
+
startingTime: moment__default['default'](plain.creation_time).toDate(),
|
|
3091
3095
|
talkingToIds: Object.keys(plain.talking_to || {}),
|
|
3092
3096
|
recording: plain.record_state === RECORD_STATE_ACTIVE,
|
|
3093
3097
|
});
|
|
@@ -3586,7 +3590,7 @@ class Recording {
|
|
|
3586
3590
|
|
|
3587
3591
|
|
|
3588
3592
|
|
|
3589
|
-
static parseMany(recordings
|
|
3593
|
+
static parseMany(recordings = []) {
|
|
3590
3594
|
return recordings.map(item => Recording.parse(item));
|
|
3591
3595
|
}
|
|
3592
3596
|
|
|
@@ -3594,8 +3598,8 @@ class Recording {
|
|
|
3594
3598
|
return new Recording({
|
|
3595
3599
|
deleted: plain.deleted,
|
|
3596
3600
|
fileName: plain.filename,
|
|
3597
|
-
end: plain.end_time ? moment__default[
|
|
3598
|
-
start: moment__default[
|
|
3601
|
+
end: plain.end_time ? moment__default['default'](plain.end_time).toDate() : null,
|
|
3602
|
+
start: moment__default['default'](plain.start_time).toDate(),
|
|
3599
3603
|
uuid: plain.uuid,
|
|
3600
3604
|
});
|
|
3601
3605
|
}
|
|
@@ -3693,7 +3697,7 @@ class CallLog {
|
|
|
3693
3697
|
|
|
3694
3698
|
static parse(plain ) {
|
|
3695
3699
|
return new CallLog({
|
|
3696
|
-
answer: plain.answer ? moment__default[
|
|
3700
|
+
answer: plain.answer ? moment__default['default'](plain.answer).toDate() : null,
|
|
3697
3701
|
answered: plain.answered,
|
|
3698
3702
|
callDirection: plain.call_direction,
|
|
3699
3703
|
destination: {
|
|
@@ -3710,9 +3714,9 @@ class CallLog {
|
|
|
3710
3714
|
},
|
|
3711
3715
|
id: plain.id,
|
|
3712
3716
|
duration: (plain.duration || 0) * 1000, // duration is in seconds
|
|
3713
|
-
start: moment__default[
|
|
3714
|
-
end: plain.end ? moment__default[
|
|
3715
|
-
recordings: Recording.parseMany(plain.recordings),
|
|
3717
|
+
start: moment__default['default'](plain.start).toDate(),
|
|
3718
|
+
end: plain.end ? moment__default['default'](plain.end).toDate() : null,
|
|
3719
|
+
recordings: Recording.parseMany(plain.recordings || []),
|
|
3716
3720
|
});
|
|
3717
3721
|
}
|
|
3718
3722
|
|
|
@@ -5886,7 +5890,7 @@ const parseCandidate$1 = (candidate ) => {
|
|
|
5886
5890
|
if (!candidate) {
|
|
5887
5891
|
return null;
|
|
5888
5892
|
}
|
|
5889
|
-
const result = sdpParser__default[
|
|
5893
|
+
const result = sdpParser__default['default'].parse(candidate.indexOf('a=') === 0 ? candidate : `a=${candidate}`);
|
|
5890
5894
|
|
|
5891
5895
|
return result.candidates ? result.candidates[0] : null;
|
|
5892
5896
|
};
|
|
@@ -5900,7 +5904,7 @@ const areCandidateValid = (candidates ) =>
|
|
|
5900
5904
|
.length > 0;
|
|
5901
5905
|
|
|
5902
5906
|
const getVideoDirection = (sdp ) => {
|
|
5903
|
-
const parsedSdp = sdpParser__default[
|
|
5907
|
+
const parsedSdp = sdpParser__default['default'].parse(sdp);
|
|
5904
5908
|
const videoMedia = parsedSdp.media.find(media => media.type === 'video');
|
|
5905
5909
|
if (!videoMedia) {
|
|
5906
5910
|
return null;
|
|
@@ -5914,14 +5918,14 @@ const hasAnActiveVideo = (sdp ) => {
|
|
|
5914
5918
|
return false;
|
|
5915
5919
|
}
|
|
5916
5920
|
|
|
5917
|
-
const parsedSdp = sdpParser__default[
|
|
5921
|
+
const parsedSdp = sdpParser__default['default'].parse(sdp);
|
|
5918
5922
|
|
|
5919
5923
|
return !!parsedSdp.media.find(media =>
|
|
5920
5924
|
media.type === 'video' && media.port > 10 && (!media.direction || media.direction !== 'inactive'));
|
|
5921
5925
|
};
|
|
5922
5926
|
|
|
5923
5927
|
const fixSdp = (sdp , candidates , forcePort = true) => {
|
|
5924
|
-
const parsedSdp = sdpParser__default[
|
|
5928
|
+
const parsedSdp = sdpParser__default['default'].parse(sdp);
|
|
5925
5929
|
const mainCandidate = getSrflxOrRelay(candidates)[0];
|
|
5926
5930
|
const ip = mainCandidate ? mainCandidate.ip : null;
|
|
5927
5931
|
|
|
@@ -5939,7 +5943,7 @@ const fixSdp = (sdp , candidates , forcePort = true)
|
|
|
5939
5943
|
};
|
|
5940
5944
|
});
|
|
5941
5945
|
|
|
5942
|
-
let fixed = sdpParser__default[
|
|
5946
|
+
let fixed = sdpParser__default['default'].write(parsedSdp);
|
|
5943
5947
|
|
|
5944
5948
|
if (ip) {
|
|
5945
5949
|
fixed = fixed.replace(/IN IP4 0.0.0.0/g, `IN IP4 ${ip}`);
|
|
@@ -5985,7 +5989,7 @@ class WazoSessionDescriptionHandler extends sessionDescriptionHandler.SessionDes
|
|
|
5985
5989
|
) {
|
|
5986
5990
|
super(logger, mediaStreamFactory, sessionDescriptionHandlerConfiguration);
|
|
5987
5991
|
|
|
5988
|
-
this.eventEmitter = new EventEmitter__default[
|
|
5992
|
+
this.eventEmitter = new EventEmitter__default['default']();
|
|
5989
5993
|
this.isWeb = isWeb;
|
|
5990
5994
|
this.session = session;
|
|
5991
5995
|
}
|
|
@@ -7302,7 +7306,7 @@ class WebRTCClient extends Emitter {
|
|
|
7302
7306
|
// We search for the last transceiver without `video-` in the mid (video- means remote transceiver)
|
|
7303
7307
|
const transceivers = pc.getTransceivers();
|
|
7304
7308
|
const transceiverIdx = lastIndexOf(transceivers, transceiver =>
|
|
7305
|
-
transceiver.sender.track === null && transceiver.mid.indexOf('video') === -1);
|
|
7309
|
+
transceiver.sender.track === null && transceiver.mid && transceiver.mid.indexOf('video') === -1);
|
|
7306
7310
|
|
|
7307
7311
|
videoSender = transceiverIdx !== -1 ? transceivers[transceiverIdx].sender : null;
|
|
7308
7312
|
} else {
|
|
@@ -8507,7 +8511,7 @@ class WebRTCClient extends Emitter {
|
|
|
8507
8511
|
}
|
|
8508
8512
|
const sessionId = this.getSipSessionId(session);
|
|
8509
8513
|
|
|
8510
|
-
getStats__default[
|
|
8514
|
+
getStats__default['default'](pc, (result ) => {
|
|
8511
8515
|
const { results, internal, nomore, ...stats } = result;
|
|
8512
8516
|
this.statsIntervals[sessionId] = nomore;
|
|
8513
8517
|
|
|
@@ -10889,7 +10893,7 @@ class WebSocketClient extends Emitter {
|
|
|
10889
10893
|
|
|
10890
10894
|
connect() {
|
|
10891
10895
|
logger$5.info('connect method started', { host: this.host, token: this.token });
|
|
10892
|
-
this.socket = new ReconnectingWebSocket__default[
|
|
10896
|
+
this.socket = new ReconnectingWebSocket__default['default'](this._getUrl.bind(this), [], this.options);
|
|
10893
10897
|
if (this.options.binaryType) {
|
|
10894
10898
|
this.socket.binaryType = this.options.binaryType;
|
|
10895
10899
|
}
|
|
@@ -11341,7 +11345,7 @@ var Websocket$1 = global.wazoWebsocketInstance;
|
|
|
11341
11345
|
|
|
11342
11346
|
const logger$3 = IssueReporter$1.loggerFor('sdk-sip-room');
|
|
11343
11347
|
|
|
11344
|
-
class SipRoom extends Room
|
|
11348
|
+
class SipRoom extends Room {
|
|
11345
11349
|
|
|
11346
11350
|
static async connect({ extension, constraints, audioOnly = false, extra, room } ) {
|
|
11347
11351
|
logger$3.info('connecting to sip room', { extension, audioOnly, room: !!room });
|
|
@@ -11671,7 +11675,7 @@ class NotificationOptions {
|
|
|
11671
11675
|
|
|
11672
11676
|
|
|
11673
11677
|
// Represents a conference room, like `9000`.
|
|
11674
|
-
class Room$
|
|
11678
|
+
class Room$1 {
|
|
11675
11679
|
|
|
11676
11680
|
|
|
11677
11681
|
|
|
@@ -11692,7 +11696,7 @@ class Room$2 {
|
|
|
11692
11696
|
}
|
|
11693
11697
|
|
|
11694
11698
|
connect(callSession ) {
|
|
11695
|
-
return new Room$
|
|
11699
|
+
return new Room$1({ ...this, connectedCallSession: callSession });
|
|
11696
11700
|
}
|
|
11697
11701
|
|
|
11698
11702
|
has(callSession ) {
|
|
@@ -11701,7 +11705,7 @@ class Room$2 {
|
|
|
11701
11705
|
|
|
11702
11706
|
addParticipant(uuid , extension , talking = null) {
|
|
11703
11707
|
if (!this.participants.some(participant => participant.uuid === uuid || participant.extension === extension)) {
|
|
11704
|
-
return new Room$
|
|
11708
|
+
return new Room$1({ ...this, participants: [...this.participants, { uuid, extension, talking }] });
|
|
11705
11709
|
}
|
|
11706
11710
|
|
|
11707
11711
|
return this;
|
|
@@ -11720,7 +11724,7 @@ class Room$2 {
|
|
|
11720
11724
|
updatedParticipants.push(participant);
|
|
11721
11725
|
}
|
|
11722
11726
|
|
|
11723
|
-
return new Room$
|
|
11727
|
+
return new Room$1({ ...this, participants: updatedParticipants });
|
|
11724
11728
|
}
|
|
11725
11729
|
|
|
11726
11730
|
updateParticipantByExtension(extension , participant , shouldAdd = false) {
|
|
@@ -11736,7 +11740,7 @@ class Room$2 {
|
|
|
11736
11740
|
updatedParticipants.push(participant);
|
|
11737
11741
|
}
|
|
11738
11742
|
|
|
11739
|
-
return new Room$
|
|
11743
|
+
return new Room$1({ ...this, participants: updatedParticipants });
|
|
11740
11744
|
}
|
|
11741
11745
|
|
|
11742
11746
|
hasCallWithId(id ) {
|
|
@@ -11744,18 +11748,18 @@ class Room$2 {
|
|
|
11744
11748
|
}
|
|
11745
11749
|
|
|
11746
11750
|
disconnect() {
|
|
11747
|
-
return new Room$
|
|
11751
|
+
return new Room$1({ ...this, connectedCallSession: null });
|
|
11748
11752
|
}
|
|
11749
11753
|
|
|
11750
11754
|
removeParticipantWithUUID(uuid ) {
|
|
11751
|
-
return new Room$
|
|
11755
|
+
return new Room$1({
|
|
11752
11756
|
...this,
|
|
11753
11757
|
participants: this.participants.filter(participant => participant.uuid !== uuid),
|
|
11754
11758
|
});
|
|
11755
11759
|
}
|
|
11756
11760
|
|
|
11757
11761
|
removeParticipantWithExtension(extension ) {
|
|
11758
|
-
return new Room$
|
|
11762
|
+
return new Room$1({
|
|
11759
11763
|
...this,
|
|
11760
11764
|
participants: this.participants.filter(participant => participant.extension !== extension),
|
|
11761
11765
|
});
|
|
@@ -11766,7 +11770,7 @@ class Room$2 {
|
|
|
11766
11770
|
}
|
|
11767
11771
|
|
|
11768
11772
|
static newFrom(room ) {
|
|
11769
|
-
return newFrom(room, Room$
|
|
11773
|
+
return newFrom(room, Room$1);
|
|
11770
11774
|
}
|
|
11771
11775
|
}
|
|
11772
11776
|
|
|
@@ -12437,10 +12441,10 @@ const Wazo = {
|
|
|
12437
12441
|
Auth: Auth$1,
|
|
12438
12442
|
Phone: Phone$1,
|
|
12439
12443
|
Websocket: Websocket$1,
|
|
12440
|
-
Room
|
|
12444
|
+
Room,
|
|
12441
12445
|
SipRoom,
|
|
12442
12446
|
RemoteParticipant,
|
|
12443
|
-
LocalParticipant
|
|
12447
|
+
LocalParticipant,
|
|
12444
12448
|
Stream,
|
|
12445
12449
|
createLocalVideoStream,
|
|
12446
12450
|
createLocalAudioStream,
|
|
@@ -12470,7 +12474,7 @@ const Wazo = {
|
|
|
12470
12474
|
Session,
|
|
12471
12475
|
Voicemail,
|
|
12472
12476
|
Relocation,
|
|
12473
|
-
ConferenceRoom: Room$
|
|
12477
|
+
ConferenceRoom: Room$1,
|
|
12474
12478
|
CallSession,
|
|
12475
12479
|
IndirectTransfer,
|
|
12476
12480
|
SwitchboardCall,
|
|
@@ -13003,7 +13007,7 @@ class Room extends Emitter {
|
|
|
13003
13007
|
}
|
|
13004
13008
|
|
|
13005
13009
|
_mapMsid(rawSdp ) {
|
|
13006
|
-
const sdp = sdpParser__default[
|
|
13010
|
+
const sdp = sdpParser__default['default'].parse(rawSdp);
|
|
13007
13011
|
const labelMsidArray = sdp.media.filter(media => !!media.label).map(({ label, msid }) => ({
|
|
13008
13012
|
label: String(label),
|
|
13009
13013
|
streamId: msid.split(' ')[0],
|
|
@@ -13340,8 +13344,6 @@ class Room extends Emitter {
|
|
|
13340
13344
|
}
|
|
13341
13345
|
}
|
|
13342
13346
|
|
|
13343
|
-
var Room$1 = Room;
|
|
13344
|
-
|
|
13345
13347
|
//
|
|
13346
13348
|
|
|
13347
13349
|
const logger = IssueReporter$1.loggerFor('room');
|
|
@@ -13637,6 +13639,4 @@ class Participant extends Emitter {
|
|
|
13637
13639
|
class LocalParticipant extends Participant {
|
|
13638
13640
|
}
|
|
13639
13641
|
|
|
13640
|
-
|
|
13641
|
-
|
|
13642
|
-
module.exports = LocalParticipant$1;
|
|
13642
|
+
module.exports = LocalParticipant;
|
|
@@ -40,7 +40,7 @@ class Emitter {
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
constructor() {
|
|
43
|
-
this.eventEmitter = new EventEmitter__default[
|
|
43
|
+
this.eventEmitter = new EventEmitter__default['default']();
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
on(event , callback ) {
|
|
@@ -525,7 +525,7 @@ class IssueReporter {
|
|
|
525
525
|
args.splice(1, 1);
|
|
526
526
|
}
|
|
527
527
|
|
|
528
|
-
const date = moment__default[
|
|
528
|
+
const date = moment__default['default']().format('YYYY-MM-DD HH:mm:ss.SSS');
|
|
529
529
|
const message = args.join(', ');
|
|
530
530
|
let consoleMessage = message;
|
|
531
531
|
|
|
@@ -702,7 +702,7 @@ class IssueReporter {
|
|
|
702
702
|
payload._retry = retry + 1;
|
|
703
703
|
}
|
|
704
704
|
|
|
705
|
-
this._sendDebugToGrafana(
|
|
705
|
+
this._sendDebugToGrafana(payload, retry + 1);
|
|
706
706
|
}, 5000 + retry * 1000);
|
|
707
707
|
});
|
|
708
708
|
}
|
|
@@ -2640,7 +2640,8 @@ class ExternalApp {
|
|
|
2640
2640
|
|
|
2641
2641
|
|
|
2642
2642
|
|
|
2643
|
-
|
|
2643
|
+
|
|
2644
|
+
|
|
2644
2645
|
|
|
2645
2646
|
|
|
2646
2647
|
class Meeting {
|
|
@@ -2652,6 +2653,7 @@ class Meeting {
|
|
|
2652
2653
|
|
|
2653
2654
|
|
|
2654
2655
|
|
|
2656
|
+
|
|
2655
2657
|
|
|
2656
2658
|
|
|
2657
2659
|
static parse(plain ) {
|
|
@@ -2663,6 +2665,7 @@ class Meeting {
|
|
|
2663
2665
|
port: plain.port,
|
|
2664
2666
|
uuid: plain.uuid,
|
|
2665
2667
|
number: plain.number,
|
|
2668
|
+
persistent: plain.persistent,
|
|
2666
2669
|
});
|
|
2667
2670
|
}
|
|
2668
2671
|
|
|
@@ -2670,7 +2673,7 @@ class Meeting {
|
|
|
2670
2673
|
return newFrom(meeting, Meeting);
|
|
2671
2674
|
}
|
|
2672
2675
|
|
|
2673
|
-
constructor({ uuid, name, guestSipAuthorization, ownerUuids, port, uri, number } = {}) {
|
|
2676
|
+
constructor({ uuid, name, guestSipAuthorization, ownerUuids, port, uri, number, persistent } = {}) {
|
|
2674
2677
|
this.guestSipAuthorization = guestSipAuthorization;
|
|
2675
2678
|
this.uri = uri;
|
|
2676
2679
|
this.name = name;
|
|
@@ -2678,6 +2681,7 @@ class Meeting {
|
|
|
2678
2681
|
this.port = port;
|
|
2679
2682
|
this.uuid = uuid;
|
|
2680
2683
|
this.number = number;
|
|
2684
|
+
this.persistent = persistent;
|
|
2681
2685
|
|
|
2682
2686
|
// Useful to compare instead of instanceof with minified code
|
|
2683
2687
|
this.type = 'Meeting';
|
|
@@ -2858,7 +2862,7 @@ class ChatMessage {
|
|
|
2858
2862
|
static parse(plain ) {
|
|
2859
2863
|
return new ChatMessage({
|
|
2860
2864
|
uuid: plain.uuid,
|
|
2861
|
-
date: moment__default[
|
|
2865
|
+
date: moment__default['default'](plain.created_at).toDate(),
|
|
2862
2866
|
content: plain.content,
|
|
2863
2867
|
alias: plain.alias,
|
|
2864
2868
|
userUuid: plain.user_uuid,
|
|
@@ -2950,7 +2954,7 @@ class Voicemail {
|
|
|
2950
2954
|
static parse(plain ) {
|
|
2951
2955
|
return new Voicemail({
|
|
2952
2956
|
id: plain.id,
|
|
2953
|
-
date: moment__default[
|
|
2957
|
+
date: moment__default['default'](plain.timestamp * 1000).toDate(),
|
|
2954
2958
|
duration: plain.duration * 1000,
|
|
2955
2959
|
caller: {
|
|
2956
2960
|
name: plain.caller_id_name,
|
|
@@ -3087,7 +3091,7 @@ class Call {
|
|
|
3087
3091
|
onHold: plain.on_hold,
|
|
3088
3092
|
status: plain.status,
|
|
3089
3093
|
lineId: plain.line_id,
|
|
3090
|
-
startingTime: moment__default[
|
|
3094
|
+
startingTime: moment__default['default'](plain.creation_time).toDate(),
|
|
3091
3095
|
talkingToIds: Object.keys(plain.talking_to || {}),
|
|
3092
3096
|
recording: plain.record_state === RECORD_STATE_ACTIVE,
|
|
3093
3097
|
});
|
|
@@ -3586,7 +3590,7 @@ class Recording {
|
|
|
3586
3590
|
|
|
3587
3591
|
|
|
3588
3592
|
|
|
3589
|
-
static parseMany(recordings
|
|
3593
|
+
static parseMany(recordings = []) {
|
|
3590
3594
|
return recordings.map(item => Recording.parse(item));
|
|
3591
3595
|
}
|
|
3592
3596
|
|
|
@@ -3594,8 +3598,8 @@ class Recording {
|
|
|
3594
3598
|
return new Recording({
|
|
3595
3599
|
deleted: plain.deleted,
|
|
3596
3600
|
fileName: plain.filename,
|
|
3597
|
-
end: plain.end_time ? moment__default[
|
|
3598
|
-
start: moment__default[
|
|
3601
|
+
end: plain.end_time ? moment__default['default'](plain.end_time).toDate() : null,
|
|
3602
|
+
start: moment__default['default'](plain.start_time).toDate(),
|
|
3599
3603
|
uuid: plain.uuid,
|
|
3600
3604
|
});
|
|
3601
3605
|
}
|
|
@@ -3693,7 +3697,7 @@ class CallLog {
|
|
|
3693
3697
|
|
|
3694
3698
|
static parse(plain ) {
|
|
3695
3699
|
return new CallLog({
|
|
3696
|
-
answer: plain.answer ? moment__default[
|
|
3700
|
+
answer: plain.answer ? moment__default['default'](plain.answer).toDate() : null,
|
|
3697
3701
|
answered: plain.answered,
|
|
3698
3702
|
callDirection: plain.call_direction,
|
|
3699
3703
|
destination: {
|
|
@@ -3710,9 +3714,9 @@ class CallLog {
|
|
|
3710
3714
|
},
|
|
3711
3715
|
id: plain.id,
|
|
3712
3716
|
duration: (plain.duration || 0) * 1000, // duration is in seconds
|
|
3713
|
-
start: moment__default[
|
|
3714
|
-
end: plain.end ? moment__default[
|
|
3715
|
-
recordings: Recording.parseMany(plain.recordings),
|
|
3717
|
+
start: moment__default['default'](plain.start).toDate(),
|
|
3718
|
+
end: plain.end ? moment__default['default'](plain.end).toDate() : null,
|
|
3719
|
+
recordings: Recording.parseMany(plain.recordings || []),
|
|
3716
3720
|
});
|
|
3717
3721
|
}
|
|
3718
3722
|
|
|
@@ -5886,7 +5890,7 @@ const parseCandidate$1 = (candidate ) => {
|
|
|
5886
5890
|
if (!candidate) {
|
|
5887
5891
|
return null;
|
|
5888
5892
|
}
|
|
5889
|
-
const result = sdpParser__default[
|
|
5893
|
+
const result = sdpParser__default['default'].parse(candidate.indexOf('a=') === 0 ? candidate : `a=${candidate}`);
|
|
5890
5894
|
|
|
5891
5895
|
return result.candidates ? result.candidates[0] : null;
|
|
5892
5896
|
};
|
|
@@ -5900,7 +5904,7 @@ const areCandidateValid = (candidates ) =>
|
|
|
5900
5904
|
.length > 0;
|
|
5901
5905
|
|
|
5902
5906
|
const getVideoDirection = (sdp ) => {
|
|
5903
|
-
const parsedSdp = sdpParser__default[
|
|
5907
|
+
const parsedSdp = sdpParser__default['default'].parse(sdp);
|
|
5904
5908
|
const videoMedia = parsedSdp.media.find(media => media.type === 'video');
|
|
5905
5909
|
if (!videoMedia) {
|
|
5906
5910
|
return null;
|
|
@@ -5914,14 +5918,14 @@ const hasAnActiveVideo = (sdp ) => {
|
|
|
5914
5918
|
return false;
|
|
5915
5919
|
}
|
|
5916
5920
|
|
|
5917
|
-
const parsedSdp = sdpParser__default[
|
|
5921
|
+
const parsedSdp = sdpParser__default['default'].parse(sdp);
|
|
5918
5922
|
|
|
5919
5923
|
return !!parsedSdp.media.find(media =>
|
|
5920
5924
|
media.type === 'video' && media.port > 10 && (!media.direction || media.direction !== 'inactive'));
|
|
5921
5925
|
};
|
|
5922
5926
|
|
|
5923
5927
|
const fixSdp = (sdp , candidates , forcePort = true) => {
|
|
5924
|
-
const parsedSdp = sdpParser__default[
|
|
5928
|
+
const parsedSdp = sdpParser__default['default'].parse(sdp);
|
|
5925
5929
|
const mainCandidate = getSrflxOrRelay(candidates)[0];
|
|
5926
5930
|
const ip = mainCandidate ? mainCandidate.ip : null;
|
|
5927
5931
|
|
|
@@ -5939,7 +5943,7 @@ const fixSdp = (sdp , candidates , forcePort = true)
|
|
|
5939
5943
|
};
|
|
5940
5944
|
});
|
|
5941
5945
|
|
|
5942
|
-
let fixed = sdpParser__default[
|
|
5946
|
+
let fixed = sdpParser__default['default'].write(parsedSdp);
|
|
5943
5947
|
|
|
5944
5948
|
if (ip) {
|
|
5945
5949
|
fixed = fixed.replace(/IN IP4 0.0.0.0/g, `IN IP4 ${ip}`);
|
|
@@ -5985,7 +5989,7 @@ class WazoSessionDescriptionHandler extends sessionDescriptionHandler.SessionDes
|
|
|
5985
5989
|
) {
|
|
5986
5990
|
super(logger, mediaStreamFactory, sessionDescriptionHandlerConfiguration);
|
|
5987
5991
|
|
|
5988
|
-
this.eventEmitter = new EventEmitter__default[
|
|
5992
|
+
this.eventEmitter = new EventEmitter__default['default']();
|
|
5989
5993
|
this.isWeb = isWeb;
|
|
5990
5994
|
this.session = session;
|
|
5991
5995
|
}
|
|
@@ -7302,7 +7306,7 @@ class WebRTCClient extends Emitter {
|
|
|
7302
7306
|
// We search for the last transceiver without `video-` in the mid (video- means remote transceiver)
|
|
7303
7307
|
const transceivers = pc.getTransceivers();
|
|
7304
7308
|
const transceiverIdx = lastIndexOf(transceivers, transceiver =>
|
|
7305
|
-
transceiver.sender.track === null && transceiver.mid.indexOf('video') === -1);
|
|
7309
|
+
transceiver.sender.track === null && transceiver.mid && transceiver.mid.indexOf('video') === -1);
|
|
7306
7310
|
|
|
7307
7311
|
videoSender = transceiverIdx !== -1 ? transceivers[transceiverIdx].sender : null;
|
|
7308
7312
|
} else {
|
|
@@ -8507,7 +8511,7 @@ class WebRTCClient extends Emitter {
|
|
|
8507
8511
|
}
|
|
8508
8512
|
const sessionId = this.getSipSessionId(session);
|
|
8509
8513
|
|
|
8510
|
-
getStats__default[
|
|
8514
|
+
getStats__default['default'](pc, (result ) => {
|
|
8511
8515
|
const { results, internal, nomore, ...stats } = result;
|
|
8512
8516
|
this.statsIntervals[sessionId] = nomore;
|
|
8513
8517
|
|
|
@@ -10889,7 +10893,7 @@ class WebSocketClient extends Emitter {
|
|
|
10889
10893
|
|
|
10890
10894
|
connect() {
|
|
10891
10895
|
logger$5.info('connect method started', { host: this.host, token: this.token });
|
|
10892
|
-
this.socket = new ReconnectingWebSocket__default[
|
|
10896
|
+
this.socket = new ReconnectingWebSocket__default['default'](this._getUrl.bind(this), [], this.options);
|
|
10893
10897
|
if (this.options.binaryType) {
|
|
10894
10898
|
this.socket.binaryType = this.options.binaryType;
|
|
10895
10899
|
}
|
|
@@ -11341,7 +11345,7 @@ var Websocket$1 = global.wazoWebsocketInstance;
|
|
|
11341
11345
|
|
|
11342
11346
|
const logger$3 = IssueReporter$1.loggerFor('sdk-sip-room');
|
|
11343
11347
|
|
|
11344
|
-
class SipRoom extends Room
|
|
11348
|
+
class SipRoom extends Room {
|
|
11345
11349
|
|
|
11346
11350
|
static async connect({ extension, constraints, audioOnly = false, extra, room } ) {
|
|
11347
11351
|
logger$3.info('connecting to sip room', { extension, audioOnly, room: !!room });
|
|
@@ -11676,7 +11680,7 @@ class NotificationOptions {
|
|
|
11676
11680
|
|
|
11677
11681
|
|
|
11678
11682
|
// Represents a conference room, like `9000`.
|
|
11679
|
-
class Room$
|
|
11683
|
+
class Room$1 {
|
|
11680
11684
|
|
|
11681
11685
|
|
|
11682
11686
|
|
|
@@ -11697,7 +11701,7 @@ class Room$2 {
|
|
|
11697
11701
|
}
|
|
11698
11702
|
|
|
11699
11703
|
connect(callSession ) {
|
|
11700
|
-
return new Room$
|
|
11704
|
+
return new Room$1({ ...this, connectedCallSession: callSession });
|
|
11701
11705
|
}
|
|
11702
11706
|
|
|
11703
11707
|
has(callSession ) {
|
|
@@ -11706,7 +11710,7 @@ class Room$2 {
|
|
|
11706
11710
|
|
|
11707
11711
|
addParticipant(uuid , extension , talking = null) {
|
|
11708
11712
|
if (!this.participants.some(participant => participant.uuid === uuid || participant.extension === extension)) {
|
|
11709
|
-
return new Room$
|
|
11713
|
+
return new Room$1({ ...this, participants: [...this.participants, { uuid, extension, talking }] });
|
|
11710
11714
|
}
|
|
11711
11715
|
|
|
11712
11716
|
return this;
|
|
@@ -11725,7 +11729,7 @@ class Room$2 {
|
|
|
11725
11729
|
updatedParticipants.push(participant);
|
|
11726
11730
|
}
|
|
11727
11731
|
|
|
11728
|
-
return new Room$
|
|
11732
|
+
return new Room$1({ ...this, participants: updatedParticipants });
|
|
11729
11733
|
}
|
|
11730
11734
|
|
|
11731
11735
|
updateParticipantByExtension(extension , participant , shouldAdd = false) {
|
|
@@ -11741,7 +11745,7 @@ class Room$2 {
|
|
|
11741
11745
|
updatedParticipants.push(participant);
|
|
11742
11746
|
}
|
|
11743
11747
|
|
|
11744
|
-
return new Room$
|
|
11748
|
+
return new Room$1({ ...this, participants: updatedParticipants });
|
|
11745
11749
|
}
|
|
11746
11750
|
|
|
11747
11751
|
hasCallWithId(id ) {
|
|
@@ -11749,18 +11753,18 @@ class Room$2 {
|
|
|
11749
11753
|
}
|
|
11750
11754
|
|
|
11751
11755
|
disconnect() {
|
|
11752
|
-
return new Room$
|
|
11756
|
+
return new Room$1({ ...this, connectedCallSession: null });
|
|
11753
11757
|
}
|
|
11754
11758
|
|
|
11755
11759
|
removeParticipantWithUUID(uuid ) {
|
|
11756
|
-
return new Room$
|
|
11760
|
+
return new Room$1({
|
|
11757
11761
|
...this,
|
|
11758
11762
|
participants: this.participants.filter(participant => participant.uuid !== uuid),
|
|
11759
11763
|
});
|
|
11760
11764
|
}
|
|
11761
11765
|
|
|
11762
11766
|
removeParticipantWithExtension(extension ) {
|
|
11763
|
-
return new Room$
|
|
11767
|
+
return new Room$1({
|
|
11764
11768
|
...this,
|
|
11765
11769
|
participants: this.participants.filter(participant => participant.extension !== extension),
|
|
11766
11770
|
});
|
|
@@ -11771,7 +11775,7 @@ class Room$2 {
|
|
|
11771
11775
|
}
|
|
11772
11776
|
|
|
11773
11777
|
static newFrom(room ) {
|
|
11774
|
-
return newFrom(room, Room$
|
|
11778
|
+
return newFrom(room, Room$1);
|
|
11775
11779
|
}
|
|
11776
11780
|
}
|
|
11777
11781
|
|
|
@@ -12442,7 +12446,7 @@ const Wazo = {
|
|
|
12442
12446
|
Auth: Auth$1,
|
|
12443
12447
|
Phone: Phone$1,
|
|
12444
12448
|
Websocket: Websocket$1,
|
|
12445
|
-
Room
|
|
12449
|
+
Room,
|
|
12446
12450
|
SipRoom,
|
|
12447
12451
|
RemoteParticipant,
|
|
12448
12452
|
LocalParticipant,
|
|
@@ -12475,7 +12479,7 @@ const Wazo = {
|
|
|
12475
12479
|
Session,
|
|
12476
12480
|
Voicemail,
|
|
12477
12481
|
Relocation,
|
|
12478
|
-
ConferenceRoom: Room$
|
|
12482
|
+
ConferenceRoom: Room$1,
|
|
12479
12483
|
CallSession,
|
|
12480
12484
|
IndirectTransfer,
|
|
12481
12485
|
SwitchboardCall,
|
|
@@ -13008,7 +13012,7 @@ class Room extends Emitter {
|
|
|
13008
13012
|
}
|
|
13009
13013
|
|
|
13010
13014
|
_mapMsid(rawSdp ) {
|
|
13011
|
-
const sdp = sdpParser__default[
|
|
13015
|
+
const sdp = sdpParser__default['default'].parse(rawSdp);
|
|
13012
13016
|
const labelMsidArray = sdp.media.filter(media => !!media.label).map(({ label, msid }) => ({
|
|
13013
13017
|
label: String(label),
|
|
13014
13018
|
streamId: msid.split(' ')[0],
|
|
@@ -13345,8 +13349,6 @@ class Room extends Emitter {
|
|
|
13345
13349
|
}
|
|
13346
13350
|
}
|
|
13347
13351
|
|
|
13348
|
-
var Room$1 = Room;
|
|
13349
|
-
|
|
13350
13352
|
//
|
|
13351
13353
|
|
|
13352
13354
|
const logger = IssueReporter$1.loggerFor('room');
|