@wazo/sdk 0.37.28 → 0.37.32
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/README.md +2 -1
- package/dist/wazo-sdk.js +4 -4
- package/esm/__tests__/api-client.test.js +30 -0
- package/esm/__tests__/web-rtc-client.test.js +65 -6
- package/esm/api/calld.js +30 -0
- package/esm/api-client.js +30 -0
- package/esm/checker/Checker.js +65 -6
- package/esm/checker/checks/aor.js +30 -0
- package/esm/checker/checks/api.js +30 -0
- package/esm/checker/checks/index.js +65 -6
- package/esm/checker/checks/webrtc-transport.js +65 -6
- package/esm/checker/checks/webrtc.js +65 -6
- package/esm/domain/AdHocAPIConference.js +30 -0
- package/esm/domain/CallSession.js +15 -3
- package/esm/domain/Features.js +30 -0
- package/esm/domain/MeetingStatus.js +29 -0
- package/esm/domain/Phone/CTIPhone.js +45 -3
- package/esm/domain/Phone/WebRTCPhone.js +28 -6
- package/esm/domain/__tests__/CallSession.test.js +32 -3
- package/esm/domain/__tests__/IndirectTransfer.test.js +15 -3
- package/esm/domain/__tests__/Room.test.js +15 -3
- package/esm/index.js +93 -12
- package/esm/service/CallApi.js +30 -0
- package/esm/service/getApiClient.js +30 -0
- package/esm/simple/Auth.js +93 -12
- package/esm/simple/Configuration.js +93 -12
- package/esm/simple/Directory.js +30 -0
- package/esm/simple/Phone.js +93 -12
- package/esm/simple/index.js +93 -12
- package/esm/simple/room/LocalParticipant.js +93 -12
- package/esm/simple/room/Participant.js +93 -12
- package/esm/simple/room/RemoteParticipant.js +93 -12
- package/esm/simple/room/Room.js +93 -12
- package/esm/simple/room/SipRoom.js +93 -12
- package/esm/simple/room/Stream.js +93 -12
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +93 -12
- package/esm/simple/utils.js +93 -12
- package/esm/web-rtc-client.js +65 -6
- package/lib/__tests__/api-client.test.js +30 -0
- package/lib/__tests__/web-rtc-client.test.js +65 -6
- package/lib/api/calld.js +30 -0
- package/lib/api-client.js +30 -0
- package/lib/checker/Checker.js +65 -6
- package/lib/checker/checks/aor.js +30 -0
- package/lib/checker/checks/api.js +30 -0
- package/lib/checker/checks/index.js +65 -6
- package/lib/checker/checks/webrtc-transport.js +65 -6
- package/lib/checker/checks/webrtc.js +65 -6
- package/lib/domain/AdHocAPIConference.js +30 -0
- package/lib/domain/CallSession.js +15 -3
- package/lib/domain/Features.js +30 -0
- package/lib/domain/MeetingStatus.js +31 -0
- package/lib/domain/Phone/CTIPhone.js +45 -3
- package/lib/domain/Phone/WebRTCPhone.js +28 -6
- package/lib/domain/__tests__/CallSession.test.js +32 -3
- package/lib/domain/__tests__/IndirectTransfer.test.js +15 -3
- package/lib/domain/__tests__/Room.test.js +15 -3
- package/lib/index.js +93 -12
- package/lib/service/CallApi.js +30 -0
- package/lib/service/getApiClient.js +30 -0
- package/lib/simple/Auth.js +93 -12
- package/lib/simple/Configuration.js +93 -12
- package/lib/simple/Directory.js +30 -0
- package/lib/simple/Phone.js +93 -12
- package/lib/simple/index.js +93 -12
- package/lib/simple/room/LocalParticipant.js +93 -12
- package/lib/simple/room/Participant.js +93 -12
- package/lib/simple/room/RemoteParticipant.js +93 -12
- package/lib/simple/room/Room.js +93 -12
- package/lib/simple/room/SipRoom.js +93 -12
- package/lib/simple/room/Stream.js +93 -12
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +93 -12
- package/lib/simple/utils.js +93 -12
- package/lib/web-rtc-client.js +65 -6
- package/package.json +1 -1
- package/src/api/calld.js +3 -0
- package/src/domain/CallSession.js +16 -4
- package/src/domain/MeetingStatus.js +27 -0
- package/src/domain/Phone/WebRTCPhone.js +13 -3
- package/src/domain/__tests__/CallSession.test.js +17 -0
- package/src/web-rtc-client.js +35 -6
|
@@ -4579,6 +4579,34 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
4579
4579
|
client.get(`${baseUrl}/users/me/rooms/messages`, options),
|
|
4580
4580
|
});
|
|
4581
4581
|
|
|
4582
|
+
//
|
|
4583
|
+
|
|
4584
|
+
|
|
4585
|
+
|
|
4586
|
+
|
|
4587
|
+
|
|
4588
|
+
class MeetingStatus {
|
|
4589
|
+
|
|
4590
|
+
|
|
4591
|
+
|
|
4592
|
+
|
|
4593
|
+
constructor({
|
|
4594
|
+
full,
|
|
4595
|
+
} = {}) {
|
|
4596
|
+
this.full = full;
|
|
4597
|
+
|
|
4598
|
+
// Useful to compare instead of instanceof with minified code
|
|
4599
|
+
this.type = 'MeetingStatus';
|
|
4600
|
+
}
|
|
4601
|
+
|
|
4602
|
+
static parse(plain ) {
|
|
4603
|
+
return new MeetingStatus({
|
|
4604
|
+
full: plain.full,
|
|
4605
|
+
});
|
|
4606
|
+
}
|
|
4607
|
+
|
|
4608
|
+
}
|
|
4609
|
+
|
|
4582
4610
|
/* */
|
|
4583
4611
|
|
|
4584
4612
|
|
|
@@ -4773,6 +4801,8 @@ var calldMethods = (client , baseUrl ) => ({
|
|
|
4773
4801
|
client.put(`${baseUrl}/users/me/calls/${callId}/record/resume`, null, null,
|
|
4774
4802
|
ApiRequester.successResponseParser),
|
|
4775
4803
|
|
|
4804
|
+
guestGetMeetingStatus: (meetingUuid ) =>
|
|
4805
|
+
client.get(`${baseUrl}/guests/me/meetings/${meetingUuid}/status`).then(MeetingStatus.parse),
|
|
4776
4806
|
});
|
|
4777
4807
|
|
|
4778
4808
|
//
|
|
@@ -5344,6 +5374,7 @@ const MAX_REGISTER_TRIES = 10;
|
|
|
5344
5374
|
|
|
5345
5375
|
|
|
5346
5376
|
|
|
5377
|
+
|
|
5347
5378
|
|
|
5348
5379
|
|
|
5349
5380
|
|
|
@@ -5385,6 +5416,7 @@ class WebRTCClient extends Emitter {
|
|
|
5385
5416
|
|
|
5386
5417
|
|
|
5387
5418
|
|
|
5419
|
+
|
|
5388
5420
|
|
|
5389
5421
|
// sugar
|
|
5390
5422
|
|
|
@@ -5447,6 +5479,7 @@ class WebRTCClient extends Emitter {
|
|
|
5447
5479
|
this.conferences = {};
|
|
5448
5480
|
this.networkMonitoringInterval = {};
|
|
5449
5481
|
this.sessionNetworkStats = {};
|
|
5482
|
+
this.forceClosed = false;
|
|
5450
5483
|
|
|
5451
5484
|
this._boundOnHeartbeat = this._onHeartbeat.bind(this);
|
|
5452
5485
|
this.heartbeat = new Heartbeat(config.heartbeatDelay, config.heartbeatTimeout, config.maxHeartbeats);
|
|
@@ -5568,6 +5601,8 @@ class WebRTCClient extends Emitter {
|
|
|
5568
5601
|
skipRegister: this.skipRegister,
|
|
5569
5602
|
};
|
|
5570
5603
|
|
|
5604
|
+
this.forceClosed = false;
|
|
5605
|
+
|
|
5571
5606
|
if (this.skipRegister) {
|
|
5572
5607
|
logger.info('sdk webrtc skip register...', logInfo);
|
|
5573
5608
|
return Promise.resolve();
|
|
@@ -5592,7 +5627,15 @@ class WebRTCClient extends Emitter {
|
|
|
5592
5627
|
const registerOptions = this._isWeb() ? {} : { extraContactHeaderParams: ['mobility=mobile'] };
|
|
5593
5628
|
|
|
5594
5629
|
const onRegisterFailed = () => {
|
|
5595
|
-
logger.info('sdk webrtc registering failed', {
|
|
5630
|
+
logger.info('sdk webrtc registering failed', {
|
|
5631
|
+
tries,
|
|
5632
|
+
registerer: !!this.registerer,
|
|
5633
|
+
forceClosed: this.forceClosed,
|
|
5634
|
+
});
|
|
5635
|
+
if (this.forceClosed) {
|
|
5636
|
+
return;
|
|
5637
|
+
}
|
|
5638
|
+
|
|
5596
5639
|
this.connectionPromise = null;
|
|
5597
5640
|
if (this.registerer && this.registerer.waiting) {
|
|
5598
5641
|
this.registerer.waitingToggle(false);
|
|
@@ -5870,8 +5913,9 @@ class WebRTCClient extends Emitter {
|
|
|
5870
5913
|
}
|
|
5871
5914
|
}
|
|
5872
5915
|
|
|
5873
|
-
async close() {
|
|
5874
|
-
logger.info('sdk webrtc closing client', { userAgent: !!this.userAgent });
|
|
5916
|
+
async close(force = false) {
|
|
5917
|
+
logger.info('sdk webrtc closing client', { userAgent: !!this.userAgent, force });
|
|
5918
|
+
this.forceClosed = force;
|
|
5875
5919
|
this._cleanupMedia();
|
|
5876
5920
|
this.connectionPromise = null;
|
|
5877
5921
|
|
|
@@ -5890,7 +5934,7 @@ class WebRTCClient extends Emitter {
|
|
|
5890
5934
|
this.userAgent.delegate = null;
|
|
5891
5935
|
this.userAgent.stateChange.removeAllListeners();
|
|
5892
5936
|
|
|
5893
|
-
await this._disconnectTransport();
|
|
5937
|
+
await this._disconnectTransport(force);
|
|
5894
5938
|
|
|
5895
5939
|
this._cleanupRegister();
|
|
5896
5940
|
|
|
@@ -6960,6 +7004,13 @@ class WebRTCClient extends Emitter {
|
|
|
6960
7004
|
}
|
|
6961
7005
|
|
|
6962
7006
|
_createWebRTCConfiguration(configOverrides = {}) {
|
|
7007
|
+
let { host } = this.config;
|
|
7008
|
+
let port = this.config.port || 443;
|
|
7009
|
+
|
|
7010
|
+
if (this.config.websocketSip) {
|
|
7011
|
+
[host, port = 443] = this.config.websocketSip.split(':');
|
|
7012
|
+
}
|
|
7013
|
+
|
|
6963
7014
|
const config = {
|
|
6964
7015
|
authorizationUsername: this.config.authorizationUser,
|
|
6965
7016
|
authorizationPassword: this.config.password,
|
|
@@ -6995,7 +7046,7 @@ class WebRTCClient extends Emitter {
|
|
|
6995
7046
|
},
|
|
6996
7047
|
transportOptions: {
|
|
6997
7048
|
traceSip: configOverrides.traceSip || false,
|
|
6998
|
-
wsServers: `wss://${
|
|
7049
|
+
wsServers: `wss://${host}:${port}/api/asterisk/ws`,
|
|
6999
7050
|
},
|
|
7000
7051
|
sessionDescriptionHandlerFactoryOptions: {
|
|
7001
7052
|
modifiers: [replaceLocalIpModifier],
|
|
@@ -7319,7 +7370,15 @@ class WebRTCClient extends Emitter {
|
|
|
7319
7370
|
return UserAgent.makeURI(`sip:${target}@${this.config.host}`);
|
|
7320
7371
|
}
|
|
7321
7372
|
|
|
7322
|
-
async _disconnectTransport() {
|
|
7373
|
+
async _disconnectTransport(force = false) {
|
|
7374
|
+
if (force) {
|
|
7375
|
+
// Bypass sip.js state machine that prevent to close WS with the state `Connecting`
|
|
7376
|
+
this.userAgent.transport.disconnectResolve = () => {};
|
|
7377
|
+
// eslint-disable-next-line
|
|
7378
|
+
this.userAgent.transport._ws.close(1000);
|
|
7379
|
+
return;
|
|
7380
|
+
}
|
|
7381
|
+
|
|
7323
7382
|
// Check if `disconnectPromise` is not present to avoid `Disconnect promise must not be defined` errors.
|
|
7324
7383
|
if (this.userAgent && this.userAgent.transport && !this.userAgent.transport.disconnectPromise) {
|
|
7325
7384
|
try {
|
|
@@ -4579,6 +4579,34 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
4579
4579
|
client.get(`${baseUrl}/users/me/rooms/messages`, options),
|
|
4580
4580
|
});
|
|
4581
4581
|
|
|
4582
|
+
//
|
|
4583
|
+
|
|
4584
|
+
|
|
4585
|
+
|
|
4586
|
+
|
|
4587
|
+
|
|
4588
|
+
class MeetingStatus {
|
|
4589
|
+
|
|
4590
|
+
|
|
4591
|
+
|
|
4592
|
+
|
|
4593
|
+
constructor({
|
|
4594
|
+
full,
|
|
4595
|
+
} = {}) {
|
|
4596
|
+
this.full = full;
|
|
4597
|
+
|
|
4598
|
+
// Useful to compare instead of instanceof with minified code
|
|
4599
|
+
this.type = 'MeetingStatus';
|
|
4600
|
+
}
|
|
4601
|
+
|
|
4602
|
+
static parse(plain ) {
|
|
4603
|
+
return new MeetingStatus({
|
|
4604
|
+
full: plain.full,
|
|
4605
|
+
});
|
|
4606
|
+
}
|
|
4607
|
+
|
|
4608
|
+
}
|
|
4609
|
+
|
|
4582
4610
|
/* */
|
|
4583
4611
|
|
|
4584
4612
|
|
|
@@ -4773,6 +4801,8 @@ var calldMethods = (client , baseUrl ) => ({
|
|
|
4773
4801
|
client.put(`${baseUrl}/users/me/calls/${callId}/record/resume`, null, null,
|
|
4774
4802
|
ApiRequester.successResponseParser),
|
|
4775
4803
|
|
|
4804
|
+
guestGetMeetingStatus: (meetingUuid ) =>
|
|
4805
|
+
client.get(`${baseUrl}/guests/me/meetings/${meetingUuid}/status`).then(MeetingStatus.parse),
|
|
4776
4806
|
});
|
|
4777
4807
|
|
|
4778
4808
|
//
|
|
@@ -5344,6 +5374,7 @@ const MAX_REGISTER_TRIES = 10;
|
|
|
5344
5374
|
|
|
5345
5375
|
|
|
5346
5376
|
|
|
5377
|
+
|
|
5347
5378
|
|
|
5348
5379
|
|
|
5349
5380
|
|
|
@@ -5385,6 +5416,7 @@ class WebRTCClient extends Emitter {
|
|
|
5385
5416
|
|
|
5386
5417
|
|
|
5387
5418
|
|
|
5419
|
+
|
|
5388
5420
|
|
|
5389
5421
|
// sugar
|
|
5390
5422
|
|
|
@@ -5447,6 +5479,7 @@ class WebRTCClient extends Emitter {
|
|
|
5447
5479
|
this.conferences = {};
|
|
5448
5480
|
this.networkMonitoringInterval = {};
|
|
5449
5481
|
this.sessionNetworkStats = {};
|
|
5482
|
+
this.forceClosed = false;
|
|
5450
5483
|
|
|
5451
5484
|
this._boundOnHeartbeat = this._onHeartbeat.bind(this);
|
|
5452
5485
|
this.heartbeat = new Heartbeat(config.heartbeatDelay, config.heartbeatTimeout, config.maxHeartbeats);
|
|
@@ -5568,6 +5601,8 @@ class WebRTCClient extends Emitter {
|
|
|
5568
5601
|
skipRegister: this.skipRegister,
|
|
5569
5602
|
};
|
|
5570
5603
|
|
|
5604
|
+
this.forceClosed = false;
|
|
5605
|
+
|
|
5571
5606
|
if (this.skipRegister) {
|
|
5572
5607
|
logger.info('sdk webrtc skip register...', logInfo);
|
|
5573
5608
|
return Promise.resolve();
|
|
@@ -5592,7 +5627,15 @@ class WebRTCClient extends Emitter {
|
|
|
5592
5627
|
const registerOptions = this._isWeb() ? {} : { extraContactHeaderParams: ['mobility=mobile'] };
|
|
5593
5628
|
|
|
5594
5629
|
const onRegisterFailed = () => {
|
|
5595
|
-
logger.info('sdk webrtc registering failed', {
|
|
5630
|
+
logger.info('sdk webrtc registering failed', {
|
|
5631
|
+
tries,
|
|
5632
|
+
registerer: !!this.registerer,
|
|
5633
|
+
forceClosed: this.forceClosed,
|
|
5634
|
+
});
|
|
5635
|
+
if (this.forceClosed) {
|
|
5636
|
+
return;
|
|
5637
|
+
}
|
|
5638
|
+
|
|
5596
5639
|
this.connectionPromise = null;
|
|
5597
5640
|
if (this.registerer && this.registerer.waiting) {
|
|
5598
5641
|
this.registerer.waitingToggle(false);
|
|
@@ -5870,8 +5913,9 @@ class WebRTCClient extends Emitter {
|
|
|
5870
5913
|
}
|
|
5871
5914
|
}
|
|
5872
5915
|
|
|
5873
|
-
async close() {
|
|
5874
|
-
logger.info('sdk webrtc closing client', { userAgent: !!this.userAgent });
|
|
5916
|
+
async close(force = false) {
|
|
5917
|
+
logger.info('sdk webrtc closing client', { userAgent: !!this.userAgent, force });
|
|
5918
|
+
this.forceClosed = force;
|
|
5875
5919
|
this._cleanupMedia();
|
|
5876
5920
|
this.connectionPromise = null;
|
|
5877
5921
|
|
|
@@ -5890,7 +5934,7 @@ class WebRTCClient extends Emitter {
|
|
|
5890
5934
|
this.userAgent.delegate = null;
|
|
5891
5935
|
this.userAgent.stateChange.removeAllListeners();
|
|
5892
5936
|
|
|
5893
|
-
await this._disconnectTransport();
|
|
5937
|
+
await this._disconnectTransport(force);
|
|
5894
5938
|
|
|
5895
5939
|
this._cleanupRegister();
|
|
5896
5940
|
|
|
@@ -6960,6 +7004,13 @@ class WebRTCClient extends Emitter {
|
|
|
6960
7004
|
}
|
|
6961
7005
|
|
|
6962
7006
|
_createWebRTCConfiguration(configOverrides = {}) {
|
|
7007
|
+
let { host } = this.config;
|
|
7008
|
+
let port = this.config.port || 443;
|
|
7009
|
+
|
|
7010
|
+
if (this.config.websocketSip) {
|
|
7011
|
+
[host, port = 443] = this.config.websocketSip.split(':');
|
|
7012
|
+
}
|
|
7013
|
+
|
|
6963
7014
|
const config = {
|
|
6964
7015
|
authorizationUsername: this.config.authorizationUser,
|
|
6965
7016
|
authorizationPassword: this.config.password,
|
|
@@ -6995,7 +7046,7 @@ class WebRTCClient extends Emitter {
|
|
|
6995
7046
|
},
|
|
6996
7047
|
transportOptions: {
|
|
6997
7048
|
traceSip: configOverrides.traceSip || false,
|
|
6998
|
-
wsServers: `wss://${
|
|
7049
|
+
wsServers: `wss://${host}:${port}/api/asterisk/ws`,
|
|
6999
7050
|
},
|
|
7000
7051
|
sessionDescriptionHandlerFactoryOptions: {
|
|
7001
7052
|
modifiers: [replaceLocalIpModifier],
|
|
@@ -7319,7 +7370,15 @@ class WebRTCClient extends Emitter {
|
|
|
7319
7370
|
return UserAgent.makeURI(`sip:${target}@${this.config.host}`);
|
|
7320
7371
|
}
|
|
7321
7372
|
|
|
7322
|
-
async _disconnectTransport() {
|
|
7373
|
+
async _disconnectTransport(force = false) {
|
|
7374
|
+
if (force) {
|
|
7375
|
+
// Bypass sip.js state machine that prevent to close WS with the state `Connecting`
|
|
7376
|
+
this.userAgent.transport.disconnectResolve = () => {};
|
|
7377
|
+
// eslint-disable-next-line
|
|
7378
|
+
this.userAgent.transport._ws.close(1000);
|
|
7379
|
+
return;
|
|
7380
|
+
}
|
|
7381
|
+
|
|
7323
7382
|
// Check if `disconnectPromise` is not present to avoid `Disconnect promise must not be defined` errors.
|
|
7324
7383
|
if (this.userAgent && this.userAgent.transport && !this.userAgent.transport.disconnectPromise) {
|
|
7325
7384
|
try {
|
|
@@ -4016,6 +4016,34 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
4016
4016
|
client.get(`${baseUrl}/users/me/rooms/messages`, options),
|
|
4017
4017
|
});
|
|
4018
4018
|
|
|
4019
|
+
//
|
|
4020
|
+
|
|
4021
|
+
|
|
4022
|
+
|
|
4023
|
+
|
|
4024
|
+
|
|
4025
|
+
class MeetingStatus {
|
|
4026
|
+
|
|
4027
|
+
|
|
4028
|
+
|
|
4029
|
+
|
|
4030
|
+
constructor({
|
|
4031
|
+
full,
|
|
4032
|
+
} = {}) {
|
|
4033
|
+
this.full = full;
|
|
4034
|
+
|
|
4035
|
+
// Useful to compare instead of instanceof with minified code
|
|
4036
|
+
this.type = 'MeetingStatus';
|
|
4037
|
+
}
|
|
4038
|
+
|
|
4039
|
+
static parse(plain ) {
|
|
4040
|
+
return new MeetingStatus({
|
|
4041
|
+
full: plain.full,
|
|
4042
|
+
});
|
|
4043
|
+
}
|
|
4044
|
+
|
|
4045
|
+
}
|
|
4046
|
+
|
|
4019
4047
|
/* */
|
|
4020
4048
|
|
|
4021
4049
|
|
|
@@ -4210,6 +4238,8 @@ var calldMethods = (client , baseUrl ) => ({
|
|
|
4210
4238
|
client.put(`${baseUrl}/users/me/calls/${callId}/record/resume`, null, null,
|
|
4211
4239
|
ApiRequester.successResponseParser),
|
|
4212
4240
|
|
|
4241
|
+
guestGetMeetingStatus: (meetingUuid ) =>
|
|
4242
|
+
client.get(`${baseUrl}/guests/me/meetings/${meetingUuid}/status`).then(MeetingStatus.parse),
|
|
4213
4243
|
});
|
|
4214
4244
|
|
|
4215
4245
|
//
|
|
@@ -32,6 +32,7 @@ var updateFrom = (instance , from ) => {
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
+
|
|
35
36
|
|
|
36
37
|
|
|
37
38
|
|
|
@@ -79,14 +80,14 @@ class CallSession {
|
|
|
79
80
|
|
|
80
81
|
|
|
81
82
|
|
|
83
|
+
// = creationTime
|
|
84
|
+
|
|
82
85
|
|
|
83
86
|
|
|
84
87
|
|
|
85
88
|
|
|
86
89
|
|
|
87
90
|
|
|
88
|
-
|
|
89
|
-
|
|
90
91
|
|
|
91
92
|
|
|
92
93
|
|
|
@@ -150,6 +151,7 @@ class CallSession {
|
|
|
150
151
|
recordingPaused,
|
|
151
152
|
videoRemotelyDowngraded,
|
|
152
153
|
sipSession,
|
|
154
|
+
answerTime,
|
|
153
155
|
} ) {
|
|
154
156
|
this.callId = callId;
|
|
155
157
|
this.sipCallId = sipCallId;
|
|
@@ -177,6 +179,7 @@ class CallSession {
|
|
|
177
179
|
this.recordingPaused = recordingPaused || false;
|
|
178
180
|
this.videoRemotelyDowngraded = videoRemotelyDowngraded;
|
|
179
181
|
this.sipSession = sipSession;
|
|
182
|
+
this.answerTime = answerTime || this.answerTime;
|
|
180
183
|
|
|
181
184
|
// Useful to compare instead of instanceof with minified code
|
|
182
185
|
this.type = 'CallSession';
|
|
@@ -207,7 +210,7 @@ class CallSession {
|
|
|
207
210
|
}
|
|
208
211
|
|
|
209
212
|
answer() {
|
|
210
|
-
this.
|
|
213
|
+
this.answerTime = new Date();
|
|
211
214
|
}
|
|
212
215
|
|
|
213
216
|
systemAnswer() {
|
|
@@ -363,6 +366,15 @@ class CallSession {
|
|
|
363
366
|
return newFrom(callSession, CallSession);
|
|
364
367
|
}
|
|
365
368
|
|
|
369
|
+
// Retro-compatibility: `answered` was a boolean before. We can reproduce the behaviour with a getter/setter
|
|
370
|
+
set answered(value ) {
|
|
371
|
+
this.answerTime = value ? this.answerTime || new Date() : null;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
get answered() {
|
|
375
|
+
return !!this.answerTime;
|
|
376
|
+
}
|
|
377
|
+
|
|
366
378
|
static parseCall(call ) {
|
|
367
379
|
return new CallSession({
|
|
368
380
|
callId: call.id,
|
package/esm/domain/Features.js
CHANGED
|
@@ -4016,6 +4016,34 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
4016
4016
|
client.get(`${baseUrl}/users/me/rooms/messages`, options),
|
|
4017
4017
|
});
|
|
4018
4018
|
|
|
4019
|
+
//
|
|
4020
|
+
|
|
4021
|
+
|
|
4022
|
+
|
|
4023
|
+
|
|
4024
|
+
|
|
4025
|
+
class MeetingStatus {
|
|
4026
|
+
|
|
4027
|
+
|
|
4028
|
+
|
|
4029
|
+
|
|
4030
|
+
constructor({
|
|
4031
|
+
full,
|
|
4032
|
+
} = {}) {
|
|
4033
|
+
this.full = full;
|
|
4034
|
+
|
|
4035
|
+
// Useful to compare instead of instanceof with minified code
|
|
4036
|
+
this.type = 'MeetingStatus';
|
|
4037
|
+
}
|
|
4038
|
+
|
|
4039
|
+
static parse(plain ) {
|
|
4040
|
+
return new MeetingStatus({
|
|
4041
|
+
full: plain.full,
|
|
4042
|
+
});
|
|
4043
|
+
}
|
|
4044
|
+
|
|
4045
|
+
}
|
|
4046
|
+
|
|
4019
4047
|
/* */
|
|
4020
4048
|
|
|
4021
4049
|
|
|
@@ -4210,6 +4238,8 @@ var calldMethods = (client , baseUrl ) => ({
|
|
|
4210
4238
|
client.put(`${baseUrl}/users/me/calls/${callId}/record/resume`, null, null,
|
|
4211
4239
|
ApiRequester.successResponseParser),
|
|
4212
4240
|
|
|
4241
|
+
guestGetMeetingStatus: (meetingUuid ) =>
|
|
4242
|
+
client.get(`${baseUrl}/guests/me/meetings/${meetingUuid}/status`).then(MeetingStatus.parse),
|
|
4213
4243
|
});
|
|
4214
4244
|
|
|
4215
4245
|
//
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class MeetingStatus {
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
constructor({
|
|
13
|
+
full,
|
|
14
|
+
} = {}) {
|
|
15
|
+
this.full = full;
|
|
16
|
+
|
|
17
|
+
// Useful to compare instead of instanceof with minified code
|
|
18
|
+
this.type = 'MeetingStatus';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
static parse(plain ) {
|
|
22
|
+
return new MeetingStatus({
|
|
23
|
+
full: plain.full,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default MeetingStatus;
|
|
@@ -1706,6 +1706,7 @@ var updateFrom = (instance , from ) => {
|
|
|
1706
1706
|
|
|
1707
1707
|
|
|
1708
1708
|
|
|
1709
|
+
|
|
1709
1710
|
|
|
1710
1711
|
|
|
1711
1712
|
|
|
@@ -1753,14 +1754,14 @@ class CallSession {
|
|
|
1753
1754
|
|
|
1754
1755
|
|
|
1755
1756
|
|
|
1757
|
+
// = creationTime
|
|
1758
|
+
|
|
1756
1759
|
|
|
1757
1760
|
|
|
1758
1761
|
|
|
1759
1762
|
|
|
1760
1763
|
|
|
1761
1764
|
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
1765
|
|
|
1765
1766
|
|
|
1766
1767
|
|
|
@@ -1824,6 +1825,7 @@ class CallSession {
|
|
|
1824
1825
|
recordingPaused,
|
|
1825
1826
|
videoRemotelyDowngraded,
|
|
1826
1827
|
sipSession,
|
|
1828
|
+
answerTime,
|
|
1827
1829
|
} ) {
|
|
1828
1830
|
this.callId = callId;
|
|
1829
1831
|
this.sipCallId = sipCallId;
|
|
@@ -1851,6 +1853,7 @@ class CallSession {
|
|
|
1851
1853
|
this.recordingPaused = recordingPaused || false;
|
|
1852
1854
|
this.videoRemotelyDowngraded = videoRemotelyDowngraded;
|
|
1853
1855
|
this.sipSession = sipSession;
|
|
1856
|
+
this.answerTime = answerTime || this.answerTime;
|
|
1854
1857
|
|
|
1855
1858
|
// Useful to compare instead of instanceof with minified code
|
|
1856
1859
|
this.type = 'CallSession';
|
|
@@ -1881,7 +1884,7 @@ class CallSession {
|
|
|
1881
1884
|
}
|
|
1882
1885
|
|
|
1883
1886
|
answer() {
|
|
1884
|
-
this.
|
|
1887
|
+
this.answerTime = new Date();
|
|
1885
1888
|
}
|
|
1886
1889
|
|
|
1887
1890
|
systemAnswer() {
|
|
@@ -2037,6 +2040,15 @@ class CallSession {
|
|
|
2037
2040
|
return newFrom(callSession, CallSession);
|
|
2038
2041
|
}
|
|
2039
2042
|
|
|
2043
|
+
// Retro-compatibility: `answered` was a boolean before. We can reproduce the behaviour with a getter/setter
|
|
2044
|
+
set answered(value ) {
|
|
2045
|
+
this.answerTime = value ? this.answerTime || new Date() : null;
|
|
2046
|
+
}
|
|
2047
|
+
|
|
2048
|
+
get answered() {
|
|
2049
|
+
return !!this.answerTime;
|
|
2050
|
+
}
|
|
2051
|
+
|
|
2040
2052
|
static parseCall(call ) {
|
|
2041
2053
|
return new CallSession({
|
|
2042
2054
|
callId: call.id,
|
|
@@ -4395,6 +4407,34 @@ class IndirectTransfer {
|
|
|
4395
4407
|
}
|
|
4396
4408
|
}
|
|
4397
4409
|
|
|
4410
|
+
//
|
|
4411
|
+
|
|
4412
|
+
|
|
4413
|
+
|
|
4414
|
+
|
|
4415
|
+
|
|
4416
|
+
class MeetingStatus {
|
|
4417
|
+
|
|
4418
|
+
|
|
4419
|
+
|
|
4420
|
+
|
|
4421
|
+
constructor({
|
|
4422
|
+
full,
|
|
4423
|
+
} = {}) {
|
|
4424
|
+
this.full = full;
|
|
4425
|
+
|
|
4426
|
+
// Useful to compare instead of instanceof with minified code
|
|
4427
|
+
this.type = 'MeetingStatus';
|
|
4428
|
+
}
|
|
4429
|
+
|
|
4430
|
+
static parse(plain ) {
|
|
4431
|
+
return new MeetingStatus({
|
|
4432
|
+
full: plain.full,
|
|
4433
|
+
});
|
|
4434
|
+
}
|
|
4435
|
+
|
|
4436
|
+
}
|
|
4437
|
+
|
|
4398
4438
|
/* */
|
|
4399
4439
|
|
|
4400
4440
|
|
|
@@ -4589,6 +4629,8 @@ var calldMethods = (client , baseUrl ) => ({
|
|
|
4589
4629
|
client.put(`${baseUrl}/users/me/calls/${callId}/record/resume`, null, null,
|
|
4590
4630
|
ApiRequester.successResponseParser),
|
|
4591
4631
|
|
|
4632
|
+
guestGetMeetingStatus: (meetingUuid ) =>
|
|
4633
|
+
client.get(`${baseUrl}/guests/me/meetings/${meetingUuid}/status`).then(MeetingStatus.parse),
|
|
4592
4634
|
});
|
|
4593
4635
|
|
|
4594
4636
|
//
|