@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.
Files changed (74) hide show
  1. package/README.md +2 -1
  2. package/dist/wazo-sdk.js +2 -2
  3. package/esm/__tests__/api-client.test.js +9 -0
  4. package/esm/__tests__/web-rtc-client.test.js +15 -3
  5. package/esm/api/auth.js +2 -0
  6. package/esm/api-client.js +9 -0
  7. package/esm/checker/Checker.js +15 -3
  8. package/esm/checker/checks/aor.js +9 -0
  9. package/esm/checker/checks/api.js +9 -0
  10. package/esm/checker/checks/index.js +15 -3
  11. package/esm/checker/checks/webrtc-transport.js +15 -3
  12. package/esm/checker/checks/webrtc.js +15 -3
  13. package/esm/domain/AdHocAPIConference.js +14 -5
  14. package/esm/domain/Features.js +9 -0
  15. package/esm/domain/Phone/CTIPhone.js +9 -0
  16. package/esm/domain/Phone/WebRTCPhone.js +1 -1
  17. package/esm/domain/SwitchboardCall.js +5 -5
  18. package/esm/index.js +33 -14
  19. package/esm/service/CallApi.js +9 -0
  20. package/esm/service/getApiClient.js +9 -0
  21. package/esm/simple/Auth.js +33 -14
  22. package/esm/simple/Configuration.js +33 -14
  23. package/esm/simple/Directory.js +9 -0
  24. package/esm/simple/Phone.js +33 -14
  25. package/esm/simple/index.js +33 -14
  26. package/esm/simple/room/LocalParticipant.js +33 -14
  27. package/esm/simple/room/Participant.js +33 -14
  28. package/esm/simple/room/RemoteParticipant.js +33 -14
  29. package/esm/simple/room/Room.js +33 -14
  30. package/esm/simple/room/SipRoom.js +33 -14
  31. package/esm/simple/room/Stream.js +33 -14
  32. package/esm/simple/room/__tests__/RemoteParticipant.test.js +33 -14
  33. package/esm/simple/utils.js +33 -14
  34. package/esm/web-rtc-client.js +15 -3
  35. package/lib/__tests__/api-client.test.js +9 -0
  36. package/lib/__tests__/web-rtc-client.test.js +15 -3
  37. package/lib/api/auth.js +2 -0
  38. package/lib/api-client.js +9 -0
  39. package/lib/checker/Checker.js +15 -3
  40. package/lib/checker/checks/aor.js +9 -0
  41. package/lib/checker/checks/api.js +9 -0
  42. package/lib/checker/checks/index.js +15 -3
  43. package/lib/checker/checks/webrtc-transport.js +15 -3
  44. package/lib/checker/checks/webrtc.js +15 -3
  45. package/lib/domain/AdHocAPIConference.js +14 -5
  46. package/lib/domain/Features.js +9 -0
  47. package/lib/domain/Phone/CTIPhone.js +9 -0
  48. package/lib/domain/Phone/WebRTCPhone.js +1 -1
  49. package/lib/domain/SwitchboardCall.js +5 -5
  50. package/lib/index.js +33 -14
  51. package/lib/service/CallApi.js +9 -0
  52. package/lib/service/getApiClient.js +9 -0
  53. package/lib/simple/Auth.js +33 -14
  54. package/lib/simple/Configuration.js +33 -14
  55. package/lib/simple/Directory.js +9 -0
  56. package/lib/simple/Phone.js +33 -14
  57. package/lib/simple/index.js +33 -14
  58. package/lib/simple/room/LocalParticipant.js +33 -14
  59. package/lib/simple/room/Participant.js +33 -14
  60. package/lib/simple/room/RemoteParticipant.js +33 -14
  61. package/lib/simple/room/Room.js +33 -14
  62. package/lib/simple/room/SipRoom.js +33 -14
  63. package/lib/simple/room/Stream.js +33 -14
  64. package/lib/simple/room/__tests__/RemoteParticipant.test.js +33 -14
  65. package/lib/simple/utils.js +33 -14
  66. package/lib/web-rtc-client.js +15 -3
  67. package/package.json +1 -1
  68. package/src/api/auth.js +2 -0
  69. package/src/api-client.js +7 -0
  70. package/src/domain/AdHocAPIConference.js +5 -5
  71. package/src/domain/Phone/WebRTCPhone.js +1 -1
  72. package/src/domain/SwitchboardCall.js +5 -5
  73. package/src/simple/Auth.js +7 -0
  74. package/src/web-rtc-client.js +7 -4
@@ -2268,12 +2268,14 @@ var authMethods = (client , baseUrl ) => ({
2268
2268
  backend ,
2269
2269
  expiration ,
2270
2270
  isMobile = false,
2271
+ tenantId ,
2271
2272
  ) => {
2272
2273
  const body = {
2273
2274
  backend: backend || DEFAULT_BACKEND_USER,
2274
2275
  expiration: expiration || DETAULT_EXPIRATION,
2275
2276
  refresh_token: refreshToken,
2276
2277
  client_id: client.clientId,
2278
+ tenant_id: tenantId,
2277
2279
  };
2278
2280
 
2279
2281
  const headers = {
@@ -5425,6 +5427,7 @@ class ApiClient {
5425
5427
 
5426
5428
 
5427
5429
 
5430
+
5428
5431
 
5429
5432
 
5430
5433
 
@@ -5465,6 +5468,7 @@ class ApiClient {
5465
5468
  logger$a.info('refresh token callback called', {
5466
5469
  refreshToken: this.refreshToken,
5467
5470
  refreshBackend: this.refreshBackend,
5471
+ refreshTenantId: this.refreshTenantId,
5468
5472
  refreshExpiration: this.refreshExpiration,
5469
5473
  isMobile: this.isMobile,
5470
5474
  });
@@ -5478,6 +5482,7 @@ class ApiClient {
5478
5482
  this.refreshBackend,
5479
5483
  this.refreshExpiration,
5480
5484
  this.isMobile,
5485
+ this.refreshTenantId,
5481
5486
  );
5482
5487
 
5483
5488
  logger$a.info('token refreshed', { token: session.token });
@@ -5519,6 +5524,10 @@ class ApiClient {
5519
5524
  this.refreshBackend = refreshBackend;
5520
5525
  }
5521
5526
 
5527
+ setRefreshTenantId(tenantId ) {
5528
+ this.refreshTenantId = tenantId;
5529
+ }
5530
+
5522
5531
  setIsMobile(isMobile ) {
5523
5532
  this.isMobile = isMobile;
5524
5533
  }
@@ -5641,7 +5650,7 @@ var getApiClient = (forServer ) => {
5641
5650
 
5642
5651
 
5643
5652
 
5644
-
5653
+
5645
5654
 
5646
5655
 
5647
5656
 
@@ -5661,7 +5670,7 @@ class AdHocAPIConference {
5661
5670
 
5662
5671
 
5663
5672
 
5664
-
5673
+
5665
5674
 
5666
5675
 
5667
5676
 
@@ -5673,7 +5682,7 @@ class AdHocAPIConference {
5673
5682
  participants,
5674
5683
  started,
5675
5684
  finished,
5676
- startTime,
5685
+ answerTime,
5677
5686
  conferenceId,
5678
5687
  muted,
5679
5688
  paused,
@@ -5683,7 +5692,7 @@ class AdHocAPIConference {
5683
5692
  this.participants = participants || {};
5684
5693
  this.started = started || false;
5685
5694
  this.finished = finished || false;
5686
- this.startTime = startTime;
5695
+ this.answerTime = answerTime;
5687
5696
  this.conferenceId = conferenceId || '';
5688
5697
  this.muted = muted || false;
5689
5698
  this.paused = paused || false;
@@ -5696,7 +5705,7 @@ class AdHocAPIConference {
5696
5705
  async start() {
5697
5706
  this.started = true;
5698
5707
  // $FlowFixMe
5699
- this.startTime = Object.values(this.participants).length ? Object.values(this.participants)[0].startTime : null;
5708
+ this.answerTime = Object.values(this.participants).length ? Object.values(this.participants)[0].answerTime : null;
5700
5709
 
5701
5710
  const participantIds = Object.keys(this.participants);
5702
5711
  const conference = await getApiClient().calld.createAdHocConference(this.host.callId, participantIds);
@@ -8454,11 +8463,14 @@ class WebRTCClient extends Emitter {
8454
8463
  }
8455
8464
 
8456
8465
  async _disconnectTransport(force = false) {
8457
- if (force) {
8466
+ if (force && this.userAgent && this.userAgent.transport) {
8458
8467
  // Bypass sip.js state machine that prevent to close WS with the state `Connecting`
8459
8468
  this.userAgent.transport.disconnectResolve = () => {};
8460
- // eslint-disable-next-line
8461
- this.userAgent.transport._ws.close(1000);
8469
+
8470
+ if (this.userAgent.transport._ws) {
8471
+ this.userAgent.transport._ws.close(1000);
8472
+ }
8473
+
8462
8474
  return;
8463
8475
  }
8464
8476
 
@@ -10130,7 +10142,7 @@ class WebRTCPhone extends Emitter {
10130
10142
  });
10131
10143
 
10132
10144
  this.client.on(this.client.DISCONNECTED, () => {
10133
- logger$8.info('WebRTC client disconnected');
10145
+ logger$8.warn('WebRTC client disconnected');
10134
10146
 
10135
10147
  this.eventEmitter.emit(ON_UNREGISTERED);
10136
10148
 
@@ -12973,7 +12985,7 @@ class Room {
12973
12985
 
12974
12986
 
12975
12987
 
12976
-
12988
+
12977
12989
 
12978
12990
 
12979
12991
 
@@ -12999,7 +13011,7 @@ class SwitchboardCall {
12999
13011
 
13000
13012
 
13001
13013
 
13002
-
13014
+
13003
13015
 
13004
13016
 
13005
13017
 
@@ -13013,7 +13025,7 @@ class SwitchboardCall {
13013
13025
  callerIdName: plain.caller_id_name || null,
13014
13026
  callerIdNumber: plain.caller_id_number || null,
13015
13027
  participantId: plain.participantId || null,
13016
- startTime: plain.startTime,
13028
+ answerTime: plain.startTime,
13017
13029
  state: plain.state,
13018
13030
  switchboardName: plain.switchboardName,
13019
13031
  switchboardUuid: plain.switchboardUuid,
@@ -13026,7 +13038,7 @@ class SwitchboardCall {
13026
13038
  callerIdName,
13027
13039
  callerIdNumber,
13028
13040
  participantId,
13029
- startTime,
13041
+ answerTime,
13030
13042
  state,
13031
13043
  switchboardName,
13032
13044
  switchboardUuid,
@@ -13036,7 +13048,7 @@ class SwitchboardCall {
13036
13048
  this.callerIdName = callerIdName;
13037
13049
  this.callerIdNumber = callerIdNumber;
13038
13050
  this.participantId = participantId;
13039
- this.startTime = startTime;
13051
+ this.answerTime = answerTime;
13040
13052
  this.state = state;
13041
13053
  this.switchboardName = switchboardName;
13042
13054
  this.switchboardUuid = switchboardUuid;
@@ -13757,6 +13769,13 @@ class Auth {
13757
13769
  expiration: this.expiration,
13758
13770
  mobile: this.mobile,
13759
13771
  });
13772
+
13773
+ if (backend) {
13774
+ getApiClient().setRefreshBackend(backend);
13775
+ }
13776
+
13777
+ getApiClient().setRefreshTenantId(tenantId);
13778
+
13760
13779
  return this._onAuthenticated(rawSession);
13761
13780
  }
13762
13781
 
@@ -2244,12 +2244,14 @@ var authMethods = (client , baseUrl ) => ({
2244
2244
  backend ,
2245
2245
  expiration ,
2246
2246
  isMobile = false,
2247
+ tenantId ,
2247
2248
  ) => {
2248
2249
  const body = {
2249
2250
  backend: backend || DEFAULT_BACKEND_USER,
2250
2251
  expiration: expiration || DETAULT_EXPIRATION,
2251
2252
  refresh_token: refreshToken,
2252
2253
  client_id: client.clientId,
2254
+ tenant_id: tenantId,
2253
2255
  };
2254
2256
 
2255
2257
  const headers = {
@@ -4572,6 +4574,7 @@ class ApiClient {
4572
4574
 
4573
4575
 
4574
4576
 
4577
+
4575
4578
 
4576
4579
 
4577
4580
 
@@ -4612,6 +4615,7 @@ class ApiClient {
4612
4615
  logger.info('refresh token callback called', {
4613
4616
  refreshToken: this.refreshToken,
4614
4617
  refreshBackend: this.refreshBackend,
4618
+ refreshTenantId: this.refreshTenantId,
4615
4619
  refreshExpiration: this.refreshExpiration,
4616
4620
  isMobile: this.isMobile,
4617
4621
  });
@@ -4625,6 +4629,7 @@ class ApiClient {
4625
4629
  this.refreshBackend,
4626
4630
  this.refreshExpiration,
4627
4631
  this.isMobile,
4632
+ this.refreshTenantId,
4628
4633
  );
4629
4634
 
4630
4635
  logger.info('token refreshed', { token: session.token });
@@ -4666,6 +4671,10 @@ class ApiClient {
4666
4671
  this.refreshBackend = refreshBackend;
4667
4672
  }
4668
4673
 
4674
+ setRefreshTenantId(tenantId ) {
4675
+ this.refreshTenantId = tenantId;
4676
+ }
4677
+
4669
4678
  setIsMobile(isMobile ) {
4670
4679
  this.isMobile = isMobile;
4671
4680
  }
@@ -2871,12 +2871,14 @@ var authMethods = (client , baseUrl ) => ({
2871
2871
  backend ,
2872
2872
  expiration ,
2873
2873
  isMobile = false,
2874
+ tenantId ,
2874
2875
  ) => {
2875
2876
  const body = {
2876
2877
  backend: backend || DEFAULT_BACKEND_USER,
2877
2878
  expiration: expiration || DETAULT_EXPIRATION,
2878
2879
  refresh_token: refreshToken,
2879
2880
  client_id: client.clientId,
2881
+ tenant_id: tenantId,
2880
2882
  };
2881
2883
 
2882
2884
  const headers = {
@@ -5425,6 +5427,7 @@ class ApiClient {
5425
5427
 
5426
5428
 
5427
5429
 
5430
+
5428
5431
 
5429
5432
 
5430
5433
 
@@ -5465,6 +5468,7 @@ class ApiClient {
5465
5468
  logger$a.info('refresh token callback called', {
5466
5469
  refreshToken: this.refreshToken,
5467
5470
  refreshBackend: this.refreshBackend,
5471
+ refreshTenantId: this.refreshTenantId,
5468
5472
  refreshExpiration: this.refreshExpiration,
5469
5473
  isMobile: this.isMobile,
5470
5474
  });
@@ -5478,6 +5482,7 @@ class ApiClient {
5478
5482
  this.refreshBackend,
5479
5483
  this.refreshExpiration,
5480
5484
  this.isMobile,
5485
+ this.refreshTenantId,
5481
5486
  );
5482
5487
 
5483
5488
  logger$a.info('token refreshed', { token: session.token });
@@ -5519,6 +5524,10 @@ class ApiClient {
5519
5524
  this.refreshBackend = refreshBackend;
5520
5525
  }
5521
5526
 
5527
+ setRefreshTenantId(tenantId ) {
5528
+ this.refreshTenantId = tenantId;
5529
+ }
5530
+
5522
5531
  setIsMobile(isMobile ) {
5523
5532
  this.isMobile = isMobile;
5524
5533
  }
@@ -5641,7 +5650,7 @@ var getApiClient = (forServer ) => {
5641
5650
 
5642
5651
 
5643
5652
 
5644
-
5653
+
5645
5654
 
5646
5655
 
5647
5656
 
@@ -5661,7 +5670,7 @@ class AdHocAPIConference {
5661
5670
 
5662
5671
 
5663
5672
 
5664
-
5673
+
5665
5674
 
5666
5675
 
5667
5676
 
@@ -5673,7 +5682,7 @@ class AdHocAPIConference {
5673
5682
  participants,
5674
5683
  started,
5675
5684
  finished,
5676
- startTime,
5685
+ answerTime,
5677
5686
  conferenceId,
5678
5687
  muted,
5679
5688
  paused,
@@ -5683,7 +5692,7 @@ class AdHocAPIConference {
5683
5692
  this.participants = participants || {};
5684
5693
  this.started = started || false;
5685
5694
  this.finished = finished || false;
5686
- this.startTime = startTime;
5695
+ this.answerTime = answerTime;
5687
5696
  this.conferenceId = conferenceId || '';
5688
5697
  this.muted = muted || false;
5689
5698
  this.paused = paused || false;
@@ -5696,7 +5705,7 @@ class AdHocAPIConference {
5696
5705
  async start() {
5697
5706
  this.started = true;
5698
5707
  // $FlowFixMe
5699
- this.startTime = Object.values(this.participants).length ? Object.values(this.participants)[0].startTime : null;
5708
+ this.answerTime = Object.values(this.participants).length ? Object.values(this.participants)[0].answerTime : null;
5700
5709
 
5701
5710
  const participantIds = Object.keys(this.participants);
5702
5711
  const conference = await getApiClient().calld.createAdHocConference(this.host.callId, participantIds);
@@ -8454,11 +8463,14 @@ class WebRTCClient extends Emitter {
8454
8463
  }
8455
8464
 
8456
8465
  async _disconnectTransport(force = false) {
8457
- if (force) {
8466
+ if (force && this.userAgent && this.userAgent.transport) {
8458
8467
  // Bypass sip.js state machine that prevent to close WS with the state `Connecting`
8459
8468
  this.userAgent.transport.disconnectResolve = () => {};
8460
- // eslint-disable-next-line
8461
- this.userAgent.transport._ws.close(1000);
8469
+
8470
+ if (this.userAgent.transport._ws) {
8471
+ this.userAgent.transport._ws.close(1000);
8472
+ }
8473
+
8462
8474
  return;
8463
8475
  }
8464
8476
 
@@ -10130,7 +10142,7 @@ class WebRTCPhone extends Emitter {
10130
10142
  });
10131
10143
 
10132
10144
  this.client.on(this.client.DISCONNECTED, () => {
10133
- logger$8.info('WebRTC client disconnected');
10145
+ logger$8.warn('WebRTC client disconnected');
10134
10146
 
10135
10147
  this.eventEmitter.emit(ON_UNREGISTERED);
10136
10148
 
@@ -10458,6 +10470,13 @@ class Auth {
10458
10470
  expiration: this.expiration,
10459
10471
  mobile: this.mobile,
10460
10472
  });
10473
+
10474
+ if (backend) {
10475
+ getApiClient().setRefreshBackend(backend);
10476
+ }
10477
+
10478
+ getApiClient().setRefreshTenantId(tenantId);
10479
+
10461
10480
  return this._onAuthenticated(rawSession);
10462
10481
  }
10463
10482
 
@@ -12855,7 +12874,7 @@ class Room {
12855
12874
 
12856
12875
 
12857
12876
 
12858
-
12877
+
12859
12878
 
12860
12879
 
12861
12880
 
@@ -12881,7 +12900,7 @@ class SwitchboardCall {
12881
12900
 
12882
12901
 
12883
12902
 
12884
-
12903
+
12885
12904
 
12886
12905
 
12887
12906
 
@@ -12895,7 +12914,7 @@ class SwitchboardCall {
12895
12914
  callerIdName: plain.caller_id_name || null,
12896
12915
  callerIdNumber: plain.caller_id_number || null,
12897
12916
  participantId: plain.participantId || null,
12898
- startTime: plain.startTime,
12917
+ answerTime: plain.startTime,
12899
12918
  state: plain.state,
12900
12919
  switchboardName: plain.switchboardName,
12901
12920
  switchboardUuid: plain.switchboardUuid,
@@ -12908,7 +12927,7 @@ class SwitchboardCall {
12908
12927
  callerIdName,
12909
12928
  callerIdNumber,
12910
12929
  participantId,
12911
- startTime,
12930
+ answerTime,
12912
12931
  state,
12913
12932
  switchboardName,
12914
12933
  switchboardUuid,
@@ -12918,7 +12937,7 @@ class SwitchboardCall {
12918
12937
  this.callerIdName = callerIdName;
12919
12938
  this.callerIdNumber = callerIdNumber;
12920
12939
  this.participantId = participantId;
12921
- this.startTime = startTime;
12940
+ this.answerTime = answerTime;
12922
12941
  this.state = state;
12923
12942
  this.switchboardName = switchboardName;
12924
12943
  this.switchboardUuid = switchboardUuid;
@@ -2268,12 +2268,14 @@ var authMethods = (client , baseUrl ) => ({
2268
2268
  backend ,
2269
2269
  expiration ,
2270
2270
  isMobile = false,
2271
+ tenantId ,
2271
2272
  ) => {
2272
2273
  const body = {
2273
2274
  backend: backend || DEFAULT_BACKEND_USER,
2274
2275
  expiration: expiration || DETAULT_EXPIRATION,
2275
2276
  refresh_token: refreshToken,
2276
2277
  client_id: client.clientId,
2278
+ tenant_id: tenantId,
2277
2279
  };
2278
2280
 
2279
2281
  const headers = {
@@ -5425,6 +5427,7 @@ class ApiClient {
5425
5427
 
5426
5428
 
5427
5429
 
5430
+
5428
5431
 
5429
5432
 
5430
5433
 
@@ -5465,6 +5468,7 @@ class ApiClient {
5465
5468
  logger$a.info('refresh token callback called', {
5466
5469
  refreshToken: this.refreshToken,
5467
5470
  refreshBackend: this.refreshBackend,
5471
+ refreshTenantId: this.refreshTenantId,
5468
5472
  refreshExpiration: this.refreshExpiration,
5469
5473
  isMobile: this.isMobile,
5470
5474
  });
@@ -5478,6 +5482,7 @@ class ApiClient {
5478
5482
  this.refreshBackend,
5479
5483
  this.refreshExpiration,
5480
5484
  this.isMobile,
5485
+ this.refreshTenantId,
5481
5486
  );
5482
5487
 
5483
5488
  logger$a.info('token refreshed', { token: session.token });
@@ -5519,6 +5524,10 @@ class ApiClient {
5519
5524
  this.refreshBackend = refreshBackend;
5520
5525
  }
5521
5526
 
5527
+ setRefreshTenantId(tenantId ) {
5528
+ this.refreshTenantId = tenantId;
5529
+ }
5530
+
5522
5531
  setIsMobile(isMobile ) {
5523
5532
  this.isMobile = isMobile;
5524
5533
  }
@@ -5690,6 +5699,13 @@ class Auth {
5690
5699
  expiration: this.expiration,
5691
5700
  mobile: this.mobile,
5692
5701
  });
5702
+
5703
+ if (backend) {
5704
+ getApiClient().setRefreshBackend(backend);
5705
+ }
5706
+
5707
+ getApiClient().setRefreshTenantId(tenantId);
5708
+
5693
5709
  return this._onAuthenticated(rawSession);
5694
5710
  }
5695
5711
 
@@ -5916,7 +5932,7 @@ var Auth$1 = global.wazoAuthInstance;
5916
5932
 
5917
5933
 
5918
5934
 
5919
-
5935
+
5920
5936
 
5921
5937
 
5922
5938
 
@@ -5936,7 +5952,7 @@ class AdHocAPIConference {
5936
5952
 
5937
5953
 
5938
5954
 
5939
-
5955
+
5940
5956
 
5941
5957
 
5942
5958
 
@@ -5948,7 +5964,7 @@ class AdHocAPIConference {
5948
5964
  participants,
5949
5965
  started,
5950
5966
  finished,
5951
- startTime,
5967
+ answerTime,
5952
5968
  conferenceId,
5953
5969
  muted,
5954
5970
  paused,
@@ -5958,7 +5974,7 @@ class AdHocAPIConference {
5958
5974
  this.participants = participants || {};
5959
5975
  this.started = started || false;
5960
5976
  this.finished = finished || false;
5961
- this.startTime = startTime;
5977
+ this.answerTime = answerTime;
5962
5978
  this.conferenceId = conferenceId || '';
5963
5979
  this.muted = muted || false;
5964
5980
  this.paused = paused || false;
@@ -5971,7 +5987,7 @@ class AdHocAPIConference {
5971
5987
  async start() {
5972
5988
  this.started = true;
5973
5989
  // $FlowFixMe
5974
- this.startTime = Object.values(this.participants).length ? Object.values(this.participants)[0].startTime : null;
5990
+ this.answerTime = Object.values(this.participants).length ? Object.values(this.participants)[0].answerTime : null;
5975
5991
 
5976
5992
  const participantIds = Object.keys(this.participants);
5977
5993
  const conference = await getApiClient().calld.createAdHocConference(this.host.callId, participantIds);
@@ -8729,11 +8745,14 @@ class WebRTCClient extends Emitter {
8729
8745
  }
8730
8746
 
8731
8747
  async _disconnectTransport(force = false) {
8732
- if (force) {
8748
+ if (force && this.userAgent && this.userAgent.transport) {
8733
8749
  // Bypass sip.js state machine that prevent to close WS with the state `Connecting`
8734
8750
  this.userAgent.transport.disconnectResolve = () => {};
8735
- // eslint-disable-next-line
8736
- this.userAgent.transport._ws.close(1000);
8751
+
8752
+ if (this.userAgent.transport._ws) {
8753
+ this.userAgent.transport._ws.close(1000);
8754
+ }
8755
+
8737
8756
  return;
8738
8757
  }
8739
8758
 
@@ -10405,7 +10424,7 @@ class WebRTCPhone extends Emitter {
10405
10424
  });
10406
10425
 
10407
10426
  this.client.on(this.client.DISCONNECTED, () => {
10408
- logger$7.info('WebRTC client disconnected');
10427
+ logger$7.warn('WebRTC client disconnected');
10409
10428
 
10410
10429
  this.eventEmitter.emit(ON_UNREGISTERED);
10411
10430
 
@@ -13265,7 +13284,7 @@ class Room {
13265
13284
 
13266
13285
 
13267
13286
 
13268
-
13287
+
13269
13288
 
13270
13289
 
13271
13290
 
@@ -13291,7 +13310,7 @@ class SwitchboardCall {
13291
13310
 
13292
13311
 
13293
13312
 
13294
-
13313
+
13295
13314
 
13296
13315
 
13297
13316
 
@@ -13305,7 +13324,7 @@ class SwitchboardCall {
13305
13324
  callerIdName: plain.caller_id_name || null,
13306
13325
  callerIdNumber: plain.caller_id_number || null,
13307
13326
  participantId: plain.participantId || null,
13308
- startTime: plain.startTime,
13327
+ answerTime: plain.startTime,
13309
13328
  state: plain.state,
13310
13329
  switchboardName: plain.switchboardName,
13311
13330
  switchboardUuid: plain.switchboardUuid,
@@ -13318,7 +13337,7 @@ class SwitchboardCall {
13318
13337
  callerIdName,
13319
13338
  callerIdNumber,
13320
13339
  participantId,
13321
- startTime,
13340
+ answerTime,
13322
13341
  state,
13323
13342
  switchboardName,
13324
13343
  switchboardUuid,
@@ -13328,7 +13347,7 @@ class SwitchboardCall {
13328
13347
  this.callerIdName = callerIdName;
13329
13348
  this.callerIdNumber = callerIdNumber;
13330
13349
  this.participantId = participantId;
13331
- this.startTime = startTime;
13350
+ this.answerTime = answerTime;
13332
13351
  this.state = state;
13333
13352
  this.switchboardName = switchboardName;
13334
13353
  this.switchboardUuid = switchboardUuid;