@wazo/sdk 0.38.5 → 0.38.6

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 (84) hide show
  1. package/README.md +1 -1
  2. package/dist/wazo-sdk.js +2 -2
  3. package/esm/__tests__/api-client.test.js +6 -0
  4. package/esm/__tests__/web-rtc-client.test.js +58 -2
  5. package/esm/api/calld.js +6 -0
  6. package/esm/api/ctid-ng.js +6 -0
  7. package/esm/api-client.js +6 -0
  8. package/esm/checker/Checker.js +8 -2
  9. package/esm/checker/checks/aor.js +6 -0
  10. package/esm/checker/checks/api.js +6 -0
  11. package/esm/checker/checks/index.js +8 -2
  12. package/esm/checker/checks/webrtc-transport.js +8 -2
  13. package/esm/checker/checks/webrtc.js +8 -2
  14. package/esm/domain/AdHocAPIConference.js +6 -0
  15. package/esm/domain/Call.js +6 -0
  16. package/esm/domain/CallSession.js +1 -1
  17. package/esm/domain/Features.js +6 -0
  18. package/esm/domain/Phone/CTIPhone.js +7 -1
  19. package/esm/domain/Phone/WebRTCPhone.js +3 -3
  20. package/esm/domain/__tests__/Call.test.js +6 -0
  21. package/esm/domain/__tests__/CallSession.test.js +1 -1
  22. package/esm/domain/__tests__/IndirectTransfer.test.js +1 -1
  23. package/esm/domain/__tests__/Room.test.js +1 -1
  24. package/esm/index.js +11 -5
  25. package/esm/service/CallApi.js +6 -0
  26. package/esm/service/getApiClient.js +6 -0
  27. package/esm/simple/Auth.js +11 -5
  28. package/esm/simple/Configuration.js +11 -5
  29. package/esm/simple/Directory.js +6 -0
  30. package/esm/simple/Phone.js +11 -5
  31. package/esm/simple/index.js +11 -5
  32. package/esm/simple/room/LocalParticipant.js +11 -5
  33. package/esm/simple/room/Participant.js +11 -5
  34. package/esm/simple/room/RemoteParticipant.js +11 -5
  35. package/esm/simple/room/Room.js +11 -5
  36. package/esm/simple/room/SipRoom.js +11 -5
  37. package/esm/simple/room/Stream.js +11 -5
  38. package/esm/simple/room/__tests__/RemoteParticipant.test.js +11 -5
  39. package/esm/simple/utils.js +11 -5
  40. package/esm/web-rtc-client.js +8 -2
  41. package/lib/__tests__/api-client.test.js +6 -0
  42. package/lib/__tests__/web-rtc-client.test.js +58 -2
  43. package/lib/api/calld.js +6 -0
  44. package/lib/api/ctid-ng.js +6 -0
  45. package/lib/api-client.js +6 -0
  46. package/lib/checker/Checker.js +8 -2
  47. package/lib/checker/checks/aor.js +6 -0
  48. package/lib/checker/checks/api.js +6 -0
  49. package/lib/checker/checks/index.js +8 -2
  50. package/lib/checker/checks/webrtc-transport.js +8 -2
  51. package/lib/checker/checks/webrtc.js +8 -2
  52. package/lib/domain/AdHocAPIConference.js +6 -0
  53. package/lib/domain/Call.js +6 -0
  54. package/lib/domain/CallSession.js +1 -1
  55. package/lib/domain/Features.js +6 -0
  56. package/lib/domain/Phone/CTIPhone.js +7 -1
  57. package/lib/domain/Phone/WebRTCPhone.js +3 -3
  58. package/lib/domain/__tests__/Call.test.js +6 -0
  59. package/lib/domain/__tests__/CallSession.test.js +1 -1
  60. package/lib/domain/__tests__/IndirectTransfer.test.js +1 -1
  61. package/lib/domain/__tests__/Room.test.js +1 -1
  62. package/lib/index.js +11 -5
  63. package/lib/service/CallApi.js +6 -0
  64. package/lib/service/getApiClient.js +6 -0
  65. package/lib/simple/Auth.js +11 -5
  66. package/lib/simple/Configuration.js +11 -5
  67. package/lib/simple/Directory.js +6 -0
  68. package/lib/simple/Phone.js +11 -5
  69. package/lib/simple/index.js +11 -5
  70. package/lib/simple/room/LocalParticipant.js +11 -5
  71. package/lib/simple/room/Participant.js +11 -5
  72. package/lib/simple/room/RemoteParticipant.js +11 -5
  73. package/lib/simple/room/Room.js +11 -5
  74. package/lib/simple/room/SipRoom.js +11 -5
  75. package/lib/simple/room/Stream.js +11 -5
  76. package/lib/simple/room/__tests__/RemoteParticipant.test.js +11 -5
  77. package/lib/simple/utils.js +11 -5
  78. package/lib/web-rtc-client.js +8 -2
  79. package/package.json +1 -1
  80. package/src/__tests__/web-rtc-client.test.js +50 -0
  81. package/src/domain/Call.js +6 -0
  82. package/src/domain/CallSession.js +1 -1
  83. package/src/domain/Phone/WebRTCPhone.js +2 -2
  84. package/src/web-rtc-client.js +2 -2
@@ -3071,6 +3071,7 @@ const RECORD_STATE_ACTIVE = 'active';
3071
3071
 
3072
3072
 
3073
3073
 
3074
+
3074
3075
 
3075
3076
 
3076
3077
 
@@ -3081,6 +3082,7 @@ const RECORD_STATE_ACTIVE = 'active';
3081
3082
 
3082
3083
 
3083
3084
 
3085
+
3084
3086
 
3085
3087
 
3086
3088
 
@@ -3109,6 +3111,7 @@ class Call {
3109
3111
 
3110
3112
 
3111
3113
 
3114
+
3112
3115
 
3113
3116
 
3114
3117
 
@@ -3133,6 +3136,7 @@ class Call {
3133
3136
  calleeNumber: plain.peer_caller_id_number,
3134
3137
  dialedExtension: plain.dialed_extension,
3135
3138
  isCaller: plain.is_caller,
3139
+ isVideo: plain.is_video,
3136
3140
  muted: plain.muted,
3137
3141
  onHold: plain.on_hold,
3138
3142
  status: plain.status,
@@ -3156,6 +3160,7 @@ class Call {
3156
3160
  calleeNumber,
3157
3161
  dialedExtension,
3158
3162
  isCaller,
3163
+ isVideo,
3159
3164
  lineId,
3160
3165
  muted,
3161
3166
  onHold,
@@ -3179,6 +3184,7 @@ class Call {
3179
3184
  this.startingTime = startingTime;
3180
3185
  this.talkingToIds = talkingToIds || [];
3181
3186
  this.recording = recording;
3187
+ this.isVideo = !!isVideo;
3182
3188
 
3183
3189
  // Useful to compare instead of instanceof with minified code
3184
3190
  this.type = 'Call';
@@ -3652,7 +3658,7 @@ class CallSession {
3652
3658
  ringing: call.isRinging(),
3653
3659
  answered: call.isUp(),
3654
3660
  answeredBySystem: call.isUp() && call.talkingToIds.length === 0,
3655
- cameraEnabled: false,
3661
+ cameraEnabled: call.isVideo,
3656
3662
  dialedExtension: call.dialedExtension,
3657
3663
  call,
3658
3664
  conference: false, // @FIXME?
@@ -7787,11 +7793,11 @@ class WebRTCClient extends Emitter {
7787
7793
  });
7788
7794
  }
7789
7795
 
7790
- changeAudioInputDevice(id , session ) {
7796
+ changeAudioInputDevice(id , session , force ) {
7791
7797
  const currentId = this.getAudioDeviceId();
7792
7798
  logger$8.info('setting audio input device', { id, currentId, session: !!session });
7793
7799
 
7794
- if (id === currentId) {
7800
+ if (!force && id === currentId) {
7795
7801
  return null;
7796
7802
  }
7797
7803
 
@@ -9587,10 +9593,10 @@ class WebRTCPhone extends Emitter {
9587
9593
  this.audioRingVolume = volume;
9588
9594
  }
9589
9595
 
9590
- changeAudioInputDevice(id ) {
9596
+ changeAudioInputDevice(id , force ) {
9591
9597
  logger$7.info('WebRTC phone - changeAudio input device', { deviceId: id });
9592
9598
 
9593
- return this.client.changeAudioInputDevice(id, this.currentSipSession);
9599
+ return this.client.changeAudioInputDevice(id, this.currentSipSession, force);
9594
9600
  }
9595
9601
 
9596
9602
  changeVideoInputDevice(id ) {
@@ -3071,6 +3071,7 @@ const RECORD_STATE_ACTIVE = 'active';
3071
3071
 
3072
3072
 
3073
3073
 
3074
+
3074
3075
 
3075
3076
 
3076
3077
 
@@ -3081,6 +3082,7 @@ const RECORD_STATE_ACTIVE = 'active';
3081
3082
 
3082
3083
 
3083
3084
 
3085
+
3084
3086
 
3085
3087
 
3086
3088
 
@@ -3109,6 +3111,7 @@ class Call {
3109
3111
 
3110
3112
 
3111
3113
 
3114
+
3112
3115
 
3113
3116
 
3114
3117
 
@@ -3133,6 +3136,7 @@ class Call {
3133
3136
  calleeNumber: plain.peer_caller_id_number,
3134
3137
  dialedExtension: plain.dialed_extension,
3135
3138
  isCaller: plain.is_caller,
3139
+ isVideo: plain.is_video,
3136
3140
  muted: plain.muted,
3137
3141
  onHold: plain.on_hold,
3138
3142
  status: plain.status,
@@ -3156,6 +3160,7 @@ class Call {
3156
3160
  calleeNumber,
3157
3161
  dialedExtension,
3158
3162
  isCaller,
3163
+ isVideo,
3159
3164
  lineId,
3160
3165
  muted,
3161
3166
  onHold,
@@ -3179,6 +3184,7 @@ class Call {
3179
3184
  this.startingTime = startingTime;
3180
3185
  this.talkingToIds = talkingToIds || [];
3181
3186
  this.recording = recording;
3187
+ this.isVideo = !!isVideo;
3182
3188
 
3183
3189
  // Useful to compare instead of instanceof with minified code
3184
3190
  this.type = 'Call';
@@ -3652,7 +3658,7 @@ class CallSession {
3652
3658
  ringing: call.isRinging(),
3653
3659
  answered: call.isUp(),
3654
3660
  answeredBySystem: call.isUp() && call.talkingToIds.length === 0,
3655
- cameraEnabled: false,
3661
+ cameraEnabled: call.isVideo,
3656
3662
  dialedExtension: call.dialedExtension,
3657
3663
  call,
3658
3664
  conference: false, // @FIXME?
@@ -7787,11 +7793,11 @@ class WebRTCClient extends Emitter {
7787
7793
  });
7788
7794
  }
7789
7795
 
7790
- changeAudioInputDevice(id , session ) {
7796
+ changeAudioInputDevice(id , session , force ) {
7791
7797
  const currentId = this.getAudioDeviceId();
7792
7798
  logger$8.info('setting audio input device', { id, currentId, session: !!session });
7793
7799
 
7794
- if (id === currentId) {
7800
+ if (!force && id === currentId) {
7795
7801
  return null;
7796
7802
  }
7797
7803
 
@@ -9587,10 +9593,10 @@ class WebRTCPhone extends Emitter {
9587
9593
  this.audioRingVolume = volume;
9588
9594
  }
9589
9595
 
9590
- changeAudioInputDevice(id ) {
9596
+ changeAudioInputDevice(id , force ) {
9591
9597
  logger$7.info('WebRTC phone - changeAudio input device', { deviceId: id });
9592
9598
 
9593
- return this.client.changeAudioInputDevice(id, this.currentSipSession);
9599
+ return this.client.changeAudioInputDevice(id, this.currentSipSession, force);
9594
9600
  }
9595
9601
 
9596
9602
  changeVideoInputDevice(id ) {
@@ -3607,6 +3607,7 @@ const RECORD_STATE_ACTIVE = 'active';
3607
3607
 
3608
3608
 
3609
3609
 
3610
+
3610
3611
 
3611
3612
 
3612
3613
 
@@ -3617,6 +3618,7 @@ const RECORD_STATE_ACTIVE = 'active';
3617
3618
 
3618
3619
 
3619
3620
 
3621
+
3620
3622
 
3621
3623
 
3622
3624
 
@@ -3645,6 +3647,7 @@ class Call {
3645
3647
 
3646
3648
 
3647
3649
 
3650
+
3648
3651
 
3649
3652
 
3650
3653
 
@@ -3669,6 +3672,7 @@ class Call {
3669
3672
  calleeNumber: plain.peer_caller_id_number,
3670
3673
  dialedExtension: plain.dialed_extension,
3671
3674
  isCaller: plain.is_caller,
3675
+ isVideo: plain.is_video,
3672
3676
  muted: plain.muted,
3673
3677
  onHold: plain.on_hold,
3674
3678
  status: plain.status,
@@ -3692,6 +3696,7 @@ class Call {
3692
3696
  calleeNumber,
3693
3697
  dialedExtension,
3694
3698
  isCaller,
3699
+ isVideo,
3695
3700
  lineId,
3696
3701
  muted,
3697
3702
  onHold,
@@ -3715,6 +3720,7 @@ class Call {
3715
3720
  this.startingTime = startingTime;
3716
3721
  this.talkingToIds = talkingToIds || [];
3717
3722
  this.recording = recording;
3723
+ this.isVideo = !!isVideo;
3718
3724
 
3719
3725
  // Useful to compare instead of instanceof with minified code
3720
3726
  this.type = 'Call';
@@ -6417,11 +6423,11 @@ class WebRTCClient extends Emitter {
6417
6423
  });
6418
6424
  }
6419
6425
 
6420
- changeAudioInputDevice(id , session ) {
6426
+ changeAudioInputDevice(id , session , force ) {
6421
6427
  const currentId = this.getAudioDeviceId();
6422
6428
  logger.info('setting audio input device', { id, currentId, session: !!session });
6423
6429
 
6424
- if (id === currentId) {
6430
+ if (!force && id === currentId) {
6425
6431
  return null;
6426
6432
  }
6427
6433
 
@@ -3057,6 +3057,7 @@ const RECORD_STATE_ACTIVE = 'active';
3057
3057
 
3058
3058
 
3059
3059
 
3060
+
3060
3061
 
3061
3062
 
3062
3063
 
@@ -3067,6 +3068,7 @@ const RECORD_STATE_ACTIVE = 'active';
3067
3068
 
3068
3069
 
3069
3070
 
3071
+
3070
3072
 
3071
3073
 
3072
3074
 
@@ -3095,6 +3097,7 @@ class Call {
3095
3097
 
3096
3098
 
3097
3099
 
3100
+
3098
3101
 
3099
3102
 
3100
3103
 
@@ -3119,6 +3122,7 @@ class Call {
3119
3122
  calleeNumber: plain.peer_caller_id_number,
3120
3123
  dialedExtension: plain.dialed_extension,
3121
3124
  isCaller: plain.is_caller,
3125
+ isVideo: plain.is_video,
3122
3126
  muted: plain.muted,
3123
3127
  onHold: plain.on_hold,
3124
3128
  status: plain.status,
@@ -3142,6 +3146,7 @@ class Call {
3142
3146
  calleeNumber,
3143
3147
  dialedExtension,
3144
3148
  isCaller,
3149
+ isVideo,
3145
3150
  lineId,
3146
3151
  muted,
3147
3152
  onHold,
@@ -3165,6 +3170,7 @@ class Call {
3165
3170
  this.startingTime = startingTime;
3166
3171
  this.talkingToIds = talkingToIds || [];
3167
3172
  this.recording = recording;
3173
+ this.isVideo = !!isVideo;
3168
3174
 
3169
3175
  // Useful to compare instead of instanceof with minified code
3170
3176
  this.type = 'Call';
@@ -3616,6 +3616,7 @@ const RECORD_STATE_ACTIVE = 'active';
3616
3616
 
3617
3617
 
3618
3618
 
3619
+
3619
3620
 
3620
3621
 
3621
3622
 
@@ -3626,6 +3627,7 @@ const RECORD_STATE_ACTIVE = 'active';
3626
3627
 
3627
3628
 
3628
3629
 
3630
+
3629
3631
 
3630
3632
 
3631
3633
 
@@ -3654,6 +3656,7 @@ class Call {
3654
3656
 
3655
3657
 
3656
3658
 
3659
+
3657
3660
 
3658
3661
 
3659
3662
 
@@ -3678,6 +3681,7 @@ class Call {
3678
3681
  calleeNumber: plain.peer_caller_id_number,
3679
3682
  dialedExtension: plain.dialed_extension,
3680
3683
  isCaller: plain.is_caller,
3684
+ isVideo: plain.is_video,
3681
3685
  muted: plain.muted,
3682
3686
  onHold: plain.on_hold,
3683
3687
  status: plain.status,
@@ -3701,6 +3705,7 @@ class Call {
3701
3705
  calleeNumber,
3702
3706
  dialedExtension,
3703
3707
  isCaller,
3708
+ isVideo,
3704
3709
  lineId,
3705
3710
  muted,
3706
3711
  onHold,
@@ -3724,6 +3729,7 @@ class Call {
3724
3729
  this.startingTime = startingTime;
3725
3730
  this.talkingToIds = talkingToIds || [];
3726
3731
  this.recording = recording;
3732
+ this.isVideo = !!isVideo;
3727
3733
 
3728
3734
  // Useful to compare instead of instanceof with minified code
3729
3735
  this.type = 'Call';
@@ -6423,11 +6429,11 @@ class WebRTCClient extends Emitter {
6423
6429
  });
6424
6430
  }
6425
6431
 
6426
- changeAudioInputDevice(id , session ) {
6432
+ changeAudioInputDevice(id , session , force ) {
6427
6433
  const currentId = this.getAudioDeviceId();
6428
6434
  logger.info('setting audio input device', { id, currentId, session: !!session });
6429
6435
 
6430
- if (id === currentId) {
6436
+ if (!force && id === currentId) {
6431
6437
  return null;
6432
6438
  }
6433
6439
 
@@ -7611,3 +7617,53 @@ describe('WebRTC client', () => {
7611
7617
  expect(client.isAudioMuted(oldKindUnmuted)).toBeFalsy();
7612
7618
  });
7613
7619
  });
7620
+
7621
+ describe('changeAudioInputDevice', () => {
7622
+ const defaultId = 'default';
7623
+ const deviceId = 'device1';
7624
+ const constraints = { audio: { deviceId: { exact: defaultId } }, video: null };
7625
+
7626
+ const session = {
7627
+ sessionDescriptionHandler: {
7628
+ peerConnection: {
7629
+ getSenders: () => [{ track: { kind: 'audio', enabled: true } }],
7630
+ },
7631
+ },
7632
+ };
7633
+
7634
+ const stream = {};
7635
+ const getAudioTracksMock = jest.fn(() => []);
7636
+ Object.defineProperty(stream, 'getAudioTracks', {
7637
+ value: getAudioTracksMock,
7638
+ });
7639
+
7640
+ const getUserMediaMock = jest.fn(async () => {
7641
+ return new Promise(resolve => {
7642
+ resolve(stream);
7643
+ });
7644
+ });
7645
+
7646
+ Object.defineProperty(global.navigator, 'mediaDevices', {
7647
+ value: {
7648
+ getUserMedia: getUserMediaMock,
7649
+ },
7650
+ });
7651
+
7652
+ it('should change the audio input track if the provided id is different', async () => {
7653
+ client.setMediaConstraints(constraints);
7654
+ expect(client.getAudioDeviceId()).toBe(defaultId);
7655
+ expect(client.changeAudioInputDevice(deviceId, session)).toBeTruthy();
7656
+ });
7657
+
7658
+ it('should NOT change the audio input track if the provided id is the same', async () => {
7659
+ client.setMediaConstraints(constraints);
7660
+ expect(client.getAudioDeviceId()).toBe(defaultId);
7661
+ expect(client.changeAudioInputDevice(defaultId, session)).toBeFalsy();
7662
+ });
7663
+
7664
+ it('should change the audio input track if the provided id is the same and force param is TRUE', async () => {
7665
+ client.setMediaConstraints(constraints);
7666
+ expect(client.getAudioDeviceId()).toBe(defaultId);
7667
+ expect(client.changeAudioInputDevice(defaultId, session, true)).toBeTruthy();
7668
+ });
7669
+ });
package/lib/api/calld.js CHANGED
@@ -974,6 +974,7 @@ const RECORD_STATE_ACTIVE = 'active';
974
974
 
975
975
 
976
976
 
977
+
977
978
 
978
979
 
979
980
 
@@ -984,6 +985,7 @@ const RECORD_STATE_ACTIVE = 'active';
984
985
 
985
986
 
986
987
 
988
+
987
989
 
988
990
 
989
991
 
@@ -1012,6 +1014,7 @@ class Call {
1012
1014
 
1013
1015
 
1014
1016
 
1017
+
1015
1018
 
1016
1019
 
1017
1020
 
@@ -1036,6 +1039,7 @@ class Call {
1036
1039
  calleeNumber: plain.peer_caller_id_number,
1037
1040
  dialedExtension: plain.dialed_extension,
1038
1041
  isCaller: plain.is_caller,
1042
+ isVideo: plain.is_video,
1039
1043
  muted: plain.muted,
1040
1044
  onHold: plain.on_hold,
1041
1045
  status: plain.status,
@@ -1059,6 +1063,7 @@ class Call {
1059
1063
  calleeNumber,
1060
1064
  dialedExtension,
1061
1065
  isCaller,
1066
+ isVideo,
1062
1067
  lineId,
1063
1068
  muted,
1064
1069
  onHold,
@@ -1082,6 +1087,7 @@ class Call {
1082
1087
  this.startingTime = startingTime;
1083
1088
  this.talkingToIds = talkingToIds || [];
1084
1089
  this.recording = recording;
1090
+ this.isVideo = !!isVideo;
1085
1091
 
1086
1092
  // Useful to compare instead of instanceof with minified code
1087
1093
  this.type = 'Call';
@@ -977,6 +977,7 @@ const RECORD_STATE_ACTIVE = 'active';
977
977
 
978
978
 
979
979
 
980
+
980
981
 
981
982
 
982
983
 
@@ -987,6 +988,7 @@ const RECORD_STATE_ACTIVE = 'active';
987
988
 
988
989
 
989
990
 
991
+
990
992
 
991
993
 
992
994
 
@@ -1015,6 +1017,7 @@ class Call {
1015
1017
 
1016
1018
 
1017
1019
 
1020
+
1018
1021
 
1019
1022
 
1020
1023
 
@@ -1039,6 +1042,7 @@ class Call {
1039
1042
  calleeNumber: plain.peer_caller_id_number,
1040
1043
  dialedExtension: plain.dialed_extension,
1041
1044
  isCaller: plain.is_caller,
1045
+ isVideo: plain.is_video,
1042
1046
  muted: plain.muted,
1043
1047
  onHold: plain.on_hold,
1044
1048
  status: plain.status,
@@ -1062,6 +1066,7 @@ class Call {
1062
1066
  calleeNumber,
1063
1067
  dialedExtension,
1064
1068
  isCaller,
1069
+ isVideo,
1065
1070
  lineId,
1066
1071
  muted,
1067
1072
  onHold,
@@ -1085,6 +1090,7 @@ class Call {
1085
1090
  this.startingTime = startingTime;
1086
1091
  this.talkingToIds = talkingToIds || [];
1087
1092
  this.recording = recording;
1093
+ this.isVideo = !!isVideo;
1088
1094
 
1089
1095
  // Useful to compare instead of instanceof with minified code
1090
1096
  this.type = 'Call';
package/lib/api-client.js CHANGED
@@ -3057,6 +3057,7 @@ const RECORD_STATE_ACTIVE = 'active';
3057
3057
 
3058
3058
 
3059
3059
 
3060
+
3060
3061
 
3061
3062
 
3062
3063
 
@@ -3067,6 +3068,7 @@ const RECORD_STATE_ACTIVE = 'active';
3067
3068
 
3068
3069
 
3069
3070
 
3071
+
3070
3072
 
3071
3073
 
3072
3074
 
@@ -3095,6 +3097,7 @@ class Call {
3095
3097
 
3096
3098
 
3097
3099
 
3100
+
3098
3101
 
3099
3102
 
3100
3103
 
@@ -3119,6 +3122,7 @@ class Call {
3119
3122
  calleeNumber: plain.peer_caller_id_number,
3120
3123
  dialedExtension: plain.dialed_extension,
3121
3124
  isCaller: plain.is_caller,
3125
+ isVideo: plain.is_video,
3122
3126
  muted: plain.muted,
3123
3127
  onHold: plain.on_hold,
3124
3128
  status: plain.status,
@@ -3142,6 +3146,7 @@ class Call {
3142
3146
  calleeNumber,
3143
3147
  dialedExtension,
3144
3148
  isCaller,
3149
+ isVideo,
3145
3150
  lineId,
3146
3151
  muted,
3147
3152
  onHold,
@@ -3165,6 +3170,7 @@ class Call {
3165
3170
  this.startingTime = startingTime;
3166
3171
  this.talkingToIds = talkingToIds || [];
3167
3172
  this.recording = recording;
3173
+ this.isVideo = !!isVideo;
3168
3174
 
3169
3175
  // Useful to compare instead of instanceof with minified code
3170
3176
  this.type = 'Call';
@@ -3079,6 +3079,7 @@ const RECORD_STATE_ACTIVE = 'active';
3079
3079
 
3080
3080
 
3081
3081
 
3082
+
3082
3083
 
3083
3084
 
3084
3085
 
@@ -3089,6 +3090,7 @@ const RECORD_STATE_ACTIVE = 'active';
3089
3090
 
3090
3091
 
3091
3092
 
3093
+
3092
3094
 
3093
3095
 
3094
3096
 
@@ -3117,6 +3119,7 @@ class Call {
3117
3119
 
3118
3120
 
3119
3121
 
3122
+
3120
3123
 
3121
3124
 
3122
3125
 
@@ -3141,6 +3144,7 @@ class Call {
3141
3144
  calleeNumber: plain.peer_caller_id_number,
3142
3145
  dialedExtension: plain.dialed_extension,
3143
3146
  isCaller: plain.is_caller,
3147
+ isVideo: plain.is_video,
3144
3148
  muted: plain.muted,
3145
3149
  onHold: plain.on_hold,
3146
3150
  status: plain.status,
@@ -3164,6 +3168,7 @@ class Call {
3164
3168
  calleeNumber,
3165
3169
  dialedExtension,
3166
3170
  isCaller,
3171
+ isVideo,
3167
3172
  lineId,
3168
3173
  muted,
3169
3174
  onHold,
@@ -3187,6 +3192,7 @@ class Call {
3187
3192
  this.startingTime = startingTime;
3188
3193
  this.talkingToIds = talkingToIds || [];
3189
3194
  this.recording = recording;
3195
+ this.isVideo = !!isVideo;
3190
3196
 
3191
3197
  // Useful to compare instead of instanceof with minified code
3192
3198
  this.type = 'Call';
@@ -7009,11 +7015,11 @@ class WebRTCClient extends Emitter {
7009
7015
  });
7010
7016
  }
7011
7017
 
7012
- changeAudioInputDevice(id , session ) {
7018
+ changeAudioInputDevice(id , session , force ) {
7013
7019
  const currentId = this.getAudioDeviceId();
7014
7020
  logger$1.info('setting audio input device', { id, currentId, session: !!session });
7015
7021
 
7016
- if (id === currentId) {
7022
+ if (!force && id === currentId) {
7017
7023
  return null;
7018
7024
  }
7019
7025
 
@@ -3057,6 +3057,7 @@ const RECORD_STATE_ACTIVE = 'active';
3057
3057
 
3058
3058
 
3059
3059
 
3060
+
3060
3061
 
3061
3062
 
3062
3063
 
@@ -3067,6 +3068,7 @@ const RECORD_STATE_ACTIVE = 'active';
3067
3068
 
3068
3069
 
3069
3070
 
3071
+
3070
3072
 
3071
3073
 
3072
3074
 
@@ -3095,6 +3097,7 @@ class Call {
3095
3097
 
3096
3098
 
3097
3099
 
3100
+
3098
3101
 
3099
3102
 
3100
3103
 
@@ -3119,6 +3122,7 @@ class Call {
3119
3122
  calleeNumber: plain.peer_caller_id_number,
3120
3123
  dialedExtension: plain.dialed_extension,
3121
3124
  isCaller: plain.is_caller,
3125
+ isVideo: plain.is_video,
3122
3126
  muted: plain.muted,
3123
3127
  onHold: plain.on_hold,
3124
3128
  status: plain.status,
@@ -3142,6 +3146,7 @@ class Call {
3142
3146
  calleeNumber,
3143
3147
  dialedExtension,
3144
3148
  isCaller,
3149
+ isVideo,
3145
3150
  lineId,
3146
3151
  muted,
3147
3152
  onHold,
@@ -3165,6 +3170,7 @@ class Call {
3165
3170
  this.startingTime = startingTime;
3166
3171
  this.talkingToIds = talkingToIds || [];
3167
3172
  this.recording = recording;
3173
+ this.isVideo = !!isVideo;
3168
3174
 
3169
3175
  // Useful to compare instead of instanceof with minified code
3170
3176
  this.type = 'Call';
@@ -3057,6 +3057,7 @@ const RECORD_STATE_ACTIVE = 'active';
3057
3057
 
3058
3058
 
3059
3059
 
3060
+
3060
3061
 
3061
3062
 
3062
3063
 
@@ -3067,6 +3068,7 @@ const RECORD_STATE_ACTIVE = 'active';
3067
3068
 
3068
3069
 
3069
3070
 
3071
+
3070
3072
 
3071
3073
 
3072
3074
 
@@ -3095,6 +3097,7 @@ class Call {
3095
3097
 
3096
3098
 
3097
3099
 
3100
+
3098
3101
 
3099
3102
 
3100
3103
 
@@ -3119,6 +3122,7 @@ class Call {
3119
3122
  calleeNumber: plain.peer_caller_id_number,
3120
3123
  dialedExtension: plain.dialed_extension,
3121
3124
  isCaller: plain.is_caller,
3125
+ isVideo: plain.is_video,
3122
3126
  muted: plain.muted,
3123
3127
  onHold: plain.on_hold,
3124
3128
  status: plain.status,
@@ -3142,6 +3146,7 @@ class Call {
3142
3146
  calleeNumber,
3143
3147
  dialedExtension,
3144
3148
  isCaller,
3149
+ isVideo,
3145
3150
  lineId,
3146
3151
  muted,
3147
3152
  onHold,
@@ -3165,6 +3170,7 @@ class Call {
3165
3170
  this.startingTime = startingTime;
3166
3171
  this.talkingToIds = talkingToIds || [];
3167
3172
  this.recording = recording;
3173
+ this.isVideo = !!isVideo;
3168
3174
 
3169
3175
  // Useful to compare instead of instanceof with minified code
3170
3176
  this.type = 'Call';