@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
@@ -3051,6 +3051,7 @@ const RECORD_STATE_ACTIVE = 'active';
3051
3051
 
3052
3052
 
3053
3053
 
3054
+
3054
3055
 
3055
3056
 
3056
3057
 
@@ -3061,6 +3062,7 @@ const RECORD_STATE_ACTIVE = 'active';
3061
3062
 
3062
3063
 
3063
3064
 
3065
+
3064
3066
 
3065
3067
 
3066
3068
 
@@ -3089,6 +3091,7 @@ class Call {
3089
3091
 
3090
3092
 
3091
3093
 
3094
+
3092
3095
 
3093
3096
 
3094
3097
 
@@ -3113,6 +3116,7 @@ class Call {
3113
3116
  calleeNumber: plain.peer_caller_id_number,
3114
3117
  dialedExtension: plain.dialed_extension,
3115
3118
  isCaller: plain.is_caller,
3119
+ isVideo: plain.is_video,
3116
3120
  muted: plain.muted,
3117
3121
  onHold: plain.on_hold,
3118
3122
  status: plain.status,
@@ -3136,6 +3140,7 @@ class Call {
3136
3140
  calleeNumber,
3137
3141
  dialedExtension,
3138
3142
  isCaller,
3143
+ isVideo,
3139
3144
  lineId,
3140
3145
  muted,
3141
3146
  onHold,
@@ -3159,6 +3164,7 @@ class Call {
3159
3164
  this.startingTime = startingTime;
3160
3165
  this.talkingToIds = talkingToIds || [];
3161
3166
  this.recording = recording;
3167
+ this.isVideo = !!isVideo;
3162
3168
 
3163
3169
  // Useful to compare instead of instanceof with minified code
3164
3170
  this.type = 'Call';
@@ -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';
@@ -6414,11 +6420,11 @@ class WebRTCClient extends Emitter {
6414
6420
  });
6415
6421
  }
6416
6422
 
6417
- changeAudioInputDevice(id , session ) {
6423
+ changeAudioInputDevice(id , session , force ) {
6418
6424
  const currentId = this.getAudioDeviceId();
6419
6425
  logger.info('setting audio input device', { id, currentId, session: !!session });
6420
6426
 
6421
- if (id === currentId) {
6427
+ if (!force && id === currentId) {
6422
6428
  return null;
6423
6429
  }
6424
6430
 
@@ -7602,3 +7608,53 @@ describe('WebRTC client', () => {
7602
7608
  expect(client.isAudioMuted(oldKindUnmuted)).toBeFalsy();
7603
7609
  });
7604
7610
  });
7611
+
7612
+ describe('changeAudioInputDevice', () => {
7613
+ const defaultId = 'default';
7614
+ const deviceId = 'device1';
7615
+ const constraints = { audio: { deviceId: { exact: defaultId } }, video: null };
7616
+
7617
+ const session = {
7618
+ sessionDescriptionHandler: {
7619
+ peerConnection: {
7620
+ getSenders: () => [{ track: { kind: 'audio', enabled: true } }],
7621
+ },
7622
+ },
7623
+ };
7624
+
7625
+ const stream = {};
7626
+ const getAudioTracksMock = jest.fn(() => []);
7627
+ Object.defineProperty(stream, 'getAudioTracks', {
7628
+ value: getAudioTracksMock,
7629
+ });
7630
+
7631
+ const getUserMediaMock = jest.fn(async () => {
7632
+ return new Promise(resolve => {
7633
+ resolve(stream);
7634
+ });
7635
+ });
7636
+
7637
+ Object.defineProperty(global.navigator, 'mediaDevices', {
7638
+ value: {
7639
+ getUserMedia: getUserMediaMock,
7640
+ },
7641
+ });
7642
+
7643
+ it('should change the audio input track if the provided id is different', async () => {
7644
+ client.setMediaConstraints(constraints);
7645
+ expect(client.getAudioDeviceId()).toBe(defaultId);
7646
+ expect(client.changeAudioInputDevice(deviceId, session)).toBeTruthy();
7647
+ });
7648
+
7649
+ it('should NOT change the audio input track if the provided id is the same', async () => {
7650
+ client.setMediaConstraints(constraints);
7651
+ expect(client.getAudioDeviceId()).toBe(defaultId);
7652
+ expect(client.changeAudioInputDevice(defaultId, session)).toBeFalsy();
7653
+ });
7654
+
7655
+ it('should change the audio input track if the provided id is the same and force param is TRUE', async () => {
7656
+ client.setMediaConstraints(constraints);
7657
+ expect(client.getAudioDeviceId()).toBe(defaultId);
7658
+ expect(client.changeAudioInputDevice(defaultId, session, true)).toBeTruthy();
7659
+ });
7660
+ });
package/esm/api/calld.js CHANGED
@@ -968,6 +968,7 @@ const RECORD_STATE_ACTIVE = 'active';
968
968
 
969
969
 
970
970
 
971
+
971
972
 
972
973
 
973
974
 
@@ -978,6 +979,7 @@ const RECORD_STATE_ACTIVE = 'active';
978
979
 
979
980
 
980
981
 
982
+
981
983
 
982
984
 
983
985
 
@@ -1006,6 +1008,7 @@ class Call {
1006
1008
 
1007
1009
 
1008
1010
 
1011
+
1009
1012
 
1010
1013
 
1011
1014
 
@@ -1030,6 +1033,7 @@ class Call {
1030
1033
  calleeNumber: plain.peer_caller_id_number,
1031
1034
  dialedExtension: plain.dialed_extension,
1032
1035
  isCaller: plain.is_caller,
1036
+ isVideo: plain.is_video,
1033
1037
  muted: plain.muted,
1034
1038
  onHold: plain.on_hold,
1035
1039
  status: plain.status,
@@ -1053,6 +1057,7 @@ class Call {
1053
1057
  calleeNumber,
1054
1058
  dialedExtension,
1055
1059
  isCaller,
1060
+ isVideo,
1056
1061
  lineId,
1057
1062
  muted,
1058
1063
  onHold,
@@ -1076,6 +1081,7 @@ class Call {
1076
1081
  this.startingTime = startingTime;
1077
1082
  this.talkingToIds = talkingToIds || [];
1078
1083
  this.recording = recording;
1084
+ this.isVideo = !!isVideo;
1079
1085
 
1080
1086
  // Useful to compare instead of instanceof with minified code
1081
1087
  this.type = 'Call';
@@ -971,6 +971,7 @@ const RECORD_STATE_ACTIVE = 'active';
971
971
 
972
972
 
973
973
 
974
+
974
975
 
975
976
 
976
977
 
@@ -981,6 +982,7 @@ const RECORD_STATE_ACTIVE = 'active';
981
982
 
982
983
 
983
984
 
985
+
984
986
 
985
987
 
986
988
 
@@ -1009,6 +1011,7 @@ class Call {
1009
1011
 
1010
1012
 
1011
1013
 
1014
+
1012
1015
 
1013
1016
 
1014
1017
 
@@ -1033,6 +1036,7 @@ class Call {
1033
1036
  calleeNumber: plain.peer_caller_id_number,
1034
1037
  dialedExtension: plain.dialed_extension,
1035
1038
  isCaller: plain.is_caller,
1039
+ isVideo: plain.is_video,
1036
1040
  muted: plain.muted,
1037
1041
  onHold: plain.on_hold,
1038
1042
  status: plain.status,
@@ -1056,6 +1060,7 @@ class Call {
1056
1060
  calleeNumber,
1057
1061
  dialedExtension,
1058
1062
  isCaller,
1063
+ isVideo,
1059
1064
  lineId,
1060
1065
  muted,
1061
1066
  onHold,
@@ -1079,6 +1084,7 @@ class Call {
1079
1084
  this.startingTime = startingTime;
1080
1085
  this.talkingToIds = talkingToIds || [];
1081
1086
  this.recording = recording;
1087
+ this.isVideo = !!isVideo;
1082
1088
 
1083
1089
  // Useful to compare instead of instanceof with minified code
1084
1090
  this.type = 'Call';
package/esm/api-client.js CHANGED
@@ -3051,6 +3051,7 @@ const RECORD_STATE_ACTIVE = 'active';
3051
3051
 
3052
3052
 
3053
3053
 
3054
+
3054
3055
 
3055
3056
 
3056
3057
 
@@ -3061,6 +3062,7 @@ const RECORD_STATE_ACTIVE = 'active';
3061
3062
 
3062
3063
 
3063
3064
 
3065
+
3064
3066
 
3065
3067
 
3066
3068
 
@@ -3089,6 +3091,7 @@ class Call {
3089
3091
 
3090
3092
 
3091
3093
 
3094
+
3092
3095
 
3093
3096
 
3094
3097
 
@@ -3113,6 +3116,7 @@ class Call {
3113
3116
  calleeNumber: plain.peer_caller_id_number,
3114
3117
  dialedExtension: plain.dialed_extension,
3115
3118
  isCaller: plain.is_caller,
3119
+ isVideo: plain.is_video,
3116
3120
  muted: plain.muted,
3117
3121
  onHold: plain.on_hold,
3118
3122
  status: plain.status,
@@ -3136,6 +3140,7 @@ class Call {
3136
3140
  calleeNumber,
3137
3141
  dialedExtension,
3138
3142
  isCaller,
3143
+ isVideo,
3139
3144
  lineId,
3140
3145
  muted,
3141
3146
  onHold,
@@ -3159,6 +3164,7 @@ class Call {
3159
3164
  this.startingTime = startingTime;
3160
3165
  this.talkingToIds = talkingToIds || [];
3161
3166
  this.recording = recording;
3167
+ this.isVideo = !!isVideo;
3162
3168
 
3163
3169
  // Useful to compare instead of instanceof with minified code
3164
3170
  this.type = 'Call';
@@ -3069,6 +3069,7 @@ const RECORD_STATE_ACTIVE = 'active';
3069
3069
 
3070
3070
 
3071
3071
 
3072
+
3072
3073
 
3073
3074
 
3074
3075
 
@@ -3079,6 +3080,7 @@ const RECORD_STATE_ACTIVE = 'active';
3079
3080
 
3080
3081
 
3081
3082
 
3083
+
3082
3084
 
3083
3085
 
3084
3086
 
@@ -3107,6 +3109,7 @@ class Call {
3107
3109
 
3108
3110
 
3109
3111
 
3112
+
3110
3113
 
3111
3114
 
3112
3115
 
@@ -3131,6 +3134,7 @@ class Call {
3131
3134
  calleeNumber: plain.peer_caller_id_number,
3132
3135
  dialedExtension: plain.dialed_extension,
3133
3136
  isCaller: plain.is_caller,
3137
+ isVideo: plain.is_video,
3134
3138
  muted: plain.muted,
3135
3139
  onHold: plain.on_hold,
3136
3140
  status: plain.status,
@@ -3154,6 +3158,7 @@ class Call {
3154
3158
  calleeNumber,
3155
3159
  dialedExtension,
3156
3160
  isCaller,
3161
+ isVideo,
3157
3162
  lineId,
3158
3163
  muted,
3159
3164
  onHold,
@@ -3177,6 +3182,7 @@ class Call {
3177
3182
  this.startingTime = startingTime;
3178
3183
  this.talkingToIds = talkingToIds || [];
3179
3184
  this.recording = recording;
3185
+ this.isVideo = !!isVideo;
3180
3186
 
3181
3187
  // Useful to compare instead of instanceof with minified code
3182
3188
  this.type = 'Call';
@@ -6999,11 +7005,11 @@ class WebRTCClient extends Emitter {
6999
7005
  });
7000
7006
  }
7001
7007
 
7002
- changeAudioInputDevice(id , session ) {
7008
+ changeAudioInputDevice(id , session , force ) {
7003
7009
  const currentId = this.getAudioDeviceId();
7004
7010
  logger$1.info('setting audio input device', { id, currentId, session: !!session });
7005
7011
 
7006
- if (id === currentId) {
7012
+ if (!force && id === currentId) {
7007
7013
  return null;
7008
7014
  }
7009
7015
 
@@ -3051,6 +3051,7 @@ const RECORD_STATE_ACTIVE = 'active';
3051
3051
 
3052
3052
 
3053
3053
 
3054
+
3054
3055
 
3055
3056
 
3056
3057
 
@@ -3061,6 +3062,7 @@ const RECORD_STATE_ACTIVE = 'active';
3061
3062
 
3062
3063
 
3063
3064
 
3065
+
3064
3066
 
3065
3067
 
3066
3068
 
@@ -3089,6 +3091,7 @@ class Call {
3089
3091
 
3090
3092
 
3091
3093
 
3094
+
3092
3095
 
3093
3096
 
3094
3097
 
@@ -3113,6 +3116,7 @@ class Call {
3113
3116
  calleeNumber: plain.peer_caller_id_number,
3114
3117
  dialedExtension: plain.dialed_extension,
3115
3118
  isCaller: plain.is_caller,
3119
+ isVideo: plain.is_video,
3116
3120
  muted: plain.muted,
3117
3121
  onHold: plain.on_hold,
3118
3122
  status: plain.status,
@@ -3136,6 +3140,7 @@ class Call {
3136
3140
  calleeNumber,
3137
3141
  dialedExtension,
3138
3142
  isCaller,
3143
+ isVideo,
3139
3144
  lineId,
3140
3145
  muted,
3141
3146
  onHold,
@@ -3159,6 +3164,7 @@ class Call {
3159
3164
  this.startingTime = startingTime;
3160
3165
  this.talkingToIds = talkingToIds || [];
3161
3166
  this.recording = recording;
3167
+ this.isVideo = !!isVideo;
3162
3168
 
3163
3169
  // Useful to compare instead of instanceof with minified code
3164
3170
  this.type = 'Call';
@@ -3051,6 +3051,7 @@ const RECORD_STATE_ACTIVE = 'active';
3051
3051
 
3052
3052
 
3053
3053
 
3054
+
3054
3055
 
3055
3056
 
3056
3057
 
@@ -3061,6 +3062,7 @@ const RECORD_STATE_ACTIVE = 'active';
3061
3062
 
3062
3063
 
3063
3064
 
3065
+
3064
3066
 
3065
3067
 
3066
3068
 
@@ -3089,6 +3091,7 @@ class Call {
3089
3091
 
3090
3092
 
3091
3093
 
3094
+
3092
3095
 
3093
3096
 
3094
3097
 
@@ -3113,6 +3116,7 @@ class Call {
3113
3116
  calleeNumber: plain.peer_caller_id_number,
3114
3117
  dialedExtension: plain.dialed_extension,
3115
3118
  isCaller: plain.is_caller,
3119
+ isVideo: plain.is_video,
3116
3120
  muted: plain.muted,
3117
3121
  onHold: plain.on_hold,
3118
3122
  status: plain.status,
@@ -3136,6 +3140,7 @@ class Call {
3136
3140
  calleeNumber,
3137
3141
  dialedExtension,
3138
3142
  isCaller,
3143
+ isVideo,
3139
3144
  lineId,
3140
3145
  muted,
3141
3146
  onHold,
@@ -3159,6 +3164,7 @@ class Call {
3159
3164
  this.startingTime = startingTime;
3160
3165
  this.talkingToIds = talkingToIds || [];
3161
3166
  this.recording = recording;
3167
+ this.isVideo = !!isVideo;
3162
3168
 
3163
3169
  // Useful to compare instead of instanceof with minified code
3164
3170
  this.type = 'Call';
@@ -3069,6 +3069,7 @@ const RECORD_STATE_ACTIVE = 'active';
3069
3069
 
3070
3070
 
3071
3071
 
3072
+
3072
3073
 
3073
3074
 
3074
3075
 
@@ -3079,6 +3080,7 @@ const RECORD_STATE_ACTIVE = 'active';
3079
3080
 
3080
3081
 
3081
3082
 
3083
+
3082
3084
 
3083
3085
 
3084
3086
 
@@ -3107,6 +3109,7 @@ class Call {
3107
3109
 
3108
3110
 
3109
3111
 
3112
+
3110
3113
 
3111
3114
 
3112
3115
 
@@ -3131,6 +3134,7 @@ class Call {
3131
3134
  calleeNumber: plain.peer_caller_id_number,
3132
3135
  dialedExtension: plain.dialed_extension,
3133
3136
  isCaller: plain.is_caller,
3137
+ isVideo: plain.is_video,
3134
3138
  muted: plain.muted,
3135
3139
  onHold: plain.on_hold,
3136
3140
  status: plain.status,
@@ -3154,6 +3158,7 @@ class Call {
3154
3158
  calleeNumber,
3155
3159
  dialedExtension,
3156
3160
  isCaller,
3161
+ isVideo,
3157
3162
  lineId,
3158
3163
  muted,
3159
3164
  onHold,
@@ -3177,6 +3182,7 @@ class Call {
3177
3182
  this.startingTime = startingTime;
3178
3183
  this.talkingToIds = talkingToIds || [];
3179
3184
  this.recording = recording;
3185
+ this.isVideo = !!isVideo;
3180
3186
 
3181
3187
  // Useful to compare instead of instanceof with minified code
3182
3188
  this.type = 'Call';
@@ -6999,11 +7005,11 @@ class WebRTCClient extends Emitter {
6999
7005
  });
7000
7006
  }
7001
7007
 
7002
- changeAudioInputDevice(id , session ) {
7008
+ changeAudioInputDevice(id , session , force ) {
7003
7009
  const currentId = this.getAudioDeviceId();
7004
7010
  logger.info('setting audio input device', { id, currentId, session: !!session });
7005
7011
 
7006
- if (id === currentId) {
7012
+ if (!force && id === currentId) {
7007
7013
  return null;
7008
7014
  }
7009
7015
 
@@ -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';
@@ -6414,11 +6420,11 @@ class WebRTCClient extends Emitter {
6414
6420
  });
6415
6421
  }
6416
6422
 
6417
- changeAudioInputDevice(id , session ) {
6423
+ changeAudioInputDevice(id , session , force ) {
6418
6424
  const currentId = this.getAudioDeviceId();
6419
6425
  logger.info('setting audio input device', { id, currentId, session: !!session });
6420
6426
 
6421
- if (id === currentId) {
6427
+ if (!force && id === currentId) {
6422
6428
  return null;
6423
6429
  }
6424
6430
 
@@ -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';
@@ -6414,11 +6420,11 @@ class WebRTCClient extends Emitter {
6414
6420
  });
6415
6421
  }
6416
6422
 
6417
- changeAudioInputDevice(id , session ) {
6423
+ changeAudioInputDevice(id , session , force ) {
6418
6424
  const currentId = this.getAudioDeviceId();
6419
6425
  logger.info('setting audio input device', { id, currentId, session: !!session });
6420
6426
 
6421
- if (id === currentId) {
6427
+ if (!force && id === currentId) {
6422
6428
  return null;
6423
6429
  }
6424
6430
 
@@ -30,6 +30,7 @@ const RECORD_STATE_ACTIVE = 'active';
30
30
 
31
31
 
32
32
 
33
+
33
34
 
34
35
 
35
36
 
@@ -40,6 +41,7 @@ const RECORD_STATE_ACTIVE = 'active';
40
41
 
41
42
 
42
43
 
44
+
43
45
 
44
46
 
45
47
 
@@ -68,6 +70,7 @@ class Call {
68
70
 
69
71
 
70
72
 
73
+
71
74
 
72
75
 
73
76
 
@@ -92,6 +95,7 @@ class Call {
92
95
  calleeNumber: plain.peer_caller_id_number,
93
96
  dialedExtension: plain.dialed_extension,
94
97
  isCaller: plain.is_caller,
98
+ isVideo: plain.is_video,
95
99
  muted: plain.muted,
96
100
  onHold: plain.on_hold,
97
101
  status: plain.status,
@@ -115,6 +119,7 @@ class Call {
115
119
  calleeNumber,
116
120
  dialedExtension,
117
121
  isCaller,
122
+ isVideo,
118
123
  lineId,
119
124
  muted,
120
125
  onHold,
@@ -138,6 +143,7 @@ class Call {
138
143
  this.startingTime = startingTime;
139
144
  this.talkingToIds = talkingToIds || [];
140
145
  this.recording = recording;
146
+ this.isVideo = !!isVideo;
141
147
 
142
148
  // Useful to compare instead of instanceof with minified code
143
149
  this.type = 'Call';