@wazo/sdk 0.37.18 → 0.37.22
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 +52 -9
- package/esm/__tests__/web-rtc-client.test.js +80 -20
- package/esm/api/agentd.js +27 -4
- package/esm/api/amid.js +27 -4
- package/esm/api/application.js +27 -4
- package/esm/api/auth.js +29 -5
- package/esm/api/call-logd.js +29 -6
- package/esm/api/calld.js +27 -4
- package/esm/api/chatd.js +27 -4
- package/esm/api/confd.js +51 -8
- package/esm/api/ctid-ng.js +27 -4
- package/esm/api/dird.js +27 -4
- package/esm/api/webhookd.js +27 -4
- package/esm/api-client.js +54 -11
- package/esm/checker/Checker.js +83 -21
- package/esm/checker/checks/aor.js +54 -11
- package/esm/checker/checks/api.js +54 -11
- package/esm/checker/checks/ice-ipv4.js +1 -1
- package/esm/checker/checks/index.js +84 -22
- package/esm/checker/checks/symmetric-nat.js +1 -1
- package/esm/checker/checks/wazo-websocket.js +29 -4
- package/esm/checker/checks/webrtc-transport.js +82 -22
- package/esm/checker/checks/webrtc.js +82 -22
- package/esm/domain/AdHocAPIConference.js +54 -11
- 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 +54 -10
- 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 +20 -3
- package/esm/domain/NotificationOptions.js +1 -1
- package/esm/domain/Phone/CTIPhone.js +55 -11
- package/esm/domain/Phone/WebRTCPhone.js +39 -6
- 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 +101 -24
- package/esm/lib/WazoSessionDescriptionHandler.js +28 -4
- package/esm/service/CallApi.js +54 -11
- package/esm/service/IssueReporter.js +27 -4
- package/esm/service/__tests__/IssueReporter.test.js +26 -3
- package/esm/service/getApiClient.js +55 -11
- package/esm/simple/Auth.js +101 -23
- package/esm/simple/Configuration.js +100 -23
- package/esm/simple/Directory.js +53 -10
- package/esm/simple/Phone.js +100 -23
- package/esm/simple/Websocket.js +30 -4
- package/esm/simple/index.js +100 -23
- package/esm/simple/room/LocalParticipant.js +113 -40
- package/esm/simple/room/Participant.js +112 -37
- package/esm/simple/room/RemoteParticipant.js +114 -41
- package/esm/simple/room/Room.js +113 -37
- package/esm/simple/room/SipRoom.js +101 -26
- package/esm/simple/room/Stream.js +101 -26
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +99 -22
- package/esm/simple/utils.js +99 -22
- package/esm/utils/Emitter.js +1 -1
- package/esm/utils/Heartbeat.js +1 -1
- package/esm/utils/__tests__/api-requester.test.js +26 -3
- package/esm/utils/api-requester.js +28 -4
- 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 +83 -22
- package/esm/websocket-client.js +30 -4
- package/lib/__tests__/api-client.test.js +61 -18
- package/lib/__tests__/web-rtc-client.test.js +97 -37
- package/lib/api/agentd.js +27 -4
- package/lib/api/amid.js +27 -4
- package/lib/api/application.js +27 -4
- package/lib/api/auth.js +28 -5
- package/lib/api/call-logd.js +34 -11
- package/lib/api/calld.js +30 -7
- package/lib/api/chatd.js +28 -5
- package/lib/api/confd.js +51 -8
- package/lib/api/ctid-ng.js +30 -7
- package/lib/api/dird.js +27 -4
- package/lib/api/webhookd.js +27 -4
- package/lib/api-client.js +61 -18
- package/lib/checker/Checker.js +100 -38
- package/lib/checker/checks/aor.js +61 -18
- package/lib/checker/checks/api.js +61 -18
- package/lib/checker/checks/index.js +100 -38
- package/lib/checker/checks/wazo-websocket.js +31 -6
- package/lib/checker/checks/webrtc-transport.js +97 -37
- package/lib/checker/checks/webrtc.js +97 -37
- package/lib/domain/AdHocAPIConference.js +61 -18
- 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 +62 -19
- package/lib/domain/ForwardOption.js +1 -1
- package/lib/domain/Meeting.js +19 -2
- package/lib/domain/Phone/CTIPhone.js +63 -20
- package/lib/domain/Phone/WebRTCPhone.js +40 -8
- 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 +120 -43
- package/lib/lib/WazoSessionDescriptionHandler.js +32 -9
- package/lib/service/CallApi.js +61 -18
- package/lib/service/IssueReporter.js +27 -4
- package/lib/service/__tests__/IssueReporter.test.js +27 -4
- package/lib/service/getApiClient.js +62 -19
- package/lib/simple/Auth.js +119 -42
- package/lib/simple/Configuration.js +118 -41
- package/lib/simple/Directory.js +61 -18
- package/lib/simple/Phone.js +118 -41
- package/lib/simple/Websocket.js +32 -6
- package/lib/simple/index.js +118 -41
- package/lib/simple/room/LocalParticipant.js +132 -59
- package/lib/simple/room/Participant.js +130 -55
- package/lib/simple/room/RemoteParticipant.js +133 -60
- package/lib/simple/room/Room.js +131 -56
- package/lib/simple/room/SipRoom.js +120 -45
- package/lib/simple/room/Stream.js +120 -45
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +118 -41
- package/lib/simple/utils.js +118 -41
- 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 +27 -4
- package/lib/utils/__tests__/sdp.test.js +12 -12
- package/lib/utils/api-requester.js +28 -5
- package/lib/utils/sdp.js +10 -10
- package/lib/web-rtc-client.js +98 -38
- package/lib/websocket-client.js +33 -7
- package/package.json +2 -2
- package/src/api/confd.js +5 -2
- package/src/domain/CallLog.js +1 -1
- package/src/domain/Meeting.js +19 -2
- package/src/domain/Phone/WebRTCPhone.js +11 -2
- package/src/domain/Recording.js +1 -1
- package/src/service/IssueReporter.js +26 -3
- package/src/simple/Phone.js +5 -0
- package/src/types/WebSocketMessage.js +5 -1
- package/src/web-rtc-client.js +28 -11
- package/src/websocket-client.js +2 -0
package/esm/simple/room/Room.js
CHANGED
|
@@ -149,6 +149,7 @@ class IssueReporter {
|
|
|
149
149
|
|
|
150
150
|
|
|
151
151
|
|
|
152
|
+
|
|
152
153
|
|
|
153
154
|
constructor() {
|
|
154
155
|
addLevelsTo(this);
|
|
@@ -160,12 +161,17 @@ class IssueReporter {
|
|
|
160
161
|
this.bufferTimeout = null;
|
|
161
162
|
this._boundProcessBuffer = this._processBuffer.bind(this);
|
|
162
163
|
this._boundParseLoggerBody = this._parseLoggerBody.bind(this);
|
|
164
|
+
this._callback = null;
|
|
163
165
|
}
|
|
164
166
|
|
|
165
167
|
init() {
|
|
166
168
|
this._catchConsole();
|
|
167
169
|
}
|
|
168
170
|
|
|
171
|
+
setCallback(cb ) {
|
|
172
|
+
this._callback = cb;
|
|
173
|
+
}
|
|
174
|
+
|
|
169
175
|
configureRemoteClient(configuration = { tag: 'wazo-sdk', host: null, port: null, level: null, extra: {} }) {
|
|
170
176
|
this.remoteClientConfiguration = configuration;
|
|
171
177
|
}
|
|
@@ -201,6 +207,7 @@ class IssueReporter {
|
|
|
201
207
|
|
|
202
208
|
// Handle category label
|
|
203
209
|
let category = null;
|
|
210
|
+
let skipSendToRemote = false;
|
|
204
211
|
let extra = {};
|
|
205
212
|
if (args[0].indexOf(CATEGORY_PREFIX) === 0) {
|
|
206
213
|
category = args[0].split('=')[1];
|
|
@@ -216,6 +223,7 @@ class IssueReporter {
|
|
|
216
223
|
errorMessage: lastArg.message,
|
|
217
224
|
errorStack: lastArg.stack,
|
|
218
225
|
errorType: lastArg.constructor.name,
|
|
226
|
+
skipSendToRemote: lastArg.skipSendToRemote,
|
|
219
227
|
};
|
|
220
228
|
} else {
|
|
221
229
|
extra = lastArg;
|
|
@@ -224,6 +232,11 @@ class IssueReporter {
|
|
|
224
232
|
args.splice(1, 1);
|
|
225
233
|
}
|
|
226
234
|
|
|
235
|
+
if (extra.skipSendToRemote) {
|
|
236
|
+
skipSendToRemote = true;
|
|
237
|
+
delete extra.skipSendToRemote;
|
|
238
|
+
}
|
|
239
|
+
|
|
227
240
|
const date = moment().format('YYYY-MM-DD HH:mm:ss.SSS');
|
|
228
241
|
const message = args.join(', ');
|
|
229
242
|
let consoleMessage = message;
|
|
@@ -244,7 +257,13 @@ class IssueReporter {
|
|
|
244
257
|
const oldMethod = this.oldConsoleMethods[consoleLevel] || this.oldConsoleMethods.log;
|
|
245
258
|
oldMethod.apply(oldMethod, [date, consoleMessage]);
|
|
246
259
|
|
|
247
|
-
this.
|
|
260
|
+
if (this._callback) {
|
|
261
|
+
this._callback(level, consoleMessage);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
if (!skipSendToRemote) {
|
|
265
|
+
this._sendToRemoteLogger(level, { date, message, category, ...extra });
|
|
266
|
+
}
|
|
248
267
|
}
|
|
249
268
|
|
|
250
269
|
logRequest(url , options , response , start ) {
|
|
@@ -389,7 +408,11 @@ class IssueReporter {
|
|
|
389
408
|
},
|
|
390
409
|
// $FlowFixMe
|
|
391
410
|
body,
|
|
392
|
-
}).catch(() => {
|
|
411
|
+
}).catch((e ) => {
|
|
412
|
+
// $FlowFixMe
|
|
413
|
+
e.skipSendToRemote = true;
|
|
414
|
+
this.log('error', this._makeCategory('grafana'), 'Sending log to grafana, error', e);
|
|
415
|
+
|
|
393
416
|
setTimeout(() => {
|
|
394
417
|
if (isArray) {
|
|
395
418
|
payload = payload.map(message => {
|
|
@@ -401,7 +424,7 @@ class IssueReporter {
|
|
|
401
424
|
payload._retry = retry + 1;
|
|
402
425
|
}
|
|
403
426
|
|
|
404
|
-
this._sendDebugToGrafana(
|
|
427
|
+
this._sendDebugToGrafana(payload, retry + 1);
|
|
405
428
|
}, 5000 + retry * 1000);
|
|
406
429
|
});
|
|
407
430
|
}
|
|
@@ -2604,7 +2627,8 @@ class ExternalApp {
|
|
|
2604
2627
|
|
|
2605
2628
|
|
|
2606
2629
|
|
|
2607
|
-
|
|
2630
|
+
|
|
2631
|
+
|
|
2608
2632
|
|
|
2609
2633
|
|
|
2610
2634
|
class Meeting {
|
|
@@ -2616,6 +2640,7 @@ class Meeting {
|
|
|
2616
2640
|
|
|
2617
2641
|
|
|
2618
2642
|
|
|
2643
|
+
|
|
2619
2644
|
|
|
2620
2645
|
|
|
2621
2646
|
static parse(plain ) {
|
|
@@ -2627,14 +2652,28 @@ class Meeting {
|
|
|
2627
2652
|
port: plain.port,
|
|
2628
2653
|
uuid: plain.uuid,
|
|
2629
2654
|
number: plain.number,
|
|
2655
|
+
persistent: plain.persistent,
|
|
2630
2656
|
});
|
|
2631
2657
|
}
|
|
2632
2658
|
|
|
2659
|
+
static parseMany(items ) {
|
|
2660
|
+
return items.map(plain => Meeting.parse(plain));
|
|
2661
|
+
}
|
|
2662
|
+
|
|
2633
2663
|
static newFrom(meeting ) {
|
|
2634
2664
|
return newFrom(meeting, Meeting);
|
|
2635
2665
|
}
|
|
2636
2666
|
|
|
2637
|
-
constructor({
|
|
2667
|
+
constructor({
|
|
2668
|
+
uuid,
|
|
2669
|
+
name,
|
|
2670
|
+
guestSipAuthorization,
|
|
2671
|
+
ownerUuids,
|
|
2672
|
+
port,
|
|
2673
|
+
uri,
|
|
2674
|
+
number,
|
|
2675
|
+
persistent,
|
|
2676
|
+
} = {}) {
|
|
2638
2677
|
this.guestSipAuthorization = guestSipAuthorization;
|
|
2639
2678
|
this.uri = uri;
|
|
2640
2679
|
this.name = name;
|
|
@@ -2642,6 +2681,7 @@ class Meeting {
|
|
|
2642
2681
|
this.port = port;
|
|
2643
2682
|
this.uuid = uuid;
|
|
2644
2683
|
this.number = number;
|
|
2684
|
+
this.persistent = persistent;
|
|
2645
2685
|
|
|
2646
2686
|
// Useful to compare instead of instanceof with minified code
|
|
2647
2687
|
this.type = 'Meeting';
|
|
@@ -2719,8 +2759,11 @@ var confdMethods = (client , baseUrl ) => ({
|
|
|
2719
2759
|
}
|
|
2720
2760
|
},
|
|
2721
2761
|
|
|
2722
|
-
|
|
2723
|
-
client.
|
|
2762
|
+
getMyMeetings: () =>
|
|
2763
|
+
client.get(`${baseUrl}/users/me/meetings`).then(response => Meeting.parseMany(response.items)),
|
|
2764
|
+
|
|
2765
|
+
createMyMeeting: (name , persistent ) =>
|
|
2766
|
+
client.post(`${baseUrl}/users/me/meetings`, { name, persistent }).then(Meeting.parse),
|
|
2724
2767
|
|
|
2725
2768
|
deleteMyMeeting: (meetingUuid ) =>
|
|
2726
2769
|
client.delete(`${baseUrl}/users/me/meetings/${meetingUuid}`, null),
|
|
@@ -3576,7 +3619,7 @@ class Recording {
|
|
|
3576
3619
|
|
|
3577
3620
|
|
|
3578
3621
|
|
|
3579
|
-
static parseMany(recordings
|
|
3622
|
+
static parseMany(recordings = []) {
|
|
3580
3623
|
return recordings.map(item => Recording.parse(item));
|
|
3581
3624
|
}
|
|
3582
3625
|
|
|
@@ -3702,7 +3745,7 @@ class CallLog {
|
|
|
3702
3745
|
duration: (plain.duration || 0) * 1000, // duration is in seconds
|
|
3703
3746
|
start: moment(plain.start).toDate(),
|
|
3704
3747
|
end: plain.end ? moment(plain.end).toDate() : null,
|
|
3705
|
-
recordings: Recording.parseMany(plain.recordings),
|
|
3748
|
+
recordings: Recording.parseMany(plain.recordings || []),
|
|
3706
3749
|
});
|
|
3707
3750
|
}
|
|
3708
3751
|
|
|
@@ -6956,7 +6999,9 @@ class WebRTCClient extends Emitter {
|
|
|
6956
6999
|
const inviteOptions = {
|
|
6957
7000
|
requestDelegate: {
|
|
6958
7001
|
onAccept: (response ) => {
|
|
6959
|
-
session.sessionDescriptionHandler.peerConnection
|
|
7002
|
+
if (session.sessionDescriptionHandler.peerConnection) {
|
|
7003
|
+
session.sessionDescriptionHandler.peerConnection.sfu = conference;
|
|
7004
|
+
}
|
|
6960
7005
|
this._onAccepted(session, response.session, true);
|
|
6961
7006
|
},
|
|
6962
7007
|
onReject: (response ) => {
|
|
@@ -7292,7 +7337,7 @@ class WebRTCClient extends Emitter {
|
|
|
7292
7337
|
// We search for the last transceiver without `video-` in the mid (video- means remote transceiver)
|
|
7293
7338
|
const transceivers = pc.getTransceivers();
|
|
7294
7339
|
const transceiverIdx = lastIndexOf(transceivers, transceiver =>
|
|
7295
|
-
transceiver.sender.track === null && transceiver.mid.indexOf('video') === -1);
|
|
7340
|
+
transceiver.sender.track === null && transceiver.mid && transceiver.mid.indexOf('video') === -1);
|
|
7296
7341
|
|
|
7297
7342
|
videoSender = transceiverIdx !== -1 ? transceivers[transceiverIdx].sender : null;
|
|
7298
7343
|
} else {
|
|
@@ -7828,6 +7873,16 @@ class WebRTCClient extends Emitter {
|
|
|
7828
7873
|
return this.hasRemoteVideo(sessionId) ? this.getRemoteStream(sessionId) : null;
|
|
7829
7874
|
}
|
|
7830
7875
|
|
|
7876
|
+
// Useful in a react-native environment when remoteMediaStream is not updated
|
|
7877
|
+
getRemoteVideoStreamFromPc(sessionId ) {
|
|
7878
|
+
const pc = this.getPeerConnection(sessionId);
|
|
7879
|
+
if (!pc) {
|
|
7880
|
+
return null;
|
|
7881
|
+
}
|
|
7882
|
+
|
|
7883
|
+
return pc.getRemoteStreams().find(stream => !!stream.getVideoTracks().length);
|
|
7884
|
+
}
|
|
7885
|
+
|
|
7831
7886
|
hasVideo(sessionId ) {
|
|
7832
7887
|
return this.hasLocalVideo(sessionId) || this.hasRemoteVideo(sessionId);
|
|
7833
7888
|
}
|
|
@@ -8338,6 +8393,7 @@ class WebRTCClient extends Emitter {
|
|
|
8338
8393
|
session.sessionDescriptionHandler.remoteMediaStream.onaddtrack = onTrack;
|
|
8339
8394
|
|
|
8340
8395
|
pc.oniceconnectionstatechange = () => {
|
|
8396
|
+
logger$8.info('on ice connection state changed', { state: pc.iceConnectionState });
|
|
8341
8397
|
if (pc.iceConnectionState === 'disconnected') {
|
|
8342
8398
|
this.eventEmitter.emit(ON_DISCONNECTED$1);
|
|
8343
8399
|
}
|
|
@@ -8606,18 +8662,22 @@ class WebRTCClient extends Emitter {
|
|
|
8606
8662
|
});
|
|
8607
8663
|
|
|
8608
8664
|
networkStats.packetsLost = packetsLost;
|
|
8609
|
-
networkStats.
|
|
8665
|
+
networkStats.totalAudioBytesSent = audioBytesSent;
|
|
8666
|
+
networkStats.audioBytesSent = audioBytesSent - lastAudioSent;
|
|
8667
|
+
networkStats.totalAudioBytesReceived = audioBytesReceived - lastAudioReceived;
|
|
8610
8668
|
networkStats.audioBytesReceived = audioBytesReceived;
|
|
8611
|
-
networkStats.
|
|
8612
|
-
networkStats.
|
|
8669
|
+
networkStats.totalVideoBytesSent = videoBytesSent;
|
|
8670
|
+
networkStats.videoBytesSent = videoBytesSent - lastVideoSent;
|
|
8671
|
+
networkStats.totalVideoBytesReceived = videoBytesReceived;
|
|
8672
|
+
networkStats.videoBytesReceived = videoBytesReceived - lastVideoReceived;
|
|
8673
|
+
networkStats.totalTransportSent = transportSent - lastTransportSent;
|
|
8613
8674
|
networkStats.transportSent = transportSent;
|
|
8614
|
-
networkStats.
|
|
8615
|
-
|
|
8616
|
-
const bandwidth = (networkStats.audioBytesSent - lastAudioSent) + (networkStats.videoBytesSent - lastVideoSent)
|
|
8617
|
-
+ (networkStats.audioBytesReceived - lastAudioReceived) + (networkStats.videoBytesReceived - lastVideoReceived)
|
|
8618
|
-
+ (networkStats.transportReceived - lastTransportReceived) + (networkStats.transportSent - lastTransportSent);
|
|
8675
|
+
networkStats.totalTransportReceived = transportReceived;
|
|
8676
|
+
networkStats.transportReceived = transportReceived - lastTransportReceived;
|
|
8619
8677
|
|
|
8620
|
-
networkStats.bandwidth =
|
|
8678
|
+
networkStats.bandwidth = networkStats.audioBytesSent + networkStats.audioBytesReceived
|
|
8679
|
+
+ networkStats.videoBytesSent + networkStats.videoBytesReceived + networkStats.transportReceived
|
|
8680
|
+
+ networkStats.transportSent;
|
|
8621
8681
|
|
|
8622
8682
|
this.eventEmitter.emit(ON_NETWORK_STATS$1, session, networkStats, this.sessionNetworkStats[sessionId]);
|
|
8623
8683
|
this.sessionNetworkStats[sessionId].push(networkStats);
|
|
@@ -8999,7 +9059,10 @@ class WebRTCPhone extends Emitter {
|
|
|
8999
9059
|
|
|
9000
9060
|
onCancel(message);
|
|
9001
9061
|
const elsewhere = message.data.indexOf('cause=26') !== -1 && message.data.indexOf('completed elsewhere') !== -1;
|
|
9002
|
-
|
|
9062
|
+
const callSession = this._createCallSession(sipSession);
|
|
9063
|
+
delete this.callSessions[callSession.getId()];
|
|
9064
|
+
|
|
9065
|
+
this.eventEmitter.emit(ON_CALL_CANCELED, callSession, elsewhere);
|
|
9003
9066
|
};
|
|
9004
9067
|
} else if (sipSession instanceof Invitation) {
|
|
9005
9068
|
console.warn('sipSession._onCancel not found, please update the wazo SDK accordingly');
|
|
@@ -9028,9 +9091,11 @@ class WebRTCPhone extends Emitter {
|
|
|
9028
9091
|
case SessionState.Terminated: {
|
|
9029
9092
|
logger$7.info('WebRTC phone - call terminated', { sipId: sipSession.id });
|
|
9030
9093
|
|
|
9094
|
+
// Should be called before `_onCallTerminated` or the callCount will not decrement...
|
|
9095
|
+
const callSession = this._createCallSession(sipSession);
|
|
9031
9096
|
const wasCurrentSession = this._onCallTerminated(sipSession);
|
|
9032
9097
|
|
|
9033
|
-
return this.eventEmitter.emit(ON_CALL_ENDED,
|
|
9098
|
+
return this.eventEmitter.emit(ON_CALL_ENDED, callSession, wasCurrentSession);
|
|
9034
9099
|
}
|
|
9035
9100
|
}
|
|
9036
9101
|
});
|
|
@@ -9978,6 +10043,10 @@ class WebRTCPhone extends Emitter {
|
|
|
9978
10043
|
return callSession ? this.client.getRemoteVideoStream(callSession.sipCallId) : null;
|
|
9979
10044
|
}
|
|
9980
10045
|
|
|
10046
|
+
getRemoteVideoStreamFromPc(callSession ) {
|
|
10047
|
+
return callSession ? this.client.getRemoteVideoStreamFromPc(callSession.sipCallId) : null;
|
|
10048
|
+
}
|
|
10049
|
+
|
|
9981
10050
|
hasRemoteVideo(callSession ) {
|
|
9982
10051
|
return callSession ? this.client.hasRemoteVideo(callSession.sipCallId) : false;
|
|
9983
10052
|
}
|
|
@@ -10661,6 +10730,11 @@ class Phone extends Emitter {
|
|
|
10661
10730
|
return this.getRemoteVideoStream(callSession);
|
|
10662
10731
|
}
|
|
10663
10732
|
|
|
10733
|
+
// Useful in a react-native environment when remoteMediaStream is not updated
|
|
10734
|
+
getRemoteVideoStreamFromPc(callSession ) {
|
|
10735
|
+
return this.phone ? this.phone.getRemoteVideoStreamFromPc(callSession) : false;
|
|
10736
|
+
}
|
|
10737
|
+
|
|
10664
10738
|
hasVideo(callSession ) {
|
|
10665
10739
|
return this.phone ? this.phone.hasVideo(callSession) : false;
|
|
10666
10740
|
}
|
|
@@ -10820,6 +10894,7 @@ const AGENT_PAUSED = 'agent_paused';
|
|
|
10820
10894
|
const AGENT_UNPAUSED = 'agent_unpaused';
|
|
10821
10895
|
const CONFERENCE_ADHOC_PARTICIPANT_LEFT = 'conference_adhoc_participant_left';
|
|
10822
10896
|
const CONFERENCE_ADHOC_DELETED = 'conference_adhoc_deleted';
|
|
10897
|
+
const MEETING_USER_PROGRESS = 'meeting_user_progress';
|
|
10823
10898
|
|
|
10824
10899
|
const BLACKLIST_EVENTS = [
|
|
10825
10900
|
CHAT_MESSAGE_SENT,
|
|
@@ -11170,6 +11245,7 @@ WebSocketClient.eventLists = [
|
|
|
11170
11245
|
AGENT_UNPAUSED,
|
|
11171
11246
|
CONFERENCE_ADHOC_PARTICIPANT_LEFT,
|
|
11172
11247
|
CONFERENCE_ADHOC_DELETED,
|
|
11248
|
+
MEETING_USER_PROGRESS,
|
|
11173
11249
|
];
|
|
11174
11250
|
|
|
11175
11251
|
var WebSocketClient$1 = /*#__PURE__*/Object.freeze({
|
|
@@ -11240,6 +11316,7 @@ var WebSocketClient$1 = /*#__PURE__*/Object.freeze({
|
|
|
11240
11316
|
AGENT_UNPAUSED: AGENT_UNPAUSED,
|
|
11241
11317
|
CONFERENCE_ADHOC_PARTICIPANT_LEFT: CONFERENCE_ADHOC_PARTICIPANT_LEFT,
|
|
11242
11318
|
CONFERENCE_ADHOC_DELETED: CONFERENCE_ADHOC_DELETED,
|
|
11319
|
+
MEETING_USER_PROGRESS: MEETING_USER_PROGRESS,
|
|
11243
11320
|
HEARTBEAT_ENGINE_VERSION: HEARTBEAT_ENGINE_VERSION,
|
|
11244
11321
|
'default': WebSocketClient
|
|
11245
11322
|
});
|
|
@@ -11331,7 +11408,7 @@ var Websocket$1 = global.wazoWebsocketInstance;
|
|
|
11331
11408
|
|
|
11332
11409
|
const logger$3 = IssueReporter$1.loggerFor('sdk-sip-room');
|
|
11333
11410
|
|
|
11334
|
-
class SipRoom extends Room
|
|
11411
|
+
class SipRoom extends Room {
|
|
11335
11412
|
|
|
11336
11413
|
static async connect({ extension, constraints, audioOnly = false, extra, room } ) {
|
|
11337
11414
|
logger$3.info('connecting to sip room', { extension, audioOnly, room: !!room });
|
|
@@ -11956,7 +12033,7 @@ class NotificationOptions {
|
|
|
11956
12033
|
|
|
11957
12034
|
|
|
11958
12035
|
// Represents a conference room, like `9000`.
|
|
11959
|
-
class Room$
|
|
12036
|
+
class Room$1 {
|
|
11960
12037
|
|
|
11961
12038
|
|
|
11962
12039
|
|
|
@@ -11977,7 +12054,7 @@ class Room$2 {
|
|
|
11977
12054
|
}
|
|
11978
12055
|
|
|
11979
12056
|
connect(callSession ) {
|
|
11980
|
-
return new Room$
|
|
12057
|
+
return new Room$1({ ...this, connectedCallSession: callSession });
|
|
11981
12058
|
}
|
|
11982
12059
|
|
|
11983
12060
|
has(callSession ) {
|
|
@@ -11986,7 +12063,7 @@ class Room$2 {
|
|
|
11986
12063
|
|
|
11987
12064
|
addParticipant(uuid , extension , talking = null) {
|
|
11988
12065
|
if (!this.participants.some(participant => participant.uuid === uuid || participant.extension === extension)) {
|
|
11989
|
-
return new Room$
|
|
12066
|
+
return new Room$1({ ...this, participants: [...this.participants, { uuid, extension, talking }] });
|
|
11990
12067
|
}
|
|
11991
12068
|
|
|
11992
12069
|
return this;
|
|
@@ -12005,7 +12082,7 @@ class Room$2 {
|
|
|
12005
12082
|
updatedParticipants.push(participant);
|
|
12006
12083
|
}
|
|
12007
12084
|
|
|
12008
|
-
return new Room$
|
|
12085
|
+
return new Room$1({ ...this, participants: updatedParticipants });
|
|
12009
12086
|
}
|
|
12010
12087
|
|
|
12011
12088
|
updateParticipantByExtension(extension , participant , shouldAdd = false) {
|
|
@@ -12021,7 +12098,7 @@ class Room$2 {
|
|
|
12021
12098
|
updatedParticipants.push(participant);
|
|
12022
12099
|
}
|
|
12023
12100
|
|
|
12024
|
-
return new Room$
|
|
12101
|
+
return new Room$1({ ...this, participants: updatedParticipants });
|
|
12025
12102
|
}
|
|
12026
12103
|
|
|
12027
12104
|
hasCallWithId(id ) {
|
|
@@ -12029,18 +12106,18 @@ class Room$2 {
|
|
|
12029
12106
|
}
|
|
12030
12107
|
|
|
12031
12108
|
disconnect() {
|
|
12032
|
-
return new Room$
|
|
12109
|
+
return new Room$1({ ...this, connectedCallSession: null });
|
|
12033
12110
|
}
|
|
12034
12111
|
|
|
12035
12112
|
removeParticipantWithUUID(uuid ) {
|
|
12036
|
-
return new Room$
|
|
12113
|
+
return new Room$1({
|
|
12037
12114
|
...this,
|
|
12038
12115
|
participants: this.participants.filter(participant => participant.uuid !== uuid),
|
|
12039
12116
|
});
|
|
12040
12117
|
}
|
|
12041
12118
|
|
|
12042
12119
|
removeParticipantWithExtension(extension ) {
|
|
12043
|
-
return new Room$
|
|
12120
|
+
return new Room$1({
|
|
12044
12121
|
...this,
|
|
12045
12122
|
participants: this.participants.filter(participant => participant.extension !== extension),
|
|
12046
12123
|
});
|
|
@@ -12051,7 +12128,7 @@ class Room$2 {
|
|
|
12051
12128
|
}
|
|
12052
12129
|
|
|
12053
12130
|
static newFrom(room ) {
|
|
12054
|
-
return newFrom(room, Room$
|
|
12131
|
+
return newFrom(room, Room$1);
|
|
12055
12132
|
}
|
|
12056
12133
|
}
|
|
12057
12134
|
|
|
@@ -12722,7 +12799,7 @@ const Wazo = {
|
|
|
12722
12799
|
Auth: Auth$1,
|
|
12723
12800
|
Phone: Phone$1,
|
|
12724
12801
|
Websocket: Websocket$1,
|
|
12725
|
-
Room
|
|
12802
|
+
Room,
|
|
12726
12803
|
SipRoom,
|
|
12727
12804
|
RemoteParticipant,
|
|
12728
12805
|
LocalParticipant,
|
|
@@ -12755,7 +12832,7 @@ const Wazo = {
|
|
|
12755
12832
|
Session,
|
|
12756
12833
|
Voicemail,
|
|
12757
12834
|
Relocation,
|
|
12758
|
-
ConferenceRoom: Room$
|
|
12835
|
+
ConferenceRoom: Room$1,
|
|
12759
12836
|
CallSession,
|
|
12760
12837
|
IndirectTransfer,
|
|
12761
12838
|
SwitchboardCall,
|
|
@@ -13625,6 +13702,5 @@ class Room extends Emitter {
|
|
|
13625
13702
|
}
|
|
13626
13703
|
}
|
|
13627
13704
|
|
|
13628
|
-
|
|
13629
|
-
|
|
13630
|
-
export { SIGNAL_TYPE_PARTICIPANT_REQUEST, SIGNAL_TYPE_PARTICIPANT_UPDATE, Room$1 as default };
|
|
13705
|
+
export default Room;
|
|
13706
|
+
export { SIGNAL_TYPE_PARTICIPANT_REQUEST, SIGNAL_TYPE_PARTICIPANT_UPDATE };
|