@wazo/sdk 0.38.3 → 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 (93) hide show
  1. package/README.md +10 -10
  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 +66 -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 +16 -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 +16 -2
  12. package/esm/checker/checks/webrtc-transport.js +16 -2
  13. package/esm/checker/checks/webrtc.js +16 -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__/Line.test.js +5 -5
  24. package/esm/domain/__tests__/Room.test.js +1 -1
  25. package/esm/index.js +24 -11
  26. package/esm/lib/WazoSessionDescriptionHandler.js +8 -0
  27. package/esm/service/CallApi.js +6 -0
  28. package/esm/service/getApiClient.js +6 -0
  29. package/esm/simple/Auth.js +24 -11
  30. package/esm/simple/Configuration.js +24 -11
  31. package/esm/simple/Directory.js +6 -0
  32. package/esm/simple/Phone.js +24 -11
  33. package/esm/simple/Softphone.js +5 -6
  34. package/esm/simple/index.js +24 -11
  35. package/esm/simple/room/LocalParticipant.js +24 -11
  36. package/esm/simple/room/Participant.js +24 -11
  37. package/esm/simple/room/RemoteParticipant.js +24 -11
  38. package/esm/simple/room/Room.js +24 -11
  39. package/esm/simple/room/SipRoom.js +24 -11
  40. package/esm/simple/room/Stream.js +24 -11
  41. package/esm/simple/room/__tests__/RemoteParticipant.test.js +24 -11
  42. package/esm/simple/utils.js +24 -11
  43. package/esm/web-rtc-client.js +16 -2
  44. package/lib/__tests__/api-client.test.js +6 -0
  45. package/lib/__tests__/web-rtc-client.test.js +66 -2
  46. package/lib/api/calld.js +6 -0
  47. package/lib/api/ctid-ng.js +6 -0
  48. package/lib/api-client.js +6 -0
  49. package/lib/checker/Checker.js +16 -2
  50. package/lib/checker/checks/aor.js +6 -0
  51. package/lib/checker/checks/api.js +6 -0
  52. package/lib/checker/checks/index.js +16 -2
  53. package/lib/checker/checks/webrtc-transport.js +16 -2
  54. package/lib/checker/checks/webrtc.js +16 -2
  55. package/lib/domain/AdHocAPIConference.js +6 -0
  56. package/lib/domain/Call.js +6 -0
  57. package/lib/domain/CallSession.js +1 -1
  58. package/lib/domain/Features.js +6 -0
  59. package/lib/domain/Phone/CTIPhone.js +7 -1
  60. package/lib/domain/Phone/WebRTCPhone.js +3 -3
  61. package/lib/domain/__tests__/Call.test.js +6 -0
  62. package/lib/domain/__tests__/CallSession.test.js +1 -1
  63. package/lib/domain/__tests__/IndirectTransfer.test.js +1 -1
  64. package/lib/domain/__tests__/Line.test.js +5 -5
  65. package/lib/domain/__tests__/Room.test.js +1 -1
  66. package/lib/index.js +24 -11
  67. package/lib/lib/WazoSessionDescriptionHandler.js +8 -0
  68. package/lib/service/CallApi.js +6 -0
  69. package/lib/service/getApiClient.js +6 -0
  70. package/lib/simple/Auth.js +24 -11
  71. package/lib/simple/Configuration.js +24 -11
  72. package/lib/simple/Directory.js +6 -0
  73. package/lib/simple/Phone.js +24 -11
  74. package/lib/simple/Softphone.js +5 -6
  75. package/lib/simple/index.js +24 -11
  76. package/lib/simple/room/LocalParticipant.js +24 -11
  77. package/lib/simple/room/Participant.js +24 -11
  78. package/lib/simple/room/RemoteParticipant.js +24 -11
  79. package/lib/simple/room/Room.js +24 -11
  80. package/lib/simple/room/SipRoom.js +24 -11
  81. package/lib/simple/room/Stream.js +24 -11
  82. package/lib/simple/room/__tests__/RemoteParticipant.test.js +24 -11
  83. package/lib/simple/utils.js +24 -11
  84. package/lib/web-rtc-client.js +16 -2
  85. package/package.json +1 -1
  86. package/src/__tests__/web-rtc-client.test.js +50 -0
  87. package/src/domain/Call.js +6 -0
  88. package/src/domain/CallSession.js +1 -1
  89. package/src/domain/Phone/WebRTCPhone.js +2 -2
  90. package/src/domain/__tests__/Line.test.js +5 -5
  91. package/src/lib/WazoSessionDescriptionHandler.js +8 -0
  92. package/src/simple/Softphone.js +5 -6
  93. package/src/web-rtc-client.js +2 -2
@@ -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';
@@ -5616,6 +5622,14 @@ class WazoSessionDescriptionHandler extends sessionDescriptionHandler.SessionDes
5616
5622
  wazoLogger.trace('onicecandidate', event.candidate ? event.candidate.candidate : { done: true });
5617
5623
  if (event.candidate) {
5618
5624
  this.gatheredCandidates.push(parseCandidate$1(event.candidate.candidate));
5625
+
5626
+ // When receiving a `srflx` or a `relay` candidate, consider the negotiation done.
5627
+ if (event.candidate.candidate.indexOf('srflx') !== -1 || event.candidate.candidate.indexOf('relay') !== -1) {
5628
+ wazoLogger.info('A valid ice was found, triggering ice gathering complete callback.', {
5629
+ ice: event.candidate.candidate,
5630
+ });
5631
+ this.iceGatheringComplete();
5632
+ }
5619
5633
  }
5620
5634
  };
5621
5635
 
@@ -7001,11 +7015,11 @@ class WebRTCClient extends Emitter {
7001
7015
  });
7002
7016
  }
7003
7017
 
7004
- changeAudioInputDevice(id , session ) {
7018
+ changeAudioInputDevice(id , session , force ) {
7005
7019
  const currentId = this.getAudioDeviceId();
7006
7020
  logger$1.info('setting audio input device', { id, currentId, session: !!session });
7007
7021
 
7008
- if (id === currentId) {
7022
+ if (!force && id === currentId) {
7009
7023
  return null;
7010
7024
  }
7011
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';
@@ -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';
@@ -5616,6 +5622,14 @@ class WazoSessionDescriptionHandler extends sessionDescriptionHandler.SessionDes
5616
5622
  wazoLogger.trace('onicecandidate', event.candidate ? event.candidate.candidate : { done: true });
5617
5623
  if (event.candidate) {
5618
5624
  this.gatheredCandidates.push(parseCandidate$1(event.candidate.candidate));
5625
+
5626
+ // When receiving a `srflx` or a `relay` candidate, consider the negotiation done.
5627
+ if (event.candidate.candidate.indexOf('srflx') !== -1 || event.candidate.candidate.indexOf('relay') !== -1) {
5628
+ wazoLogger.info('A valid ice was found, triggering ice gathering complete callback.', {
5629
+ ice: event.candidate.candidate,
5630
+ });
5631
+ this.iceGatheringComplete();
5632
+ }
5619
5633
  }
5620
5634
  };
5621
5635
 
@@ -7001,11 +7015,11 @@ class WebRTCClient extends Emitter {
7001
7015
  });
7002
7016
  }
7003
7017
 
7004
- changeAudioInputDevice(id , session ) {
7018
+ changeAudioInputDevice(id , session , force ) {
7005
7019
  const currentId = this.getAudioDeviceId();
7006
7020
  logger.info('setting audio input device', { id, currentId, session: !!session });
7007
7021
 
7008
- if (id === currentId) {
7022
+ if (!force && id === currentId) {
7009
7023
  return null;
7010
7024
  }
7011
7025
 
@@ -885,6 +885,14 @@ class WazoSessionDescriptionHandler extends sessionDescriptionHandler.SessionDes
885
885
  wazoLogger.trace('onicecandidate', event.candidate ? event.candidate.candidate : { done: true });
886
886
  if (event.candidate) {
887
887
  this.gatheredCandidates.push(parseCandidate(event.candidate.candidate));
888
+
889
+ // When receiving a `srflx` or a `relay` candidate, consider the negotiation done.
890
+ if (event.candidate.candidate.indexOf('srflx') !== -1 || event.candidate.candidate.indexOf('relay') !== -1) {
891
+ wazoLogger.info('A valid ice was found, triggering ice gathering complete callback.', {
892
+ ice: event.candidate.candidate,
893
+ });
894
+ this.iceGatheringComplete();
895
+ }
888
896
  }
889
897
  };
890
898
 
@@ -3608,6 +3616,7 @@ const RECORD_STATE_ACTIVE = 'active';
3608
3616
 
3609
3617
 
3610
3618
 
3619
+
3611
3620
 
3612
3621
 
3613
3622
 
@@ -3618,6 +3627,7 @@ const RECORD_STATE_ACTIVE = 'active';
3618
3627
 
3619
3628
 
3620
3629
 
3630
+
3621
3631
 
3622
3632
 
3623
3633
 
@@ -3646,6 +3656,7 @@ class Call {
3646
3656
 
3647
3657
 
3648
3658
 
3659
+
3649
3660
 
3650
3661
 
3651
3662
 
@@ -3670,6 +3681,7 @@ class Call {
3670
3681
  calleeNumber: plain.peer_caller_id_number,
3671
3682
  dialedExtension: plain.dialed_extension,
3672
3683
  isCaller: plain.is_caller,
3684
+ isVideo: plain.is_video,
3673
3685
  muted: plain.muted,
3674
3686
  onHold: plain.on_hold,
3675
3687
  status: plain.status,
@@ -3693,6 +3705,7 @@ class Call {
3693
3705
  calleeNumber,
3694
3706
  dialedExtension,
3695
3707
  isCaller,
3708
+ isVideo,
3696
3709
  lineId,
3697
3710
  muted,
3698
3711
  onHold,
@@ -3716,6 +3729,7 @@ class Call {
3716
3729
  this.startingTime = startingTime;
3717
3730
  this.talkingToIds = talkingToIds || [];
3718
3731
  this.recording = recording;
3732
+ this.isVideo = !!isVideo;
3719
3733
 
3720
3734
  // Useful to compare instead of instanceof with minified code
3721
3735
  this.type = 'Call';
@@ -6415,11 +6429,11 @@ class WebRTCClient extends Emitter {
6415
6429
  });
6416
6430
  }
6417
6431
 
6418
- changeAudioInputDevice(id , session ) {
6432
+ changeAudioInputDevice(id , session , force ) {
6419
6433
  const currentId = this.getAudioDeviceId();
6420
6434
  logger.info('setting audio input device', { id, currentId, session: !!session });
6421
6435
 
6422
- if (id === currentId) {
6436
+ if (!force && id === currentId) {
6423
6437
  return null;
6424
6438
  }
6425
6439
 
@@ -885,6 +885,14 @@ class WazoSessionDescriptionHandler extends sessionDescriptionHandler.SessionDes
885
885
  wazoLogger.trace('onicecandidate', event.candidate ? event.candidate.candidate : { done: true });
886
886
  if (event.candidate) {
887
887
  this.gatheredCandidates.push(parseCandidate(event.candidate.candidate));
888
+
889
+ // When receiving a `srflx` or a `relay` candidate, consider the negotiation done.
890
+ if (event.candidate.candidate.indexOf('srflx') !== -1 || event.candidate.candidate.indexOf('relay') !== -1) {
891
+ wazoLogger.info('A valid ice was found, triggering ice gathering complete callback.', {
892
+ ice: event.candidate.candidate,
893
+ });
894
+ this.iceGatheringComplete();
895
+ }
888
896
  }
889
897
  };
890
898
 
@@ -3608,6 +3616,7 @@ const RECORD_STATE_ACTIVE = 'active';
3608
3616
 
3609
3617
 
3610
3618
 
3619
+
3611
3620
 
3612
3621
 
3613
3622
 
@@ -3618,6 +3627,7 @@ const RECORD_STATE_ACTIVE = 'active';
3618
3627
 
3619
3628
 
3620
3629
 
3630
+
3621
3631
 
3622
3632
 
3623
3633
 
@@ -3646,6 +3656,7 @@ class Call {
3646
3656
 
3647
3657
 
3648
3658
 
3659
+
3649
3660
 
3650
3661
 
3651
3662
 
@@ -3670,6 +3681,7 @@ class Call {
3670
3681
  calleeNumber: plain.peer_caller_id_number,
3671
3682
  dialedExtension: plain.dialed_extension,
3672
3683
  isCaller: plain.is_caller,
3684
+ isVideo: plain.is_video,
3673
3685
  muted: plain.muted,
3674
3686
  onHold: plain.on_hold,
3675
3687
  status: plain.status,
@@ -3693,6 +3705,7 @@ class Call {
3693
3705
  calleeNumber,
3694
3706
  dialedExtension,
3695
3707
  isCaller,
3708
+ isVideo,
3696
3709
  lineId,
3697
3710
  muted,
3698
3711
  onHold,
@@ -3716,6 +3729,7 @@ class Call {
3716
3729
  this.startingTime = startingTime;
3717
3730
  this.talkingToIds = talkingToIds || [];
3718
3731
  this.recording = recording;
3732
+ this.isVideo = !!isVideo;
3719
3733
 
3720
3734
  // Useful to compare instead of instanceof with minified code
3721
3735
  this.type = 'Call';
@@ -6415,11 +6429,11 @@ class WebRTCClient extends Emitter {
6415
6429
  });
6416
6430
  }
6417
6431
 
6418
- changeAudioInputDevice(id , session ) {
6432
+ changeAudioInputDevice(id , session , force ) {
6419
6433
  const currentId = this.getAudioDeviceId();
6420
6434
  logger.info('setting audio input device', { id, currentId, session: !!session });
6421
6435
 
6422
- if (id === currentId) {
6436
+ if (!force && id === currentId) {
6423
6437
  return null;
6424
6438
  }
6425
6439
 
@@ -36,6 +36,7 @@ const RECORD_STATE_ACTIVE = 'active';
36
36
 
37
37
 
38
38
 
39
+
39
40
 
40
41
 
41
42
 
@@ -46,6 +47,7 @@ const RECORD_STATE_ACTIVE = 'active';
46
47
 
47
48
 
48
49
 
50
+
49
51
 
50
52
 
51
53
 
@@ -74,6 +76,7 @@ class Call {
74
76
 
75
77
 
76
78
 
79
+
77
80
 
78
81
 
79
82
 
@@ -98,6 +101,7 @@ class Call {
98
101
  calleeNumber: plain.peer_caller_id_number,
99
102
  dialedExtension: plain.dialed_extension,
100
103
  isCaller: plain.is_caller,
104
+ isVideo: plain.is_video,
101
105
  muted: plain.muted,
102
106
  onHold: plain.on_hold,
103
107
  status: plain.status,
@@ -121,6 +125,7 @@ class Call {
121
125
  calleeNumber,
122
126
  dialedExtension,
123
127
  isCaller,
128
+ isVideo,
124
129
  lineId,
125
130
  muted,
126
131
  onHold,
@@ -144,6 +149,7 @@ class Call {
144
149
  this.startingTime = startingTime;
145
150
  this.talkingToIds = talkingToIds || [];
146
151
  this.recording = recording;
152
+ this.isVideo = !!isVideo;
147
153
 
148
154
  // Useful to compare instead of instanceof with minified code
149
155
  this.type = 'Call';
@@ -31,6 +31,7 @@ const RECORD_STATE_ACTIVE = 'active';
31
31
 
32
32
 
33
33
 
34
+
34
35
 
35
36
 
36
37
 
@@ -41,6 +42,7 @@ const RECORD_STATE_ACTIVE = 'active';
41
42
 
42
43
 
43
44
 
45
+
44
46
 
45
47
 
46
48
 
@@ -69,6 +71,7 @@ class Call {
69
71
 
70
72
 
71
73
 
74
+
72
75
 
73
76
 
74
77
 
@@ -93,6 +96,7 @@ class Call {
93
96
  calleeNumber: plain.peer_caller_id_number,
94
97
  dialedExtension: plain.dialed_extension,
95
98
  isCaller: plain.is_caller,
99
+ isVideo: plain.is_video,
96
100
  muted: plain.muted,
97
101
  onHold: plain.on_hold,
98
102
  status: plain.status,
@@ -116,6 +120,7 @@ class Call {
116
120
  calleeNumber,
117
121
  dialedExtension,
118
122
  isCaller,
123
+ isVideo,
119
124
  lineId,
120
125
  muted,
121
126
  onHold,
@@ -139,6 +144,7 @@ class Call {
139
144
  this.startingTime = startingTime;
140
145
  this.talkingToIds = talkingToIds || [];
141
146
  this.recording = recording;
147
+ this.isVideo = !!isVideo;
142
148
 
143
149
  // Useful to compare instead of instanceof with minified code
144
150
  this.type = 'Call';
@@ -416,7 +416,7 @@ class CallSession {
416
416
  ringing: call.isRinging(),
417
417
  answered: call.isUp(),
418
418
  answeredBySystem: call.isUp() && call.talkingToIds.length === 0,
419
- cameraEnabled: false,
419
+ cameraEnabled: call.isVideo,
420
420
  dialedExtension: call.dialedExtension,
421
421
  call,
422
422
  conference: false, // @FIXME?
@@ -3059,6 +3059,7 @@ const RECORD_STATE_ACTIVE = 'active';
3059
3059
 
3060
3060
 
3061
3061
 
3062
+
3062
3063
 
3063
3064
 
3064
3065
 
@@ -3069,6 +3070,7 @@ const RECORD_STATE_ACTIVE = 'active';
3069
3070
 
3070
3071
 
3071
3072
 
3073
+
3072
3074
 
3073
3075
 
3074
3076
 
@@ -3097,6 +3099,7 @@ class Call {
3097
3099
 
3098
3100
 
3099
3101
 
3102
+
3100
3103
 
3101
3104
 
3102
3105
 
@@ -3121,6 +3124,7 @@ class Call {
3121
3124
  calleeNumber: plain.peer_caller_id_number,
3122
3125
  dialedExtension: plain.dialed_extension,
3123
3126
  isCaller: plain.is_caller,
3127
+ isVideo: plain.is_video,
3124
3128
  muted: plain.muted,
3125
3129
  onHold: plain.on_hold,
3126
3130
  status: plain.status,
@@ -3144,6 +3148,7 @@ class Call {
3144
3148
  calleeNumber,
3145
3149
  dialedExtension,
3146
3150
  isCaller,
3151
+ isVideo,
3147
3152
  lineId,
3148
3153
  muted,
3149
3154
  onHold,
@@ -3167,6 +3172,7 @@ class Call {
3167
3172
  this.startingTime = startingTime;
3168
3173
  this.talkingToIds = talkingToIds || [];
3169
3174
  this.recording = recording;
3175
+ this.isVideo = !!isVideo;
3170
3176
 
3171
3177
  // Useful to compare instead of instanceof with minified code
3172
3178
  this.type = 'Call';
@@ -1522,6 +1522,7 @@ const RECORD_STATE_ACTIVE = 'active';
1522
1522
 
1523
1523
 
1524
1524
 
1525
+
1525
1526
 
1526
1527
 
1527
1528
 
@@ -1532,6 +1533,7 @@ const RECORD_STATE_ACTIVE = 'active';
1532
1533
 
1533
1534
 
1534
1535
 
1536
+
1535
1537
 
1536
1538
 
1537
1539
 
@@ -1560,6 +1562,7 @@ class Call {
1560
1562
 
1561
1563
 
1562
1564
 
1565
+
1563
1566
 
1564
1567
 
1565
1568
 
@@ -1584,6 +1587,7 @@ class Call {
1584
1587
  calleeNumber: plain.peer_caller_id_number,
1585
1588
  dialedExtension: plain.dialed_extension,
1586
1589
  isCaller: plain.is_caller,
1590
+ isVideo: plain.is_video,
1587
1591
  muted: plain.muted,
1588
1592
  onHold: plain.on_hold,
1589
1593
  status: plain.status,
@@ -1607,6 +1611,7 @@ class Call {
1607
1611
  calleeNumber,
1608
1612
  dialedExtension,
1609
1613
  isCaller,
1614
+ isVideo,
1610
1615
  lineId,
1611
1616
  muted,
1612
1617
  onHold,
@@ -1630,6 +1635,7 @@ class Call {
1630
1635
  this.startingTime = startingTime;
1631
1636
  this.talkingToIds = talkingToIds || [];
1632
1637
  this.recording = recording;
1638
+ this.isVideo = !!isVideo;
1633
1639
 
1634
1640
  // Useful to compare instead of instanceof with minified code
1635
1641
  this.type = 'Call';
@@ -2103,7 +2109,7 @@ class CallSession {
2103
2109
  ringing: call.isRinging(),
2104
2110
  answered: call.isUp(),
2105
2111
  answeredBySystem: call.isUp() && call.talkingToIds.length === 0,
2106
- cameraEnabled: false,
2112
+ cameraEnabled: call.isVideo,
2107
2113
  dialedExtension: call.dialedExtension,
2108
2114
  call,
2109
2115
  conference: false, // @FIXME?