From f5d7c90be194dcc3dcce06f8f5e91b9c736dbce8 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 8 Sep 2020 15:14:07 -0600 Subject: [PATCH 1/8] add config for branding --- .../CiscoCodec/CiscoSparkCodecPropertiesConfig.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodecPropertiesConfig.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodecPropertiesConfig.cs index 2f335780..256b803a 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodecPropertiesConfig.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodecPropertiesConfig.cs @@ -40,6 +40,9 @@ namespace PepperDash.Essentials.Devices.Common.Codec [JsonProperty("phonebookResultsLimit")] public uint PhonebookResultsLimit { get; set; } + [JsonProperty("UiBranding")] + public BrandingLogoProperties UiBranding { get; set; } + } public class SharingProperties @@ -47,4 +50,13 @@ namespace PepperDash.Essentials.Devices.Common.Codec [JsonProperty("autoShareContentWhileInCall")] public bool AutoShareContentWhileInCall { get; set; } } + + public class BrandingLogoProperties + { + [JsonProperty("enable")] + public bool Enable { get; set; } + + [JsonProperty("brandingUrl")] + public bool LogoUrl { get; set; } + } } \ No newline at end of file From ea28b8afa44813ba3d8c29412ca6f5ca020e5bce Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 8 Sep 2020 16:24:52 -0600 Subject: [PATCH 2/8] add IHasBranding Interface --- .../DeviceTypeInterfaces/IHasBranding.cs | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IHasBranding.cs diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IHasBranding.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IHasBranding.cs new file mode 100644 index 00000000..d5c95c47 --- /dev/null +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IHasBranding.cs @@ -0,0 +1,8 @@ +namespace PepperDash_Essentials_Core.DeviceTypeInterfaces +{ + public interface IHasBranding + { + bool BrandingEnabled { get; } + void InitializeBranding(string roomKey); + } +} \ No newline at end of file From 74c101628b36d9bdee8c90af227f4f0e4f547611 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 8 Sep 2020 16:25:12 -0600 Subject: [PATCH 3/8] Add Config for branding --- .../VideoCodec/CiscoCodec/CiscoSparkCodecPropertiesConfig.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodecPropertiesConfig.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodecPropertiesConfig.cs index 256b803a..cd280b29 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodecPropertiesConfig.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodecPropertiesConfig.cs @@ -57,6 +57,6 @@ namespace PepperDash.Essentials.Devices.Common.Codec public bool Enable { get; set; } [JsonProperty("brandingUrl")] - public bool LogoUrl { get; set; } + public string BrandingUrl { get; set; } } } \ No newline at end of file From b2ec99e663221a26879fab4fd136425d1e9269e7 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 8 Sep 2020 16:25:21 -0600 Subject: [PATCH 4/8] add logic for branding --- .../VideoCodec/CiscoCodec/CiscoSparkCodec.cs | 87 +++++++++++++++++-- 1 file changed, 82 insertions(+), 5 deletions(-) diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs index 9759cfdd..bad47d71 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs @@ -12,10 +12,12 @@ using Newtonsoft.Json.Linq; using PepperDash.Core; using PepperDash.Essentials.Core; using PepperDash.Essentials.Core.Config; +using PepperDash.Essentials.Core.DeviceTypeInterfaces; using PepperDash.Essentials.Core.Routing; using PepperDash.Essentials.Devices.Common.Cameras; using PepperDash.Essentials.Devices.Common.Codec; using PepperDash.Essentials.Devices.Common.VideoCodec; +using PepperDash_Essentials_Core.DeviceTypeInterfaces; namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco { @@ -25,10 +27,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco public class CiscoSparkCodec : VideoCodecBase, IHasCallHistory, IHasCallFavorites, IHasDirectory, IHasScheduleAwareness, IOccupancyStatusProvider, IHasCodecLayouts, IHasCodecSelfView, - ICommunicationMonitor, IRouting, IHasCodecCameras, IHasCameraAutoMode, IHasCodecRoomPresets, IHasExternalSourceSwitching + ICommunicationMonitor, IRouting, IHasCodecCameras, IHasCameraAutoMode, IHasCodecRoomPresets, IHasExternalSourceSwitching, IHasBranding { public event EventHandler DirectoryResultReturned; + private CTimer _brandingTimer; + public CommunicationGather PortGather { get; private set; } public StatusMonitorBase CommunicationMonitor { get; private set; } @@ -401,10 +405,15 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco CreateOsdSource(); - if (props.ExternalSourceListEnabled != null) - { - ExternalSourceListEnabled = props.ExternalSourceListEnabled; - } + ExternalSourceListEnabled = props.ExternalSourceListEnabled; + + if (props.UiBranding == null) + { + return; + } + + BrandingEnabled = props.UiBranding.Enable; + _brandingUrl = props.UiBranding.BrandingUrl; } /// @@ -443,6 +452,70 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco TieLineCollection.Default.Add(tl); } + public void InitializeBranding(string roomKey) + { + if (!BrandingEnabled) + { + return; + } + + var mcBridgeKey = String.Format("mobileControlBridge-{0}", roomKey); + + var mcBridge = DeviceManager.GetDeviceForKey(mcBridgeKey) as IMobileControlRoomBridge; + + if (!String.IsNullOrEmpty(_brandingUrl)) + { + if (_brandingTimer != null) + { + _brandingTimer.Stop(); + _brandingTimer.Dispose(); + } + + _brandingTimer = new CTimer((o) => + { + if (_sendMcUrl) + { + SendMcBrandingUrl(mcBridge); + _sendMcUrl = false; + } + else + { + SendBrandingUrl(); + _sendMcUrl = true; + } + }, 0, 15000); + } else if (String.IsNullOrEmpty(_brandingUrl)) + { + if (mcBridge == null) return; + + mcBridge.UserCodeChanged += (o, a) => SendMcBrandingUrl(mcBridge); + + SendMcBrandingUrl(mcBridge); + } + } + + private void SendMcBrandingUrl(IMobileControlRoomBridge mcBridge) + { + if (mcBridge == null) + { + return; + } + + SendText(String.Format( + "xcommand userinterface branding fetch type: branding url: {0}", + mcBridge.QrCodeUrl)); + SendText(String.Format( + "xcommand userinterface branding fetch type: halfwakebranding url: {0}", + mcBridge.QrCodeUrl)); + } + + private void SendBrandingUrl() + { + SendText(String.Format("xcommand userinterface branding fetch type: branding url: {0}", + _brandingUrl)); + SendText(String.Format("xcommand userinterface branding fetch type: halfwakebranding url: {0}", + _brandingUrl)); + } /// /// Starts the HTTP feedback server and syncronizes state of codec /// @@ -1835,6 +1908,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco private set; } + public bool BrandingEnabled { get; private set; } + private string _brandingUrl; + private bool _sendMcUrl; + /// /// Adds an external source to the Cisco /// From b6b88086f3f276da6d867af58b61803612310e07 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 8 Sep 2020 16:25:32 -0600 Subject: [PATCH 5/8] Add logic to init branding --- .../Room/Types/EssentialsHuddleVtc1Room.cs | 41 +++++++++++-------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs index 20c8ae3d..69fdaaec 100644 --- a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs +++ b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs @@ -13,6 +13,7 @@ using PepperDash.Essentials.Room.Config; using PepperDash.Essentials.Devices.Common.Codec; using PepperDash.Essentials.Devices.Common.VideoCodec; using PepperDash.Essentials.Devices.Common.AudioCodec; +using PepperDash_Essentials_Core.DeviceTypeInterfaces; namespace PepperDash.Essentials { @@ -703,29 +704,35 @@ namespace PepperDash.Essentials { return; } - else - { - string codecTieLine = ""; - codecTieLine = ConfigReader.ConfigObject.TieLines.SingleOrDefault(x => x.DestinationKey == VideoCodec.Key).DestinationPort; - videoCodecWithExternalSwitching.ClearExternalSources(); - videoCodecWithExternalSwitching.RunRouteAction = RunRouteAction; - var srcList = ConfigReader.ConfigObject.SourceLists.SingleOrDefault(x => x.Key == SourceListKey).Value.OrderBy(kv => kv.Value.Order); ; - foreach (var kvp in srcList) - { - var srcConfig = kvp.Value; + string codecTieLine = ConfigReader.ConfigObject.TieLines.SingleOrDefault(x => x.DestinationKey == VideoCodec.Key).DestinationPort; + videoCodecWithExternalSwitching.ClearExternalSources(); + videoCodecWithExternalSwitching.RunRouteAction = RunRouteAction; + var srcList = ConfigReader.ConfigObject.SourceLists.SingleOrDefault(x => x.Key == SourceListKey).Value.OrderBy(kv => kv.Value.Order); ; - if (kvp.Key != DefaultCodecRouteString && kvp.Key != "roomOff") - { + foreach (var kvp in srcList) + { + var srcConfig = kvp.Value; - videoCodecWithExternalSwitching.AddExternalSource(codecTieLine, kvp.Key, srcConfig.PreferredName, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceType.desktop); - videoCodecWithExternalSwitching.SetExternalSourceState(kvp.Key, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceMode.Ready); + if (kvp.Key != DefaultCodecRouteString && kvp.Key != "roomOff") + { + + videoCodecWithExternalSwitching.AddExternalSource(codecTieLine, kvp.Key, srcConfig.PreferredName, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceType.desktop); + videoCodecWithExternalSwitching.SetExternalSourceState(kvp.Key, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceMode.Ready); - } - } - } + } + } } + + private void SetCodecBranding() + { + var vcWithBranding = VideoCodec as IHasBranding; + + if (vcWithBranding == null) return; + + vcWithBranding.InitializeBranding(Key); + } #region IPrivacy Members From 54dd424b012a861ba2bf44bd69a840e610bf057e Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 9 Sep 2020 08:53:20 -0600 Subject: [PATCH 6/8] add some debug statements --- .../Room/Types/EssentialsHuddleVtc1Room.cs | 2 +- .../PepperDash_Essentials_Core.csproj | 7 ++++--- .../VideoCodec/CiscoCodec/CiscoSparkCodec.cs | 7 ++++++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs index 69fdaaec..f84d343d 100644 --- a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs +++ b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs @@ -314,7 +314,7 @@ namespace PepperDash.Essentials VideoCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate(); - VideoCodec.IsReadyChange += (o, a) => this.SetCodecExternalSources(); + VideoCodec.IsReadyChange += (o, a) => { this.SetCodecExternalSources(); SetCodecBranding(); }; if (AudioCodec != null) AudioCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate(); diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj index ae420105..e0cf8dcb 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj @@ -98,12 +98,12 @@ False - ..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll + ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll False False - ..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll + ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll False @@ -113,7 +113,7 @@ False - ..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe + ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe False @@ -206,6 +206,7 @@ + diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs index bad47d71..d138ee8a 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs @@ -411,12 +411,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco { return; } + Debug.Console(2, this, "Setting branding properties enable: {0} _brandingUrl {1}", props.UiBranding.Enable, + props.UiBranding.BrandingUrl); BrandingEnabled = props.UiBranding.Enable; _brandingUrl = props.UiBranding.BrandingUrl; } - /// /// Runs in it's own thread to dequeue messages in the order they were received to be processed /// /// @@ -454,6 +455,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco public void InitializeBranding(string roomKey) { + Debug.Console(2, this, "Initializing Branding for room {0}", roomKey); + if (!BrandingEnabled) { return; @@ -488,6 +491,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco { if (mcBridge == null) return; + Debug.Console(2, this, "Setting QR code URL: {0}", mcBridge.QrCodeUrl); + mcBridge.UserCodeChanged += (o, a) => SendMcBrandingUrl(mcBridge); SendMcBrandingUrl(mcBridge); From cb89bd390894b988143ab403ce385636cc3cf5ea Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 9 Sep 2020 10:29:53 -0600 Subject: [PATCH 7/8] Changed debug levels --- .../Room/Types/EssentialsHuddleVtc1Room.cs | 1 + .../VideoCodec/CiscoCodec/CiscoSparkCodec.cs | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs index f84d343d..97c1775e 100644 --- a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs +++ b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs @@ -731,6 +731,7 @@ namespace PepperDash.Essentials if (vcWithBranding == null) return; + Debug.Console(1, this, "Setting Codec Branding"); vcWithBranding.InitializeBranding(Key); } diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs index d138ee8a..eb02e814 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs @@ -455,7 +455,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco public void InitializeBranding(string roomKey) { - Debug.Console(2, this, "Initializing Branding for room {0}", roomKey); + Debug.Console(1, this, "Initializing Branding for room {0}", roomKey); if (!BrandingEnabled) { @@ -468,6 +468,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco if (!String.IsNullOrEmpty(_brandingUrl)) { + Debug.Console(1, this, "Branding URL found: {0}", _brandingUrl); if (_brandingTimer != null) { _brandingTimer.Stop(); @@ -489,6 +490,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco }, 0, 15000); } else if (String.IsNullOrEmpty(_brandingUrl)) { + Debug.Console(1, this, "No Branding URL found"); if (mcBridge == null) return; Debug.Console(2, this, "Setting QR code URL: {0}", mcBridge.QrCodeUrl); @@ -506,6 +508,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco return; } + Debug.Console(1, this, "Sending url: {0}", mcBridge.QrCodeUrl); + SendText(String.Format( "xcommand userinterface branding fetch type: branding url: {0}", mcBridge.QrCodeUrl)); @@ -516,6 +520,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco private void SendBrandingUrl() { + Debug.Console(1, this, "Sending url: {0}", _brandingUrl); + SendText(String.Format("xcommand userinterface branding fetch type: branding url: {0}", _brandingUrl)); SendText(String.Format("xcommand userinterface branding fetch type: halfwakebranding url: {0}", From 862a5ebd126123376074aa66d8e6cb1d3e7f9320 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 9 Sep 2020 10:54:01 -0600 Subject: [PATCH 8/8] Added logic to set messages for instructions --- .../VideoCodec/CiscoCodec/CiscoSparkCodec.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs index eb02e814..814ce903 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs @@ -510,6 +510,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco Debug.Console(1, this, "Sending url: {0}", mcBridge.QrCodeUrl); + SendText("xconfiguration userinterface custommessage: \"Scan the QR code with a mobile phone to get started\""); + SendText("xconfiguration userinterface osd halfwakemessage: \"Tap the touch panel or scan the QR code with a mobile phone to get started\""); + SendText(String.Format( "xcommand userinterface branding fetch type: branding url: {0}", mcBridge.QrCodeUrl));