@wazo/sdk 0.37.1 → 0.37.2

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 (105) hide show
  1. package/dist/wazo-sdk.js +5 -5
  2. package/esm/__tests__/api-client.test.js +7 -1
  3. package/esm/__tests__/web-rtc-client.test.js +13 -1
  4. package/esm/api/agentd.js +7 -1
  5. package/esm/api/amid.js +7 -1
  6. package/esm/api/application.js +7 -1
  7. package/esm/api/auth.js +7 -1
  8. package/esm/api/call-logd.js +7 -1
  9. package/esm/api/calld.js +7 -1
  10. package/esm/api/chatd.js +7 -1
  11. package/esm/api/confd.js +7 -1
  12. package/esm/api/ctid-ng.js +7 -1
  13. package/esm/api/dird.js +7 -1
  14. package/esm/api/webhookd.js +7 -1
  15. package/esm/api-client.js +7 -1
  16. package/esm/checker/Checker.js +13 -1
  17. package/esm/checker/checks/aor.js +7 -1
  18. package/esm/checker/checks/api.js +7 -1
  19. package/esm/checker/checks/index.js +13 -1
  20. package/esm/checker/checks/wazo-websocket.js +7 -1
  21. package/esm/checker/checks/webrtc-transport.js +13 -1
  22. package/esm/checker/checks/webrtc.js +13 -1
  23. package/esm/domain/AdHocAPIConference.js +7 -1
  24. package/esm/domain/Features.js +7 -1
  25. package/esm/domain/Phone/CTIPhone.js +11 -1
  26. package/esm/domain/Phone/WebRTCPhone.js +7 -1
  27. package/esm/index.js +5648 -5229
  28. package/esm/lib/WazoSessionDescriptionHandler.js +7 -1
  29. package/esm/service/CallApi.js +7 -1
  30. package/esm/service/IssueReporter.js +7 -1
  31. package/esm/service/__tests__/IssueReporter.test.js +9 -1
  32. package/esm/service/getApiClient.js +7 -1
  33. package/esm/simple/Auth.js +426 -9
  34. package/esm/simple/Configuration.js +426 -9
  35. package/esm/simple/Directory.js +7 -1
  36. package/esm/simple/Phone.js +426 -9
  37. package/esm/simple/Websocket.js +7 -1
  38. package/esm/simple/index.js +426 -9
  39. package/esm/simple/room/LocalParticipant.js +426 -9
  40. package/esm/simple/room/Participant.js +426 -9
  41. package/esm/simple/room/RemoteParticipant.js +426 -9
  42. package/esm/simple/room/Room.js +426 -9
  43. package/esm/simple/room/Stream.js +426 -9
  44. package/esm/simple/room/__tests__/RemoteParticipant.test.js +426 -9
  45. package/esm/simple/utils.js +426 -9
  46. package/esm/utils/__tests__/api-requester.test.js +7 -1
  47. package/esm/utils/api-requester.js +7 -1
  48. package/esm/web-rtc-client.js +13 -1
  49. package/esm/websocket-client.js +7 -1
  50. package/lib/__tests__/api-client.test.js +7 -1
  51. package/lib/__tests__/web-rtc-client.test.js +13 -1
  52. package/lib/api/agentd.js +7 -1
  53. package/lib/api/amid.js +7 -1
  54. package/lib/api/application.js +7 -1
  55. package/lib/api/auth.js +7 -1
  56. package/lib/api/call-logd.js +7 -1
  57. package/lib/api/calld.js +7 -1
  58. package/lib/api/chatd.js +7 -1
  59. package/lib/api/confd.js +7 -1
  60. package/lib/api/ctid-ng.js +7 -1
  61. package/lib/api/dird.js +7 -1
  62. package/lib/api/webhookd.js +7 -1
  63. package/lib/api-client.js +7 -1
  64. package/lib/checker/Checker.js +13 -1
  65. package/lib/checker/checks/aor.js +7 -1
  66. package/lib/checker/checks/api.js +7 -1
  67. package/lib/checker/checks/index.js +13 -1
  68. package/lib/checker/checks/wazo-websocket.js +7 -1
  69. package/lib/checker/checks/webrtc-transport.js +13 -1
  70. package/lib/checker/checks/webrtc.js +13 -1
  71. package/lib/domain/AdHocAPIConference.js +7 -1
  72. package/lib/domain/Features.js +7 -1
  73. package/lib/domain/Phone/CTIPhone.js +11 -1
  74. package/lib/domain/Phone/WebRTCPhone.js +7 -1
  75. package/lib/index.js +5648 -5229
  76. package/lib/lib/WazoSessionDescriptionHandler.js +7 -1
  77. package/lib/service/CallApi.js +7 -1
  78. package/lib/service/IssueReporter.js +7 -1
  79. package/lib/service/__tests__/IssueReporter.test.js +9 -1
  80. package/lib/service/getApiClient.js +7 -1
  81. package/lib/simple/Auth.js +426 -9
  82. package/lib/simple/Configuration.js +426 -9
  83. package/lib/simple/Directory.js +7 -1
  84. package/lib/simple/Phone.js +426 -9
  85. package/lib/simple/Websocket.js +7 -1
  86. package/lib/simple/index.js +426 -9
  87. package/lib/simple/room/LocalParticipant.js +426 -9
  88. package/lib/simple/room/Participant.js +426 -9
  89. package/lib/simple/room/RemoteParticipant.js +426 -9
  90. package/lib/simple/room/Room.js +426 -9
  91. package/lib/simple/room/Stream.js +426 -9
  92. package/lib/simple/room/__tests__/RemoteParticipant.test.js +426 -9
  93. package/lib/simple/utils.js +426 -9
  94. package/lib/utils/__tests__/api-requester.test.js +7 -1
  95. package/lib/utils/api-requester.js +7 -1
  96. package/lib/web-rtc-client.js +13 -1
  97. package/lib/websocket-client.js +7 -1
  98. package/package.json +1 -1
  99. package/src/domain/Phone/CTIPhone.js +4 -0
  100. package/src/domain/Phone/Phone.js +2 -0
  101. package/src/index.js +4 -0
  102. package/src/service/IssueReporter.js +7 -1
  103. package/src/service/__tests__/IssueReporter.test.js +2 -0
  104. package/src/simple/index.js +4 -0
  105. package/src/web-rtc-client.js +6 -0
@@ -877,7 +877,13 @@ class IssueReporter {
877
877
  }
878
878
 
879
879
  _isLevelAbove(level1 , level2 ) {
880
- return LOG_LEVELS.indexOf(level1) > LOG_LEVELS.indexOf(level2);
880
+ const index1 = LOG_LEVELS.indexOf(level1);
881
+ const index2 = LOG_LEVELS.indexOf(level2);
882
+ if (index1 === -1 || index2 === -1) {
883
+ return false;
884
+ }
885
+
886
+ return index1 > index2;
881
887
  }
882
888
 
883
889
  _makeCategory(category ) {
@@ -900,7 +906,7 @@ var IssueReporter$1 = new IssueReporter();
900
906
 
901
907
  const methods = ['head', 'get', 'post', 'put', 'delete'];
902
908
 
903
- const logger$a = IssueReporter$1 ? IssueReporter$1.loggerFor('api') : console;
909
+ const logger$b = IssueReporter$1 ? IssueReporter$1.loggerFor('api') : console;
904
910
 
905
911
  // Use a function here to be able to mock it in tests
906
912
  const realFetch = () => {
@@ -1039,7 +1045,7 @@ class ApiRequester {
1039
1045
  };
1040
1046
 
1041
1047
  if (this.refreshTokenPromise) {
1042
- logger$a.info('A token is already refreshing, waiting ...', { url });
1048
+ logger$b.info('A token is already refreshing, waiting ...', { url });
1043
1049
  await this.refreshTokenPromise;
1044
1050
  }
1045
1051
 
@@ -1059,7 +1065,7 @@ class ApiRequester {
1059
1065
  return promise.then(async (err ) => {
1060
1066
  // Check if the token is still valid
1061
1067
  if (firstCall && this._checkTokenExpired(response, err)) {
1062
- logger$a.warn('token expired', { error: err.reason });
1068
+ logger$b.warn('token expired', { error: err.reason });
1063
1069
  // Replay the call after refreshing the token
1064
1070
  return this._replayWithNewToken(err, path, method, body, headers, parse);
1065
1071
  }
@@ -1069,7 +1075,7 @@ class ApiRequester {
1069
1075
  : exceptionClass.fromResponse(err, response.status);
1070
1076
 
1071
1077
  if (this.shouldLogErrors) {
1072
- logger$a.error('API error', error);
1078
+ logger$b.error('API error', error);
1073
1079
  }
1074
1080
 
1075
1081
  throw error;
@@ -1079,7 +1085,7 @@ class ApiRequester {
1079
1085
  return newParse(response, isJson);
1080
1086
  }).catch(error => {
1081
1087
  if (this.shouldLogErrors) {
1082
- logger$a.error('Fetch failed', { url, options, message: error.message, stack: error.stack });
1088
+ logger$b.error('Fetch failed', { url, options, message: error.message, stack: error.stack });
1083
1089
  }
1084
1090
 
1085
1091
  throw error;
@@ -1107,13 +1113,13 @@ class ApiRequester {
1107
1113
  ) {
1108
1114
  const isTokenNotFound = this._isTokenNotFound(err);
1109
1115
  let newPath = path;
1110
- logger$a.info('refreshing token', { inProgress: !!this.refreshTokenPromise });
1116
+ logger$b.info('refreshing token', { inProgress: !!this.refreshTokenPromise });
1111
1117
 
1112
1118
  this.refreshTokenPromise = this.refreshTokenPromise || this.refreshTokenCallback();
1113
1119
 
1114
1120
  return this.refreshTokenPromise.then(() => {
1115
1121
  this.refreshTokenPromise = null;
1116
- logger$a.info('token refreshed', { isTokenNotFound });
1122
+ logger$b.info('token refreshed', { isTokenNotFound });
1117
1123
  if (isTokenNotFound) {
1118
1124
  const pathParts = path.split('/');
1119
1125
  pathParts.pop();
@@ -3726,11 +3732,414 @@ class IndirectTransfer {
3726
3732
  }
3727
3733
 
3728
3734
  //
3735
+
3736
+ class CallApi {
3737
+ static async fetchCallLogs(offset , limit ) {
3738
+ return getApiClient().callLogd.listCallLogs(offset, limit);
3739
+ }
3740
+
3741
+ static async fetchDistinctCallLogs(offset , limit , distinct = 'peer_exten') {
3742
+ return getApiClient().callLogd.listDistinctCallLogs(offset, limit, distinct);
3743
+ }
3744
+
3745
+ static async fetchActiveCalls() {
3746
+ return getApiClient().calld.listCalls();
3747
+ }
3748
+
3749
+ static async fetchCallLogsFromDate(from , number ) {
3750
+ return getApiClient().callLogd.listCallLogsFromDate(from, number);
3751
+ }
3752
+
3753
+ static async search(query , limit ) {
3754
+ return getApiClient().callLogd.search(query, limit);
3755
+ }
3756
+
3757
+ static async searchBy(field , value , limit ) {
3758
+ return getApiClient().callLogd.searchBy(field, value, limit);
3759
+ }
3760
+
3761
+ static async fetchSIP(session , line ) {
3762
+ const lineToUse = line || session.primaryLine();
3763
+ return getApiClient().confd.getUserLineSip(session.uuid, lineToUse ? lineToUse.id : null);
3764
+ }
3765
+
3766
+ static async cancelCall(callSession ) {
3767
+ return getApiClient().calld.cancelCall(callSession.callId);
3768
+ }
3769
+
3770
+ static async makeCall(callFromLine , extension , isMobile = false,
3771
+ callbackAllLines = false) {
3772
+ const lineId = callFromLine ? callFromLine.id : null;
3773
+
3774
+ const response = await getApiClient().calld.makeCall(extension, isMobile, lineId, callbackAllLines);
3775
+ return Call.parse(response);
3776
+ }
3777
+
3778
+ static async relocateCall(callId , line , contactIdentifier ) {
3779
+ return getApiClient().calld.relocateCall(callId, 'line', line, contactIdentifier);
3780
+ }
3781
+
3782
+ static async hold(callId ) {
3783
+ return getApiClient().calld.hold(callId);
3784
+ }
3785
+
3786
+ static async resume(callId ) {
3787
+ return getApiClient().calld.resume(callId);
3788
+ }
3789
+
3790
+ static async mute(callId ) {
3791
+ return getApiClient().calld.mute(callId);
3792
+ }
3793
+
3794
+ static async sendDTMF(callId , digits ) {
3795
+ return getApiClient().calld.sendDTMF(callId, digits);
3796
+ }
3797
+
3798
+ static async unmute(callId ) {
3799
+ return getApiClient().calld.unmute(callId);
3800
+ }
3801
+
3802
+ static async transferCall(callId , number , flow ) {
3803
+ return getApiClient().calld.transferCall(callId, number, flow);
3804
+ }
3805
+
3806
+ static async cancelCallTransfer(transferId ) {
3807
+ return getApiClient().calld.cancelCallTransfer(transferId);
3808
+ }
3809
+
3810
+ static async confirmCallTransfer(transferId ) {
3811
+ return getApiClient().calld.confirmCallTransfer(transferId);
3812
+ }
3813
+ }
3814
+
3815
+ //
3816
+
3817
+ const TRANSFER_FLOW_ATTENDED = 'attended';
3729
3818
  const TRANSFER_FLOW_BLIND = 'blind';
3730
3819
 
3731
3820
  // const MINIMUM_WAZO_ENGINE_VERSION_FOR_CTI_HOLD = '20.11';
3732
3821
 
3733
- IssueReporter$1 ? IssueReporter$1.loggerFor('cti-phone') : console;
3822
+ const logger$a = IssueReporter$1 ? IssueReporter$1.loggerFor('cti-phone') : console;
3823
+
3824
+ class CTIPhone extends Emitter {
3825
+
3826
+
3827
+
3828
+
3829
+
3830
+
3831
+
3832
+
3833
+ constructor(session , isMobile = false, callbackAllLines = false) {
3834
+ super();
3835
+ logger$a.info('CTI Phone created');
3836
+ this.session = session;
3837
+ this.isMobile = isMobile;
3838
+ this.callbackAllLines = callbackAllLines;
3839
+ }
3840
+
3841
+ getOptions() {
3842
+ // @FIXME: temporarily disabling this option
3843
+ // const hold = this.session.hasEngineVersionGte(MINIMUM_WAZO_ENGINE_VERSION_FOR_CTI_HOLD);
3844
+
3845
+ return {
3846
+ accept: false,
3847
+ decline: true,
3848
+ mute: true,
3849
+ hold: false,
3850
+ transfer: true,
3851
+ sendKey: true,
3852
+ addParticipant: false,
3853
+ record: true,
3854
+ merge: false,
3855
+ };
3856
+ }
3857
+
3858
+ hasAnActiveCall() {
3859
+ return !!this.currentCall;
3860
+ }
3861
+
3862
+ callCount() {
3863
+ return this.currentCall ? 1 : 0;
3864
+ }
3865
+
3866
+ isWebRTC() {
3867
+ return false;
3868
+ }
3869
+
3870
+ getUserAgent() {
3871
+ return 'cti-phone';
3872
+ }
3873
+
3874
+ startHeartbeat() {
3875
+ }
3876
+
3877
+ setOnHeartbeatTimeout() {
3878
+ }
3879
+
3880
+ setOnHeartbeatCallback() {
3881
+ }
3882
+
3883
+ stopHeartbeat() {
3884
+ }
3885
+
3886
+ bindClientEvents() {
3887
+ }
3888
+
3889
+ onConnect() {
3890
+ }
3891
+
3892
+ onDisconnect() {
3893
+ }
3894
+
3895
+ async makeCall(number , line ) {
3896
+ logger$a.info('make CTI call', { number });
3897
+
3898
+ if (!number) {
3899
+ return null;
3900
+ }
3901
+ try {
3902
+ this.currentCall = await CallApi.makeCall(line, number, this.isMobile, this.callbackAllLines);
3903
+ } catch (_) {
3904
+ // We have to deal with error like `User has no mobile phone number` error in the UI.
3905
+ }
3906
+ if (!this.currentCall) {
3907
+ return null;
3908
+ }
3909
+ const callSession = CallSession.parseCall(this.currentCall);
3910
+ this.eventEmitter.emit('onCallOutgoing', callSession);
3911
+
3912
+ return callSession;
3913
+ }
3914
+
3915
+ accept(callSession ) {
3916
+ if (!callSession) {
3917
+ return Promise.resolve(null);
3918
+ }
3919
+ logger$a.info('accept CTI call', { callId: callSession.getId(), number: callSession.number });
3920
+
3921
+ if (!this.currentCall) {
3922
+ this.currentCall = callSession.call;
3923
+ }
3924
+
3925
+ return Promise.resolve(callSession.getId());
3926
+ }
3927
+
3928
+ endCurrentCall(callSession ) {
3929
+ if (!callSession) {
3930
+ return;
3931
+ }
3932
+ logger$a.info('end current CTI call', { callId: callSession.getId(), number: callSession.number });
3933
+
3934
+ this.currentCall = undefined;
3935
+ this.eventEmitter.emit('onCallEnded', callSession);
3936
+ }
3937
+
3938
+ async hangup(callSession ) {
3939
+ if (!callSession) {
3940
+ return Promise.resolve(false);
3941
+ }
3942
+ logger$a.info('hangup CTI call', { callId: callSession.getId(), number: callSession.number });
3943
+
3944
+ try {
3945
+ await CallApi.cancelCall(callSession);
3946
+ if (this.currentCall && callSession.callId === this.currentCall.id) {
3947
+ this.endCurrentCall(callSession);
3948
+ }
3949
+
3950
+ this.eventEmitter.emit('onCallEnded', callSession);
3951
+ return true;
3952
+ } catch (e) {
3953
+ logger$a.error('hangup CTI call, error', e);
3954
+
3955
+ this.eventEmitter.emit('onCallFailed', callSession);
3956
+ return false;
3957
+ }
3958
+ }
3959
+
3960
+ ignore() {}
3961
+
3962
+ async reject(callSession ) {
3963
+ if (!callSession) {
3964
+ return;
3965
+ }
3966
+ logger$a.info('reject CTI call', { callId: callSession.getId(), number: callSession.number });
3967
+
3968
+ await CallApi.cancelCall(callSession);
3969
+ this.eventEmitter.emit('onCallEnded', callSession);
3970
+ }
3971
+
3972
+ async transfer(callSession , number ) {
3973
+ if (!callSession) {
3974
+ return;
3975
+ }
3976
+ logger$a.info('transfer CTI call', { callId: callSession.getId(), number: callSession.number, to: number });
3977
+
3978
+ await CallApi.transferCall(callSession.callId, number, TRANSFER_FLOW_BLIND);
3979
+ }
3980
+
3981
+ indirectTransfer() {}
3982
+
3983
+ async initiateCTIIndirectTransfer(callSession , number ) {
3984
+ if (!callSession) {
3985
+ return;
3986
+ }
3987
+ logger$a.info('indirect CTI transfer', { callId: callSession.getId(), number: callSession.number, to: number });
3988
+
3989
+ return CallApi.transferCall(callSession.callId, number, TRANSFER_FLOW_ATTENDED);
3990
+ }
3991
+
3992
+ async cancelCTIIndirectTransfer(transferId ) {
3993
+ logger$a.info('cancel CTI transfer', { transferId });
3994
+
3995
+ return CallApi.cancelCallTransfer(transferId);
3996
+ }
3997
+
3998
+ async confirmCTIIndirectTransfer(transferId ) {
3999
+ logger$a.info('confirm CTI transfer', { transferId });
4000
+
4001
+ return CallApi.confirmCallTransfer(transferId);
4002
+ }
4003
+
4004
+ sendKey(callSession , digits ) {
4005
+ if (!callSession) {
4006
+ return;
4007
+ }
4008
+ logger$a.info('send CTI key', { callId: callSession.getId(), number: callSession.number, digits });
4009
+
4010
+ return CallApi.sendDTMF(callSession.callId, digits);
4011
+ }
4012
+
4013
+ onConnectionMade() {
4014
+ logger$a.info('on CTI connection made');
4015
+
4016
+ this.eventEmitter.emit('onCallAccepted');
4017
+ }
4018
+
4019
+ async close() {
4020
+ logger$a.info('CTI close');
4021
+
4022
+ return Promise.resolve();
4023
+ }
4024
+
4025
+ async hold(callSession ) {
4026
+ if (!callSession) {
4027
+ return;
4028
+ }
4029
+ logger$a.info('CTI hold', { callId: callSession.getId(), number: callSession.number });
4030
+
4031
+ return CallApi.hold(callSession.callId);
4032
+ }
4033
+
4034
+ async resume(callSession ) {
4035
+ if (!callSession) {
4036
+ return;
4037
+ }
4038
+ logger$a.info('CTI resume', { callId: callSession.getId(), number: callSession.number });
4039
+
4040
+ return CallApi.resume(callSession.callId);
4041
+ }
4042
+
4043
+ async mute(callSession ) {
4044
+ if (!callSession) {
4045
+ return;
4046
+ }
4047
+ logger$a.info('CTI mute', { callId: callSession.getId(), number: callSession.number });
4048
+
4049
+ return CallApi.mute(callSession.callId);
4050
+ }
4051
+
4052
+ async unmute(callSession ) {
4053
+ if (!callSession) {
4054
+ return;
4055
+ }
4056
+ logger$a.info('CTI unmute', { callId: callSession.getId(), number: callSession.number });
4057
+
4058
+ return CallApi.unmute(callSession.callId);
4059
+ }
4060
+
4061
+ putOnSpeaker() {}
4062
+
4063
+ putOffSpeaker() {}
4064
+
4065
+ turnCameraOff() {}
4066
+
4067
+ turnCameraOn() {}
4068
+
4069
+ changeAudioInputDevice() {}
4070
+
4071
+ changeVideoInputDevice() {}
4072
+
4073
+ changeAudioDevice() {}
4074
+
4075
+ changeRingDevice() {}
4076
+
4077
+ changeAudioVolume() {}
4078
+
4079
+ changeRingVolume() {}
4080
+
4081
+ hasVideo() {
4082
+ return false;
4083
+ }
4084
+
4085
+ getLocalStreamForCall() {
4086
+ return null;
4087
+ }
4088
+
4089
+ getRemoteStreamForCall() {
4090
+ return null;
4091
+ }
4092
+
4093
+ getLocalVideoStream() {
4094
+ return null;
4095
+ }
4096
+
4097
+ setActiveSipSession() {}
4098
+
4099
+ isRegistered() {
4100
+ return true;
4101
+ }
4102
+
4103
+ hasIncomingCallSession() {
4104
+ return true;
4105
+ }
4106
+
4107
+ hasActiveRemoteVideoStream() {
4108
+ return false;
4109
+ }
4110
+
4111
+ getCurrentCallSession() {
4112
+ return this.currentCall ? CallSession.parseCall(this.currentCall) : null;
4113
+ }
4114
+
4115
+ enableRinging() {}
4116
+
4117
+ sendMessage() {}
4118
+
4119
+ disableRinging() {}
4120
+
4121
+ getLocalStream() {
4122
+ return null;
4123
+ }
4124
+
4125
+ getRemoteStream() {
4126
+ return null;
4127
+ }
4128
+
4129
+ getRemoteVideoStream() {
4130
+ return null;
4131
+ }
4132
+
4133
+ getRemoteAudioStream() {
4134
+ return null;
4135
+ }
4136
+
4137
+ hasLocalVideo() {
4138
+ return false;
4139
+ }
4140
+
4141
+ useLocalVideoElement() {}
4142
+ }
3734
4143
 
3735
4144
  /* */
3736
4145
 
@@ -6272,6 +6681,9 @@ class WebRTCClient extends Emitter {
6272
6681
  if (!this._isWeb()) {
6273
6682
  options.sessionDescriptionHandlerModifiers = [holdModifier];
6274
6683
  }
6684
+ options.sessionDescriptionHandlerOptions = {
6685
+ constraints: options.constraints,
6686
+ };
6275
6687
 
6276
6688
  // Send re-INVITE
6277
6689
  return session.invite(options);
@@ -6311,6 +6723,9 @@ class WebRTCClient extends Emitter {
6311
6723
  // (eg: holdModifier)
6312
6724
  options.sessionDescriptionHandlerModifiers = [];
6313
6725
  }
6726
+ options.sessionDescriptionHandlerOptions = {
6727
+ constraints: options.constraints,
6728
+ };
6314
6729
 
6315
6730
  // Send re-INVITE
6316
6731
  return session.invite(options);
@@ -11804,6 +12219,7 @@ const Wazo = {
11804
12219
  ServerError,
11805
12220
  Call,
11806
12221
  CallLog,
12222
+ CTIPhone,
11807
12223
  Recording,
11808
12224
  ChatMessage,
11809
12225
  ChatRoom,
@@ -11819,6 +12235,7 @@ const Wazo = {
11819
12235
  CallSession,
11820
12236
  IndirectTransfer,
11821
12237
  SwitchboardCall,
12238
+ WebRTCPhone,
11822
12239
  },
11823
12240
 
11824
12241
  // Api
@@ -300,7 +300,13 @@ class IssueReporter {
300
300
  }
301
301
 
302
302
  _isLevelAbove(level1 , level2 ) {
303
- return LOG_LEVELS.indexOf(level1) > LOG_LEVELS.indexOf(level2);
303
+ const index1 = LOG_LEVELS.indexOf(level1);
304
+ const index2 = LOG_LEVELS.indexOf(level2);
305
+ if (index1 === -1 || index2 === -1) {
306
+ return false;
307
+ }
308
+
309
+ return index1 > index2;
304
310
  }
305
311
 
306
312
  _makeCategory(category ) {