@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
|
@@ -4204,10 +4204,13 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
4204
4204
|
createRoom: async (name , users ) =>
|
|
4205
4205
|
client.post(`${baseUrl}/users/me/rooms`, { name, users }).then(ChatRoom.parse),
|
|
4206
4206
|
|
|
4207
|
-
getRoomMessages: async (roomUuid ) =>
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4207
|
+
getRoomMessages: async (roomUuid , params = {}) => {
|
|
4208
|
+
const qs = ApiRequester.getQueryString(params);
|
|
4209
|
+
|
|
4210
|
+
return client
|
|
4211
|
+
.get(`${baseUrl}/users/me/rooms/${roomUuid}/messages${qs.length ? `?${qs}` : ''}`)
|
|
4212
|
+
.then((response ) => ChatMessage.parseMany(response));
|
|
4213
|
+
},
|
|
4211
4214
|
|
|
4212
4215
|
sendRoomMessage: async (roomUuid , message ) =>
|
|
4213
4216
|
client.post(`${baseUrl}/users/me/rooms/${roomUuid}/messages`, message).then(ChatMessage.parse),
|
|
@@ -4781,10 +4781,13 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
4781
4781
|
createRoom: async (name , users ) =>
|
|
4782
4782
|
client.post(`${baseUrl}/users/me/rooms`, { name, users }).then(ChatRoom.parse),
|
|
4783
4783
|
|
|
4784
|
-
getRoomMessages: async (roomUuid ) =>
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4784
|
+
getRoomMessages: async (roomUuid , params = {}) => {
|
|
4785
|
+
const qs = ApiRequester.getQueryString(params);
|
|
4786
|
+
|
|
4787
|
+
return client
|
|
4788
|
+
.get(`${baseUrl}/users/me/rooms/${roomUuid}/messages${qs.length ? `?${qs}` : ''}`)
|
|
4789
|
+
.then((response ) => ChatMessage.parseMany(response));
|
|
4790
|
+
},
|
|
4788
4791
|
|
|
4789
4792
|
sendRoomMessage: async (roomUuid , message ) =>
|
|
4790
4793
|
client.post(`${baseUrl}/users/me/rooms/${roomUuid}/messages`, message).then(ChatMessage.parse),
|
|
@@ -5605,6 +5608,7 @@ const MESSAGE = 'message';
|
|
|
5605
5608
|
const ACCEPTED = 'accepted';
|
|
5606
5609
|
const REJECTED = 'rejected';
|
|
5607
5610
|
const ON_TRACK = 'onTrack';
|
|
5611
|
+
const ON_EARLY_MEDIA = 'onEarlyMedia';
|
|
5608
5612
|
const ON_REINVITE = 'reinvite';
|
|
5609
5613
|
const ON_ERROR = 'onError';
|
|
5610
5614
|
const ON_SCREEN_SHARING_REINVITE = 'onScreenSharingReinvite';
|
|
@@ -5685,6 +5689,7 @@ class WebRTCClient extends Emitter {
|
|
|
5685
5689
|
|
|
5686
5690
|
|
|
5687
5691
|
|
|
5692
|
+
|
|
5688
5693
|
|
|
5689
5694
|
|
|
5690
5695
|
static isAPrivateIp(ip ) {
|
|
@@ -5753,6 +5758,7 @@ class WebRTCClient extends Emitter {
|
|
|
5753
5758
|
this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
|
|
5754
5759
|
this.ON_NETWORK_STATS = ON_NETWORK_STATS;
|
|
5755
5760
|
this.ON_DISCONNECTED = ON_DISCONNECTED;
|
|
5761
|
+
this.ON_EARLY_MEDIA = ON_EARLY_MEDIA;
|
|
5756
5762
|
}
|
|
5757
5763
|
|
|
5758
5764
|
configureMedia(media ) {
|
|
@@ -6040,6 +6046,11 @@ class WebRTCClient extends Emitter {
|
|
|
6040
6046
|
}
|
|
6041
6047
|
this._onAccepted(session, response.session, true);
|
|
6042
6048
|
},
|
|
6049
|
+
onProgress: (payload) => {
|
|
6050
|
+
if (payload.message.statusCode === 183) {
|
|
6051
|
+
this._onEarlyProgress(payload.session);
|
|
6052
|
+
}
|
|
6053
|
+
},
|
|
6043
6054
|
onReject: (response ) => {
|
|
6044
6055
|
logger.info('on call rejected', { id: session.id, fromTag: session.fromTag });
|
|
6045
6056
|
this._stopSendingStats(session);
|
|
@@ -7432,6 +7443,17 @@ class WebRTCClient extends Emitter {
|
|
|
7432
7443
|
};
|
|
7433
7444
|
}
|
|
7434
7445
|
|
|
7446
|
+
_onEarlyProgress(session ) {
|
|
7447
|
+
this._setupMedias(session);
|
|
7448
|
+
|
|
7449
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
7450
|
+
this.updateRemoteStream(sessionId);
|
|
7451
|
+
|
|
7452
|
+
logger.info('Early media progress progress received', { sessionId });
|
|
7453
|
+
|
|
7454
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA, session);
|
|
7455
|
+
}
|
|
7456
|
+
|
|
7435
7457
|
_onAccepted(session , sessionDialog , withEvent = true) {
|
|
7436
7458
|
logger.info('on call accepted', { id: session.id, remoteTag: session.remoteTag });
|
|
7437
7459
|
|
|
@@ -7483,15 +7505,22 @@ class WebRTCClient extends Emitter {
|
|
|
7483
7505
|
|
|
7484
7506
|
_setupMedias(session , newStream ) {
|
|
7485
7507
|
// Safari hack, because you cannot call .play() from a non user action
|
|
7486
|
-
const sessionId = this.getSipSessionId(session);
|
|
7508
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
7487
7509
|
const isConference = this.isConference(sessionId);
|
|
7488
7510
|
|
|
7511
|
+
if (sessionId in this.audioElements) {
|
|
7512
|
+
logger.info('html element already exists for session', { sessionId });
|
|
7513
|
+
return;
|
|
7514
|
+
}
|
|
7515
|
+
|
|
7489
7516
|
if (this._hasAudio() && this._isWeb() && !(sessionId in this.audioElements)) {
|
|
7490
7517
|
this.createAudioElementFor(sessionId);
|
|
7491
7518
|
}
|
|
7492
7519
|
|
|
7493
7520
|
const audioElement = this.audioElements[sessionId];
|
|
7494
|
-
const
|
|
7521
|
+
const sipSession = this.sipSessions[session.callId];
|
|
7522
|
+
const removeStream = this.getRemoteStream(sessionId);
|
|
7523
|
+
const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
|
|
7495
7524
|
|
|
7496
7525
|
if (!this._isWeb() || !stream) {
|
|
7497
7526
|
return;
|
package/esm/api/chatd.js
CHANGED
|
@@ -1296,10 +1296,13 @@ var chatd = (client , baseUrl ) => ({
|
|
|
1296
1296
|
createRoom: async (name , users ) =>
|
|
1297
1297
|
client.post(`${baseUrl}/users/me/rooms`, { name, users }).then(ChatRoom.parse),
|
|
1298
1298
|
|
|
1299
|
-
getRoomMessages: async (roomUuid ) =>
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1299
|
+
getRoomMessages: async (roomUuid , params = {}) => {
|
|
1300
|
+
const qs = ApiRequester.getQueryString(params);
|
|
1301
|
+
|
|
1302
|
+
return client
|
|
1303
|
+
.get(`${baseUrl}/users/me/rooms/${roomUuid}/messages${qs.length ? `?${qs}` : ''}`)
|
|
1304
|
+
.then((response ) => ChatMessage.parseMany(response));
|
|
1305
|
+
},
|
|
1303
1306
|
|
|
1304
1307
|
sendRoomMessage: async (roomUuid , message ) =>
|
|
1305
1308
|
client.post(`${baseUrl}/users/me/rooms/${roomUuid}/messages`, message).then(ChatMessage.parse),
|
package/esm/api-client.js
CHANGED
|
@@ -4204,10 +4204,13 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
4204
4204
|
createRoom: async (name , users ) =>
|
|
4205
4205
|
client.post(`${baseUrl}/users/me/rooms`, { name, users }).then(ChatRoom.parse),
|
|
4206
4206
|
|
|
4207
|
-
getRoomMessages: async (roomUuid ) =>
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4207
|
+
getRoomMessages: async (roomUuid , params = {}) => {
|
|
4208
|
+
const qs = ApiRequester.getQueryString(params);
|
|
4209
|
+
|
|
4210
|
+
return client
|
|
4211
|
+
.get(`${baseUrl}/users/me/rooms/${roomUuid}/messages${qs.length ? `?${qs}` : ''}`)
|
|
4212
|
+
.then((response ) => ChatMessage.parseMany(response));
|
|
4213
|
+
},
|
|
4211
4214
|
|
|
4212
4215
|
sendRoomMessage: async (roomUuid , message ) =>
|
|
4213
4216
|
client.post(`${baseUrl}/users/me/rooms/${roomUuid}/messages`, message).then(ChatMessage.parse),
|
package/esm/checker/Checker.js
CHANGED
|
@@ -4248,10 +4248,13 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
4248
4248
|
createRoom: async (name , users ) =>
|
|
4249
4249
|
client.post(`${baseUrl}/users/me/rooms`, { name, users }).then(ChatRoom.parse),
|
|
4250
4250
|
|
|
4251
|
-
getRoomMessages: async (roomUuid ) =>
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4251
|
+
getRoomMessages: async (roomUuid , params = {}) => {
|
|
4252
|
+
const qs = ApiRequester.getQueryString(params);
|
|
4253
|
+
|
|
4254
|
+
return client
|
|
4255
|
+
.get(`${baseUrl}/users/me/rooms/${roomUuid}/messages${qs.length ? `?${qs}` : ''}`)
|
|
4256
|
+
.then((response ) => ChatMessage.parseMany(response));
|
|
4257
|
+
},
|
|
4255
4258
|
|
|
4256
4259
|
sendRoomMessage: async (roomUuid , message ) =>
|
|
4257
4260
|
client.post(`${baseUrl}/users/me/rooms/${roomUuid}/messages`, message).then(ChatMessage.parse),
|
|
@@ -6192,6 +6195,7 @@ const MESSAGE = 'message';
|
|
|
6192
6195
|
const ACCEPTED = 'accepted';
|
|
6193
6196
|
const REJECTED = 'rejected';
|
|
6194
6197
|
const ON_TRACK = 'onTrack';
|
|
6198
|
+
const ON_EARLY_MEDIA = 'onEarlyMedia';
|
|
6195
6199
|
const ON_REINVITE = 'reinvite';
|
|
6196
6200
|
const ON_ERROR = 'onError';
|
|
6197
6201
|
const ON_SCREEN_SHARING_REINVITE = 'onScreenSharingReinvite';
|
|
@@ -6272,6 +6276,7 @@ class WebRTCClient extends Emitter {
|
|
|
6272
6276
|
|
|
6273
6277
|
|
|
6274
6278
|
|
|
6279
|
+
|
|
6275
6280
|
|
|
6276
6281
|
|
|
6277
6282
|
static isAPrivateIp(ip ) {
|
|
@@ -6340,6 +6345,7 @@ class WebRTCClient extends Emitter {
|
|
|
6340
6345
|
this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
|
|
6341
6346
|
this.ON_NETWORK_STATS = ON_NETWORK_STATS;
|
|
6342
6347
|
this.ON_DISCONNECTED = ON_DISCONNECTED;
|
|
6348
|
+
this.ON_EARLY_MEDIA = ON_EARLY_MEDIA;
|
|
6343
6349
|
}
|
|
6344
6350
|
|
|
6345
6351
|
configureMedia(media ) {
|
|
@@ -6627,6 +6633,11 @@ class WebRTCClient extends Emitter {
|
|
|
6627
6633
|
}
|
|
6628
6634
|
this._onAccepted(session, response.session, true);
|
|
6629
6635
|
},
|
|
6636
|
+
onProgress: (payload) => {
|
|
6637
|
+
if (payload.message.statusCode === 183) {
|
|
6638
|
+
this._onEarlyProgress(payload.session);
|
|
6639
|
+
}
|
|
6640
|
+
},
|
|
6630
6641
|
onReject: (response ) => {
|
|
6631
6642
|
logger$1.info('on call rejected', { id: session.id, fromTag: session.fromTag });
|
|
6632
6643
|
this._stopSendingStats(session);
|
|
@@ -8019,6 +8030,17 @@ class WebRTCClient extends Emitter {
|
|
|
8019
8030
|
};
|
|
8020
8031
|
}
|
|
8021
8032
|
|
|
8033
|
+
_onEarlyProgress(session ) {
|
|
8034
|
+
this._setupMedias(session);
|
|
8035
|
+
|
|
8036
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8037
|
+
this.updateRemoteStream(sessionId);
|
|
8038
|
+
|
|
8039
|
+
logger$1.info('Early media progress progress received', { sessionId });
|
|
8040
|
+
|
|
8041
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA, session);
|
|
8042
|
+
}
|
|
8043
|
+
|
|
8022
8044
|
_onAccepted(session , sessionDialog , withEvent = true) {
|
|
8023
8045
|
logger$1.info('on call accepted', { id: session.id, remoteTag: session.remoteTag });
|
|
8024
8046
|
|
|
@@ -8070,15 +8092,22 @@ class WebRTCClient extends Emitter {
|
|
|
8070
8092
|
|
|
8071
8093
|
_setupMedias(session , newStream ) {
|
|
8072
8094
|
// Safari hack, because you cannot call .play() from a non user action
|
|
8073
|
-
const sessionId = this.getSipSessionId(session);
|
|
8095
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8074
8096
|
const isConference = this.isConference(sessionId);
|
|
8075
8097
|
|
|
8098
|
+
if (sessionId in this.audioElements) {
|
|
8099
|
+
logger$1.info('html element already exists for session', { sessionId });
|
|
8100
|
+
return;
|
|
8101
|
+
}
|
|
8102
|
+
|
|
8076
8103
|
if (this._hasAudio() && this._isWeb() && !(sessionId in this.audioElements)) {
|
|
8077
8104
|
this.createAudioElementFor(sessionId);
|
|
8078
8105
|
}
|
|
8079
8106
|
|
|
8080
8107
|
const audioElement = this.audioElements[sessionId];
|
|
8081
|
-
const
|
|
8108
|
+
const sipSession = this.sipSessions[session.callId];
|
|
8109
|
+
const removeStream = this.getRemoteStream(sessionId);
|
|
8110
|
+
const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
|
|
8082
8111
|
|
|
8083
8112
|
if (!this._isWeb() || !stream) {
|
|
8084
8113
|
return;
|
|
@@ -4204,10 +4204,13 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
4204
4204
|
createRoom: async (name , users ) =>
|
|
4205
4205
|
client.post(`${baseUrl}/users/me/rooms`, { name, users }).then(ChatRoom.parse),
|
|
4206
4206
|
|
|
4207
|
-
getRoomMessages: async (roomUuid ) =>
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4207
|
+
getRoomMessages: async (roomUuid , params = {}) => {
|
|
4208
|
+
const qs = ApiRequester.getQueryString(params);
|
|
4209
|
+
|
|
4210
|
+
return client
|
|
4211
|
+
.get(`${baseUrl}/users/me/rooms/${roomUuid}/messages${qs.length ? `?${qs}` : ''}`)
|
|
4212
|
+
.then((response ) => ChatMessage.parseMany(response));
|
|
4213
|
+
},
|
|
4211
4214
|
|
|
4212
4215
|
sendRoomMessage: async (roomUuid , message ) =>
|
|
4213
4216
|
client.post(`${baseUrl}/users/me/rooms/${roomUuid}/messages`, message).then(ChatMessage.parse),
|
|
@@ -4204,10 +4204,13 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
4204
4204
|
createRoom: async (name , users ) =>
|
|
4205
4205
|
client.post(`${baseUrl}/users/me/rooms`, { name, users }).then(ChatRoom.parse),
|
|
4206
4206
|
|
|
4207
|
-
getRoomMessages: async (roomUuid ) =>
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4207
|
+
getRoomMessages: async (roomUuid , params = {}) => {
|
|
4208
|
+
const qs = ApiRequester.getQueryString(params);
|
|
4209
|
+
|
|
4210
|
+
return client
|
|
4211
|
+
.get(`${baseUrl}/users/me/rooms/${roomUuid}/messages${qs.length ? `?${qs}` : ''}`)
|
|
4212
|
+
.then((response ) => ChatMessage.parseMany(response));
|
|
4213
|
+
},
|
|
4211
4214
|
|
|
4212
4215
|
sendRoomMessage: async (roomUuid , message ) =>
|
|
4213
4216
|
client.post(`${baseUrl}/users/me/rooms/${roomUuid}/messages`, message).then(ChatMessage.parse),
|
|
@@ -4248,10 +4248,13 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
4248
4248
|
createRoom: async (name , users ) =>
|
|
4249
4249
|
client.post(`${baseUrl}/users/me/rooms`, { name, users }).then(ChatRoom.parse),
|
|
4250
4250
|
|
|
4251
|
-
getRoomMessages: async (roomUuid ) =>
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4251
|
+
getRoomMessages: async (roomUuid , params = {}) => {
|
|
4252
|
+
const qs = ApiRequester.getQueryString(params);
|
|
4253
|
+
|
|
4254
|
+
return client
|
|
4255
|
+
.get(`${baseUrl}/users/me/rooms/${roomUuid}/messages${qs.length ? `?${qs}` : ''}`)
|
|
4256
|
+
.then((response ) => ChatMessage.parseMany(response));
|
|
4257
|
+
},
|
|
4255
4258
|
|
|
4256
4259
|
sendRoomMessage: async (roomUuid , message ) =>
|
|
4257
4260
|
client.post(`${baseUrl}/users/me/rooms/${roomUuid}/messages`, message).then(ChatMessage.parse),
|
|
@@ -6192,6 +6195,7 @@ const MESSAGE = 'message';
|
|
|
6192
6195
|
const ACCEPTED = 'accepted';
|
|
6193
6196
|
const REJECTED = 'rejected';
|
|
6194
6197
|
const ON_TRACK = 'onTrack';
|
|
6198
|
+
const ON_EARLY_MEDIA = 'onEarlyMedia';
|
|
6195
6199
|
const ON_REINVITE = 'reinvite';
|
|
6196
6200
|
const ON_ERROR = 'onError';
|
|
6197
6201
|
const ON_SCREEN_SHARING_REINVITE = 'onScreenSharingReinvite';
|
|
@@ -6272,6 +6276,7 @@ class WebRTCClient extends Emitter {
|
|
|
6272
6276
|
|
|
6273
6277
|
|
|
6274
6278
|
|
|
6279
|
+
|
|
6275
6280
|
|
|
6276
6281
|
|
|
6277
6282
|
static isAPrivateIp(ip ) {
|
|
@@ -6340,6 +6345,7 @@ class WebRTCClient extends Emitter {
|
|
|
6340
6345
|
this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
|
|
6341
6346
|
this.ON_NETWORK_STATS = ON_NETWORK_STATS;
|
|
6342
6347
|
this.ON_DISCONNECTED = ON_DISCONNECTED;
|
|
6348
|
+
this.ON_EARLY_MEDIA = ON_EARLY_MEDIA;
|
|
6343
6349
|
}
|
|
6344
6350
|
|
|
6345
6351
|
configureMedia(media ) {
|
|
@@ -6627,6 +6633,11 @@ class WebRTCClient extends Emitter {
|
|
|
6627
6633
|
}
|
|
6628
6634
|
this._onAccepted(session, response.session, true);
|
|
6629
6635
|
},
|
|
6636
|
+
onProgress: (payload) => {
|
|
6637
|
+
if (payload.message.statusCode === 183) {
|
|
6638
|
+
this._onEarlyProgress(payload.session);
|
|
6639
|
+
}
|
|
6640
|
+
},
|
|
6630
6641
|
onReject: (response ) => {
|
|
6631
6642
|
logger.info('on call rejected', { id: session.id, fromTag: session.fromTag });
|
|
6632
6643
|
this._stopSendingStats(session);
|
|
@@ -8019,6 +8030,17 @@ class WebRTCClient extends Emitter {
|
|
|
8019
8030
|
};
|
|
8020
8031
|
}
|
|
8021
8032
|
|
|
8033
|
+
_onEarlyProgress(session ) {
|
|
8034
|
+
this._setupMedias(session);
|
|
8035
|
+
|
|
8036
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8037
|
+
this.updateRemoteStream(sessionId);
|
|
8038
|
+
|
|
8039
|
+
logger.info('Early media progress progress received', { sessionId });
|
|
8040
|
+
|
|
8041
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA, session);
|
|
8042
|
+
}
|
|
8043
|
+
|
|
8022
8044
|
_onAccepted(session , sessionDialog , withEvent = true) {
|
|
8023
8045
|
logger.info('on call accepted', { id: session.id, remoteTag: session.remoteTag });
|
|
8024
8046
|
|
|
@@ -8070,15 +8092,22 @@ class WebRTCClient extends Emitter {
|
|
|
8070
8092
|
|
|
8071
8093
|
_setupMedias(session , newStream ) {
|
|
8072
8094
|
// Safari hack, because you cannot call .play() from a non user action
|
|
8073
|
-
const sessionId = this.getSipSessionId(session);
|
|
8095
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8074
8096
|
const isConference = this.isConference(sessionId);
|
|
8075
8097
|
|
|
8098
|
+
if (sessionId in this.audioElements) {
|
|
8099
|
+
logger.info('html element already exists for session', { sessionId });
|
|
8100
|
+
return;
|
|
8101
|
+
}
|
|
8102
|
+
|
|
8076
8103
|
if (this._hasAudio() && this._isWeb() && !(sessionId in this.audioElements)) {
|
|
8077
8104
|
this.createAudioElementFor(sessionId);
|
|
8078
8105
|
}
|
|
8079
8106
|
|
|
8080
8107
|
const audioElement = this.audioElements[sessionId];
|
|
8081
|
-
const
|
|
8108
|
+
const sipSession = this.sipSessions[session.callId];
|
|
8109
|
+
const removeStream = this.getRemoteStream(sessionId);
|
|
8110
|
+
const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
|
|
8082
8111
|
|
|
8083
8112
|
if (!this._isWeb() || !stream) {
|
|
8084
8113
|
return;
|
|
@@ -4781,10 +4781,13 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
4781
4781
|
createRoom: async (name , users ) =>
|
|
4782
4782
|
client.post(`${baseUrl}/users/me/rooms`, { name, users }).then(ChatRoom.parse),
|
|
4783
4783
|
|
|
4784
|
-
getRoomMessages: async (roomUuid ) =>
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4784
|
+
getRoomMessages: async (roomUuid , params = {}) => {
|
|
4785
|
+
const qs = ApiRequester.getQueryString(params);
|
|
4786
|
+
|
|
4787
|
+
return client
|
|
4788
|
+
.get(`${baseUrl}/users/me/rooms/${roomUuid}/messages${qs.length ? `?${qs}` : ''}`)
|
|
4789
|
+
.then((response ) => ChatMessage.parseMany(response));
|
|
4790
|
+
},
|
|
4788
4791
|
|
|
4789
4792
|
sendRoomMessage: async (roomUuid , message ) =>
|
|
4790
4793
|
client.post(`${baseUrl}/users/me/rooms/${roomUuid}/messages`, message).then(ChatMessage.parse),
|
|
@@ -5605,6 +5608,7 @@ const MESSAGE = 'message';
|
|
|
5605
5608
|
const ACCEPTED = 'accepted';
|
|
5606
5609
|
const REJECTED = 'rejected';
|
|
5607
5610
|
const ON_TRACK = 'onTrack';
|
|
5611
|
+
const ON_EARLY_MEDIA = 'onEarlyMedia';
|
|
5608
5612
|
const ON_REINVITE = 'reinvite';
|
|
5609
5613
|
const ON_ERROR = 'onError';
|
|
5610
5614
|
const ON_SCREEN_SHARING_REINVITE = 'onScreenSharingReinvite';
|
|
@@ -5685,6 +5689,7 @@ class WebRTCClient extends Emitter {
|
|
|
5685
5689
|
|
|
5686
5690
|
|
|
5687
5691
|
|
|
5692
|
+
|
|
5688
5693
|
|
|
5689
5694
|
|
|
5690
5695
|
static isAPrivateIp(ip ) {
|
|
@@ -5753,6 +5758,7 @@ class WebRTCClient extends Emitter {
|
|
|
5753
5758
|
this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
|
|
5754
5759
|
this.ON_NETWORK_STATS = ON_NETWORK_STATS;
|
|
5755
5760
|
this.ON_DISCONNECTED = ON_DISCONNECTED;
|
|
5761
|
+
this.ON_EARLY_MEDIA = ON_EARLY_MEDIA;
|
|
5756
5762
|
}
|
|
5757
5763
|
|
|
5758
5764
|
configureMedia(media ) {
|
|
@@ -6040,6 +6046,11 @@ class WebRTCClient extends Emitter {
|
|
|
6040
6046
|
}
|
|
6041
6047
|
this._onAccepted(session, response.session, true);
|
|
6042
6048
|
},
|
|
6049
|
+
onProgress: (payload) => {
|
|
6050
|
+
if (payload.message.statusCode === 183) {
|
|
6051
|
+
this._onEarlyProgress(payload.session);
|
|
6052
|
+
}
|
|
6053
|
+
},
|
|
6043
6054
|
onReject: (response ) => {
|
|
6044
6055
|
logger.info('on call rejected', { id: session.id, fromTag: session.fromTag });
|
|
6045
6056
|
this._stopSendingStats(session);
|
|
@@ -7432,6 +7443,17 @@ class WebRTCClient extends Emitter {
|
|
|
7432
7443
|
};
|
|
7433
7444
|
}
|
|
7434
7445
|
|
|
7446
|
+
_onEarlyProgress(session ) {
|
|
7447
|
+
this._setupMedias(session);
|
|
7448
|
+
|
|
7449
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
7450
|
+
this.updateRemoteStream(sessionId);
|
|
7451
|
+
|
|
7452
|
+
logger.info('Early media progress progress received', { sessionId });
|
|
7453
|
+
|
|
7454
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA, session);
|
|
7455
|
+
}
|
|
7456
|
+
|
|
7435
7457
|
_onAccepted(session , sessionDialog , withEvent = true) {
|
|
7436
7458
|
logger.info('on call accepted', { id: session.id, remoteTag: session.remoteTag });
|
|
7437
7459
|
|
|
@@ -7483,15 +7505,22 @@ class WebRTCClient extends Emitter {
|
|
|
7483
7505
|
|
|
7484
7506
|
_setupMedias(session , newStream ) {
|
|
7485
7507
|
// Safari hack, because you cannot call .play() from a non user action
|
|
7486
|
-
const sessionId = this.getSipSessionId(session);
|
|
7508
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
7487
7509
|
const isConference = this.isConference(sessionId);
|
|
7488
7510
|
|
|
7511
|
+
if (sessionId in this.audioElements) {
|
|
7512
|
+
logger.info('html element already exists for session', { sessionId });
|
|
7513
|
+
return;
|
|
7514
|
+
}
|
|
7515
|
+
|
|
7489
7516
|
if (this._hasAudio() && this._isWeb() && !(sessionId in this.audioElements)) {
|
|
7490
7517
|
this.createAudioElementFor(sessionId);
|
|
7491
7518
|
}
|
|
7492
7519
|
|
|
7493
7520
|
const audioElement = this.audioElements[sessionId];
|
|
7494
|
-
const
|
|
7521
|
+
const sipSession = this.sipSessions[session.callId];
|
|
7522
|
+
const removeStream = this.getRemoteStream(sessionId);
|
|
7523
|
+
const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
|
|
7495
7524
|
|
|
7496
7525
|
if (!this._isWeb() || !stream) {
|
|
7497
7526
|
return;
|
|
@@ -4781,10 +4781,13 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
4781
4781
|
createRoom: async (name , users ) =>
|
|
4782
4782
|
client.post(`${baseUrl}/users/me/rooms`, { name, users }).then(ChatRoom.parse),
|
|
4783
4783
|
|
|
4784
|
-
getRoomMessages: async (roomUuid ) =>
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4784
|
+
getRoomMessages: async (roomUuid , params = {}) => {
|
|
4785
|
+
const qs = ApiRequester.getQueryString(params);
|
|
4786
|
+
|
|
4787
|
+
return client
|
|
4788
|
+
.get(`${baseUrl}/users/me/rooms/${roomUuid}/messages${qs.length ? `?${qs}` : ''}`)
|
|
4789
|
+
.then((response ) => ChatMessage.parseMany(response));
|
|
4790
|
+
},
|
|
4788
4791
|
|
|
4789
4792
|
sendRoomMessage: async (roomUuid , message ) =>
|
|
4790
4793
|
client.post(`${baseUrl}/users/me/rooms/${roomUuid}/messages`, message).then(ChatMessage.parse),
|
|
@@ -5605,6 +5608,7 @@ const MESSAGE = 'message';
|
|
|
5605
5608
|
const ACCEPTED = 'accepted';
|
|
5606
5609
|
const REJECTED = 'rejected';
|
|
5607
5610
|
const ON_TRACK = 'onTrack';
|
|
5611
|
+
const ON_EARLY_MEDIA = 'onEarlyMedia';
|
|
5608
5612
|
const ON_REINVITE = 'reinvite';
|
|
5609
5613
|
const ON_ERROR = 'onError';
|
|
5610
5614
|
const ON_SCREEN_SHARING_REINVITE = 'onScreenSharingReinvite';
|
|
@@ -5685,6 +5689,7 @@ class WebRTCClient extends Emitter {
|
|
|
5685
5689
|
|
|
5686
5690
|
|
|
5687
5691
|
|
|
5692
|
+
|
|
5688
5693
|
|
|
5689
5694
|
|
|
5690
5695
|
static isAPrivateIp(ip ) {
|
|
@@ -5753,6 +5758,7 @@ class WebRTCClient extends Emitter {
|
|
|
5753
5758
|
this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
|
|
5754
5759
|
this.ON_NETWORK_STATS = ON_NETWORK_STATS;
|
|
5755
5760
|
this.ON_DISCONNECTED = ON_DISCONNECTED;
|
|
5761
|
+
this.ON_EARLY_MEDIA = ON_EARLY_MEDIA;
|
|
5756
5762
|
}
|
|
5757
5763
|
|
|
5758
5764
|
configureMedia(media ) {
|
|
@@ -6040,6 +6046,11 @@ class WebRTCClient extends Emitter {
|
|
|
6040
6046
|
}
|
|
6041
6047
|
this._onAccepted(session, response.session, true);
|
|
6042
6048
|
},
|
|
6049
|
+
onProgress: (payload) => {
|
|
6050
|
+
if (payload.message.statusCode === 183) {
|
|
6051
|
+
this._onEarlyProgress(payload.session);
|
|
6052
|
+
}
|
|
6053
|
+
},
|
|
6043
6054
|
onReject: (response ) => {
|
|
6044
6055
|
logger.info('on call rejected', { id: session.id, fromTag: session.fromTag });
|
|
6045
6056
|
this._stopSendingStats(session);
|
|
@@ -7432,6 +7443,17 @@ class WebRTCClient extends Emitter {
|
|
|
7432
7443
|
};
|
|
7433
7444
|
}
|
|
7434
7445
|
|
|
7446
|
+
_onEarlyProgress(session ) {
|
|
7447
|
+
this._setupMedias(session);
|
|
7448
|
+
|
|
7449
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
7450
|
+
this.updateRemoteStream(sessionId);
|
|
7451
|
+
|
|
7452
|
+
logger.info('Early media progress progress received', { sessionId });
|
|
7453
|
+
|
|
7454
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA, session);
|
|
7455
|
+
}
|
|
7456
|
+
|
|
7435
7457
|
_onAccepted(session , sessionDialog , withEvent = true) {
|
|
7436
7458
|
logger.info('on call accepted', { id: session.id, remoteTag: session.remoteTag });
|
|
7437
7459
|
|
|
@@ -7483,15 +7505,22 @@ class WebRTCClient extends Emitter {
|
|
|
7483
7505
|
|
|
7484
7506
|
_setupMedias(session , newStream ) {
|
|
7485
7507
|
// Safari hack, because you cannot call .play() from a non user action
|
|
7486
|
-
const sessionId = this.getSipSessionId(session);
|
|
7508
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
7487
7509
|
const isConference = this.isConference(sessionId);
|
|
7488
7510
|
|
|
7511
|
+
if (sessionId in this.audioElements) {
|
|
7512
|
+
logger.info('html element already exists for session', { sessionId });
|
|
7513
|
+
return;
|
|
7514
|
+
}
|
|
7515
|
+
|
|
7489
7516
|
if (this._hasAudio() && this._isWeb() && !(sessionId in this.audioElements)) {
|
|
7490
7517
|
this.createAudioElementFor(sessionId);
|
|
7491
7518
|
}
|
|
7492
7519
|
|
|
7493
7520
|
const audioElement = this.audioElements[sessionId];
|
|
7494
|
-
const
|
|
7521
|
+
const sipSession = this.sipSessions[session.callId];
|
|
7522
|
+
const removeStream = this.getRemoteStream(sessionId);
|
|
7523
|
+
const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
|
|
7495
7524
|
|
|
7496
7525
|
if (!this._isWeb() || !stream) {
|
|
7497
7526
|
return;
|
|
@@ -4186,10 +4186,13 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
4186
4186
|
createRoom: async (name , users ) =>
|
|
4187
4187
|
client.post(`${baseUrl}/users/me/rooms`, { name, users }).then(ChatRoom.parse),
|
|
4188
4188
|
|
|
4189
|
-
getRoomMessages: async (roomUuid ) =>
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4189
|
+
getRoomMessages: async (roomUuid , params = {}) => {
|
|
4190
|
+
const qs = ApiRequester.getQueryString(params);
|
|
4191
|
+
|
|
4192
|
+
return client
|
|
4193
|
+
.get(`${baseUrl}/users/me/rooms/${roomUuid}/messages${qs.length ? `?${qs}` : ''}`)
|
|
4194
|
+
.then((response ) => ChatMessage.parseMany(response));
|
|
4195
|
+
},
|
|
4193
4196
|
|
|
4194
4197
|
sendRoomMessage: async (roomUuid , message ) =>
|
|
4195
4198
|
client.post(`${baseUrl}/users/me/rooms/${roomUuid}/messages`, message).then(ChatMessage.parse),
|
package/esm/domain/Features.js
CHANGED
|
@@ -4186,10 +4186,13 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
4186
4186
|
createRoom: async (name , users ) =>
|
|
4187
4187
|
client.post(`${baseUrl}/users/me/rooms`, { name, users }).then(ChatRoom.parse),
|
|
4188
4188
|
|
|
4189
|
-
getRoomMessages: async (roomUuid ) =>
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4189
|
+
getRoomMessages: async (roomUuid , params = {}) => {
|
|
4190
|
+
const qs = ApiRequester.getQueryString(params);
|
|
4191
|
+
|
|
4192
|
+
return client
|
|
4193
|
+
.get(`${baseUrl}/users/me/rooms/${roomUuid}/messages${qs.length ? `?${qs}` : ''}`)
|
|
4194
|
+
.then((response ) => ChatMessage.parseMany(response));
|
|
4195
|
+
},
|
|
4193
4196
|
|
|
4194
4197
|
sendRoomMessage: async (roomUuid , message ) =>
|
|
4195
4198
|
client.post(`${baseUrl}/users/me/rooms/${roomUuid}/messages`, message).then(ChatMessage.parse),
|
|
@@ -4531,10 +4531,13 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
4531
4531
|
createRoom: async (name , users ) =>
|
|
4532
4532
|
client.post(`${baseUrl}/users/me/rooms`, { name, users }).then(ChatRoom.parse),
|
|
4533
4533
|
|
|
4534
|
-
getRoomMessages: async (roomUuid ) =>
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4534
|
+
getRoomMessages: async (roomUuid , params = {}) => {
|
|
4535
|
+
const qs = ApiRequester.getQueryString(params);
|
|
4536
|
+
|
|
4537
|
+
return client
|
|
4538
|
+
.get(`${baseUrl}/users/me/rooms/${roomUuid}/messages${qs.length ? `?${qs}` : ''}`)
|
|
4539
|
+
.then((response ) => ChatMessage.parseMany(response));
|
|
4540
|
+
},
|
|
4538
4541
|
|
|
4539
4542
|
sendRoomMessage: async (roomUuid , message ) =>
|
|
4540
4543
|
client.post(`${baseUrl}/users/me/rooms/${roomUuid}/messages`, message).then(ChatMessage.parse),
|