@wazo/sdk 0.37.37 → 0.37.40
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 +2 -2
- package/esm/__tests__/api-client.test.js +9 -0
- package/esm/__tests__/web-rtc-client.test.js +15 -3
- package/esm/api/auth.js +2 -0
- package/esm/api-client.js +9 -0
- package/esm/checker/Checker.js +15 -3
- package/esm/checker/checks/aor.js +9 -0
- package/esm/checker/checks/api.js +9 -0
- package/esm/checker/checks/index.js +15 -3
- package/esm/checker/checks/webrtc-transport.js +15 -3
- package/esm/checker/checks/webrtc.js +15 -3
- package/esm/domain/AdHocAPIConference.js +14 -5
- package/esm/domain/Features.js +9 -0
- package/esm/domain/Phone/CTIPhone.js +9 -0
- package/esm/domain/Phone/WebRTCPhone.js +1 -1
- package/esm/domain/SwitchboardCall.js +5 -5
- package/esm/index.js +33 -14
- package/esm/service/CallApi.js +9 -0
- package/esm/service/getApiClient.js +9 -0
- package/esm/simple/Auth.js +33 -14
- package/esm/simple/Configuration.js +33 -14
- package/esm/simple/Directory.js +9 -0
- package/esm/simple/Phone.js +33 -14
- package/esm/simple/index.js +33 -14
- package/esm/simple/room/LocalParticipant.js +33 -14
- package/esm/simple/room/Participant.js +33 -14
- package/esm/simple/room/RemoteParticipant.js +33 -14
- package/esm/simple/room/Room.js +33 -14
- package/esm/simple/room/SipRoom.js +33 -14
- package/esm/simple/room/Stream.js +33 -14
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +33 -14
- package/esm/simple/utils.js +33 -14
- package/esm/web-rtc-client.js +15 -3
- package/lib/__tests__/api-client.test.js +9 -0
- package/lib/__tests__/web-rtc-client.test.js +15 -3
- package/lib/api/auth.js +2 -0
- package/lib/api-client.js +9 -0
- package/lib/checker/Checker.js +15 -3
- package/lib/checker/checks/aor.js +9 -0
- package/lib/checker/checks/api.js +9 -0
- package/lib/checker/checks/index.js +15 -3
- package/lib/checker/checks/webrtc-transport.js +15 -3
- package/lib/checker/checks/webrtc.js +15 -3
- package/lib/domain/AdHocAPIConference.js +14 -5
- package/lib/domain/Features.js +9 -0
- package/lib/domain/Phone/CTIPhone.js +9 -0
- package/lib/domain/Phone/WebRTCPhone.js +1 -1
- package/lib/domain/SwitchboardCall.js +5 -5
- package/lib/index.js +33 -14
- package/lib/service/CallApi.js +9 -0
- package/lib/service/getApiClient.js +9 -0
- package/lib/simple/Auth.js +33 -14
- package/lib/simple/Configuration.js +33 -14
- package/lib/simple/Directory.js +9 -0
- package/lib/simple/Phone.js +33 -14
- package/lib/simple/index.js +33 -14
- package/lib/simple/room/LocalParticipant.js +33 -14
- package/lib/simple/room/Participant.js +33 -14
- package/lib/simple/room/RemoteParticipant.js +33 -14
- package/lib/simple/room/Room.js +33 -14
- package/lib/simple/room/SipRoom.js +33 -14
- package/lib/simple/room/Stream.js +33 -14
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +33 -14
- package/lib/simple/utils.js +33 -14
- package/lib/web-rtc-client.js +15 -3
- package/package.json +1 -1
- package/src/api/auth.js +2 -0
- package/src/api-client.js +7 -0
- package/src/domain/AdHocAPIConference.js +5 -5
- package/src/domain/Phone/WebRTCPhone.js +1 -1
- package/src/domain/SwitchboardCall.js +5 -5
- package/src/simple/Auth.js +7 -0
- package/src/web-rtc-client.js +7 -4
|
@@ -3198,12 +3198,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
3198
3198
|
backend ,
|
|
3199
3199
|
expiration ,
|
|
3200
3200
|
isMobile = false,
|
|
3201
|
+
tenantId ,
|
|
3201
3202
|
) => {
|
|
3202
3203
|
const body = {
|
|
3203
3204
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
3204
3205
|
expiration: expiration || DETAULT_EXPIRATION,
|
|
3205
3206
|
refresh_token: refreshToken,
|
|
3206
3207
|
client_id: client.clientId,
|
|
3208
|
+
tenant_id: tenantId,
|
|
3207
3209
|
};
|
|
3208
3210
|
|
|
3209
3211
|
const headers = {
|
|
@@ -4979,6 +4981,7 @@ class ApiClient {
|
|
|
4979
4981
|
|
|
4980
4982
|
|
|
4981
4983
|
|
|
4984
|
+
|
|
4982
4985
|
|
|
4983
4986
|
|
|
4984
4987
|
|
|
@@ -5019,6 +5022,7 @@ class ApiClient {
|
|
|
5019
5022
|
logger$1.info('refresh token callback called', {
|
|
5020
5023
|
refreshToken: this.refreshToken,
|
|
5021
5024
|
refreshBackend: this.refreshBackend,
|
|
5025
|
+
refreshTenantId: this.refreshTenantId,
|
|
5022
5026
|
refreshExpiration: this.refreshExpiration,
|
|
5023
5027
|
isMobile: this.isMobile,
|
|
5024
5028
|
});
|
|
@@ -5032,6 +5036,7 @@ class ApiClient {
|
|
|
5032
5036
|
this.refreshBackend,
|
|
5033
5037
|
this.refreshExpiration,
|
|
5034
5038
|
this.isMobile,
|
|
5039
|
+
this.refreshTenantId,
|
|
5035
5040
|
);
|
|
5036
5041
|
|
|
5037
5042
|
logger$1.info('token refreshed', { token: session.token });
|
|
@@ -5073,6 +5078,10 @@ class ApiClient {
|
|
|
5073
5078
|
this.refreshBackend = refreshBackend;
|
|
5074
5079
|
}
|
|
5075
5080
|
|
|
5081
|
+
setRefreshTenantId(tenantId ) {
|
|
5082
|
+
this.refreshTenantId = tenantId;
|
|
5083
|
+
}
|
|
5084
|
+
|
|
5076
5085
|
setIsMobile(isMobile ) {
|
|
5077
5086
|
this.isMobile = isMobile;
|
|
5078
5087
|
}
|
|
@@ -2458,7 +2458,7 @@ class WebRTCPhone extends Emitter {
|
|
|
2458
2458
|
});
|
|
2459
2459
|
|
|
2460
2460
|
this.client.on(this.client.DISCONNECTED, () => {
|
|
2461
|
-
logger.
|
|
2461
|
+
logger.warn('WebRTC client disconnected');
|
|
2462
2462
|
|
|
2463
2463
|
this.eventEmitter.emit(ON_UNREGISTERED);
|
|
2464
2464
|
|
|
@@ -54,7 +54,7 @@ var updateFrom = (instance , from ) => {
|
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
|
|
@@ -80,7 +80,7 @@ class SwitchboardCall {
|
|
|
80
80
|
|
|
81
81
|
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
|
|
84
84
|
|
|
85
85
|
|
|
86
86
|
|
|
@@ -94,7 +94,7 @@ class SwitchboardCall {
|
|
|
94
94
|
callerIdName: plain.caller_id_name || null,
|
|
95
95
|
callerIdNumber: plain.caller_id_number || null,
|
|
96
96
|
participantId: plain.participantId || null,
|
|
97
|
-
|
|
97
|
+
answerTime: plain.startTime,
|
|
98
98
|
state: plain.state,
|
|
99
99
|
switchboardName: plain.switchboardName,
|
|
100
100
|
switchboardUuid: plain.switchboardUuid,
|
|
@@ -107,7 +107,7 @@ class SwitchboardCall {
|
|
|
107
107
|
callerIdName,
|
|
108
108
|
callerIdNumber,
|
|
109
109
|
participantId,
|
|
110
|
-
|
|
110
|
+
answerTime,
|
|
111
111
|
state,
|
|
112
112
|
switchboardName,
|
|
113
113
|
switchboardUuid,
|
|
@@ -117,7 +117,7 @@ class SwitchboardCall {
|
|
|
117
117
|
this.callerIdName = callerIdName;
|
|
118
118
|
this.callerIdNumber = callerIdNumber;
|
|
119
119
|
this.participantId = participantId;
|
|
120
|
-
this.
|
|
120
|
+
this.answerTime = answerTime;
|
|
121
121
|
this.state = state;
|
|
122
122
|
this.switchboardName = switchboardName;
|
|
123
123
|
this.switchboardUuid = switchboardUuid;
|
package/esm/index.js
CHANGED
|
@@ -2259,12 +2259,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2259
2259
|
backend ,
|
|
2260
2260
|
expiration ,
|
|
2261
2261
|
isMobile = false,
|
|
2262
|
+
tenantId ,
|
|
2262
2263
|
) => {
|
|
2263
2264
|
const body = {
|
|
2264
2265
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
2265
2266
|
expiration: expiration || DETAULT_EXPIRATION,
|
|
2266
2267
|
refresh_token: refreshToken,
|
|
2267
2268
|
client_id: client.clientId,
|
|
2269
|
+
tenant_id: tenantId,
|
|
2268
2270
|
};
|
|
2269
2271
|
|
|
2270
2272
|
const headers = {
|
|
@@ -5499,6 +5501,7 @@ class ApiClient {
|
|
|
5499
5501
|
|
|
5500
5502
|
|
|
5501
5503
|
|
|
5504
|
+
|
|
5502
5505
|
|
|
5503
5506
|
|
|
5504
5507
|
|
|
@@ -5539,6 +5542,7 @@ class ApiClient {
|
|
|
5539
5542
|
logger$a.info('refresh token callback called', {
|
|
5540
5543
|
refreshToken: this.refreshToken,
|
|
5541
5544
|
refreshBackend: this.refreshBackend,
|
|
5545
|
+
refreshTenantId: this.refreshTenantId,
|
|
5542
5546
|
refreshExpiration: this.refreshExpiration,
|
|
5543
5547
|
isMobile: this.isMobile,
|
|
5544
5548
|
});
|
|
@@ -5552,6 +5556,7 @@ class ApiClient {
|
|
|
5552
5556
|
this.refreshBackend,
|
|
5553
5557
|
this.refreshExpiration,
|
|
5554
5558
|
this.isMobile,
|
|
5559
|
+
this.refreshTenantId,
|
|
5555
5560
|
);
|
|
5556
5561
|
|
|
5557
5562
|
logger$a.info('token refreshed', { token: session.token });
|
|
@@ -5593,6 +5598,10 @@ class ApiClient {
|
|
|
5593
5598
|
this.refreshBackend = refreshBackend;
|
|
5594
5599
|
}
|
|
5595
5600
|
|
|
5601
|
+
setRefreshTenantId(tenantId ) {
|
|
5602
|
+
this.refreshTenantId = tenantId;
|
|
5603
|
+
}
|
|
5604
|
+
|
|
5596
5605
|
setIsMobile(isMobile ) {
|
|
5597
5606
|
this.isMobile = isMobile;
|
|
5598
5607
|
}
|
|
@@ -8266,11 +8275,14 @@ class WebRTCClient extends Emitter {
|
|
|
8266
8275
|
}
|
|
8267
8276
|
|
|
8268
8277
|
async _disconnectTransport(force = false) {
|
|
8269
|
-
if (force) {
|
|
8278
|
+
if (force && this.userAgent && this.userAgent.transport) {
|
|
8270
8279
|
// Bypass sip.js state machine that prevent to close WS with the state `Connecting`
|
|
8271
8280
|
this.userAgent.transport.disconnectResolve = () => {};
|
|
8272
|
-
|
|
8273
|
-
this.userAgent.transport._ws
|
|
8281
|
+
|
|
8282
|
+
if (this.userAgent.transport._ws) {
|
|
8283
|
+
this.userAgent.transport._ws.close(1000);
|
|
8284
|
+
}
|
|
8285
|
+
|
|
8274
8286
|
return;
|
|
8275
8287
|
}
|
|
8276
8288
|
|
|
@@ -9202,7 +9214,7 @@ class Room$1 {
|
|
|
9202
9214
|
|
|
9203
9215
|
|
|
9204
9216
|
|
|
9205
|
-
|
|
9217
|
+
|
|
9206
9218
|
|
|
9207
9219
|
|
|
9208
9220
|
|
|
@@ -9228,7 +9240,7 @@ class SwitchboardCall {
|
|
|
9228
9240
|
|
|
9229
9241
|
|
|
9230
9242
|
|
|
9231
|
-
|
|
9243
|
+
|
|
9232
9244
|
|
|
9233
9245
|
|
|
9234
9246
|
|
|
@@ -9242,7 +9254,7 @@ class SwitchboardCall {
|
|
|
9242
9254
|
callerIdName: plain.caller_id_name || null,
|
|
9243
9255
|
callerIdNumber: plain.caller_id_number || null,
|
|
9244
9256
|
participantId: plain.participantId || null,
|
|
9245
|
-
|
|
9257
|
+
answerTime: plain.startTime,
|
|
9246
9258
|
state: plain.state,
|
|
9247
9259
|
switchboardName: plain.switchboardName,
|
|
9248
9260
|
switchboardUuid: plain.switchboardUuid,
|
|
@@ -9255,7 +9267,7 @@ class SwitchboardCall {
|
|
|
9255
9267
|
callerIdName,
|
|
9256
9268
|
callerIdNumber,
|
|
9257
9269
|
participantId,
|
|
9258
|
-
|
|
9270
|
+
answerTime,
|
|
9259
9271
|
state,
|
|
9260
9272
|
switchboardName,
|
|
9261
9273
|
switchboardUuid,
|
|
@@ -9265,7 +9277,7 @@ class SwitchboardCall {
|
|
|
9265
9277
|
this.callerIdName = callerIdName;
|
|
9266
9278
|
this.callerIdNumber = callerIdNumber;
|
|
9267
9279
|
this.participantId = participantId;
|
|
9268
|
-
this.
|
|
9280
|
+
this.answerTime = answerTime;
|
|
9269
9281
|
this.state = state;
|
|
9270
9282
|
this.switchboardName = switchboardName;
|
|
9271
9283
|
this.switchboardUuid = switchboardUuid;
|
|
@@ -10843,7 +10855,7 @@ class WebRTCPhone extends Emitter {
|
|
|
10843
10855
|
});
|
|
10844
10856
|
|
|
10845
10857
|
this.client.on(this.client.DISCONNECTED, () => {
|
|
10846
|
-
logger$7.
|
|
10858
|
+
logger$7.warn('WebRTC client disconnected');
|
|
10847
10859
|
|
|
10848
10860
|
this.eventEmitter.emit(ON_UNREGISTERED);
|
|
10849
10861
|
|
|
@@ -11767,6 +11779,13 @@ class Auth {
|
|
|
11767
11779
|
expiration: this.expiration,
|
|
11768
11780
|
mobile: this.mobile,
|
|
11769
11781
|
});
|
|
11782
|
+
|
|
11783
|
+
if (backend) {
|
|
11784
|
+
getApiClient().setRefreshBackend(backend);
|
|
11785
|
+
}
|
|
11786
|
+
|
|
11787
|
+
getApiClient().setRefreshTenantId(tenantId);
|
|
11788
|
+
|
|
11770
11789
|
return this._onAuthenticated(rawSession);
|
|
11771
11790
|
}
|
|
11772
11791
|
|
|
@@ -11993,7 +12012,7 @@ var Auth$1 = global.wazoAuthInstance;
|
|
|
11993
12012
|
|
|
11994
12013
|
|
|
11995
12014
|
|
|
11996
|
-
|
|
12015
|
+
|
|
11997
12016
|
|
|
11998
12017
|
|
|
11999
12018
|
|
|
@@ -12013,7 +12032,7 @@ class AdHocAPIConference {
|
|
|
12013
12032
|
|
|
12014
12033
|
|
|
12015
12034
|
|
|
12016
|
-
|
|
12035
|
+
|
|
12017
12036
|
|
|
12018
12037
|
|
|
12019
12038
|
|
|
@@ -12025,7 +12044,7 @@ class AdHocAPIConference {
|
|
|
12025
12044
|
participants,
|
|
12026
12045
|
started,
|
|
12027
12046
|
finished,
|
|
12028
|
-
|
|
12047
|
+
answerTime,
|
|
12029
12048
|
conferenceId,
|
|
12030
12049
|
muted,
|
|
12031
12050
|
paused,
|
|
@@ -12035,7 +12054,7 @@ class AdHocAPIConference {
|
|
|
12035
12054
|
this.participants = participants || {};
|
|
12036
12055
|
this.started = started || false;
|
|
12037
12056
|
this.finished = finished || false;
|
|
12038
|
-
this.
|
|
12057
|
+
this.answerTime = answerTime;
|
|
12039
12058
|
this.conferenceId = conferenceId || '';
|
|
12040
12059
|
this.muted = muted || false;
|
|
12041
12060
|
this.paused = paused || false;
|
|
@@ -12048,7 +12067,7 @@ class AdHocAPIConference {
|
|
|
12048
12067
|
async start() {
|
|
12049
12068
|
this.started = true;
|
|
12050
12069
|
// $FlowFixMe
|
|
12051
|
-
this.
|
|
12070
|
+
this.answerTime = Object.values(this.participants).length ? Object.values(this.participants)[0].answerTime : null;
|
|
12052
12071
|
|
|
12053
12072
|
const participantIds = Object.keys(this.participants);
|
|
12054
12073
|
const conference = await getApiClient().calld.createAdHocConference(this.host.callId, participantIds);
|
package/esm/service/CallApi.js
CHANGED
|
@@ -2778,12 +2778,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2778
2778
|
backend ,
|
|
2779
2779
|
expiration ,
|
|
2780
2780
|
isMobile = false,
|
|
2781
|
+
tenantId ,
|
|
2781
2782
|
) => {
|
|
2782
2783
|
const body = {
|
|
2783
2784
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
2784
2785
|
expiration: expiration || DETAULT_EXPIRATION,
|
|
2785
2786
|
refresh_token: refreshToken,
|
|
2786
2787
|
client_id: client.clientId,
|
|
2788
|
+
tenant_id: tenantId,
|
|
2787
2789
|
};
|
|
2788
2790
|
|
|
2789
2791
|
const headers = {
|
|
@@ -4566,6 +4568,7 @@ class ApiClient {
|
|
|
4566
4568
|
|
|
4567
4569
|
|
|
4568
4570
|
|
|
4571
|
+
|
|
4569
4572
|
|
|
4570
4573
|
|
|
4571
4574
|
|
|
@@ -4606,6 +4609,7 @@ class ApiClient {
|
|
|
4606
4609
|
logger.info('refresh token callback called', {
|
|
4607
4610
|
refreshToken: this.refreshToken,
|
|
4608
4611
|
refreshBackend: this.refreshBackend,
|
|
4612
|
+
refreshTenantId: this.refreshTenantId,
|
|
4609
4613
|
refreshExpiration: this.refreshExpiration,
|
|
4610
4614
|
isMobile: this.isMobile,
|
|
4611
4615
|
});
|
|
@@ -4619,6 +4623,7 @@ class ApiClient {
|
|
|
4619
4623
|
this.refreshBackend,
|
|
4620
4624
|
this.refreshExpiration,
|
|
4621
4625
|
this.isMobile,
|
|
4626
|
+
this.refreshTenantId,
|
|
4622
4627
|
);
|
|
4623
4628
|
|
|
4624
4629
|
logger.info('token refreshed', { token: session.token });
|
|
@@ -4660,6 +4665,10 @@ class ApiClient {
|
|
|
4660
4665
|
this.refreshBackend = refreshBackend;
|
|
4661
4666
|
}
|
|
4662
4667
|
|
|
4668
|
+
setRefreshTenantId(tenantId ) {
|
|
4669
|
+
this.refreshTenantId = tenantId;
|
|
4670
|
+
}
|
|
4671
|
+
|
|
4663
4672
|
setIsMobile(isMobile ) {
|
|
4664
4673
|
this.isMobile = isMobile;
|
|
4665
4674
|
}
|
|
@@ -2238,12 +2238,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2238
2238
|
backend ,
|
|
2239
2239
|
expiration ,
|
|
2240
2240
|
isMobile = false,
|
|
2241
|
+
tenantId ,
|
|
2241
2242
|
) => {
|
|
2242
2243
|
const body = {
|
|
2243
2244
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
2244
2245
|
expiration: expiration || DETAULT_EXPIRATION,
|
|
2245
2246
|
refresh_token: refreshToken,
|
|
2246
2247
|
client_id: client.clientId,
|
|
2248
|
+
tenant_id: tenantId,
|
|
2247
2249
|
};
|
|
2248
2250
|
|
|
2249
2251
|
const headers = {
|
|
@@ -4566,6 +4568,7 @@ class ApiClient {
|
|
|
4566
4568
|
|
|
4567
4569
|
|
|
4568
4570
|
|
|
4571
|
+
|
|
4569
4572
|
|
|
4570
4573
|
|
|
4571
4574
|
|
|
@@ -4606,6 +4609,7 @@ class ApiClient {
|
|
|
4606
4609
|
logger.info('refresh token callback called', {
|
|
4607
4610
|
refreshToken: this.refreshToken,
|
|
4608
4611
|
refreshBackend: this.refreshBackend,
|
|
4612
|
+
refreshTenantId: this.refreshTenantId,
|
|
4609
4613
|
refreshExpiration: this.refreshExpiration,
|
|
4610
4614
|
isMobile: this.isMobile,
|
|
4611
4615
|
});
|
|
@@ -4619,6 +4623,7 @@ class ApiClient {
|
|
|
4619
4623
|
this.refreshBackend,
|
|
4620
4624
|
this.refreshExpiration,
|
|
4621
4625
|
this.isMobile,
|
|
4626
|
+
this.refreshTenantId,
|
|
4622
4627
|
);
|
|
4623
4628
|
|
|
4624
4629
|
logger.info('token refreshed', { token: session.token });
|
|
@@ -4660,6 +4665,10 @@ class ApiClient {
|
|
|
4660
4665
|
this.refreshBackend = refreshBackend;
|
|
4661
4666
|
}
|
|
4662
4667
|
|
|
4668
|
+
setRefreshTenantId(tenantId ) {
|
|
4669
|
+
this.refreshTenantId = tenantId;
|
|
4670
|
+
}
|
|
4671
|
+
|
|
4663
4672
|
setIsMobile(isMobile ) {
|
|
4664
4673
|
this.isMobile = isMobile;
|
|
4665
4674
|
}
|
package/esm/simple/Auth.js
CHANGED
|
@@ -2258,12 +2258,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2258
2258
|
backend ,
|
|
2259
2259
|
expiration ,
|
|
2260
2260
|
isMobile = false,
|
|
2261
|
+
tenantId ,
|
|
2261
2262
|
) => {
|
|
2262
2263
|
const body = {
|
|
2263
2264
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
2264
2265
|
expiration: expiration || DETAULT_EXPIRATION,
|
|
2265
2266
|
refresh_token: refreshToken,
|
|
2266
2267
|
client_id: client.clientId,
|
|
2268
|
+
tenant_id: tenantId,
|
|
2267
2269
|
};
|
|
2268
2270
|
|
|
2269
2271
|
const headers = {
|
|
@@ -5415,6 +5417,7 @@ class ApiClient {
|
|
|
5415
5417
|
|
|
5416
5418
|
|
|
5417
5419
|
|
|
5420
|
+
|
|
5418
5421
|
|
|
5419
5422
|
|
|
5420
5423
|
|
|
@@ -5455,6 +5458,7 @@ class ApiClient {
|
|
|
5455
5458
|
logger$a.info('refresh token callback called', {
|
|
5456
5459
|
refreshToken: this.refreshToken,
|
|
5457
5460
|
refreshBackend: this.refreshBackend,
|
|
5461
|
+
refreshTenantId: this.refreshTenantId,
|
|
5458
5462
|
refreshExpiration: this.refreshExpiration,
|
|
5459
5463
|
isMobile: this.isMobile,
|
|
5460
5464
|
});
|
|
@@ -5468,6 +5472,7 @@ class ApiClient {
|
|
|
5468
5472
|
this.refreshBackend,
|
|
5469
5473
|
this.refreshExpiration,
|
|
5470
5474
|
this.isMobile,
|
|
5475
|
+
this.refreshTenantId,
|
|
5471
5476
|
);
|
|
5472
5477
|
|
|
5473
5478
|
logger$a.info('token refreshed', { token: session.token });
|
|
@@ -5509,6 +5514,10 @@ class ApiClient {
|
|
|
5509
5514
|
this.refreshBackend = refreshBackend;
|
|
5510
5515
|
}
|
|
5511
5516
|
|
|
5517
|
+
setRefreshTenantId(tenantId ) {
|
|
5518
|
+
this.refreshTenantId = tenantId;
|
|
5519
|
+
}
|
|
5520
|
+
|
|
5512
5521
|
setIsMobile(isMobile ) {
|
|
5513
5522
|
this.isMobile = isMobile;
|
|
5514
5523
|
}
|
|
@@ -5631,7 +5640,7 @@ var getApiClient = (forServer ) => {
|
|
|
5631
5640
|
|
|
5632
5641
|
|
|
5633
5642
|
|
|
5634
|
-
|
|
5643
|
+
|
|
5635
5644
|
|
|
5636
5645
|
|
|
5637
5646
|
|
|
@@ -5651,7 +5660,7 @@ class AdHocAPIConference {
|
|
|
5651
5660
|
|
|
5652
5661
|
|
|
5653
5662
|
|
|
5654
|
-
|
|
5663
|
+
|
|
5655
5664
|
|
|
5656
5665
|
|
|
5657
5666
|
|
|
@@ -5663,7 +5672,7 @@ class AdHocAPIConference {
|
|
|
5663
5672
|
participants,
|
|
5664
5673
|
started,
|
|
5665
5674
|
finished,
|
|
5666
|
-
|
|
5675
|
+
answerTime,
|
|
5667
5676
|
conferenceId,
|
|
5668
5677
|
muted,
|
|
5669
5678
|
paused,
|
|
@@ -5673,7 +5682,7 @@ class AdHocAPIConference {
|
|
|
5673
5682
|
this.participants = participants || {};
|
|
5674
5683
|
this.started = started || false;
|
|
5675
5684
|
this.finished = finished || false;
|
|
5676
|
-
this.
|
|
5685
|
+
this.answerTime = answerTime;
|
|
5677
5686
|
this.conferenceId = conferenceId || '';
|
|
5678
5687
|
this.muted = muted || false;
|
|
5679
5688
|
this.paused = paused || false;
|
|
@@ -5686,7 +5695,7 @@ class AdHocAPIConference {
|
|
|
5686
5695
|
async start() {
|
|
5687
5696
|
this.started = true;
|
|
5688
5697
|
// $FlowFixMe
|
|
5689
|
-
this.
|
|
5698
|
+
this.answerTime = Object.values(this.participants).length ? Object.values(this.participants)[0].answerTime : null;
|
|
5690
5699
|
|
|
5691
5700
|
const participantIds = Object.keys(this.participants);
|
|
5692
5701
|
const conference = await getApiClient().calld.createAdHocConference(this.host.callId, participantIds);
|
|
@@ -8444,11 +8453,14 @@ class WebRTCClient extends Emitter {
|
|
|
8444
8453
|
}
|
|
8445
8454
|
|
|
8446
8455
|
async _disconnectTransport(force = false) {
|
|
8447
|
-
if (force) {
|
|
8456
|
+
if (force && this.userAgent && this.userAgent.transport) {
|
|
8448
8457
|
// Bypass sip.js state machine that prevent to close WS with the state `Connecting`
|
|
8449
8458
|
this.userAgent.transport.disconnectResolve = () => {};
|
|
8450
|
-
|
|
8451
|
-
this.userAgent.transport._ws
|
|
8459
|
+
|
|
8460
|
+
if (this.userAgent.transport._ws) {
|
|
8461
|
+
this.userAgent.transport._ws.close(1000);
|
|
8462
|
+
}
|
|
8463
|
+
|
|
8452
8464
|
return;
|
|
8453
8465
|
}
|
|
8454
8466
|
|
|
@@ -10120,7 +10132,7 @@ class WebRTCPhone extends Emitter {
|
|
|
10120
10132
|
});
|
|
10121
10133
|
|
|
10122
10134
|
this.client.on(this.client.DISCONNECTED, () => {
|
|
10123
|
-
logger$8.
|
|
10135
|
+
logger$8.warn('WebRTC client disconnected');
|
|
10124
10136
|
|
|
10125
10137
|
this.eventEmitter.emit(ON_UNREGISTERED);
|
|
10126
10138
|
|
|
@@ -12980,7 +12992,7 @@ class Room {
|
|
|
12980
12992
|
|
|
12981
12993
|
|
|
12982
12994
|
|
|
12983
|
-
|
|
12995
|
+
|
|
12984
12996
|
|
|
12985
12997
|
|
|
12986
12998
|
|
|
@@ -13006,7 +13018,7 @@ class SwitchboardCall {
|
|
|
13006
13018
|
|
|
13007
13019
|
|
|
13008
13020
|
|
|
13009
|
-
|
|
13021
|
+
|
|
13010
13022
|
|
|
13011
13023
|
|
|
13012
13024
|
|
|
@@ -13020,7 +13032,7 @@ class SwitchboardCall {
|
|
|
13020
13032
|
callerIdName: plain.caller_id_name || null,
|
|
13021
13033
|
callerIdNumber: plain.caller_id_number || null,
|
|
13022
13034
|
participantId: plain.participantId || null,
|
|
13023
|
-
|
|
13035
|
+
answerTime: plain.startTime,
|
|
13024
13036
|
state: plain.state,
|
|
13025
13037
|
switchboardName: plain.switchboardName,
|
|
13026
13038
|
switchboardUuid: plain.switchboardUuid,
|
|
@@ -13033,7 +13045,7 @@ class SwitchboardCall {
|
|
|
13033
13045
|
callerIdName,
|
|
13034
13046
|
callerIdNumber,
|
|
13035
13047
|
participantId,
|
|
13036
|
-
|
|
13048
|
+
answerTime,
|
|
13037
13049
|
state,
|
|
13038
13050
|
switchboardName,
|
|
13039
13051
|
switchboardUuid,
|
|
@@ -13043,7 +13055,7 @@ class SwitchboardCall {
|
|
|
13043
13055
|
this.callerIdName = callerIdName;
|
|
13044
13056
|
this.callerIdNumber = callerIdNumber;
|
|
13045
13057
|
this.participantId = participantId;
|
|
13046
|
-
this.
|
|
13058
|
+
this.answerTime = answerTime;
|
|
13047
13059
|
this.state = state;
|
|
13048
13060
|
this.switchboardName = switchboardName;
|
|
13049
13061
|
this.switchboardUuid = switchboardUuid;
|
|
@@ -13764,6 +13776,13 @@ class Auth {
|
|
|
13764
13776
|
expiration: this.expiration,
|
|
13765
13777
|
mobile: this.mobile,
|
|
13766
13778
|
});
|
|
13779
|
+
|
|
13780
|
+
if (backend) {
|
|
13781
|
+
getApiClient().setRefreshBackend(backend);
|
|
13782
|
+
}
|
|
13783
|
+
|
|
13784
|
+
getApiClient().setRefreshTenantId(tenantId);
|
|
13785
|
+
|
|
13767
13786
|
return this._onAuthenticated(rawSession);
|
|
13768
13787
|
}
|
|
13769
13788
|
|