@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/web-rtc-client.js
CHANGED
|
@@ -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';
|
|
@@ -5688,6 +5692,7 @@ class WebRTCClient extends Emitter {
|
|
|
5688
5692
|
|
|
5689
5693
|
|
|
5690
5694
|
|
|
5695
|
+
|
|
5691
5696
|
|
|
5692
5697
|
|
|
5693
5698
|
static isAPrivateIp(ip ) {
|
|
@@ -5756,6 +5761,7 @@ class WebRTCClient extends Emitter {
|
|
|
5756
5761
|
this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
|
|
5757
5762
|
this.ON_NETWORK_STATS = ON_NETWORK_STATS;
|
|
5758
5763
|
this.ON_DISCONNECTED = ON_DISCONNECTED;
|
|
5764
|
+
this.ON_EARLY_MEDIA = ON_EARLY_MEDIA;
|
|
5759
5765
|
}
|
|
5760
5766
|
|
|
5761
5767
|
configureMedia(media ) {
|
|
@@ -6043,6 +6049,11 @@ class WebRTCClient extends Emitter {
|
|
|
6043
6049
|
}
|
|
6044
6050
|
this._onAccepted(session, response.session, true);
|
|
6045
6051
|
},
|
|
6052
|
+
onProgress: (payload) => {
|
|
6053
|
+
if (payload.message.statusCode === 183) {
|
|
6054
|
+
this._onEarlyProgress(payload.session);
|
|
6055
|
+
}
|
|
6056
|
+
},
|
|
6046
6057
|
onReject: (response ) => {
|
|
6047
6058
|
logger.info('on call rejected', { id: session.id, fromTag: session.fromTag });
|
|
6048
6059
|
this._stopSendingStats(session);
|
|
@@ -7435,6 +7446,17 @@ class WebRTCClient extends Emitter {
|
|
|
7435
7446
|
};
|
|
7436
7447
|
}
|
|
7437
7448
|
|
|
7449
|
+
_onEarlyProgress(session ) {
|
|
7450
|
+
this._setupMedias(session);
|
|
7451
|
+
|
|
7452
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
7453
|
+
this.updateRemoteStream(sessionId);
|
|
7454
|
+
|
|
7455
|
+
logger.info('Early media progress progress received', { sessionId });
|
|
7456
|
+
|
|
7457
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA, session);
|
|
7458
|
+
}
|
|
7459
|
+
|
|
7438
7460
|
_onAccepted(session , sessionDialog , withEvent = true) {
|
|
7439
7461
|
logger.info('on call accepted', { id: session.id, remoteTag: session.remoteTag });
|
|
7440
7462
|
|
|
@@ -7486,15 +7508,22 @@ class WebRTCClient extends Emitter {
|
|
|
7486
7508
|
|
|
7487
7509
|
_setupMedias(session , newStream ) {
|
|
7488
7510
|
// Safari hack, because you cannot call .play() from a non user action
|
|
7489
|
-
const sessionId = this.getSipSessionId(session);
|
|
7511
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
7490
7512
|
const isConference = this.isConference(sessionId);
|
|
7491
7513
|
|
|
7514
|
+
if (sessionId in this.audioElements) {
|
|
7515
|
+
logger.info('html element already exists for session', { sessionId });
|
|
7516
|
+
return;
|
|
7517
|
+
}
|
|
7518
|
+
|
|
7492
7519
|
if (this._hasAudio() && this._isWeb() && !(sessionId in this.audioElements)) {
|
|
7493
7520
|
this.createAudioElementFor(sessionId);
|
|
7494
7521
|
}
|
|
7495
7522
|
|
|
7496
7523
|
const audioElement = this.audioElements[sessionId];
|
|
7497
|
-
const
|
|
7524
|
+
const sipSession = this.sipSessions[session.callId];
|
|
7525
|
+
const removeStream = this.getRemoteStream(sessionId);
|
|
7526
|
+
const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
|
|
7498
7527
|
|
|
7499
7528
|
if (!this._isWeb() || !stream) {
|
|
7500
7529
|
return;
|
|
@@ -4210,10 +4210,13 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
4210
4210
|
createRoom: async (name , users ) =>
|
|
4211
4211
|
client.post(`${baseUrl}/users/me/rooms`, { name, users }).then(ChatRoom.parse),
|
|
4212
4212
|
|
|
4213
|
-
getRoomMessages: async (roomUuid ) =>
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4213
|
+
getRoomMessages: async (roomUuid , params = {}) => {
|
|
4214
|
+
const qs = ApiRequester.getQueryString(params);
|
|
4215
|
+
|
|
4216
|
+
return client
|
|
4217
|
+
.get(`${baseUrl}/users/me/rooms/${roomUuid}/messages${qs.length ? `?${qs}` : ''}`)
|
|
4218
|
+
.then((response ) => ChatMessage.parseMany(response));
|
|
4219
|
+
},
|
|
4217
4220
|
|
|
4218
4221
|
sendRoomMessage: async (roomUuid , message ) =>
|
|
4219
4222
|
client.post(`${baseUrl}/users/me/rooms/${roomUuid}/messages`, message).then(ChatMessage.parse),
|
|
@@ -4790,10 +4790,13 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
4790
4790
|
createRoom: async (name , users ) =>
|
|
4791
4791
|
client.post(`${baseUrl}/users/me/rooms`, { name, users }).then(ChatRoom.parse),
|
|
4792
4792
|
|
|
4793
|
-
getRoomMessages: async (roomUuid ) =>
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4793
|
+
getRoomMessages: async (roomUuid , params = {}) => {
|
|
4794
|
+
const qs = ApiRequester.getQueryString(params);
|
|
4795
|
+
|
|
4796
|
+
return client
|
|
4797
|
+
.get(`${baseUrl}/users/me/rooms/${roomUuid}/messages${qs.length ? `?${qs}` : ''}`)
|
|
4798
|
+
.then((response ) => ChatMessage.parseMany(response));
|
|
4799
|
+
},
|
|
4797
4800
|
|
|
4798
4801
|
sendRoomMessage: async (roomUuid , message ) =>
|
|
4799
4802
|
client.post(`${baseUrl}/users/me/rooms/${roomUuid}/messages`, message).then(ChatMessage.parse),
|
|
@@ -5614,6 +5617,7 @@ const MESSAGE = 'message';
|
|
|
5614
5617
|
const ACCEPTED = 'accepted';
|
|
5615
5618
|
const REJECTED = 'rejected';
|
|
5616
5619
|
const ON_TRACK = 'onTrack';
|
|
5620
|
+
const ON_EARLY_MEDIA = 'onEarlyMedia';
|
|
5617
5621
|
const ON_REINVITE = 'reinvite';
|
|
5618
5622
|
const ON_ERROR = 'onError';
|
|
5619
5623
|
const ON_SCREEN_SHARING_REINVITE = 'onScreenSharingReinvite';
|
|
@@ -5694,6 +5698,7 @@ class WebRTCClient extends Emitter {
|
|
|
5694
5698
|
|
|
5695
5699
|
|
|
5696
5700
|
|
|
5701
|
+
|
|
5697
5702
|
|
|
5698
5703
|
|
|
5699
5704
|
static isAPrivateIp(ip ) {
|
|
@@ -5762,6 +5767,7 @@ class WebRTCClient extends Emitter {
|
|
|
5762
5767
|
this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
|
|
5763
5768
|
this.ON_NETWORK_STATS = ON_NETWORK_STATS;
|
|
5764
5769
|
this.ON_DISCONNECTED = ON_DISCONNECTED;
|
|
5770
|
+
this.ON_EARLY_MEDIA = ON_EARLY_MEDIA;
|
|
5765
5771
|
}
|
|
5766
5772
|
|
|
5767
5773
|
configureMedia(media ) {
|
|
@@ -6049,6 +6055,11 @@ class WebRTCClient extends Emitter {
|
|
|
6049
6055
|
}
|
|
6050
6056
|
this._onAccepted(session, response.session, true);
|
|
6051
6057
|
},
|
|
6058
|
+
onProgress: (payload) => {
|
|
6059
|
+
if (payload.message.statusCode === 183) {
|
|
6060
|
+
this._onEarlyProgress(payload.session);
|
|
6061
|
+
}
|
|
6062
|
+
},
|
|
6052
6063
|
onReject: (response ) => {
|
|
6053
6064
|
logger.info('on call rejected', { id: session.id, fromTag: session.fromTag });
|
|
6054
6065
|
this._stopSendingStats(session);
|
|
@@ -7441,6 +7452,17 @@ class WebRTCClient extends Emitter {
|
|
|
7441
7452
|
};
|
|
7442
7453
|
}
|
|
7443
7454
|
|
|
7455
|
+
_onEarlyProgress(session ) {
|
|
7456
|
+
this._setupMedias(session);
|
|
7457
|
+
|
|
7458
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
7459
|
+
this.updateRemoteStream(sessionId);
|
|
7460
|
+
|
|
7461
|
+
logger.info('Early media progress progress received', { sessionId });
|
|
7462
|
+
|
|
7463
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA, session);
|
|
7464
|
+
}
|
|
7465
|
+
|
|
7444
7466
|
_onAccepted(session , sessionDialog , withEvent = true) {
|
|
7445
7467
|
logger.info('on call accepted', { id: session.id, remoteTag: session.remoteTag });
|
|
7446
7468
|
|
|
@@ -7492,15 +7514,22 @@ class WebRTCClient extends Emitter {
|
|
|
7492
7514
|
|
|
7493
7515
|
_setupMedias(session , newStream ) {
|
|
7494
7516
|
// Safari hack, because you cannot call .play() from a non user action
|
|
7495
|
-
const sessionId = this.getSipSessionId(session);
|
|
7517
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
7496
7518
|
const isConference = this.isConference(sessionId);
|
|
7497
7519
|
|
|
7520
|
+
if (sessionId in this.audioElements) {
|
|
7521
|
+
logger.info('html element already exists for session', { sessionId });
|
|
7522
|
+
return;
|
|
7523
|
+
}
|
|
7524
|
+
|
|
7498
7525
|
if (this._hasAudio() && this._isWeb() && !(sessionId in this.audioElements)) {
|
|
7499
7526
|
this.createAudioElementFor(sessionId);
|
|
7500
7527
|
}
|
|
7501
7528
|
|
|
7502
7529
|
const audioElement = this.audioElements[sessionId];
|
|
7503
|
-
const
|
|
7530
|
+
const sipSession = this.sipSessions[session.callId];
|
|
7531
|
+
const removeStream = this.getRemoteStream(sessionId);
|
|
7532
|
+
const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
|
|
7504
7533
|
|
|
7505
7534
|
if (!this._isWeb() || !stream) {
|
|
7506
7535
|
return;
|
package/lib/api/chatd.js
CHANGED
|
@@ -1302,10 +1302,13 @@ var chatd = (client , baseUrl ) => ({
|
|
|
1302
1302
|
createRoom: async (name , users ) =>
|
|
1303
1303
|
client.post(`${baseUrl}/users/me/rooms`, { name, users }).then(ChatRoom.parse),
|
|
1304
1304
|
|
|
1305
|
-
getRoomMessages: async (roomUuid ) =>
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1305
|
+
getRoomMessages: async (roomUuid , params = {}) => {
|
|
1306
|
+
const qs = ApiRequester.getQueryString(params);
|
|
1307
|
+
|
|
1308
|
+
return client
|
|
1309
|
+
.get(`${baseUrl}/users/me/rooms/${roomUuid}/messages${qs.length ? `?${qs}` : ''}`)
|
|
1310
|
+
.then((response ) => ChatMessage.parseMany(response));
|
|
1311
|
+
},
|
|
1309
1312
|
|
|
1310
1313
|
sendRoomMessage: async (roomUuid , message ) =>
|
|
1311
1314
|
client.post(`${baseUrl}/users/me/rooms/${roomUuid}/messages`, message).then(ChatMessage.parse),
|
package/lib/api-client.js
CHANGED
|
@@ -4210,10 +4210,13 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
4210
4210
|
createRoom: async (name , users ) =>
|
|
4211
4211
|
client.post(`${baseUrl}/users/me/rooms`, { name, users }).then(ChatRoom.parse),
|
|
4212
4212
|
|
|
4213
|
-
getRoomMessages: async (roomUuid ) =>
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4213
|
+
getRoomMessages: async (roomUuid , params = {}) => {
|
|
4214
|
+
const qs = ApiRequester.getQueryString(params);
|
|
4215
|
+
|
|
4216
|
+
return client
|
|
4217
|
+
.get(`${baseUrl}/users/me/rooms/${roomUuid}/messages${qs.length ? `?${qs}` : ''}`)
|
|
4218
|
+
.then((response ) => ChatMessage.parseMany(response));
|
|
4219
|
+
},
|
|
4217
4220
|
|
|
4218
4221
|
sendRoomMessage: async (roomUuid , message ) =>
|
|
4219
4222
|
client.post(`${baseUrl}/users/me/rooms/${roomUuid}/messages`, message).then(ChatMessage.parse),
|
package/lib/checker/Checker.js
CHANGED
|
@@ -4258,10 +4258,13 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
4258
4258
|
createRoom: async (name , users ) =>
|
|
4259
4259
|
client.post(`${baseUrl}/users/me/rooms`, { name, users }).then(ChatRoom.parse),
|
|
4260
4260
|
|
|
4261
|
-
getRoomMessages: async (roomUuid ) =>
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4261
|
+
getRoomMessages: async (roomUuid , params = {}) => {
|
|
4262
|
+
const qs = ApiRequester.getQueryString(params);
|
|
4263
|
+
|
|
4264
|
+
return client
|
|
4265
|
+
.get(`${baseUrl}/users/me/rooms/${roomUuid}/messages${qs.length ? `?${qs}` : ''}`)
|
|
4266
|
+
.then((response ) => ChatMessage.parseMany(response));
|
|
4267
|
+
},
|
|
4265
4268
|
|
|
4266
4269
|
sendRoomMessage: async (roomUuid , message ) =>
|
|
4267
4270
|
client.post(`${baseUrl}/users/me/rooms/${roomUuid}/messages`, message).then(ChatMessage.parse),
|
|
@@ -6202,6 +6205,7 @@ const MESSAGE = 'message';
|
|
|
6202
6205
|
const ACCEPTED = 'accepted';
|
|
6203
6206
|
const REJECTED = 'rejected';
|
|
6204
6207
|
const ON_TRACK = 'onTrack';
|
|
6208
|
+
const ON_EARLY_MEDIA = 'onEarlyMedia';
|
|
6205
6209
|
const ON_REINVITE = 'reinvite';
|
|
6206
6210
|
const ON_ERROR = 'onError';
|
|
6207
6211
|
const ON_SCREEN_SHARING_REINVITE = 'onScreenSharingReinvite';
|
|
@@ -6282,6 +6286,7 @@ class WebRTCClient extends Emitter {
|
|
|
6282
6286
|
|
|
6283
6287
|
|
|
6284
6288
|
|
|
6289
|
+
|
|
6285
6290
|
|
|
6286
6291
|
|
|
6287
6292
|
static isAPrivateIp(ip ) {
|
|
@@ -6350,6 +6355,7 @@ class WebRTCClient extends Emitter {
|
|
|
6350
6355
|
this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
|
|
6351
6356
|
this.ON_NETWORK_STATS = ON_NETWORK_STATS;
|
|
6352
6357
|
this.ON_DISCONNECTED = ON_DISCONNECTED;
|
|
6358
|
+
this.ON_EARLY_MEDIA = ON_EARLY_MEDIA;
|
|
6353
6359
|
}
|
|
6354
6360
|
|
|
6355
6361
|
configureMedia(media ) {
|
|
@@ -6637,6 +6643,11 @@ class WebRTCClient extends Emitter {
|
|
|
6637
6643
|
}
|
|
6638
6644
|
this._onAccepted(session, response.session, true);
|
|
6639
6645
|
},
|
|
6646
|
+
onProgress: (payload) => {
|
|
6647
|
+
if (payload.message.statusCode === 183) {
|
|
6648
|
+
this._onEarlyProgress(payload.session);
|
|
6649
|
+
}
|
|
6650
|
+
},
|
|
6640
6651
|
onReject: (response ) => {
|
|
6641
6652
|
logger$1.info('on call rejected', { id: session.id, fromTag: session.fromTag });
|
|
6642
6653
|
this._stopSendingStats(session);
|
|
@@ -8029,6 +8040,17 @@ class WebRTCClient extends Emitter {
|
|
|
8029
8040
|
};
|
|
8030
8041
|
}
|
|
8031
8042
|
|
|
8043
|
+
_onEarlyProgress(session ) {
|
|
8044
|
+
this._setupMedias(session);
|
|
8045
|
+
|
|
8046
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8047
|
+
this.updateRemoteStream(sessionId);
|
|
8048
|
+
|
|
8049
|
+
logger$1.info('Early media progress progress received', { sessionId });
|
|
8050
|
+
|
|
8051
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA, session);
|
|
8052
|
+
}
|
|
8053
|
+
|
|
8032
8054
|
_onAccepted(session , sessionDialog , withEvent = true) {
|
|
8033
8055
|
logger$1.info('on call accepted', { id: session.id, remoteTag: session.remoteTag });
|
|
8034
8056
|
|
|
@@ -8080,15 +8102,22 @@ class WebRTCClient extends Emitter {
|
|
|
8080
8102
|
|
|
8081
8103
|
_setupMedias(session , newStream ) {
|
|
8082
8104
|
// Safari hack, because you cannot call .play() from a non user action
|
|
8083
|
-
const sessionId = this.getSipSessionId(session);
|
|
8105
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8084
8106
|
const isConference = this.isConference(sessionId);
|
|
8085
8107
|
|
|
8108
|
+
if (sessionId in this.audioElements) {
|
|
8109
|
+
logger$1.info('html element already exists for session', { sessionId });
|
|
8110
|
+
return;
|
|
8111
|
+
}
|
|
8112
|
+
|
|
8086
8113
|
if (this._hasAudio() && this._isWeb() && !(sessionId in this.audioElements)) {
|
|
8087
8114
|
this.createAudioElementFor(sessionId);
|
|
8088
8115
|
}
|
|
8089
8116
|
|
|
8090
8117
|
const audioElement = this.audioElements[sessionId];
|
|
8091
|
-
const
|
|
8118
|
+
const sipSession = this.sipSessions[session.callId];
|
|
8119
|
+
const removeStream = this.getRemoteStream(sessionId);
|
|
8120
|
+
const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
|
|
8092
8121
|
|
|
8093
8122
|
if (!this._isWeb() || !stream) {
|
|
8094
8123
|
return;
|
|
@@ -4210,10 +4210,13 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
4210
4210
|
createRoom: async (name , users ) =>
|
|
4211
4211
|
client.post(`${baseUrl}/users/me/rooms`, { name, users }).then(ChatRoom.parse),
|
|
4212
4212
|
|
|
4213
|
-
getRoomMessages: async (roomUuid ) =>
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4213
|
+
getRoomMessages: async (roomUuid , params = {}) => {
|
|
4214
|
+
const qs = ApiRequester.getQueryString(params);
|
|
4215
|
+
|
|
4216
|
+
return client
|
|
4217
|
+
.get(`${baseUrl}/users/me/rooms/${roomUuid}/messages${qs.length ? `?${qs}` : ''}`)
|
|
4218
|
+
.then((response ) => ChatMessage.parseMany(response));
|
|
4219
|
+
},
|
|
4217
4220
|
|
|
4218
4221
|
sendRoomMessage: async (roomUuid , message ) =>
|
|
4219
4222
|
client.post(`${baseUrl}/users/me/rooms/${roomUuid}/messages`, message).then(ChatMessage.parse),
|
|
@@ -4210,10 +4210,13 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
4210
4210
|
createRoom: async (name , users ) =>
|
|
4211
4211
|
client.post(`${baseUrl}/users/me/rooms`, { name, users }).then(ChatRoom.parse),
|
|
4212
4212
|
|
|
4213
|
-
getRoomMessages: async (roomUuid ) =>
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4213
|
+
getRoomMessages: async (roomUuid , params = {}) => {
|
|
4214
|
+
const qs = ApiRequester.getQueryString(params);
|
|
4215
|
+
|
|
4216
|
+
return client
|
|
4217
|
+
.get(`${baseUrl}/users/me/rooms/${roomUuid}/messages${qs.length ? `?${qs}` : ''}`)
|
|
4218
|
+
.then((response ) => ChatMessage.parseMany(response));
|
|
4219
|
+
},
|
|
4217
4220
|
|
|
4218
4221
|
sendRoomMessage: async (roomUuid , message ) =>
|
|
4219
4222
|
client.post(`${baseUrl}/users/me/rooms/${roomUuid}/messages`, message).then(ChatMessage.parse),
|
|
@@ -4258,10 +4258,13 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
4258
4258
|
createRoom: async (name , users ) =>
|
|
4259
4259
|
client.post(`${baseUrl}/users/me/rooms`, { name, users }).then(ChatRoom.parse),
|
|
4260
4260
|
|
|
4261
|
-
getRoomMessages: async (roomUuid ) =>
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4261
|
+
getRoomMessages: async (roomUuid , params = {}) => {
|
|
4262
|
+
const qs = ApiRequester.getQueryString(params);
|
|
4263
|
+
|
|
4264
|
+
return client
|
|
4265
|
+
.get(`${baseUrl}/users/me/rooms/${roomUuid}/messages${qs.length ? `?${qs}` : ''}`)
|
|
4266
|
+
.then((response ) => ChatMessage.parseMany(response));
|
|
4267
|
+
},
|
|
4265
4268
|
|
|
4266
4269
|
sendRoomMessage: async (roomUuid , message ) =>
|
|
4267
4270
|
client.post(`${baseUrl}/users/me/rooms/${roomUuid}/messages`, message).then(ChatMessage.parse),
|
|
@@ -6202,6 +6205,7 @@ const MESSAGE = 'message';
|
|
|
6202
6205
|
const ACCEPTED = 'accepted';
|
|
6203
6206
|
const REJECTED = 'rejected';
|
|
6204
6207
|
const ON_TRACK = 'onTrack';
|
|
6208
|
+
const ON_EARLY_MEDIA = 'onEarlyMedia';
|
|
6205
6209
|
const ON_REINVITE = 'reinvite';
|
|
6206
6210
|
const ON_ERROR = 'onError';
|
|
6207
6211
|
const ON_SCREEN_SHARING_REINVITE = 'onScreenSharingReinvite';
|
|
@@ -6282,6 +6286,7 @@ class WebRTCClient extends Emitter {
|
|
|
6282
6286
|
|
|
6283
6287
|
|
|
6284
6288
|
|
|
6289
|
+
|
|
6285
6290
|
|
|
6286
6291
|
|
|
6287
6292
|
static isAPrivateIp(ip ) {
|
|
@@ -6350,6 +6355,7 @@ class WebRTCClient extends Emitter {
|
|
|
6350
6355
|
this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
|
|
6351
6356
|
this.ON_NETWORK_STATS = ON_NETWORK_STATS;
|
|
6352
6357
|
this.ON_DISCONNECTED = ON_DISCONNECTED;
|
|
6358
|
+
this.ON_EARLY_MEDIA = ON_EARLY_MEDIA;
|
|
6353
6359
|
}
|
|
6354
6360
|
|
|
6355
6361
|
configureMedia(media ) {
|
|
@@ -6637,6 +6643,11 @@ class WebRTCClient extends Emitter {
|
|
|
6637
6643
|
}
|
|
6638
6644
|
this._onAccepted(session, response.session, true);
|
|
6639
6645
|
},
|
|
6646
|
+
onProgress: (payload) => {
|
|
6647
|
+
if (payload.message.statusCode === 183) {
|
|
6648
|
+
this._onEarlyProgress(payload.session);
|
|
6649
|
+
}
|
|
6650
|
+
},
|
|
6640
6651
|
onReject: (response ) => {
|
|
6641
6652
|
logger.info('on call rejected', { id: session.id, fromTag: session.fromTag });
|
|
6642
6653
|
this._stopSendingStats(session);
|
|
@@ -8029,6 +8040,17 @@ class WebRTCClient extends Emitter {
|
|
|
8029
8040
|
};
|
|
8030
8041
|
}
|
|
8031
8042
|
|
|
8043
|
+
_onEarlyProgress(session ) {
|
|
8044
|
+
this._setupMedias(session);
|
|
8045
|
+
|
|
8046
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8047
|
+
this.updateRemoteStream(sessionId);
|
|
8048
|
+
|
|
8049
|
+
logger.info('Early media progress progress received', { sessionId });
|
|
8050
|
+
|
|
8051
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA, session);
|
|
8052
|
+
}
|
|
8053
|
+
|
|
8032
8054
|
_onAccepted(session , sessionDialog , withEvent = true) {
|
|
8033
8055
|
logger.info('on call accepted', { id: session.id, remoteTag: session.remoteTag });
|
|
8034
8056
|
|
|
@@ -8080,15 +8102,22 @@ class WebRTCClient extends Emitter {
|
|
|
8080
8102
|
|
|
8081
8103
|
_setupMedias(session , newStream ) {
|
|
8082
8104
|
// Safari hack, because you cannot call .play() from a non user action
|
|
8083
|
-
const sessionId = this.getSipSessionId(session);
|
|
8105
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
8084
8106
|
const isConference = this.isConference(sessionId);
|
|
8085
8107
|
|
|
8108
|
+
if (sessionId in this.audioElements) {
|
|
8109
|
+
logger.info('html element already exists for session', { sessionId });
|
|
8110
|
+
return;
|
|
8111
|
+
}
|
|
8112
|
+
|
|
8086
8113
|
if (this._hasAudio() && this._isWeb() && !(sessionId in this.audioElements)) {
|
|
8087
8114
|
this.createAudioElementFor(sessionId);
|
|
8088
8115
|
}
|
|
8089
8116
|
|
|
8090
8117
|
const audioElement = this.audioElements[sessionId];
|
|
8091
|
-
const
|
|
8118
|
+
const sipSession = this.sipSessions[session.callId];
|
|
8119
|
+
const removeStream = this.getRemoteStream(sessionId);
|
|
8120
|
+
const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
|
|
8092
8121
|
|
|
8093
8122
|
if (!this._isWeb() || !stream) {
|
|
8094
8123
|
return;
|
|
@@ -4790,10 +4790,13 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
4790
4790
|
createRoom: async (name , users ) =>
|
|
4791
4791
|
client.post(`${baseUrl}/users/me/rooms`, { name, users }).then(ChatRoom.parse),
|
|
4792
4792
|
|
|
4793
|
-
getRoomMessages: async (roomUuid ) =>
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4793
|
+
getRoomMessages: async (roomUuid , params = {}) => {
|
|
4794
|
+
const qs = ApiRequester.getQueryString(params);
|
|
4795
|
+
|
|
4796
|
+
return client
|
|
4797
|
+
.get(`${baseUrl}/users/me/rooms/${roomUuid}/messages${qs.length ? `?${qs}` : ''}`)
|
|
4798
|
+
.then((response ) => ChatMessage.parseMany(response));
|
|
4799
|
+
},
|
|
4797
4800
|
|
|
4798
4801
|
sendRoomMessage: async (roomUuid , message ) =>
|
|
4799
4802
|
client.post(`${baseUrl}/users/me/rooms/${roomUuid}/messages`, message).then(ChatMessage.parse),
|
|
@@ -5614,6 +5617,7 @@ const MESSAGE = 'message';
|
|
|
5614
5617
|
const ACCEPTED = 'accepted';
|
|
5615
5618
|
const REJECTED = 'rejected';
|
|
5616
5619
|
const ON_TRACK = 'onTrack';
|
|
5620
|
+
const ON_EARLY_MEDIA = 'onEarlyMedia';
|
|
5617
5621
|
const ON_REINVITE = 'reinvite';
|
|
5618
5622
|
const ON_ERROR = 'onError';
|
|
5619
5623
|
const ON_SCREEN_SHARING_REINVITE = 'onScreenSharingReinvite';
|
|
@@ -5694,6 +5698,7 @@ class WebRTCClient extends Emitter {
|
|
|
5694
5698
|
|
|
5695
5699
|
|
|
5696
5700
|
|
|
5701
|
+
|
|
5697
5702
|
|
|
5698
5703
|
|
|
5699
5704
|
static isAPrivateIp(ip ) {
|
|
@@ -5762,6 +5767,7 @@ class WebRTCClient extends Emitter {
|
|
|
5762
5767
|
this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
|
|
5763
5768
|
this.ON_NETWORK_STATS = ON_NETWORK_STATS;
|
|
5764
5769
|
this.ON_DISCONNECTED = ON_DISCONNECTED;
|
|
5770
|
+
this.ON_EARLY_MEDIA = ON_EARLY_MEDIA;
|
|
5765
5771
|
}
|
|
5766
5772
|
|
|
5767
5773
|
configureMedia(media ) {
|
|
@@ -6049,6 +6055,11 @@ class WebRTCClient extends Emitter {
|
|
|
6049
6055
|
}
|
|
6050
6056
|
this._onAccepted(session, response.session, true);
|
|
6051
6057
|
},
|
|
6058
|
+
onProgress: (payload) => {
|
|
6059
|
+
if (payload.message.statusCode === 183) {
|
|
6060
|
+
this._onEarlyProgress(payload.session);
|
|
6061
|
+
}
|
|
6062
|
+
},
|
|
6052
6063
|
onReject: (response ) => {
|
|
6053
6064
|
logger.info('on call rejected', { id: session.id, fromTag: session.fromTag });
|
|
6054
6065
|
this._stopSendingStats(session);
|
|
@@ -7441,6 +7452,17 @@ class WebRTCClient extends Emitter {
|
|
|
7441
7452
|
};
|
|
7442
7453
|
}
|
|
7443
7454
|
|
|
7455
|
+
_onEarlyProgress(session ) {
|
|
7456
|
+
this._setupMedias(session);
|
|
7457
|
+
|
|
7458
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
7459
|
+
this.updateRemoteStream(sessionId);
|
|
7460
|
+
|
|
7461
|
+
logger.info('Early media progress progress received', { sessionId });
|
|
7462
|
+
|
|
7463
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA, session);
|
|
7464
|
+
}
|
|
7465
|
+
|
|
7444
7466
|
_onAccepted(session , sessionDialog , withEvent = true) {
|
|
7445
7467
|
logger.info('on call accepted', { id: session.id, remoteTag: session.remoteTag });
|
|
7446
7468
|
|
|
@@ -7492,15 +7514,22 @@ class WebRTCClient extends Emitter {
|
|
|
7492
7514
|
|
|
7493
7515
|
_setupMedias(session , newStream ) {
|
|
7494
7516
|
// Safari hack, because you cannot call .play() from a non user action
|
|
7495
|
-
const sessionId = this.getSipSessionId(session);
|
|
7517
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
7496
7518
|
const isConference = this.isConference(sessionId);
|
|
7497
7519
|
|
|
7520
|
+
if (sessionId in this.audioElements) {
|
|
7521
|
+
logger.info('html element already exists for session', { sessionId });
|
|
7522
|
+
return;
|
|
7523
|
+
}
|
|
7524
|
+
|
|
7498
7525
|
if (this._hasAudio() && this._isWeb() && !(sessionId in this.audioElements)) {
|
|
7499
7526
|
this.createAudioElementFor(sessionId);
|
|
7500
7527
|
}
|
|
7501
7528
|
|
|
7502
7529
|
const audioElement = this.audioElements[sessionId];
|
|
7503
|
-
const
|
|
7530
|
+
const sipSession = this.sipSessions[session.callId];
|
|
7531
|
+
const removeStream = this.getRemoteStream(sessionId);
|
|
7532
|
+
const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
|
|
7504
7533
|
|
|
7505
7534
|
if (!this._isWeb() || !stream) {
|
|
7506
7535
|
return;
|
|
@@ -4790,10 +4790,13 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
4790
4790
|
createRoom: async (name , users ) =>
|
|
4791
4791
|
client.post(`${baseUrl}/users/me/rooms`, { name, users }).then(ChatRoom.parse),
|
|
4792
4792
|
|
|
4793
|
-
getRoomMessages: async (roomUuid ) =>
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4793
|
+
getRoomMessages: async (roomUuid , params = {}) => {
|
|
4794
|
+
const qs = ApiRequester.getQueryString(params);
|
|
4795
|
+
|
|
4796
|
+
return client
|
|
4797
|
+
.get(`${baseUrl}/users/me/rooms/${roomUuid}/messages${qs.length ? `?${qs}` : ''}`)
|
|
4798
|
+
.then((response ) => ChatMessage.parseMany(response));
|
|
4799
|
+
},
|
|
4797
4800
|
|
|
4798
4801
|
sendRoomMessage: async (roomUuid , message ) =>
|
|
4799
4802
|
client.post(`${baseUrl}/users/me/rooms/${roomUuid}/messages`, message).then(ChatMessage.parse),
|
|
@@ -5614,6 +5617,7 @@ const MESSAGE = 'message';
|
|
|
5614
5617
|
const ACCEPTED = 'accepted';
|
|
5615
5618
|
const REJECTED = 'rejected';
|
|
5616
5619
|
const ON_TRACK = 'onTrack';
|
|
5620
|
+
const ON_EARLY_MEDIA = 'onEarlyMedia';
|
|
5617
5621
|
const ON_REINVITE = 'reinvite';
|
|
5618
5622
|
const ON_ERROR = 'onError';
|
|
5619
5623
|
const ON_SCREEN_SHARING_REINVITE = 'onScreenSharingReinvite';
|
|
@@ -5694,6 +5698,7 @@ class WebRTCClient extends Emitter {
|
|
|
5694
5698
|
|
|
5695
5699
|
|
|
5696
5700
|
|
|
5701
|
+
|
|
5697
5702
|
|
|
5698
5703
|
|
|
5699
5704
|
static isAPrivateIp(ip ) {
|
|
@@ -5762,6 +5767,7 @@ class WebRTCClient extends Emitter {
|
|
|
5762
5767
|
this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
|
|
5763
5768
|
this.ON_NETWORK_STATS = ON_NETWORK_STATS;
|
|
5764
5769
|
this.ON_DISCONNECTED = ON_DISCONNECTED;
|
|
5770
|
+
this.ON_EARLY_MEDIA = ON_EARLY_MEDIA;
|
|
5765
5771
|
}
|
|
5766
5772
|
|
|
5767
5773
|
configureMedia(media ) {
|
|
@@ -6049,6 +6055,11 @@ class WebRTCClient extends Emitter {
|
|
|
6049
6055
|
}
|
|
6050
6056
|
this._onAccepted(session, response.session, true);
|
|
6051
6057
|
},
|
|
6058
|
+
onProgress: (payload) => {
|
|
6059
|
+
if (payload.message.statusCode === 183) {
|
|
6060
|
+
this._onEarlyProgress(payload.session);
|
|
6061
|
+
}
|
|
6062
|
+
},
|
|
6052
6063
|
onReject: (response ) => {
|
|
6053
6064
|
logger.info('on call rejected', { id: session.id, fromTag: session.fromTag });
|
|
6054
6065
|
this._stopSendingStats(session);
|
|
@@ -7441,6 +7452,17 @@ class WebRTCClient extends Emitter {
|
|
|
7441
7452
|
};
|
|
7442
7453
|
}
|
|
7443
7454
|
|
|
7455
|
+
_onEarlyProgress(session ) {
|
|
7456
|
+
this._setupMedias(session);
|
|
7457
|
+
|
|
7458
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
7459
|
+
this.updateRemoteStream(sessionId);
|
|
7460
|
+
|
|
7461
|
+
logger.info('Early media progress progress received', { sessionId });
|
|
7462
|
+
|
|
7463
|
+
this.eventEmitter.emit(ON_EARLY_MEDIA, session);
|
|
7464
|
+
}
|
|
7465
|
+
|
|
7444
7466
|
_onAccepted(session , sessionDialog , withEvent = true) {
|
|
7445
7467
|
logger.info('on call accepted', { id: session.id, remoteTag: session.remoteTag });
|
|
7446
7468
|
|
|
@@ -7492,15 +7514,22 @@ class WebRTCClient extends Emitter {
|
|
|
7492
7514
|
|
|
7493
7515
|
_setupMedias(session , newStream ) {
|
|
7494
7516
|
// Safari hack, because you cannot call .play() from a non user action
|
|
7495
|
-
const sessionId = this.getSipSessionId(session);
|
|
7517
|
+
const sessionId = this.getSipSessionId(session).substr(0, 20);
|
|
7496
7518
|
const isConference = this.isConference(sessionId);
|
|
7497
7519
|
|
|
7520
|
+
if (sessionId in this.audioElements) {
|
|
7521
|
+
logger.info('html element already exists for session', { sessionId });
|
|
7522
|
+
return;
|
|
7523
|
+
}
|
|
7524
|
+
|
|
7498
7525
|
if (this._hasAudio() && this._isWeb() && !(sessionId in this.audioElements)) {
|
|
7499
7526
|
this.createAudioElementFor(sessionId);
|
|
7500
7527
|
}
|
|
7501
7528
|
|
|
7502
7529
|
const audioElement = this.audioElements[sessionId];
|
|
7503
|
-
const
|
|
7530
|
+
const sipSession = this.sipSessions[session.callId];
|
|
7531
|
+
const removeStream = this.getRemoteStream(sessionId);
|
|
7532
|
+
const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
|
|
7504
7533
|
|
|
7505
7534
|
if (!this._isWeb() || !stream) {
|
|
7506
7535
|
return;
|