mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-13 19:54:59 +00:00
Re-added VC/CiscoCodec classes
This commit is contained in:
@@ -18,7 +18,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
void AcceptCall();
|
void AcceptCall();
|
||||||
void RejectCall();
|
void RejectCall();
|
||||||
|
|
||||||
void SendDtmf();
|
void SendDtmf(string digit);
|
||||||
|
|
||||||
BoolFeedback InCallFeedback { get; }
|
BoolFeedback InCallFeedback { get; }
|
||||||
BoolFeedback IncomingCallFeedback { get; }
|
BoolFeedback IncomingCallFeedback { get; }
|
||||||
|
|||||||
@@ -127,7 +127,11 @@
|
|||||||
<Compile Include="SetTopBox\IRSetTopBoxBase.cs" />
|
<Compile Include="SetTopBox\IRSetTopBoxBase.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Streaming\Roku.cs" />
|
<Compile Include="Streaming\Roku.cs" />
|
||||||
|
<Compile Include="VC\CiscoCodec\CiscoCodec.cs" />
|
||||||
|
<Compile Include="VC\CiscoCodec\Configuration.cs" />
|
||||||
|
<Compile Include="VC\CiscoCodec\HttpApiServer.cs" />
|
||||||
<Compile Include="VC\MockVC\MockVC.cs" />
|
<Compile Include="VC\MockVC\MockVC.cs" />
|
||||||
|
<Compile Include="VC\CiscoCodec\Status.cs" />
|
||||||
<Compile Include="VC\VideoCodecBase.cs" />
|
<Compile Include="VC\VideoCodecBase.cs" />
|
||||||
<None Include="Properties\ControlSystem.cfg" />
|
<None Include="Properties\ControlSystem.cfg" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -13,13 +13,14 @@ using Cisco_SX80_Corporate_Phone_Book;
|
|||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.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 };
|
enum eCommandType { SessionStart, SessionEnd, Command, GetStatus, GetConfiguration };
|
||||||
|
|
||||||
public class CiscoCodec : VideoCodecBase
|
public class CiscoCodec : VideoCodecBase
|
||||||
{
|
{
|
||||||
public IBasicCommunication Communication { get; private set; }
|
public IBasicCommunication Communication { get; private set; }
|
||||||
|
public CommunicationGather PortGather { get; private set; }
|
||||||
|
|
||||||
public StatusMonitorBase CommunicationMonitor { get; private set; }
|
public StatusMonitorBase CommunicationMonitor { get; private set; }
|
||||||
|
|
||||||
@@ -48,6 +49,10 @@ namespace PepperDash.Essentials.Devices.VideoCodec.Cisco
|
|||||||
: base(key, name)
|
: base(key, name)
|
||||||
{
|
{
|
||||||
Communication = comm;
|
Communication = comm;
|
||||||
|
|
||||||
|
PortGather = new CommunicationGather(Communication, "\x0d\x0a");
|
||||||
|
PortGather.LineReceived += this.Port_LineReceived;
|
||||||
|
|
||||||
Communication.TextReceived += new EventHandler<GenericCommMethodReceiveTextArgs>(Communication_TextReceived);
|
Communication.TextReceived += new EventHandler<GenericCommMethodReceiveTextArgs>(Communication_TextReceived);
|
||||||
|
|
||||||
ServerPort = serverPort;
|
ServerPort = serverPort;
|
||||||
@@ -66,12 +71,18 @@ namespace PepperDash.Essentials.Devices.VideoCodec.Cisco
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Starts the HTTP feedback server and syncronizes state of codec
|
/// Starts the HTTP feedback server and syncronizes state of codec
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public override bool CustomActivate()
|
public override bool CustomActivate()
|
||||||
{
|
{
|
||||||
|
CrestronConsole.AddNewConsoleCommand(SendText, "send" + Key, "", ConsoleAccessLevelEnum.AccessOperator);
|
||||||
|
|
||||||
|
Communication.Connect();
|
||||||
|
|
||||||
Debug.Console(1, this, "Starting Cisco API Server");
|
Debug.Console(1, this, "Starting Cisco API Server");
|
||||||
|
|
||||||
Server.Start(ServerPort);
|
Server.Start(ServerPort);
|
||||||
@@ -113,6 +124,19 @@ namespace PepperDash.Essentials.Devices.VideoCodec.Cisco
|
|||||||
return base.CustomActivate();
|
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()
|
private void StartHttpsSession()
|
||||||
{
|
{
|
||||||
SendHttpCommand("", eCommandType.SessionStart);
|
SendHttpCommand("", eCommandType.SessionStart);
|
||||||
@@ -190,7 +214,7 @@ namespace PepperDash.Essentials.Devices.VideoCodec.Cisco
|
|||||||
Client.DispatchAsync(request, PostConnectionCallback);
|
Client.DispatchAsync(request, PostConnectionCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PostConnectionCallback(HttpsClientResponse resp, HTTP_CALLBACK_ERROR err)
|
void PostConnectionCallback(HttpsClientResponse resp, HTTPS_CALLBACK_ERROR err)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -310,11 +334,11 @@ namespace PepperDash.Essentials.Devices.VideoCodec.Cisco
|
|||||||
|
|
||||||
protected override Func<bool> PrivacyModeFeedbackFunc { get { return () => false; } }
|
protected override Func<bool> PrivacyModeFeedbackFunc { get { return () => false; } }
|
||||||
|
|
||||||
public override void Dial()
|
public override void Dial(string s)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void EndCall()
|
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()
|
public override void ReceiveMuteOff()
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -4,7 +4,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.VideoCodec.Cisco
|
namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||||
{
|
{
|
||||||
public class CiscoCodecConfiguration
|
public class CiscoCodecConfiguration
|
||||||
{
|
{
|
||||||
@@ -8,7 +8,7 @@ using Crestron.SimplSharp.Net.Http;
|
|||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.VideoCodec.Cisco
|
namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||||
{
|
{
|
||||||
public class HttpApiServer
|
public class HttpApiServer
|
||||||
{
|
{
|
||||||
@@ -5,7 +5,7 @@ using System.Text;
|
|||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharp.CrestronXml.Serialization;
|
using Crestron.SimplSharp.CrestronXml.Serialization;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.VideoCodec.Cisco
|
namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||||
{
|
{
|
||||||
public class CiscoCodecStatus
|
public class CiscoCodecStatus
|
||||||
{
|
{
|
||||||
@@ -60,13 +60,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Makes horrible tones go out on the wire!
|
/// Makes horrible tones go out on the wire!
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="s"></param>
|
/// <param name="s"></param>
|
||||||
public void SendDTMF(string s)
|
public override void SendDtmf(string s)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public override void EndCall()
|
public override void EndCall()
|
||||||
{
|
{
|
||||||
_InCall = false;
|
_InCall = false;
|
||||||
@@ -87,10 +86,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
public override void RejectCall()
|
public override void RejectCall()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void StartSharing()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void StopSharing()
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public override void ExecuteSwitch(object selector)
|
public override void ExecuteSwitch(object selector)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ using Crestron.SimplSharp;
|
|||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.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
|
public abstract class VideoCodecBase : Device, IRoutingSinkWithSwitching, IUsageTracking, IHasDialer, IHasSharing //, ICodecAudio
|
||||||
{
|
{
|
||||||
@@ -56,11 +56,15 @@ namespace PepperDash.Essentials.Devices.VideoCodec
|
|||||||
UsageTracker.EndDeviceUsage();
|
UsageTracker.EndDeviceUsage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#region IHasDialer Members
|
||||||
|
|
||||||
public abstract void Dial();
|
public abstract void Dial(string s);
|
||||||
public abstract void EndCall();
|
public abstract void EndCall();
|
||||||
public abstract void AcceptCall();
|
public abstract void AcceptCall();
|
||||||
public abstract void RejectCall();
|
public abstract void RejectCall();
|
||||||
|
public abstract void SendDtmf(string s);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
public virtual List<Feedback> Feedbacks
|
public virtual List<Feedback> Feedbacks
|
||||||
{
|
{
|
||||||
@@ -104,7 +108,10 @@ namespace PepperDash.Essentials.Devices.VideoCodec
|
|||||||
|
|
||||||
#region IHasSharing Members
|
#region IHasSharing Members
|
||||||
|
|
||||||
public BoolFeedback SharingSourceFeedback { get; private set; }
|
public abstract void StartSharing();
|
||||||
|
public abstract void StopSharing();
|
||||||
|
|
||||||
|
public StringFeedback SharingSourceFeedback { get; private set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,17 +57,6 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
//PortalSync = new PepperDashPortalSyncClient();
|
//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");
|
Debug.Console(0, "Starting Essentials load from configuration");
|
||||||
ConfigReader.LoadConfig2();
|
ConfigReader.LoadConfig2();
|
||||||
LoadDevices();
|
LoadDevices();
|
||||||
@@ -137,6 +126,16 @@ namespace PepperDash.Essentials
|
|||||||
else
|
else
|
||||||
Debug.Console(0, "WARNING: Cannot load unknown device type '{0}', key '{1}'.", devConf.Type, devConf.Key);
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ using Crestron.SimplSharpPro.DeviceSupport;
|
|||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials;
|
using PepperDash.Essentials;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.SmartObjects;
|
using PepperDash.Essentials.Core.SmartObjects;
|
||||||
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.UIDrivers.VC
|
namespace PepperDash.Essentials.UIDrivers.VC
|
||||||
|
|||||||
Reference in New Issue
Block a user