@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/index.js
CHANGED
|
@@ -1644,6 +1644,7 @@ class IssueReporter {
|
|
|
1644
1644
|
|
|
1645
1645
|
|
|
1646
1646
|
|
|
1647
|
+
|
|
1647
1648
|
|
|
1648
1649
|
constructor() {
|
|
1649
1650
|
addLevelsTo(this);
|
|
@@ -1655,12 +1656,17 @@ class IssueReporter {
|
|
|
1655
1656
|
this.bufferTimeout = null;
|
|
1656
1657
|
this._boundProcessBuffer = this._processBuffer.bind(this);
|
|
1657
1658
|
this._boundParseLoggerBody = this._parseLoggerBody.bind(this);
|
|
1659
|
+
this._callback = null;
|
|
1658
1660
|
}
|
|
1659
1661
|
|
|
1660
1662
|
init() {
|
|
1661
1663
|
this._catchConsole();
|
|
1662
1664
|
}
|
|
1663
1665
|
|
|
1666
|
+
setCallback(cb ) {
|
|
1667
|
+
this._callback = cb;
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1664
1670
|
configureRemoteClient(configuration = { tag: 'wazo-sdk', host: null, port: null, level: null, extra: {} }) {
|
|
1665
1671
|
this.remoteClientConfiguration = configuration;
|
|
1666
1672
|
}
|
|
@@ -1696,6 +1702,7 @@ class IssueReporter {
|
|
|
1696
1702
|
|
|
1697
1703
|
// Handle category label
|
|
1698
1704
|
let category = null;
|
|
1705
|
+
let skipSendToRemote = false;
|
|
1699
1706
|
let extra = {};
|
|
1700
1707
|
if (args[0].indexOf(CATEGORY_PREFIX) === 0) {
|
|
1701
1708
|
category = args[0].split('=')[1];
|
|
@@ -1711,6 +1718,7 @@ class IssueReporter {
|
|
|
1711
1718
|
errorMessage: lastArg.message,
|
|
1712
1719
|
errorStack: lastArg.stack,
|
|
1713
1720
|
errorType: lastArg.constructor.name,
|
|
1721
|
+
skipSendToRemote: lastArg.skipSendToRemote,
|
|
1714
1722
|
};
|
|
1715
1723
|
} else {
|
|
1716
1724
|
extra = lastArg;
|
|
@@ -1719,6 +1727,11 @@ class IssueReporter {
|
|
|
1719
1727
|
args.splice(1, 1);
|
|
1720
1728
|
}
|
|
1721
1729
|
|
|
1730
|
+
if (extra.skipSendToRemote) {
|
|
1731
|
+
skipSendToRemote = true;
|
|
1732
|
+
delete extra.skipSendToRemote;
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1722
1735
|
const date = moment__default['default']().format('YYYY-MM-DD HH:mm:ss.SSS');
|
|
1723
1736
|
const message = args.join(', ');
|
|
1724
1737
|
let consoleMessage = message;
|
|
@@ -1739,7 +1752,13 @@ class IssueReporter {
|
|
|
1739
1752
|
const oldMethod = this.oldConsoleMethods[consoleLevel] || this.oldConsoleMethods.log;
|
|
1740
1753
|
oldMethod.apply(oldMethod, [date, consoleMessage]);
|
|
1741
1754
|
|
|
1742
|
-
this.
|
|
1755
|
+
if (this._callback) {
|
|
1756
|
+
this._callback(level, consoleMessage);
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
if (!skipSendToRemote) {
|
|
1760
|
+
this._sendToRemoteLogger(level, { date, message, category, ...extra });
|
|
1761
|
+
}
|
|
1743
1762
|
}
|
|
1744
1763
|
|
|
1745
1764
|
logRequest(url , options , response , start ) {
|
|
@@ -1884,7 +1903,11 @@ class IssueReporter {
|
|
|
1884
1903
|
},
|
|
1885
1904
|
// $FlowFixMe
|
|
1886
1905
|
body,
|
|
1887
|
-
}).catch(() => {
|
|
1906
|
+
}).catch((e ) => {
|
|
1907
|
+
// $FlowFixMe
|
|
1908
|
+
e.skipSendToRemote = true;
|
|
1909
|
+
this.log('error', this._makeCategory('grafana'), 'Sending log to grafana, error', e);
|
|
1910
|
+
|
|
1888
1911
|
setTimeout(() => {
|
|
1889
1912
|
if (isArray) {
|
|
1890
1913
|
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
|
});
|
|
@@ -450,6 +450,7 @@ class IssueReporter {
|
|
|
450
450
|
|
|
451
451
|
|
|
452
452
|
|
|
453
|
+
|
|
453
454
|
|
|
454
455
|
constructor() {
|
|
455
456
|
addLevelsTo(this);
|
|
@@ -461,12 +462,17 @@ class IssueReporter {
|
|
|
461
462
|
this.bufferTimeout = null;
|
|
462
463
|
this._boundProcessBuffer = this._processBuffer.bind(this);
|
|
463
464
|
this._boundParseLoggerBody = this._parseLoggerBody.bind(this);
|
|
465
|
+
this._callback = null;
|
|
464
466
|
}
|
|
465
467
|
|
|
466
468
|
init() {
|
|
467
469
|
this._catchConsole();
|
|
468
470
|
}
|
|
469
471
|
|
|
472
|
+
setCallback(cb ) {
|
|
473
|
+
this._callback = cb;
|
|
474
|
+
}
|
|
475
|
+
|
|
470
476
|
configureRemoteClient(configuration = { tag: 'wazo-sdk', host: null, port: null, level: null, extra: {} }) {
|
|
471
477
|
this.remoteClientConfiguration = configuration;
|
|
472
478
|
}
|
|
@@ -502,6 +508,7 @@ class IssueReporter {
|
|
|
502
508
|
|
|
503
509
|
// Handle category label
|
|
504
510
|
let category = null;
|
|
511
|
+
let skipSendToRemote = false;
|
|
505
512
|
let extra = {};
|
|
506
513
|
if (args[0].indexOf(CATEGORY_PREFIX) === 0) {
|
|
507
514
|
category = args[0].split('=')[1];
|
|
@@ -517,6 +524,7 @@ class IssueReporter {
|
|
|
517
524
|
errorMessage: lastArg.message,
|
|
518
525
|
errorStack: lastArg.stack,
|
|
519
526
|
errorType: lastArg.constructor.name,
|
|
527
|
+
skipSendToRemote: lastArg.skipSendToRemote,
|
|
520
528
|
};
|
|
521
529
|
} else {
|
|
522
530
|
extra = lastArg;
|
|
@@ -525,6 +533,11 @@ class IssueReporter {
|
|
|
525
533
|
args.splice(1, 1);
|
|
526
534
|
}
|
|
527
535
|
|
|
536
|
+
if (extra.skipSendToRemote) {
|
|
537
|
+
skipSendToRemote = true;
|
|
538
|
+
delete extra.skipSendToRemote;
|
|
539
|
+
}
|
|
540
|
+
|
|
528
541
|
const date = moment__default['default']().format('YYYY-MM-DD HH:mm:ss.SSS');
|
|
529
542
|
const message = args.join(', ');
|
|
530
543
|
let consoleMessage = message;
|
|
@@ -545,7 +558,13 @@ class IssueReporter {
|
|
|
545
558
|
const oldMethod = this.oldConsoleMethods[consoleLevel] || this.oldConsoleMethods.log;
|
|
546
559
|
oldMethod.apply(oldMethod, [date, consoleMessage]);
|
|
547
560
|
|
|
548
|
-
this.
|
|
561
|
+
if (this._callback) {
|
|
562
|
+
this._callback(level, consoleMessage);
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
if (!skipSendToRemote) {
|
|
566
|
+
this._sendToRemoteLogger(level, { date, message, category, ...extra });
|
|
567
|
+
}
|
|
549
568
|
}
|
|
550
569
|
|
|
551
570
|
logRequest(url , options , response , start ) {
|
|
@@ -690,7 +709,11 @@ class IssueReporter {
|
|
|
690
709
|
},
|
|
691
710
|
// $FlowFixMe
|
|
692
711
|
body,
|
|
693
|
-
}).catch(() => {
|
|
712
|
+
}).catch((e ) => {
|
|
713
|
+
// $FlowFixMe
|
|
714
|
+
e.skipSendToRemote = true;
|
|
715
|
+
this.log('error', this._makeCategory('grafana'), 'Sending log to grafana, error', e);
|
|
716
|
+
|
|
694
717
|
setTimeout(() => {
|
|
695
718
|
if (isArray) {
|
|
696
719
|
payload = payload.map(message => {
|
|
@@ -2669,11 +2692,24 @@ class Meeting {
|
|
|
2669
2692
|
});
|
|
2670
2693
|
}
|
|
2671
2694
|
|
|
2695
|
+
static parseMany(items ) {
|
|
2696
|
+
return items.map(plain => Meeting.parse(plain));
|
|
2697
|
+
}
|
|
2698
|
+
|
|
2672
2699
|
static newFrom(meeting ) {
|
|
2673
2700
|
return newFrom(meeting, Meeting);
|
|
2674
2701
|
}
|
|
2675
2702
|
|
|
2676
|
-
constructor({
|
|
2703
|
+
constructor({
|
|
2704
|
+
uuid,
|
|
2705
|
+
name,
|
|
2706
|
+
guestSipAuthorization,
|
|
2707
|
+
ownerUuids,
|
|
2708
|
+
port,
|
|
2709
|
+
uri,
|
|
2710
|
+
number,
|
|
2711
|
+
persistent,
|
|
2712
|
+
} = {}) {
|
|
2677
2713
|
this.guestSipAuthorization = guestSipAuthorization;
|
|
2678
2714
|
this.uri = uri;
|
|
2679
2715
|
this.name = name;
|
|
@@ -2759,8 +2795,11 @@ var confdMethods = (client , baseUrl ) => ({
|
|
|
2759
2795
|
}
|
|
2760
2796
|
},
|
|
2761
2797
|
|
|
2762
|
-
|
|
2763
|
-
client.
|
|
2798
|
+
getMyMeetings: () =>
|
|
2799
|
+
client.get(`${baseUrl}/users/me/meetings`).then(response => Meeting.parseMany(response.items)),
|
|
2800
|
+
|
|
2801
|
+
createMyMeeting: (name , persistent ) =>
|
|
2802
|
+
client.post(`${baseUrl}/users/me/meetings`, { name, persistent }).then(Meeting.parse),
|
|
2764
2803
|
|
|
2765
2804
|
deleteMyMeeting: (meetingUuid ) =>
|
|
2766
2805
|
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
|
});
|