@wazo/sdk 0.37.20 → 0.37.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/wazo-sdk.js +5 -5
- package/esm/__tests__/api-client.test.js +44 -5
- package/esm/__tests__/web-rtc-client.test.js +70 -15
- package/esm/api/agentd.js +25 -2
- package/esm/api/amid.js +25 -2
- package/esm/api/application.js +25 -2
- package/esm/api/auth.js +25 -2
- package/esm/api/call-logd.js +25 -2
- package/esm/api/calld.js +25 -2
- package/esm/api/chatd.js +25 -2
- package/esm/api/confd.js +44 -5
- package/esm/api/ctid-ng.js +25 -2
- package/esm/api/dird.js +25 -2
- package/esm/api/webhookd.js +25 -2
- package/esm/api-client.js +44 -5
- package/esm/checker/Checker.js +72 -15
- package/esm/checker/checks/aor.js +44 -5
- package/esm/checker/checks/api.js +44 -5
- package/esm/checker/checks/index.js +72 -15
- package/esm/checker/checks/wazo-websocket.js +27 -2
- package/esm/checker/checks/webrtc-transport.js +70 -15
- package/esm/checker/checks/webrtc.js +70 -15
- package/esm/domain/AdHocAPIConference.js +44 -5
- package/esm/domain/Features.js +44 -5
- package/esm/domain/Meeting.js +14 -1
- package/esm/domain/Phone/CTIPhone.js +44 -5
- package/esm/domain/Phone/WebRTCPhone.js +32 -3
- package/esm/index.js +85 -16
- package/esm/lib/WazoSessionDescriptionHandler.js +25 -2
- package/esm/service/CallApi.js +44 -5
- package/esm/service/IssueReporter.js +25 -2
- package/esm/service/__tests__/IssueReporter.test.js +25 -2
- package/esm/service/getApiClient.js +44 -5
- package/esm/simple/Auth.js +85 -16
- package/esm/simple/Configuration.js +85 -16
- package/esm/simple/Directory.js +44 -5
- package/esm/simple/Phone.js +85 -16
- package/esm/simple/Websocket.js +28 -2
- package/esm/simple/index.js +85 -16
- package/esm/simple/room/LocalParticipant.js +85 -16
- package/esm/simple/room/Participant.js +85 -16
- package/esm/simple/room/RemoteParticipant.js +85 -16
- package/esm/simple/room/Room.js +85 -16
- package/esm/simple/room/SipRoom.js +85 -16
- package/esm/simple/room/Stream.js +85 -16
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +85 -16
- package/esm/simple/utils.js +85 -16
- package/esm/utils/__tests__/api-requester.test.js +25 -2
- package/esm/utils/api-requester.js +25 -2
- package/esm/web-rtc-client.js +70 -15
- package/esm/websocket-client.js +28 -3
- package/lib/__tests__/api-client.test.js +44 -5
- package/lib/__tests__/web-rtc-client.test.js +70 -15
- package/lib/api/agentd.js +25 -2
- package/lib/api/amid.js +25 -2
- package/lib/api/application.js +25 -2
- package/lib/api/auth.js +25 -2
- package/lib/api/call-logd.js +25 -2
- package/lib/api/calld.js +25 -2
- package/lib/api/chatd.js +25 -2
- package/lib/api/confd.js +44 -5
- package/lib/api/ctid-ng.js +25 -2
- package/lib/api/dird.js +25 -2
- package/lib/api/webhookd.js +25 -2
- package/lib/api-client.js +44 -5
- package/lib/checker/Checker.js +72 -15
- package/lib/checker/checks/aor.js +44 -5
- package/lib/checker/checks/api.js +44 -5
- package/lib/checker/checks/index.js +72 -15
- package/lib/checker/checks/wazo-websocket.js +27 -2
- package/lib/checker/checks/webrtc-transport.js +70 -15
- package/lib/checker/checks/webrtc.js +70 -15
- package/lib/domain/AdHocAPIConference.js +44 -5
- package/lib/domain/Features.js +44 -5
- package/lib/domain/Meeting.js +14 -1
- package/lib/domain/Phone/CTIPhone.js +44 -5
- package/lib/domain/Phone/WebRTCPhone.js +32 -3
- package/lib/index.js +85 -16
- package/lib/lib/WazoSessionDescriptionHandler.js +25 -2
- package/lib/service/CallApi.js +44 -5
- package/lib/service/IssueReporter.js +25 -2
- package/lib/service/__tests__/IssueReporter.test.js +25 -2
- package/lib/service/getApiClient.js +44 -5
- package/lib/simple/Auth.js +85 -16
- package/lib/simple/Configuration.js +85 -16
- package/lib/simple/Directory.js +44 -5
- package/lib/simple/Phone.js +85 -16
- package/lib/simple/Websocket.js +28 -2
- package/lib/simple/index.js +85 -16
- package/lib/simple/room/LocalParticipant.js +85 -16
- package/lib/simple/room/Participant.js +85 -16
- package/lib/simple/room/RemoteParticipant.js +85 -16
- package/lib/simple/room/Room.js +85 -16
- package/lib/simple/room/SipRoom.js +85 -16
- package/lib/simple/room/Stream.js +85 -16
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +85 -16
- package/lib/simple/utils.js +85 -16
- package/lib/utils/__tests__/api-requester.test.js +25 -2
- package/lib/utils/api-requester.js +25 -2
- package/lib/web-rtc-client.js +70 -15
- package/lib/websocket-client.js +28 -2
- package/package.json +1 -1
- package/src/api/confd.js +5 -2
- package/src/domain/Meeting.js +14 -1
- package/src/domain/Phone/WebRTCPhone.js +7 -1
- package/src/service/IssueReporter.js +25 -2
- package/src/simple/Phone.js +5 -0
- package/src/types/WebSocketMessage.js +5 -1
- package/src/web-rtc-client.js +26 -10
- package/src/websocket-client.js +2 -0
package/lib/simple/room/Room.js
CHANGED
|
@@ -161,6 +161,7 @@ class IssueReporter {
|
|
|
161
161
|
|
|
162
162
|
|
|
163
163
|
|
|
164
|
+
|
|
164
165
|
|
|
165
166
|
constructor() {
|
|
166
167
|
addLevelsTo(this);
|
|
@@ -172,12 +173,17 @@ class IssueReporter {
|
|
|
172
173
|
this.bufferTimeout = null;
|
|
173
174
|
this._boundProcessBuffer = this._processBuffer.bind(this);
|
|
174
175
|
this._boundParseLoggerBody = this._parseLoggerBody.bind(this);
|
|
176
|
+
this._callback = null;
|
|
175
177
|
}
|
|
176
178
|
|
|
177
179
|
init() {
|
|
178
180
|
this._catchConsole();
|
|
179
181
|
}
|
|
180
182
|
|
|
183
|
+
setCallback(cb ) {
|
|
184
|
+
this._callback = cb;
|
|
185
|
+
}
|
|
186
|
+
|
|
181
187
|
configureRemoteClient(configuration = { tag: 'wazo-sdk', host: null, port: null, level: null, extra: {} }) {
|
|
182
188
|
this.remoteClientConfiguration = configuration;
|
|
183
189
|
}
|
|
@@ -213,6 +219,7 @@ class IssueReporter {
|
|
|
213
219
|
|
|
214
220
|
// Handle category label
|
|
215
221
|
let category = null;
|
|
222
|
+
let skipSendToRemote = false;
|
|
216
223
|
let extra = {};
|
|
217
224
|
if (args[0].indexOf(CATEGORY_PREFIX) === 0) {
|
|
218
225
|
category = args[0].split('=')[1];
|
|
@@ -228,6 +235,7 @@ class IssueReporter {
|
|
|
228
235
|
errorMessage: lastArg.message,
|
|
229
236
|
errorStack: lastArg.stack,
|
|
230
237
|
errorType: lastArg.constructor.name,
|
|
238
|
+
skipSendToRemote: lastArg.skipSendToRemote,
|
|
231
239
|
};
|
|
232
240
|
} else {
|
|
233
241
|
extra = lastArg;
|
|
@@ -236,6 +244,11 @@ class IssueReporter {
|
|
|
236
244
|
args.splice(1, 1);
|
|
237
245
|
}
|
|
238
246
|
|
|
247
|
+
if (extra.skipSendToRemote) {
|
|
248
|
+
skipSendToRemote = true;
|
|
249
|
+
delete extra.skipSendToRemote;
|
|
250
|
+
}
|
|
251
|
+
|
|
239
252
|
const date = moment__default['default']().format('YYYY-MM-DD HH:mm:ss.SSS');
|
|
240
253
|
const message = args.join(', ');
|
|
241
254
|
let consoleMessage = message;
|
|
@@ -256,7 +269,13 @@ class IssueReporter {
|
|
|
256
269
|
const oldMethod = this.oldConsoleMethods[consoleLevel] || this.oldConsoleMethods.log;
|
|
257
270
|
oldMethod.apply(oldMethod, [date, consoleMessage]);
|
|
258
271
|
|
|
259
|
-
this.
|
|
272
|
+
if (this._callback) {
|
|
273
|
+
this._callback(level, consoleMessage);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
if (!skipSendToRemote) {
|
|
277
|
+
this._sendToRemoteLogger(level, { date, message, category, ...extra });
|
|
278
|
+
}
|
|
260
279
|
}
|
|
261
280
|
|
|
262
281
|
logRequest(url , options , response , start ) {
|
|
@@ -401,7 +420,11 @@ class IssueReporter {
|
|
|
401
420
|
},
|
|
402
421
|
// $FlowFixMe
|
|
403
422
|
body,
|
|
404
|
-
}).catch(() => {
|
|
423
|
+
}).catch((e ) => {
|
|
424
|
+
// $FlowFixMe
|
|
425
|
+
e.skipSendToRemote = true;
|
|
426
|
+
this.log('error', this._makeCategory('grafana'), 'Sending log to grafana, error', e);
|
|
427
|
+
|
|
405
428
|
setTimeout(() => {
|
|
406
429
|
if (isArray) {
|
|
407
430
|
payload = payload.map(message => {
|
|
@@ -2645,11 +2668,24 @@ class Meeting {
|
|
|
2645
2668
|
});
|
|
2646
2669
|
}
|
|
2647
2670
|
|
|
2671
|
+
static parseMany(items ) {
|
|
2672
|
+
return items.map(plain => Meeting.parse(plain));
|
|
2673
|
+
}
|
|
2674
|
+
|
|
2648
2675
|
static newFrom(meeting ) {
|
|
2649
2676
|
return newFrom(meeting, Meeting);
|
|
2650
2677
|
}
|
|
2651
2678
|
|
|
2652
|
-
constructor({
|
|
2679
|
+
constructor({
|
|
2680
|
+
uuid,
|
|
2681
|
+
name,
|
|
2682
|
+
guestSipAuthorization,
|
|
2683
|
+
ownerUuids,
|
|
2684
|
+
port,
|
|
2685
|
+
uri,
|
|
2686
|
+
number,
|
|
2687
|
+
persistent,
|
|
2688
|
+
} = {}) {
|
|
2653
2689
|
this.guestSipAuthorization = guestSipAuthorization;
|
|
2654
2690
|
this.uri = uri;
|
|
2655
2691
|
this.name = name;
|
|
@@ -2735,8 +2771,11 @@ var confdMethods = (client , baseUrl ) => ({
|
|
|
2735
2771
|
}
|
|
2736
2772
|
},
|
|
2737
2773
|
|
|
2738
|
-
|
|
2739
|
-
client.
|
|
2774
|
+
getMyMeetings: () =>
|
|
2775
|
+
client.get(`${baseUrl}/users/me/meetings`).then(response => Meeting.parseMany(response.items)),
|
|
2776
|
+
|
|
2777
|
+
createMyMeeting: (name , persistent ) =>
|
|
2778
|
+
client.post(`${baseUrl}/users/me/meetings`, { name, persistent }).then(Meeting.parse),
|
|
2740
2779
|
|
|
2741
2780
|
deleteMyMeeting: (meetingUuid ) =>
|
|
2742
2781
|
client.delete(`${baseUrl}/users/me/meetings/${meetingUuid}`, null),
|
|
@@ -6972,7 +7011,9 @@ class WebRTCClient extends Emitter {
|
|
|
6972
7011
|
const inviteOptions = {
|
|
6973
7012
|
requestDelegate: {
|
|
6974
7013
|
onAccept: (response ) => {
|
|
6975
|
-
session.sessionDescriptionHandler.peerConnection
|
|
7014
|
+
if (session.sessionDescriptionHandler.peerConnection) {
|
|
7015
|
+
session.sessionDescriptionHandler.peerConnection.sfu = conference;
|
|
7016
|
+
}
|
|
6976
7017
|
this._onAccepted(session, response.session, true);
|
|
6977
7018
|
},
|
|
6978
7019
|
onReject: (response ) => {
|
|
@@ -7844,6 +7885,16 @@ class WebRTCClient extends Emitter {
|
|
|
7844
7885
|
return this.hasRemoteVideo(sessionId) ? this.getRemoteStream(sessionId) : null;
|
|
7845
7886
|
}
|
|
7846
7887
|
|
|
7888
|
+
// Useful in a react-native environment when remoteMediaStream is not updated
|
|
7889
|
+
getRemoteVideoStreamFromPc(sessionId ) {
|
|
7890
|
+
const pc = this.getPeerConnection(sessionId);
|
|
7891
|
+
if (!pc) {
|
|
7892
|
+
return null;
|
|
7893
|
+
}
|
|
7894
|
+
|
|
7895
|
+
return pc.getRemoteStreams().find(stream => !!stream.getVideoTracks().length);
|
|
7896
|
+
}
|
|
7897
|
+
|
|
7847
7898
|
hasVideo(sessionId ) {
|
|
7848
7899
|
return this.hasLocalVideo(sessionId) || this.hasRemoteVideo(sessionId);
|
|
7849
7900
|
}
|
|
@@ -8622,18 +8673,22 @@ class WebRTCClient extends Emitter {
|
|
|
8622
8673
|
});
|
|
8623
8674
|
|
|
8624
8675
|
networkStats.packetsLost = packetsLost;
|
|
8625
|
-
networkStats.
|
|
8676
|
+
networkStats.totalAudioBytesSent = audioBytesSent;
|
|
8677
|
+
networkStats.audioBytesSent = audioBytesSent - lastAudioSent;
|
|
8678
|
+
networkStats.totalAudioBytesReceived = audioBytesReceived - lastAudioReceived;
|
|
8626
8679
|
networkStats.audioBytesReceived = audioBytesReceived;
|
|
8627
|
-
networkStats.
|
|
8628
|
-
networkStats.
|
|
8680
|
+
networkStats.totalVideoBytesSent = videoBytesSent;
|
|
8681
|
+
networkStats.videoBytesSent = videoBytesSent - lastVideoSent;
|
|
8682
|
+
networkStats.totalVideoBytesReceived = videoBytesReceived;
|
|
8683
|
+
networkStats.videoBytesReceived = videoBytesReceived - lastVideoReceived;
|
|
8684
|
+
networkStats.totalTransportSent = transportSent - lastTransportSent;
|
|
8629
8685
|
networkStats.transportSent = transportSent;
|
|
8630
|
-
networkStats.
|
|
8686
|
+
networkStats.totalTransportReceived = transportReceived;
|
|
8687
|
+
networkStats.transportReceived = transportReceived - lastTransportReceived;
|
|
8631
8688
|
|
|
8632
|
-
|
|
8633
|
-
+
|
|
8634
|
-
+
|
|
8635
|
-
|
|
8636
|
-
networkStats.bandwidth = bandwidth;
|
|
8689
|
+
networkStats.bandwidth = networkStats.audioBytesSent + networkStats.audioBytesReceived
|
|
8690
|
+
+ networkStats.videoBytesSent + networkStats.videoBytesReceived + networkStats.transportReceived
|
|
8691
|
+
+ networkStats.transportSent;
|
|
8637
8692
|
|
|
8638
8693
|
this.eventEmitter.emit(ON_NETWORK_STATS$1, session, networkStats, this.sessionNetworkStats[sessionId]);
|
|
8639
8694
|
this.sessionNetworkStats[sessionId].push(networkStats);
|
|
@@ -9044,9 +9099,11 @@ class WebRTCPhone extends Emitter {
|
|
|
9044
9099
|
case sessionState.SessionState.Terminated: {
|
|
9045
9100
|
logger$7.info('WebRTC phone - call terminated', { sipId: sipSession.id });
|
|
9046
9101
|
|
|
9102
|
+
// Should be called before `_onCallTerminated` or the callCount will not decrement...
|
|
9103
|
+
const callSession = this._createCallSession(sipSession);
|
|
9047
9104
|
const wasCurrentSession = this._onCallTerminated(sipSession);
|
|
9048
9105
|
|
|
9049
|
-
return this.eventEmitter.emit(ON_CALL_ENDED,
|
|
9106
|
+
return this.eventEmitter.emit(ON_CALL_ENDED, callSession, wasCurrentSession);
|
|
9050
9107
|
}
|
|
9051
9108
|
}
|
|
9052
9109
|
});
|
|
@@ -9994,6 +10051,10 @@ class WebRTCPhone extends Emitter {
|
|
|
9994
10051
|
return callSession ? this.client.getRemoteVideoStream(callSession.sipCallId) : null;
|
|
9995
10052
|
}
|
|
9996
10053
|
|
|
10054
|
+
getRemoteVideoStreamFromPc(callSession ) {
|
|
10055
|
+
return callSession ? this.client.getRemoteVideoStreamFromPc(callSession.sipCallId) : null;
|
|
10056
|
+
}
|
|
10057
|
+
|
|
9997
10058
|
hasRemoteVideo(callSession ) {
|
|
9998
10059
|
return callSession ? this.client.hasRemoteVideo(callSession.sipCallId) : false;
|
|
9999
10060
|
}
|
|
@@ -10677,6 +10738,11 @@ class Phone extends Emitter {
|
|
|
10677
10738
|
return this.getRemoteVideoStream(callSession);
|
|
10678
10739
|
}
|
|
10679
10740
|
|
|
10741
|
+
// Useful in a react-native environment when remoteMediaStream is not updated
|
|
10742
|
+
getRemoteVideoStreamFromPc(callSession ) {
|
|
10743
|
+
return this.phone ? this.phone.getRemoteVideoStreamFromPc(callSession) : false;
|
|
10744
|
+
}
|
|
10745
|
+
|
|
10680
10746
|
hasVideo(callSession ) {
|
|
10681
10747
|
return this.phone ? this.phone.hasVideo(callSession) : false;
|
|
10682
10748
|
}
|
|
@@ -10836,6 +10902,7 @@ const AGENT_PAUSED = 'agent_paused';
|
|
|
10836
10902
|
const AGENT_UNPAUSED = 'agent_unpaused';
|
|
10837
10903
|
const CONFERENCE_ADHOC_PARTICIPANT_LEFT = 'conference_adhoc_participant_left';
|
|
10838
10904
|
const CONFERENCE_ADHOC_DELETED = 'conference_adhoc_deleted';
|
|
10905
|
+
const MEETING_USER_PROGRESS = 'meeting_user_progress';
|
|
10839
10906
|
|
|
10840
10907
|
const BLACKLIST_EVENTS = [
|
|
10841
10908
|
CHAT_MESSAGE_SENT,
|
|
@@ -11186,6 +11253,7 @@ WebSocketClient.eventLists = [
|
|
|
11186
11253
|
AGENT_UNPAUSED,
|
|
11187
11254
|
CONFERENCE_ADHOC_PARTICIPANT_LEFT,
|
|
11188
11255
|
CONFERENCE_ADHOC_DELETED,
|
|
11256
|
+
MEETING_USER_PROGRESS,
|
|
11189
11257
|
];
|
|
11190
11258
|
|
|
11191
11259
|
var WebSocketClient$1 = /*#__PURE__*/Object.freeze({
|
|
@@ -11256,6 +11324,7 @@ var WebSocketClient$1 = /*#__PURE__*/Object.freeze({
|
|
|
11256
11324
|
AGENT_UNPAUSED: AGENT_UNPAUSED,
|
|
11257
11325
|
CONFERENCE_ADHOC_PARTICIPANT_LEFT: CONFERENCE_ADHOC_PARTICIPANT_LEFT,
|
|
11258
11326
|
CONFERENCE_ADHOC_DELETED: CONFERENCE_ADHOC_DELETED,
|
|
11327
|
+
MEETING_USER_PROGRESS: MEETING_USER_PROGRESS,
|
|
11259
11328
|
HEARTBEAT_ENGINE_VERSION: HEARTBEAT_ENGINE_VERSION,
|
|
11260
11329
|
'default': WebSocketClient
|
|
11261
11330
|
});
|
|
@@ -424,6 +424,7 @@ class IssueReporter {
|
|
|
424
424
|
|
|
425
425
|
|
|
426
426
|
|
|
427
|
+
|
|
427
428
|
|
|
428
429
|
constructor() {
|
|
429
430
|
addLevelsTo(this);
|
|
@@ -435,12 +436,17 @@ class IssueReporter {
|
|
|
435
436
|
this.bufferTimeout = null;
|
|
436
437
|
this._boundProcessBuffer = this._processBuffer.bind(this);
|
|
437
438
|
this._boundParseLoggerBody = this._parseLoggerBody.bind(this);
|
|
439
|
+
this._callback = null;
|
|
438
440
|
}
|
|
439
441
|
|
|
440
442
|
init() {
|
|
441
443
|
this._catchConsole();
|
|
442
444
|
}
|
|
443
445
|
|
|
446
|
+
setCallback(cb ) {
|
|
447
|
+
this._callback = cb;
|
|
448
|
+
}
|
|
449
|
+
|
|
444
450
|
configureRemoteClient(configuration = { tag: 'wazo-sdk', host: null, port: null, level: null, extra: {} }) {
|
|
445
451
|
this.remoteClientConfiguration = configuration;
|
|
446
452
|
}
|
|
@@ -476,6 +482,7 @@ class IssueReporter {
|
|
|
476
482
|
|
|
477
483
|
// Handle category label
|
|
478
484
|
let category = null;
|
|
485
|
+
let skipSendToRemote = false;
|
|
479
486
|
let extra = {};
|
|
480
487
|
if (args[0].indexOf(CATEGORY_PREFIX) === 0) {
|
|
481
488
|
category = args[0].split('=')[1];
|
|
@@ -491,6 +498,7 @@ class IssueReporter {
|
|
|
491
498
|
errorMessage: lastArg.message,
|
|
492
499
|
errorStack: lastArg.stack,
|
|
493
500
|
errorType: lastArg.constructor.name,
|
|
501
|
+
skipSendToRemote: lastArg.skipSendToRemote,
|
|
494
502
|
};
|
|
495
503
|
} else {
|
|
496
504
|
extra = lastArg;
|
|
@@ -499,6 +507,11 @@ class IssueReporter {
|
|
|
499
507
|
args.splice(1, 1);
|
|
500
508
|
}
|
|
501
509
|
|
|
510
|
+
if (extra.skipSendToRemote) {
|
|
511
|
+
skipSendToRemote = true;
|
|
512
|
+
delete extra.skipSendToRemote;
|
|
513
|
+
}
|
|
514
|
+
|
|
502
515
|
const date = moment__default['default']().format('YYYY-MM-DD HH:mm:ss.SSS');
|
|
503
516
|
const message = args.join(', ');
|
|
504
517
|
let consoleMessage = message;
|
|
@@ -519,7 +532,13 @@ class IssueReporter {
|
|
|
519
532
|
const oldMethod = this.oldConsoleMethods[consoleLevel] || this.oldConsoleMethods.log;
|
|
520
533
|
oldMethod.apply(oldMethod, [date, consoleMessage]);
|
|
521
534
|
|
|
522
|
-
this.
|
|
535
|
+
if (this._callback) {
|
|
536
|
+
this._callback(level, consoleMessage);
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
if (!skipSendToRemote) {
|
|
540
|
+
this._sendToRemoteLogger(level, { date, message, category, ...extra });
|
|
541
|
+
}
|
|
523
542
|
}
|
|
524
543
|
|
|
525
544
|
logRequest(url , options , response , start ) {
|
|
@@ -664,7 +683,11 @@ class IssueReporter {
|
|
|
664
683
|
},
|
|
665
684
|
// $FlowFixMe
|
|
666
685
|
body,
|
|
667
|
-
}).catch(() => {
|
|
686
|
+
}).catch((e ) => {
|
|
687
|
+
// $FlowFixMe
|
|
688
|
+
e.skipSendToRemote = true;
|
|
689
|
+
this.log('error', this._makeCategory('grafana'), 'Sending log to grafana, error', e);
|
|
690
|
+
|
|
668
691
|
setTimeout(() => {
|
|
669
692
|
if (isArray) {
|
|
670
693
|
payload = payload.map(message => {
|
|
@@ -2643,11 +2666,24 @@ class Meeting {
|
|
|
2643
2666
|
});
|
|
2644
2667
|
}
|
|
2645
2668
|
|
|
2669
|
+
static parseMany(items ) {
|
|
2670
|
+
return items.map(plain => Meeting.parse(plain));
|
|
2671
|
+
}
|
|
2672
|
+
|
|
2646
2673
|
static newFrom(meeting ) {
|
|
2647
2674
|
return newFrom(meeting, Meeting);
|
|
2648
2675
|
}
|
|
2649
2676
|
|
|
2650
|
-
constructor({
|
|
2677
|
+
constructor({
|
|
2678
|
+
uuid,
|
|
2679
|
+
name,
|
|
2680
|
+
guestSipAuthorization,
|
|
2681
|
+
ownerUuids,
|
|
2682
|
+
port,
|
|
2683
|
+
uri,
|
|
2684
|
+
number,
|
|
2685
|
+
persistent,
|
|
2686
|
+
} = {}) {
|
|
2651
2687
|
this.guestSipAuthorization = guestSipAuthorization;
|
|
2652
2688
|
this.uri = uri;
|
|
2653
2689
|
this.name = name;
|
|
@@ -2733,8 +2769,11 @@ var confdMethods = (client , baseUrl ) => ({
|
|
|
2733
2769
|
}
|
|
2734
2770
|
},
|
|
2735
2771
|
|
|
2736
|
-
|
|
2737
|
-
client.
|
|
2772
|
+
getMyMeetings: () =>
|
|
2773
|
+
client.get(`${baseUrl}/users/me/meetings`).then(response => Meeting.parseMany(response.items)),
|
|
2774
|
+
|
|
2775
|
+
createMyMeeting: (name , persistent ) =>
|
|
2776
|
+
client.post(`${baseUrl}/users/me/meetings`, { name, persistent }).then(Meeting.parse),
|
|
2738
2777
|
|
|
2739
2778
|
deleteMyMeeting: (meetingUuid ) =>
|
|
2740
2779
|
client.delete(`${baseUrl}/users/me/meetings/${meetingUuid}`, null),
|
|
@@ -6970,7 +7009,9 @@ class WebRTCClient extends Emitter {
|
|
|
6970
7009
|
const inviteOptions = {
|
|
6971
7010
|
requestDelegate: {
|
|
6972
7011
|
onAccept: (response ) => {
|
|
6973
|
-
session.sessionDescriptionHandler.peerConnection
|
|
7012
|
+
if (session.sessionDescriptionHandler.peerConnection) {
|
|
7013
|
+
session.sessionDescriptionHandler.peerConnection.sfu = conference;
|
|
7014
|
+
}
|
|
6974
7015
|
this._onAccepted(session, response.session, true);
|
|
6975
7016
|
},
|
|
6976
7017
|
onReject: (response ) => {
|
|
@@ -7842,6 +7883,16 @@ class WebRTCClient extends Emitter {
|
|
|
7842
7883
|
return this.hasRemoteVideo(sessionId) ? this.getRemoteStream(sessionId) : null;
|
|
7843
7884
|
}
|
|
7844
7885
|
|
|
7886
|
+
// Useful in a react-native environment when remoteMediaStream is not updated
|
|
7887
|
+
getRemoteVideoStreamFromPc(sessionId ) {
|
|
7888
|
+
const pc = this.getPeerConnection(sessionId);
|
|
7889
|
+
if (!pc) {
|
|
7890
|
+
return null;
|
|
7891
|
+
}
|
|
7892
|
+
|
|
7893
|
+
return pc.getRemoteStreams().find(stream => !!stream.getVideoTracks().length);
|
|
7894
|
+
}
|
|
7895
|
+
|
|
7845
7896
|
hasVideo(sessionId ) {
|
|
7846
7897
|
return this.hasLocalVideo(sessionId) || this.hasRemoteVideo(sessionId);
|
|
7847
7898
|
}
|
|
@@ -8620,18 +8671,22 @@ class WebRTCClient extends Emitter {
|
|
|
8620
8671
|
});
|
|
8621
8672
|
|
|
8622
8673
|
networkStats.packetsLost = packetsLost;
|
|
8623
|
-
networkStats.
|
|
8674
|
+
networkStats.totalAudioBytesSent = audioBytesSent;
|
|
8675
|
+
networkStats.audioBytesSent = audioBytesSent - lastAudioSent;
|
|
8676
|
+
networkStats.totalAudioBytesReceived = audioBytesReceived - lastAudioReceived;
|
|
8624
8677
|
networkStats.audioBytesReceived = audioBytesReceived;
|
|
8625
|
-
networkStats.
|
|
8626
|
-
networkStats.
|
|
8678
|
+
networkStats.totalVideoBytesSent = videoBytesSent;
|
|
8679
|
+
networkStats.videoBytesSent = videoBytesSent - lastVideoSent;
|
|
8680
|
+
networkStats.totalVideoBytesReceived = videoBytesReceived;
|
|
8681
|
+
networkStats.videoBytesReceived = videoBytesReceived - lastVideoReceived;
|
|
8682
|
+
networkStats.totalTransportSent = transportSent - lastTransportSent;
|
|
8627
8683
|
networkStats.transportSent = transportSent;
|
|
8628
|
-
networkStats.
|
|
8684
|
+
networkStats.totalTransportReceived = transportReceived;
|
|
8685
|
+
networkStats.transportReceived = transportReceived - lastTransportReceived;
|
|
8629
8686
|
|
|
8630
|
-
|
|
8631
|
-
+
|
|
8632
|
-
+
|
|
8633
|
-
|
|
8634
|
-
networkStats.bandwidth = bandwidth;
|
|
8687
|
+
networkStats.bandwidth = networkStats.audioBytesSent + networkStats.audioBytesReceived
|
|
8688
|
+
+ networkStats.videoBytesSent + networkStats.videoBytesReceived + networkStats.transportReceived
|
|
8689
|
+
+ networkStats.transportSent;
|
|
8635
8690
|
|
|
8636
8691
|
this.eventEmitter.emit(ON_NETWORK_STATS$1, session, networkStats, this.sessionNetworkStats[sessionId]);
|
|
8637
8692
|
this.sessionNetworkStats[sessionId].push(networkStats);
|
|
@@ -9042,9 +9097,11 @@ class WebRTCPhone extends Emitter {
|
|
|
9042
9097
|
case sessionState.SessionState.Terminated: {
|
|
9043
9098
|
logger$7.info('WebRTC phone - call terminated', { sipId: sipSession.id });
|
|
9044
9099
|
|
|
9100
|
+
// Should be called before `_onCallTerminated` or the callCount will not decrement...
|
|
9101
|
+
const callSession = this._createCallSession(sipSession);
|
|
9045
9102
|
const wasCurrentSession = this._onCallTerminated(sipSession);
|
|
9046
9103
|
|
|
9047
|
-
return this.eventEmitter.emit(ON_CALL_ENDED,
|
|
9104
|
+
return this.eventEmitter.emit(ON_CALL_ENDED, callSession, wasCurrentSession);
|
|
9048
9105
|
}
|
|
9049
9106
|
}
|
|
9050
9107
|
});
|
|
@@ -9992,6 +10049,10 @@ class WebRTCPhone extends Emitter {
|
|
|
9992
10049
|
return callSession ? this.client.getRemoteVideoStream(callSession.sipCallId) : null;
|
|
9993
10050
|
}
|
|
9994
10051
|
|
|
10052
|
+
getRemoteVideoStreamFromPc(callSession ) {
|
|
10053
|
+
return callSession ? this.client.getRemoteVideoStreamFromPc(callSession.sipCallId) : null;
|
|
10054
|
+
}
|
|
10055
|
+
|
|
9995
10056
|
hasRemoteVideo(callSession ) {
|
|
9996
10057
|
return callSession ? this.client.hasRemoteVideo(callSession.sipCallId) : false;
|
|
9997
10058
|
}
|
|
@@ -10675,6 +10736,11 @@ class Phone extends Emitter {
|
|
|
10675
10736
|
return this.getRemoteVideoStream(callSession);
|
|
10676
10737
|
}
|
|
10677
10738
|
|
|
10739
|
+
// Useful in a react-native environment when remoteMediaStream is not updated
|
|
10740
|
+
getRemoteVideoStreamFromPc(callSession ) {
|
|
10741
|
+
return this.phone ? this.phone.getRemoteVideoStreamFromPc(callSession) : false;
|
|
10742
|
+
}
|
|
10743
|
+
|
|
10678
10744
|
hasVideo(callSession ) {
|
|
10679
10745
|
return this.phone ? this.phone.hasVideo(callSession) : false;
|
|
10680
10746
|
}
|
|
@@ -10834,6 +10900,7 @@ const AGENT_PAUSED = 'agent_paused';
|
|
|
10834
10900
|
const AGENT_UNPAUSED = 'agent_unpaused';
|
|
10835
10901
|
const CONFERENCE_ADHOC_PARTICIPANT_LEFT = 'conference_adhoc_participant_left';
|
|
10836
10902
|
const CONFERENCE_ADHOC_DELETED = 'conference_adhoc_deleted';
|
|
10903
|
+
const MEETING_USER_PROGRESS = 'meeting_user_progress';
|
|
10837
10904
|
|
|
10838
10905
|
const BLACKLIST_EVENTS = [
|
|
10839
10906
|
CHAT_MESSAGE_SENT,
|
|
@@ -11184,6 +11251,7 @@ WebSocketClient.eventLists = [
|
|
|
11184
11251
|
AGENT_UNPAUSED,
|
|
11185
11252
|
CONFERENCE_ADHOC_PARTICIPANT_LEFT,
|
|
11186
11253
|
CONFERENCE_ADHOC_DELETED,
|
|
11254
|
+
MEETING_USER_PROGRESS,
|
|
11187
11255
|
];
|
|
11188
11256
|
|
|
11189
11257
|
var WebSocketClient$1 = /*#__PURE__*/Object.freeze({
|
|
@@ -11254,6 +11322,7 @@ var WebSocketClient$1 = /*#__PURE__*/Object.freeze({
|
|
|
11254
11322
|
AGENT_UNPAUSED: AGENT_UNPAUSED,
|
|
11255
11323
|
CONFERENCE_ADHOC_PARTICIPANT_LEFT: CONFERENCE_ADHOC_PARTICIPANT_LEFT,
|
|
11256
11324
|
CONFERENCE_ADHOC_DELETED: CONFERENCE_ADHOC_DELETED,
|
|
11325
|
+
MEETING_USER_PROGRESS: MEETING_USER_PROGRESS,
|
|
11257
11326
|
HEARTBEAT_ENGINE_VERSION: HEARTBEAT_ENGINE_VERSION,
|
|
11258
11327
|
'default': WebSocketClient
|
|
11259
11328
|
});
|