@wazo/sdk 0.37.23 → 0.37.27
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/README.md +95 -57
- package/dist/wazo-sdk.js +3 -3
- package/esm/__tests__/api-client.test.js +12 -7
- package/esm/__tests__/web-rtc-client.test.js +47 -20
- package/esm/api/agentd.js +1 -1
- package/esm/api/amid.js +1 -1
- package/esm/api/application.js +1 -1
- package/esm/api/auth.js +1 -1
- package/esm/api/call-logd.js +1 -1
- package/esm/api/calld.js +1 -1
- package/esm/api/chatd.js +1 -1
- package/esm/api/confd.js +11 -6
- package/esm/api/ctid-ng.js +1 -1
- package/esm/api/dird.js +2 -2
- package/esm/api/webhookd.js +1 -1
- package/esm/api-client.js +12 -7
- package/esm/checker/Checker.js +47 -20
- package/esm/checker/checks/aor.js +12 -7
- package/esm/checker/checks/api.js +12 -7
- package/esm/checker/checks/index.js +47 -20
- package/esm/checker/checks/wazo-websocket.js +1 -1
- package/esm/checker/checks/webrtc-transport.js +47 -20
- package/esm/checker/checks/webrtc.js +47 -20
- package/esm/domain/AdHocAPIConference.js +12 -7
- package/esm/domain/Contact.js +1 -1
- package/esm/domain/Features.js +12 -7
- package/esm/domain/Meeting.js +12 -5
- package/esm/domain/Phone/CTIPhone.js +12 -7
- package/esm/domain/Phone/WebRTCPhone.js +34 -6
- package/esm/domain/__tests__/Contact.test.js +1 -1
- package/esm/domain/__tests__/Meeting.test.js +144 -0
- package/esm/index.js +80 -25
- package/esm/lib/WazoSessionDescriptionHandler.js +9 -4
- package/esm/service/CallApi.js +12 -7
- package/esm/service/IssueReporter.js +1 -1
- package/esm/service/__tests__/IssueReporter.test.js +1 -1
- package/esm/service/getApiClient.js +12 -7
- package/esm/simple/Auth.js +80 -25
- package/esm/simple/Configuration.js +80 -25
- package/esm/simple/Directory.js +12 -7
- package/esm/simple/Phone.js +80 -25
- package/esm/simple/Websocket.js +1 -1
- package/esm/simple/index.js +80 -25
- package/esm/simple/room/LocalParticipant.js +80 -25
- package/esm/simple/room/Participant.js +80 -25
- package/esm/simple/room/RemoteParticipant.js +80 -25
- package/esm/simple/room/Room.js +80 -25
- package/esm/simple/room/SipRoom.js +80 -25
- package/esm/simple/room/Stream.js +80 -25
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +80 -25
- package/esm/simple/utils.js +80 -25
- package/esm/types/WebSocketMessage.js +1 -1
- package/esm/utils/__tests__/api-requester.test.js +1 -1
- package/esm/utils/api-requester.js +1 -1
- package/esm/web-rtc-client.js +47 -20
- package/esm/websocket-client.js +1 -1
- package/lib/__tests__/api-client.test.js +12 -7
- package/lib/__tests__/web-rtc-client.test.js +47 -20
- package/lib/api/agentd.js +1 -1
- package/lib/api/amid.js +1 -1
- package/lib/api/application.js +1 -1
- package/lib/api/auth.js +1 -1
- package/lib/api/call-logd.js +1 -1
- package/lib/api/calld.js +1 -1
- package/lib/api/chatd.js +1 -1
- package/lib/api/confd.js +11 -6
- package/lib/api/ctid-ng.js +1 -1
- package/lib/api/dird.js +2 -2
- package/lib/api/webhookd.js +1 -1
- package/lib/api-client.js +12 -7
- package/lib/checker/Checker.js +47 -20
- package/lib/checker/checks/aor.js +12 -7
- package/lib/checker/checks/api.js +12 -7
- package/lib/checker/checks/index.js +47 -20
- package/lib/checker/checks/wazo-websocket.js +1 -1
- package/lib/checker/checks/webrtc-transport.js +47 -20
- package/lib/checker/checks/webrtc.js +47 -20
- package/lib/domain/AdHocAPIConference.js +12 -7
- package/lib/domain/Contact.js +1 -1
- package/lib/domain/Features.js +12 -7
- package/lib/domain/Meeting.js +16 -5
- package/lib/domain/Phone/CTIPhone.js +12 -7
- package/lib/domain/Phone/WebRTCPhone.js +34 -6
- package/lib/domain/__tests__/Contact.test.js +1 -1
- package/lib/domain/__tests__/Meeting.test.js +150 -0
- package/lib/index.js +80 -25
- package/lib/lib/WazoSessionDescriptionHandler.js +9 -4
- package/lib/service/CallApi.js +12 -7
- package/lib/service/IssueReporter.js +1 -1
- package/lib/service/__tests__/IssueReporter.test.js +1 -1
- package/lib/service/getApiClient.js +12 -7
- package/lib/simple/Auth.js +80 -25
- package/lib/simple/Configuration.js +80 -25
- package/lib/simple/Directory.js +12 -7
- package/lib/simple/Phone.js +80 -25
- package/lib/simple/Websocket.js +1 -1
- package/lib/simple/index.js +80 -25
- package/lib/simple/room/LocalParticipant.js +80 -25
- package/lib/simple/room/Participant.js +80 -25
- package/lib/simple/room/RemoteParticipant.js +80 -25
- package/lib/simple/room/Room.js +80 -25
- package/lib/simple/room/SipRoom.js +80 -25
- package/lib/simple/room/Stream.js +80 -25
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +80 -25
- package/lib/simple/utils.js +80 -25
- package/lib/types/WebSocketMessage.js +2 -0
- package/lib/utils/__tests__/api-requester.test.js +1 -1
- package/lib/utils/api-requester.js +1 -1
- package/lib/web-rtc-client.js +47 -20
- package/lib/websocket-client.js +1 -1
- package/package.json +1 -1
- package/src/domain/Contact.js +1 -1
- package/src/domain/Meeting.js +12 -5
- package/src/domain/Phone/WebRTCPhone.js +33 -5
- package/src/domain/__tests__/Meeting.test.js +50 -0
- package/src/lib/WazoSessionDescriptionHandler.js +8 -3
- package/src/utils/api-requester.js +1 -1
- package/src/web-rtc-client.js +27 -10
|
@@ -113,7 +113,7 @@ const logger$2 = IssueReporter$1 ? IssueReporter$1.loggerFor('api') : console;
|
|
|
113
113
|
|
|
114
114
|
// Use a function here to be able to mock it in tests
|
|
115
115
|
const realFetch = () => {
|
|
116
|
-
if (typeof document !== 'undefined') {
|
|
116
|
+
if (typeof document !== 'undefined' && window.fetch) {
|
|
117
117
|
// Browser
|
|
118
118
|
return window.fetch;
|
|
119
119
|
}
|
|
@@ -832,11 +832,16 @@ class WazoSessionDescriptionHandler extends sessionDescriptionHandler.SessionDes
|
|
|
832
832
|
|
|
833
833
|
// $FlowFixMe
|
|
834
834
|
setRemoteSessionDescription(sessionDescription ) {
|
|
835
|
-
|
|
835
|
+
try {
|
|
836
|
+
const result = super.setRemoteSessionDescription(sessionDescription);
|
|
836
837
|
|
|
837
|
-
|
|
838
|
+
this.eventEmitter.emit('setDescription', sessionDescription);
|
|
838
839
|
|
|
839
|
-
|
|
840
|
+
return result;
|
|
841
|
+
} catch (error) {
|
|
842
|
+
this.logger.error('SessionDescriptionHandler.setRemoteSessionDescription error', error);
|
|
843
|
+
throw error;
|
|
844
|
+
}
|
|
840
845
|
}
|
|
841
846
|
|
|
842
847
|
// Overridden to avoid to fix ice-candidates missing in the SDP in react-native and chrome canary.
|
|
@@ -2456,7 +2461,7 @@ class Contact {
|
|
|
2456
2461
|
this[key] = old[key] || this[key];
|
|
2457
2462
|
});
|
|
2458
2463
|
|
|
2459
|
-
if (old.lineState
|
|
2464
|
+
if (old.lineState) {
|
|
2460
2465
|
this.lineState = old.lineState;
|
|
2461
2466
|
}
|
|
2462
2467
|
|
|
@@ -3163,8 +3168,9 @@ class ExternalApp {
|
|
|
3163
3168
|
|
|
3164
3169
|
|
|
3165
3170
|
|
|
3166
|
-
|
|
3171
|
+
|
|
3167
3172
|
|
|
3173
|
+
|
|
3168
3174
|
|
|
3169
3175
|
|
|
3170
3176
|
class Meeting {
|
|
@@ -3175,9 +3181,10 @@ class Meeting {
|
|
|
3175
3181
|
|
|
3176
3182
|
|
|
3177
3183
|
|
|
3178
|
-
|
|
3184
|
+
|
|
3179
3185
|
|
|
3180
3186
|
|
|
3187
|
+
|
|
3181
3188
|
|
|
3182
3189
|
static parse(plain ) {
|
|
3183
3190
|
return new Meeting({
|
|
@@ -3187,8 +3194,9 @@ class Meeting {
|
|
|
3187
3194
|
ownerUuids: plain.owner_uuids,
|
|
3188
3195
|
port: plain.port,
|
|
3189
3196
|
uuid: plain.uuid,
|
|
3190
|
-
|
|
3197
|
+
extension: plain.exten,
|
|
3191
3198
|
persistent: plain.persistent,
|
|
3199
|
+
creationTime: moment__default['default'](plain.creation_time).toDate(),
|
|
3192
3200
|
});
|
|
3193
3201
|
}
|
|
3194
3202
|
|
|
@@ -3210,8 +3218,9 @@ class Meeting {
|
|
|
3210
3218
|
ownerUuids,
|
|
3211
3219
|
port,
|
|
3212
3220
|
uri,
|
|
3213
|
-
|
|
3221
|
+
extension,
|
|
3214
3222
|
persistent,
|
|
3223
|
+
creationTime,
|
|
3215
3224
|
} = {}) {
|
|
3216
3225
|
this.guestSipAuthorization = guestSipAuthorization;
|
|
3217
3226
|
this.uri = uri;
|
|
@@ -3219,8 +3228,9 @@ class Meeting {
|
|
|
3219
3228
|
this.ownerUuids = ownerUuids;
|
|
3220
3229
|
this.port = port;
|
|
3221
3230
|
this.uuid = uuid;
|
|
3222
|
-
this.
|
|
3231
|
+
this.extension = extension;
|
|
3223
3232
|
this.persistent = persistent;
|
|
3233
|
+
this.creationTime = creationTime;
|
|
3224
3234
|
|
|
3225
3235
|
// Useful to compare instead of instanceof with minified code
|
|
3226
3236
|
this.type = 'Meeting';
|
|
@@ -5709,7 +5719,7 @@ class WebRTCClient extends Emitter {
|
|
|
5709
5719
|
}
|
|
5710
5720
|
|
|
5711
5721
|
call(number , enableVideo , audioOnly = false, conference = false) {
|
|
5712
|
-
logger.info('sdk webrtc creating call', { number, enableVideo, audioOnly });
|
|
5722
|
+
logger.info('sdk webrtc creating call', { number, enableVideo, audioOnly, conference });
|
|
5713
5723
|
const inviterOptions = {
|
|
5714
5724
|
sessionDescriptionHandlerOptionsReInvite: {
|
|
5715
5725
|
conference,
|
|
@@ -6785,6 +6795,7 @@ class WebRTCClient extends Emitter {
|
|
|
6785
6795
|
const screenSharing = constraints && 'screen' in constraints ? constraints.screen : false;
|
|
6786
6796
|
const isDesktop = constraints && 'desktop' in constraints ? constraints.desktop : false;
|
|
6787
6797
|
const withAudio = constraints && 'audio' in constraints ? constraints.audio : true;
|
|
6798
|
+
const mandatoryVideo = constraints && typeof constraints.video === 'object' ? constraints.video.mandatory : {};
|
|
6788
6799
|
|
|
6789
6800
|
logger.info('Retrieving media a configuration', { enableVideo, screenSharing, isDesktop, withAudio, constraints });
|
|
6790
6801
|
|
|
@@ -6792,7 +6803,8 @@ class WebRTCClient extends Emitter {
|
|
|
6792
6803
|
constraints: {
|
|
6793
6804
|
// Exact constraint are not supported with `getDisplayMedia` and we must have a video=false in desktop screenshare
|
|
6794
6805
|
audio: screenSharing ? !isDesktop : (withAudio ? this._getAudioConstraints() : false),
|
|
6795
|
-
video: screenSharing ? (isDesktop
|
|
6806
|
+
video: screenSharing ? (isDesktop
|
|
6807
|
+
? ({ mandatory: { chromeMediaSource: 'desktop', ...(mandatoryVideo || {}) } }) : { cursor: 'always' })
|
|
6796
6808
|
: this._getVideoConstraints(enableVideo),
|
|
6797
6809
|
screen: screenSharing,
|
|
6798
6810
|
desktop: isDesktop,
|
|
@@ -7127,12 +7139,14 @@ class WebRTCClient extends Emitter {
|
|
|
7127
7139
|
|
|
7128
7140
|
session.sessionDescriptionHandler.remoteMediaStream.onaddtrack = onTrack;
|
|
7129
7141
|
|
|
7130
|
-
|
|
7131
|
-
|
|
7132
|
-
|
|
7133
|
-
|
|
7134
|
-
|
|
7135
|
-
|
|
7142
|
+
if (pc) {
|
|
7143
|
+
pc.oniceconnectionstatechange = () => {
|
|
7144
|
+
logger.info('on ice connection state changed', { state: pc.iceConnectionState });
|
|
7145
|
+
if (pc.iceConnectionState === 'disconnected') {
|
|
7146
|
+
this.eventEmitter.emit(ON_DISCONNECTED);
|
|
7147
|
+
}
|
|
7148
|
+
};
|
|
7149
|
+
}
|
|
7136
7150
|
|
|
7137
7151
|
if (withEvent) {
|
|
7138
7152
|
this.eventEmitter.emit(ACCEPTED, session, sessionDialog);
|
|
@@ -7342,13 +7356,17 @@ class WebRTCClient extends Emitter {
|
|
|
7342
7356
|
const nbStats = this.sessionNetworkStats[sessionId].length;
|
|
7343
7357
|
const lastNetworkStats = this.sessionNetworkStats[sessionId][nbStats - 1];
|
|
7344
7358
|
const lastAudioSent = lastNetworkStats ? lastNetworkStats.audioBytesSent : 0;
|
|
7359
|
+
const lastAudioContentSent = lastNetworkStats ? lastNetworkStats.audioContentSent : 0;
|
|
7345
7360
|
const lastVideoSent = lastNetworkStats ? lastNetworkStats.videoBytesSent : 0;
|
|
7346
7361
|
const lastAudioReceived = lastNetworkStats ? lastNetworkStats.audioBytesReceived : 0;
|
|
7362
|
+
const lastAudioContentReceived = lastNetworkStats ? lastNetworkStats.audioContentReceived : 0;
|
|
7347
7363
|
const lastVideoReceived = lastNetworkStats ? lastNetworkStats.videoBytesReceived : 0;
|
|
7348
7364
|
const lastTransportSent = lastNetworkStats ? lastNetworkStats.transportSent : 0;
|
|
7349
7365
|
const lastTransportReceived = lastNetworkStats ? lastNetworkStats.transportReceived : 0;
|
|
7350
|
-
let audioBytesSent = 0;
|
|
7351
|
-
let audioBytesReceived = 0;
|
|
7366
|
+
let audioBytesSent = 0; // content + header
|
|
7367
|
+
let audioBytesReceived = 0; // content + header
|
|
7368
|
+
let audioContentSent = 0; // useful to detect blank call
|
|
7369
|
+
let audioContentReceived = 0;
|
|
7352
7370
|
let videoBytesSent = 0;
|
|
7353
7371
|
let videoBytesReceived = 0;
|
|
7354
7372
|
let transportSent = 0;
|
|
@@ -7358,6 +7376,7 @@ class WebRTCClient extends Emitter {
|
|
|
7358
7376
|
stats.forEach(report => {
|
|
7359
7377
|
if (report.type === 'outbound-rtp' && report.kind === 'audio') {
|
|
7360
7378
|
audioBytesSent += Number(report.bytesSent) + Number(report.headerBytesSent);
|
|
7379
|
+
audioContentSent += Number(report.bytesSent);
|
|
7361
7380
|
}
|
|
7362
7381
|
if (report.type === 'remote-outbound-rtp' && report.kind === 'audio') {
|
|
7363
7382
|
audioBytesSent += Number(report.bytesSent);
|
|
@@ -7369,6 +7388,7 @@ class WebRTCClient extends Emitter {
|
|
|
7369
7388
|
packetsLost += Number(report.packetsLost);
|
|
7370
7389
|
networkStats.packetsReceived = Number(report.packetsReceived);
|
|
7371
7390
|
audioBytesReceived += Number(report.bytesReceived) + Number(report.headerBytesReceived);
|
|
7391
|
+
audioContentReceived += Number(report.bytesReceived);
|
|
7372
7392
|
}
|
|
7373
7393
|
if (report.type === 'inbound-rtp' && report.kind === 'video') {
|
|
7374
7394
|
videoBytesReceived += Number(report.bytesReceived) + Number(report.headerBytesReceived);
|
|
@@ -7397,10 +7417,17 @@ class WebRTCClient extends Emitter {
|
|
|
7397
7417
|
});
|
|
7398
7418
|
|
|
7399
7419
|
networkStats.packetsLost = packetsLost;
|
|
7420
|
+
|
|
7400
7421
|
networkStats.totalAudioBytesSent = audioBytesSent;
|
|
7401
7422
|
networkStats.audioBytesSent = audioBytesSent - lastAudioSent;
|
|
7402
7423
|
networkStats.totalAudioBytesReceived = audioBytesReceived - lastAudioReceived;
|
|
7403
7424
|
networkStats.audioBytesReceived = audioBytesReceived;
|
|
7425
|
+
|
|
7426
|
+
networkStats.totalAudioContentSent = audioContentSent;
|
|
7427
|
+
networkStats.audioContentSent = audioContentSent - lastAudioContentSent;
|
|
7428
|
+
networkStats.totalAudioBytesReceived = audioContentReceived - lastAudioContentReceived;
|
|
7429
|
+
networkStats.audioContentReceived = audioContentReceived;
|
|
7430
|
+
|
|
7404
7431
|
networkStats.totalVideoBytesSent = videoBytesSent;
|
|
7405
7432
|
networkStats.videoBytesSent = videoBytesSent - lastVideoSent;
|
|
7406
7433
|
networkStats.totalVideoBytesReceived = videoBytesReceived;
|
|
@@ -113,7 +113,7 @@ const logger$2 = IssueReporter$1 ? IssueReporter$1.loggerFor('api') : console;
|
|
|
113
113
|
|
|
114
114
|
// Use a function here to be able to mock it in tests
|
|
115
115
|
const realFetch = () => {
|
|
116
|
-
if (typeof document !== 'undefined') {
|
|
116
|
+
if (typeof document !== 'undefined' && window.fetch) {
|
|
117
117
|
// Browser
|
|
118
118
|
return window.fetch;
|
|
119
119
|
}
|
|
@@ -832,11 +832,16 @@ class WazoSessionDescriptionHandler extends sessionDescriptionHandler.SessionDes
|
|
|
832
832
|
|
|
833
833
|
// $FlowFixMe
|
|
834
834
|
setRemoteSessionDescription(sessionDescription ) {
|
|
835
|
-
|
|
835
|
+
try {
|
|
836
|
+
const result = super.setRemoteSessionDescription(sessionDescription);
|
|
836
837
|
|
|
837
|
-
|
|
838
|
+
this.eventEmitter.emit('setDescription', sessionDescription);
|
|
838
839
|
|
|
839
|
-
|
|
840
|
+
return result;
|
|
841
|
+
} catch (error) {
|
|
842
|
+
this.logger.error('SessionDescriptionHandler.setRemoteSessionDescription error', error);
|
|
843
|
+
throw error;
|
|
844
|
+
}
|
|
840
845
|
}
|
|
841
846
|
|
|
842
847
|
// Overridden to avoid to fix ice-candidates missing in the SDP in react-native and chrome canary.
|
|
@@ -2456,7 +2461,7 @@ class Contact {
|
|
|
2456
2461
|
this[key] = old[key] || this[key];
|
|
2457
2462
|
});
|
|
2458
2463
|
|
|
2459
|
-
if (old.lineState
|
|
2464
|
+
if (old.lineState) {
|
|
2460
2465
|
this.lineState = old.lineState;
|
|
2461
2466
|
}
|
|
2462
2467
|
|
|
@@ -3163,8 +3168,9 @@ class ExternalApp {
|
|
|
3163
3168
|
|
|
3164
3169
|
|
|
3165
3170
|
|
|
3166
|
-
|
|
3171
|
+
|
|
3167
3172
|
|
|
3173
|
+
|
|
3168
3174
|
|
|
3169
3175
|
|
|
3170
3176
|
class Meeting {
|
|
@@ -3175,9 +3181,10 @@ class Meeting {
|
|
|
3175
3181
|
|
|
3176
3182
|
|
|
3177
3183
|
|
|
3178
|
-
|
|
3184
|
+
|
|
3179
3185
|
|
|
3180
3186
|
|
|
3187
|
+
|
|
3181
3188
|
|
|
3182
3189
|
static parse(plain ) {
|
|
3183
3190
|
return new Meeting({
|
|
@@ -3187,8 +3194,9 @@ class Meeting {
|
|
|
3187
3194
|
ownerUuids: plain.owner_uuids,
|
|
3188
3195
|
port: plain.port,
|
|
3189
3196
|
uuid: plain.uuid,
|
|
3190
|
-
|
|
3197
|
+
extension: plain.exten,
|
|
3191
3198
|
persistent: plain.persistent,
|
|
3199
|
+
creationTime: moment__default['default'](plain.creation_time).toDate(),
|
|
3192
3200
|
});
|
|
3193
3201
|
}
|
|
3194
3202
|
|
|
@@ -3210,8 +3218,9 @@ class Meeting {
|
|
|
3210
3218
|
ownerUuids,
|
|
3211
3219
|
port,
|
|
3212
3220
|
uri,
|
|
3213
|
-
|
|
3221
|
+
extension,
|
|
3214
3222
|
persistent,
|
|
3223
|
+
creationTime,
|
|
3215
3224
|
} = {}) {
|
|
3216
3225
|
this.guestSipAuthorization = guestSipAuthorization;
|
|
3217
3226
|
this.uri = uri;
|
|
@@ -3219,8 +3228,9 @@ class Meeting {
|
|
|
3219
3228
|
this.ownerUuids = ownerUuids;
|
|
3220
3229
|
this.port = port;
|
|
3221
3230
|
this.uuid = uuid;
|
|
3222
|
-
this.
|
|
3231
|
+
this.extension = extension;
|
|
3223
3232
|
this.persistent = persistent;
|
|
3233
|
+
this.creationTime = creationTime;
|
|
3224
3234
|
|
|
3225
3235
|
// Useful to compare instead of instanceof with minified code
|
|
3226
3236
|
this.type = 'Meeting';
|
|
@@ -5709,7 +5719,7 @@ class WebRTCClient extends Emitter {
|
|
|
5709
5719
|
}
|
|
5710
5720
|
|
|
5711
5721
|
call(number , enableVideo , audioOnly = false, conference = false) {
|
|
5712
|
-
logger.info('sdk webrtc creating call', { number, enableVideo, audioOnly });
|
|
5722
|
+
logger.info('sdk webrtc creating call', { number, enableVideo, audioOnly, conference });
|
|
5713
5723
|
const inviterOptions = {
|
|
5714
5724
|
sessionDescriptionHandlerOptionsReInvite: {
|
|
5715
5725
|
conference,
|
|
@@ -6785,6 +6795,7 @@ class WebRTCClient extends Emitter {
|
|
|
6785
6795
|
const screenSharing = constraints && 'screen' in constraints ? constraints.screen : false;
|
|
6786
6796
|
const isDesktop = constraints && 'desktop' in constraints ? constraints.desktop : false;
|
|
6787
6797
|
const withAudio = constraints && 'audio' in constraints ? constraints.audio : true;
|
|
6798
|
+
const mandatoryVideo = constraints && typeof constraints.video === 'object' ? constraints.video.mandatory : {};
|
|
6788
6799
|
|
|
6789
6800
|
logger.info('Retrieving media a configuration', { enableVideo, screenSharing, isDesktop, withAudio, constraints });
|
|
6790
6801
|
|
|
@@ -6792,7 +6803,8 @@ class WebRTCClient extends Emitter {
|
|
|
6792
6803
|
constraints: {
|
|
6793
6804
|
// Exact constraint are not supported with `getDisplayMedia` and we must have a video=false in desktop screenshare
|
|
6794
6805
|
audio: screenSharing ? !isDesktop : (withAudio ? this._getAudioConstraints() : false),
|
|
6795
|
-
video: screenSharing ? (isDesktop
|
|
6806
|
+
video: screenSharing ? (isDesktop
|
|
6807
|
+
? ({ mandatory: { chromeMediaSource: 'desktop', ...(mandatoryVideo || {}) } }) : { cursor: 'always' })
|
|
6796
6808
|
: this._getVideoConstraints(enableVideo),
|
|
6797
6809
|
screen: screenSharing,
|
|
6798
6810
|
desktop: isDesktop,
|
|
@@ -7127,12 +7139,14 @@ class WebRTCClient extends Emitter {
|
|
|
7127
7139
|
|
|
7128
7140
|
session.sessionDescriptionHandler.remoteMediaStream.onaddtrack = onTrack;
|
|
7129
7141
|
|
|
7130
|
-
|
|
7131
|
-
|
|
7132
|
-
|
|
7133
|
-
|
|
7134
|
-
|
|
7135
|
-
|
|
7142
|
+
if (pc) {
|
|
7143
|
+
pc.oniceconnectionstatechange = () => {
|
|
7144
|
+
logger.info('on ice connection state changed', { state: pc.iceConnectionState });
|
|
7145
|
+
if (pc.iceConnectionState === 'disconnected') {
|
|
7146
|
+
this.eventEmitter.emit(ON_DISCONNECTED);
|
|
7147
|
+
}
|
|
7148
|
+
};
|
|
7149
|
+
}
|
|
7136
7150
|
|
|
7137
7151
|
if (withEvent) {
|
|
7138
7152
|
this.eventEmitter.emit(ACCEPTED, session, sessionDialog);
|
|
@@ -7342,13 +7356,17 @@ class WebRTCClient extends Emitter {
|
|
|
7342
7356
|
const nbStats = this.sessionNetworkStats[sessionId].length;
|
|
7343
7357
|
const lastNetworkStats = this.sessionNetworkStats[sessionId][nbStats - 1];
|
|
7344
7358
|
const lastAudioSent = lastNetworkStats ? lastNetworkStats.audioBytesSent : 0;
|
|
7359
|
+
const lastAudioContentSent = lastNetworkStats ? lastNetworkStats.audioContentSent : 0;
|
|
7345
7360
|
const lastVideoSent = lastNetworkStats ? lastNetworkStats.videoBytesSent : 0;
|
|
7346
7361
|
const lastAudioReceived = lastNetworkStats ? lastNetworkStats.audioBytesReceived : 0;
|
|
7362
|
+
const lastAudioContentReceived = lastNetworkStats ? lastNetworkStats.audioContentReceived : 0;
|
|
7347
7363
|
const lastVideoReceived = lastNetworkStats ? lastNetworkStats.videoBytesReceived : 0;
|
|
7348
7364
|
const lastTransportSent = lastNetworkStats ? lastNetworkStats.transportSent : 0;
|
|
7349
7365
|
const lastTransportReceived = lastNetworkStats ? lastNetworkStats.transportReceived : 0;
|
|
7350
|
-
let audioBytesSent = 0;
|
|
7351
|
-
let audioBytesReceived = 0;
|
|
7366
|
+
let audioBytesSent = 0; // content + header
|
|
7367
|
+
let audioBytesReceived = 0; // content + header
|
|
7368
|
+
let audioContentSent = 0; // useful to detect blank call
|
|
7369
|
+
let audioContentReceived = 0;
|
|
7352
7370
|
let videoBytesSent = 0;
|
|
7353
7371
|
let videoBytesReceived = 0;
|
|
7354
7372
|
let transportSent = 0;
|
|
@@ -7358,6 +7376,7 @@ class WebRTCClient extends Emitter {
|
|
|
7358
7376
|
stats.forEach(report => {
|
|
7359
7377
|
if (report.type === 'outbound-rtp' && report.kind === 'audio') {
|
|
7360
7378
|
audioBytesSent += Number(report.bytesSent) + Number(report.headerBytesSent);
|
|
7379
|
+
audioContentSent += Number(report.bytesSent);
|
|
7361
7380
|
}
|
|
7362
7381
|
if (report.type === 'remote-outbound-rtp' && report.kind === 'audio') {
|
|
7363
7382
|
audioBytesSent += Number(report.bytesSent);
|
|
@@ -7369,6 +7388,7 @@ class WebRTCClient extends Emitter {
|
|
|
7369
7388
|
packetsLost += Number(report.packetsLost);
|
|
7370
7389
|
networkStats.packetsReceived = Number(report.packetsReceived);
|
|
7371
7390
|
audioBytesReceived += Number(report.bytesReceived) + Number(report.headerBytesReceived);
|
|
7391
|
+
audioContentReceived += Number(report.bytesReceived);
|
|
7372
7392
|
}
|
|
7373
7393
|
if (report.type === 'inbound-rtp' && report.kind === 'video') {
|
|
7374
7394
|
videoBytesReceived += Number(report.bytesReceived) + Number(report.headerBytesReceived);
|
|
@@ -7397,10 +7417,17 @@ class WebRTCClient extends Emitter {
|
|
|
7397
7417
|
});
|
|
7398
7418
|
|
|
7399
7419
|
networkStats.packetsLost = packetsLost;
|
|
7420
|
+
|
|
7400
7421
|
networkStats.totalAudioBytesSent = audioBytesSent;
|
|
7401
7422
|
networkStats.audioBytesSent = audioBytesSent - lastAudioSent;
|
|
7402
7423
|
networkStats.totalAudioBytesReceived = audioBytesReceived - lastAudioReceived;
|
|
7403
7424
|
networkStats.audioBytesReceived = audioBytesReceived;
|
|
7425
|
+
|
|
7426
|
+
networkStats.totalAudioContentSent = audioContentSent;
|
|
7427
|
+
networkStats.audioContentSent = audioContentSent - lastAudioContentSent;
|
|
7428
|
+
networkStats.totalAudioBytesReceived = audioContentReceived - lastAudioContentReceived;
|
|
7429
|
+
networkStats.audioContentReceived = audioContentReceived;
|
|
7430
|
+
|
|
7404
7431
|
networkStats.totalVideoBytesSent = videoBytesSent;
|
|
7405
7432
|
networkStats.videoBytesSent = videoBytesSent - lastVideoSent;
|
|
7406
7433
|
networkStats.totalVideoBytesReceived = videoBytesReceived;
|
|
@@ -670,7 +670,7 @@ const logger$1 = IssueReporter$1 ? IssueReporter$1.loggerFor('api') : console;
|
|
|
670
670
|
|
|
671
671
|
// Use a function here to be able to mock it in tests
|
|
672
672
|
const realFetch = () => {
|
|
673
|
-
if (typeof document !== 'undefined') {
|
|
673
|
+
if (typeof document !== 'undefined' && window.fetch) {
|
|
674
674
|
// Browser
|
|
675
675
|
return window.fetch;
|
|
676
676
|
}
|
|
@@ -2119,7 +2119,7 @@ class Contact {
|
|
|
2119
2119
|
this[key] = old[key] || this[key];
|
|
2120
2120
|
});
|
|
2121
2121
|
|
|
2122
|
-
if (old.lineState
|
|
2122
|
+
if (old.lineState) {
|
|
2123
2123
|
this.lineState = old.lineState;
|
|
2124
2124
|
}
|
|
2125
2125
|
|
|
@@ -2826,8 +2826,9 @@ class ExternalApp {
|
|
|
2826
2826
|
|
|
2827
2827
|
|
|
2828
2828
|
|
|
2829
|
-
|
|
2829
|
+
|
|
2830
2830
|
|
|
2831
|
+
|
|
2831
2832
|
|
|
2832
2833
|
|
|
2833
2834
|
class Meeting {
|
|
@@ -2838,9 +2839,10 @@ class Meeting {
|
|
|
2838
2839
|
|
|
2839
2840
|
|
|
2840
2841
|
|
|
2841
|
-
|
|
2842
|
+
|
|
2842
2843
|
|
|
2843
2844
|
|
|
2845
|
+
|
|
2844
2846
|
|
|
2845
2847
|
static parse(plain ) {
|
|
2846
2848
|
return new Meeting({
|
|
@@ -2850,8 +2852,9 @@ class Meeting {
|
|
|
2850
2852
|
ownerUuids: plain.owner_uuids,
|
|
2851
2853
|
port: plain.port,
|
|
2852
2854
|
uuid: plain.uuid,
|
|
2853
|
-
|
|
2855
|
+
extension: plain.exten,
|
|
2854
2856
|
persistent: plain.persistent,
|
|
2857
|
+
creationTime: moment__default['default'](plain.creation_time).toDate(),
|
|
2855
2858
|
});
|
|
2856
2859
|
}
|
|
2857
2860
|
|
|
@@ -2873,8 +2876,9 @@ class Meeting {
|
|
|
2873
2876
|
ownerUuids,
|
|
2874
2877
|
port,
|
|
2875
2878
|
uri,
|
|
2876
|
-
|
|
2879
|
+
extension,
|
|
2877
2880
|
persistent,
|
|
2881
|
+
creationTime,
|
|
2878
2882
|
} = {}) {
|
|
2879
2883
|
this.guestSipAuthorization = guestSipAuthorization;
|
|
2880
2884
|
this.uri = uri;
|
|
@@ -2882,8 +2886,9 @@ class Meeting {
|
|
|
2882
2886
|
this.ownerUuids = ownerUuids;
|
|
2883
2887
|
this.port = port;
|
|
2884
2888
|
this.uuid = uuid;
|
|
2885
|
-
this.
|
|
2889
|
+
this.extension = extension;
|
|
2886
2890
|
this.persistent = persistent;
|
|
2891
|
+
this.creationTime = creationTime;
|
|
2887
2892
|
|
|
2888
2893
|
// Useful to compare instead of instanceof with minified code
|
|
2889
2894
|
this.type = 'Meeting';
|
package/lib/domain/Contact.js
CHANGED
package/lib/domain/Features.js
CHANGED
|
@@ -452,7 +452,7 @@ const logger$1 = IssueReporter$1 ? IssueReporter$1.loggerFor('api') : console;
|
|
|
452
452
|
|
|
453
453
|
// Use a function here to be able to mock it in tests
|
|
454
454
|
const realFetch = () => {
|
|
455
|
-
if (typeof document !== 'undefined') {
|
|
455
|
+
if (typeof document !== 'undefined' && window.fetch) {
|
|
456
456
|
// Browser
|
|
457
457
|
return window.fetch;
|
|
458
458
|
}
|
|
@@ -1912,7 +1912,7 @@ class Contact {
|
|
|
1912
1912
|
this[key] = old[key] || this[key];
|
|
1913
1913
|
});
|
|
1914
1914
|
|
|
1915
|
-
if (old.lineState
|
|
1915
|
+
if (old.lineState) {
|
|
1916
1916
|
this.lineState = old.lineState;
|
|
1917
1917
|
}
|
|
1918
1918
|
|
|
@@ -2619,8 +2619,9 @@ class ExternalApp {
|
|
|
2619
2619
|
|
|
2620
2620
|
|
|
2621
2621
|
|
|
2622
|
-
|
|
2622
|
+
|
|
2623
2623
|
|
|
2624
|
+
|
|
2624
2625
|
|
|
2625
2626
|
|
|
2626
2627
|
class Meeting {
|
|
@@ -2631,9 +2632,10 @@ class Meeting {
|
|
|
2631
2632
|
|
|
2632
2633
|
|
|
2633
2634
|
|
|
2634
|
-
|
|
2635
|
+
|
|
2635
2636
|
|
|
2636
2637
|
|
|
2638
|
+
|
|
2637
2639
|
|
|
2638
2640
|
static parse(plain ) {
|
|
2639
2641
|
return new Meeting({
|
|
@@ -2643,8 +2645,9 @@ class Meeting {
|
|
|
2643
2645
|
ownerUuids: plain.owner_uuids,
|
|
2644
2646
|
port: plain.port,
|
|
2645
2647
|
uuid: plain.uuid,
|
|
2646
|
-
|
|
2648
|
+
extension: plain.exten,
|
|
2647
2649
|
persistent: plain.persistent,
|
|
2650
|
+
creationTime: moment__default['default'](plain.creation_time).toDate(),
|
|
2648
2651
|
});
|
|
2649
2652
|
}
|
|
2650
2653
|
|
|
@@ -2666,8 +2669,9 @@ class Meeting {
|
|
|
2666
2669
|
ownerUuids,
|
|
2667
2670
|
port,
|
|
2668
2671
|
uri,
|
|
2669
|
-
|
|
2672
|
+
extension,
|
|
2670
2673
|
persistent,
|
|
2674
|
+
creationTime,
|
|
2671
2675
|
} = {}) {
|
|
2672
2676
|
this.guestSipAuthorization = guestSipAuthorization;
|
|
2673
2677
|
this.uri = uri;
|
|
@@ -2675,8 +2679,9 @@ class Meeting {
|
|
|
2675
2679
|
this.ownerUuids = ownerUuids;
|
|
2676
2680
|
this.port = port;
|
|
2677
2681
|
this.uuid = uuid;
|
|
2678
|
-
this.
|
|
2682
|
+
this.extension = extension;
|
|
2679
2683
|
this.persistent = persistent;
|
|
2684
|
+
this.creationTime = creationTime;
|
|
2680
2685
|
|
|
2681
2686
|
// Useful to compare instead of instanceof with minified code
|
|
2682
2687
|
this.type = 'Meeting';
|
package/lib/domain/Meeting.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var moment = require('moment');
|
|
4
|
+
|
|
5
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
6
|
+
|
|
7
|
+
var moment__default = /*#__PURE__*/_interopDefaultLegacy(moment);
|
|
8
|
+
|
|
3
9
|
//
|
|
4
10
|
|
|
5
11
|
var newFrom = (instance , ToClass ) => {
|
|
@@ -20,8 +26,9 @@ var newFrom = (instance , ToClass ) => {
|
|
|
20
26
|
|
|
21
27
|
|
|
22
28
|
|
|
23
|
-
|
|
29
|
+
|
|
24
30
|
|
|
31
|
+
|
|
25
32
|
|
|
26
33
|
|
|
27
34
|
class Meeting {
|
|
@@ -32,9 +39,10 @@ class Meeting {
|
|
|
32
39
|
|
|
33
40
|
|
|
34
41
|
|
|
35
|
-
|
|
42
|
+
|
|
36
43
|
|
|
37
44
|
|
|
45
|
+
|
|
38
46
|
|
|
39
47
|
static parse(plain ) {
|
|
40
48
|
return new Meeting({
|
|
@@ -44,8 +52,9 @@ class Meeting {
|
|
|
44
52
|
ownerUuids: plain.owner_uuids,
|
|
45
53
|
port: plain.port,
|
|
46
54
|
uuid: plain.uuid,
|
|
47
|
-
|
|
55
|
+
extension: plain.exten,
|
|
48
56
|
persistent: plain.persistent,
|
|
57
|
+
creationTime: moment__default['default'](plain.creation_time).toDate(),
|
|
49
58
|
});
|
|
50
59
|
}
|
|
51
60
|
|
|
@@ -67,8 +76,9 @@ class Meeting {
|
|
|
67
76
|
ownerUuids,
|
|
68
77
|
port,
|
|
69
78
|
uri,
|
|
70
|
-
|
|
79
|
+
extension,
|
|
71
80
|
persistent,
|
|
81
|
+
creationTime,
|
|
72
82
|
} = {}) {
|
|
73
83
|
this.guestSipAuthorization = guestSipAuthorization;
|
|
74
84
|
this.uri = uri;
|
|
@@ -76,8 +86,9 @@ class Meeting {
|
|
|
76
86
|
this.ownerUuids = ownerUuids;
|
|
77
87
|
this.port = port;
|
|
78
88
|
this.uuid = uuid;
|
|
79
|
-
this.
|
|
89
|
+
this.extension = extension;
|
|
80
90
|
this.persistent = persistent;
|
|
91
|
+
this.creationTime = creationTime;
|
|
81
92
|
|
|
82
93
|
// Useful to compare instead of instanceof with minified code
|
|
83
94
|
this.type = 'Meeting';
|
|
@@ -1226,7 +1226,7 @@ class Contact {
|
|
|
1226
1226
|
this[key] = old[key] || this[key];
|
|
1227
1227
|
});
|
|
1228
1228
|
|
|
1229
|
-
if (old.lineState
|
|
1229
|
+
if (old.lineState) {
|
|
1230
1230
|
this.lineState = old.lineState;
|
|
1231
1231
|
}
|
|
1232
1232
|
|
|
@@ -2846,7 +2846,7 @@ const logger$2 = IssueReporter$1 ? IssueReporter$1.loggerFor('api') : console;
|
|
|
2846
2846
|
|
|
2847
2847
|
// Use a function here to be able to mock it in tests
|
|
2848
2848
|
const realFetch = () => {
|
|
2849
|
-
if (typeof document !== 'undefined') {
|
|
2849
|
+
if (typeof document !== 'undefined' && window.fetch) {
|
|
2850
2850
|
// Browser
|
|
2851
2851
|
return window.fetch;
|
|
2852
2852
|
}
|
|
@@ -3525,8 +3525,9 @@ class ExternalApp {
|
|
|
3525
3525
|
|
|
3526
3526
|
|
|
3527
3527
|
|
|
3528
|
-
|
|
3528
|
+
|
|
3529
3529
|
|
|
3530
|
+
|
|
3530
3531
|
|
|
3531
3532
|
|
|
3532
3533
|
class Meeting {
|
|
@@ -3537,9 +3538,10 @@ class Meeting {
|
|
|
3537
3538
|
|
|
3538
3539
|
|
|
3539
3540
|
|
|
3540
|
-
|
|
3541
|
+
|
|
3541
3542
|
|
|
3542
3543
|
|
|
3544
|
+
|
|
3543
3545
|
|
|
3544
3546
|
static parse(plain ) {
|
|
3545
3547
|
return new Meeting({
|
|
@@ -3549,8 +3551,9 @@ class Meeting {
|
|
|
3549
3551
|
ownerUuids: plain.owner_uuids,
|
|
3550
3552
|
port: plain.port,
|
|
3551
3553
|
uuid: plain.uuid,
|
|
3552
|
-
|
|
3554
|
+
extension: plain.exten,
|
|
3553
3555
|
persistent: plain.persistent,
|
|
3556
|
+
creationTime: moment__default['default'](plain.creation_time).toDate(),
|
|
3554
3557
|
});
|
|
3555
3558
|
}
|
|
3556
3559
|
|
|
@@ -3572,8 +3575,9 @@ class Meeting {
|
|
|
3572
3575
|
ownerUuids,
|
|
3573
3576
|
port,
|
|
3574
3577
|
uri,
|
|
3575
|
-
|
|
3578
|
+
extension,
|
|
3576
3579
|
persistent,
|
|
3580
|
+
creationTime,
|
|
3577
3581
|
} = {}) {
|
|
3578
3582
|
this.guestSipAuthorization = guestSipAuthorization;
|
|
3579
3583
|
this.uri = uri;
|
|
@@ -3581,8 +3585,9 @@ class Meeting {
|
|
|
3581
3585
|
this.ownerUuids = ownerUuids;
|
|
3582
3586
|
this.port = port;
|
|
3583
3587
|
this.uuid = uuid;
|
|
3584
|
-
this.
|
|
3588
|
+
this.extension = extension;
|
|
3585
3589
|
this.persistent = persistent;
|
|
3590
|
+
this.creationTime = creationTime;
|
|
3586
3591
|
|
|
3587
3592
|
// Useful to compare instead of instanceof with minified code
|
|
3588
3593
|
this.type = 'Meeting';
|