@wazo/sdk 0.38.16 → 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__/api-client.test.js +7 -4
- package/esm/__tests__/web-rtc-client.test.js +35 -6
- package/esm/api/chatd.js +7 -4
- package/esm/api-client.js +7 -4
- package/esm/checker/Checker.js +35 -6
- package/esm/checker/checks/aor.js +7 -4
- package/esm/checker/checks/api.js +7 -4
- package/esm/checker/checks/index.js +35 -6
- package/esm/checker/checks/webrtc-transport.js +35 -6
- package/esm/checker/checks/webrtc.js +35 -6
- package/esm/domain/AdHocAPIConference.js +7 -4
- package/esm/domain/Features.js +7 -4
- package/esm/domain/Phone/CTIPhone.js +7 -4
- package/esm/domain/Phone/WebRTCPhone.js +7 -1
- package/esm/index.js +42 -6
- package/esm/service/CallApi.js +7 -4
- package/esm/service/getApiClient.js +7 -4
- package/esm/simple/Auth.js +42 -6
- package/esm/simple/Configuration.js +42 -6
- package/esm/simple/Directory.js +7 -4
- package/esm/simple/Phone.js +42 -6
- package/esm/simple/index.js +42 -6
- package/esm/simple/room/LocalParticipant.js +42 -6
- package/esm/simple/room/Participant.js +42 -6
- package/esm/simple/room/RemoteParticipant.js +42 -6
- package/esm/simple/room/Room.js +42 -6
- package/esm/simple/room/SipRoom.js +42 -6
- package/esm/simple/room/Stream.js +42 -6
- package/esm/simple/room/__tests__/Participant.test.js +42 -6
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +42 -6
- package/esm/simple/utils.js +42 -6
- package/esm/web-rtc-client.js +35 -6
- package/lib/__tests__/api-client.test.js +7 -4
- package/lib/__tests__/web-rtc-client.test.js +35 -6
- package/lib/api/chatd.js +7 -4
- package/lib/api-client.js +7 -4
- package/lib/checker/Checker.js +35 -6
- package/lib/checker/checks/aor.js +7 -4
- package/lib/checker/checks/api.js +7 -4
- package/lib/checker/checks/index.js +35 -6
- package/lib/checker/checks/webrtc-transport.js +35 -6
- package/lib/checker/checks/webrtc.js +35 -6
- package/lib/domain/AdHocAPIConference.js +7 -4
- package/lib/domain/Features.js +7 -4
- package/lib/domain/Phone/CTIPhone.js +7 -4
- package/lib/domain/Phone/WebRTCPhone.js +7 -0
- package/lib/index.js +42 -6
- package/lib/service/CallApi.js +7 -4
- package/lib/service/getApiClient.js +7 -4
- package/lib/simple/Auth.js +42 -6
- package/lib/simple/Configuration.js +42 -6
- package/lib/simple/Directory.js +7 -4
- package/lib/simple/Phone.js +42 -6
- package/lib/simple/index.js +42 -6
- package/lib/simple/room/LocalParticipant.js +42 -6
- package/lib/simple/room/Participant.js +42 -6
- package/lib/simple/room/RemoteParticipant.js +42 -6
- package/lib/simple/room/Room.js +42 -6
- package/lib/simple/room/SipRoom.js +42 -6
- package/lib/simple/room/Stream.js +42 -6
- package/lib/simple/room/__tests__/Participant.test.js +42 -6
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +42 -6
- package/lib/simple/utils.js +42 -6
- package/lib/web-rtc-client.js +35 -6
- package/package.json +1 -1
- package/src/api/chatd.js +7 -4
- package/src/domain/Phone/WebRTCPhone.js +6 -0
- package/src/web-rtc-client.js +28 -2
package/esm/simple/index.js
CHANGED
|
@@ -5037,10 +5037,13 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
5037
5037
|
createRoom: async (name , users ) =>
|
|
5038
5038
|
client.post(`${baseUrl}/users/me/rooms`, { name, users }).then(ChatRoom.parse),
|
|
5039
5039
|
|
|
5040
|
-
getRoomMessages: async (roomUuid ) =>
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5040
|
+
getRoomMessages: async (roomUuid , params = {}) => {
|
|
5041
|
+
const qs = ApiRequester.getQueryString(params);
|
|
5042
|
+
|
|
5043
|
+
return client
|
|
5044
|
+
.get(`${baseUrl}/users/me/rooms/${roomUuid}/messages${qs.length ? `?${qs}` : ''}`)
|
|
5045
|
+
.then((response ) => ChatMessage.parseMany(response));
|
|
5046
|
+
},
|
|
5044
5047
|
|
|
5045
5048
|
sendRoomMessage: async (roomUuid , message ) =>
|
|
5046
5049
|
client.post(`${baseUrl}/users/me/rooms/${roomUuid}/messages`, message).then(ChatMessage.parse),
|
|
@@ -7017,6 +7020,7 @@ const MESSAGE = 'message';
|
|
|
7017
7020
|
const ACCEPTED = 'accepted';
|
|
7018
7021
|
const REJECTED = 'rejected';
|
|
7019
7022
|
const ON_TRACK$1 = 'onTrack';
|
|
7023
|
+
const ON_EARLY_MEDIA$1 = 'onEarlyMedia';
|
|
7020
7024
|
const ON_REINVITE$1 = 'reinvite';
|
|
7021
7025
|
const ON_ERROR = 'onError';
|
|
7022
7026
|
const ON_SCREEN_SHARING_REINVITE = 'onScreenSharingReinvite';
|
|
@@ -7100,6 +7104,7 @@ class WebRTCClient extends Emitter {
|
|
|
7100
7104
|
|
|
7101
7105
|
|
|
7102
7106
|
|
|
7107
|
+
|
|
7103
7108
|
|
|
7104
7109
|
|
|
7105
7110
|
static isAPrivateIp(ip ) {
|
|
@@ -7168,6 +7173,7 @@ class WebRTCClient extends Emitter {
|
|
|
7168
7173
|
this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
|
|
7169
7174
|
this.ON_NETWORK_STATS = ON_NETWORK_STATS$1;
|
|
7170
7175
|
this.ON_DISCONNECTED = ON_DISCONNECTED$1;
|
|
7176
|
+
this.ON_EARLY_MEDIA = ON_EARLY_MEDIA$1;
|
|
7171
7177
|
}
|
|
7172
7178
|
|
|
7173
7179
|
configureMedia(media ) {
|
|
@@ -7455,6 +7461,11 @@ class WebRTCClient extends Emitter {
|
|
|
7455
7461
|
}
|
|
7456
7462
|
this._onAccepted(session, response.session, true);
|
|
7457
7463
|
},
|
|
7464
|
+
onProgress: (payload) => {
|
|
7465
|
+
if (payload.message.statusCode === 183) {
|
|
7466
|
+
this._onEarlyProgress(payload.session);
|
|
7467
|
+
}
|
|
7468
|
+
},
|
|
7458
7469
|
onReject: (response ) => {
|
|
7459
7470
|
logger$8.info('on call rejected', { id: session.id, fromTag: session.fromTag });
|
|
7460
7471
|
this._stopSendingStats(session);
|
|
@@ -8847,6 +8858,17 @@ class WebRTCClient extends Emitter {
|
|
|
8847
8858
|
};
|
|
8848
8859
|
}
|
|
8849
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
|
+
|
|
8850
8872
|
_onAccepted(session , sessionDialog , withEvent = true) {
|
|
8851
8873
|
logger$8.info('on call accepted', { id: session.id, remoteTag: session.remoteTag });
|
|
8852
8874
|
|
|
@@ -8898,15 +8920,22 @@ class WebRTCClient extends Emitter {
|
|
|
8898
8920
|
|
|
8899
8921
|
_setupMedias(session , newStream ) {
|
|
8900
8922
|
// Safari hack, because you cannot call .play() from a non user action
|
|
8901
|
-
const sessionId = this.getSipSessionId(session);
|
|
8923
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8902
8924
|
const isConference = this.isConference(sessionId);
|
|
8903
8925
|
|
|
8926
|
+
if (sessionId in this.audioElements) {
|
|
8927
|
+
logger$8.info('html element already exists for session', { sessionId });
|
|
8928
|
+
return;
|
|
8929
|
+
}
|
|
8930
|
+
|
|
8904
8931
|
if (this._hasAudio() && this._isWeb() && !(sessionId in this.audioElements)) {
|
|
8905
8932
|
this.createAudioElementFor(sessionId);
|
|
8906
8933
|
}
|
|
8907
8934
|
|
|
8908
8935
|
const audioElement = this.audioElements[sessionId];
|
|
8909
|
-
const
|
|
8936
|
+
const sipSession = this.sipSessions[session.callId];
|
|
8937
|
+
const removeStream = this.getRemoteStream(sessionId);
|
|
8938
|
+
const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
|
|
8910
8939
|
|
|
8911
8940
|
if (!this._isWeb() || !stream) {
|
|
8912
8941
|
return;
|
|
@@ -9238,6 +9267,7 @@ const ON_NETWORK_STATS = 'onNetworkStats';
|
|
|
9238
9267
|
const ON_CHAT = 'phone/ON_CHAT';
|
|
9239
9268
|
const ON_SIGNAL = 'phone/ON_SIGNAL';
|
|
9240
9269
|
const ON_DISCONNECTED = 'onDisconnected';
|
|
9270
|
+
const ON_EARLY_MEDIA = 'onEarlyMedia';
|
|
9241
9271
|
|
|
9242
9272
|
const MESSAGE_TYPE_CHAT = 'message/TYPE_CHAT';
|
|
9243
9273
|
const MESSAGE_TYPE_SIGNAL = 'message/TYPE_SIGNAL';
|
|
@@ -9279,6 +9309,7 @@ const events = [
|
|
|
9279
9309
|
ON_SIGNAL,
|
|
9280
9310
|
ON_NETWORK_STATS,
|
|
9281
9311
|
ON_DISCONNECTED,
|
|
9312
|
+
ON_EARLY_MEDIA,
|
|
9282
9313
|
];
|
|
9283
9314
|
|
|
9284
9315
|
const logger$7 = IssueReporter$1.loggerFor('webrtc-phone');
|
|
@@ -10708,6 +10739,10 @@ class WebRTCPhone extends Emitter {
|
|
|
10708
10739
|
logger$7.info('WebRTC disconnected');
|
|
10709
10740
|
this.eventEmitter.emit(ON_DISCONNECTED);
|
|
10710
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
|
+
});
|
|
10711
10746
|
|
|
10712
10747
|
this.client.on(this.client.REGISTERED, () => {
|
|
10713
10748
|
logger$7.info('WebRTC registered', {
|
|
@@ -10991,6 +11026,7 @@ var PHONE_EVENTS = /*#__PURE__*/Object.freeze({
|
|
|
10991
11026
|
ON_CHAT: ON_CHAT,
|
|
10992
11027
|
ON_SIGNAL: ON_SIGNAL,
|
|
10993
11028
|
ON_DISCONNECTED: ON_DISCONNECTED,
|
|
11029
|
+
ON_EARLY_MEDIA: ON_EARLY_MEDIA,
|
|
10994
11030
|
MESSAGE_TYPE_CHAT: MESSAGE_TYPE_CHAT,
|
|
10995
11031
|
MESSAGE_TYPE_SIGNAL: MESSAGE_TYPE_SIGNAL,
|
|
10996
11032
|
events: events,
|
|
@@ -5037,10 +5037,13 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
5037
5037
|
createRoom: async (name , users ) =>
|
|
5038
5038
|
client.post(`${baseUrl}/users/me/rooms`, { name, users }).then(ChatRoom.parse),
|
|
5039
5039
|
|
|
5040
|
-
getRoomMessages: async (roomUuid ) =>
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5040
|
+
getRoomMessages: async (roomUuid , params = {}) => {
|
|
5041
|
+
const qs = ApiRequester.getQueryString(params);
|
|
5042
|
+
|
|
5043
|
+
return client
|
|
5044
|
+
.get(`${baseUrl}/users/me/rooms/${roomUuid}/messages${qs.length ? `?${qs}` : ''}`)
|
|
5045
|
+
.then((response ) => ChatMessage.parseMany(response));
|
|
5046
|
+
},
|
|
5044
5047
|
|
|
5045
5048
|
sendRoomMessage: async (roomUuid , message ) =>
|
|
5046
5049
|
client.post(`${baseUrl}/users/me/rooms/${roomUuid}/messages`, message).then(ChatMessage.parse),
|
|
@@ -6686,6 +6689,7 @@ const MESSAGE = 'message';
|
|
|
6686
6689
|
const ACCEPTED = 'accepted';
|
|
6687
6690
|
const REJECTED = 'rejected';
|
|
6688
6691
|
const ON_TRACK$1 = 'onTrack';
|
|
6692
|
+
const ON_EARLY_MEDIA$1 = 'onEarlyMedia';
|
|
6689
6693
|
const ON_REINVITE$1 = 'reinvite';
|
|
6690
6694
|
const ON_ERROR = 'onError';
|
|
6691
6695
|
const ON_SCREEN_SHARING_REINVITE = 'onScreenSharingReinvite';
|
|
@@ -6769,6 +6773,7 @@ class WebRTCClient extends Emitter {
|
|
|
6769
6773
|
|
|
6770
6774
|
|
|
6771
6775
|
|
|
6776
|
+
|
|
6772
6777
|
|
|
6773
6778
|
|
|
6774
6779
|
static isAPrivateIp(ip ) {
|
|
@@ -6837,6 +6842,7 @@ class WebRTCClient extends Emitter {
|
|
|
6837
6842
|
this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
|
|
6838
6843
|
this.ON_NETWORK_STATS = ON_NETWORK_STATS$1;
|
|
6839
6844
|
this.ON_DISCONNECTED = ON_DISCONNECTED$1;
|
|
6845
|
+
this.ON_EARLY_MEDIA = ON_EARLY_MEDIA$1;
|
|
6840
6846
|
}
|
|
6841
6847
|
|
|
6842
6848
|
configureMedia(media ) {
|
|
@@ -7124,6 +7130,11 @@ class WebRTCClient extends Emitter {
|
|
|
7124
7130
|
}
|
|
7125
7131
|
this._onAccepted(session, response.session, true);
|
|
7126
7132
|
},
|
|
7133
|
+
onProgress: (payload) => {
|
|
7134
|
+
if (payload.message.statusCode === 183) {
|
|
7135
|
+
this._onEarlyProgress(payload.session);
|
|
7136
|
+
}
|
|
7137
|
+
},
|
|
7127
7138
|
onReject: (response ) => {
|
|
7128
7139
|
logger$9.info('on call rejected', { id: session.id, fromTag: session.fromTag });
|
|
7129
7140
|
this._stopSendingStats(session);
|
|
@@ -8516,6 +8527,17 @@ class WebRTCClient extends Emitter {
|
|
|
8516
8527
|
};
|
|
8517
8528
|
}
|
|
8518
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
|
+
|
|
8519
8541
|
_onAccepted(session , sessionDialog , withEvent = true) {
|
|
8520
8542
|
logger$9.info('on call accepted', { id: session.id, remoteTag: session.remoteTag });
|
|
8521
8543
|
|
|
@@ -8567,15 +8589,22 @@ class WebRTCClient extends Emitter {
|
|
|
8567
8589
|
|
|
8568
8590
|
_setupMedias(session , newStream ) {
|
|
8569
8591
|
// Safari hack, because you cannot call .play() from a non user action
|
|
8570
|
-
const sessionId = this.getSipSessionId(session);
|
|
8592
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8571
8593
|
const isConference = this.isConference(sessionId);
|
|
8572
8594
|
|
|
8595
|
+
if (sessionId in this.audioElements) {
|
|
8596
|
+
logger$9.info('html element already exists for session', { sessionId });
|
|
8597
|
+
return;
|
|
8598
|
+
}
|
|
8599
|
+
|
|
8573
8600
|
if (this._hasAudio() && this._isWeb() && !(sessionId in this.audioElements)) {
|
|
8574
8601
|
this.createAudioElementFor(sessionId);
|
|
8575
8602
|
}
|
|
8576
8603
|
|
|
8577
8604
|
const audioElement = this.audioElements[sessionId];
|
|
8578
|
-
const
|
|
8605
|
+
const sipSession = this.sipSessions[session.callId];
|
|
8606
|
+
const removeStream = this.getRemoteStream(sessionId);
|
|
8607
|
+
const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
|
|
8579
8608
|
|
|
8580
8609
|
if (!this._isWeb() || !stream) {
|
|
8581
8610
|
return;
|
|
@@ -8907,6 +8936,7 @@ const ON_NETWORK_STATS = 'onNetworkStats';
|
|
|
8907
8936
|
const ON_CHAT = 'phone/ON_CHAT';
|
|
8908
8937
|
const ON_SIGNAL = 'phone/ON_SIGNAL';
|
|
8909
8938
|
const ON_DISCONNECTED = 'onDisconnected';
|
|
8939
|
+
const ON_EARLY_MEDIA = 'onEarlyMedia';
|
|
8910
8940
|
|
|
8911
8941
|
const MESSAGE_TYPE_CHAT = 'message/TYPE_CHAT';
|
|
8912
8942
|
const MESSAGE_TYPE_SIGNAL = 'message/TYPE_SIGNAL';
|
|
@@ -8948,6 +8978,7 @@ const events = [
|
|
|
8948
8978
|
ON_SIGNAL,
|
|
8949
8979
|
ON_NETWORK_STATS,
|
|
8950
8980
|
ON_DISCONNECTED,
|
|
8981
|
+
ON_EARLY_MEDIA,
|
|
8951
8982
|
];
|
|
8952
8983
|
|
|
8953
8984
|
const logger$8 = IssueReporter$1.loggerFor('webrtc-phone');
|
|
@@ -10377,6 +10408,10 @@ class WebRTCPhone extends Emitter {
|
|
|
10377
10408
|
logger$8.info('WebRTC disconnected');
|
|
10378
10409
|
this.eventEmitter.emit(ON_DISCONNECTED);
|
|
10379
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
|
+
});
|
|
10380
10415
|
|
|
10381
10416
|
this.client.on(this.client.REGISTERED, () => {
|
|
10382
10417
|
logger$8.info('WebRTC registered', {
|
|
@@ -10660,6 +10695,7 @@ var PHONE_EVENTS = /*#__PURE__*/Object.freeze({
|
|
|
10660
10695
|
ON_CHAT: ON_CHAT,
|
|
10661
10696
|
ON_SIGNAL: ON_SIGNAL,
|
|
10662
10697
|
ON_DISCONNECTED: ON_DISCONNECTED,
|
|
10698
|
+
ON_EARLY_MEDIA: ON_EARLY_MEDIA,
|
|
10663
10699
|
MESSAGE_TYPE_CHAT: MESSAGE_TYPE_CHAT,
|
|
10664
10700
|
MESSAGE_TYPE_SIGNAL: MESSAGE_TYPE_SIGNAL,
|
|
10665
10701
|
events: events,
|
|
@@ -5037,10 +5037,13 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
5037
5037
|
createRoom: async (name , users ) =>
|
|
5038
5038
|
client.post(`${baseUrl}/users/me/rooms`, { name, users }).then(ChatRoom.parse),
|
|
5039
5039
|
|
|
5040
|
-
getRoomMessages: async (roomUuid ) =>
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5040
|
+
getRoomMessages: async (roomUuid , params = {}) => {
|
|
5041
|
+
const qs = ApiRequester.getQueryString(params);
|
|
5042
|
+
|
|
5043
|
+
return client
|
|
5044
|
+
.get(`${baseUrl}/users/me/rooms/${roomUuid}/messages${qs.length ? `?${qs}` : ''}`)
|
|
5045
|
+
.then((response ) => ChatMessage.parseMany(response));
|
|
5046
|
+
},
|
|
5044
5047
|
|
|
5045
5048
|
sendRoomMessage: async (roomUuid , message ) =>
|
|
5046
5049
|
client.post(`${baseUrl}/users/me/rooms/${roomUuid}/messages`, message).then(ChatMessage.parse),
|
|
@@ -6686,6 +6689,7 @@ const MESSAGE = 'message';
|
|
|
6686
6689
|
const ACCEPTED = 'accepted';
|
|
6687
6690
|
const REJECTED = 'rejected';
|
|
6688
6691
|
const ON_TRACK$1 = 'onTrack';
|
|
6692
|
+
const ON_EARLY_MEDIA$1 = 'onEarlyMedia';
|
|
6689
6693
|
const ON_REINVITE$1 = 'reinvite';
|
|
6690
6694
|
const ON_ERROR = 'onError';
|
|
6691
6695
|
const ON_SCREEN_SHARING_REINVITE = 'onScreenSharingReinvite';
|
|
@@ -6769,6 +6773,7 @@ class WebRTCClient extends Emitter {
|
|
|
6769
6773
|
|
|
6770
6774
|
|
|
6771
6775
|
|
|
6776
|
+
|
|
6772
6777
|
|
|
6773
6778
|
|
|
6774
6779
|
static isAPrivateIp(ip ) {
|
|
@@ -6837,6 +6842,7 @@ class WebRTCClient extends Emitter {
|
|
|
6837
6842
|
this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
|
|
6838
6843
|
this.ON_NETWORK_STATS = ON_NETWORK_STATS$1;
|
|
6839
6844
|
this.ON_DISCONNECTED = ON_DISCONNECTED$1;
|
|
6845
|
+
this.ON_EARLY_MEDIA = ON_EARLY_MEDIA$1;
|
|
6840
6846
|
}
|
|
6841
6847
|
|
|
6842
6848
|
configureMedia(media ) {
|
|
@@ -7124,6 +7130,11 @@ class WebRTCClient extends Emitter {
|
|
|
7124
7130
|
}
|
|
7125
7131
|
this._onAccepted(session, response.session, true);
|
|
7126
7132
|
},
|
|
7133
|
+
onProgress: (payload) => {
|
|
7134
|
+
if (payload.message.statusCode === 183) {
|
|
7135
|
+
this._onEarlyProgress(payload.session);
|
|
7136
|
+
}
|
|
7137
|
+
},
|
|
7127
7138
|
onReject: (response ) => {
|
|
7128
7139
|
logger$9.info('on call rejected', { id: session.id, fromTag: session.fromTag });
|
|
7129
7140
|
this._stopSendingStats(session);
|
|
@@ -8516,6 +8527,17 @@ class WebRTCClient extends Emitter {
|
|
|
8516
8527
|
};
|
|
8517
8528
|
}
|
|
8518
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
|
+
|
|
8519
8541
|
_onAccepted(session , sessionDialog , withEvent = true) {
|
|
8520
8542
|
logger$9.info('on call accepted', { id: session.id, remoteTag: session.remoteTag });
|
|
8521
8543
|
|
|
@@ -8567,15 +8589,22 @@ class WebRTCClient extends Emitter {
|
|
|
8567
8589
|
|
|
8568
8590
|
_setupMedias(session , newStream ) {
|
|
8569
8591
|
// Safari hack, because you cannot call .play() from a non user action
|
|
8570
|
-
const sessionId = this.getSipSessionId(session);
|
|
8592
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8571
8593
|
const isConference = this.isConference(sessionId);
|
|
8572
8594
|
|
|
8595
|
+
if (sessionId in this.audioElements) {
|
|
8596
|
+
logger$9.info('html element already exists for session', { sessionId });
|
|
8597
|
+
return;
|
|
8598
|
+
}
|
|
8599
|
+
|
|
8573
8600
|
if (this._hasAudio() && this._isWeb() && !(sessionId in this.audioElements)) {
|
|
8574
8601
|
this.createAudioElementFor(sessionId);
|
|
8575
8602
|
}
|
|
8576
8603
|
|
|
8577
8604
|
const audioElement = this.audioElements[sessionId];
|
|
8578
|
-
const
|
|
8605
|
+
const sipSession = this.sipSessions[session.callId];
|
|
8606
|
+
const removeStream = this.getRemoteStream(sessionId);
|
|
8607
|
+
const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
|
|
8579
8608
|
|
|
8580
8609
|
if (!this._isWeb() || !stream) {
|
|
8581
8610
|
return;
|
|
@@ -8907,6 +8936,7 @@ const ON_NETWORK_STATS = 'onNetworkStats';
|
|
|
8907
8936
|
const ON_CHAT = 'phone/ON_CHAT';
|
|
8908
8937
|
const ON_SIGNAL = 'phone/ON_SIGNAL';
|
|
8909
8938
|
const ON_DISCONNECTED = 'onDisconnected';
|
|
8939
|
+
const ON_EARLY_MEDIA = 'onEarlyMedia';
|
|
8910
8940
|
|
|
8911
8941
|
const MESSAGE_TYPE_CHAT = 'message/TYPE_CHAT';
|
|
8912
8942
|
const MESSAGE_TYPE_SIGNAL = 'message/TYPE_SIGNAL';
|
|
@@ -8948,6 +8978,7 @@ const events = [
|
|
|
8948
8978
|
ON_SIGNAL,
|
|
8949
8979
|
ON_NETWORK_STATS,
|
|
8950
8980
|
ON_DISCONNECTED,
|
|
8981
|
+
ON_EARLY_MEDIA,
|
|
8951
8982
|
];
|
|
8952
8983
|
|
|
8953
8984
|
const logger$8 = IssueReporter$1.loggerFor('webrtc-phone');
|
|
@@ -10377,6 +10408,10 @@ class WebRTCPhone extends Emitter {
|
|
|
10377
10408
|
logger$8.info('WebRTC disconnected');
|
|
10378
10409
|
this.eventEmitter.emit(ON_DISCONNECTED);
|
|
10379
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
|
+
});
|
|
10380
10415
|
|
|
10381
10416
|
this.client.on(this.client.REGISTERED, () => {
|
|
10382
10417
|
logger$8.info('WebRTC registered', {
|
|
@@ -10660,6 +10695,7 @@ var PHONE_EVENTS = /*#__PURE__*/Object.freeze({
|
|
|
10660
10695
|
ON_CHAT: ON_CHAT,
|
|
10661
10696
|
ON_SIGNAL: ON_SIGNAL,
|
|
10662
10697
|
ON_DISCONNECTED: ON_DISCONNECTED,
|
|
10698
|
+
ON_EARLY_MEDIA: ON_EARLY_MEDIA,
|
|
10663
10699
|
MESSAGE_TYPE_CHAT: MESSAGE_TYPE_CHAT,
|
|
10664
10700
|
MESSAGE_TYPE_SIGNAL: MESSAGE_TYPE_SIGNAL,
|
|
10665
10701
|
events: events,
|
|
@@ -5037,10 +5037,13 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
5037
5037
|
createRoom: async (name , users ) =>
|
|
5038
5038
|
client.post(`${baseUrl}/users/me/rooms`, { name, users }).then(ChatRoom.parse),
|
|
5039
5039
|
|
|
5040
|
-
getRoomMessages: async (roomUuid ) =>
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5040
|
+
getRoomMessages: async (roomUuid , params = {}) => {
|
|
5041
|
+
const qs = ApiRequester.getQueryString(params);
|
|
5042
|
+
|
|
5043
|
+
return client
|
|
5044
|
+
.get(`${baseUrl}/users/me/rooms/${roomUuid}/messages${qs.length ? `?${qs}` : ''}`)
|
|
5045
|
+
.then((response ) => ChatMessage.parseMany(response));
|
|
5046
|
+
},
|
|
5044
5047
|
|
|
5045
5048
|
sendRoomMessage: async (roomUuid , message ) =>
|
|
5046
5049
|
client.post(`${baseUrl}/users/me/rooms/${roomUuid}/messages`, message).then(ChatMessage.parse),
|
|
@@ -7017,6 +7020,7 @@ const MESSAGE = 'message';
|
|
|
7017
7020
|
const ACCEPTED = 'accepted';
|
|
7018
7021
|
const REJECTED = 'rejected';
|
|
7019
7022
|
const ON_TRACK$1 = 'onTrack';
|
|
7023
|
+
const ON_EARLY_MEDIA$1 = 'onEarlyMedia';
|
|
7020
7024
|
const ON_REINVITE$1 = 'reinvite';
|
|
7021
7025
|
const ON_ERROR = 'onError';
|
|
7022
7026
|
const ON_SCREEN_SHARING_REINVITE = 'onScreenSharingReinvite';
|
|
@@ -7100,6 +7104,7 @@ class WebRTCClient extends Emitter {
|
|
|
7100
7104
|
|
|
7101
7105
|
|
|
7102
7106
|
|
|
7107
|
+
|
|
7103
7108
|
|
|
7104
7109
|
|
|
7105
7110
|
static isAPrivateIp(ip ) {
|
|
@@ -7168,6 +7173,7 @@ class WebRTCClient extends Emitter {
|
|
|
7168
7173
|
this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
|
|
7169
7174
|
this.ON_NETWORK_STATS = ON_NETWORK_STATS$1;
|
|
7170
7175
|
this.ON_DISCONNECTED = ON_DISCONNECTED$1;
|
|
7176
|
+
this.ON_EARLY_MEDIA = ON_EARLY_MEDIA$1;
|
|
7171
7177
|
}
|
|
7172
7178
|
|
|
7173
7179
|
configureMedia(media ) {
|
|
@@ -7455,6 +7461,11 @@ class WebRTCClient extends Emitter {
|
|
|
7455
7461
|
}
|
|
7456
7462
|
this._onAccepted(session, response.session, true);
|
|
7457
7463
|
},
|
|
7464
|
+
onProgress: (payload) => {
|
|
7465
|
+
if (payload.message.statusCode === 183) {
|
|
7466
|
+
this._onEarlyProgress(payload.session);
|
|
7467
|
+
}
|
|
7468
|
+
},
|
|
7458
7469
|
onReject: (response ) => {
|
|
7459
7470
|
logger$8.info('on call rejected', { id: session.id, fromTag: session.fromTag });
|
|
7460
7471
|
this._stopSendingStats(session);
|
|
@@ -8847,6 +8858,17 @@ class WebRTCClient extends Emitter {
|
|
|
8847
8858
|
};
|
|
8848
8859
|
}
|
|
8849
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
|
+
|
|
8850
8872
|
_onAccepted(session , sessionDialog , withEvent = true) {
|
|
8851
8873
|
logger$8.info('on call accepted', { id: session.id, remoteTag: session.remoteTag });
|
|
8852
8874
|
|
|
@@ -8898,15 +8920,22 @@ class WebRTCClient extends Emitter {
|
|
|
8898
8920
|
|
|
8899
8921
|
_setupMedias(session , newStream ) {
|
|
8900
8922
|
// Safari hack, because you cannot call .play() from a non user action
|
|
8901
|
-
const sessionId = this.getSipSessionId(session);
|
|
8923
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8902
8924
|
const isConference = this.isConference(sessionId);
|
|
8903
8925
|
|
|
8926
|
+
if (sessionId in this.audioElements) {
|
|
8927
|
+
logger$8.info('html element already exists for session', { sessionId });
|
|
8928
|
+
return;
|
|
8929
|
+
}
|
|
8930
|
+
|
|
8904
8931
|
if (this._hasAudio() && this._isWeb() && !(sessionId in this.audioElements)) {
|
|
8905
8932
|
this.createAudioElementFor(sessionId);
|
|
8906
8933
|
}
|
|
8907
8934
|
|
|
8908
8935
|
const audioElement = this.audioElements[sessionId];
|
|
8909
|
-
const
|
|
8936
|
+
const sipSession = this.sipSessions[session.callId];
|
|
8937
|
+
const removeStream = this.getRemoteStream(sessionId);
|
|
8938
|
+
const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
|
|
8910
8939
|
|
|
8911
8940
|
if (!this._isWeb() || !stream) {
|
|
8912
8941
|
return;
|
|
@@ -9238,6 +9267,7 @@ const ON_NETWORK_STATS = 'onNetworkStats';
|
|
|
9238
9267
|
const ON_CHAT = 'phone/ON_CHAT';
|
|
9239
9268
|
const ON_SIGNAL = 'phone/ON_SIGNAL';
|
|
9240
9269
|
const ON_DISCONNECTED = 'onDisconnected';
|
|
9270
|
+
const ON_EARLY_MEDIA = 'onEarlyMedia';
|
|
9241
9271
|
|
|
9242
9272
|
const MESSAGE_TYPE_CHAT = 'message/TYPE_CHAT';
|
|
9243
9273
|
const MESSAGE_TYPE_SIGNAL = 'message/TYPE_SIGNAL';
|
|
@@ -9279,6 +9309,7 @@ const events = [
|
|
|
9279
9309
|
ON_SIGNAL,
|
|
9280
9310
|
ON_NETWORK_STATS,
|
|
9281
9311
|
ON_DISCONNECTED,
|
|
9312
|
+
ON_EARLY_MEDIA,
|
|
9282
9313
|
];
|
|
9283
9314
|
|
|
9284
9315
|
const logger$7 = IssueReporter$1.loggerFor('webrtc-phone');
|
|
@@ -10708,6 +10739,10 @@ class WebRTCPhone extends Emitter {
|
|
|
10708
10739
|
logger$7.info('WebRTC disconnected');
|
|
10709
10740
|
this.eventEmitter.emit(ON_DISCONNECTED);
|
|
10710
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
|
+
});
|
|
10711
10746
|
|
|
10712
10747
|
this.client.on(this.client.REGISTERED, () => {
|
|
10713
10748
|
logger$7.info('WebRTC registered', {
|
|
@@ -10991,6 +11026,7 @@ var PHONE_EVENTS = /*#__PURE__*/Object.freeze({
|
|
|
10991
11026
|
ON_CHAT: ON_CHAT,
|
|
10992
11027
|
ON_SIGNAL: ON_SIGNAL,
|
|
10993
11028
|
ON_DISCONNECTED: ON_DISCONNECTED,
|
|
11029
|
+
ON_EARLY_MEDIA: ON_EARLY_MEDIA,
|
|
10994
11030
|
MESSAGE_TYPE_CHAT: MESSAGE_TYPE_CHAT,
|
|
10995
11031
|
MESSAGE_TYPE_SIGNAL: MESSAGE_TYPE_SIGNAL,
|
|
10996
11032
|
events: events,
|
package/esm/simple/room/Room.js
CHANGED
|
@@ -5037,10 +5037,13 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
5037
5037
|
createRoom: async (name , users ) =>
|
|
5038
5038
|
client.post(`${baseUrl}/users/me/rooms`, { name, users }).then(ChatRoom.parse),
|
|
5039
5039
|
|
|
5040
|
-
getRoomMessages: async (roomUuid ) =>
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5040
|
+
getRoomMessages: async (roomUuid , params = {}) => {
|
|
5041
|
+
const qs = ApiRequester.getQueryString(params);
|
|
5042
|
+
|
|
5043
|
+
return client
|
|
5044
|
+
.get(`${baseUrl}/users/me/rooms/${roomUuid}/messages${qs.length ? `?${qs}` : ''}`)
|
|
5045
|
+
.then((response ) => ChatMessage.parseMany(response));
|
|
5046
|
+
},
|
|
5044
5047
|
|
|
5045
5048
|
sendRoomMessage: async (roomUuid , message ) =>
|
|
5046
5049
|
client.post(`${baseUrl}/users/me/rooms/${roomUuid}/messages`, message).then(ChatMessage.parse),
|
|
@@ -7017,6 +7020,7 @@ const MESSAGE = 'message';
|
|
|
7017
7020
|
const ACCEPTED = 'accepted';
|
|
7018
7021
|
const REJECTED = 'rejected';
|
|
7019
7022
|
const ON_TRACK$1 = 'onTrack';
|
|
7023
|
+
const ON_EARLY_MEDIA$1 = 'onEarlyMedia';
|
|
7020
7024
|
const ON_REINVITE$1 = 'reinvite';
|
|
7021
7025
|
const ON_ERROR = 'onError';
|
|
7022
7026
|
const ON_SCREEN_SHARING_REINVITE = 'onScreenSharingReinvite';
|
|
@@ -7100,6 +7104,7 @@ class WebRTCClient extends Emitter {
|
|
|
7100
7104
|
|
|
7101
7105
|
|
|
7102
7106
|
|
|
7107
|
+
|
|
7103
7108
|
|
|
7104
7109
|
|
|
7105
7110
|
static isAPrivateIp(ip ) {
|
|
@@ -7168,6 +7173,7 @@ class WebRTCClient extends Emitter {
|
|
|
7168
7173
|
this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
|
|
7169
7174
|
this.ON_NETWORK_STATS = ON_NETWORK_STATS$1;
|
|
7170
7175
|
this.ON_DISCONNECTED = ON_DISCONNECTED$1;
|
|
7176
|
+
this.ON_EARLY_MEDIA = ON_EARLY_MEDIA$1;
|
|
7171
7177
|
}
|
|
7172
7178
|
|
|
7173
7179
|
configureMedia(media ) {
|
|
@@ -7455,6 +7461,11 @@ class WebRTCClient extends Emitter {
|
|
|
7455
7461
|
}
|
|
7456
7462
|
this._onAccepted(session, response.session, true);
|
|
7457
7463
|
},
|
|
7464
|
+
onProgress: (payload) => {
|
|
7465
|
+
if (payload.message.statusCode === 183) {
|
|
7466
|
+
this._onEarlyProgress(payload.session);
|
|
7467
|
+
}
|
|
7468
|
+
},
|
|
7458
7469
|
onReject: (response ) => {
|
|
7459
7470
|
logger$8.info('on call rejected', { id: session.id, fromTag: session.fromTag });
|
|
7460
7471
|
this._stopSendingStats(session);
|
|
@@ -8847,6 +8858,17 @@ class WebRTCClient extends Emitter {
|
|
|
8847
8858
|
};
|
|
8848
8859
|
}
|
|
8849
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
|
+
|
|
8850
8872
|
_onAccepted(session , sessionDialog , withEvent = true) {
|
|
8851
8873
|
logger$8.info('on call accepted', { id: session.id, remoteTag: session.remoteTag });
|
|
8852
8874
|
|
|
@@ -8898,15 +8920,22 @@ class WebRTCClient extends Emitter {
|
|
|
8898
8920
|
|
|
8899
8921
|
_setupMedias(session , newStream ) {
|
|
8900
8922
|
// Safari hack, because you cannot call .play() from a non user action
|
|
8901
|
-
const sessionId = this.getSipSessionId(session);
|
|
8923
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8902
8924
|
const isConference = this.isConference(sessionId);
|
|
8903
8925
|
|
|
8926
|
+
if (sessionId in this.audioElements) {
|
|
8927
|
+
logger$8.info('html element already exists for session', { sessionId });
|
|
8928
|
+
return;
|
|
8929
|
+
}
|
|
8930
|
+
|
|
8904
8931
|
if (this._hasAudio() && this._isWeb() && !(sessionId in this.audioElements)) {
|
|
8905
8932
|
this.createAudioElementFor(sessionId);
|
|
8906
8933
|
}
|
|
8907
8934
|
|
|
8908
8935
|
const audioElement = this.audioElements[sessionId];
|
|
8909
|
-
const
|
|
8936
|
+
const sipSession = this.sipSessions[session.callId];
|
|
8937
|
+
const removeStream = this.getRemoteStream(sessionId);
|
|
8938
|
+
const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
|
|
8910
8939
|
|
|
8911
8940
|
if (!this._isWeb() || !stream) {
|
|
8912
8941
|
return;
|
|
@@ -9238,6 +9267,7 @@ const ON_NETWORK_STATS = 'onNetworkStats';
|
|
|
9238
9267
|
const ON_CHAT = 'phone/ON_CHAT';
|
|
9239
9268
|
const ON_SIGNAL = 'phone/ON_SIGNAL';
|
|
9240
9269
|
const ON_DISCONNECTED = 'onDisconnected';
|
|
9270
|
+
const ON_EARLY_MEDIA = 'onEarlyMedia';
|
|
9241
9271
|
|
|
9242
9272
|
const MESSAGE_TYPE_CHAT = 'message/TYPE_CHAT';
|
|
9243
9273
|
const MESSAGE_TYPE_SIGNAL = 'message/TYPE_SIGNAL';
|
|
@@ -9279,6 +9309,7 @@ const events = [
|
|
|
9279
9309
|
ON_SIGNAL,
|
|
9280
9310
|
ON_NETWORK_STATS,
|
|
9281
9311
|
ON_DISCONNECTED,
|
|
9312
|
+
ON_EARLY_MEDIA,
|
|
9282
9313
|
];
|
|
9283
9314
|
|
|
9284
9315
|
const logger$7 = IssueReporter$1.loggerFor('webrtc-phone');
|
|
@@ -10708,6 +10739,10 @@ class WebRTCPhone extends Emitter {
|
|
|
10708
10739
|
logger$7.info('WebRTC disconnected');
|
|
10709
10740
|
this.eventEmitter.emit(ON_DISCONNECTED);
|
|
10710
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
|
+
});
|
|
10711
10746
|
|
|
10712
10747
|
this.client.on(this.client.REGISTERED, () => {
|
|
10713
10748
|
logger$7.info('WebRTC registered', {
|
|
@@ -10991,6 +11026,7 @@ var PHONE_EVENTS = /*#__PURE__*/Object.freeze({
|
|
|
10991
11026
|
ON_CHAT: ON_CHAT,
|
|
10992
11027
|
ON_SIGNAL: ON_SIGNAL,
|
|
10993
11028
|
ON_DISCONNECTED: ON_DISCONNECTED,
|
|
11029
|
+
ON_EARLY_MEDIA: ON_EARLY_MEDIA,
|
|
10994
11030
|
MESSAGE_TYPE_CHAT: MESSAGE_TYPE_CHAT,
|
|
10995
11031
|
MESSAGE_TYPE_SIGNAL: MESSAGE_TYPE_SIGNAL,
|
|
10996
11032
|
events: events,
|