diff --git a/Essentials Core/PepperDashEssentialsBase/Devices/CodecInterfaces.cs b/Essentials Core/PepperDashEssentialsBase/Devices/CodecInterfaces.cs index e3399d00..5135ac07 100644 --- a/Essentials Core/PepperDashEssentialsBase/Devices/CodecInterfaces.cs +++ b/Essentials Core/PepperDashEssentialsBase/Devices/CodecInterfaces.cs @@ -18,7 +18,7 @@ namespace PepperDash.Essentials.Core void AcceptCall(); void RejectCall(); - void SendDtmf(); + void SendDtmf(string digit); BoolFeedback InCallFeedback { get; } BoolFeedback IncomingCallFeedback { get; } diff --git a/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj b/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj index f7a4fab5..f0c31484 100644 --- a/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj +++ b/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj @@ -127,7 +127,11 @@ + + + + diff --git a/Essentials Devices Common/Essentials Devices Common/VC/Cisco/CiscoCodec.cs b/Essentials Devices Common/Essentials Devices Common/VC/CiscoCodec/CiscoCodec.cs similarity index 89% rename from Essentials Devices Common/Essentials Devices Common/VC/Cisco/CiscoCodec.cs rename to Essentials Devices Common/Essentials Devices Common/VC/CiscoCodec/CiscoCodec.cs index 56397284..a069ebe9 100644 --- a/Essentials Devices Common/Essentials Devices Common/VC/Cisco/CiscoCodec.cs +++ b/Essentials Devices Common/Essentials Devices Common/VC/CiscoCodec/CiscoCodec.cs @@ -13,13 +13,14 @@ using Cisco_SX80_Corporate_Phone_Book; using PepperDash.Core; using PepperDash.Essentials.Core; -namespace PepperDash.Essentials.Devices.VideoCodec.Cisco +namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco { enum eCommandType { SessionStart, SessionEnd, Command, GetStatus, GetConfiguration }; public class CiscoCodec : VideoCodecBase { public IBasicCommunication Communication { get; private set; } + public CommunicationGather PortGather { get; private set; } public StatusMonitorBase CommunicationMonitor { get; private set; } @@ -48,6 +49,10 @@ namespace PepperDash.Essentials.Devices.VideoCodec.Cisco : base(key, name) { Communication = comm; + + PortGather = new CommunicationGather(Communication, "\x0d\x0a"); + PortGather.LineReceived += this.Port_LineReceived; + Communication.TextReceived += new EventHandler(Communication_TextReceived); ServerPort = serverPort; @@ -66,12 +71,18 @@ namespace PepperDash.Essentials.Devices.VideoCodec.Cisco } + + /// /// Starts the HTTP feedback server and syncronizes state of codec /// /// public override bool CustomActivate() { + CrestronConsole.AddNewConsoleCommand(SendText, "send" + Key, "", ConsoleAccessLevelEnum.AccessOperator); + + Communication.Connect(); + Debug.Console(1, this, "Starting Cisco API Server"); Server.Start(ServerPort); @@ -113,6 +124,19 @@ namespace PepperDash.Essentials.Devices.VideoCodec.Cisco return base.CustomActivate(); } + void Port_LineReceived(object dev, GenericCommMethodReceiveTextArgs args) + { + if (Debug.Level == 1) + Debug.Console(1, this, "RX: '{0}'", + ComTextHelper.GetEscapedText(args.Text)); + } + + public void SendText(string command) + { + Debug.Console(1, this, "Sending: '{{0}'", command); + Communication.SendText(command + "\0xd\0xa"); + } + private void StartHttpsSession() { SendHttpCommand("", eCommandType.SessionStart); @@ -190,7 +214,7 @@ namespace PepperDash.Essentials.Devices.VideoCodec.Cisco Client.DispatchAsync(request, PostConnectionCallback); } - void PostConnectionCallback(HttpsClientResponse resp, HTTP_CALLBACK_ERROR err) + void PostConnectionCallback(HttpsClientResponse resp, HTTPS_CALLBACK_ERROR err) { try { @@ -310,11 +334,11 @@ namespace PepperDash.Essentials.Devices.VideoCodec.Cisco protected override Func PrivacyModeFeedbackFunc { get { return () => false; } } - public override void Dial() + public override void Dial(string s) { - - } - + + } + public override void EndCall() { @@ -330,6 +354,21 @@ namespace PepperDash.Essentials.Devices.VideoCodec.Cisco } + public override void SendDtmf(string s) + { + + } + + public override void StartSharing() + { + + } + + public override void StopSharing() + { + + } + public override void ReceiveMuteOff() { diff --git a/Essentials Devices Common/Essentials Devices Common/VC/Cisco/Configuration.cs b/Essentials Devices Common/Essentials Devices Common/VC/CiscoCodec/Configuration.cs similarity index 97% rename from Essentials Devices Common/Essentials Devices Common/VC/Cisco/Configuration.cs rename to Essentials Devices Common/Essentials Devices Common/VC/CiscoCodec/Configuration.cs index a88b9b70..7a866a83 100644 --- a/Essentials Devices Common/Essentials Devices Common/VC/Cisco/Configuration.cs +++ b/Essentials Devices Common/Essentials Devices Common/VC/CiscoCodec/Configuration.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using Crestron.SimplSharp; -namespace PepperDash.Essentials.Devices.VideoCodec.Cisco +namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco { public class CiscoCodecConfiguration { diff --git a/Essentials Devices Common/Essentials Devices Common/VC/Cisco/HttpApiServer.cs b/Essentials Devices Common/Essentials Devices Common/VC/CiscoCodec/HttpApiServer.cs similarity index 94% rename from Essentials Devices Common/Essentials Devices Common/VC/Cisco/HttpApiServer.cs rename to Essentials Devices Common/Essentials Devices Common/VC/CiscoCodec/HttpApiServer.cs index 4f5f3fd5..4e25f732 100644 --- a/Essentials Devices Common/Essentials Devices Common/VC/Cisco/HttpApiServer.cs +++ b/Essentials Devices Common/Essentials Devices Common/VC/CiscoCodec/HttpApiServer.cs @@ -8,7 +8,7 @@ using Crestron.SimplSharp.Net.Http; using PepperDash.Core; -namespace PepperDash.Essentials.Devices.VideoCodec.Cisco +namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco { public class HttpApiServer { diff --git a/Essentials Devices Common/Essentials Devices Common/VC/Cisco/Status.cs b/Essentials Devices Common/Essentials Devices Common/VC/CiscoCodec/Status.cs similarity index 97% rename from Essentials Devices Common/Essentials Devices Common/VC/Cisco/Status.cs rename to Essentials Devices Common/Essentials Devices Common/VC/CiscoCodec/Status.cs index ecf54edd..11e608a2 100644 --- a/Essentials Devices Common/Essentials Devices Common/VC/Cisco/Status.cs +++ b/Essentials Devices Common/Essentials Devices Common/VC/CiscoCodec/Status.cs @@ -5,7 +5,7 @@ using System.Text; using Crestron.SimplSharp; using Crestron.SimplSharp.CrestronXml.Serialization; -namespace PepperDash.Essentials.Devices.VideoCodec.Cisco +namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco { public class CiscoCodecStatus { diff --git a/Essentials Devices Common/Essentials Devices Common/VC/MockVC/MockVC.cs b/Essentials Devices Common/Essentials Devices Common/VC/MockVC/MockVC.cs index d8f11150..176070c3 100644 --- a/Essentials Devices Common/Essentials Devices Common/VC/MockVC/MockVC.cs +++ b/Essentials Devices Common/Essentials Devices Common/VC/MockVC/MockVC.cs @@ -60,13 +60,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec /// /// Makes horrible tones go out on the wire! /// - /// - public void SendDTMF(string s) - { - + /// + public override void SendDtmf(string s) + { + } - public override void EndCall() { _InCall = false; @@ -87,10 +86,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec public override void RejectCall() { + } + + public override void StartSharing() + { + + } + + public override void StopSharing() + { + } - - public override void ExecuteSwitch(object selector) { diff --git a/Essentials Devices Common/Essentials Devices Common/VC/VideoCodecBase.cs b/Essentials Devices Common/Essentials Devices Common/VC/VideoCodecBase.cs index 75c0a67a..61e00b86 100644 --- a/Essentials Devices Common/Essentials Devices Common/VC/VideoCodecBase.cs +++ b/Essentials Devices Common/Essentials Devices Common/VC/VideoCodecBase.cs @@ -7,7 +7,7 @@ using Crestron.SimplSharp; using PepperDash.Core; using PepperDash.Essentials.Core; -namespace PepperDash.Essentials.Devices.VideoCodec +namespace PepperDash.Essentials.Devices.Common.VideoCodec { public abstract class VideoCodecBase : Device, IRoutingSinkWithSwitching, IUsageTracking, IHasDialer, IHasSharing //, ICodecAudio { @@ -56,11 +56,15 @@ namespace PepperDash.Essentials.Devices.VideoCodec UsageTracker.EndDeviceUsage(); } } + #region IHasDialer Members - public abstract void Dial(); + public abstract void Dial(string s); public abstract void EndCall(); public abstract void AcceptCall(); public abstract void RejectCall(); + public abstract void SendDtmf(string s); + + #endregion public virtual List Feedbacks { @@ -104,7 +108,10 @@ namespace PepperDash.Essentials.Devices.VideoCodec #region IHasSharing Members - public BoolFeedback SharingSourceFeedback { get; private set; } + public abstract void StartSharing(); + public abstract void StopSharing(); + + public StringFeedback SharingSourceFeedback { get; private set; } #endregion } diff --git a/Essentials/PepperDashEssentials/ControlSystem.cs b/Essentials/PepperDashEssentials/ControlSystem.cs index 9e995b5e..f33d6198 100644 --- a/Essentials/PepperDashEssentials/ControlSystem.cs +++ b/Essentials/PepperDashEssentials/ControlSystem.cs @@ -57,17 +57,6 @@ namespace PepperDash.Essentials //PortalSync = new PepperDashPortalSyncClient(); - - // CODEC TESTING - //GenericSshClient TestCodecClient = new GenericSshClient("TestCodec-1--SshClient", "10.11.50.135", 22, "crestron", "2H3Zu&OvgXp6"); - - //PepperDash.Essentials.Devices.VideoCodec.Cisco.CiscoCodec TestCodec = - // new PepperDash.Essentials.Devices.VideoCodec.Cisco.CiscoCodec("TestCodec-1", "Cisco Spark Room Kit", TestCodecClient, 8080); - - //TestCodec.CustomActivate(); - - // CODEC TESTING - Debug.Console(0, "Starting Essentials load from configuration"); ConfigReader.LoadConfig2(); LoadDevices(); @@ -137,6 +126,16 @@ namespace PepperDash.Essentials else Debug.Console(0, "WARNING: Cannot load unknown device type '{0}', key '{1}'.", devConf.Type, devConf.Key); } + + // CODEC TESTING + GenericSshClient TestCodecClient = new GenericSshClient("TestCodec-1--SshClient", "10.11.50.135", 22, "crestron", "2H3Zu&OvgXp6"); + + PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoCodec TestCodec = + new PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoCodec("TestCodec-1", "Cisco Spark Room Kit", TestCodecClient, 8080); + + TestCodec.CustomActivate(); + + // CODEC TESTING } /// diff --git a/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsCiscoSparkUiDriver.cs b/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsCiscoSparkUiDriver.cs index b61f39f6..d4ca1f1c 100644 --- a/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsCiscoSparkUiDriver.cs +++ b/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsCiscoSparkUiDriver.cs @@ -8,7 +8,7 @@ using Crestron.SimplSharpPro.DeviceSupport; using PepperDash.Core; using PepperDash.Essentials; using PepperDash.Essentials.Core; -using PepperDash.Essentials.Core.SmartObjects; +using PepperDash.Essentials.Core.SmartObjects; using PepperDash.Essentials.Devices.Common.VideoCodec; namespace PepperDash.Essentials.UIDrivers.VC