@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
|
@@ -7030,6 +7030,7 @@ const MESSAGE = 'message';
|
|
|
7030
7030
|
const ACCEPTED = 'accepted';
|
|
7031
7031
|
const REJECTED = 'rejected';
|
|
7032
7032
|
const ON_TRACK$1 = 'onTrack';
|
|
7033
|
+
const ON_EARLY_MEDIA$1 = 'onEarlyMedia';
|
|
7033
7034
|
const ON_REINVITE$1 = 'reinvite';
|
|
7034
7035
|
const ON_ERROR = 'onError';
|
|
7035
7036
|
const ON_SCREEN_SHARING_REINVITE = 'onScreenSharingReinvite';
|
|
@@ -7113,6 +7114,7 @@ class WebRTCClient extends Emitter {
|
|
|
7113
7114
|
|
|
7114
7115
|
|
|
7115
7116
|
|
|
7117
|
+
|
|
7116
7118
|
|
|
7117
7119
|
|
|
7118
7120
|
static isAPrivateIp(ip ) {
|
|
@@ -7181,6 +7183,7 @@ class WebRTCClient extends Emitter {
|
|
|
7181
7183
|
this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
|
|
7182
7184
|
this.ON_NETWORK_STATS = ON_NETWORK_STATS$1;
|
|
7183
7185
|
this.ON_DISCONNECTED = ON_DISCONNECTED$1;
|
|
7186
|
+
this.ON_EARLY_MEDIA = ON_EARLY_MEDIA$1;
|
|
7184
7187
|
}
|
|
7185
7188
|
|
|
7186
7189
|
configureMedia(media ) {
|
|
@@ -7468,6 +7471,11 @@ class WebRTCClient extends Emitter {
|
|
|
7468
7471
|
}
|
|
7469
7472
|
this._onAccepted(session, response.session, true);
|
|
7470
7473
|
},
|
|
7474
|
+
onProgress: (payload) => {
|
|
7475
|
+
if (payload.message.statusCode === 183) {
|
|
7476
|
+
this._onEarlyProgress(payload.session);
|
|
7477
|
+
}
|
|
7478
|
+
},
|
|
7471
7479
|
onReject: (response ) => {
|
|
7472
7480
|
logger$8.info('on call rejected', { id: session.id, fromTag: session.fromTag });
|
|
7473
7481
|
this._stopSendingStats(session);
|
|
@@ -8860,6 +8868,17 @@ class WebRTCClient extends Emitter {
|
|
|
8860
8868
|
};
|
|
8861
8869
|
}
|
|
8862
8870
|
|
|
8871
|
+
_onEarlyProgress(session ) {
|
|
8872
|
+
this._setupMedias(session);
|
|
8873
|
+
|
|
8874
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8875
|
+
this.updateRemoteStream(sessionId);
|
|
8876
|
+
|
|
8877
|
+
logger$8.info('Early media progress progress received', { sessionId });
|
|
8878
|
+
|
|
8879
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA$1, session);
|
|
8880
|
+
}
|
|
8881
|
+
|
|
8863
8882
|
_onAccepted(session , sessionDialog , withEvent = true) {
|
|
8864
8883
|
logger$8.info('on call accepted', { id: session.id, remoteTag: session.remoteTag });
|
|
8865
8884
|
|
|
@@ -8911,15 +8930,22 @@ class WebRTCClient extends Emitter {
|
|
|
8911
8930
|
|
|
8912
8931
|
_setupMedias(session , newStream ) {
|
|
8913
8932
|
// Safari hack, because you cannot call .play() from a non user action
|
|
8914
|
-
const sessionId = this.getSipSessionId(session);
|
|
8933
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8915
8934
|
const isConference = this.isConference(sessionId);
|
|
8916
8935
|
|
|
8936
|
+
if (sessionId in this.audioElements) {
|
|
8937
|
+
logger$8.info('html element already exists for session', { sessionId });
|
|
8938
|
+
return;
|
|
8939
|
+
}
|
|
8940
|
+
|
|
8917
8941
|
if (this._hasAudio() && this._isWeb() && !(sessionId in this.audioElements)) {
|
|
8918
8942
|
this.createAudioElementFor(sessionId);
|
|
8919
8943
|
}
|
|
8920
8944
|
|
|
8921
8945
|
const audioElement = this.audioElements[sessionId];
|
|
8922
|
-
const
|
|
8946
|
+
const sipSession = this.sipSessions[session.callId];
|
|
8947
|
+
const removeStream = this.getRemoteStream(sessionId);
|
|
8948
|
+
const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
|
|
8923
8949
|
|
|
8924
8950
|
if (!this._isWeb() || !stream) {
|
|
8925
8951
|
return;
|
|
@@ -9251,6 +9277,7 @@ const ON_NETWORK_STATS = 'onNetworkStats';
|
|
|
9251
9277
|
const ON_CHAT = 'phone/ON_CHAT';
|
|
9252
9278
|
const ON_SIGNAL = 'phone/ON_SIGNAL';
|
|
9253
9279
|
const ON_DISCONNECTED = 'onDisconnected';
|
|
9280
|
+
const ON_EARLY_MEDIA = 'onEarlyMedia';
|
|
9254
9281
|
|
|
9255
9282
|
const MESSAGE_TYPE_CHAT = 'message/TYPE_CHAT';
|
|
9256
9283
|
const MESSAGE_TYPE_SIGNAL = 'message/TYPE_SIGNAL';
|
|
@@ -9292,6 +9319,7 @@ const events = [
|
|
|
9292
9319
|
ON_SIGNAL,
|
|
9293
9320
|
ON_NETWORK_STATS,
|
|
9294
9321
|
ON_DISCONNECTED,
|
|
9322
|
+
ON_EARLY_MEDIA,
|
|
9295
9323
|
];
|
|
9296
9324
|
|
|
9297
9325
|
const logger$7 = IssueReporter$1.loggerFor('webrtc-phone');
|
|
@@ -10721,6 +10749,10 @@ class WebRTCPhone extends Emitter {
|
|
|
10721
10749
|
logger$7.info('WebRTC disconnected');
|
|
10722
10750
|
this.eventEmitter.emit(ON_DISCONNECTED);
|
|
10723
10751
|
});
|
|
10752
|
+
this.client.on(this.client.ON_EARLY_MEDIA, () => {
|
|
10753
|
+
logger$7.info('WebRTC early media');
|
|
10754
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA);
|
|
10755
|
+
});
|
|
10724
10756
|
|
|
10725
10757
|
this.client.on(this.client.REGISTERED, () => {
|
|
10726
10758
|
logger$7.info('WebRTC registered', {
|
|
@@ -11004,6 +11036,7 @@ var PHONE_EVENTS = /*#__PURE__*/Object.freeze({
|
|
|
11004
11036
|
ON_CHAT: ON_CHAT,
|
|
11005
11037
|
ON_SIGNAL: ON_SIGNAL,
|
|
11006
11038
|
ON_DISCONNECTED: ON_DISCONNECTED,
|
|
11039
|
+
ON_EARLY_MEDIA: ON_EARLY_MEDIA,
|
|
11007
11040
|
MESSAGE_TYPE_CHAT: MESSAGE_TYPE_CHAT,
|
|
11008
11041
|
MESSAGE_TYPE_SIGNAL: MESSAGE_TYPE_SIGNAL,
|
|
11009
11042
|
events: events,
|
package/lib/simple/room/Room.js
CHANGED
|
@@ -7032,6 +7032,7 @@ const MESSAGE = 'message';
|
|
|
7032
7032
|
const ACCEPTED = 'accepted';
|
|
7033
7033
|
const REJECTED = 'rejected';
|
|
7034
7034
|
const ON_TRACK$1 = 'onTrack';
|
|
7035
|
+
const ON_EARLY_MEDIA$1 = 'onEarlyMedia';
|
|
7035
7036
|
const ON_REINVITE$1 = 'reinvite';
|
|
7036
7037
|
const ON_ERROR = 'onError';
|
|
7037
7038
|
const ON_SCREEN_SHARING_REINVITE = 'onScreenSharingReinvite';
|
|
@@ -7115,6 +7116,7 @@ class WebRTCClient extends Emitter {
|
|
|
7115
7116
|
|
|
7116
7117
|
|
|
7117
7118
|
|
|
7119
|
+
|
|
7118
7120
|
|
|
7119
7121
|
|
|
7120
7122
|
static isAPrivateIp(ip ) {
|
|
@@ -7183,6 +7185,7 @@ class WebRTCClient extends Emitter {
|
|
|
7183
7185
|
this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
|
|
7184
7186
|
this.ON_NETWORK_STATS = ON_NETWORK_STATS$1;
|
|
7185
7187
|
this.ON_DISCONNECTED = ON_DISCONNECTED$1;
|
|
7188
|
+
this.ON_EARLY_MEDIA = ON_EARLY_MEDIA$1;
|
|
7186
7189
|
}
|
|
7187
7190
|
|
|
7188
7191
|
configureMedia(media ) {
|
|
@@ -7470,6 +7473,11 @@ class WebRTCClient extends Emitter {
|
|
|
7470
7473
|
}
|
|
7471
7474
|
this._onAccepted(session, response.session, true);
|
|
7472
7475
|
},
|
|
7476
|
+
onProgress: (payload) => {
|
|
7477
|
+
if (payload.message.statusCode === 183) {
|
|
7478
|
+
this._onEarlyProgress(payload.session);
|
|
7479
|
+
}
|
|
7480
|
+
},
|
|
7473
7481
|
onReject: (response ) => {
|
|
7474
7482
|
logger$8.info('on call rejected', { id: session.id, fromTag: session.fromTag });
|
|
7475
7483
|
this._stopSendingStats(session);
|
|
@@ -8862,6 +8870,17 @@ class WebRTCClient extends Emitter {
|
|
|
8862
8870
|
};
|
|
8863
8871
|
}
|
|
8864
8872
|
|
|
8873
|
+
_onEarlyProgress(session ) {
|
|
8874
|
+
this._setupMedias(session);
|
|
8875
|
+
|
|
8876
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8877
|
+
this.updateRemoteStream(sessionId);
|
|
8878
|
+
|
|
8879
|
+
logger$8.info('Early media progress progress received', { sessionId });
|
|
8880
|
+
|
|
8881
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA$1, session);
|
|
8882
|
+
}
|
|
8883
|
+
|
|
8865
8884
|
_onAccepted(session , sessionDialog , withEvent = true) {
|
|
8866
8885
|
logger$8.info('on call accepted', { id: session.id, remoteTag: session.remoteTag });
|
|
8867
8886
|
|
|
@@ -8913,15 +8932,22 @@ class WebRTCClient extends Emitter {
|
|
|
8913
8932
|
|
|
8914
8933
|
_setupMedias(session , newStream ) {
|
|
8915
8934
|
// Safari hack, because you cannot call .play() from a non user action
|
|
8916
|
-
const sessionId = this.getSipSessionId(session);
|
|
8935
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8917
8936
|
const isConference = this.isConference(sessionId);
|
|
8918
8937
|
|
|
8938
|
+
if (sessionId in this.audioElements) {
|
|
8939
|
+
logger$8.info('html element already exists for session', { sessionId });
|
|
8940
|
+
return;
|
|
8941
|
+
}
|
|
8942
|
+
|
|
8919
8943
|
if (this._hasAudio() && this._isWeb() && !(sessionId in this.audioElements)) {
|
|
8920
8944
|
this.createAudioElementFor(sessionId);
|
|
8921
8945
|
}
|
|
8922
8946
|
|
|
8923
8947
|
const audioElement = this.audioElements[sessionId];
|
|
8924
|
-
const
|
|
8948
|
+
const sipSession = this.sipSessions[session.callId];
|
|
8949
|
+
const removeStream = this.getRemoteStream(sessionId);
|
|
8950
|
+
const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
|
|
8925
8951
|
|
|
8926
8952
|
if (!this._isWeb() || !stream) {
|
|
8927
8953
|
return;
|
|
@@ -9253,6 +9279,7 @@ const ON_NETWORK_STATS = 'onNetworkStats';
|
|
|
9253
9279
|
const ON_CHAT = 'phone/ON_CHAT';
|
|
9254
9280
|
const ON_SIGNAL = 'phone/ON_SIGNAL';
|
|
9255
9281
|
const ON_DISCONNECTED = 'onDisconnected';
|
|
9282
|
+
const ON_EARLY_MEDIA = 'onEarlyMedia';
|
|
9256
9283
|
|
|
9257
9284
|
const MESSAGE_TYPE_CHAT = 'message/TYPE_CHAT';
|
|
9258
9285
|
const MESSAGE_TYPE_SIGNAL = 'message/TYPE_SIGNAL';
|
|
@@ -9294,6 +9321,7 @@ const events = [
|
|
|
9294
9321
|
ON_SIGNAL,
|
|
9295
9322
|
ON_NETWORK_STATS,
|
|
9296
9323
|
ON_DISCONNECTED,
|
|
9324
|
+
ON_EARLY_MEDIA,
|
|
9297
9325
|
];
|
|
9298
9326
|
|
|
9299
9327
|
const logger$7 = IssueReporter$1.loggerFor('webrtc-phone');
|
|
@@ -10723,6 +10751,10 @@ class WebRTCPhone extends Emitter {
|
|
|
10723
10751
|
logger$7.info('WebRTC disconnected');
|
|
10724
10752
|
this.eventEmitter.emit(ON_DISCONNECTED);
|
|
10725
10753
|
});
|
|
10754
|
+
this.client.on(this.client.ON_EARLY_MEDIA, () => {
|
|
10755
|
+
logger$7.info('WebRTC early media');
|
|
10756
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA);
|
|
10757
|
+
});
|
|
10726
10758
|
|
|
10727
10759
|
this.client.on(this.client.REGISTERED, () => {
|
|
10728
10760
|
logger$7.info('WebRTC registered', {
|
|
@@ -11006,6 +11038,7 @@ var PHONE_EVENTS = /*#__PURE__*/Object.freeze({
|
|
|
11006
11038
|
ON_CHAT: ON_CHAT,
|
|
11007
11039
|
ON_SIGNAL: ON_SIGNAL,
|
|
11008
11040
|
ON_DISCONNECTED: ON_DISCONNECTED,
|
|
11041
|
+
ON_EARLY_MEDIA: ON_EARLY_MEDIA,
|
|
11009
11042
|
MESSAGE_TYPE_CHAT: MESSAGE_TYPE_CHAT,
|
|
11010
11043
|
MESSAGE_TYPE_SIGNAL: MESSAGE_TYPE_SIGNAL,
|
|
11011
11044
|
events: events,
|
|
@@ -7030,6 +7030,7 @@ const MESSAGE = 'message';
|
|
|
7030
7030
|
const ACCEPTED = 'accepted';
|
|
7031
7031
|
const REJECTED = 'rejected';
|
|
7032
7032
|
const ON_TRACK$1 = 'onTrack';
|
|
7033
|
+
const ON_EARLY_MEDIA$1 = 'onEarlyMedia';
|
|
7033
7034
|
const ON_REINVITE$1 = 'reinvite';
|
|
7034
7035
|
const ON_ERROR = 'onError';
|
|
7035
7036
|
const ON_SCREEN_SHARING_REINVITE = 'onScreenSharingReinvite';
|
|
@@ -7113,6 +7114,7 @@ class WebRTCClient extends Emitter {
|
|
|
7113
7114
|
|
|
7114
7115
|
|
|
7115
7116
|
|
|
7117
|
+
|
|
7116
7118
|
|
|
7117
7119
|
|
|
7118
7120
|
static isAPrivateIp(ip ) {
|
|
@@ -7181,6 +7183,7 @@ class WebRTCClient extends Emitter {
|
|
|
7181
7183
|
this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
|
|
7182
7184
|
this.ON_NETWORK_STATS = ON_NETWORK_STATS$1;
|
|
7183
7185
|
this.ON_DISCONNECTED = ON_DISCONNECTED$1;
|
|
7186
|
+
this.ON_EARLY_MEDIA = ON_EARLY_MEDIA$1;
|
|
7184
7187
|
}
|
|
7185
7188
|
|
|
7186
7189
|
configureMedia(media ) {
|
|
@@ -7468,6 +7471,11 @@ class WebRTCClient extends Emitter {
|
|
|
7468
7471
|
}
|
|
7469
7472
|
this._onAccepted(session, response.session, true);
|
|
7470
7473
|
},
|
|
7474
|
+
onProgress: (payload) => {
|
|
7475
|
+
if (payload.message.statusCode === 183) {
|
|
7476
|
+
this._onEarlyProgress(payload.session);
|
|
7477
|
+
}
|
|
7478
|
+
},
|
|
7471
7479
|
onReject: (response ) => {
|
|
7472
7480
|
logger$8.info('on call rejected', { id: session.id, fromTag: session.fromTag });
|
|
7473
7481
|
this._stopSendingStats(session);
|
|
@@ -8860,6 +8868,17 @@ class WebRTCClient extends Emitter {
|
|
|
8860
8868
|
};
|
|
8861
8869
|
}
|
|
8862
8870
|
|
|
8871
|
+
_onEarlyProgress(session ) {
|
|
8872
|
+
this._setupMedias(session);
|
|
8873
|
+
|
|
8874
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8875
|
+
this.updateRemoteStream(sessionId);
|
|
8876
|
+
|
|
8877
|
+
logger$8.info('Early media progress progress received', { sessionId });
|
|
8878
|
+
|
|
8879
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA$1, session);
|
|
8880
|
+
}
|
|
8881
|
+
|
|
8863
8882
|
_onAccepted(session , sessionDialog , withEvent = true) {
|
|
8864
8883
|
logger$8.info('on call accepted', { id: session.id, remoteTag: session.remoteTag });
|
|
8865
8884
|
|
|
@@ -8911,15 +8930,22 @@ class WebRTCClient extends Emitter {
|
|
|
8911
8930
|
|
|
8912
8931
|
_setupMedias(session , newStream ) {
|
|
8913
8932
|
// Safari hack, because you cannot call .play() from a non user action
|
|
8914
|
-
const sessionId = this.getSipSessionId(session);
|
|
8933
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8915
8934
|
const isConference = this.isConference(sessionId);
|
|
8916
8935
|
|
|
8936
|
+
if (sessionId in this.audioElements) {
|
|
8937
|
+
logger$8.info('html element already exists for session', { sessionId });
|
|
8938
|
+
return;
|
|
8939
|
+
}
|
|
8940
|
+
|
|
8917
8941
|
if (this._hasAudio() && this._isWeb() && !(sessionId in this.audioElements)) {
|
|
8918
8942
|
this.createAudioElementFor(sessionId);
|
|
8919
8943
|
}
|
|
8920
8944
|
|
|
8921
8945
|
const audioElement = this.audioElements[sessionId];
|
|
8922
|
-
const
|
|
8946
|
+
const sipSession = this.sipSessions[session.callId];
|
|
8947
|
+
const removeStream = this.getRemoteStream(sessionId);
|
|
8948
|
+
const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
|
|
8923
8949
|
|
|
8924
8950
|
if (!this._isWeb() || !stream) {
|
|
8925
8951
|
return;
|
|
@@ -9251,6 +9277,7 @@ const ON_NETWORK_STATS = 'onNetworkStats';
|
|
|
9251
9277
|
const ON_CHAT = 'phone/ON_CHAT';
|
|
9252
9278
|
const ON_SIGNAL = 'phone/ON_SIGNAL';
|
|
9253
9279
|
const ON_DISCONNECTED = 'onDisconnected';
|
|
9280
|
+
const ON_EARLY_MEDIA = 'onEarlyMedia';
|
|
9254
9281
|
|
|
9255
9282
|
const MESSAGE_TYPE_CHAT = 'message/TYPE_CHAT';
|
|
9256
9283
|
const MESSAGE_TYPE_SIGNAL = 'message/TYPE_SIGNAL';
|
|
@@ -9292,6 +9319,7 @@ const events = [
|
|
|
9292
9319
|
ON_SIGNAL,
|
|
9293
9320
|
ON_NETWORK_STATS,
|
|
9294
9321
|
ON_DISCONNECTED,
|
|
9322
|
+
ON_EARLY_MEDIA,
|
|
9295
9323
|
];
|
|
9296
9324
|
|
|
9297
9325
|
const logger$7 = IssueReporter$1.loggerFor('webrtc-phone');
|
|
@@ -10721,6 +10749,10 @@ class WebRTCPhone extends Emitter {
|
|
|
10721
10749
|
logger$7.info('WebRTC disconnected');
|
|
10722
10750
|
this.eventEmitter.emit(ON_DISCONNECTED);
|
|
10723
10751
|
});
|
|
10752
|
+
this.client.on(this.client.ON_EARLY_MEDIA, () => {
|
|
10753
|
+
logger$7.info('WebRTC early media');
|
|
10754
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA);
|
|
10755
|
+
});
|
|
10724
10756
|
|
|
10725
10757
|
this.client.on(this.client.REGISTERED, () => {
|
|
10726
10758
|
logger$7.info('WebRTC registered', {
|
|
@@ -11004,6 +11036,7 @@ var PHONE_EVENTS = /*#__PURE__*/Object.freeze({
|
|
|
11004
11036
|
ON_CHAT: ON_CHAT,
|
|
11005
11037
|
ON_SIGNAL: ON_SIGNAL,
|
|
11006
11038
|
ON_DISCONNECTED: ON_DISCONNECTED,
|
|
11039
|
+
ON_EARLY_MEDIA: ON_EARLY_MEDIA,
|
|
11007
11040
|
MESSAGE_TYPE_CHAT: MESSAGE_TYPE_CHAT,
|
|
11008
11041
|
MESSAGE_TYPE_SIGNAL: MESSAGE_TYPE_SIGNAL,
|
|
11009
11042
|
events: events,
|
|
@@ -7030,6 +7030,7 @@ const MESSAGE = 'message';
|
|
|
7030
7030
|
const ACCEPTED = 'accepted';
|
|
7031
7031
|
const REJECTED = 'rejected';
|
|
7032
7032
|
const ON_TRACK$1 = 'onTrack';
|
|
7033
|
+
const ON_EARLY_MEDIA$1 = 'onEarlyMedia';
|
|
7033
7034
|
const ON_REINVITE$1 = 'reinvite';
|
|
7034
7035
|
const ON_ERROR = 'onError';
|
|
7035
7036
|
const ON_SCREEN_SHARING_REINVITE = 'onScreenSharingReinvite';
|
|
@@ -7113,6 +7114,7 @@ class WebRTCClient extends Emitter {
|
|
|
7113
7114
|
|
|
7114
7115
|
|
|
7115
7116
|
|
|
7117
|
+
|
|
7116
7118
|
|
|
7117
7119
|
|
|
7118
7120
|
static isAPrivateIp(ip ) {
|
|
@@ -7181,6 +7183,7 @@ class WebRTCClient extends Emitter {
|
|
|
7181
7183
|
this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
|
|
7182
7184
|
this.ON_NETWORK_STATS = ON_NETWORK_STATS$1;
|
|
7183
7185
|
this.ON_DISCONNECTED = ON_DISCONNECTED$1;
|
|
7186
|
+
this.ON_EARLY_MEDIA = ON_EARLY_MEDIA$1;
|
|
7184
7187
|
}
|
|
7185
7188
|
|
|
7186
7189
|
configureMedia(media ) {
|
|
@@ -7468,6 +7471,11 @@ class WebRTCClient extends Emitter {
|
|
|
7468
7471
|
}
|
|
7469
7472
|
this._onAccepted(session, response.session, true);
|
|
7470
7473
|
},
|
|
7474
|
+
onProgress: (payload) => {
|
|
7475
|
+
if (payload.message.statusCode === 183) {
|
|
7476
|
+
this._onEarlyProgress(payload.session);
|
|
7477
|
+
}
|
|
7478
|
+
},
|
|
7471
7479
|
onReject: (response ) => {
|
|
7472
7480
|
logger$8.info('on call rejected', { id: session.id, fromTag: session.fromTag });
|
|
7473
7481
|
this._stopSendingStats(session);
|
|
@@ -8860,6 +8868,17 @@ class WebRTCClient extends Emitter {
|
|
|
8860
8868
|
};
|
|
8861
8869
|
}
|
|
8862
8870
|
|
|
8871
|
+
_onEarlyProgress(session ) {
|
|
8872
|
+
this._setupMedias(session);
|
|
8873
|
+
|
|
8874
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8875
|
+
this.updateRemoteStream(sessionId);
|
|
8876
|
+
|
|
8877
|
+
logger$8.info('Early media progress progress received', { sessionId });
|
|
8878
|
+
|
|
8879
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA$1, session);
|
|
8880
|
+
}
|
|
8881
|
+
|
|
8863
8882
|
_onAccepted(session , sessionDialog , withEvent = true) {
|
|
8864
8883
|
logger$8.info('on call accepted', { id: session.id, remoteTag: session.remoteTag });
|
|
8865
8884
|
|
|
@@ -8911,15 +8930,22 @@ class WebRTCClient extends Emitter {
|
|
|
8911
8930
|
|
|
8912
8931
|
_setupMedias(session , newStream ) {
|
|
8913
8932
|
// Safari hack, because you cannot call .play() from a non user action
|
|
8914
|
-
const sessionId = this.getSipSessionId(session);
|
|
8933
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8915
8934
|
const isConference = this.isConference(sessionId);
|
|
8916
8935
|
|
|
8936
|
+
if (sessionId in this.audioElements) {
|
|
8937
|
+
logger$8.info('html element already exists for session', { sessionId });
|
|
8938
|
+
return;
|
|
8939
|
+
}
|
|
8940
|
+
|
|
8917
8941
|
if (this._hasAudio() && this._isWeb() && !(sessionId in this.audioElements)) {
|
|
8918
8942
|
this.createAudioElementFor(sessionId);
|
|
8919
8943
|
}
|
|
8920
8944
|
|
|
8921
8945
|
const audioElement = this.audioElements[sessionId];
|
|
8922
|
-
const
|
|
8946
|
+
const sipSession = this.sipSessions[session.callId];
|
|
8947
|
+
const removeStream = this.getRemoteStream(sessionId);
|
|
8948
|
+
const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
|
|
8923
8949
|
|
|
8924
8950
|
if (!this._isWeb() || !stream) {
|
|
8925
8951
|
return;
|
|
@@ -9251,6 +9277,7 @@ const ON_NETWORK_STATS = 'onNetworkStats';
|
|
|
9251
9277
|
const ON_CHAT = 'phone/ON_CHAT';
|
|
9252
9278
|
const ON_SIGNAL = 'phone/ON_SIGNAL';
|
|
9253
9279
|
const ON_DISCONNECTED = 'onDisconnected';
|
|
9280
|
+
const ON_EARLY_MEDIA = 'onEarlyMedia';
|
|
9254
9281
|
|
|
9255
9282
|
const MESSAGE_TYPE_CHAT = 'message/TYPE_CHAT';
|
|
9256
9283
|
const MESSAGE_TYPE_SIGNAL = 'message/TYPE_SIGNAL';
|
|
@@ -9292,6 +9319,7 @@ const events = [
|
|
|
9292
9319
|
ON_SIGNAL,
|
|
9293
9320
|
ON_NETWORK_STATS,
|
|
9294
9321
|
ON_DISCONNECTED,
|
|
9322
|
+
ON_EARLY_MEDIA,
|
|
9295
9323
|
];
|
|
9296
9324
|
|
|
9297
9325
|
const logger$7 = IssueReporter$1.loggerFor('webrtc-phone');
|
|
@@ -10721,6 +10749,10 @@ class WebRTCPhone extends Emitter {
|
|
|
10721
10749
|
logger$7.info('WebRTC disconnected');
|
|
10722
10750
|
this.eventEmitter.emit(ON_DISCONNECTED);
|
|
10723
10751
|
});
|
|
10752
|
+
this.client.on(this.client.ON_EARLY_MEDIA, () => {
|
|
10753
|
+
logger$7.info('WebRTC early media');
|
|
10754
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA);
|
|
10755
|
+
});
|
|
10724
10756
|
|
|
10725
10757
|
this.client.on(this.client.REGISTERED, () => {
|
|
10726
10758
|
logger$7.info('WebRTC registered', {
|
|
@@ -11004,6 +11036,7 @@ var PHONE_EVENTS = /*#__PURE__*/Object.freeze({
|
|
|
11004
11036
|
ON_CHAT: ON_CHAT,
|
|
11005
11037
|
ON_SIGNAL: ON_SIGNAL,
|
|
11006
11038
|
ON_DISCONNECTED: ON_DISCONNECTED,
|
|
11039
|
+
ON_EARLY_MEDIA: ON_EARLY_MEDIA,
|
|
11007
11040
|
MESSAGE_TYPE_CHAT: MESSAGE_TYPE_CHAT,
|
|
11008
11041
|
MESSAGE_TYPE_SIGNAL: MESSAGE_TYPE_SIGNAL,
|
|
11009
11042
|
events: events,
|
|
@@ -7030,6 +7030,7 @@ const MESSAGE = 'message';
|
|
|
7030
7030
|
const ACCEPTED = 'accepted';
|
|
7031
7031
|
const REJECTED = 'rejected';
|
|
7032
7032
|
const ON_TRACK$1 = 'onTrack';
|
|
7033
|
+
const ON_EARLY_MEDIA$1 = 'onEarlyMedia';
|
|
7033
7034
|
const ON_REINVITE$1 = 'reinvite';
|
|
7034
7035
|
const ON_ERROR = 'onError';
|
|
7035
7036
|
const ON_SCREEN_SHARING_REINVITE = 'onScreenSharingReinvite';
|
|
@@ -7113,6 +7114,7 @@ class WebRTCClient extends Emitter {
|
|
|
7113
7114
|
|
|
7114
7115
|
|
|
7115
7116
|
|
|
7117
|
+
|
|
7116
7118
|
|
|
7117
7119
|
|
|
7118
7120
|
static isAPrivateIp(ip ) {
|
|
@@ -7181,6 +7183,7 @@ class WebRTCClient extends Emitter {
|
|
|
7181
7183
|
this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
|
|
7182
7184
|
this.ON_NETWORK_STATS = ON_NETWORK_STATS$1;
|
|
7183
7185
|
this.ON_DISCONNECTED = ON_DISCONNECTED$1;
|
|
7186
|
+
this.ON_EARLY_MEDIA = ON_EARLY_MEDIA$1;
|
|
7184
7187
|
}
|
|
7185
7188
|
|
|
7186
7189
|
configureMedia(media ) {
|
|
@@ -7468,6 +7471,11 @@ class WebRTCClient extends Emitter {
|
|
|
7468
7471
|
}
|
|
7469
7472
|
this._onAccepted(session, response.session, true);
|
|
7470
7473
|
},
|
|
7474
|
+
onProgress: (payload) => {
|
|
7475
|
+
if (payload.message.statusCode === 183) {
|
|
7476
|
+
this._onEarlyProgress(payload.session);
|
|
7477
|
+
}
|
|
7478
|
+
},
|
|
7471
7479
|
onReject: (response ) => {
|
|
7472
7480
|
logger$8.info('on call rejected', { id: session.id, fromTag: session.fromTag });
|
|
7473
7481
|
this._stopSendingStats(session);
|
|
@@ -8860,6 +8868,17 @@ class WebRTCClient extends Emitter {
|
|
|
8860
8868
|
};
|
|
8861
8869
|
}
|
|
8862
8870
|
|
|
8871
|
+
_onEarlyProgress(session ) {
|
|
8872
|
+
this._setupMedias(session);
|
|
8873
|
+
|
|
8874
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8875
|
+
this.updateRemoteStream(sessionId);
|
|
8876
|
+
|
|
8877
|
+
logger$8.info('Early media progress progress received', { sessionId });
|
|
8878
|
+
|
|
8879
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA$1, session);
|
|
8880
|
+
}
|
|
8881
|
+
|
|
8863
8882
|
_onAccepted(session , sessionDialog , withEvent = true) {
|
|
8864
8883
|
logger$8.info('on call accepted', { id: session.id, remoteTag: session.remoteTag });
|
|
8865
8884
|
|
|
@@ -8911,15 +8930,22 @@ class WebRTCClient extends Emitter {
|
|
|
8911
8930
|
|
|
8912
8931
|
_setupMedias(session , newStream ) {
|
|
8913
8932
|
// Safari hack, because you cannot call .play() from a non user action
|
|
8914
|
-
const sessionId = this.getSipSessionId(session);
|
|
8933
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8915
8934
|
const isConference = this.isConference(sessionId);
|
|
8916
8935
|
|
|
8936
|
+
if (sessionId in this.audioElements) {
|
|
8937
|
+
logger$8.info('html element already exists for session', { sessionId });
|
|
8938
|
+
return;
|
|
8939
|
+
}
|
|
8940
|
+
|
|
8917
8941
|
if (this._hasAudio() && this._isWeb() && !(sessionId in this.audioElements)) {
|
|
8918
8942
|
this.createAudioElementFor(sessionId);
|
|
8919
8943
|
}
|
|
8920
8944
|
|
|
8921
8945
|
const audioElement = this.audioElements[sessionId];
|
|
8922
|
-
const
|
|
8946
|
+
const sipSession = this.sipSessions[session.callId];
|
|
8947
|
+
const removeStream = this.getRemoteStream(sessionId);
|
|
8948
|
+
const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
|
|
8923
8949
|
|
|
8924
8950
|
if (!this._isWeb() || !stream) {
|
|
8925
8951
|
return;
|
|
@@ -9251,6 +9277,7 @@ const ON_NETWORK_STATS = 'onNetworkStats';
|
|
|
9251
9277
|
const ON_CHAT = 'phone/ON_CHAT';
|
|
9252
9278
|
const ON_SIGNAL = 'phone/ON_SIGNAL';
|
|
9253
9279
|
const ON_DISCONNECTED = 'onDisconnected';
|
|
9280
|
+
const ON_EARLY_MEDIA = 'onEarlyMedia';
|
|
9254
9281
|
|
|
9255
9282
|
const MESSAGE_TYPE_CHAT = 'message/TYPE_CHAT';
|
|
9256
9283
|
const MESSAGE_TYPE_SIGNAL = 'message/TYPE_SIGNAL';
|
|
@@ -9292,6 +9319,7 @@ const events = [
|
|
|
9292
9319
|
ON_SIGNAL,
|
|
9293
9320
|
ON_NETWORK_STATS,
|
|
9294
9321
|
ON_DISCONNECTED,
|
|
9322
|
+
ON_EARLY_MEDIA,
|
|
9295
9323
|
];
|
|
9296
9324
|
|
|
9297
9325
|
const logger$7 = IssueReporter$1.loggerFor('webrtc-phone');
|
|
@@ -10721,6 +10749,10 @@ class WebRTCPhone extends Emitter {
|
|
|
10721
10749
|
logger$7.info('WebRTC disconnected');
|
|
10722
10750
|
this.eventEmitter.emit(ON_DISCONNECTED);
|
|
10723
10751
|
});
|
|
10752
|
+
this.client.on(this.client.ON_EARLY_MEDIA, () => {
|
|
10753
|
+
logger$7.info('WebRTC early media');
|
|
10754
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA);
|
|
10755
|
+
});
|
|
10724
10756
|
|
|
10725
10757
|
this.client.on(this.client.REGISTERED, () => {
|
|
10726
10758
|
logger$7.info('WebRTC registered', {
|
|
@@ -11004,6 +11036,7 @@ var PHONE_EVENTS = /*#__PURE__*/Object.freeze({
|
|
|
11004
11036
|
ON_CHAT: ON_CHAT,
|
|
11005
11037
|
ON_SIGNAL: ON_SIGNAL,
|
|
11006
11038
|
ON_DISCONNECTED: ON_DISCONNECTED,
|
|
11039
|
+
ON_EARLY_MEDIA: ON_EARLY_MEDIA,
|
|
11007
11040
|
MESSAGE_TYPE_CHAT: MESSAGE_TYPE_CHAT,
|
|
11008
11041
|
MESSAGE_TYPE_SIGNAL: MESSAGE_TYPE_SIGNAL,
|
|
11009
11042
|
events: events,
|
|
@@ -7030,6 +7030,7 @@ const MESSAGE = 'message';
|
|
|
7030
7030
|
const ACCEPTED = 'accepted';
|
|
7031
7031
|
const REJECTED = 'rejected';
|
|
7032
7032
|
const ON_TRACK$1 = 'onTrack';
|
|
7033
|
+
const ON_EARLY_MEDIA$1 = 'onEarlyMedia';
|
|
7033
7034
|
const ON_REINVITE$1 = 'reinvite';
|
|
7034
7035
|
const ON_ERROR = 'onError';
|
|
7035
7036
|
const ON_SCREEN_SHARING_REINVITE = 'onScreenSharingReinvite';
|
|
@@ -7113,6 +7114,7 @@ class WebRTCClient extends Emitter {
|
|
|
7113
7114
|
|
|
7114
7115
|
|
|
7115
7116
|
|
|
7117
|
+
|
|
7116
7118
|
|
|
7117
7119
|
|
|
7118
7120
|
static isAPrivateIp(ip ) {
|
|
@@ -7181,6 +7183,7 @@ class WebRTCClient extends Emitter {
|
|
|
7181
7183
|
this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
|
|
7182
7184
|
this.ON_NETWORK_STATS = ON_NETWORK_STATS$1;
|
|
7183
7185
|
this.ON_DISCONNECTED = ON_DISCONNECTED$1;
|
|
7186
|
+
this.ON_EARLY_MEDIA = ON_EARLY_MEDIA$1;
|
|
7184
7187
|
}
|
|
7185
7188
|
|
|
7186
7189
|
configureMedia(media ) {
|
|
@@ -7468,6 +7471,11 @@ class WebRTCClient extends Emitter {
|
|
|
7468
7471
|
}
|
|
7469
7472
|
this._onAccepted(session, response.session, true);
|
|
7470
7473
|
},
|
|
7474
|
+
onProgress: (payload) => {
|
|
7475
|
+
if (payload.message.statusCode === 183) {
|
|
7476
|
+
this._onEarlyProgress(payload.session);
|
|
7477
|
+
}
|
|
7478
|
+
},
|
|
7471
7479
|
onReject: (response ) => {
|
|
7472
7480
|
logger$8.info('on call rejected', { id: session.id, fromTag: session.fromTag });
|
|
7473
7481
|
this._stopSendingStats(session);
|
|
@@ -8860,6 +8868,17 @@ class WebRTCClient extends Emitter {
|
|
|
8860
8868
|
};
|
|
8861
8869
|
}
|
|
8862
8870
|
|
|
8871
|
+
_onEarlyProgress(session ) {
|
|
8872
|
+
this._setupMedias(session);
|
|
8873
|
+
|
|
8874
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8875
|
+
this.updateRemoteStream(sessionId);
|
|
8876
|
+
|
|
8877
|
+
logger$8.info('Early media progress progress received', { sessionId });
|
|
8878
|
+
|
|
8879
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA$1, session);
|
|
8880
|
+
}
|
|
8881
|
+
|
|
8863
8882
|
_onAccepted(session , sessionDialog , withEvent = true) {
|
|
8864
8883
|
logger$8.info('on call accepted', { id: session.id, remoteTag: session.remoteTag });
|
|
8865
8884
|
|
|
@@ -8911,15 +8930,22 @@ class WebRTCClient extends Emitter {
|
|
|
8911
8930
|
|
|
8912
8931
|
_setupMedias(session , newStream ) {
|
|
8913
8932
|
// Safari hack, because you cannot call .play() from a non user action
|
|
8914
|
-
const sessionId = this.getSipSessionId(session);
|
|
8933
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8915
8934
|
const isConference = this.isConference(sessionId);
|
|
8916
8935
|
|
|
8936
|
+
if (sessionId in this.audioElements) {
|
|
8937
|
+
logger$8.info('html element already exists for session', { sessionId });
|
|
8938
|
+
return;
|
|
8939
|
+
}
|
|
8940
|
+
|
|
8917
8941
|
if (this._hasAudio() && this._isWeb() && !(sessionId in this.audioElements)) {
|
|
8918
8942
|
this.createAudioElementFor(sessionId);
|
|
8919
8943
|
}
|
|
8920
8944
|
|
|
8921
8945
|
const audioElement = this.audioElements[sessionId];
|
|
8922
|
-
const
|
|
8946
|
+
const sipSession = this.sipSessions[session.callId];
|
|
8947
|
+
const removeStream = this.getRemoteStream(sessionId);
|
|
8948
|
+
const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
|
|
8923
8949
|
|
|
8924
8950
|
if (!this._isWeb() || !stream) {
|
|
8925
8951
|
return;
|
|
@@ -9251,6 +9277,7 @@ const ON_NETWORK_STATS = 'onNetworkStats';
|
|
|
9251
9277
|
const ON_CHAT = 'phone/ON_CHAT';
|
|
9252
9278
|
const ON_SIGNAL = 'phone/ON_SIGNAL';
|
|
9253
9279
|
const ON_DISCONNECTED = 'onDisconnected';
|
|
9280
|
+
const ON_EARLY_MEDIA = 'onEarlyMedia';
|
|
9254
9281
|
|
|
9255
9282
|
const MESSAGE_TYPE_CHAT = 'message/TYPE_CHAT';
|
|
9256
9283
|
const MESSAGE_TYPE_SIGNAL = 'message/TYPE_SIGNAL';
|
|
@@ -9292,6 +9319,7 @@ const events = [
|
|
|
9292
9319
|
ON_SIGNAL,
|
|
9293
9320
|
ON_NETWORK_STATS,
|
|
9294
9321
|
ON_DISCONNECTED,
|
|
9322
|
+
ON_EARLY_MEDIA,
|
|
9295
9323
|
];
|
|
9296
9324
|
|
|
9297
9325
|
const logger$7 = IssueReporter$1.loggerFor('webrtc-phone');
|
|
@@ -10721,6 +10749,10 @@ class WebRTCPhone extends Emitter {
|
|
|
10721
10749
|
logger$7.info('WebRTC disconnected');
|
|
10722
10750
|
this.eventEmitter.emit(ON_DISCONNECTED);
|
|
10723
10751
|
});
|
|
10752
|
+
this.client.on(this.client.ON_EARLY_MEDIA, () => {
|
|
10753
|
+
logger$7.info('WebRTC early media');
|
|
10754
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA);
|
|
10755
|
+
});
|
|
10724
10756
|
|
|
10725
10757
|
this.client.on(this.client.REGISTERED, () => {
|
|
10726
10758
|
logger$7.info('WebRTC registered', {
|
|
@@ -11004,6 +11036,7 @@ var PHONE_EVENTS = /*#__PURE__*/Object.freeze({
|
|
|
11004
11036
|
ON_CHAT: ON_CHAT,
|
|
11005
11037
|
ON_SIGNAL: ON_SIGNAL,
|
|
11006
11038
|
ON_DISCONNECTED: ON_DISCONNECTED,
|
|
11039
|
+
ON_EARLY_MEDIA: ON_EARLY_MEDIA,
|
|
11007
11040
|
MESSAGE_TYPE_CHAT: MESSAGE_TYPE_CHAT,
|
|
11008
11041
|
MESSAGE_TYPE_SIGNAL: MESSAGE_TYPE_SIGNAL,
|
|
11009
11042
|
events: events,
|