@wazo/sdk 0.37.35 → 0.37.36

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 (94) hide show
  1. package/README.md +1 -0
  2. package/dist/wazo-sdk.js +2 -2
  3. package/esm/__tests__/api-client.test.js +7 -1
  4. package/esm/__tests__/web-rtc-client.test.js +7 -1
  5. package/esm/api/call-logd.js +1 -1
  6. package/esm/api/chatd.js +6 -0
  7. package/esm/api/confd.js +6 -0
  8. package/esm/api-client.js +7 -1
  9. package/esm/checker/Checker.js +7 -1
  10. package/esm/checker/checks/aor.js +7 -1
  11. package/esm/checker/checks/api.js +7 -1
  12. package/esm/checker/checks/index.js +7 -1
  13. package/esm/checker/checks/webrtc-transport.js +7 -1
  14. package/esm/checker/checks/webrtc.js +7 -1
  15. package/esm/domain/AdHocAPIConference.js +11 -1
  16. package/esm/domain/CallLog.js +1 -1
  17. package/esm/domain/CallSession.js +14 -0
  18. package/esm/domain/Features.js +7 -1
  19. package/esm/domain/Phone/CTIPhone.js +21 -1
  20. package/esm/domain/Phone/WebRTCPhone.js +42 -11
  21. package/esm/domain/Profile.js +6 -0
  22. package/esm/domain/__tests__/CallLog.test.js +5 -1
  23. package/esm/domain/__tests__/CallSession.test.js +14 -0
  24. package/esm/domain/__tests__/IndirectTransfer.test.js +14 -0
  25. package/esm/domain/__tests__/Profile.test.js +6 -0
  26. package/esm/domain/__tests__/Room.test.js +14 -0
  27. package/esm/domain/__tests__/Session.test.js +6 -0
  28. package/esm/index.js +59 -18
  29. package/esm/service/CallApi.js +7 -1
  30. package/esm/service/getApiClient.js +7 -1
  31. package/esm/simple/Auth.js +59 -18
  32. package/esm/simple/Configuration.js +59 -18
  33. package/esm/simple/Directory.js +7 -1
  34. package/esm/simple/Phone.js +59 -18
  35. package/esm/simple/index.js +59 -18
  36. package/esm/simple/room/LocalParticipant.js +59 -18
  37. package/esm/simple/room/Participant.js +59 -18
  38. package/esm/simple/room/RemoteParticipant.js +59 -18
  39. package/esm/simple/room/Room.js +59 -18
  40. package/esm/simple/room/SipRoom.js +59 -18
  41. package/esm/simple/room/Stream.js +59 -18
  42. package/esm/simple/room/__tests__/RemoteParticipant.test.js +59 -18
  43. package/esm/simple/utils.js +59 -18
  44. package/esm/web-rtc-client.js +7 -1
  45. package/lib/__tests__/api-client.test.js +7 -1
  46. package/lib/__tests__/web-rtc-client.test.js +7 -1
  47. package/lib/api/call-logd.js +1 -1
  48. package/lib/api/chatd.js +6 -0
  49. package/lib/api/confd.js +6 -0
  50. package/lib/api-client.js +7 -1
  51. package/lib/checker/Checker.js +7 -1
  52. package/lib/checker/checks/aor.js +7 -1
  53. package/lib/checker/checks/api.js +7 -1
  54. package/lib/checker/checks/index.js +7 -1
  55. package/lib/checker/checks/webrtc-transport.js +7 -1
  56. package/lib/checker/checks/webrtc.js +7 -1
  57. package/lib/domain/AdHocAPIConference.js +11 -1
  58. package/lib/domain/CallLog.js +1 -1
  59. package/lib/domain/CallSession.js +14 -0
  60. package/lib/domain/Features.js +7 -1
  61. package/lib/domain/Phone/CTIPhone.js +21 -1
  62. package/lib/domain/Phone/WebRTCPhone.js +42 -11
  63. package/lib/domain/Profile.js +6 -0
  64. package/lib/domain/__tests__/CallLog.test.js +5 -1
  65. package/lib/domain/__tests__/CallSession.test.js +14 -0
  66. package/lib/domain/__tests__/IndirectTransfer.test.js +14 -0
  67. package/lib/domain/__tests__/Profile.test.js +6 -0
  68. package/lib/domain/__tests__/Room.test.js +14 -0
  69. package/lib/domain/__tests__/Session.test.js +6 -0
  70. package/lib/index.js +59 -18
  71. package/lib/service/CallApi.js +7 -1
  72. package/lib/service/getApiClient.js +7 -1
  73. package/lib/simple/Auth.js +59 -18
  74. package/lib/simple/Configuration.js +59 -18
  75. package/lib/simple/Directory.js +7 -1
  76. package/lib/simple/Phone.js +59 -18
  77. package/lib/simple/index.js +59 -18
  78. package/lib/simple/room/LocalParticipant.js +59 -18
  79. package/lib/simple/room/Participant.js +59 -18
  80. package/lib/simple/room/RemoteParticipant.js +59 -18
  81. package/lib/simple/room/Room.js +59 -18
  82. package/lib/simple/room/SipRoom.js +59 -18
  83. package/lib/simple/room/Stream.js +59 -18
  84. package/lib/simple/room/__tests__/RemoteParticipant.test.js +59 -18
  85. package/lib/simple/utils.js +59 -18
  86. package/lib/web-rtc-client.js +7 -1
  87. package/package.json +1 -1
  88. package/src/domain/AdHocAPIConference.js +4 -0
  89. package/src/domain/CallLog.js +1 -1
  90. package/src/domain/CallSession.js +14 -0
  91. package/src/domain/Phone/WebRTCPhone.js +28 -11
  92. package/src/domain/Profile.js +6 -0
  93. package/src/domain/__tests__/CallLog.test.js +4 -0
  94. package/src/simple/Phone.js +6 -6
@@ -1097,6 +1097,7 @@ const LINE_STATE = {
1097
1097
 
1098
1098
 
1099
1099
 
1100
+
1100
1101
 
1101
1102
 
1102
1103
 
@@ -1133,6 +1134,7 @@ const LINE_STATE = {
1133
1134
 
1134
1135
 
1135
1136
 
1137
+
1136
1138
 
1137
1139
 
1138
1140
 
@@ -1164,6 +1166,7 @@ class Profile {
1164
1166
 
1165
1167
 
1166
1168
 
1169
+
1167
1170
 
1168
1171
 
1169
1172
 
@@ -1180,6 +1183,7 @@ class Profile {
1180
1183
  lines: plain.lines.map(line => Line.parse(line)),
1181
1184
  username: plain.username,
1182
1185
  mobileNumber: plain.mobile_phone_number || '',
1186
+ ringSeconds: plain.ring_seconds,
1183
1187
  forwards: [
1184
1188
  ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
1185
1189
  ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
@@ -1216,6 +1220,7 @@ class Profile {
1216
1220
  switchboards,
1217
1221
  agent,
1218
1222
  status,
1223
+ ringSeconds,
1219
1224
  sipLines,
1220
1225
  callPickupTargetUsers,
1221
1226
  onlineCallRecordEnabled,
@@ -1237,6 +1242,7 @@ class Profile {
1237
1242
  this.status = status;
1238
1243
  this.callPickupTargetUsers = callPickupTargetUsers;
1239
1244
  this.onlineCallRecordEnabled = onlineCallRecordEnabled;
1245
+ this.ringSeconds = ringSeconds;
1240
1246
 
1241
1247
  this.sipLines = sipLines || [];
1242
1248
  }
@@ -3306,6 +3312,7 @@ var updateFrom = (instance , from ) => {
3306
3312
 
3307
3313
 
3308
3314
 
3315
+
3309
3316
 
3310
3317
 
3311
3318
  class CallSession {
@@ -3368,6 +3375,8 @@ class CallSession {
3368
3375
 
3369
3376
 
3370
3377
 
3378
+
3379
+
3371
3380
 
3372
3381
 
3373
3382
 
@@ -3399,6 +3408,7 @@ class CallSession {
3399
3408
  videoRemotelyDowngraded,
3400
3409
  sipSession,
3401
3410
  answerTime,
3411
+ conference,
3402
3412
  } ) {
3403
3413
  this.callId = callId;
3404
3414
  this.sipCallId = sipCallId;
@@ -3427,6 +3437,7 @@ class CallSession {
3427
3437
  this.videoRemotelyDowngraded = videoRemotelyDowngraded;
3428
3438
  this.sipSession = sipSession;
3429
3439
  this.answerTime = answerTime || this.answerTime;
3440
+ this.conference = conference;
3430
3441
 
3431
3442
  // Useful to compare instead of instanceof with minified code
3432
3443
  this.type = 'CallSession';
@@ -3484,6 +3495,10 @@ class CallSession {
3484
3495
  this.screensharing = false;
3485
3496
  }
3486
3497
 
3498
+ setIsConference(conference ) {
3499
+ this.conference = conference;
3500
+ }
3501
+
3487
3502
  isIncoming() {
3488
3503
  return !this.isCaller && !this.answered;
3489
3504
  }
@@ -3560,6 +3575,10 @@ class CallSession {
3560
3575
  return this.sipStatus === SessionState.Terminated;
3561
3576
  }
3562
3577
 
3578
+ isConference() {
3579
+ return this.conference;
3580
+ }
3581
+
3563
3582
  getElapsedTimeInSeconds() {
3564
3583
  if (!this.startTime) {
3565
3584
  return 0;
@@ -3651,6 +3670,7 @@ class CallSession {
3651
3670
  cameraEnabled: false,
3652
3671
  dialedExtension: call.dialedExtension,
3653
3672
  call,
3673
+ conference: false, // @FIXME?
3654
3674
  });
3655
3675
  }
3656
3676
  }
@@ -3720,7 +3740,7 @@ class Recording {
3720
3740
 
3721
3741
 
3722
3742
 
3723
-
3743
+
3724
3744
 
3725
3745
 
3726
3746
 
@@ -5920,6 +5940,10 @@ class AdHocAPIConference {
5920
5940
  this.conferenceId = conferenceId || '';
5921
5941
  this.muted = muted || false;
5922
5942
  this.paused = paused || false;
5943
+
5944
+ if (this.host) {
5945
+ this.host.setIsConference(true);
5946
+ }
5923
5947
  }
5924
5948
 
5925
5949
  async start() {
@@ -9629,7 +9653,11 @@ class WebRTCPhone extends Emitter {
9629
9653
  accept(callSession , cameraEnabled ) {
9630
9654
  logger$7.info('WebRTC phone - accept call', { id: callSession ? callSession.getId() : 'n/a', cameraEnabled });
9631
9655
  if (this.currentSipSession) {
9632
- this.holdSipSession(this.currentSipSession, this.currentCallSession, true);
9656
+ this.holdSipSession(
9657
+ this.currentSipSession,
9658
+ this.currentCallSession,
9659
+ true,
9660
+ );
9633
9661
  }
9634
9662
 
9635
9663
  if (!callSession) {
@@ -9722,22 +9750,22 @@ class WebRTCPhone extends Emitter {
9722
9750
  }
9723
9751
  }
9724
9752
 
9725
- hold(callSession , withEvent = true, isConference = false) {
9753
+ hold(callSession , withEvent = true) {
9726
9754
  logger$7.info('WebRTC hold', { id: callSession.getId() });
9727
9755
 
9728
9756
  const sipSession = this.findSipSession(callSession);
9729
9757
 
9730
- return sipSession ? this.holdSipSession(sipSession, callSession, withEvent, isConference) : null;
9758
+ return sipSession ? this.holdSipSession(sipSession, callSession, withEvent) : null;
9731
9759
  }
9732
9760
 
9733
9761
  // @Deprecated
9734
- unhold(callSession , withEvent = true, isConference = false) {
9762
+ unhold(callSession , withEvent = true) {
9735
9763
  console.warn('Please note that `phone.unhold()` is being deprecated; `phone.resume()` is the preferred method');
9736
9764
 
9737
- return this.resume(callSession, isConference, withEvent);
9765
+ return this.resume(callSession, withEvent);
9738
9766
  }
9739
9767
 
9740
- resume(callSession , isConference = false, withEvent = true) {
9768
+ resume(callSession , withEvent = true) {
9741
9769
  logger$7.info('WebRTC resume called', { id: callSession ? callSession.getId() : null });
9742
9770
 
9743
9771
  const sipSession = this.findSipSession(callSession);
@@ -9750,10 +9778,14 @@ class WebRTCPhone extends Emitter {
9750
9778
  // Hold current session if different from the current one (we don't want 2 sessions active at the same time).
9751
9779
  if (this.currentSipSession && this.currentSipSession.id !== sipSession.id) {
9752
9780
  logger$7.info('WebRTC hold call after resume', { id: this.currentSipSession.id });
9753
- this.holdSipSession(this.currentSipSession, this.currentCallSession);
9781
+ this.holdSipSession(
9782
+ this.currentSipSession,
9783
+ this.currentCallSession,
9784
+ withEvent,
9785
+ );
9754
9786
  }
9755
9787
 
9756
- const promise = this.unholdSipSession(sipSession, callSession, withEvent, isConference);
9788
+ const promise = this.unholdSipSession(sipSession, callSession, withEvent);
9757
9789
  this.currentSipSession = sipSession;
9758
9790
  if (callSession) {
9759
9791
  this.currentCallSession = callSession;
@@ -9766,7 +9798,6 @@ class WebRTCPhone extends Emitter {
9766
9798
  sipSession ,
9767
9799
  callSession ,
9768
9800
  withEvent = true,
9769
- isConference = false,
9770
9801
  ) {
9771
9802
  if (!sipSession) {
9772
9803
  return new Promise((resolve, reject) => reject(new Error('No session to hold')));
@@ -9787,6 +9818,8 @@ class WebRTCPhone extends Emitter {
9787
9818
  await this.client.downgradeToAudio(sipSession);
9788
9819
  }
9789
9820
 
9821
+ const isConference = !!callSession && callSession.isConference();
9822
+
9790
9823
  const promise = this.client.hold(sipSession, isConference, hasVideo);
9791
9824
  if (withEvent) {
9792
9825
  this.eventEmitter.emit(ON_CALL_HELD, this._createCallSession(sipSession, callSession));
@@ -9799,11 +9832,13 @@ class WebRTCPhone extends Emitter {
9799
9832
  sipSession ,
9800
9833
  callSession ,
9801
9834
  withEvent = true,
9802
- isConference = false,
9803
9835
  ) {
9804
9836
  if (!sipSession) {
9805
9837
  return new Promise((resolve, reject) => reject(new Error('No session to unhold')));
9806
9838
  }
9839
+
9840
+ const isConference = !!callSession && callSession.isConference();
9841
+
9807
9842
  const sessionId = this.getSipSessionId(sipSession);
9808
9843
  logger$7.info('WebRTC unhold sip session', { sessionId, isConference });
9809
9844
 
@@ -9945,7 +9980,11 @@ class WebRTCPhone extends Emitter {
9945
9980
  await this.client.register();
9946
9981
  }
9947
9982
  if (this.currentSipSession) {
9948
- this.holdSipSession(this.currentSipSession, this.currentCallSession, true).catch(e => {
9983
+ this.holdSipSession(
9984
+ this.currentSipSession,
9985
+ this.currentCallSession,
9986
+ true,
9987
+ ).catch(e => {
9949
9988
  logger$7.warn('Unable to hold current session when making another call', e);
9950
9989
  });
9951
9990
  }
@@ -9960,6 +9999,7 @@ class WebRTCPhone extends Emitter {
9960
9999
  return Promise.resolve(null);
9961
10000
  }
9962
10001
  const callSession = this._createOutgoingCallSession(sipSession, cameraEnabled || false);
10002
+ callSession.setIsConference(conference);
9963
10003
  callSession.creationTime = new Date();
9964
10004
  this._updateCallSession(callSession);
9965
10005
 
@@ -10538,6 +10578,7 @@ class WebRTCPhone extends Emitter {
10538
10578
  recording: fromSession ? fromSession.isRecording() : false,
10539
10579
  recordingPaused: false, // @TODO
10540
10580
  sipSession,
10581
+ conference: !!fromSession && fromSession.isConference(),
10541
10582
  ...extra,
10542
10583
  });
10543
10584
 
@@ -10794,16 +10835,16 @@ class Phone extends Emitter {
10794
10835
  }
10795
10836
  }
10796
10837
 
10797
- hold(callSession , isConference = false) {
10798
- return this.phone && this.phone.hold(callSession, true, isConference);
10838
+ hold(callSession ) {
10839
+ return this.phone && this.phone.hold(callSession, true);
10799
10840
  }
10800
10841
 
10801
- unhold(callSession , isConference = false) {
10802
- return this.phone && this.phone.unhold(callSession, true, isConference);
10842
+ unhold(callSession ) {
10843
+ return this.phone && this.phone.unhold(callSession, true);
10803
10844
  }
10804
10845
 
10805
- resume(callSession , isConference = false) {
10806
- return this.phone && this.phone.resume(callSession, isConference);
10846
+ resume(callSession ) {
10847
+ return this.phone && this.phone.resume(callSession);
10807
10848
  }
10808
10849
 
10809
10850
  reject(callSession ) {
@@ -1097,6 +1097,7 @@ const LINE_STATE = {
1097
1097
 
1098
1098
 
1099
1099
 
1100
+
1100
1101
 
1101
1102
 
1102
1103
 
@@ -1133,6 +1134,7 @@ const LINE_STATE = {
1133
1134
 
1134
1135
 
1135
1136
 
1137
+
1136
1138
 
1137
1139
 
1138
1140
 
@@ -1164,6 +1166,7 @@ class Profile {
1164
1166
 
1165
1167
 
1166
1168
 
1169
+
1167
1170
 
1168
1171
 
1169
1172
 
@@ -1180,6 +1183,7 @@ class Profile {
1180
1183
  lines: plain.lines.map(line => Line.parse(line)),
1181
1184
  username: plain.username,
1182
1185
  mobileNumber: plain.mobile_phone_number || '',
1186
+ ringSeconds: plain.ring_seconds,
1183
1187
  forwards: [
1184
1188
  ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
1185
1189
  ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
@@ -1216,6 +1220,7 @@ class Profile {
1216
1220
  switchboards,
1217
1221
  agent,
1218
1222
  status,
1223
+ ringSeconds,
1219
1224
  sipLines,
1220
1225
  callPickupTargetUsers,
1221
1226
  onlineCallRecordEnabled,
@@ -1237,6 +1242,7 @@ class Profile {
1237
1242
  this.status = status;
1238
1243
  this.callPickupTargetUsers = callPickupTargetUsers;
1239
1244
  this.onlineCallRecordEnabled = onlineCallRecordEnabled;
1245
+ this.ringSeconds = ringSeconds;
1240
1246
 
1241
1247
  this.sipLines = sipLines || [];
1242
1248
  }
@@ -3306,6 +3312,7 @@ var updateFrom = (instance , from ) => {
3306
3312
 
3307
3313
 
3308
3314
 
3315
+
3309
3316
 
3310
3317
 
3311
3318
  class CallSession {
@@ -3368,6 +3375,8 @@ class CallSession {
3368
3375
 
3369
3376
 
3370
3377
 
3378
+
3379
+
3371
3380
 
3372
3381
 
3373
3382
 
@@ -3399,6 +3408,7 @@ class CallSession {
3399
3408
  videoRemotelyDowngraded,
3400
3409
  sipSession,
3401
3410
  answerTime,
3411
+ conference,
3402
3412
  } ) {
3403
3413
  this.callId = callId;
3404
3414
  this.sipCallId = sipCallId;
@@ -3427,6 +3437,7 @@ class CallSession {
3427
3437
  this.videoRemotelyDowngraded = videoRemotelyDowngraded;
3428
3438
  this.sipSession = sipSession;
3429
3439
  this.answerTime = answerTime || this.answerTime;
3440
+ this.conference = conference;
3430
3441
 
3431
3442
  // Useful to compare instead of instanceof with minified code
3432
3443
  this.type = 'CallSession';
@@ -3484,6 +3495,10 @@ class CallSession {
3484
3495
  this.screensharing = false;
3485
3496
  }
3486
3497
 
3498
+ setIsConference(conference ) {
3499
+ this.conference = conference;
3500
+ }
3501
+
3487
3502
  isIncoming() {
3488
3503
  return !this.isCaller && !this.answered;
3489
3504
  }
@@ -3560,6 +3575,10 @@ class CallSession {
3560
3575
  return this.sipStatus === SessionState.Terminated;
3561
3576
  }
3562
3577
 
3578
+ isConference() {
3579
+ return this.conference;
3580
+ }
3581
+
3563
3582
  getElapsedTimeInSeconds() {
3564
3583
  if (!this.startTime) {
3565
3584
  return 0;
@@ -3651,6 +3670,7 @@ class CallSession {
3651
3670
  cameraEnabled: false,
3652
3671
  dialedExtension: call.dialedExtension,
3653
3672
  call,
3673
+ conference: false, // @FIXME?
3654
3674
  });
3655
3675
  }
3656
3676
  }
@@ -3720,7 +3740,7 @@ class Recording {
3720
3740
 
3721
3741
 
3722
3742
 
3723
-
3743
+
3724
3744
 
3725
3745
 
3726
3746
 
@@ -5920,6 +5940,10 @@ class AdHocAPIConference {
5920
5940
  this.conferenceId = conferenceId || '';
5921
5941
  this.muted = muted || false;
5922
5942
  this.paused = paused || false;
5943
+
5944
+ if (this.host) {
5945
+ this.host.setIsConference(true);
5946
+ }
5923
5947
  }
5924
5948
 
5925
5949
  async start() {
@@ -9629,7 +9653,11 @@ class WebRTCPhone extends Emitter {
9629
9653
  accept(callSession , cameraEnabled ) {
9630
9654
  logger$7.info('WebRTC phone - accept call', { id: callSession ? callSession.getId() : 'n/a', cameraEnabled });
9631
9655
  if (this.currentSipSession) {
9632
- this.holdSipSession(this.currentSipSession, this.currentCallSession, true);
9656
+ this.holdSipSession(
9657
+ this.currentSipSession,
9658
+ this.currentCallSession,
9659
+ true,
9660
+ );
9633
9661
  }
9634
9662
 
9635
9663
  if (!callSession) {
@@ -9722,22 +9750,22 @@ class WebRTCPhone extends Emitter {
9722
9750
  }
9723
9751
  }
9724
9752
 
9725
- hold(callSession , withEvent = true, isConference = false) {
9753
+ hold(callSession , withEvent = true) {
9726
9754
  logger$7.info('WebRTC hold', { id: callSession.getId() });
9727
9755
 
9728
9756
  const sipSession = this.findSipSession(callSession);
9729
9757
 
9730
- return sipSession ? this.holdSipSession(sipSession, callSession, withEvent, isConference) : null;
9758
+ return sipSession ? this.holdSipSession(sipSession, callSession, withEvent) : null;
9731
9759
  }
9732
9760
 
9733
9761
  // @Deprecated
9734
- unhold(callSession , withEvent = true, isConference = false) {
9762
+ unhold(callSession , withEvent = true) {
9735
9763
  console.warn('Please note that `phone.unhold()` is being deprecated; `phone.resume()` is the preferred method');
9736
9764
 
9737
- return this.resume(callSession, isConference, withEvent);
9765
+ return this.resume(callSession, withEvent);
9738
9766
  }
9739
9767
 
9740
- resume(callSession , isConference = false, withEvent = true) {
9768
+ resume(callSession , withEvent = true) {
9741
9769
  logger$7.info('WebRTC resume called', { id: callSession ? callSession.getId() : null });
9742
9770
 
9743
9771
  const sipSession = this.findSipSession(callSession);
@@ -9750,10 +9778,14 @@ class WebRTCPhone extends Emitter {
9750
9778
  // Hold current session if different from the current one (we don't want 2 sessions active at the same time).
9751
9779
  if (this.currentSipSession && this.currentSipSession.id !== sipSession.id) {
9752
9780
  logger$7.info('WebRTC hold call after resume', { id: this.currentSipSession.id });
9753
- this.holdSipSession(this.currentSipSession, this.currentCallSession);
9781
+ this.holdSipSession(
9782
+ this.currentSipSession,
9783
+ this.currentCallSession,
9784
+ withEvent,
9785
+ );
9754
9786
  }
9755
9787
 
9756
- const promise = this.unholdSipSession(sipSession, callSession, withEvent, isConference);
9788
+ const promise = this.unholdSipSession(sipSession, callSession, withEvent);
9757
9789
  this.currentSipSession = sipSession;
9758
9790
  if (callSession) {
9759
9791
  this.currentCallSession = callSession;
@@ -9766,7 +9798,6 @@ class WebRTCPhone extends Emitter {
9766
9798
  sipSession ,
9767
9799
  callSession ,
9768
9800
  withEvent = true,
9769
- isConference = false,
9770
9801
  ) {
9771
9802
  if (!sipSession) {
9772
9803
  return new Promise((resolve, reject) => reject(new Error('No session to hold')));
@@ -9787,6 +9818,8 @@ class WebRTCPhone extends Emitter {
9787
9818
  await this.client.downgradeToAudio(sipSession);
9788
9819
  }
9789
9820
 
9821
+ const isConference = !!callSession && callSession.isConference();
9822
+
9790
9823
  const promise = this.client.hold(sipSession, isConference, hasVideo);
9791
9824
  if (withEvent) {
9792
9825
  this.eventEmitter.emit(ON_CALL_HELD, this._createCallSession(sipSession, callSession));
@@ -9799,11 +9832,13 @@ class WebRTCPhone extends Emitter {
9799
9832
  sipSession ,
9800
9833
  callSession ,
9801
9834
  withEvent = true,
9802
- isConference = false,
9803
9835
  ) {
9804
9836
  if (!sipSession) {
9805
9837
  return new Promise((resolve, reject) => reject(new Error('No session to unhold')));
9806
9838
  }
9839
+
9840
+ const isConference = !!callSession && callSession.isConference();
9841
+
9807
9842
  const sessionId = this.getSipSessionId(sipSession);
9808
9843
  logger$7.info('WebRTC unhold sip session', { sessionId, isConference });
9809
9844
 
@@ -9945,7 +9980,11 @@ class WebRTCPhone extends Emitter {
9945
9980
  await this.client.register();
9946
9981
  }
9947
9982
  if (this.currentSipSession) {
9948
- this.holdSipSession(this.currentSipSession, this.currentCallSession, true).catch(e => {
9983
+ this.holdSipSession(
9984
+ this.currentSipSession,
9985
+ this.currentCallSession,
9986
+ true,
9987
+ ).catch(e => {
9949
9988
  logger$7.warn('Unable to hold current session when making another call', e);
9950
9989
  });
9951
9990
  }
@@ -9960,6 +9999,7 @@ class WebRTCPhone extends Emitter {
9960
9999
  return Promise.resolve(null);
9961
10000
  }
9962
10001
  const callSession = this._createOutgoingCallSession(sipSession, cameraEnabled || false);
10002
+ callSession.setIsConference(conference);
9963
10003
  callSession.creationTime = new Date();
9964
10004
  this._updateCallSession(callSession);
9965
10005
 
@@ -10538,6 +10578,7 @@ class WebRTCPhone extends Emitter {
10538
10578
  recording: fromSession ? fromSession.isRecording() : false,
10539
10579
  recordingPaused: false, // @TODO
10540
10580
  sipSession,
10581
+ conference: !!fromSession && fromSession.isConference(),
10541
10582
  ...extra,
10542
10583
  });
10543
10584
 
@@ -10794,16 +10835,16 @@ class Phone extends Emitter {
10794
10835
  }
10795
10836
  }
10796
10837
 
10797
- hold(callSession , isConference = false) {
10798
- return this.phone && this.phone.hold(callSession, true, isConference);
10838
+ hold(callSession ) {
10839
+ return this.phone && this.phone.hold(callSession, true);
10799
10840
  }
10800
10841
 
10801
- unhold(callSession , isConference = false) {
10802
- return this.phone && this.phone.unhold(callSession, true, isConference);
10842
+ unhold(callSession ) {
10843
+ return this.phone && this.phone.unhold(callSession, true);
10803
10844
  }
10804
10845
 
10805
- resume(callSession , isConference = false) {
10806
- return this.phone && this.phone.resume(callSession, isConference);
10846
+ resume(callSession ) {
10847
+ return this.phone && this.phone.resume(callSession);
10807
10848
  }
10808
10849
 
10809
10850
  reject(callSession ) {