@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
@@ -394,6 +394,7 @@ const LINE_STATE = {
394
394
 
395
395
 
396
396
 
397
+
397
398
 
398
399
 
399
400
 
@@ -430,6 +431,7 @@ const LINE_STATE = {
430
431
 
431
432
 
432
433
 
434
+
433
435
 
434
436
 
435
437
 
@@ -461,6 +463,7 @@ class Profile {
461
463
 
462
464
 
463
465
 
466
+
464
467
 
465
468
 
466
469
 
@@ -477,6 +480,7 @@ class Profile {
477
480
  lines: plain.lines.map(line => Line.parse(line)),
478
481
  username: plain.username,
479
482
  mobileNumber: plain.mobile_phone_number || '',
483
+ ringSeconds: plain.ring_seconds,
480
484
  forwards: [
481
485
  ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
482
486
  ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
@@ -513,6 +517,7 @@ class Profile {
513
517
  switchboards,
514
518
  agent,
515
519
  status,
520
+ ringSeconds,
516
521
  sipLines,
517
522
  callPickupTargetUsers,
518
523
  onlineCallRecordEnabled,
@@ -534,6 +539,7 @@ class Profile {
534
539
  this.status = status;
535
540
  this.callPickupTargetUsers = callPickupTargetUsers;
536
541
  this.onlineCallRecordEnabled = onlineCallRecordEnabled;
542
+ this.ringSeconds = ringSeconds;
537
543
 
538
544
  this.sipLines = sipLines || [];
539
545
  }
@@ -3290,6 +3296,7 @@ var updateFrom = (instance , from ) => {
3290
3296
 
3291
3297
 
3292
3298
 
3299
+
3293
3300
 
3294
3301
 
3295
3302
  class CallSession {
@@ -3352,6 +3359,8 @@ class CallSession {
3352
3359
 
3353
3360
 
3354
3361
 
3362
+
3363
+
3355
3364
 
3356
3365
 
3357
3366
 
@@ -3383,6 +3392,7 @@ class CallSession {
3383
3392
  videoRemotelyDowngraded,
3384
3393
  sipSession,
3385
3394
  answerTime,
3395
+ conference,
3386
3396
  } ) {
3387
3397
  this.callId = callId;
3388
3398
  this.sipCallId = sipCallId;
@@ -3411,6 +3421,7 @@ class CallSession {
3411
3421
  this.videoRemotelyDowngraded = videoRemotelyDowngraded;
3412
3422
  this.sipSession = sipSession;
3413
3423
  this.answerTime = answerTime || this.answerTime;
3424
+ this.conference = conference;
3414
3425
 
3415
3426
  // Useful to compare instead of instanceof with minified code
3416
3427
  this.type = 'CallSession';
@@ -3468,6 +3479,10 @@ class CallSession {
3468
3479
  this.screensharing = false;
3469
3480
  }
3470
3481
 
3482
+ setIsConference(conference ) {
3483
+ this.conference = conference;
3484
+ }
3485
+
3471
3486
  isIncoming() {
3472
3487
  return !this.isCaller && !this.answered;
3473
3488
  }
@@ -3544,6 +3559,10 @@ class CallSession {
3544
3559
  return this.sipStatus === sessionState.SessionState.Terminated;
3545
3560
  }
3546
3561
 
3562
+ isConference() {
3563
+ return this.conference;
3564
+ }
3565
+
3547
3566
  getElapsedTimeInSeconds() {
3548
3567
  if (!this.startTime) {
3549
3568
  return 0;
@@ -3635,6 +3654,7 @@ class CallSession {
3635
3654
  cameraEnabled: false,
3636
3655
  dialedExtension: call.dialedExtension,
3637
3656
  call,
3657
+ conference: false, // @FIXME?
3638
3658
  });
3639
3659
  }
3640
3660
  }
@@ -3730,7 +3750,7 @@ class Recording {
3730
3750
 
3731
3751
 
3732
3752
 
3733
-
3753
+
3734
3754
 
3735
3755
 
3736
3756
 
@@ -5930,6 +5950,10 @@ class AdHocAPIConference {
5930
5950
  this.conferenceId = conferenceId || '';
5931
5951
  this.muted = muted || false;
5932
5952
  this.paused = paused || false;
5953
+
5954
+ if (this.host) {
5955
+ this.host.setIsConference(true);
5956
+ }
5933
5957
  }
5934
5958
 
5935
5959
  async start() {
@@ -9639,7 +9663,11 @@ class WebRTCPhone extends Emitter {
9639
9663
  accept(callSession , cameraEnabled ) {
9640
9664
  logger$7.info('WebRTC phone - accept call', { id: callSession ? callSession.getId() : 'n/a', cameraEnabled });
9641
9665
  if (this.currentSipSession) {
9642
- this.holdSipSession(this.currentSipSession, this.currentCallSession, true);
9666
+ this.holdSipSession(
9667
+ this.currentSipSession,
9668
+ this.currentCallSession,
9669
+ true,
9670
+ );
9643
9671
  }
9644
9672
 
9645
9673
  if (!callSession) {
@@ -9732,22 +9760,22 @@ class WebRTCPhone extends Emitter {
9732
9760
  }
9733
9761
  }
9734
9762
 
9735
- hold(callSession , withEvent = true, isConference = false) {
9763
+ hold(callSession , withEvent = true) {
9736
9764
  logger$7.info('WebRTC hold', { id: callSession.getId() });
9737
9765
 
9738
9766
  const sipSession = this.findSipSession(callSession);
9739
9767
 
9740
- return sipSession ? this.holdSipSession(sipSession, callSession, withEvent, isConference) : null;
9768
+ return sipSession ? this.holdSipSession(sipSession, callSession, withEvent) : null;
9741
9769
  }
9742
9770
 
9743
9771
  // @Deprecated
9744
- unhold(callSession , withEvent = true, isConference = false) {
9772
+ unhold(callSession , withEvent = true) {
9745
9773
  console.warn('Please note that `phone.unhold()` is being deprecated; `phone.resume()` is the preferred method');
9746
9774
 
9747
- return this.resume(callSession, isConference, withEvent);
9775
+ return this.resume(callSession, withEvent);
9748
9776
  }
9749
9777
 
9750
- resume(callSession , isConference = false, withEvent = true) {
9778
+ resume(callSession , withEvent = true) {
9751
9779
  logger$7.info('WebRTC resume called', { id: callSession ? callSession.getId() : null });
9752
9780
 
9753
9781
  const sipSession = this.findSipSession(callSession);
@@ -9760,10 +9788,14 @@ class WebRTCPhone extends Emitter {
9760
9788
  // Hold current session if different from the current one (we don't want 2 sessions active at the same time).
9761
9789
  if (this.currentSipSession && this.currentSipSession.id !== sipSession.id) {
9762
9790
  logger$7.info('WebRTC hold call after resume', { id: this.currentSipSession.id });
9763
- this.holdSipSession(this.currentSipSession, this.currentCallSession);
9791
+ this.holdSipSession(
9792
+ this.currentSipSession,
9793
+ this.currentCallSession,
9794
+ withEvent,
9795
+ );
9764
9796
  }
9765
9797
 
9766
- const promise = this.unholdSipSession(sipSession, callSession, withEvent, isConference);
9798
+ const promise = this.unholdSipSession(sipSession, callSession, withEvent);
9767
9799
  this.currentSipSession = sipSession;
9768
9800
  if (callSession) {
9769
9801
  this.currentCallSession = callSession;
@@ -9776,7 +9808,6 @@ class WebRTCPhone extends Emitter {
9776
9808
  sipSession ,
9777
9809
  callSession ,
9778
9810
  withEvent = true,
9779
- isConference = false,
9780
9811
  ) {
9781
9812
  if (!sipSession) {
9782
9813
  return new Promise((resolve, reject) => reject(new Error('No session to hold')));
@@ -9797,6 +9828,8 @@ class WebRTCPhone extends Emitter {
9797
9828
  await this.client.downgradeToAudio(sipSession);
9798
9829
  }
9799
9830
 
9831
+ const isConference = !!callSession && callSession.isConference();
9832
+
9800
9833
  const promise = this.client.hold(sipSession, isConference, hasVideo);
9801
9834
  if (withEvent) {
9802
9835
  this.eventEmitter.emit(ON_CALL_HELD, this._createCallSession(sipSession, callSession));
@@ -9809,11 +9842,13 @@ class WebRTCPhone extends Emitter {
9809
9842
  sipSession ,
9810
9843
  callSession ,
9811
9844
  withEvent = true,
9812
- isConference = false,
9813
9845
  ) {
9814
9846
  if (!sipSession) {
9815
9847
  return new Promise((resolve, reject) => reject(new Error('No session to unhold')));
9816
9848
  }
9849
+
9850
+ const isConference = !!callSession && callSession.isConference();
9851
+
9817
9852
  const sessionId = this.getSipSessionId(sipSession);
9818
9853
  logger$7.info('WebRTC unhold sip session', { sessionId, isConference });
9819
9854
 
@@ -9955,7 +9990,11 @@ class WebRTCPhone extends Emitter {
9955
9990
  await this.client.register();
9956
9991
  }
9957
9992
  if (this.currentSipSession) {
9958
- this.holdSipSession(this.currentSipSession, this.currentCallSession, true).catch(e => {
9993
+ this.holdSipSession(
9994
+ this.currentSipSession,
9995
+ this.currentCallSession,
9996
+ true,
9997
+ ).catch(e => {
9959
9998
  logger$7.warn('Unable to hold current session when making another call', e);
9960
9999
  });
9961
10000
  }
@@ -9970,6 +10009,7 @@ class WebRTCPhone extends Emitter {
9970
10009
  return Promise.resolve(null);
9971
10010
  }
9972
10011
  const callSession = this._createOutgoingCallSession(sipSession, cameraEnabled || false);
10012
+ callSession.setIsConference(conference);
9973
10013
  callSession.creationTime = new Date();
9974
10014
  this._updateCallSession(callSession);
9975
10015
 
@@ -10548,6 +10588,7 @@ class WebRTCPhone extends Emitter {
10548
10588
  recording: fromSession ? fromSession.isRecording() : false,
10549
10589
  recordingPaused: false, // @TODO
10550
10590
  sipSession,
10591
+ conference: !!fromSession && fromSession.isConference(),
10551
10592
  ...extra,
10552
10593
  });
10553
10594
 
@@ -10804,16 +10845,16 @@ class Phone extends Emitter {
10804
10845
  }
10805
10846
  }
10806
10847
 
10807
- hold(callSession , isConference = false) {
10808
- return this.phone && this.phone.hold(callSession, true, isConference);
10848
+ hold(callSession ) {
10849
+ return this.phone && this.phone.hold(callSession, true);
10809
10850
  }
10810
10851
 
10811
- unhold(callSession , isConference = false) {
10812
- return this.phone && this.phone.unhold(callSession, true, isConference);
10852
+ unhold(callSession ) {
10853
+ return this.phone && this.phone.unhold(callSession, true);
10813
10854
  }
10814
10855
 
10815
- resume(callSession , isConference = false) {
10816
- return this.phone && this.phone.resume(callSession, isConference);
10856
+ resume(callSession ) {
10857
+ return this.phone && this.phone.resume(callSession);
10817
10858
  }
10818
10859
 
10819
10860
  reject(callSession ) {
@@ -394,6 +394,7 @@ const LINE_STATE = {
394
394
 
395
395
 
396
396
 
397
+
397
398
 
398
399
 
399
400
 
@@ -430,6 +431,7 @@ const LINE_STATE = {
430
431
 
431
432
 
432
433
 
434
+
433
435
 
434
436
 
435
437
 
@@ -461,6 +463,7 @@ class Profile {
461
463
 
462
464
 
463
465
 
466
+
464
467
 
465
468
 
466
469
 
@@ -477,6 +480,7 @@ class Profile {
477
480
  lines: plain.lines.map(line => Line.parse(line)),
478
481
  username: plain.username,
479
482
  mobileNumber: plain.mobile_phone_number || '',
483
+ ringSeconds: plain.ring_seconds,
480
484
  forwards: [
481
485
  ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
482
486
  ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
@@ -513,6 +517,7 @@ class Profile {
513
517
  switchboards,
514
518
  agent,
515
519
  status,
520
+ ringSeconds,
516
521
  sipLines,
517
522
  callPickupTargetUsers,
518
523
  onlineCallRecordEnabled,
@@ -534,6 +539,7 @@ class Profile {
534
539
  this.status = status;
535
540
  this.callPickupTargetUsers = callPickupTargetUsers;
536
541
  this.onlineCallRecordEnabled = onlineCallRecordEnabled;
542
+ this.ringSeconds = ringSeconds;
537
543
 
538
544
  this.sipLines = sipLines || [];
539
545
  }
@@ -3290,6 +3296,7 @@ var updateFrom = (instance , from ) => {
3290
3296
 
3291
3297
 
3292
3298
 
3299
+
3293
3300
 
3294
3301
 
3295
3302
  class CallSession {
@@ -3352,6 +3359,8 @@ class CallSession {
3352
3359
 
3353
3360
 
3354
3361
 
3362
+
3363
+
3355
3364
 
3356
3365
 
3357
3366
 
@@ -3383,6 +3392,7 @@ class CallSession {
3383
3392
  videoRemotelyDowngraded,
3384
3393
  sipSession,
3385
3394
  answerTime,
3395
+ conference,
3386
3396
  } ) {
3387
3397
  this.callId = callId;
3388
3398
  this.sipCallId = sipCallId;
@@ -3411,6 +3421,7 @@ class CallSession {
3411
3421
  this.videoRemotelyDowngraded = videoRemotelyDowngraded;
3412
3422
  this.sipSession = sipSession;
3413
3423
  this.answerTime = answerTime || this.answerTime;
3424
+ this.conference = conference;
3414
3425
 
3415
3426
  // Useful to compare instead of instanceof with minified code
3416
3427
  this.type = 'CallSession';
@@ -3468,6 +3479,10 @@ class CallSession {
3468
3479
  this.screensharing = false;
3469
3480
  }
3470
3481
 
3482
+ setIsConference(conference ) {
3483
+ this.conference = conference;
3484
+ }
3485
+
3471
3486
  isIncoming() {
3472
3487
  return !this.isCaller && !this.answered;
3473
3488
  }
@@ -3544,6 +3559,10 @@ class CallSession {
3544
3559
  return this.sipStatus === sessionState.SessionState.Terminated;
3545
3560
  }
3546
3561
 
3562
+ isConference() {
3563
+ return this.conference;
3564
+ }
3565
+
3547
3566
  getElapsedTimeInSeconds() {
3548
3567
  if (!this.startTime) {
3549
3568
  return 0;
@@ -3635,6 +3654,7 @@ class CallSession {
3635
3654
  cameraEnabled: false,
3636
3655
  dialedExtension: call.dialedExtension,
3637
3656
  call,
3657
+ conference: false, // @FIXME?
3638
3658
  });
3639
3659
  }
3640
3660
  }
@@ -3730,7 +3750,7 @@ class Recording {
3730
3750
 
3731
3751
 
3732
3752
 
3733
-
3753
+
3734
3754
 
3735
3755
 
3736
3756
 
@@ -5930,6 +5950,10 @@ class AdHocAPIConference {
5930
5950
  this.conferenceId = conferenceId || '';
5931
5951
  this.muted = muted || false;
5932
5952
  this.paused = paused || false;
5953
+
5954
+ if (this.host) {
5955
+ this.host.setIsConference(true);
5956
+ }
5933
5957
  }
5934
5958
 
5935
5959
  async start() {
@@ -9639,7 +9663,11 @@ class WebRTCPhone extends Emitter {
9639
9663
  accept(callSession , cameraEnabled ) {
9640
9664
  logger$7.info('WebRTC phone - accept call', { id: callSession ? callSession.getId() : 'n/a', cameraEnabled });
9641
9665
  if (this.currentSipSession) {
9642
- this.holdSipSession(this.currentSipSession, this.currentCallSession, true);
9666
+ this.holdSipSession(
9667
+ this.currentSipSession,
9668
+ this.currentCallSession,
9669
+ true,
9670
+ );
9643
9671
  }
9644
9672
 
9645
9673
  if (!callSession) {
@@ -9732,22 +9760,22 @@ class WebRTCPhone extends Emitter {
9732
9760
  }
9733
9761
  }
9734
9762
 
9735
- hold(callSession , withEvent = true, isConference = false) {
9763
+ hold(callSession , withEvent = true) {
9736
9764
  logger$7.info('WebRTC hold', { id: callSession.getId() });
9737
9765
 
9738
9766
  const sipSession = this.findSipSession(callSession);
9739
9767
 
9740
- return sipSession ? this.holdSipSession(sipSession, callSession, withEvent, isConference) : null;
9768
+ return sipSession ? this.holdSipSession(sipSession, callSession, withEvent) : null;
9741
9769
  }
9742
9770
 
9743
9771
  // @Deprecated
9744
- unhold(callSession , withEvent = true, isConference = false) {
9772
+ unhold(callSession , withEvent = true) {
9745
9773
  console.warn('Please note that `phone.unhold()` is being deprecated; `phone.resume()` is the preferred method');
9746
9774
 
9747
- return this.resume(callSession, isConference, withEvent);
9775
+ return this.resume(callSession, withEvent);
9748
9776
  }
9749
9777
 
9750
- resume(callSession , isConference = false, withEvent = true) {
9778
+ resume(callSession , withEvent = true) {
9751
9779
  logger$7.info('WebRTC resume called', { id: callSession ? callSession.getId() : null });
9752
9780
 
9753
9781
  const sipSession = this.findSipSession(callSession);
@@ -9760,10 +9788,14 @@ class WebRTCPhone extends Emitter {
9760
9788
  // Hold current session if different from the current one (we don't want 2 sessions active at the same time).
9761
9789
  if (this.currentSipSession && this.currentSipSession.id !== sipSession.id) {
9762
9790
  logger$7.info('WebRTC hold call after resume', { id: this.currentSipSession.id });
9763
- this.holdSipSession(this.currentSipSession, this.currentCallSession);
9791
+ this.holdSipSession(
9792
+ this.currentSipSession,
9793
+ this.currentCallSession,
9794
+ withEvent,
9795
+ );
9764
9796
  }
9765
9797
 
9766
- const promise = this.unholdSipSession(sipSession, callSession, withEvent, isConference);
9798
+ const promise = this.unholdSipSession(sipSession, callSession, withEvent);
9767
9799
  this.currentSipSession = sipSession;
9768
9800
  if (callSession) {
9769
9801
  this.currentCallSession = callSession;
@@ -9776,7 +9808,6 @@ class WebRTCPhone extends Emitter {
9776
9808
  sipSession ,
9777
9809
  callSession ,
9778
9810
  withEvent = true,
9779
- isConference = false,
9780
9811
  ) {
9781
9812
  if (!sipSession) {
9782
9813
  return new Promise((resolve, reject) => reject(new Error('No session to hold')));
@@ -9797,6 +9828,8 @@ class WebRTCPhone extends Emitter {
9797
9828
  await this.client.downgradeToAudio(sipSession);
9798
9829
  }
9799
9830
 
9831
+ const isConference = !!callSession && callSession.isConference();
9832
+
9800
9833
  const promise = this.client.hold(sipSession, isConference, hasVideo);
9801
9834
  if (withEvent) {
9802
9835
  this.eventEmitter.emit(ON_CALL_HELD, this._createCallSession(sipSession, callSession));
@@ -9809,11 +9842,13 @@ class WebRTCPhone extends Emitter {
9809
9842
  sipSession ,
9810
9843
  callSession ,
9811
9844
  withEvent = true,
9812
- isConference = false,
9813
9845
  ) {
9814
9846
  if (!sipSession) {
9815
9847
  return new Promise((resolve, reject) => reject(new Error('No session to unhold')));
9816
9848
  }
9849
+
9850
+ const isConference = !!callSession && callSession.isConference();
9851
+
9817
9852
  const sessionId = this.getSipSessionId(sipSession);
9818
9853
  logger$7.info('WebRTC unhold sip session', { sessionId, isConference });
9819
9854
 
@@ -9955,7 +9990,11 @@ class WebRTCPhone extends Emitter {
9955
9990
  await this.client.register();
9956
9991
  }
9957
9992
  if (this.currentSipSession) {
9958
- this.holdSipSession(this.currentSipSession, this.currentCallSession, true).catch(e => {
9993
+ this.holdSipSession(
9994
+ this.currentSipSession,
9995
+ this.currentCallSession,
9996
+ true,
9997
+ ).catch(e => {
9959
9998
  logger$7.warn('Unable to hold current session when making another call', e);
9960
9999
  });
9961
10000
  }
@@ -9970,6 +10009,7 @@ class WebRTCPhone extends Emitter {
9970
10009
  return Promise.resolve(null);
9971
10010
  }
9972
10011
  const callSession = this._createOutgoingCallSession(sipSession, cameraEnabled || false);
10012
+ callSession.setIsConference(conference);
9973
10013
  callSession.creationTime = new Date();
9974
10014
  this._updateCallSession(callSession);
9975
10015
 
@@ -10548,6 +10588,7 @@ class WebRTCPhone extends Emitter {
10548
10588
  recording: fromSession ? fromSession.isRecording() : false,
10549
10589
  recordingPaused: false, // @TODO
10550
10590
  sipSession,
10591
+ conference: !!fromSession && fromSession.isConference(),
10551
10592
  ...extra,
10552
10593
  });
10553
10594
 
@@ -10804,16 +10845,16 @@ class Phone extends Emitter {
10804
10845
  }
10805
10846
  }
10806
10847
 
10807
- hold(callSession , isConference = false) {
10808
- return this.phone && this.phone.hold(callSession, true, isConference);
10848
+ hold(callSession ) {
10849
+ return this.phone && this.phone.hold(callSession, true);
10809
10850
  }
10810
10851
 
10811
- unhold(callSession , isConference = false) {
10812
- return this.phone && this.phone.unhold(callSession, true, isConference);
10852
+ unhold(callSession ) {
10853
+ return this.phone && this.phone.unhold(callSession, true);
10813
10854
  }
10814
10855
 
10815
- resume(callSession , isConference = false) {
10816
- return this.phone && this.phone.resume(callSession, isConference);
10856
+ resume(callSession ) {
10857
+ return this.phone && this.phone.resume(callSession);
10817
10858
  }
10818
10859
 
10819
10860
  reject(callSession ) {