@wazo/sdk 0.38.17 → 0.38.18
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 +2 -2
- package/esm/__tests__/web-rtc-client.test.js +28 -2
- package/esm/checker/Checker.js +28 -2
- package/esm/checker/checks/index.js +28 -2
- package/esm/checker/checks/webrtc-transport.js +28 -2
- package/esm/checker/checks/webrtc.js +28 -2
- package/esm/domain/Phone/WebRTCPhone.js +7 -1
- package/esm/index.js +35 -2
- package/esm/simple/Auth.js +35 -2
- package/esm/simple/Configuration.js +35 -2
- package/esm/simple/Phone.js +35 -2
- package/esm/simple/index.js +35 -2
- package/esm/simple/room/LocalParticipant.js +35 -2
- package/esm/simple/room/Participant.js +35 -2
- package/esm/simple/room/RemoteParticipant.js +35 -2
- package/esm/simple/room/Room.js +35 -2
- package/esm/simple/room/SipRoom.js +35 -2
- package/esm/simple/room/Stream.js +35 -2
- package/esm/simple/room/__tests__/Participant.test.js +35 -2
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +35 -2
- package/esm/simple/utils.js +35 -2
- package/esm/web-rtc-client.js +28 -2
- package/lib/__tests__/web-rtc-client.test.js +28 -2
- package/lib/checker/Checker.js +28 -2
- package/lib/checker/checks/index.js +28 -2
- package/lib/checker/checks/webrtc-transport.js +28 -2
- package/lib/checker/checks/webrtc.js +28 -2
- package/lib/domain/Phone/WebRTCPhone.js +7 -0
- package/lib/index.js +35 -2
- package/lib/simple/Auth.js +35 -2
- package/lib/simple/Configuration.js +35 -2
- package/lib/simple/Phone.js +35 -2
- package/lib/simple/index.js +35 -2
- package/lib/simple/room/LocalParticipant.js +35 -2
- package/lib/simple/room/Participant.js +35 -2
- package/lib/simple/room/RemoteParticipant.js +35 -2
- package/lib/simple/room/Room.js +35 -2
- package/lib/simple/room/SipRoom.js +35 -2
- package/lib/simple/room/Stream.js +35 -2
- package/lib/simple/room/__tests__/Participant.test.js +35 -2
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +35 -2
- package/lib/simple/utils.js +35 -2
- package/lib/web-rtc-client.js +28 -2
- package/package.json +1 -1
- package/src/domain/Phone/WebRTCPhone.js +6 -0
- package/src/web-rtc-client.js +28 -2
|
@@ -6689,6 +6689,7 @@ const MESSAGE = 'message';
|
|
|
6689
6689
|
const ACCEPTED = 'accepted';
|
|
6690
6690
|
const REJECTED = 'rejected';
|
|
6691
6691
|
const ON_TRACK$1 = 'onTrack';
|
|
6692
|
+
const ON_EARLY_MEDIA$1 = 'onEarlyMedia';
|
|
6692
6693
|
const ON_REINVITE$1 = 'reinvite';
|
|
6693
6694
|
const ON_ERROR = 'onError';
|
|
6694
6695
|
const ON_SCREEN_SHARING_REINVITE = 'onScreenSharingReinvite';
|
|
@@ -6772,6 +6773,7 @@ class WebRTCClient extends Emitter {
|
|
|
6772
6773
|
|
|
6773
6774
|
|
|
6774
6775
|
|
|
6776
|
+
|
|
6775
6777
|
|
|
6776
6778
|
|
|
6777
6779
|
static isAPrivateIp(ip ) {
|
|
@@ -6840,6 +6842,7 @@ class WebRTCClient extends Emitter {
|
|
|
6840
6842
|
this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
|
|
6841
6843
|
this.ON_NETWORK_STATS = ON_NETWORK_STATS$1;
|
|
6842
6844
|
this.ON_DISCONNECTED = ON_DISCONNECTED$1;
|
|
6845
|
+
this.ON_EARLY_MEDIA = ON_EARLY_MEDIA$1;
|
|
6843
6846
|
}
|
|
6844
6847
|
|
|
6845
6848
|
configureMedia(media ) {
|
|
@@ -7127,6 +7130,11 @@ class WebRTCClient extends Emitter {
|
|
|
7127
7130
|
}
|
|
7128
7131
|
this._onAccepted(session, response.session, true);
|
|
7129
7132
|
},
|
|
7133
|
+
onProgress: (payload) => {
|
|
7134
|
+
if (payload.message.statusCode === 183) {
|
|
7135
|
+
this._onEarlyProgress(payload.session);
|
|
7136
|
+
}
|
|
7137
|
+
},
|
|
7130
7138
|
onReject: (response ) => {
|
|
7131
7139
|
logger$9.info('on call rejected', { id: session.id, fromTag: session.fromTag });
|
|
7132
7140
|
this._stopSendingStats(session);
|
|
@@ -8519,6 +8527,17 @@ class WebRTCClient extends Emitter {
|
|
|
8519
8527
|
};
|
|
8520
8528
|
}
|
|
8521
8529
|
|
|
8530
|
+
_onEarlyProgress(session ) {
|
|
8531
|
+
this._setupMedias(session);
|
|
8532
|
+
|
|
8533
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8534
|
+
this.updateRemoteStream(sessionId);
|
|
8535
|
+
|
|
8536
|
+
logger$9.info('Early media progress progress received', { sessionId });
|
|
8537
|
+
|
|
8538
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA$1, session);
|
|
8539
|
+
}
|
|
8540
|
+
|
|
8522
8541
|
_onAccepted(session , sessionDialog , withEvent = true) {
|
|
8523
8542
|
logger$9.info('on call accepted', { id: session.id, remoteTag: session.remoteTag });
|
|
8524
8543
|
|
|
@@ -8570,15 +8589,22 @@ class WebRTCClient extends Emitter {
|
|
|
8570
8589
|
|
|
8571
8590
|
_setupMedias(session , newStream ) {
|
|
8572
8591
|
// Safari hack, because you cannot call .play() from a non user action
|
|
8573
|
-
const sessionId = this.getSipSessionId(session);
|
|
8592
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8574
8593
|
const isConference = this.isConference(sessionId);
|
|
8575
8594
|
|
|
8595
|
+
if (sessionId in this.audioElements) {
|
|
8596
|
+
logger$9.info('html element already exists for session', { sessionId });
|
|
8597
|
+
return;
|
|
8598
|
+
}
|
|
8599
|
+
|
|
8576
8600
|
if (this._hasAudio() && this._isWeb() && !(sessionId in this.audioElements)) {
|
|
8577
8601
|
this.createAudioElementFor(sessionId);
|
|
8578
8602
|
}
|
|
8579
8603
|
|
|
8580
8604
|
const audioElement = this.audioElements[sessionId];
|
|
8581
|
-
const
|
|
8605
|
+
const sipSession = this.sipSessions[session.callId];
|
|
8606
|
+
const removeStream = this.getRemoteStream(sessionId);
|
|
8607
|
+
const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
|
|
8582
8608
|
|
|
8583
8609
|
if (!this._isWeb() || !stream) {
|
|
8584
8610
|
return;
|
|
@@ -8910,6 +8936,7 @@ const ON_NETWORK_STATS = 'onNetworkStats';
|
|
|
8910
8936
|
const ON_CHAT = 'phone/ON_CHAT';
|
|
8911
8937
|
const ON_SIGNAL = 'phone/ON_SIGNAL';
|
|
8912
8938
|
const ON_DISCONNECTED = 'onDisconnected';
|
|
8939
|
+
const ON_EARLY_MEDIA = 'onEarlyMedia';
|
|
8913
8940
|
|
|
8914
8941
|
const MESSAGE_TYPE_CHAT = 'message/TYPE_CHAT';
|
|
8915
8942
|
const MESSAGE_TYPE_SIGNAL = 'message/TYPE_SIGNAL';
|
|
@@ -8951,6 +8978,7 @@ const events = [
|
|
|
8951
8978
|
ON_SIGNAL,
|
|
8952
8979
|
ON_NETWORK_STATS,
|
|
8953
8980
|
ON_DISCONNECTED,
|
|
8981
|
+
ON_EARLY_MEDIA,
|
|
8954
8982
|
];
|
|
8955
8983
|
|
|
8956
8984
|
const logger$8 = IssueReporter$1.loggerFor('webrtc-phone');
|
|
@@ -10380,6 +10408,10 @@ class WebRTCPhone extends Emitter {
|
|
|
10380
10408
|
logger$8.info('WebRTC disconnected');
|
|
10381
10409
|
this.eventEmitter.emit(ON_DISCONNECTED);
|
|
10382
10410
|
});
|
|
10411
|
+
this.client.on(this.client.ON_EARLY_MEDIA, () => {
|
|
10412
|
+
logger$8.info('WebRTC early media');
|
|
10413
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA);
|
|
10414
|
+
});
|
|
10383
10415
|
|
|
10384
10416
|
this.client.on(this.client.REGISTERED, () => {
|
|
10385
10417
|
logger$8.info('WebRTC registered', {
|
|
@@ -10663,6 +10695,7 @@ var PHONE_EVENTS = /*#__PURE__*/Object.freeze({
|
|
|
10663
10695
|
ON_CHAT: ON_CHAT,
|
|
10664
10696
|
ON_SIGNAL: ON_SIGNAL,
|
|
10665
10697
|
ON_DISCONNECTED: ON_DISCONNECTED,
|
|
10698
|
+
ON_EARLY_MEDIA: ON_EARLY_MEDIA,
|
|
10666
10699
|
MESSAGE_TYPE_CHAT: MESSAGE_TYPE_CHAT,
|
|
10667
10700
|
MESSAGE_TYPE_SIGNAL: MESSAGE_TYPE_SIGNAL,
|
|
10668
10701
|
events: events,
|
package/esm/simple/Phone.js
CHANGED
|
@@ -6689,6 +6689,7 @@ const MESSAGE = 'message';
|
|
|
6689
6689
|
const ACCEPTED = 'accepted';
|
|
6690
6690
|
const REJECTED = 'rejected';
|
|
6691
6691
|
const ON_TRACK$1 = 'onTrack';
|
|
6692
|
+
const ON_EARLY_MEDIA$1 = 'onEarlyMedia';
|
|
6692
6693
|
const ON_REINVITE$1 = 'reinvite';
|
|
6693
6694
|
const ON_ERROR = 'onError';
|
|
6694
6695
|
const ON_SCREEN_SHARING_REINVITE = 'onScreenSharingReinvite';
|
|
@@ -6772,6 +6773,7 @@ class WebRTCClient extends Emitter {
|
|
|
6772
6773
|
|
|
6773
6774
|
|
|
6774
6775
|
|
|
6776
|
+
|
|
6775
6777
|
|
|
6776
6778
|
|
|
6777
6779
|
static isAPrivateIp(ip ) {
|
|
@@ -6840,6 +6842,7 @@ class WebRTCClient extends Emitter {
|
|
|
6840
6842
|
this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
|
|
6841
6843
|
this.ON_NETWORK_STATS = ON_NETWORK_STATS$1;
|
|
6842
6844
|
this.ON_DISCONNECTED = ON_DISCONNECTED$1;
|
|
6845
|
+
this.ON_EARLY_MEDIA = ON_EARLY_MEDIA$1;
|
|
6843
6846
|
}
|
|
6844
6847
|
|
|
6845
6848
|
configureMedia(media ) {
|
|
@@ -7127,6 +7130,11 @@ class WebRTCClient extends Emitter {
|
|
|
7127
7130
|
}
|
|
7128
7131
|
this._onAccepted(session, response.session, true);
|
|
7129
7132
|
},
|
|
7133
|
+
onProgress: (payload) => {
|
|
7134
|
+
if (payload.message.statusCode === 183) {
|
|
7135
|
+
this._onEarlyProgress(payload.session);
|
|
7136
|
+
}
|
|
7137
|
+
},
|
|
7130
7138
|
onReject: (response ) => {
|
|
7131
7139
|
logger$9.info('on call rejected', { id: session.id, fromTag: session.fromTag });
|
|
7132
7140
|
this._stopSendingStats(session);
|
|
@@ -8519,6 +8527,17 @@ class WebRTCClient extends Emitter {
|
|
|
8519
8527
|
};
|
|
8520
8528
|
}
|
|
8521
8529
|
|
|
8530
|
+
_onEarlyProgress(session ) {
|
|
8531
|
+
this._setupMedias(session);
|
|
8532
|
+
|
|
8533
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8534
|
+
this.updateRemoteStream(sessionId);
|
|
8535
|
+
|
|
8536
|
+
logger$9.info('Early media progress progress received', { sessionId });
|
|
8537
|
+
|
|
8538
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA$1, session);
|
|
8539
|
+
}
|
|
8540
|
+
|
|
8522
8541
|
_onAccepted(session , sessionDialog , withEvent = true) {
|
|
8523
8542
|
logger$9.info('on call accepted', { id: session.id, remoteTag: session.remoteTag });
|
|
8524
8543
|
|
|
@@ -8570,15 +8589,22 @@ class WebRTCClient extends Emitter {
|
|
|
8570
8589
|
|
|
8571
8590
|
_setupMedias(session , newStream ) {
|
|
8572
8591
|
// Safari hack, because you cannot call .play() from a non user action
|
|
8573
|
-
const sessionId = this.getSipSessionId(session);
|
|
8592
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8574
8593
|
const isConference = this.isConference(sessionId);
|
|
8575
8594
|
|
|
8595
|
+
if (sessionId in this.audioElements) {
|
|
8596
|
+
logger$9.info('html element already exists for session', { sessionId });
|
|
8597
|
+
return;
|
|
8598
|
+
}
|
|
8599
|
+
|
|
8576
8600
|
if (this._hasAudio() && this._isWeb() && !(sessionId in this.audioElements)) {
|
|
8577
8601
|
this.createAudioElementFor(sessionId);
|
|
8578
8602
|
}
|
|
8579
8603
|
|
|
8580
8604
|
const audioElement = this.audioElements[sessionId];
|
|
8581
|
-
const
|
|
8605
|
+
const sipSession = this.sipSessions[session.callId];
|
|
8606
|
+
const removeStream = this.getRemoteStream(sessionId);
|
|
8607
|
+
const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
|
|
8582
8608
|
|
|
8583
8609
|
if (!this._isWeb() || !stream) {
|
|
8584
8610
|
return;
|
|
@@ -8910,6 +8936,7 @@ const ON_NETWORK_STATS = 'onNetworkStats';
|
|
|
8910
8936
|
const ON_CHAT = 'phone/ON_CHAT';
|
|
8911
8937
|
const ON_SIGNAL = 'phone/ON_SIGNAL';
|
|
8912
8938
|
const ON_DISCONNECTED = 'onDisconnected';
|
|
8939
|
+
const ON_EARLY_MEDIA = 'onEarlyMedia';
|
|
8913
8940
|
|
|
8914
8941
|
const MESSAGE_TYPE_CHAT = 'message/TYPE_CHAT';
|
|
8915
8942
|
const MESSAGE_TYPE_SIGNAL = 'message/TYPE_SIGNAL';
|
|
@@ -8951,6 +8978,7 @@ const events = [
|
|
|
8951
8978
|
ON_SIGNAL,
|
|
8952
8979
|
ON_NETWORK_STATS,
|
|
8953
8980
|
ON_DISCONNECTED,
|
|
8981
|
+
ON_EARLY_MEDIA,
|
|
8954
8982
|
];
|
|
8955
8983
|
|
|
8956
8984
|
const logger$8 = IssueReporter$1.loggerFor('webrtc-phone');
|
|
@@ -10380,6 +10408,10 @@ class WebRTCPhone extends Emitter {
|
|
|
10380
10408
|
logger$8.info('WebRTC disconnected');
|
|
10381
10409
|
this.eventEmitter.emit(ON_DISCONNECTED);
|
|
10382
10410
|
});
|
|
10411
|
+
this.client.on(this.client.ON_EARLY_MEDIA, () => {
|
|
10412
|
+
logger$8.info('WebRTC early media');
|
|
10413
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA);
|
|
10414
|
+
});
|
|
10383
10415
|
|
|
10384
10416
|
this.client.on(this.client.REGISTERED, () => {
|
|
10385
10417
|
logger$8.info('WebRTC registered', {
|
|
@@ -10663,6 +10695,7 @@ var PHONE_EVENTS = /*#__PURE__*/Object.freeze({
|
|
|
10663
10695
|
ON_CHAT: ON_CHAT,
|
|
10664
10696
|
ON_SIGNAL: ON_SIGNAL,
|
|
10665
10697
|
ON_DISCONNECTED: ON_DISCONNECTED,
|
|
10698
|
+
ON_EARLY_MEDIA: ON_EARLY_MEDIA,
|
|
10666
10699
|
MESSAGE_TYPE_CHAT: MESSAGE_TYPE_CHAT,
|
|
10667
10700
|
MESSAGE_TYPE_SIGNAL: MESSAGE_TYPE_SIGNAL,
|
|
10668
10701
|
events: events,
|
package/esm/simple/index.js
CHANGED
|
@@ -7020,6 +7020,7 @@ const MESSAGE = 'message';
|
|
|
7020
7020
|
const ACCEPTED = 'accepted';
|
|
7021
7021
|
const REJECTED = 'rejected';
|
|
7022
7022
|
const ON_TRACK$1 = 'onTrack';
|
|
7023
|
+
const ON_EARLY_MEDIA$1 = 'onEarlyMedia';
|
|
7023
7024
|
const ON_REINVITE$1 = 'reinvite';
|
|
7024
7025
|
const ON_ERROR = 'onError';
|
|
7025
7026
|
const ON_SCREEN_SHARING_REINVITE = 'onScreenSharingReinvite';
|
|
@@ -7103,6 +7104,7 @@ class WebRTCClient extends Emitter {
|
|
|
7103
7104
|
|
|
7104
7105
|
|
|
7105
7106
|
|
|
7107
|
+
|
|
7106
7108
|
|
|
7107
7109
|
|
|
7108
7110
|
static isAPrivateIp(ip ) {
|
|
@@ -7171,6 +7173,7 @@ class WebRTCClient extends Emitter {
|
|
|
7171
7173
|
this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
|
|
7172
7174
|
this.ON_NETWORK_STATS = ON_NETWORK_STATS$1;
|
|
7173
7175
|
this.ON_DISCONNECTED = ON_DISCONNECTED$1;
|
|
7176
|
+
this.ON_EARLY_MEDIA = ON_EARLY_MEDIA$1;
|
|
7174
7177
|
}
|
|
7175
7178
|
|
|
7176
7179
|
configureMedia(media ) {
|
|
@@ -7458,6 +7461,11 @@ class WebRTCClient extends Emitter {
|
|
|
7458
7461
|
}
|
|
7459
7462
|
this._onAccepted(session, response.session, true);
|
|
7460
7463
|
},
|
|
7464
|
+
onProgress: (payload) => {
|
|
7465
|
+
if (payload.message.statusCode === 183) {
|
|
7466
|
+
this._onEarlyProgress(payload.session);
|
|
7467
|
+
}
|
|
7468
|
+
},
|
|
7461
7469
|
onReject: (response ) => {
|
|
7462
7470
|
logger$8.info('on call rejected', { id: session.id, fromTag: session.fromTag });
|
|
7463
7471
|
this._stopSendingStats(session);
|
|
@@ -8850,6 +8858,17 @@ class WebRTCClient extends Emitter {
|
|
|
8850
8858
|
};
|
|
8851
8859
|
}
|
|
8852
8860
|
|
|
8861
|
+
_onEarlyProgress(session ) {
|
|
8862
|
+
this._setupMedias(session);
|
|
8863
|
+
|
|
8864
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8865
|
+
this.updateRemoteStream(sessionId);
|
|
8866
|
+
|
|
8867
|
+
logger$8.info('Early media progress progress received', { sessionId });
|
|
8868
|
+
|
|
8869
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA$1, session);
|
|
8870
|
+
}
|
|
8871
|
+
|
|
8853
8872
|
_onAccepted(session , sessionDialog , withEvent = true) {
|
|
8854
8873
|
logger$8.info('on call accepted', { id: session.id, remoteTag: session.remoteTag });
|
|
8855
8874
|
|
|
@@ -8901,15 +8920,22 @@ class WebRTCClient extends Emitter {
|
|
|
8901
8920
|
|
|
8902
8921
|
_setupMedias(session , newStream ) {
|
|
8903
8922
|
// Safari hack, because you cannot call .play() from a non user action
|
|
8904
|
-
const sessionId = this.getSipSessionId(session);
|
|
8923
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8905
8924
|
const isConference = this.isConference(sessionId);
|
|
8906
8925
|
|
|
8926
|
+
if (sessionId in this.audioElements) {
|
|
8927
|
+
logger$8.info('html element already exists for session', { sessionId });
|
|
8928
|
+
return;
|
|
8929
|
+
}
|
|
8930
|
+
|
|
8907
8931
|
if (this._hasAudio() && this._isWeb() && !(sessionId in this.audioElements)) {
|
|
8908
8932
|
this.createAudioElementFor(sessionId);
|
|
8909
8933
|
}
|
|
8910
8934
|
|
|
8911
8935
|
const audioElement = this.audioElements[sessionId];
|
|
8912
|
-
const
|
|
8936
|
+
const sipSession = this.sipSessions[session.callId];
|
|
8937
|
+
const removeStream = this.getRemoteStream(sessionId);
|
|
8938
|
+
const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
|
|
8913
8939
|
|
|
8914
8940
|
if (!this._isWeb() || !stream) {
|
|
8915
8941
|
return;
|
|
@@ -9241,6 +9267,7 @@ const ON_NETWORK_STATS = 'onNetworkStats';
|
|
|
9241
9267
|
const ON_CHAT = 'phone/ON_CHAT';
|
|
9242
9268
|
const ON_SIGNAL = 'phone/ON_SIGNAL';
|
|
9243
9269
|
const ON_DISCONNECTED = 'onDisconnected';
|
|
9270
|
+
const ON_EARLY_MEDIA = 'onEarlyMedia';
|
|
9244
9271
|
|
|
9245
9272
|
const MESSAGE_TYPE_CHAT = 'message/TYPE_CHAT';
|
|
9246
9273
|
const MESSAGE_TYPE_SIGNAL = 'message/TYPE_SIGNAL';
|
|
@@ -9282,6 +9309,7 @@ const events = [
|
|
|
9282
9309
|
ON_SIGNAL,
|
|
9283
9310
|
ON_NETWORK_STATS,
|
|
9284
9311
|
ON_DISCONNECTED,
|
|
9312
|
+
ON_EARLY_MEDIA,
|
|
9285
9313
|
];
|
|
9286
9314
|
|
|
9287
9315
|
const logger$7 = IssueReporter$1.loggerFor('webrtc-phone');
|
|
@@ -10711,6 +10739,10 @@ class WebRTCPhone extends Emitter {
|
|
|
10711
10739
|
logger$7.info('WebRTC disconnected');
|
|
10712
10740
|
this.eventEmitter.emit(ON_DISCONNECTED);
|
|
10713
10741
|
});
|
|
10742
|
+
this.client.on(this.client.ON_EARLY_MEDIA, () => {
|
|
10743
|
+
logger$7.info('WebRTC early media');
|
|
10744
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA);
|
|
10745
|
+
});
|
|
10714
10746
|
|
|
10715
10747
|
this.client.on(this.client.REGISTERED, () => {
|
|
10716
10748
|
logger$7.info('WebRTC registered', {
|
|
@@ -10994,6 +11026,7 @@ var PHONE_EVENTS = /*#__PURE__*/Object.freeze({
|
|
|
10994
11026
|
ON_CHAT: ON_CHAT,
|
|
10995
11027
|
ON_SIGNAL: ON_SIGNAL,
|
|
10996
11028
|
ON_DISCONNECTED: ON_DISCONNECTED,
|
|
11029
|
+
ON_EARLY_MEDIA: ON_EARLY_MEDIA,
|
|
10997
11030
|
MESSAGE_TYPE_CHAT: MESSAGE_TYPE_CHAT,
|
|
10998
11031
|
MESSAGE_TYPE_SIGNAL: MESSAGE_TYPE_SIGNAL,
|
|
10999
11032
|
events: events,
|
|
@@ -6689,6 +6689,7 @@ const MESSAGE = 'message';
|
|
|
6689
6689
|
const ACCEPTED = 'accepted';
|
|
6690
6690
|
const REJECTED = 'rejected';
|
|
6691
6691
|
const ON_TRACK$1 = 'onTrack';
|
|
6692
|
+
const ON_EARLY_MEDIA$1 = 'onEarlyMedia';
|
|
6692
6693
|
const ON_REINVITE$1 = 'reinvite';
|
|
6693
6694
|
const ON_ERROR = 'onError';
|
|
6694
6695
|
const ON_SCREEN_SHARING_REINVITE = 'onScreenSharingReinvite';
|
|
@@ -6772,6 +6773,7 @@ class WebRTCClient extends Emitter {
|
|
|
6772
6773
|
|
|
6773
6774
|
|
|
6774
6775
|
|
|
6776
|
+
|
|
6775
6777
|
|
|
6776
6778
|
|
|
6777
6779
|
static isAPrivateIp(ip ) {
|
|
@@ -6840,6 +6842,7 @@ class WebRTCClient extends Emitter {
|
|
|
6840
6842
|
this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
|
|
6841
6843
|
this.ON_NETWORK_STATS = ON_NETWORK_STATS$1;
|
|
6842
6844
|
this.ON_DISCONNECTED = ON_DISCONNECTED$1;
|
|
6845
|
+
this.ON_EARLY_MEDIA = ON_EARLY_MEDIA$1;
|
|
6843
6846
|
}
|
|
6844
6847
|
|
|
6845
6848
|
configureMedia(media ) {
|
|
@@ -7127,6 +7130,11 @@ class WebRTCClient extends Emitter {
|
|
|
7127
7130
|
}
|
|
7128
7131
|
this._onAccepted(session, response.session, true);
|
|
7129
7132
|
},
|
|
7133
|
+
onProgress: (payload) => {
|
|
7134
|
+
if (payload.message.statusCode === 183) {
|
|
7135
|
+
this._onEarlyProgress(payload.session);
|
|
7136
|
+
}
|
|
7137
|
+
},
|
|
7130
7138
|
onReject: (response ) => {
|
|
7131
7139
|
logger$9.info('on call rejected', { id: session.id, fromTag: session.fromTag });
|
|
7132
7140
|
this._stopSendingStats(session);
|
|
@@ -8519,6 +8527,17 @@ class WebRTCClient extends Emitter {
|
|
|
8519
8527
|
};
|
|
8520
8528
|
}
|
|
8521
8529
|
|
|
8530
|
+
_onEarlyProgress(session ) {
|
|
8531
|
+
this._setupMedias(session);
|
|
8532
|
+
|
|
8533
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8534
|
+
this.updateRemoteStream(sessionId);
|
|
8535
|
+
|
|
8536
|
+
logger$9.info('Early media progress progress received', { sessionId });
|
|
8537
|
+
|
|
8538
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA$1, session);
|
|
8539
|
+
}
|
|
8540
|
+
|
|
8522
8541
|
_onAccepted(session , sessionDialog , withEvent = true) {
|
|
8523
8542
|
logger$9.info('on call accepted', { id: session.id, remoteTag: session.remoteTag });
|
|
8524
8543
|
|
|
@@ -8570,15 +8589,22 @@ class WebRTCClient extends Emitter {
|
|
|
8570
8589
|
|
|
8571
8590
|
_setupMedias(session , newStream ) {
|
|
8572
8591
|
// Safari hack, because you cannot call .play() from a non user action
|
|
8573
|
-
const sessionId = this.getSipSessionId(session);
|
|
8592
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8574
8593
|
const isConference = this.isConference(sessionId);
|
|
8575
8594
|
|
|
8595
|
+
if (sessionId in this.audioElements) {
|
|
8596
|
+
logger$9.info('html element already exists for session', { sessionId });
|
|
8597
|
+
return;
|
|
8598
|
+
}
|
|
8599
|
+
|
|
8576
8600
|
if (this._hasAudio() && this._isWeb() && !(sessionId in this.audioElements)) {
|
|
8577
8601
|
this.createAudioElementFor(sessionId);
|
|
8578
8602
|
}
|
|
8579
8603
|
|
|
8580
8604
|
const audioElement = this.audioElements[sessionId];
|
|
8581
|
-
const
|
|
8605
|
+
const sipSession = this.sipSessions[session.callId];
|
|
8606
|
+
const removeStream = this.getRemoteStream(sessionId);
|
|
8607
|
+
const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
|
|
8582
8608
|
|
|
8583
8609
|
if (!this._isWeb() || !stream) {
|
|
8584
8610
|
return;
|
|
@@ -8910,6 +8936,7 @@ const ON_NETWORK_STATS = 'onNetworkStats';
|
|
|
8910
8936
|
const ON_CHAT = 'phone/ON_CHAT';
|
|
8911
8937
|
const ON_SIGNAL = 'phone/ON_SIGNAL';
|
|
8912
8938
|
const ON_DISCONNECTED = 'onDisconnected';
|
|
8939
|
+
const ON_EARLY_MEDIA = 'onEarlyMedia';
|
|
8913
8940
|
|
|
8914
8941
|
const MESSAGE_TYPE_CHAT = 'message/TYPE_CHAT';
|
|
8915
8942
|
const MESSAGE_TYPE_SIGNAL = 'message/TYPE_SIGNAL';
|
|
@@ -8951,6 +8978,7 @@ const events = [
|
|
|
8951
8978
|
ON_SIGNAL,
|
|
8952
8979
|
ON_NETWORK_STATS,
|
|
8953
8980
|
ON_DISCONNECTED,
|
|
8981
|
+
ON_EARLY_MEDIA,
|
|
8954
8982
|
];
|
|
8955
8983
|
|
|
8956
8984
|
const logger$8 = IssueReporter$1.loggerFor('webrtc-phone');
|
|
@@ -10380,6 +10408,10 @@ class WebRTCPhone extends Emitter {
|
|
|
10380
10408
|
logger$8.info('WebRTC disconnected');
|
|
10381
10409
|
this.eventEmitter.emit(ON_DISCONNECTED);
|
|
10382
10410
|
});
|
|
10411
|
+
this.client.on(this.client.ON_EARLY_MEDIA, () => {
|
|
10412
|
+
logger$8.info('WebRTC early media');
|
|
10413
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA);
|
|
10414
|
+
});
|
|
10383
10415
|
|
|
10384
10416
|
this.client.on(this.client.REGISTERED, () => {
|
|
10385
10417
|
logger$8.info('WebRTC registered', {
|
|
@@ -10663,6 +10695,7 @@ var PHONE_EVENTS = /*#__PURE__*/Object.freeze({
|
|
|
10663
10695
|
ON_CHAT: ON_CHAT,
|
|
10664
10696
|
ON_SIGNAL: ON_SIGNAL,
|
|
10665
10697
|
ON_DISCONNECTED: ON_DISCONNECTED,
|
|
10698
|
+
ON_EARLY_MEDIA: ON_EARLY_MEDIA,
|
|
10666
10699
|
MESSAGE_TYPE_CHAT: MESSAGE_TYPE_CHAT,
|
|
10667
10700
|
MESSAGE_TYPE_SIGNAL: MESSAGE_TYPE_SIGNAL,
|
|
10668
10701
|
events: events,
|
|
@@ -6689,6 +6689,7 @@ const MESSAGE = 'message';
|
|
|
6689
6689
|
const ACCEPTED = 'accepted';
|
|
6690
6690
|
const REJECTED = 'rejected';
|
|
6691
6691
|
const ON_TRACK$1 = 'onTrack';
|
|
6692
|
+
const ON_EARLY_MEDIA$1 = 'onEarlyMedia';
|
|
6692
6693
|
const ON_REINVITE$1 = 'reinvite';
|
|
6693
6694
|
const ON_ERROR = 'onError';
|
|
6694
6695
|
const ON_SCREEN_SHARING_REINVITE = 'onScreenSharingReinvite';
|
|
@@ -6772,6 +6773,7 @@ class WebRTCClient extends Emitter {
|
|
|
6772
6773
|
|
|
6773
6774
|
|
|
6774
6775
|
|
|
6776
|
+
|
|
6775
6777
|
|
|
6776
6778
|
|
|
6777
6779
|
static isAPrivateIp(ip ) {
|
|
@@ -6840,6 +6842,7 @@ class WebRTCClient extends Emitter {
|
|
|
6840
6842
|
this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
|
|
6841
6843
|
this.ON_NETWORK_STATS = ON_NETWORK_STATS$1;
|
|
6842
6844
|
this.ON_DISCONNECTED = ON_DISCONNECTED$1;
|
|
6845
|
+
this.ON_EARLY_MEDIA = ON_EARLY_MEDIA$1;
|
|
6843
6846
|
}
|
|
6844
6847
|
|
|
6845
6848
|
configureMedia(media ) {
|
|
@@ -7127,6 +7130,11 @@ class WebRTCClient extends Emitter {
|
|
|
7127
7130
|
}
|
|
7128
7131
|
this._onAccepted(session, response.session, true);
|
|
7129
7132
|
},
|
|
7133
|
+
onProgress: (payload) => {
|
|
7134
|
+
if (payload.message.statusCode === 183) {
|
|
7135
|
+
this._onEarlyProgress(payload.session);
|
|
7136
|
+
}
|
|
7137
|
+
},
|
|
7130
7138
|
onReject: (response ) => {
|
|
7131
7139
|
logger$9.info('on call rejected', { id: session.id, fromTag: session.fromTag });
|
|
7132
7140
|
this._stopSendingStats(session);
|
|
@@ -8519,6 +8527,17 @@ class WebRTCClient extends Emitter {
|
|
|
8519
8527
|
};
|
|
8520
8528
|
}
|
|
8521
8529
|
|
|
8530
|
+
_onEarlyProgress(session ) {
|
|
8531
|
+
this._setupMedias(session);
|
|
8532
|
+
|
|
8533
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8534
|
+
this.updateRemoteStream(sessionId);
|
|
8535
|
+
|
|
8536
|
+
logger$9.info('Early media progress progress received', { sessionId });
|
|
8537
|
+
|
|
8538
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA$1, session);
|
|
8539
|
+
}
|
|
8540
|
+
|
|
8522
8541
|
_onAccepted(session , sessionDialog , withEvent = true) {
|
|
8523
8542
|
logger$9.info('on call accepted', { id: session.id, remoteTag: session.remoteTag });
|
|
8524
8543
|
|
|
@@ -8570,15 +8589,22 @@ class WebRTCClient extends Emitter {
|
|
|
8570
8589
|
|
|
8571
8590
|
_setupMedias(session , newStream ) {
|
|
8572
8591
|
// Safari hack, because you cannot call .play() from a non user action
|
|
8573
|
-
const sessionId = this.getSipSessionId(session);
|
|
8592
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8574
8593
|
const isConference = this.isConference(sessionId);
|
|
8575
8594
|
|
|
8595
|
+
if (sessionId in this.audioElements) {
|
|
8596
|
+
logger$9.info('html element already exists for session', { sessionId });
|
|
8597
|
+
return;
|
|
8598
|
+
}
|
|
8599
|
+
|
|
8576
8600
|
if (this._hasAudio() && this._isWeb() && !(sessionId in this.audioElements)) {
|
|
8577
8601
|
this.createAudioElementFor(sessionId);
|
|
8578
8602
|
}
|
|
8579
8603
|
|
|
8580
8604
|
const audioElement = this.audioElements[sessionId];
|
|
8581
|
-
const
|
|
8605
|
+
const sipSession = this.sipSessions[session.callId];
|
|
8606
|
+
const removeStream = this.getRemoteStream(sessionId);
|
|
8607
|
+
const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
|
|
8582
8608
|
|
|
8583
8609
|
if (!this._isWeb() || !stream) {
|
|
8584
8610
|
return;
|
|
@@ -8910,6 +8936,7 @@ const ON_NETWORK_STATS = 'onNetworkStats';
|
|
|
8910
8936
|
const ON_CHAT = 'phone/ON_CHAT';
|
|
8911
8937
|
const ON_SIGNAL = 'phone/ON_SIGNAL';
|
|
8912
8938
|
const ON_DISCONNECTED = 'onDisconnected';
|
|
8939
|
+
const ON_EARLY_MEDIA = 'onEarlyMedia';
|
|
8913
8940
|
|
|
8914
8941
|
const MESSAGE_TYPE_CHAT = 'message/TYPE_CHAT';
|
|
8915
8942
|
const MESSAGE_TYPE_SIGNAL = 'message/TYPE_SIGNAL';
|
|
@@ -8951,6 +8978,7 @@ const events = [
|
|
|
8951
8978
|
ON_SIGNAL,
|
|
8952
8979
|
ON_NETWORK_STATS,
|
|
8953
8980
|
ON_DISCONNECTED,
|
|
8981
|
+
ON_EARLY_MEDIA,
|
|
8954
8982
|
];
|
|
8955
8983
|
|
|
8956
8984
|
const logger$8 = IssueReporter$1.loggerFor('webrtc-phone');
|
|
@@ -10380,6 +10408,10 @@ class WebRTCPhone extends Emitter {
|
|
|
10380
10408
|
logger$8.info('WebRTC disconnected');
|
|
10381
10409
|
this.eventEmitter.emit(ON_DISCONNECTED);
|
|
10382
10410
|
});
|
|
10411
|
+
this.client.on(this.client.ON_EARLY_MEDIA, () => {
|
|
10412
|
+
logger$8.info('WebRTC early media');
|
|
10413
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA);
|
|
10414
|
+
});
|
|
10383
10415
|
|
|
10384
10416
|
this.client.on(this.client.REGISTERED, () => {
|
|
10385
10417
|
logger$8.info('WebRTC registered', {
|
|
@@ -10663,6 +10695,7 @@ var PHONE_EVENTS = /*#__PURE__*/Object.freeze({
|
|
|
10663
10695
|
ON_CHAT: ON_CHAT,
|
|
10664
10696
|
ON_SIGNAL: ON_SIGNAL,
|
|
10665
10697
|
ON_DISCONNECTED: ON_DISCONNECTED,
|
|
10698
|
+
ON_EARLY_MEDIA: ON_EARLY_MEDIA,
|
|
10666
10699
|
MESSAGE_TYPE_CHAT: MESSAGE_TYPE_CHAT,
|
|
10667
10700
|
MESSAGE_TYPE_SIGNAL: MESSAGE_TYPE_SIGNAL,
|
|
10668
10701
|
events: events,
|
|
@@ -7020,6 +7020,7 @@ const MESSAGE = 'message';
|
|
|
7020
7020
|
const ACCEPTED = 'accepted';
|
|
7021
7021
|
const REJECTED = 'rejected';
|
|
7022
7022
|
const ON_TRACK$1 = 'onTrack';
|
|
7023
|
+
const ON_EARLY_MEDIA$1 = 'onEarlyMedia';
|
|
7023
7024
|
const ON_REINVITE$1 = 'reinvite';
|
|
7024
7025
|
const ON_ERROR = 'onError';
|
|
7025
7026
|
const ON_SCREEN_SHARING_REINVITE = 'onScreenSharingReinvite';
|
|
@@ -7103,6 +7104,7 @@ class WebRTCClient extends Emitter {
|
|
|
7103
7104
|
|
|
7104
7105
|
|
|
7105
7106
|
|
|
7107
|
+
|
|
7106
7108
|
|
|
7107
7109
|
|
|
7108
7110
|
static isAPrivateIp(ip ) {
|
|
@@ -7171,6 +7173,7 @@ class WebRTCClient extends Emitter {
|
|
|
7171
7173
|
this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
|
|
7172
7174
|
this.ON_NETWORK_STATS = ON_NETWORK_STATS$1;
|
|
7173
7175
|
this.ON_DISCONNECTED = ON_DISCONNECTED$1;
|
|
7176
|
+
this.ON_EARLY_MEDIA = ON_EARLY_MEDIA$1;
|
|
7174
7177
|
}
|
|
7175
7178
|
|
|
7176
7179
|
configureMedia(media ) {
|
|
@@ -7458,6 +7461,11 @@ class WebRTCClient extends Emitter {
|
|
|
7458
7461
|
}
|
|
7459
7462
|
this._onAccepted(session, response.session, true);
|
|
7460
7463
|
},
|
|
7464
|
+
onProgress: (payload) => {
|
|
7465
|
+
if (payload.message.statusCode === 183) {
|
|
7466
|
+
this._onEarlyProgress(payload.session);
|
|
7467
|
+
}
|
|
7468
|
+
},
|
|
7461
7469
|
onReject: (response ) => {
|
|
7462
7470
|
logger$8.info('on call rejected', { id: session.id, fromTag: session.fromTag });
|
|
7463
7471
|
this._stopSendingStats(session);
|
|
@@ -8850,6 +8858,17 @@ class WebRTCClient extends Emitter {
|
|
|
8850
8858
|
};
|
|
8851
8859
|
}
|
|
8852
8860
|
|
|
8861
|
+
_onEarlyProgress(session ) {
|
|
8862
|
+
this._setupMedias(session);
|
|
8863
|
+
|
|
8864
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8865
|
+
this.updateRemoteStream(sessionId);
|
|
8866
|
+
|
|
8867
|
+
logger$8.info('Early media progress progress received', { sessionId });
|
|
8868
|
+
|
|
8869
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA$1, session);
|
|
8870
|
+
}
|
|
8871
|
+
|
|
8853
8872
|
_onAccepted(session , sessionDialog , withEvent = true) {
|
|
8854
8873
|
logger$8.info('on call accepted', { id: session.id, remoteTag: session.remoteTag });
|
|
8855
8874
|
|
|
@@ -8901,15 +8920,22 @@ class WebRTCClient extends Emitter {
|
|
|
8901
8920
|
|
|
8902
8921
|
_setupMedias(session , newStream ) {
|
|
8903
8922
|
// Safari hack, because you cannot call .play() from a non user action
|
|
8904
|
-
const sessionId = this.getSipSessionId(session);
|
|
8923
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8905
8924
|
const isConference = this.isConference(sessionId);
|
|
8906
8925
|
|
|
8926
|
+
if (sessionId in this.audioElements) {
|
|
8927
|
+
logger$8.info('html element already exists for session', { sessionId });
|
|
8928
|
+
return;
|
|
8929
|
+
}
|
|
8930
|
+
|
|
8907
8931
|
if (this._hasAudio() && this._isWeb() && !(sessionId in this.audioElements)) {
|
|
8908
8932
|
this.createAudioElementFor(sessionId);
|
|
8909
8933
|
}
|
|
8910
8934
|
|
|
8911
8935
|
const audioElement = this.audioElements[sessionId];
|
|
8912
|
-
const
|
|
8936
|
+
const sipSession = this.sipSessions[session.callId];
|
|
8937
|
+
const removeStream = this.getRemoteStream(sessionId);
|
|
8938
|
+
const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
|
|
8913
8939
|
|
|
8914
8940
|
if (!this._isWeb() || !stream) {
|
|
8915
8941
|
return;
|
|
@@ -9241,6 +9267,7 @@ const ON_NETWORK_STATS = 'onNetworkStats';
|
|
|
9241
9267
|
const ON_CHAT = 'phone/ON_CHAT';
|
|
9242
9268
|
const ON_SIGNAL = 'phone/ON_SIGNAL';
|
|
9243
9269
|
const ON_DISCONNECTED = 'onDisconnected';
|
|
9270
|
+
const ON_EARLY_MEDIA = 'onEarlyMedia';
|
|
9244
9271
|
|
|
9245
9272
|
const MESSAGE_TYPE_CHAT = 'message/TYPE_CHAT';
|
|
9246
9273
|
const MESSAGE_TYPE_SIGNAL = 'message/TYPE_SIGNAL';
|
|
@@ -9282,6 +9309,7 @@ const events = [
|
|
|
9282
9309
|
ON_SIGNAL,
|
|
9283
9310
|
ON_NETWORK_STATS,
|
|
9284
9311
|
ON_DISCONNECTED,
|
|
9312
|
+
ON_EARLY_MEDIA,
|
|
9285
9313
|
];
|
|
9286
9314
|
|
|
9287
9315
|
const logger$7 = IssueReporter$1.loggerFor('webrtc-phone');
|
|
@@ -10711,6 +10739,10 @@ class WebRTCPhone extends Emitter {
|
|
|
10711
10739
|
logger$7.info('WebRTC disconnected');
|
|
10712
10740
|
this.eventEmitter.emit(ON_DISCONNECTED);
|
|
10713
10741
|
});
|
|
10742
|
+
this.client.on(this.client.ON_EARLY_MEDIA, () => {
|
|
10743
|
+
logger$7.info('WebRTC early media');
|
|
10744
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA);
|
|
10745
|
+
});
|
|
10714
10746
|
|
|
10715
10747
|
this.client.on(this.client.REGISTERED, () => {
|
|
10716
10748
|
logger$7.info('WebRTC registered', {
|
|
@@ -10994,6 +11026,7 @@ var PHONE_EVENTS = /*#__PURE__*/Object.freeze({
|
|
|
10994
11026
|
ON_CHAT: ON_CHAT,
|
|
10995
11027
|
ON_SIGNAL: ON_SIGNAL,
|
|
10996
11028
|
ON_DISCONNECTED: ON_DISCONNECTED,
|
|
11029
|
+
ON_EARLY_MEDIA: ON_EARLY_MEDIA,
|
|
10997
11030
|
MESSAGE_TYPE_CHAT: MESSAGE_TYPE_CHAT,
|
|
10998
11031
|
MESSAGE_TYPE_SIGNAL: MESSAGE_TYPE_SIGNAL,
|
|
10999
11032
|
events: events,
|