From f3fc0f2b2626d604b970aefc32a05aa4fcf1c3ff Mon Sep 17 00:00:00 2001 From: Trevor Payne Date: Tue, 18 Oct 2022 10:51:24 -0500 Subject: [PATCH 01/21] fix: update xSig Method for active call status --- .../VideoCodec/VideoCodecBase.cs | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs index bea5862c..44d3f423 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs @@ -1393,11 +1393,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec tokenArray[digitalIndex + 1] = new XSigDigitalToken(digitalIndex + 2, call.IsOnHold); //serials - tokenArray[arrayIndex + 1] = new XSigSerialToken(stringIndex + 1, call.Name ?? String.Empty); - tokenArray[arrayIndex + 2] = new XSigSerialToken(stringIndex + 2, call.Number ?? String.Empty); - tokenArray[arrayIndex + 3] = new XSigSerialToken(stringIndex + 3, call.Direction.ToString()); - tokenArray[arrayIndex + 4] = new XSigSerialToken(stringIndex + 4, call.Type.ToString()); - tokenArray[arrayIndex + 5] = new XSigSerialToken(stringIndex + 5, call.Status.ToString()); + tokenArray[arrayIndex] = new XSigSerialToken(stringIndex + 1, call.Name ?? String.Empty); + tokenArray[arrayIndex + 1] = new XSigSerialToken(stringIndex + 2, call.Number ?? String.Empty); + tokenArray[arrayIndex + 2] = new XSigSerialToken(stringIndex + 3, call.Direction.ToString()); + tokenArray[arrayIndex + 3] = new XSigSerialToken(stringIndex + 4, call.Type.ToString()); + tokenArray[arrayIndex + 4] = new XSigSerialToken(stringIndex + 5, call.Status.ToString()); if(call.Duration != null) { // May need to verify correct string format here @@ -1417,12 +1417,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec //serials - tokenArray[arrayIndex + 1] = new XSigSerialToken(stringIndex + 1, String.Empty); - tokenArray[arrayIndex + 2] = new XSigSerialToken(stringIndex + 2, String.Empty); - tokenArray[arrayIndex + 3] = new XSigSerialToken(stringIndex + 3, String.Empty); - tokenArray[arrayIndex + 4] = new XSigSerialToken(stringIndex + 4, String.Empty); - tokenArray[arrayIndex + 5] = new XSigSerialToken(stringIndex + 5, String.Empty); - tokenArray[arrayIndex + 6] = new XSigSerialToken(stringIndex + 6, String.Empty); + tokenArray[arrayIndex] = new XSigSerialToken(stringIndex + 1, String.Empty); + tokenArray[arrayIndex + 1] = new XSigSerialToken(stringIndex + 2, String.Empty); + tokenArray[arrayIndex + 2] = new XSigSerialToken(stringIndex + 3, String.Empty); + tokenArray[arrayIndex + 3] = new XSigSerialToken(stringIndex + 4, String.Empty); + tokenArray[arrayIndex + 4] = new XSigSerialToken(stringIndex + 5, String.Empty); + tokenArray[arrayIndex + 5] = new XSigSerialToken(stringIndex + 6, String.Empty); arrayIndex += offset; stringIndex += maxStrings; From 70d2633eb0be310fe06fd4571b68cd667a563b25 Mon Sep 17 00:00:00 2001 From: Jason Alborough Date: Thu, 20 Oct 2022 09:52:58 -0400 Subject: [PATCH 02/21] fix: max number of presets now uses join span rather than join start. --- .../Essentials Devices Common/Cameras/CameraBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Cameras/CameraBase.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Cameras/CameraBase.cs index 1ef679ba..c5758108 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Cameras/CameraBase.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Cameras/CameraBase.cs @@ -223,7 +223,7 @@ namespace PepperDash.Essentials.Devices.Common.Cameras SendCameraPresetNamesToApi(presetsCamera, joinMap, trilist); - for (int i = 0; i < joinMap.NumberOfPresets.JoinNumber; i++) + for (int i = 0; i < joinMap.NumberOfPresets.JoinSpan; i++) { int tempNum = i; From 53596040987fcfb834e298bfc1ce72e7f539205c Mon Sep 17 00:00:00 2001 From: jdevito Date: Thu, 20 Oct 2022 11:11:07 -0500 Subject: [PATCH 03/21] fix: added bool property tracking if meeting is require, added poll method and updated GetBookings to reference bool property that prohibits polling when meeting password is required --- .../VideoCodec/ZoomRoom/ZoomRoom.cs | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 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 30ec50c8..96d966f4 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 @@ -66,6 +66,15 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom private readonly ZoomRoomPropertiesConfig _props; + private bool _meetingPasswordRequired; + + public void Poll(string pollString) + { + if(_meetingPasswordRequired) return; + + SendText(string.Format("{0}{1}", pollString, SendDelimiter)); + } + public ZoomRoom(DeviceConfig config, IBasicCommunication comm) : base(config) { @@ -79,13 +88,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom if (_props.CommunicationMonitorProperties != null) { - CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, - _props.CommunicationMonitorProperties); + CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, _props.CommunicationMonitorProperties.PollInterval, _props.CommunicationMonitorProperties.TimeToWarning, _props.CommunicationMonitorProperties.TimeToError, + () => Poll(_props.CommunicationMonitorProperties.PollString)); } else { - CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 30000, 120000, 300000, - "zStatus SystemUnit" + SendDelimiter); + CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 30000, 120000, 300000, () => Poll("zStatus SystemUnit")); } DeviceManager.AddDevice(CommunicationMonitor); @@ -1985,6 +1993,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom /// private void GetBookings() { + if (_meetingPasswordRequired) return; + SendText("zCommand Bookings List"); } @@ -2170,6 +2180,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom ); } + _meetingPasswordRequired = false; base.OnCallStatusChange(item); Debug.Console(1, this, "[OnCallStatusChange] Current Call Status: {0}", @@ -3390,6 +3401,9 @@ 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)); } } From bef07fe41bf335d2271a1b1b21e664533f983ed9 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 25 Oct 2022 10:30:02 -0600 Subject: [PATCH 04/21] fix(essentials): Block all commands to ZoomRoom on incoming call --- .../VideoCodec/ZoomRoom/ZoomRoom.cs | 32 +++++++++++++++++-- 1 file changed, 29 insertions(+), 3 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 6f497cef..5d63a4cf 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 @@ -64,9 +64,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom private bool _meetingPasswordRequired; + private bool _waitingForUserToAcceptOrRejectIncomingCall; + public void Poll(string pollString) { - if(_meetingPasswordRequired) return; + if(_meetingPasswordRequired || _waitingForUserToAcceptOrRejectIncomingCall) return; SendText(string.Format("{0}{1}", pollString, SendDelimiter)); } @@ -968,6 +970,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom public void SendText(string command) { + if (_meetingPasswordRequired) + { + Debug.Console(2, this, "Blocking commands to ZoomRoom while waiting for user to enter meeting password"); + return; + } + + if (_waitingForUserToAcceptOrRejectIncomingCall) + { + Debug.Console(2, this, "Blocking commands to ZoomRoom while waiting for user to accept or reject incoming call"); + return; + } + if (CommDebuggingIsOn) { Debug.Console(1, this, "Sending: '{0}'", command); @@ -1592,6 +1606,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom Id = incomingCall.callerJID }; + _waitingForUserToAcceptOrRejectIncomingCall = true; + ActiveCalls.Add(newCall); OnCallStatusChange(newCall); @@ -1618,6 +1634,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom OnCallStatusChange(existingCall); } + _waitingForUserToAcceptOrRejectIncomingCall = false; + UpdateCallStatus(); } @@ -2000,7 +2018,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom /// private void GetBookings() { - if (_meetingPasswordRequired) return; + if (_meetingPasswordRequired || _waitingForUserToAcceptOrRejectIncomingCall) return; SendText("zCommand Bookings List"); } @@ -2637,6 +2655,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom public void AcceptCall() { + _waitingForUserToAcceptOrRejectIncomingCall = false; + var incomingCall = ActiveCalls.FirstOrDefault( c => c.Status.Equals(eCodecCallStatus.Ringing) && c.Direction.Equals(eCodecCallDirection.Incoming)); @@ -2646,6 +2666,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom public override void AcceptCall(CodecActiveCallItem call) { + _waitingForUserToAcceptOrRejectIncomingCall = false; + SendText(string.Format("zCommand Call Accept callerJID: {0}", call.Id)); call.Status = eCodecCallStatus.Connected; @@ -2657,6 +2679,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom public void RejectCall() { + _waitingForUserToAcceptOrRejectIncomingCall = false; + var incomingCall = ActiveCalls.FirstOrDefault( c => c.Status.Equals(eCodecCallStatus.Ringing) && c.Direction.Equals(eCodecCallDirection.Incoming)); @@ -2666,6 +2690,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom public override void RejectCall(CodecActiveCallItem call) { + _waitingForUserToAcceptOrRejectIncomingCall = false; + SendText(string.Format("zCommand Call Reject callerJID: {0}", call.Id)); call.Status = eCodecCallStatus.Disconnected; @@ -3451,9 +3477,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom public void SubmitPassword(string password) { + _meetingPasswordRequired = false; Debug.Console(2, this, "Password Submitted: {0}", password); Dial(_lastDialedMeetingNumber, password); - //OnPasswordRequired(false, false, true, ""); } void OnPasswordRequired(bool lastAttemptIncorrect, bool loginFailed, bool loginCancelled, string message) From 4d6da37c60b39e076f7056403c30741b60dbee22 Mon Sep 17 00:00:00 2001 From: jdevito Date: Fri, 28 Oct 2022 08:38:16 -0500 Subject: [PATCH 05/21] 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 06/21] 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 07/21] 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)); From 2be42f88bc8179987c5c9868ca54cd81e776027a Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Fri, 4 Nov 2022 09:48:17 -0600 Subject: [PATCH 08/21] chore: update PD Core version In order to fix issues with debug file location for VC-4, the PD Core version needs to be updated --- packages.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages.config b/packages.config index 4c411add..04d36492 100644 --- a/packages.config +++ b/packages.config @@ -1,3 +1,3 @@ - + \ No newline at end of file From ce51a62d9734a1fd4efdef666e107f6a49fd037e Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Fri, 4 Nov 2022 14:01:11 -0600 Subject: [PATCH 09/21] chore: update PD Core version --- packages.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages.config b/packages.config index 04d36492..41e00961 100644 --- a/packages.config +++ b/packages.config @@ -1,3 +1,3 @@ - + \ No newline at end of file From fc3840173e0005f323a8659d839a8053aa79e25f Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 8 Nov 2022 08:44:39 -0700 Subject: [PATCH 10/21] chore: Update PD Core version --- packages.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages.config b/packages.config index 41e00961..3a15ad08 100644 --- a/packages.config +++ b/packages.config @@ -1,3 +1,3 @@ - + \ No newline at end of file From c07f52b06f36960d7dde335b26903007b78ddd38 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Thu, 10 Nov 2022 12:51:04 -0700 Subject: [PATCH 11/21] feat: update VC-4 client to use correct RoomID --- .../Bridges/BridgeBase.cs | 28 +++++++++++++------ 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/BridgeBase.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/BridgeBase.cs index a1326770..7bb25b0a 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/BridgeBase.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/BridgeBase.cs @@ -394,35 +394,45 @@ namespace PepperDash.Essentials.Core.Bridges var controlProperties = CommFactory.GetControlPropertiesConfig(dc); + BasicTriList eisc; + switch (dc.Type.ToLower()) { case "eiscapiadv": case "eiscapiadvanced": { - var eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(controlProperties.IpIdInt, + eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(controlProperties.IpIdInt, controlProperties.TcpSshProperties.Address, Global.ControlSystem); - return new EiscApiAdvanced(dc, eisc); + break; } case "eiscapiadvancedserver": { - var eisc = new EISCServer(controlProperties.IpIdInt, Global.ControlSystem); - return new EiscApiAdvanced(dc, eisc); + eisc = new EISCServer(controlProperties.IpIdInt, Global.ControlSystem); + break; } case "eiscapiadvancedclient": { - var eisc = new EISCClient(controlProperties.IpIdInt, controlProperties.TcpSshProperties.Address, Global.ControlSystem); - return new EiscApiAdvanced(dc, eisc); + eisc = new EISCClient(controlProperties.IpIdInt, controlProperties.TcpSshProperties.Address, Global.ControlSystem); + break; } case "vceiscapiadv": case "vceiscapiadvanced": { - var eisc = new VirtualControlEISCClient(controlProperties.IpIdInt, InitialParametersClass.RoomId, + eisc = new VirtualControlEISCClient(controlProperties.IpIdInt, controlProperties.RoomId, Global.ControlSystem); - return new EiscApiAdvanced(dc, eisc); + break; } default: - return null; + eisc = null; + break; } + + if (eisc == null) + { + return null; + } + + return new EiscApiAdvanced(dc, eisc); } } From db19da124cdb53921e1e3e82db5c8894f236b5fd Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Fri, 11 Nov 2022 14:37:46 -0700 Subject: [PATCH 12/21] fix: set debug level to 2 on startup Some plugins and devices are doing their own filtering based on the debug level that's normally set using the `appdebug` console command. On VC-4, there's no way to set that value. With this change, when Essentials starts on a server, the debug level will be set to 2, so that any of the messages that might be filtered based on the debug level won't be filtered. --- PepperDashEssentials/ControlSystem.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PepperDashEssentials/ControlSystem.cs b/PepperDashEssentials/ControlSystem.cs index dd8f3d5a..9a48000a 100644 --- a/PepperDashEssentials/ControlSystem.cs +++ b/PepperDashEssentials/ControlSystem.cs @@ -195,6 +195,8 @@ namespace PepperDash.Essentials } else // Handles Linux OS (Virtual Control) { + Debug.SetDebugLevel(2); + Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials v{0} on Virtual Control Server", Global.AssemblyVersion); // Set path to User/ From 5e797db0965e1be9a3f001f91624d8ac816e3921 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Fri, 11 Nov 2022 16:26:37 -0700 Subject: [PATCH 13/21] fix: add check for missing/empty roomId --- .../PepperDashEssentialsBase/Bridges/BridgeBase.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/BridgeBase.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/BridgeBase.cs index 7bb25b0a..252c9c48 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/BridgeBase.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/BridgeBase.cs @@ -418,6 +418,12 @@ namespace PepperDash.Essentials.Core.Bridges case "vceiscapiadv": case "vceiscapiadvanced": { + if (string.IsNullOrEmpty(controlProperties.RoomId)) + { + Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to build VC-4 EISC Client for device {0}. Room ID is missing or empty", dc.Key); + eisc = null; + break; + } eisc = new VirtualControlEISCClient(controlProperties.IpIdInt, controlProperties.RoomId, Global.ControlSystem); break; From 247827ac2580a64cd84431f39c6ea07d915e1549 Mon Sep 17 00:00:00 2001 From: Trevor Payne Date: Mon, 14 Nov 2022 10:10:22 -0600 Subject: [PATCH 14/21] fix: UpdateCallStatusXsig() now properly refreshing calls --- .../VideoCodec/VideoCodecBase.cs | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs index 44d3f423..19c61b9f 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs @@ -1393,11 +1393,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec tokenArray[digitalIndex + 1] = new XSigDigitalToken(digitalIndex + 2, call.IsOnHold); //serials - tokenArray[arrayIndex] = new XSigSerialToken(stringIndex + 1, call.Name ?? String.Empty); - tokenArray[arrayIndex + 1] = new XSigSerialToken(stringIndex + 2, call.Number ?? String.Empty); - tokenArray[arrayIndex + 2] = new XSigSerialToken(stringIndex + 3, call.Direction.ToString()); - tokenArray[arrayIndex + 3] = new XSigSerialToken(stringIndex + 4, call.Type.ToString()); - tokenArray[arrayIndex + 4] = new XSigSerialToken(stringIndex + 5, call.Status.ToString()); + tokenArray[stringIndex] = new XSigSerialToken(stringIndex + 1, call.Name ?? String.Empty); + tokenArray[stringIndex + 1] = new XSigSerialToken(stringIndex + 2, call.Number ?? String.Empty); + tokenArray[stringIndex + 2] = new XSigSerialToken(stringIndex + 3, call.Direction.ToString()); + tokenArray[stringIndex + 3] = new XSigSerialToken(stringIndex + 4, call.Type.ToString()); + tokenArray[stringIndex + 4] = new XSigSerialToken(stringIndex + 5, call.Status.ToString()); if(call.Duration != null) { // May need to verify correct string format here @@ -1417,12 +1417,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec //serials - tokenArray[arrayIndex] = new XSigSerialToken(stringIndex + 1, String.Empty); - tokenArray[arrayIndex + 1] = new XSigSerialToken(stringIndex + 2, String.Empty); - tokenArray[arrayIndex + 2] = new XSigSerialToken(stringIndex + 3, String.Empty); - tokenArray[arrayIndex + 3] = new XSigSerialToken(stringIndex + 4, String.Empty); - tokenArray[arrayIndex + 4] = new XSigSerialToken(stringIndex + 5, String.Empty); - tokenArray[arrayIndex + 5] = new XSigSerialToken(stringIndex + 6, String.Empty); + tokenArray[stringIndex] = new XSigSerialToken(stringIndex + 1, String.Empty); + tokenArray[stringIndex + 1] = new XSigSerialToken(stringIndex + 2, String.Empty); + tokenArray[stringIndex + 2] = new XSigSerialToken(stringIndex + 3, String.Empty); + tokenArray[stringIndex + 3] = new XSigSerialToken(stringIndex + 4, String.Empty); + tokenArray[stringIndex + 4] = new XSigSerialToken(stringIndex + 5, String.Empty); + tokenArray[stringIndex + 5] = new XSigSerialToken(stringIndex + 6, String.Empty); arrayIndex += offset; stringIndex += maxStrings; From ba0bae3c4ecf07ad7d9bcce1636cf1181b3d1c37 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 16 Nov 2022 10:51:48 -0700 Subject: [PATCH 15/21] chore: update PD Core to 1.1.3 --- packages.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages.config b/packages.config index 3a15ad08..e2f8b03b 100644 --- a/packages.config +++ b/packages.config @@ -1,3 +1,3 @@ - + \ No newline at end of file From 1b43fba37e2a38bd275fac585a80d478a442c442 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 21 Nov 2022 10:28:08 -0700 Subject: [PATCH 16/21] fix: add logic to prevent vacancy from triggering room off if room is in a call --- .../Room/Types/EssentialsHuddleVtc1Room.cs | 18 ++++++++++++++++++ .../Room/EssentialsRoomBase.cs | 16 ++++++++++++++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs index e622983f..0b7b2b28 100644 --- a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs +++ b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs @@ -745,6 +745,24 @@ namespace PepperDash.Essentials { //Implement this } + + protected override bool AllowVacancyTimerToStart() + { + bool allowVideo = true; + bool allowAudio = true; + + if (VideoCodec != null) + { + allowVideo = !VideoCodec.IsInCall; + } + + if (AudioCodec != null) + { + allowAudio = !AudioCodec.IsInCall; + } + + return allowVideo && allowAudio; + } /// /// Does what it says diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/EssentialsRoomBase.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/EssentialsRoomBase.cs index 352cbfcd..6cb06841 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/EssentialsRoomBase.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/EssentialsRoomBase.cs @@ -343,7 +343,7 @@ namespace PepperDash.Essentials.Core void RoomIsOccupiedFeedback_OutputChange(object sender, EventArgs e) { - if (RoomOccupancy.RoomIsOccupiedFeedback.BoolValue == false) + if (RoomOccupancy.RoomIsOccupiedFeedback.BoolValue == false && AllowVacancyTimerToStart()) { Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Notice: Vacancy Detected"); // Trigger the timer when the room is vacant @@ -361,7 +361,19 @@ namespace PepperDash.Essentials.Core /// Executes when RoomVacancyShutdownTimer expires. Used to trigger specific room actions as needed. Must nullify the timer object when executed /// /// - public abstract void RoomVacatedForTimeoutPeriod(object o); + public abstract void RoomVacatedForTimeoutPeriod(object o) + { + + } + + /// + /// Allow the vacancy event from an occupancy sensor to turn the room off. + /// + /// If the timer should be allowed. Defaults to true + protected virtual bool AllowVacancyTimerToStart() + { + return true; + } } /// From a2b67798f3bb3de1e5a6a9279ea7bfa838c14f67 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 21 Nov 2022 10:37:26 -0700 Subject: [PATCH 17/21] refactor: add logging statements --- PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs index 0b7b2b28..038acd9d 100644 --- a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs +++ b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs @@ -753,14 +753,18 @@ namespace PepperDash.Essentials if (VideoCodec != null) { + Debug.Console(2,this, Debug.ErrorLogLevel.Notice, "Room {0} is in a video call. Not allowing auto power off", Key); allowVideo = !VideoCodec.IsInCall; } if (AudioCodec != null) { + Debug.Console(2,this, Debug.ErrorLogLevel.Notice, "Room {0} is in an audio call. Not allowing auto power off", Key); allowAudio = !AudioCodec.IsInCall; } + Debug.Console(2, this, "Room {0} allowing vacancy timer to start: {1}", Key, allowVideo && allowAudio); + return allowVideo && allowAudio; } From 5263b16bb7f7ab30b4abd233bfcbab7ba2561e2c Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 21 Nov 2022 10:42:33 -0700 Subject: [PATCH 18/21] refactor: fix issues with log statments --- PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs index 038acd9d..d04de3cc 100644 --- a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs +++ b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs @@ -753,13 +753,13 @@ namespace PepperDash.Essentials if (VideoCodec != null) { - Debug.Console(2,this, Debug.ErrorLogLevel.Notice, "Room {0} is in a video call. Not allowing auto power off", Key); + Debug.Console(2,this, Debug.ErrorLogLevel.Notice, "Room {0} {1} in a video call", Key, VideoCodec.IsInCall ? "is" : "is not"); allowVideo = !VideoCodec.IsInCall; } if (AudioCodec != null) { - Debug.Console(2,this, Debug.ErrorLogLevel.Notice, "Room {0} is in an audio call. Not allowing auto power off", Key); + Debug.Console(2,this, Debug.ErrorLogLevel.Notice, "Room {0} {1} in an audio call", Key, AudioCodec.IsInCall ? "is" : "is not"); allowAudio = !AudioCodec.IsInCall; } From 430612847443b0eb07a5b271be116a606da8d0b3 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 21 Nov 2022 10:45:25 -0700 Subject: [PATCH 19/21] refactor: fix abstract method --- .../PepperDashEssentialsBase/Room/EssentialsRoomBase.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/EssentialsRoomBase.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/EssentialsRoomBase.cs index 6cb06841..f5e3dee8 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/EssentialsRoomBase.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/EssentialsRoomBase.cs @@ -361,10 +361,7 @@ namespace PepperDash.Essentials.Core /// Executes when RoomVacancyShutdownTimer expires. Used to trigger specific room actions as needed. Must nullify the timer object when executed /// /// - public abstract void RoomVacatedForTimeoutPeriod(object o) - { - - } + public abstract void RoomVacatedForTimeoutPeriod(object o); /// /// Allow the vacancy event from an occupancy sensor to turn the room off. From 1b43b44d1914042f291213f835794c8e69a6ae16 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 23 Nov 2022 13:12:35 -0700 Subject: [PATCH 20/21] fix: typo in `TouchpanelBase` constructor The constructor was checking the wrong variable, leading to it always being null and failing to build the `EssentialsTouchpanelController` class. --- .../PepperDashEssentialsBase/UI/TouchpanelBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/UI/TouchpanelBase.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/UI/TouchpanelBase.cs index 36e0342e..7c64aa6d 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/UI/TouchpanelBase.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/UI/TouchpanelBase.cs @@ -31,7 +31,7 @@ namespace PepperDash.Essentials.Core.UI :base(key, name) { - if (Panel == null) + if (panel == null) { Debug.Console(0, this, "Panel is not valid. Touchpanel class WILL NOT work correctly"); return; From 8e57e7ec31f9a2d9f6db5909538eaeb52aca62ff Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 23 Nov 2022 14:29:36 -0700 Subject: [PATCH 21/21] fix: add missing LoadSmartObjects call --- .../PepperDashEssentialsBase/UI/TouchpanelBase.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/UI/TouchpanelBase.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/UI/TouchpanelBase.cs index 7c64aa6d..c7be5048 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/UI/TouchpanelBase.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/UI/TouchpanelBase.cs @@ -71,6 +71,8 @@ namespace PepperDash.Essentials.Core.UI return; } } + + Panel.LoadSmartObjects(sgdName); }); AddPostActivationAction(() =>