From 4d6da37c60b39e076f7056403c30741b60dbee22 Mon Sep 17 00:00:00 2001 From: jdevito Date: Fri, 28 Oct 2022 08:38:16 -0500 Subject: [PATCH 1/3] fix: added additional evaluations for prompt property tracking and set/reset to handled unknown user scenarios --- .../VideoCodec/ZoomRoom/ZoomRoom.cs | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs index 5d63a4cf..60965ca0 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs @@ -2578,11 +2578,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom PasswordRequired += (devices, args) => { - Debug.Console(0, this, "***********************************PaswordRequired. Message: {0} Cancelled: {1} Last Incorrect: {2} Failed: {3}", args.Message, args.LoginAttemptCancelled, args.LastAttemptWasIncorrect, args.LoginAttemptFailed); + Debug.Console(2, this, "***********************************PaswordRequired. Message: {0} Cancelled: {1} Last Incorrect: {2} Failed: {3}", args.Message, args.LoginAttemptCancelled, args.LastAttemptWasIncorrect, args.LoginAttemptFailed); if (args.LoginAttemptCancelled) { trilist.SetBool(joinMap.MeetingPasswordRequired.JoinNumber, false); + _meetingPasswordRequired = false; return; } @@ -2594,6 +2595,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom if (args.LoginAttemptFailed) { // login attempt failed + _meetingPasswordRequired = false; return; } @@ -2818,16 +2820,25 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom public void LeaveMeeting() { - SendText("zCommand Call Leave"); + if (_meetingPasswordRequired) _meetingPasswordRequired = false; + if (_waitingForUserToAcceptOrRejectIncomingCall) _waitingForUserToAcceptOrRejectIncomingCall = false; + + SendText("zCommand Call Leave"); } public override void EndCall(CodecActiveCallItem call) { + if (_meetingPasswordRequired) _meetingPasswordRequired = false; + if (_waitingForUserToAcceptOrRejectIncomingCall) _waitingForUserToAcceptOrRejectIncomingCall = false; + SendText("zCommand Call Disconnect"); } public override void EndAllCalls() { + if (_meetingPasswordRequired) _meetingPasswordRequired = false; + if (_waitingForUserToAcceptOrRejectIncomingCall) _waitingForUserToAcceptOrRejectIncomingCall = false; + SendText("zCommand Call Disconnect"); } @@ -3487,10 +3498,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom var handler = PasswordRequired; if (handler != null) { - if(!loginFailed || !loginCancelled) - _meetingPasswordRequired = true; - - handler(this, new PasswordPromptEventArgs(lastAttemptIncorrect, loginFailed, loginCancelled, message)); + _meetingPasswordRequired = !loginFailed || !loginCancelled; + Debug.Console(2, this, "Meeting Password Required: {0}", _meetingPasswordRequired); + + handler(this, new PasswordPromptEventArgs(lastAttemptIncorrect, loginFailed, loginCancelled, message)); } } From a09212417c7dcaadf6f1cd499828a62963c2792a Mon Sep 17 00:00:00 2001 From: jdevito Date: Fri, 28 Oct 2022 16:20:49 -0500 Subject: [PATCH 2/3] fix: removed property sets as recommended in discussion; removed 'if' statements before property sets in leave and end call methods --- .../VideoCodec/ZoomRoom/ZoomRoom.cs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs index 60965ca0..cc0dfcd7 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs @@ -2583,7 +2583,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom if (args.LoginAttemptCancelled) { trilist.SetBool(joinMap.MeetingPasswordRequired.JoinNumber, false); - _meetingPasswordRequired = false; return; } @@ -2595,7 +2594,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom if (args.LoginAttemptFailed) { // login attempt failed - _meetingPasswordRequired = false; return; } @@ -2820,24 +2818,24 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom public void LeaveMeeting() { - if (_meetingPasswordRequired) _meetingPasswordRequired = false; - if (_waitingForUserToAcceptOrRejectIncomingCall) _waitingForUserToAcceptOrRejectIncomingCall = false; - + _meetingPasswordRequired = false; + _waitingForUserToAcceptOrRejectIncomingCall = false; + SendText("zCommand Call Leave"); } public override void EndCall(CodecActiveCallItem call) { - if (_meetingPasswordRequired) _meetingPasswordRequired = false; - if (_waitingForUserToAcceptOrRejectIncomingCall) _waitingForUserToAcceptOrRejectIncomingCall = false; + _meetingPasswordRequired = false; + _waitingForUserToAcceptOrRejectIncomingCall = false; SendText("zCommand Call Disconnect"); } public override void EndAllCalls() { - if (_meetingPasswordRequired) _meetingPasswordRequired = false; - if (_waitingForUserToAcceptOrRejectIncomingCall) _waitingForUserToAcceptOrRejectIncomingCall = false; + _meetingPasswordRequired = false; + _waitingForUserToAcceptOrRejectIncomingCall = false; SendText("zCommand Call Disconnect"); } From 6f9a9ee255c6d90d98680474a1e5c2df3b79fa70 Mon Sep 17 00:00:00 2001 From: jdevito Date: Fri, 28 Oct 2022 16:47:43 -0500 Subject: [PATCH 3/3] fix: moved setting set in event before null check --- .../VideoCodec/ZoomRoom/ZoomRoom.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs index cc0dfcd7..abf308d9 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs @@ -3493,10 +3493,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom void OnPasswordRequired(bool lastAttemptIncorrect, bool loginFailed, bool loginCancelled, string message) { + _meetingPasswordRequired = !loginFailed || !loginCancelled; + var handler = PasswordRequired; if (handler != null) - { - _meetingPasswordRequired = !loginFailed || !loginCancelled; + { Debug.Console(2, this, "Meeting Password Required: {0}", _meetingPasswordRequired); handler(this, new PasswordPromptEventArgs(lastAttemptIncorrect, loginFailed, loginCancelled, message));