@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
package/esm/web-rtc-client.js
CHANGED
|
@@ -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
|
//
|
|
@@ -5347,6 +5377,7 @@ const MAX_REGISTER_TRIES = 10;
|
|
|
5347
5377
|
|
|
5348
5378
|
|
|
5349
5379
|
|
|
5380
|
+
|
|
5350
5381
|
|
|
5351
5382
|
|
|
5352
5383
|
|
|
@@ -5388,6 +5419,7 @@ class WebRTCClient extends Emitter {
|
|
|
5388
5419
|
|
|
5389
5420
|
|
|
5390
5421
|
|
|
5422
|
+
|
|
5391
5423
|
|
|
5392
5424
|
// sugar
|
|
5393
5425
|
|
|
@@ -5450,6 +5482,7 @@ class WebRTCClient extends Emitter {
|
|
|
5450
5482
|
this.conferences = {};
|
|
5451
5483
|
this.networkMonitoringInterval = {};
|
|
5452
5484
|
this.sessionNetworkStats = {};
|
|
5485
|
+
this.forceClosed = false;
|
|
5453
5486
|
|
|
5454
5487
|
this._boundOnHeartbeat = this._onHeartbeat.bind(this);
|
|
5455
5488
|
this.heartbeat = new Heartbeat(config.heartbeatDelay, config.heartbeatTimeout, config.maxHeartbeats);
|
|
@@ -5571,6 +5604,8 @@ class WebRTCClient extends Emitter {
|
|
|
5571
5604
|
skipRegister: this.skipRegister,
|
|
5572
5605
|
};
|
|
5573
5606
|
|
|
5607
|
+
this.forceClosed = false;
|
|
5608
|
+
|
|
5574
5609
|
if (this.skipRegister) {
|
|
5575
5610
|
logger.info('sdk webrtc skip register...', logInfo);
|
|
5576
5611
|
return Promise.resolve();
|
|
@@ -5595,7 +5630,15 @@ class WebRTCClient extends Emitter {
|
|
|
5595
5630
|
const registerOptions = this._isWeb() ? {} : { extraContactHeaderParams: ['mobility=mobile'] };
|
|
5596
5631
|
|
|
5597
5632
|
const onRegisterFailed = () => {
|
|
5598
|
-
logger.info('sdk webrtc registering failed', {
|
|
5633
|
+
logger.info('sdk webrtc registering failed', {
|
|
5634
|
+
tries,
|
|
5635
|
+
registerer: !!this.registerer,
|
|
5636
|
+
forceClosed: this.forceClosed,
|
|
5637
|
+
});
|
|
5638
|
+
if (this.forceClosed) {
|
|
5639
|
+
return;
|
|
5640
|
+
}
|
|
5641
|
+
|
|
5599
5642
|
this.connectionPromise = null;
|
|
5600
5643
|
if (this.registerer && this.registerer.waiting) {
|
|
5601
5644
|
this.registerer.waitingToggle(false);
|
|
@@ -5873,8 +5916,9 @@ class WebRTCClient extends Emitter {
|
|
|
5873
5916
|
}
|
|
5874
5917
|
}
|
|
5875
5918
|
|
|
5876
|
-
async close() {
|
|
5877
|
-
logger.info('sdk webrtc closing client', { userAgent: !!this.userAgent });
|
|
5919
|
+
async close(force = false) {
|
|
5920
|
+
logger.info('sdk webrtc closing client', { userAgent: !!this.userAgent, force });
|
|
5921
|
+
this.forceClosed = force;
|
|
5878
5922
|
this._cleanupMedia();
|
|
5879
5923
|
this.connectionPromise = null;
|
|
5880
5924
|
|
|
@@ -5893,7 +5937,7 @@ class WebRTCClient extends Emitter {
|
|
|
5893
5937
|
this.userAgent.delegate = null;
|
|
5894
5938
|
this.userAgent.stateChange.removeAllListeners();
|
|
5895
5939
|
|
|
5896
|
-
await this._disconnectTransport();
|
|
5940
|
+
await this._disconnectTransport(force);
|
|
5897
5941
|
|
|
5898
5942
|
this._cleanupRegister();
|
|
5899
5943
|
|
|
@@ -6963,6 +7007,13 @@ class WebRTCClient extends Emitter {
|
|
|
6963
7007
|
}
|
|
6964
7008
|
|
|
6965
7009
|
_createWebRTCConfiguration(configOverrides = {}) {
|
|
7010
|
+
let { host } = this.config;
|
|
7011
|
+
let port = this.config.port || 443;
|
|
7012
|
+
|
|
7013
|
+
if (this.config.websocketSip) {
|
|
7014
|
+
[host, port = 443] = this.config.websocketSip.split(':');
|
|
7015
|
+
}
|
|
7016
|
+
|
|
6966
7017
|
const config = {
|
|
6967
7018
|
authorizationUsername: this.config.authorizationUser,
|
|
6968
7019
|
authorizationPassword: this.config.password,
|
|
@@ -6998,7 +7049,7 @@ class WebRTCClient extends Emitter {
|
|
|
6998
7049
|
},
|
|
6999
7050
|
transportOptions: {
|
|
7000
7051
|
traceSip: configOverrides.traceSip || false,
|
|
7001
|
-
wsServers: `wss://${
|
|
7052
|
+
wsServers: `wss://${host}:${port}/api/asterisk/ws`,
|
|
7002
7053
|
},
|
|
7003
7054
|
sessionDescriptionHandlerFactoryOptions: {
|
|
7004
7055
|
modifiers: [replaceLocalIpModifier],
|
|
@@ -7322,7 +7373,15 @@ class WebRTCClient extends Emitter {
|
|
|
7322
7373
|
return UserAgent.makeURI(`sip:${target}@${this.config.host}`);
|
|
7323
7374
|
}
|
|
7324
7375
|
|
|
7325
|
-
async _disconnectTransport() {
|
|
7376
|
+
async _disconnectTransport(force = false) {
|
|
7377
|
+
if (force) {
|
|
7378
|
+
// Bypass sip.js state machine that prevent to close WS with the state `Connecting`
|
|
7379
|
+
this.userAgent.transport.disconnectResolve = () => {};
|
|
7380
|
+
// eslint-disable-next-line
|
|
7381
|
+
this.userAgent.transport._ws.close(1000);
|
|
7382
|
+
return;
|
|
7383
|
+
}
|
|
7384
|
+
|
|
7326
7385
|
// Check if `disconnectPromise` is not present to avoid `Disconnect promise must not be defined` errors.
|
|
7327
7386
|
if (this.userAgent && this.userAgent.transport && !this.userAgent.transport.disconnectPromise) {
|
|
7328
7387
|
try {
|
|
@@ -4037,6 +4037,34 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
4037
4037
|
client.get(`${baseUrl}/users/me/rooms/messages`, options),
|
|
4038
4038
|
});
|
|
4039
4039
|
|
|
4040
|
+
//
|
|
4041
|
+
|
|
4042
|
+
|
|
4043
|
+
|
|
4044
|
+
|
|
4045
|
+
|
|
4046
|
+
class MeetingStatus {
|
|
4047
|
+
|
|
4048
|
+
|
|
4049
|
+
|
|
4050
|
+
|
|
4051
|
+
constructor({
|
|
4052
|
+
full,
|
|
4053
|
+
} = {}) {
|
|
4054
|
+
this.full = full;
|
|
4055
|
+
|
|
4056
|
+
// Useful to compare instead of instanceof with minified code
|
|
4057
|
+
this.type = 'MeetingStatus';
|
|
4058
|
+
}
|
|
4059
|
+
|
|
4060
|
+
static parse(plain ) {
|
|
4061
|
+
return new MeetingStatus({
|
|
4062
|
+
full: plain.full,
|
|
4063
|
+
});
|
|
4064
|
+
}
|
|
4065
|
+
|
|
4066
|
+
}
|
|
4067
|
+
|
|
4040
4068
|
/* */
|
|
4041
4069
|
|
|
4042
4070
|
|
|
@@ -4231,6 +4259,8 @@ var calldMethods = (client , baseUrl ) => ({
|
|
|
4231
4259
|
client.put(`${baseUrl}/users/me/calls/${callId}/record/resume`, null, null,
|
|
4232
4260
|
ApiRequester.successResponseParser),
|
|
4233
4261
|
|
|
4262
|
+
guestGetMeetingStatus: (meetingUuid ) =>
|
|
4263
|
+
client.get(`${baseUrl}/guests/me/meetings/${meetingUuid}/status`).then(MeetingStatus.parse),
|
|
4234
4264
|
});
|
|
4235
4265
|
|
|
4236
4266
|
//
|
|
@@ -4588,6 +4588,34 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
4588
4588
|
client.get(`${baseUrl}/users/me/rooms/messages`, options),
|
|
4589
4589
|
});
|
|
4590
4590
|
|
|
4591
|
+
//
|
|
4592
|
+
|
|
4593
|
+
|
|
4594
|
+
|
|
4595
|
+
|
|
4596
|
+
|
|
4597
|
+
class MeetingStatus {
|
|
4598
|
+
|
|
4599
|
+
|
|
4600
|
+
|
|
4601
|
+
|
|
4602
|
+
constructor({
|
|
4603
|
+
full,
|
|
4604
|
+
} = {}) {
|
|
4605
|
+
this.full = full;
|
|
4606
|
+
|
|
4607
|
+
// Useful to compare instead of instanceof with minified code
|
|
4608
|
+
this.type = 'MeetingStatus';
|
|
4609
|
+
}
|
|
4610
|
+
|
|
4611
|
+
static parse(plain ) {
|
|
4612
|
+
return new MeetingStatus({
|
|
4613
|
+
full: plain.full,
|
|
4614
|
+
});
|
|
4615
|
+
}
|
|
4616
|
+
|
|
4617
|
+
}
|
|
4618
|
+
|
|
4591
4619
|
/* */
|
|
4592
4620
|
|
|
4593
4621
|
|
|
@@ -4782,6 +4810,8 @@ var calldMethods = (client , baseUrl ) => ({
|
|
|
4782
4810
|
client.put(`${baseUrl}/users/me/calls/${callId}/record/resume`, null, null,
|
|
4783
4811
|
ApiRequester.successResponseParser),
|
|
4784
4812
|
|
|
4813
|
+
guestGetMeetingStatus: (meetingUuid ) =>
|
|
4814
|
+
client.get(`${baseUrl}/guests/me/meetings/${meetingUuid}/status`).then(MeetingStatus.parse),
|
|
4785
4815
|
});
|
|
4786
4816
|
|
|
4787
4817
|
//
|
|
@@ -5353,6 +5383,7 @@ const MAX_REGISTER_TRIES = 10;
|
|
|
5353
5383
|
|
|
5354
5384
|
|
|
5355
5385
|
|
|
5386
|
+
|
|
5356
5387
|
|
|
5357
5388
|
|
|
5358
5389
|
|
|
@@ -5394,6 +5425,7 @@ class WebRTCClient extends Emitter {
|
|
|
5394
5425
|
|
|
5395
5426
|
|
|
5396
5427
|
|
|
5428
|
+
|
|
5397
5429
|
|
|
5398
5430
|
// sugar
|
|
5399
5431
|
|
|
@@ -5456,6 +5488,7 @@ class WebRTCClient extends Emitter {
|
|
|
5456
5488
|
this.conferences = {};
|
|
5457
5489
|
this.networkMonitoringInterval = {};
|
|
5458
5490
|
this.sessionNetworkStats = {};
|
|
5491
|
+
this.forceClosed = false;
|
|
5459
5492
|
|
|
5460
5493
|
this._boundOnHeartbeat = this._onHeartbeat.bind(this);
|
|
5461
5494
|
this.heartbeat = new Heartbeat(config.heartbeatDelay, config.heartbeatTimeout, config.maxHeartbeats);
|
|
@@ -5577,6 +5610,8 @@ class WebRTCClient extends Emitter {
|
|
|
5577
5610
|
skipRegister: this.skipRegister,
|
|
5578
5611
|
};
|
|
5579
5612
|
|
|
5613
|
+
this.forceClosed = false;
|
|
5614
|
+
|
|
5580
5615
|
if (this.skipRegister) {
|
|
5581
5616
|
logger.info('sdk webrtc skip register...', logInfo);
|
|
5582
5617
|
return Promise.resolve();
|
|
@@ -5601,7 +5636,15 @@ class WebRTCClient extends Emitter {
|
|
|
5601
5636
|
const registerOptions = this._isWeb() ? {} : { extraContactHeaderParams: ['mobility=mobile'] };
|
|
5602
5637
|
|
|
5603
5638
|
const onRegisterFailed = () => {
|
|
5604
|
-
logger.info('sdk webrtc registering failed', {
|
|
5639
|
+
logger.info('sdk webrtc registering failed', {
|
|
5640
|
+
tries,
|
|
5641
|
+
registerer: !!this.registerer,
|
|
5642
|
+
forceClosed: this.forceClosed,
|
|
5643
|
+
});
|
|
5644
|
+
if (this.forceClosed) {
|
|
5645
|
+
return;
|
|
5646
|
+
}
|
|
5647
|
+
|
|
5605
5648
|
this.connectionPromise = null;
|
|
5606
5649
|
if (this.registerer && this.registerer.waiting) {
|
|
5607
5650
|
this.registerer.waitingToggle(false);
|
|
@@ -5879,8 +5922,9 @@ class WebRTCClient extends Emitter {
|
|
|
5879
5922
|
}
|
|
5880
5923
|
}
|
|
5881
5924
|
|
|
5882
|
-
async close() {
|
|
5883
|
-
logger.info('sdk webrtc closing client', { userAgent: !!this.userAgent });
|
|
5925
|
+
async close(force = false) {
|
|
5926
|
+
logger.info('sdk webrtc closing client', { userAgent: !!this.userAgent, force });
|
|
5927
|
+
this.forceClosed = force;
|
|
5884
5928
|
this._cleanupMedia();
|
|
5885
5929
|
this.connectionPromise = null;
|
|
5886
5930
|
|
|
@@ -5899,7 +5943,7 @@ class WebRTCClient extends Emitter {
|
|
|
5899
5943
|
this.userAgent.delegate = null;
|
|
5900
5944
|
this.userAgent.stateChange.removeAllListeners();
|
|
5901
5945
|
|
|
5902
|
-
await this._disconnectTransport();
|
|
5946
|
+
await this._disconnectTransport(force);
|
|
5903
5947
|
|
|
5904
5948
|
this._cleanupRegister();
|
|
5905
5949
|
|
|
@@ -6969,6 +7013,13 @@ class WebRTCClient extends Emitter {
|
|
|
6969
7013
|
}
|
|
6970
7014
|
|
|
6971
7015
|
_createWebRTCConfiguration(configOverrides = {}) {
|
|
7016
|
+
let { host } = this.config;
|
|
7017
|
+
let port = this.config.port || 443;
|
|
7018
|
+
|
|
7019
|
+
if (this.config.websocketSip) {
|
|
7020
|
+
[host, port = 443] = this.config.websocketSip.split(':');
|
|
7021
|
+
}
|
|
7022
|
+
|
|
6972
7023
|
const config = {
|
|
6973
7024
|
authorizationUsername: this.config.authorizationUser,
|
|
6974
7025
|
authorizationPassword: this.config.password,
|
|
@@ -7004,7 +7055,7 @@ class WebRTCClient extends Emitter {
|
|
|
7004
7055
|
},
|
|
7005
7056
|
transportOptions: {
|
|
7006
7057
|
traceSip: configOverrides.traceSip || false,
|
|
7007
|
-
wsServers: `wss://${
|
|
7058
|
+
wsServers: `wss://${host}:${port}/api/asterisk/ws`,
|
|
7008
7059
|
},
|
|
7009
7060
|
sessionDescriptionHandlerFactoryOptions: {
|
|
7010
7061
|
modifiers: [replaceLocalIpModifier],
|
|
@@ -7328,7 +7379,15 @@ class WebRTCClient extends Emitter {
|
|
|
7328
7379
|
return userAgent.UserAgent.makeURI(`sip:${target}@${this.config.host}`);
|
|
7329
7380
|
}
|
|
7330
7381
|
|
|
7331
|
-
async _disconnectTransport() {
|
|
7382
|
+
async _disconnectTransport(force = false) {
|
|
7383
|
+
if (force) {
|
|
7384
|
+
// Bypass sip.js state machine that prevent to close WS with the state `Connecting`
|
|
7385
|
+
this.userAgent.transport.disconnectResolve = () => {};
|
|
7386
|
+
// eslint-disable-next-line
|
|
7387
|
+
this.userAgent.transport._ws.close(1000);
|
|
7388
|
+
return;
|
|
7389
|
+
}
|
|
7390
|
+
|
|
7332
7391
|
// Check if `disconnectPromise` is not present to avoid `Disconnect promise must not be defined` errors.
|
|
7333
7392
|
if (this.userAgent && this.userAgent.transport && !this.userAgent.transport.disconnectPromise) {
|
|
7334
7393
|
try {
|
package/lib/api/calld.js
CHANGED
|
@@ -1232,6 +1232,34 @@ class IndirectTransfer {
|
|
|
1232
1232
|
}
|
|
1233
1233
|
}
|
|
1234
1234
|
|
|
1235
|
+
//
|
|
1236
|
+
|
|
1237
|
+
|
|
1238
|
+
|
|
1239
|
+
|
|
1240
|
+
|
|
1241
|
+
class MeetingStatus {
|
|
1242
|
+
|
|
1243
|
+
|
|
1244
|
+
|
|
1245
|
+
|
|
1246
|
+
constructor({
|
|
1247
|
+
full,
|
|
1248
|
+
} = {}) {
|
|
1249
|
+
this.full = full;
|
|
1250
|
+
|
|
1251
|
+
// Useful to compare instead of instanceof with minified code
|
|
1252
|
+
this.type = 'MeetingStatus';
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
static parse(plain ) {
|
|
1256
|
+
return new MeetingStatus({
|
|
1257
|
+
full: plain.full,
|
|
1258
|
+
});
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1235
1263
|
/* */
|
|
1236
1264
|
|
|
1237
1265
|
|
|
@@ -1426,6 +1454,8 @@ var calld = (client , baseUrl ) => ({
|
|
|
1426
1454
|
client.put(`${baseUrl}/users/me/calls/${callId}/record/resume`, null, null,
|
|
1427
1455
|
ApiRequester.successResponseParser),
|
|
1428
1456
|
|
|
1457
|
+
guestGetMeetingStatus: (meetingUuid ) =>
|
|
1458
|
+
client.get(`${baseUrl}/guests/me/meetings/${meetingUuid}/status`).then(MeetingStatus.parse),
|
|
1429
1459
|
});
|
|
1430
1460
|
|
|
1431
1461
|
module.exports = calld;
|
package/lib/api-client.js
CHANGED
|
@@ -4037,6 +4037,34 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
4037
4037
|
client.get(`${baseUrl}/users/me/rooms/messages`, options),
|
|
4038
4038
|
});
|
|
4039
4039
|
|
|
4040
|
+
//
|
|
4041
|
+
|
|
4042
|
+
|
|
4043
|
+
|
|
4044
|
+
|
|
4045
|
+
|
|
4046
|
+
class MeetingStatus {
|
|
4047
|
+
|
|
4048
|
+
|
|
4049
|
+
|
|
4050
|
+
|
|
4051
|
+
constructor({
|
|
4052
|
+
full,
|
|
4053
|
+
} = {}) {
|
|
4054
|
+
this.full = full;
|
|
4055
|
+
|
|
4056
|
+
// Useful to compare instead of instanceof with minified code
|
|
4057
|
+
this.type = 'MeetingStatus';
|
|
4058
|
+
}
|
|
4059
|
+
|
|
4060
|
+
static parse(plain ) {
|
|
4061
|
+
return new MeetingStatus({
|
|
4062
|
+
full: plain.full,
|
|
4063
|
+
});
|
|
4064
|
+
}
|
|
4065
|
+
|
|
4066
|
+
}
|
|
4067
|
+
|
|
4040
4068
|
/* */
|
|
4041
4069
|
|
|
4042
4070
|
|
|
@@ -4231,6 +4259,8 @@ var calldMethods = (client , baseUrl ) => ({
|
|
|
4231
4259
|
client.put(`${baseUrl}/users/me/calls/${callId}/record/resume`, null, null,
|
|
4232
4260
|
ApiRequester.successResponseParser),
|
|
4233
4261
|
|
|
4262
|
+
guestGetMeetingStatus: (meetingUuid ) =>
|
|
4263
|
+
client.get(`${baseUrl}/guests/me/meetings/${meetingUuid}/status`).then(MeetingStatus.parse),
|
|
4234
4264
|
});
|
|
4235
4265
|
|
|
4236
4266
|
//
|
package/lib/checker/Checker.js
CHANGED
|
@@ -4085,6 +4085,34 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
4085
4085
|
client.get(`${baseUrl}/users/me/rooms/messages`, options),
|
|
4086
4086
|
});
|
|
4087
4087
|
|
|
4088
|
+
//
|
|
4089
|
+
|
|
4090
|
+
|
|
4091
|
+
|
|
4092
|
+
|
|
4093
|
+
|
|
4094
|
+
class MeetingStatus {
|
|
4095
|
+
|
|
4096
|
+
|
|
4097
|
+
|
|
4098
|
+
|
|
4099
|
+
constructor({
|
|
4100
|
+
full,
|
|
4101
|
+
} = {}) {
|
|
4102
|
+
this.full = full;
|
|
4103
|
+
|
|
4104
|
+
// Useful to compare instead of instanceof with minified code
|
|
4105
|
+
this.type = 'MeetingStatus';
|
|
4106
|
+
}
|
|
4107
|
+
|
|
4108
|
+
static parse(plain ) {
|
|
4109
|
+
return new MeetingStatus({
|
|
4110
|
+
full: plain.full,
|
|
4111
|
+
});
|
|
4112
|
+
}
|
|
4113
|
+
|
|
4114
|
+
}
|
|
4115
|
+
|
|
4088
4116
|
/* */
|
|
4089
4117
|
|
|
4090
4118
|
|
|
@@ -4279,6 +4307,8 @@ var calldMethods = (client , baseUrl ) => ({
|
|
|
4279
4307
|
client.put(`${baseUrl}/users/me/calls/${callId}/record/resume`, null, null,
|
|
4280
4308
|
ApiRequester.successResponseParser),
|
|
4281
4309
|
|
|
4310
|
+
guestGetMeetingStatus: (meetingUuid ) =>
|
|
4311
|
+
client.get(`${baseUrl}/guests/me/meetings/${meetingUuid}/status`).then(MeetingStatus.parse),
|
|
4282
4312
|
});
|
|
4283
4313
|
|
|
4284
4314
|
//
|
|
@@ -5939,6 +5969,7 @@ const MAX_REGISTER_TRIES = 10;
|
|
|
5939
5969
|
|
|
5940
5970
|
|
|
5941
5971
|
|
|
5972
|
+
|
|
5942
5973
|
|
|
5943
5974
|
|
|
5944
5975
|
|
|
@@ -5980,6 +6011,7 @@ class WebRTCClient extends Emitter {
|
|
|
5980
6011
|
|
|
5981
6012
|
|
|
5982
6013
|
|
|
6014
|
+
|
|
5983
6015
|
|
|
5984
6016
|
// sugar
|
|
5985
6017
|
|
|
@@ -6042,6 +6074,7 @@ class WebRTCClient extends Emitter {
|
|
|
6042
6074
|
this.conferences = {};
|
|
6043
6075
|
this.networkMonitoringInterval = {};
|
|
6044
6076
|
this.sessionNetworkStats = {};
|
|
6077
|
+
this.forceClosed = false;
|
|
6045
6078
|
|
|
6046
6079
|
this._boundOnHeartbeat = this._onHeartbeat.bind(this);
|
|
6047
6080
|
this.heartbeat = new Heartbeat(config.heartbeatDelay, config.heartbeatTimeout, config.maxHeartbeats);
|
|
@@ -6163,6 +6196,8 @@ class WebRTCClient extends Emitter {
|
|
|
6163
6196
|
skipRegister: this.skipRegister,
|
|
6164
6197
|
};
|
|
6165
6198
|
|
|
6199
|
+
this.forceClosed = false;
|
|
6200
|
+
|
|
6166
6201
|
if (this.skipRegister) {
|
|
6167
6202
|
logger$1.info('sdk webrtc skip register...', logInfo);
|
|
6168
6203
|
return Promise.resolve();
|
|
@@ -6187,7 +6222,15 @@ class WebRTCClient extends Emitter {
|
|
|
6187
6222
|
const registerOptions = this._isWeb() ? {} : { extraContactHeaderParams: ['mobility=mobile'] };
|
|
6188
6223
|
|
|
6189
6224
|
const onRegisterFailed = () => {
|
|
6190
|
-
logger$1.info('sdk webrtc registering failed', {
|
|
6225
|
+
logger$1.info('sdk webrtc registering failed', {
|
|
6226
|
+
tries,
|
|
6227
|
+
registerer: !!this.registerer,
|
|
6228
|
+
forceClosed: this.forceClosed,
|
|
6229
|
+
});
|
|
6230
|
+
if (this.forceClosed) {
|
|
6231
|
+
return;
|
|
6232
|
+
}
|
|
6233
|
+
|
|
6191
6234
|
this.connectionPromise = null;
|
|
6192
6235
|
if (this.registerer && this.registerer.waiting) {
|
|
6193
6236
|
this.registerer.waitingToggle(false);
|
|
@@ -6465,8 +6508,9 @@ class WebRTCClient extends Emitter {
|
|
|
6465
6508
|
}
|
|
6466
6509
|
}
|
|
6467
6510
|
|
|
6468
|
-
async close() {
|
|
6469
|
-
logger$1.info('sdk webrtc closing client', { userAgent: !!this.userAgent });
|
|
6511
|
+
async close(force = false) {
|
|
6512
|
+
logger$1.info('sdk webrtc closing client', { userAgent: !!this.userAgent, force });
|
|
6513
|
+
this.forceClosed = force;
|
|
6470
6514
|
this._cleanupMedia();
|
|
6471
6515
|
this.connectionPromise = null;
|
|
6472
6516
|
|
|
@@ -6485,7 +6529,7 @@ class WebRTCClient extends Emitter {
|
|
|
6485
6529
|
this.userAgent.delegate = null;
|
|
6486
6530
|
this.userAgent.stateChange.removeAllListeners();
|
|
6487
6531
|
|
|
6488
|
-
await this._disconnectTransport();
|
|
6532
|
+
await this._disconnectTransport(force);
|
|
6489
6533
|
|
|
6490
6534
|
this._cleanupRegister();
|
|
6491
6535
|
|
|
@@ -7555,6 +7599,13 @@ class WebRTCClient extends Emitter {
|
|
|
7555
7599
|
}
|
|
7556
7600
|
|
|
7557
7601
|
_createWebRTCConfiguration(configOverrides = {}) {
|
|
7602
|
+
let { host } = this.config;
|
|
7603
|
+
let port = this.config.port || 443;
|
|
7604
|
+
|
|
7605
|
+
if (this.config.websocketSip) {
|
|
7606
|
+
[host, port = 443] = this.config.websocketSip.split(':');
|
|
7607
|
+
}
|
|
7608
|
+
|
|
7558
7609
|
const config = {
|
|
7559
7610
|
authorizationUsername: this.config.authorizationUser,
|
|
7560
7611
|
authorizationPassword: this.config.password,
|
|
@@ -7590,7 +7641,7 @@ class WebRTCClient extends Emitter {
|
|
|
7590
7641
|
},
|
|
7591
7642
|
transportOptions: {
|
|
7592
7643
|
traceSip: configOverrides.traceSip || false,
|
|
7593
|
-
wsServers: `wss://${
|
|
7644
|
+
wsServers: `wss://${host}:${port}/api/asterisk/ws`,
|
|
7594
7645
|
},
|
|
7595
7646
|
sessionDescriptionHandlerFactoryOptions: {
|
|
7596
7647
|
modifiers: [replaceLocalIpModifier],
|
|
@@ -7914,7 +7965,15 @@ class WebRTCClient extends Emitter {
|
|
|
7914
7965
|
return userAgent.UserAgent.makeURI(`sip:${target}@${this.config.host}`);
|
|
7915
7966
|
}
|
|
7916
7967
|
|
|
7917
|
-
async _disconnectTransport() {
|
|
7968
|
+
async _disconnectTransport(force = false) {
|
|
7969
|
+
if (force) {
|
|
7970
|
+
// Bypass sip.js state machine that prevent to close WS with the state `Connecting`
|
|
7971
|
+
this.userAgent.transport.disconnectResolve = () => {};
|
|
7972
|
+
// eslint-disable-next-line
|
|
7973
|
+
this.userAgent.transport._ws.close(1000);
|
|
7974
|
+
return;
|
|
7975
|
+
}
|
|
7976
|
+
|
|
7918
7977
|
// Check if `disconnectPromise` is not present to avoid `Disconnect promise must not be defined` errors.
|
|
7919
7978
|
if (this.userAgent && this.userAgent.transport && !this.userAgent.transport.disconnectPromise) {
|
|
7920
7979
|
try {
|
|
@@ -4037,6 +4037,34 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
4037
4037
|
client.get(`${baseUrl}/users/me/rooms/messages`, options),
|
|
4038
4038
|
});
|
|
4039
4039
|
|
|
4040
|
+
//
|
|
4041
|
+
|
|
4042
|
+
|
|
4043
|
+
|
|
4044
|
+
|
|
4045
|
+
|
|
4046
|
+
class MeetingStatus {
|
|
4047
|
+
|
|
4048
|
+
|
|
4049
|
+
|
|
4050
|
+
|
|
4051
|
+
constructor({
|
|
4052
|
+
full,
|
|
4053
|
+
} = {}) {
|
|
4054
|
+
this.full = full;
|
|
4055
|
+
|
|
4056
|
+
// Useful to compare instead of instanceof with minified code
|
|
4057
|
+
this.type = 'MeetingStatus';
|
|
4058
|
+
}
|
|
4059
|
+
|
|
4060
|
+
static parse(plain ) {
|
|
4061
|
+
return new MeetingStatus({
|
|
4062
|
+
full: plain.full,
|
|
4063
|
+
});
|
|
4064
|
+
}
|
|
4065
|
+
|
|
4066
|
+
}
|
|
4067
|
+
|
|
4040
4068
|
/* */
|
|
4041
4069
|
|
|
4042
4070
|
|
|
@@ -4231,6 +4259,8 @@ var calldMethods = (client , baseUrl ) => ({
|
|
|
4231
4259
|
client.put(`${baseUrl}/users/me/calls/${callId}/record/resume`, null, null,
|
|
4232
4260
|
ApiRequester.successResponseParser),
|
|
4233
4261
|
|
|
4262
|
+
guestGetMeetingStatus: (meetingUuid ) =>
|
|
4263
|
+
client.get(`${baseUrl}/guests/me/meetings/${meetingUuid}/status`).then(MeetingStatus.parse),
|
|
4234
4264
|
});
|
|
4235
4265
|
|
|
4236
4266
|
//
|
|
@@ -4037,6 +4037,34 @@ var chatdMethods = (client , baseUrl ) => ({
|
|
|
4037
4037
|
client.get(`${baseUrl}/users/me/rooms/messages`, options),
|
|
4038
4038
|
});
|
|
4039
4039
|
|
|
4040
|
+
//
|
|
4041
|
+
|
|
4042
|
+
|
|
4043
|
+
|
|
4044
|
+
|
|
4045
|
+
|
|
4046
|
+
class MeetingStatus {
|
|
4047
|
+
|
|
4048
|
+
|
|
4049
|
+
|
|
4050
|
+
|
|
4051
|
+
constructor({
|
|
4052
|
+
full,
|
|
4053
|
+
} = {}) {
|
|
4054
|
+
this.full = full;
|
|
4055
|
+
|
|
4056
|
+
// Useful to compare instead of instanceof with minified code
|
|
4057
|
+
this.type = 'MeetingStatus';
|
|
4058
|
+
}
|
|
4059
|
+
|
|
4060
|
+
static parse(plain ) {
|
|
4061
|
+
return new MeetingStatus({
|
|
4062
|
+
full: plain.full,
|
|
4063
|
+
});
|
|
4064
|
+
}
|
|
4065
|
+
|
|
4066
|
+
}
|
|
4067
|
+
|
|
4040
4068
|
/* */
|
|
4041
4069
|
|
|
4042
4070
|
|
|
@@ -4231,6 +4259,8 @@ var calldMethods = (client , baseUrl ) => ({
|
|
|
4231
4259
|
client.put(`${baseUrl}/users/me/calls/${callId}/record/resume`, null, null,
|
|
4232
4260
|
ApiRequester.successResponseParser),
|
|
4233
4261
|
|
|
4262
|
+
guestGetMeetingStatus: (meetingUuid ) =>
|
|
4263
|
+
client.get(`${baseUrl}/guests/me/meetings/${meetingUuid}/status`).then(MeetingStatus.parse),
|
|
4234
4264
|
});
|
|
4235
4265
|
|
|
4236
4266
|
//
|