diff --git a/Essentials Core/PepperDashEssentialsBase/Devices/CodecInterfaces.cs b/Essentials Core/PepperDashEssentialsBase/Devices/CodecInterfaces.cs index a5e84b12..d7a00aa6 100644 --- a/Essentials Core/PepperDashEssentialsBase/Devices/CodecInterfaces.cs +++ b/Essentials Core/PepperDashEssentialsBase/Devices/CodecInterfaces.cs @@ -20,7 +20,7 @@ namespace PepperDash.Essentials.Core void SendDtmf(string digit); - BoolFeedback InCallFeedback { get; } + IntFeedback ActiveCallCountFeedback { get; } BoolFeedback IncomingCallFeedback { get; } @@ -30,7 +30,7 @@ namespace PepperDash.Essentials.Core /// /// Defines minimum volume controls for a codec device with dialing capabilities /// - public interface ICodecAudio : IBasicVolumeWithFeedback, ICodecPrivacy + public interface ICodecAudio : IBasicVolumeWithFeedback, IPrivacy { } @@ -38,7 +38,7 @@ namespace PepperDash.Essentials.Core /// /// Adds control of codec receive volume /// - public interface ICodecReceiveVolume + public interface IReceiveVolume { // Break this out into 3 interfaces void SetReceiveVolume(ushort level); @@ -52,7 +52,7 @@ namespace PepperDash.Essentials.Core /// /// Adds control of codec transmit volume /// - public interface ICodecTransmitVolume + public interface ITransmitVolume { void SetTransmitVolume(ushort level); void TransmitMuteOn(); @@ -65,7 +65,7 @@ namespace PepperDash.Essentials.Core /// /// Adds control of codec privacy function (microphone mute) /// - public interface ICodecPrivacy + public interface IPrivacy { void PrivacyModeOn(); void PrivacyModeOff(); 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 fc1c2303..7787f5c2 100644 --- a/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj +++ b/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj @@ -127,13 +127,14 @@ - - - - - - - + + + + + + + + diff --git a/Essentials Devices Common/Essentials Devices Common/VC/CiscoCodec/CiscoCodec.cs b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoCodec.cs similarity index 96% rename from Essentials Devices Common/Essentials Devices Common/VC/CiscoCodec/CiscoCodec.cs rename to Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoCodec.cs index 864387cc..d6c399c7 100644 --- a/Essentials Devices Common/Essentials Devices Common/VC/CiscoCodec/CiscoCodec.cs +++ b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoCodec.cs @@ -1,766 +1,771 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Crestron.SimplSharp; -using Crestron.SimplSharp.Net.Https; -using Crestron.SimplSharp.CrestronXml; -using Crestron.SimplSharp.CrestronXml.Serialization; -using Newtonsoft.Json; -using Cisco_One_Button_To_Push; -using Cisco_SX80_Corporate_Phone_Book; - -using PepperDash.Core; -using PepperDash.Essentials.Core; -using PepperDash.Essentials.Core.Routing; - -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 CommunicationGather JsonGather { get; private set; } - - public StatusMonitorBase CommunicationMonitor { get; private set; } - - public BoolFeedback StandbyIsOnFeedback { get; private set; } - - private CiscoOneButtonToPush CodecObtp; - - private Corporate_Phone_Book PhoneBook; - - private CiscoCodecConfiguration.RootObject CodecConfiguration; - - private CiscoCodecStatus.RootObject CodecStatus; - - private CiscoCodecEvents.RootObject CodecEvent; - - /// - /// Gets and returns the scaled volume of the codec - /// - protected override Func VolumeLevelFeedbackFunc - { - get - { - return () => CrestronEnvironment.ScaleWithLimits(CodecStatus.Status.Audio.Volume.IntValue, 100, 0, 65535, 0); - } - } - - protected override Func PrivacyModeFeedbackFunc - { - get - { - return () => CodecStatus.Status.Audio.Microphones.Mute.BoolValue; - } - } - - protected Func StandbyStateFeedbackFunc - { - get - { - return () => CodecStatus.Status.Standby.State.BoolValue; - } - } - - protected override Func SharingSourceFeedbackFunc - { - get { return () => "Fix me fuckers"; } - } - - protected override Func MuteFeedbackFunc - { - get { return () => false; } - } - - //private HttpsClient Client; - - //private HttpApiServer Server; - - //private int ServerPort; - - //private string CodecUrl; - - //private string HttpSessionId; - - //private string FeedbackRegistrationExpression; - - private string CliFeedbackRegistrationExpression; - - private CodecSyncState SyncState; - - private StringBuilder JsonMessage; - - private bool JsonFeedbackMessageIsIncoming; - - string Delimiter = "\r\n"; - - int PresentationSource; - - public bool CommDebuggingIsOn; - - // Constructor for IBasicCommunication - public CiscoCodec(string key, string name, IBasicCommunication comm, int serverPort) - : base(key, name) - { - StandbyIsOnFeedback = new BoolFeedback(StandbyStateFeedbackFunc); - - Communication = comm; - - SyncState = new CodecSyncState(key + "--sync"); - - PortGather = new CommunicationGather(Communication, Delimiter); - PortGather.IncludeDelimiter = true; - PortGather.LineReceived += this.Port_LineReceived; - - //ServerPort = serverPort; - - CodecObtp = new CiscoOneButtonToPush(); - - PhoneBook = new Corporate_Phone_Book(); - - CodecConfiguration = new CiscoCodecConfiguration.RootObject(); - - CodecStatus = new CiscoCodecStatus.RootObject(); - - CodecEvent = new CiscoCodecEvents.RootObject(); - - CodecStatus.Status.Audio.Volume.ValueChangedAction = VolumeLevelFeedback.FireUpdate; - CodecStatus.Status.Audio.VolumeMute.ValueChangedAction = MuteFeedback.FireUpdate; - CodecStatus.Status.Audio.Microphones.Mute.ValueChangedAction = PrivacyModeIsOnFeedback.FireUpdate; - CodecStatus.Status.Standby.State.ValueChangedAction = StandbyIsOnFeedback.FireUpdate; - - //Client = new HttpsClient(); - - //Server = new HttpApiServer(); - } - - /// - /// Starts the HTTP feedback server and syncronizes state of codec - /// - /// - public override bool CustomActivate() - { - CrestronConsole.AddNewConsoleCommand(SendText, "send" + Key, "", ConsoleAccessLevelEnum.AccessOperator); - CrestronConsole.AddNewConsoleCommand(SetCommDebug, "SetCiscoCommDebug", "0 for Off, 1 for on", ConsoleAccessLevelEnum.AccessOperator); - - - - Communication.Connect(); - var socket = Communication as ISocketStatus; - if (socket != null) - { - socket.ConnectionChange += new EventHandler(socket_ConnectionChange); - } - - InputPorts.Add(new RoutingInputPort(RoutingPortNames.HdmiIn1, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, new Action(SelectPresentationSource1), this)); - InputPorts.Add(new RoutingInputPort(RoutingPortNames.HdmiIn2, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, new Action(SelectPresentationSource2), this)); - - //Debug.Console(1, this, "Starting Cisco API Server"); - - //Server.Start(ServerPort); - - //Server.ApiRequest += new EventHandler(Server_ApiRequest); - - //CodecUrl = string.Format("http://{0}", (Communication as GenericSshClient).Hostname); - - CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 2000, 120000, 300000, "xStatus SystemUnit Software Version\r"); - DeviceManager.AddDevice(CommunicationMonitor); - - //Client = new HttpsClient(); - - //Client.Verbose = true; - //Client.KeepAlive = true; - - - // Temp feedback registration - - //FeedbackRegistrationExpression = - // "1" + - // string.Format("http://{0}:{1}/cisco/api", CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0), ServerPort) + - // "JSON" + - // "/Configuration" + - // "/Event/CallDisconnect" + - // "/Status/Call" + - // "" + - // "" + - // ""; - - string prefix = "xFeedback register "; - CliFeedbackRegistrationExpression = - prefix + "/Configuration" + Delimiter + - prefix + "/Status/Audio" + Delimiter + - prefix + "/Status/Call" + Delimiter + - prefix + "/Status/Cameras/SpeakerTrack" + Delimiter + - prefix + "/Status/RoomAnalytics" + Delimiter + - prefix + "/Status/Standby" + Delimiter + - prefix + "/Status/Video/Selfview" + Delimiter + - prefix + "/Bookings" + Delimiter + - prefix + "/Event/CallDisconnect" + Delimiter; - - //StartHttpsSession(); - - //CodecObtp.Initialize(); - - //CodecObtp.GetMeetings(); - - //PhoneBook.DownloadPhoneBook(Corporate_Phone_Book.ePhoneBookLocation.Corporate); - - return base.CustomActivate(); - } - - public void SetCommDebug(string s) - { - if (s == "1") - { - CommDebuggingIsOn = true; - Debug.Console(0, this, "Comm Debug Enabled."); - } - else - { - CommDebuggingIsOn = false; - Debug.Console(0, this, "Comm Debug Disabled."); - } - } - - void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e) - { - // Reset sync status on disconnect - if (!e.Client.IsConnected) - SyncState.CodecDisconnected(); - } - - /// - /// Gathers responses from the codec (including the delimiter. Responses are checked to see if they contain JSON data and if so, the data is collected until a complete JSON - /// message is received before forwarding the message to be deserialized. - /// - /// - /// - void Port_LineReceived(object dev, GenericCommMethodReceiveTextArgs args) - { - if (CommDebuggingIsOn) - { - if(!JsonFeedbackMessageIsIncoming) - Debug.Console(1, this, "RX: '{0}'", args.Text); - } - - if (args.Text == "{" + Delimiter) // Check for the beginning of a new JSON message - { - JsonFeedbackMessageIsIncoming = true; - - if (CommDebuggingIsOn) - Debug.Console(1, this, "Incoming JSON message..."); - - JsonMessage = new StringBuilder(); - } - else if (args.Text == "}" + Delimiter) // Check for the end of a JSON message - { - JsonFeedbackMessageIsIncoming = false; - - JsonMessage.Append(args.Text); - - if (CommDebuggingIsOn) - Debug.Console(1, this, "Complete JSON Received:\n{0}", JsonMessage.ToString()); - - // Forward the complete message to be deserialized - DeserializeResponse(JsonMessage.ToString()); - return; - } - - if(JsonFeedbackMessageIsIncoming) - { - JsonMessage.Append(args.Text); - - //Debug.Console(1, this, "Building JSON:\n{0}", JsonMessage.ToString()); - return; - } - - if (!SyncState.InitialSyncComplete) - { - switch (args.Text.Trim().ToLower()) // remove the whitespace - { - case "*r login successful": - { - SendText("xPreferences outputmode json"); - break; - } - case "xpreferences outputmode json": - { - if(!SyncState.InitialStatusMessageWasReceived) - SendText("xStatus"); - break; - } - case "xfeedback register": - { - SyncState.FeedbackRegistered(); - break; - } - } - } - } - - public void SendText(string command) - { - if (CommDebuggingIsOn) - Debug.Console(1, this, "Sending: '{0}'", command); - - Communication.SendText(command + Delimiter); - } - - //private void StartHttpsSession() - //{ - // SendHttpCommand("", eCommandType.SessionStart); - //} - - //private void EndHttpsSession() - //{ - // SendHttpCommand("", eCommandType.SessionEnd); - //} - - //private void SendHttpCommand(string command, eCommandType commandType) - //{ - // //HttpsClientRequest request = new HttpsClientRequest(); - - // //string urlSuffix = null; - - // //Client.UserName = null; - // //Client.Password = null; - - // //Client.PeerVerification = false; - // //Client.HostVerification = false; - - // //request.RequestType = RequestType.Post; - - // //if(!string.IsNullOrEmpty(HttpSessionId)) - // // request.Header.SetHeaderValue("Cookie", HttpSessionId); - - // //switch (commandType) - // //{ - // // case eCommandType.Command: - // // { - // // urlSuffix = "/putxml"; - // // request.ContentString = command; - // // request.Header.SetHeaderValue("Content-Type", "text/xml"); - // // break; - // // } - // // case eCommandType.SessionStart: - // // { - - // // urlSuffix = "/xmlapi/session/begin"; - - // // Client.UserName = (Communication as GenericSshClient).Username; - // // Client.Password = (Communication as GenericSshClient).Password; - - // // break; - // // } - // // case eCommandType.SessionEnd: - // // { - // // urlSuffix = "/xmlapi/session/end"; - // // request.Header.SetHeaderValue("Cookie", HttpSessionId); - // // break; - // // } - // // case eCommandType.GetStatus: - // // { - // // request.RequestType = RequestType.Get; - // // request.Header.SetHeaderValue("Content-Type", "text/xml"); - // // urlSuffix = "/getxml?location=/Status"; - // // break; - // // } - // // case eCommandType.GetConfiguration: - // // { - // // request.RequestType = RequestType.Get; - // // request.Header.SetHeaderValue("Content-Type", "text/xml"); - // // urlSuffix = "/getxml?location=/Configuration"; - // // break; - // // } - // //} - - // //var requestUrl = CodecUrl + urlSuffix; - // //request.Header.RequestVersion = "HTTP/1.1"; - // //request.Url.Parse(requestUrl); - - // //Debug.Console(1, this, "Sending HTTP request to Cisco Codec at {0}\nHeader:\n{1}\nContent:\n{2}", requestUrl, request.Header, request.ContentString); - - // //Client.DispatchAsync(request, PostConnectionCallback); - //} - - //void PostConnectionCallback(HttpsClientResponse resp, HTTPS_CALLBACK_ERROR err) - //{ - // //try - // //{ - // // if (resp != null) - // // { - // // if (resp.Code == 200) - // // { - // // Debug.Console(1, this, "Http Post to Cisco Codec Successful. Code: {0}\nContent: {1}", resp.Code, resp.ContentString); - - // // if (resp.ContentString.IndexOf("") > 1) - // // { - // // // Get the initial configruation for sync purposes - // // SendHttpCommand("", eCommandType.GetConfiguration); - // // } - // // else - // // { - // // try - // // { - // // if (resp.ContentString.IndexOf("") > -1) - // // { - // // XmlReaderSettings settings = new XmlReaderSettings(); - - // // XmlReader reader = new XmlReader(resp.ContentString, settings); - - // // CodecConfiguration = CrestronXMLSerialization.DeSerializeObject(reader); - - // // //Debug.Console(1, this, "Product Name: {0} Software Version: {1} ApiVersion: {2}", CodecConfiguration.Configuration.Product, CodecConfiguration.Version, CodecConfiguration.ApiVersion); - - // // // Get the initial status for sync purposes - // // SendHttpCommand("", eCommandType.GetStatus); - // // } - // // else if (resp.ContentString.IndexOf("") > -1) - // // { - // // XmlReaderSettings settings = new XmlReaderSettings(); - - // // XmlReader reader = new XmlReader(resp.ContentString, settings); - - // // CodecStatus = CrestronXMLSerialization.DeSerializeObject(reader); - // // //Debug.Console(1, this, "Product Name: {0} Software Version: {1} ApiVersion: {2} Volume: {3}", CodecStatus.Product, CodecStatus.Version, CodecStatus.ApiVersion, CodecStatus.Audio.Volume); - // // } - // // } - // // catch (Exception ex) - // // { - // // Debug.Console(1, this, "Error Deserializing XML document from codec: {0}", ex); - // // } - // // } - // // } - // // else if (resp.Code == 204) - // // { - // // Debug.Console(1, this, "Response Code: {0}\nHeader:\n{1}Content:\n{1}", resp.Code, resp.Header, resp.ContentString); - - // // HttpSessionId = resp.Header.GetHeaderValue("Set-Cookie"); - // // //var chunks = HttpSessionId.Split(';'); - // // //HttpSessionId = chunks[0]; - // // //HttpSessionId = HttpSessionId.Substring(HttpSessionId.IndexOf("=") + 1); - - - // // // Register for feedbacks once we have a valid session - // // SendHttpCommand(FeedbackRegistrationExpression, eCommandType.Command); - // // } - // // else - // // { - // // Debug.Console(1, this, "Response Code: {0}\nHeader:\n{1}Content:\n{1}Err:\n{2}", resp.Code, resp.Header, resp.ContentString, err); - // // } - // // } - // // else - // // Debug.Console(1, this, "Null response received from server"); - // //} - // //catch (Exception e) - // //{ - // // Debug.Console(1, this, "Error Initializing HTTPS Client: {0}", e); - // //} - //} - - //void Server_ApiRequest(object sender, Crestron.SimplSharp.Net.Http.OnHttpRequestArgs e) - //{ - // Debug.Console(1, this, "Api Reqeust from Codec: {0}", e.Request.ContentString); - // e.Response.Code = 200; - // e.Response.ContentString = "OK"; - - // DeserializeResponse(e.Request.ContentString); - //} - - void DeserializeResponse(string response) - { - try - { - // Serializer settings. We want to ignore null values and mising members - JsonSerializerSettings settings = new JsonSerializerSettings(); - settings.NullValueHandling = NullValueHandling.Ignore; - settings.MissingMemberHandling = MissingMemberHandling.Ignore; - settings.ObjectCreationHandling = ObjectCreationHandling.Auto; - - if (response.IndexOf("\"Status\":{") > -1) - { - JsonConvert.PopulateObject(response, CodecStatus); - - if (!SyncState.InitialStatusMessageWasReceived) - { - SyncState.InitialStatusMessageReceived(); - if(!SyncState.InitialConfigurationMessageWasReceived) - SendText("xConfiguration"); - } - } - else if (response.IndexOf("\"Configuration\":{") > -1) - { - JsonConvert.PopulateObject(response, CodecConfiguration); - - if (!SyncState.InitialConfigurationMessageWasReceived) - { - SyncState.InitialConfigurationMessageReceived(); - if (!SyncState.FeedbackWasRegistered) - { - SendText(CliFeedbackRegistrationExpression); - } - } - - } - else if (response.IndexOf("\"Event\":{") > -1) - { - JsonConvert.PopulateObject(response, CodecEvent); - } - - } - catch (Exception ex) - { - Debug.Console(1, this, "Error Deserializing feedback from codec: {0}", ex); - } - } - - public override void ExecuteSwitch(object selector) - { - (selector as Action)(); - } - - protected override Func InCallFeedbackFunc { get { return () => false; } } - - protected override Func IncomingCallFeedbackFunc { get { return () => false; } } - - /// - /// Gets the first CallId or returns null - /// - /// - private string GetCallId() - { - string callId = null; - - if (CodecStatus.Status.Call.Count > 0) - callId = CodecStatus.Status.Call[0].id; - - return callId; - - } - - public override void Dial(string s) - { - SendText(string.Format("xCommand Dial Number: \"{0}\"", s)); - } - - public void DialBookingId(string s) - { - SendText(string.Format("xCommand Dial BookingId: {0}", s)); - } - - public override void EndCall() - { - SendText(string.Format("xCommand Call Disconnect CallId: {0}", GetCallId())); - } - - public override void AcceptCall() - { - SendText("xCommand Call Accept"); - } - - public override void RejectCall() - { - SendText("xCommand Call Reject"); - } - - public override void SendDtmf(string s) - { - SendText(string.Format("xCommand Call DTMFSend CallId: {0} DTMFString: \"{1}\"", GetCallId(), s)); - } - - public void SelectPresentationSource(int source) - { - PresentationSource = source; - - StartSharing(); - } - - /// - /// Select source 1 as the presetnation source - /// - public void SelectPresentationSource1() - { - SelectPresentationSource(1); - } - - /// - /// Select source 2 as the presetnation source - /// - public void SelectPresentationSource2() - { - SelectPresentationSource(2); - } - - public override void StartSharing() - { - string sendingMode = string.Empty; - - if (InCallFeedback.BoolValue) - sendingMode = "LocalRemote"; - else - sendingMode = "LocalOnly"; - - SendText(string.Format("xCommand Presentation Start PresentationSource: {0}", PresentationSource)); - } - - public override void StopSharing() - { - SendText(string.Format("xCommand Presentation Stop PresentationSource: {0}", PresentationSource)); - } - - public override void PrivacyModeOn() - { - SendText("xCommand Audio Microphones Mute"); - } - - public override void PrivacyModeOff() - { - SendText("xCommand Audio Microphones Unmute"); - } - - public override void PrivacyModeToggle() - { - SendText("xCommand Audio Microphones ToggleMute"); - } - - public override void MuteOff() - { - SendText("xCommand Audio Volume Unmute"); - } - - public override void MuteOn() - { - SendText("xCommand Audio Volume Mute"); - } - - public override void MuteToggle() - { - SendText("xCommand Audio Volume ToggleMute"); - } - - /// - /// Increments the voluem - /// - /// - public override void VolumeUp(bool pressRelease) - { - SendText("xCommand Audio Volume Increase"); - } - - /// - /// Decrements the volume - /// - /// - public override void VolumeDown(bool pressRelease) - { - SendText("xCommand Audio Volume Decrease"); - } - - /// - /// Scales the level and sets the codec to the specified level within its range - /// - /// level from slider (0-65535 range) - public override void SetVolume(ushort level) - { - var scaledLevel = CrestronEnvironment.ScaleWithLimits(level, 65535, 0, 100, 0); - SendText(string.Format("xCommand Audio Volume Set Level: {0}", scaledLevel)); - } - - /// - /// Recalls the default volume on the codec - /// - public void VolumeSetToDefault() - { - SendText("xCommand Audio Volume SetToDefault"); - } - - /// - /// Puts the codec in standby mode - /// - public void StandbyActivate() - { - SendText("xCommand Standby Activate"); - } - - /// - /// Wakes the codec from standby - /// - public void StandbyDeactivate() - { - SendText("xCommand Standby Deactivate"); - } - - /// - /// Reboots the codec - /// - public void Reboot() - { - SendText("xCommand SystemUnit Boot Action: Restart"); - } - } - - /// - /// Tracks the initial sycnronization state of the codec when making a connection - /// - public class CodecSyncState : IKeyed - { - public string Key { get; private set; } - - public bool InitialSyncComplete { get; private set; } - - public bool InitialStatusMessageWasReceived { get; private set; } - - public bool InitialConfigurationMessageWasReceived { get; private set; } - - public bool FeedbackWasRegistered { get; private set; } - - public CodecSyncState(string key) - { - Key = key; - CodecDisconnected(); - } - - public void InitialStatusMessageReceived() - { - InitialStatusMessageWasReceived = true; - Debug.Console(1, this, "Initial Codec Status Message Received."); - CheckSyncStatus(); - } - - public void InitialConfigurationMessageReceived() - { - InitialConfigurationMessageWasReceived = true; - Debug.Console(1, this, "Initial Codec Configuration Message Received."); - CheckSyncStatus(); - } - - public void FeedbackRegistered() - { - FeedbackWasRegistered = true; - Debug.Console(1, this, "Initial Codec Feedback Registration Successful."); - CheckSyncStatus(); - } - - public void CodecDisconnected() - { - InitialConfigurationMessageWasReceived = false; - InitialStatusMessageWasReceived = false; - FeedbackWasRegistered = false; - InitialSyncComplete = false; - } - - void CheckSyncStatus() - { - if (InitialConfigurationMessageWasReceived && InitialStatusMessageWasReceived && FeedbackWasRegistered) - { - InitialSyncComplete = true; - Debug.Console(1, this, "Initial Codec Sync Complete!"); - } - else - InitialSyncComplete = false; - } - } +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; +using Crestron.SimplSharp.Net.Https; +using Crestron.SimplSharp.CrestronXml; +using Crestron.SimplSharp.CrestronXml.Serialization; +using Newtonsoft.Json; +using Cisco_One_Button_To_Push; +using Cisco_SX80_Corporate_Phone_Book; + +using PepperDash.Core; +using PepperDash.Essentials.Core; +using PepperDash.Essentials.Core.Routing; + +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 CommunicationGather JsonGather { get; private set; } + + public StatusMonitorBase CommunicationMonitor { get; private set; } + + public BoolFeedback StandbyIsOnFeedback { get; private set; } + + private CiscoOneButtonToPush CodecObtp; + + private Corporate_Phone_Book PhoneBook; + + private CiscoCodecConfiguration.RootObject CodecConfiguration; + + private CiscoCodecStatus.RootObject CodecStatus; + + private CiscoCodecEvents.RootObject CodecEvent; + + /// + /// Gets and returns the scaled volume of the codec + /// + protected override Func VolumeLevelFeedbackFunc + { + get + { + return () => CrestronEnvironment.ScaleWithLimits(CodecStatus.Status.Audio.Volume.IntValue, 100, 0, 65535, 0); + } + } + + protected override Func PrivacyModeIsOnFeedbackFunc + { + get + { + return () => CodecStatus.Status.Audio.Microphones.Mute.BoolValue; + } + } + + protected Func StandbyStateFeedbackFunc + { + get + { + return () => CodecStatus.Status.Standby.State.BoolValue; + } + } + + protected override Func SharingSourceFeedbackFunc + { + get { return () => "Fix me fuckers"; } + } + + protected override Func MuteFeedbackFunc + { + get { return () => false; } + } + + //private HttpsClient Client; + + //private HttpApiServer Server; + + //private int ServerPort; + + //private string CodecUrl; + + //private string HttpSessionId; + + //private string FeedbackRegistrationExpression; + + private string CliFeedbackRegistrationExpression; + + private CodecSyncState SyncState; + + private StringBuilder JsonMessage; + + private bool JsonFeedbackMessageIsIncoming; + + string Delimiter = "\r\n"; + + int PresentationSource; + + public bool CommDebuggingIsOn; + + // Constructor for IBasicCommunication + public CiscoCodec(string key, string name, IBasicCommunication comm, int serverPort) + : base(key, name) + { + StandbyIsOnFeedback = new BoolFeedback(StandbyStateFeedbackFunc); + + Communication = comm; + + SyncState = new CodecSyncState(key + "--sync"); + + PortGather = new CommunicationGather(Communication, Delimiter); + PortGather.IncludeDelimiter = true; + PortGather.LineReceived += this.Port_LineReceived; + + //ServerPort = serverPort; + + CodecObtp = new CiscoOneButtonToPush(); + + PhoneBook = new Corporate_Phone_Book(); + + CodecConfiguration = new CiscoCodecConfiguration.RootObject(); + + CodecStatus = new CiscoCodecStatus.RootObject(); + + CodecEvent = new CiscoCodecEvents.RootObject(); + + CodecStatus.Status.Audio.Volume.ValueChangedAction = VolumeLevelFeedback.FireUpdate; + CodecStatus.Status.Audio.VolumeMute.ValueChangedAction = MuteFeedback.FireUpdate; + CodecStatus.Status.Audio.Microphones.Mute.ValueChangedAction = PrivacyModeIsOnFeedback.FireUpdate; + CodecStatus.Status.Standby.State.ValueChangedAction = StandbyIsOnFeedback.FireUpdate; + + //Client = new HttpsClient(); + + //Server = new HttpApiServer(); + } + + /// + /// Starts the HTTP feedback server and syncronizes state of codec + /// + /// + public override bool CustomActivate() + { + CrestronConsole.AddNewConsoleCommand(SendText, "send" + Key, "", ConsoleAccessLevelEnum.AccessOperator); + CrestronConsole.AddNewConsoleCommand(SetCommDebug, "SetCiscoCommDebug", "0 for Off, 1 for on", ConsoleAccessLevelEnum.AccessOperator); + + + + Communication.Connect(); + var socket = Communication as ISocketStatus; + if (socket != null) + { + socket.ConnectionChange += new EventHandler(socket_ConnectionChange); + } + + InputPorts.Add(new RoutingInputPort(RoutingPortNames.HdmiIn1, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, new Action(SelectPresentationSource1), this)); + InputPorts.Add(new RoutingInputPort(RoutingPortNames.HdmiIn2, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, new Action(SelectPresentationSource2), this)); + + //Debug.Console(1, this, "Starting Cisco API Server"); + + //Server.Start(ServerPort); + + //Server.ApiRequest += new EventHandler(Server_ApiRequest); + + //CodecUrl = string.Format("http://{0}", (Communication as GenericSshClient).Hostname); + + CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 2000, 120000, 300000, "xStatus SystemUnit Software Version\r"); + DeviceManager.AddDevice(CommunicationMonitor); + + //Client = new HttpsClient(); + + //Client.Verbose = true; + //Client.KeepAlive = true; + + + // Temp feedback registration + + //FeedbackRegistrationExpression = + // "1" + + // string.Format("http://{0}:{1}/cisco/api", CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0), ServerPort) + + // "JSON" + + // "/Configuration" + + // "/Event/CallDisconnect" + + // "/Status/Call" + + // "" + + // "" + + // ""; + + string prefix = "xFeedback register "; + CliFeedbackRegistrationExpression = + prefix + "/Configuration" + Delimiter + + prefix + "/Status/Audio" + Delimiter + + prefix + "/Status/Call" + Delimiter + + prefix + "/Status/Cameras/SpeakerTrack" + Delimiter + + prefix + "/Status/RoomAnalytics" + Delimiter + + prefix + "/Status/Standby" + Delimiter + + prefix + "/Status/Video/Selfview" + Delimiter + + prefix + "/Bookings" + Delimiter + + prefix + "/Event/CallDisconnect" + Delimiter; + + //StartHttpsSession(); + + //CodecObtp.Initialize(); + + //CodecObtp.GetMeetings(); + + //PhoneBook.DownloadPhoneBook(Corporate_Phone_Book.ePhoneBookLocation.Corporate); + + return base.CustomActivate(); + } + + public void SetCommDebug(string s) + { + if (s == "1") + { + CommDebuggingIsOn = true; + Debug.Console(0, this, "Comm Debug Enabled."); + } + else + { + CommDebuggingIsOn = false; + Debug.Console(0, this, "Comm Debug Disabled."); + } + } + + void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e) + { + // Reset sync status on disconnect + if (!e.Client.IsConnected) + SyncState.CodecDisconnected(); + } + + /// + /// Gathers responses from the codec (including the delimiter. Responses are checked to see if they contain JSON data and if so, the data is collected until a complete JSON + /// message is received before forwarding the message to be deserialized. + /// + /// + /// + void Port_LineReceived(object dev, GenericCommMethodReceiveTextArgs args) + { + if (CommDebuggingIsOn) + { + if(!JsonFeedbackMessageIsIncoming) + Debug.Console(1, this, "RX: '{0}'", args.Text); + } + + if (args.Text == "{" + Delimiter) // Check for the beginning of a new JSON message + { + JsonFeedbackMessageIsIncoming = true; + + if (CommDebuggingIsOn) + Debug.Console(1, this, "Incoming JSON message..."); + + JsonMessage = new StringBuilder(); + } + else if (args.Text == "}" + Delimiter) // Check for the end of a JSON message + { + JsonFeedbackMessageIsIncoming = false; + + JsonMessage.Append(args.Text); + + if (CommDebuggingIsOn) + Debug.Console(1, this, "Complete JSON Received:\n{0}", JsonMessage.ToString()); + + // Forward the complete message to be deserialized + DeserializeResponse(JsonMessage.ToString()); + return; + } + + if(JsonFeedbackMessageIsIncoming) + { + JsonMessage.Append(args.Text); + + //Debug.Console(1, this, "Building JSON:\n{0}", JsonMessage.ToString()); + return; + } + + if (!SyncState.InitialSyncComplete) + { + switch (args.Text.Trim().ToLower()) // remove the whitespace + { + case "*r login successful": + { + SendText("xPreferences outputmode json"); + break; + } + case "xpreferences outputmode json": + { + if(!SyncState.InitialStatusMessageWasReceived) + SendText("xStatus"); + break; + } + case "xfeedback register": + { + SyncState.FeedbackRegistered(); + break; + } + } + } + } + + public void SendText(string command) + { + if (CommDebuggingIsOn) + Debug.Console(1, this, "Sending: '{0}'", command); + + Communication.SendText(command + Delimiter); + } + + //private void StartHttpsSession() + //{ + // SendHttpCommand("", eCommandType.SessionStart); + //} + + //private void EndHttpsSession() + //{ + // SendHttpCommand("", eCommandType.SessionEnd); + //} + + //private void SendHttpCommand(string command, eCommandType commandType) + //{ + // //HttpsClientRequest request = new HttpsClientRequest(); + + // //string urlSuffix = null; + + // //Client.UserName = null; + // //Client.Password = null; + + // //Client.PeerVerification = false; + // //Client.HostVerification = false; + + // //request.RequestType = RequestType.Post; + + // //if(!string.IsNullOrEmpty(HttpSessionId)) + // // request.Header.SetHeaderValue("Cookie", HttpSessionId); + + // //switch (commandType) + // //{ + // // case eCommandType.Command: + // // { + // // urlSuffix = "/putxml"; + // // request.ContentString = command; + // // request.Header.SetHeaderValue("Content-Type", "text/xml"); + // // break; + // // } + // // case eCommandType.SessionStart: + // // { + + // // urlSuffix = "/xmlapi/session/begin"; + + // // Client.UserName = (Communication as GenericSshClient).Username; + // // Client.Password = (Communication as GenericSshClient).Password; + + // // break; + // // } + // // case eCommandType.SessionEnd: + // // { + // // urlSuffix = "/xmlapi/session/end"; + // // request.Header.SetHeaderValue("Cookie", HttpSessionId); + // // break; + // // } + // // case eCommandType.GetStatus: + // // { + // // request.RequestType = RequestType.Get; + // // request.Header.SetHeaderValue("Content-Type", "text/xml"); + // // urlSuffix = "/getxml?location=/Status"; + // // break; + // // } + // // case eCommandType.GetConfiguration: + // // { + // // request.RequestType = RequestType.Get; + // // request.Header.SetHeaderValue("Content-Type", "text/xml"); + // // urlSuffix = "/getxml?location=/Configuration"; + // // break; + // // } + // //} + + // //var requestUrl = CodecUrl + urlSuffix; + // //request.Header.RequestVersion = "HTTP/1.1"; + // //request.Url.Parse(requestUrl); + + // //Debug.Console(1, this, "Sending HTTP request to Cisco Codec at {0}\nHeader:\n{1}\nContent:\n{2}", requestUrl, request.Header, request.ContentString); + + // //Client.DispatchAsync(request, PostConnectionCallback); + //} + + //void PostConnectionCallback(HttpsClientResponse resp, HTTPS_CALLBACK_ERROR err) + //{ + // //try + // //{ + // // if (resp != null) + // // { + // // if (resp.Code == 200) + // // { + // // Debug.Console(1, this, "Http Post to Cisco Codec Successful. Code: {0}\nContent: {1}", resp.Code, resp.ContentString); + + // // if (resp.ContentString.IndexOf("") > 1) + // // { + // // // Get the initial configruation for sync purposes + // // SendHttpCommand("", eCommandType.GetConfiguration); + // // } + // // else + // // { + // // try + // // { + // // if (resp.ContentString.IndexOf("") > -1) + // // { + // // XmlReaderSettings settings = new XmlReaderSettings(); + + // // XmlReader reader = new XmlReader(resp.ContentString, settings); + + // // CodecConfiguration = CrestronXMLSerialization.DeSerializeObject(reader); + + // // //Debug.Console(1, this, "Product Name: {0} Software Version: {1} ApiVersion: {2}", CodecConfiguration.Configuration.Product, CodecConfiguration.Version, CodecConfiguration.ApiVersion); + + // // // Get the initial status for sync purposes + // // SendHttpCommand("", eCommandType.GetStatus); + // // } + // // else if (resp.ContentString.IndexOf("") > -1) + // // { + // // XmlReaderSettings settings = new XmlReaderSettings(); + + // // XmlReader reader = new XmlReader(resp.ContentString, settings); + + // // CodecStatus = CrestronXMLSerialization.DeSerializeObject(reader); + // // //Debug.Console(1, this, "Product Name: {0} Software Version: {1} ApiVersion: {2} Volume: {3}", CodecStatus.Product, CodecStatus.Version, CodecStatus.ApiVersion, CodecStatus.Audio.Volume); + // // } + // // } + // // catch (Exception ex) + // // { + // // Debug.Console(1, this, "Error Deserializing XML document from codec: {0}", ex); + // // } + // // } + // // } + // // else if (resp.Code == 204) + // // { + // // Debug.Console(1, this, "Response Code: {0}\nHeader:\n{1}Content:\n{1}", resp.Code, resp.Header, resp.ContentString); + + // // HttpSessionId = resp.Header.GetHeaderValue("Set-Cookie"); + // // //var chunks = HttpSessionId.Split(';'); + // // //HttpSessionId = chunks[0]; + // // //HttpSessionId = HttpSessionId.Substring(HttpSessionId.IndexOf("=") + 1); + + + // // // Register for feedbacks once we have a valid session + // // SendHttpCommand(FeedbackRegistrationExpression, eCommandType.Command); + // // } + // // else + // // { + // // Debug.Console(1, this, "Response Code: {0}\nHeader:\n{1}Content:\n{1}Err:\n{2}", resp.Code, resp.Header, resp.ContentString, err); + // // } + // // } + // // else + // // Debug.Console(1, this, "Null response received from server"); + // //} + // //catch (Exception e) + // //{ + // // Debug.Console(1, this, "Error Initializing HTTPS Client: {0}", e); + // //} + //} + + //void Server_ApiRequest(object sender, Crestron.SimplSharp.Net.Http.OnHttpRequestArgs e) + //{ + // Debug.Console(1, this, "Api Reqeust from Codec: {0}", e.Request.ContentString); + // e.Response.Code = 200; + // e.Response.ContentString = "OK"; + + // DeserializeResponse(e.Request.ContentString); + //} + + void DeserializeResponse(string response) + { + try + { + // Serializer settings. We want to ignore null values and mising members + JsonSerializerSettings settings = new JsonSerializerSettings(); + settings.NullValueHandling = NullValueHandling.Ignore; + settings.MissingMemberHandling = MissingMemberHandling.Ignore; + settings.ObjectCreationHandling = ObjectCreationHandling.Auto; + + if (response.IndexOf("\"Status\":{") > -1) + { + JsonConvert.PopulateObject(response, CodecStatus); + + if (!SyncState.InitialStatusMessageWasReceived) + { + SyncState.InitialStatusMessageReceived(); + if(!SyncState.InitialConfigurationMessageWasReceived) + SendText("xConfiguration"); + } + } + else if (response.IndexOf("\"Configuration\":{") > -1) + { + JsonConvert.PopulateObject(response, CodecConfiguration); + + if (!SyncState.InitialConfigurationMessageWasReceived) + { + SyncState.InitialConfigurationMessageReceived(); + if (!SyncState.FeedbackWasRegistered) + { + SendText(CliFeedbackRegistrationExpression); + } + } + + } + else if (response.IndexOf("\"Event\":{") > -1) + { + JsonConvert.PopulateObject(response, CodecEvent); + } + + } + catch (Exception ex) + { + Debug.Console(1, this, "Error Deserializing feedback from codec: {0}", ex); + } + } + + public override void ExecuteSwitch(object selector) + { + (selector as Action)(); + } + + //protected Func InCallFeedbackFunc { get { return () => false; } } + + protected override Func IncomingCallFeedbackFunc { get { return () => false; } } + + /// + /// Gets the first CallId or returns null + /// + /// + private string GetCallId() + { + string callId = null; + + if (CodecStatus.Status.Call.Count > 0) + callId = CodecStatus.Status.Call[0].id; + + return callId; + + } + + public override void Dial(string s) + { + SendText(string.Format("xCommand Dial Number: \"{0}\"", s)); + } + + public void DialBookingId(string s) + { + SendText(string.Format("xCommand Dial BookingId: {0}", s)); + } + + public override void EndCall() + { + SendText(string.Format("xCommand Call Disconnect CallId: {0}", GetCallId())); + } + + public override void AcceptCall() + { + SendText("xCommand Call Accept"); + } + + public override void RejectCall() + { + SendText("xCommand Call Reject"); + } + + public override void SendDtmf(string s) + { + SendText(string.Format("xCommand Call DTMFSend CallId: {0} DTMFString: \"{1}\"", GetCallId(), s)); + } + + public void SelectPresentationSource(int source) + { + PresentationSource = source; + + StartSharing(); + } + + /// + /// Select source 1 as the presetnation source + /// + public void SelectPresentationSource1() + { + SelectPresentationSource(1); + } + + /// + /// Select source 2 as the presetnation source + /// + public void SelectPresentationSource2() + { + SelectPresentationSource(2); + } + + public override void StartSharing() + { + string sendingMode = string.Empty; + + if (IsInCall) + sendingMode = "LocalRemote"; + else + sendingMode = "LocalOnly"; + + SendText(string.Format("xCommand Presentation Start PresentationSource: {0}", PresentationSource)); + } + + public override void StopSharing() + { + SendText(string.Format("xCommand Presentation Stop PresentationSource: {0}", PresentationSource)); + } + + public override void PrivacyModeOn() + { + SendText("xCommand Audio Microphones Mute"); + } + + public override void PrivacyModeOff() + { + SendText("xCommand Audio Microphones Unmute"); + } + + public override void PrivacyModeToggle() + { + SendText("xCommand Audio Microphones ToggleMute"); + } + + public override void MuteOff() + { + SendText("xCommand Audio Volume Unmute"); + } + + public override void MuteOn() + { + SendText("xCommand Audio Volume Mute"); + } + + public override void MuteToggle() + { + SendText("xCommand Audio Volume ToggleMute"); + } + + /// + /// Increments the voluem + /// + /// + public override void VolumeUp(bool pressRelease) + { + SendText("xCommand Audio Volume Increase"); + } + + /// + /// Decrements the volume + /// + /// + public override void VolumeDown(bool pressRelease) + { + SendText("xCommand Audio Volume Decrease"); + } + + /// + /// Scales the level and sets the codec to the specified level within its range + /// + /// level from slider (0-65535 range) + public override void SetVolume(ushort level) + { + var scaledLevel = CrestronEnvironment.ScaleWithLimits(level, 65535, 0, 100, 0); + SendText(string.Format("xCommand Audio Volume Set Level: {0}", scaledLevel)); + } + + /// + /// Recalls the default volume on the codec + /// + public void VolumeSetToDefault() + { + SendText("xCommand Audio Volume SetToDefault"); + } + + /// + /// Puts the codec in standby mode + /// + public void StandbyActivate() + { + SendText("xCommand Standby Activate"); + } + + /// + /// Wakes the codec from standby + /// + public void StandbyDeactivate() + { + SendText("xCommand Standby Deactivate"); + } + + /// + /// Reboots the codec + /// + public void Reboot() + { + SendText("xCommand SystemUnit Boot Action: Restart"); + } + + protected override Func ActiveCallCountFeedbackFunc + { + get { throw new NotImplementedException(); } + } + } + + /// + /// Tracks the initial sycnronization state of the codec when making a connection + /// + public class CodecSyncState : IKeyed + { + public string Key { get; private set; } + + public bool InitialSyncComplete { get; private set; } + + public bool InitialStatusMessageWasReceived { get; private set; } + + public bool InitialConfigurationMessageWasReceived { get; private set; } + + public bool FeedbackWasRegistered { get; private set; } + + public CodecSyncState(string key) + { + Key = key; + CodecDisconnected(); + } + + public void InitialStatusMessageReceived() + { + InitialStatusMessageWasReceived = true; + Debug.Console(1, this, "Initial Codec Status Message Received."); + CheckSyncStatus(); + } + + public void InitialConfigurationMessageReceived() + { + InitialConfigurationMessageWasReceived = true; + Debug.Console(1, this, "Initial Codec Configuration Message Received."); + CheckSyncStatus(); + } + + public void FeedbackRegistered() + { + FeedbackWasRegistered = true; + Debug.Console(1, this, "Initial Codec Feedback Registration Successful."); + CheckSyncStatus(); + } + + public void CodecDisconnected() + { + InitialConfigurationMessageWasReceived = false; + InitialStatusMessageWasReceived = false; + FeedbackWasRegistered = false; + InitialSyncComplete = false; + } + + void CheckSyncStatus() + { + if (InitialConfigurationMessageWasReceived && InitialStatusMessageWasReceived && FeedbackWasRegistered) + { + InitialSyncComplete = true; + Debug.Console(1, this, "Initial Codec Sync Complete!"); + } + else + InitialSyncComplete = false; + } + } } \ No newline at end of file diff --git a/Essentials Devices Common/Essentials Devices Common/VC/CiscoCodec/HttpApiServer.cs b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/HttpApiServer.cs similarity index 96% rename from Essentials Devices Common/Essentials Devices Common/VC/CiscoCodec/HttpApiServer.cs rename to Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/HttpApiServer.cs index 4e25f732..affe9c2f 100644 --- a/Essentials Devices Common/Essentials Devices Common/VC/CiscoCodec/HttpApiServer.cs +++ b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/HttpApiServer.cs @@ -1,106 +1,106 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Crestron.SimplSharp; -using Crestron.SimplSharp.Net.Http; - -using PepperDash.Core; - - -namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco -{ - public class HttpApiServer - { - public static Dictionary ExtensionContentTypes; - - public event EventHandler ApiRequest; - public Crestron.SimplSharp.Net.Http.HttpServer HttpServer { get; private set; } - - public string HtmlRoot { get; set; } - - - /// - /// SIMPL+ can only execute the default constructor. If you have variables that require initialization, please - /// use an Initialize method - /// - public HttpApiServer() - { - ExtensionContentTypes = new Dictionary - { - { ".css", "text/css" }, - { ".htm", "text/html" }, - { ".html", "text/html" }, - { ".jpg", "image/jpeg" }, - { ".jpeg", "image/jpeg" }, - { ".js", "application/javascript" }, - { ".json", "application/json" }, - { ".xml", "text/xml" }, - { ".map", "application/x-navimap" }, - { ".pdf", "application.pdf" }, - { ".png", "image/png" }, - { ".txt", "text/plain" }, - }; - HtmlRoot = @"\HTML"; - } - - - public void Start(int port) - { - // TEMP - this should be inserted by configuring class - - HttpServer = new Crestron.SimplSharp.Net.Http.HttpServer(); - HttpServer.ServerName = "Cisco API Server"; - HttpServer.KeepAlive = true; - HttpServer.Port = port; - HttpServer.OnHttpRequest += Server_Request; - HttpServer.Open(); - - CrestronEnvironment.ProgramStatusEventHandler += (a) => - { - if (a == eProgramStatusEventType.Stopping) - { - HttpServer.Close(); - Debug.Console(1, "Shutting down HTTP Server on port {0}", HttpServer.Port); - } - }; - } - - void Server_Request(object sender, OnHttpRequestArgs args) - { - if (args.Request.Header.RequestType == "OPTIONS") - { - Debug.Console(2, "Asking for OPTIONS"); - args.Response.Header.SetHeaderValue("Access-Control-Allow-Origin", "*"); - args.Response.Header.SetHeaderValue("Access-Control-Allow-Methods", "GET, POST, PATCH, PUT, DELETE, OPTIONS"); - return; - } - - string path = Uri.UnescapeDataString(args.Request.Path); - var host = args.Request.DataConnection.RemoteEndPointAddress; - //string authToken; - - Debug.Console(2, "HTTP Request: {2}: Path='{0}' ?'{1}'", path, args.Request.QueryString, host); - - // ----------------------------------- ADD AUTH HERE - if (path.StartsWith("/cisco/api")) - { - var handler = ApiRequest; - if (ApiRequest != null) - ApiRequest(this, args); - } - } - - public static string GetContentType(string extension) - { - string type; - if (ExtensionContentTypes.ContainsKey(extension)) - type = ExtensionContentTypes[extension]; - else - type = "text/plain"; - return type; - } - - } - +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; +using Crestron.SimplSharp.Net.Http; + +using PepperDash.Core; + + +namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco +{ + public class HttpApiServer + { + public static Dictionary ExtensionContentTypes; + + public event EventHandler ApiRequest; + public Crestron.SimplSharp.Net.Http.HttpServer HttpServer { get; private set; } + + public string HtmlRoot { get; set; } + + + /// + /// SIMPL+ can only execute the default constructor. If you have variables that require initialization, please + /// use an Initialize method + /// + public HttpApiServer() + { + ExtensionContentTypes = new Dictionary + { + { ".css", "text/css" }, + { ".htm", "text/html" }, + { ".html", "text/html" }, + { ".jpg", "image/jpeg" }, + { ".jpeg", "image/jpeg" }, + { ".js", "application/javascript" }, + { ".json", "application/json" }, + { ".xml", "text/xml" }, + { ".map", "application/x-navimap" }, + { ".pdf", "application.pdf" }, + { ".png", "image/png" }, + { ".txt", "text/plain" }, + }; + HtmlRoot = @"\HTML"; + } + + + public void Start(int port) + { + // TEMP - this should be inserted by configuring class + + HttpServer = new Crestron.SimplSharp.Net.Http.HttpServer(); + HttpServer.ServerName = "Cisco API Server"; + HttpServer.KeepAlive = true; + HttpServer.Port = port; + HttpServer.OnHttpRequest += Server_Request; + HttpServer.Open(); + + CrestronEnvironment.ProgramStatusEventHandler += (a) => + { + if (a == eProgramStatusEventType.Stopping) + { + HttpServer.Close(); + Debug.Console(1, "Shutting down HTTP Server on port {0}", HttpServer.Port); + } + }; + } + + void Server_Request(object sender, OnHttpRequestArgs args) + { + if (args.Request.Header.RequestType == "OPTIONS") + { + Debug.Console(2, "Asking for OPTIONS"); + args.Response.Header.SetHeaderValue("Access-Control-Allow-Origin", "*"); + args.Response.Header.SetHeaderValue("Access-Control-Allow-Methods", "GET, POST, PATCH, PUT, DELETE, OPTIONS"); + return; + } + + string path = Uri.UnescapeDataString(args.Request.Path); + var host = args.Request.DataConnection.RemoteEndPointAddress; + //string authToken; + + Debug.Console(2, "HTTP Request: {2}: Path='{0}' ?'{1}'", path, args.Request.QueryString, host); + + // ----------------------------------- ADD AUTH HERE + if (path.StartsWith("/cisco/api")) + { + var handler = ApiRequest; + if (ApiRequest != null) + ApiRequest(this, args); + } + } + + public static string GetContentType(string extension) + { + string type; + if (ExtensionContentTypes.ContainsKey(extension)) + type = ExtensionContentTypes[extension]; + else + type = "text/plain"; + return type; + } + + } + } \ No newline at end of file diff --git a/Essentials Devices Common/Essentials Devices Common/VC/CiscoCodec/xConfiguration.cs b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/xConfiguration.cs similarity index 96% rename from Essentials Devices Common/Essentials Devices Common/VC/CiscoCodec/xConfiguration.cs rename to Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/xConfiguration.cs index 75eed815..530cb791 100644 --- a/Essentials Devices Common/Essentials Devices Common/VC/CiscoCodec/xConfiguration.cs +++ b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/xConfiguration.cs @@ -1,1668 +1,1668 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Crestron.SimplSharp; - -namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco -{ - public class CiscoCodecConfiguration - { - public class DefaultVolume - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Mode - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Dereverberation - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Mode2 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class NoiseReduction - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class EchoControl - { - public Dereverberation Dereverberation { get; set; } - public Mode2 Mode { get; set; } - public NoiseReduction NoiseReduction { get; set; } - } - - public class Level - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Microphone - { - public string id { get; set; } - public Mode Mode { get; set; } - public EchoControl EchoControl { get; set; } - public Level Level { get; set; } - } - - public class Input - { - public List Microphone { get; set; } - } - - public class Enabled - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Mute - { - public Enabled Enabled { get; set; } - } - - public class Microphones - { - public Mute Mute { get; set; } - } - - public class Mode3 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class InternalSpeaker - { - public Mode3 Mode { get; set; } - } - - public class Mode4 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class OutputType - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Line - { - public string id { get; set; } - public Mode4 Mode { get; set; } - public OutputType OutputType { get; set; } - } - - public class Output - { - public InternalSpeaker InternalSpeaker { get; set; } - public List Line { get; set; } - } - - public class RingTone - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class RingVolume - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class SoundsAndAlerts - { - public RingTone RingTone { get; set; } - public RingVolume RingVolume { get; set; } - } - - public class Audio - { - public DefaultVolume DefaultVolume { get; set; } - public Input Input { get; set; } - public Microphones Microphones { get; set; } - public Output Output { get; set; } - public SoundsAndAlerts SoundsAndAlerts { get; set; } - } - - public class Framerate - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Camera - { - public Framerate Framerate { get; set; } - } - - public class Closeup - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Mode5 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class SpeakerTrack - { - public Closeup Closeup { get; set; } - public Mode5 Mode { get; set; } - } - - public class Cameras - { - public Camera Camera { get; set; } - public SpeakerTrack SpeakerTrack { get; set; } - } - - public class Delay - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Mode6 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Mute2 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class AutoAnswer - { - public Delay Delay { get; set; } - public Mode6 Mode { get; set; } - public Mute2 Mute { get; set; } - } - - public class Protocol - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Rate - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class DefaultCall - { - public Protocol Protocol { get; set; } - public Rate Rate { get; set; } - } - - public class DefaultTimeout - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class DoNotDisturb - { - public DefaultTimeout DefaultTimeout { get; set; } - } - - public class Mode7 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Encryption - { - public Mode7 Mode { get; set; } - } - - public class Mode8 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class FarEndControl - { - public Mode8 Mode { get; set; } - } - - public class MaxReceiveCallRate - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class MaxTotalReceiveCallRate - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class MaxTotalTransmitCallRate - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class MaxTransmitCallRate - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Mode9 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class MultiStream - { - public Mode9 Mode { get; set; } - } - - public class Conference - { - public AutoAnswer AutoAnswer { get; set; } - public DefaultCall DefaultCall { get; set; } - public DoNotDisturb DoNotDisturb { get; set; } - public Encryption Encryption { get; set; } - public FarEndControl FarEndControl { get; set; } - public MaxReceiveCallRate MaxReceiveCallRate { get; set; } - public MaxTotalReceiveCallRate MaxTotalReceiveCallRate { get; set; } - public MaxTotalTransmitCallRate MaxTotalTransmitCallRate { get; set; } - public MaxTransmitCallRate MaxTransmitCallRate { get; set; } - public MultiStream MultiStream { get; set; } - } - - public class LoginName - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Mode10 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Password - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Authentication - { - public LoginName LoginName { get; set; } - public Mode10 Mode { get; set; } - public Password Password { get; set; } - } - - public class Mode11 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class CallSetup - { - public Mode11 Mode { get; set; } - } - - public class KeySize - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Encryption2 - { - public KeySize KeySize { get; set; } - } - - public class Address - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Gatekeeper - { - public Address Address { get; set; } - } - - public class E164 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class ID - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class H323Alias - { - public E164 E164 { get; set; } - public ID ID { get; set; } - } - - public class Address2 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Mode12 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class NAT - { - public Address2 Address { get; set; } - public Mode12 Mode { get; set; } - } - - public class H323 - { - public Authentication Authentication { get; set; } - public CallSetup CallSetup { get; set; } - public Encryption2 Encryption { get; set; } - public Gatekeeper Gatekeeper { get; set; } - public H323Alias H323Alias { get; set; } - public NAT NAT { get; set; } - } - - public class Name - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Domain - { - public Name Name { get; set; } - } - - public class Address3 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Server - { - public string id { get; set; } - public Address3 Address { get; set; } - } - - public class DNS - { - public Domain Domain { get; set; } - public List Server { get; set; } - } - - public class AnonymousIdentity - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Md5 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Peap - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Tls - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Ttls - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Eap - { - public Md5 Md5 { get; set; } - public Peap Peap { get; set; } - public Tls Tls { get; set; } - public Ttls Ttls { get; set; } - } - - public class Identity - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Mode13 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Password2 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class TlsVerify - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class UseClientCertificate - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class IEEE8021X - { - public AnonymousIdentity AnonymousIdentity { get; set; } - public Eap Eap { get; set; } - public Identity Identity { get; set; } - public Mode13 Mode { get; set; } - public Password2 Password { get; set; } - public TlsVerify TlsVerify { get; set; } - public UseClientCertificate UseClientCertificate { get; set; } - } - - public class IPStack - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Address4 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Assignment - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Gateway - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class SubnetMask - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class IPv4 - { - public Address4 Address { get; set; } - public Assignment Assignment { get; set; } - public Gateway Gateway { get; set; } - public SubnetMask SubnetMask { get; set; } - } - - public class Address5 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Assignment2 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class DHCPOptions - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Gateway2 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class IPv6 - { - public Address5 Address { get; set; } - public Assignment2 Assignment { get; set; } - public DHCPOptions DHCPOptions { get; set; } - public Gateway2 Gateway { get; set; } - } - - public class MTU - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Audio2 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Data - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class ICMPv6 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class NTP - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Signalling - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Video - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Diffserv - { - public Audio2 Audio { get; set; } - public Data Data { get; set; } - public ICMPv6 ICMPv6 { get; set; } - public NTP NTP { get; set; } - public Signalling Signalling { get; set; } - public Video Video { get; set; } - } - - public class Mode14 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class QoS - { - public Diffserv Diffserv { get; set; } - public Mode14 Mode { get; set; } - } - - public class Allow - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class RemoteAccess - { - public Allow Allow { get; set; } - } - - public class Speed - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Mode15 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class VlanId - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Voice - { - public Mode15 Mode { get; set; } - public VlanId VlanId { get; set; } - } - - public class VLAN - { - public Voice Voice { get; set; } - } - - public class Network - { - public string id { get; set; } - public DNS DNS { get; set; } - public IEEE8021X IEEE8021X { get; set; } - public IPStack IPStack { get; set; } - public IPv4 IPv4 { get; set; } - public IPv6 IPv6 { get; set; } - public MTU MTU { get; set; } - public QoS QoS { get; set; } - public RemoteAccess RemoteAccess { get; set; } - public Speed Speed { get; set; } - public VLAN VLAN { get; set; } - } - - public class Mode16 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class CDP - { - public Mode16 Mode { get; set; } - } - - public class Mode17 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class H3232 - { - public Mode17 Mode { get; set; } - } - - public class Mode18 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class HTTP - { - public Mode18 Mode { get; set; } - } - - public class MinimumTLSVersion - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Server2 - { - public MinimumTLSVersion MinimumTLSVersion { get; set; } - } - - public class StrictTransportSecurity - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class VerifyClientCertificate - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class VerifyServerCertificate - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class HTTPS - { - public Server2 Server { get; set; } - public StrictTransportSecurity StrictTransportSecurity { get; set; } - public VerifyClientCertificate VerifyClientCertificate { get; set; } - public VerifyServerCertificate VerifyServerCertificate { get; set; } - } - - public class Mode19 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Address6 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Server3 - { - public string id { get; set; } - public Address6 Address { get; set; } - } - - public class NTP2 - { - public Mode19 Mode { get; set; } - public List Server { get; set; } - } - - public class Mode20 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class SIP - { - public Mode20 Mode { get; set; } - } - - public class CommunityName - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Address7 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Host - { - public string id { get; set; } - public Address7 Address { get; set; } - } - - public class Mode21 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class SystemContact - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class SystemLocation - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class SNMP - { - public CommunityName CommunityName { get; set; } - public List Host { get; set; } - public Mode21 Mode { get; set; } - public SystemContact SystemContact { get; set; } - public SystemLocation SystemLocation { get; set; } - } - - public class Mode22 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class SSH - { - public Mode22 Mode { get; set; } - } - - public class Mode23 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class UPnP - { - public Mode23 Mode { get; set; } - } - - public class WelcomeText - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class NetworkServices - { - public CDP CDP { get; set; } - public H3232 H323 { get; set; } - public HTTP HTTP { get; set; } - public HTTPS HTTPS { get; set; } - public NTP2 NTP { get; set; } - public SIP SIP { get; set; } - public SNMP SNMP { get; set; } - public SSH SSH { get; set; } - public UPnP UPnP { get; set; } - public WelcomeText WelcomeText { get; set; } - } - - public class Cameras2 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class ControlSystems - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class TouchPanels - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Profile - { - public Cameras2 Cameras { get; set; } - public ControlSystems ControlSystems { get; set; } - public TouchPanels TouchPanels { get; set; } - } - - public class Peripherals - { - public Profile Profile { get; set; } - } - - public class ID2 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Type - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class URL - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Server4 - { - public string id { get; set; } - public ID2 ID { get; set; } - public Type Type { get; set; } - public URL URL { get; set; } - } - - public class Phonebook - { - public List Server { get; set; } - } - - public class Connectivity - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Address8 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class AlternateAddress - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Domain2 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Path - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Protocol2 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class ExternalManager - { - public Address8 Address { get; set; } - public AlternateAddress AlternateAddress { get; set; } - public Domain2 Domain { get; set; } - public Path Path { get; set; } - public Protocol2 Protocol { get; set; } - } - - public class HttpMethod - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class LoginName2 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Mode24 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Password3 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Provisioning - { - public Connectivity Connectivity { get; set; } - public ExternalManager ExternalManager { get; set; } - public HttpMethod HttpMethod { get; set; } - public LoginName2 LoginName { get; set; } - public Mode24 Mode { get; set; } - public Password3 Password { get; set; } - } - - public class Mode25 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class CallControl - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class FromClients - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class ToClients - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class ContentShare - { - public FromClients FromClients { get; set; } - public ToClients ToClients { get; set; } - } - - public class Services - { - public CallControl CallControl { get; set; } - public ContentShare ContentShare { get; set; } - } - - public class Proximity - { - public Mode25 Mode { get; set; } - public Services Services { get; set; } - } - - public class PeopleCountOutOfCall - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class PeoplePresenceDetector - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class RoomAnalytics - { - public PeopleCountOutOfCall PeopleCountOutOfCall { get; set; } - public PeoplePresenceDetector PeoplePresenceDetector { get; set; } - } - - public class Password4 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class UserName - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Authentication2 - { - public Password4 Password { get; set; } - public UserName UserName { get; set; } - } - - public class DefaultTransport - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class DisplayName - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class DefaultCandidate - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Mode26 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Ice - { - public DefaultCandidate DefaultCandidate { get; set; } - public Mode26 Mode { get; set; } - } - - public class ListenPort - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Address9 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Proxy - { - public string id { get; set; } - public Address9 Address { get; set; } - } - - public class Password5 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Server5 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class UserName2 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Turn - { - public Password5 Password { get; set; } - public Server5 Server { get; set; } - public UserName2 UserName { get; set; } - } - - public class URI - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class SIP2 - { - public Authentication2 Authentication { get; set; } - public DefaultTransport DefaultTransport { get; set; } - public DisplayName DisplayName { get; set; } - public Ice Ice { get; set; } - public ListenPort ListenPort { get; set; } - public List Proxy { get; set; } - public Turn Turn { get; set; } - public URI URI { get; set; } - } - - public class BaudRate - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class LoginRequired - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Mode27 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class SerialPort - { - public BaudRate BaudRate { get; set; } - public LoginRequired LoginRequired { get; set; } - public Mode27 Mode { get; set; } - } - - public class BootAction - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Control - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Delay2 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class StandbyAction - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class WakeupAction - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Standby - { - public BootAction BootAction { get; set; } - public Control Control { get; set; } - public Delay2 Delay { get; set; } - public StandbyAction StandbyAction { get; set; } - public WakeupAction WakeupAction { get; set; } - } - - public class Name2 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class SystemUnit - { - public Name2 Name { get; set; } - } - - public class DateFormat - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class TimeFormat - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Zone - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Time - { - public DateFormat DateFormat { get; set; } - public TimeFormat TimeFormat { get; set; } - public Zone Zone { get; set; } - } - - public class Type2 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class ContactInfo - { - public Type2 Type { get; set; } - } - - public class Mode28 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class KeyTones - { - public Mode28 Mode { get; set; } - } - - public class Language - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Output2 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class OSD - { - public Output2 Output { get; set; } - } - - public class UserInterface - { - public ContactInfo ContactInfo { get; set; } - public KeyTones KeyTones { get; set; } - public Language Language { get; set; } - public OSD OSD { get; set; } - } - - public class Filter - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Group - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Admin - { - public Filter Filter { get; set; } - public Group Group { get; set; } - } - - public class Attribute - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class BaseDN - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Encryption3 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class MinimumTLSVersion2 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Mode29 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Address10 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Port - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Server6 - { - public Address10 Address { get; set; } - public Port Port { get; set; } - } - - public class VerifyServerCertificate2 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class LDAP - { - public Admin Admin { get; set; } - public Attribute Attribute { get; set; } - public BaseDN BaseDN { get; set; } - public Encryption3 Encryption { get; set; } - public MinimumTLSVersion2 MinimumTLSVersion { get; set; } - public Mode29 Mode { get; set; } - public Server6 Server { get; set; } - public VerifyServerCertificate2 VerifyServerCertificate { get; set; } - } - - public class UserManagement - { - public LDAP LDAP { get; set; } - } - - public class DefaultMainSource - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class CameraId - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Mode30 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class CameraControl - { - public CameraId CameraId { get; set; } - public Mode30 Mode { get; set; } - } - - public class InputSourceType - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Name3 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Visibility - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class PreferredResolution - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class PresentationSelection - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Quality - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Connector - { - public string id { get; set; } - public CameraControl CameraControl { get; set; } - public InputSourceType InputSourceType { get; set; } - public Name3 Name { get; set; } - public Visibility Visibility { get; set; } - public PreferredResolution PreferredResolution { get; set; } - public PresentationSelection PresentationSelection { get; set; } - public Quality Quality { get; set; } - } - - public class Input2 - { - public List Connector { get; set; } - } - - public class Monitors - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Mode31 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class CEC - { - public Mode31 Mode { get; set; } - } - - public class MonitorRole - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Resolution - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Connector2 - { - public string id { get; set; } - public CEC CEC { get; set; } - public MonitorRole MonitorRole { get; set; } - public Resolution Resolution { get; set; } - } - - public class Output3 - { - public List Connector { get; set; } - } - - public class DefaultSource - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Presentation - { - public DefaultSource DefaultSource { get; set; } - } - - public class FullscreenMode - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Mode32 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class OnMonitorRole - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class PIPPosition - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Default - { - public FullscreenMode FullscreenMode { get; set; } - public Mode32 Mode { get; set; } - public OnMonitorRole OnMonitorRole { get; set; } - public PIPPosition PIPPosition { get; set; } - } - - public class Duration - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class Mode33 - { - public string valueSpaceRef { get; set; } - public string Value { get; set; } - } - - public class OnCall - { - public Duration Duration { get; set; } - public Mode33 Mode { get; set; } - } - - public class Selfview - { - public Default Default { get; set; } - public OnCall OnCall { get; set; } - } - - public class Video2 - { - public DefaultMainSource DefaultMainSource { get; set; } - public Input2 Input { get; set; } - public Monitors Monitors { get; set; } - public Output3 Output { get; set; } - public Presentation Presentation { get; set; } - public Selfview Selfview { get; set; } - } - - public class Configuration - { - public Audio Audio { get; set; } - public Cameras Cameras { get; set; } - public Conference Conference { get; set; } - public H323 H323 { get; set; } - public List Network { get; set; } - public NetworkServices NetworkServices { get; set; } - public Peripherals Peripherals { get; set; } - public Phonebook Phonebook { get; set; } - public Provisioning Provisioning { get; set; } - public Proximity Proximity { get; set; } - public RoomAnalytics RoomAnalytics { get; set; } - public SIP2 SIP { get; set; } - public SerialPort SerialPort { get; set; } - public Standby Standby { get; set; } - public SystemUnit SystemUnit { get; set; } - public Time Time { get; set; } - public UserInterface UserInterface { get; set; } - public UserManagement UserManagement { get; set; } - public Video2 Video { get; set; } - } - - public class RootObject - { - public Configuration Configuration { get; set; } - } - } +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; + +namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco +{ + public class CiscoCodecConfiguration + { + public class DefaultVolume + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Mode + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Dereverberation + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Mode2 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class NoiseReduction + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class EchoControl + { + public Dereverberation Dereverberation { get; set; } + public Mode2 Mode { get; set; } + public NoiseReduction NoiseReduction { get; set; } + } + + public class Level + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Microphone + { + public string id { get; set; } + public Mode Mode { get; set; } + public EchoControl EchoControl { get; set; } + public Level Level { get; set; } + } + + public class Input + { + public List Microphone { get; set; } + } + + public class Enabled + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Mute + { + public Enabled Enabled { get; set; } + } + + public class Microphones + { + public Mute Mute { get; set; } + } + + public class Mode3 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class InternalSpeaker + { + public Mode3 Mode { get; set; } + } + + public class Mode4 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class OutputType + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Line + { + public string id { get; set; } + public Mode4 Mode { get; set; } + public OutputType OutputType { get; set; } + } + + public class Output + { + public InternalSpeaker InternalSpeaker { get; set; } + public List Line { get; set; } + } + + public class RingTone + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class RingVolume + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class SoundsAndAlerts + { + public RingTone RingTone { get; set; } + public RingVolume RingVolume { get; set; } + } + + public class Audio + { + public DefaultVolume DefaultVolume { get; set; } + public Input Input { get; set; } + public Microphones Microphones { get; set; } + public Output Output { get; set; } + public SoundsAndAlerts SoundsAndAlerts { get; set; } + } + + public class Framerate + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Camera + { + public Framerate Framerate { get; set; } + } + + public class Closeup + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Mode5 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class SpeakerTrack + { + public Closeup Closeup { get; set; } + public Mode5 Mode { get; set; } + } + + public class Cameras + { + public Camera Camera { get; set; } + public SpeakerTrack SpeakerTrack { get; set; } + } + + public class Delay + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Mode6 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Mute2 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class AutoAnswer + { + public Delay Delay { get; set; } + public Mode6 Mode { get; set; } + public Mute2 Mute { get; set; } + } + + public class Protocol + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Rate + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class DefaultCall + { + public Protocol Protocol { get; set; } + public Rate Rate { get; set; } + } + + public class DefaultTimeout + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class DoNotDisturb + { + public DefaultTimeout DefaultTimeout { get; set; } + } + + public class Mode7 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Encryption + { + public Mode7 Mode { get; set; } + } + + public class Mode8 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class FarEndControl + { + public Mode8 Mode { get; set; } + } + + public class MaxReceiveCallRate + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class MaxTotalReceiveCallRate + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class MaxTotalTransmitCallRate + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class MaxTransmitCallRate + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Mode9 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class MultiStream + { + public Mode9 Mode { get; set; } + } + + public class Conference + { + public AutoAnswer AutoAnswer { get; set; } + public DefaultCall DefaultCall { get; set; } + public DoNotDisturb DoNotDisturb { get; set; } + public Encryption Encryption { get; set; } + public FarEndControl FarEndControl { get; set; } + public MaxReceiveCallRate MaxReceiveCallRate { get; set; } + public MaxTotalReceiveCallRate MaxTotalReceiveCallRate { get; set; } + public MaxTotalTransmitCallRate MaxTotalTransmitCallRate { get; set; } + public MaxTransmitCallRate MaxTransmitCallRate { get; set; } + public MultiStream MultiStream { get; set; } + } + + public class LoginName + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Mode10 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Password + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Authentication + { + public LoginName LoginName { get; set; } + public Mode10 Mode { get; set; } + public Password Password { get; set; } + } + + public class Mode11 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class CallSetup + { + public Mode11 Mode { get; set; } + } + + public class KeySize + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Encryption2 + { + public KeySize KeySize { get; set; } + } + + public class Address + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Gatekeeper + { + public Address Address { get; set; } + } + + public class E164 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class ID + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class H323Alias + { + public E164 E164 { get; set; } + public ID ID { get; set; } + } + + public class Address2 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Mode12 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class NAT + { + public Address2 Address { get; set; } + public Mode12 Mode { get; set; } + } + + public class H323 + { + public Authentication Authentication { get; set; } + public CallSetup CallSetup { get; set; } + public Encryption2 Encryption { get; set; } + public Gatekeeper Gatekeeper { get; set; } + public H323Alias H323Alias { get; set; } + public NAT NAT { get; set; } + } + + public class Name + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Domain + { + public Name Name { get; set; } + } + + public class Address3 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Server + { + public string id { get; set; } + public Address3 Address { get; set; } + } + + public class DNS + { + public Domain Domain { get; set; } + public List Server { get; set; } + } + + public class AnonymousIdentity + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Md5 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Peap + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Tls + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Ttls + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Eap + { + public Md5 Md5 { get; set; } + public Peap Peap { get; set; } + public Tls Tls { get; set; } + public Ttls Ttls { get; set; } + } + + public class Identity + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Mode13 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Password2 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class TlsVerify + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class UseClientCertificate + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class IEEE8021X + { + public AnonymousIdentity AnonymousIdentity { get; set; } + public Eap Eap { get; set; } + public Identity Identity { get; set; } + public Mode13 Mode { get; set; } + public Password2 Password { get; set; } + public TlsVerify TlsVerify { get; set; } + public UseClientCertificate UseClientCertificate { get; set; } + } + + public class IPStack + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Address4 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Assignment + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Gateway + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class SubnetMask + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class IPv4 + { + public Address4 Address { get; set; } + public Assignment Assignment { get; set; } + public Gateway Gateway { get; set; } + public SubnetMask SubnetMask { get; set; } + } + + public class Address5 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Assignment2 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class DHCPOptions + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Gateway2 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class IPv6 + { + public Address5 Address { get; set; } + public Assignment2 Assignment { get; set; } + public DHCPOptions DHCPOptions { get; set; } + public Gateway2 Gateway { get; set; } + } + + public class MTU + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Audio2 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Data + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class ICMPv6 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class NTP + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Signalling + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Video + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Diffserv + { + public Audio2 Audio { get; set; } + public Data Data { get; set; } + public ICMPv6 ICMPv6 { get; set; } + public NTP NTP { get; set; } + public Signalling Signalling { get; set; } + public Video Video { get; set; } + } + + public class Mode14 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class QoS + { + public Diffserv Diffserv { get; set; } + public Mode14 Mode { get; set; } + } + + public class Allow + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class RemoteAccess + { + public Allow Allow { get; set; } + } + + public class Speed + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Mode15 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class VlanId + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Voice + { + public Mode15 Mode { get; set; } + public VlanId VlanId { get; set; } + } + + public class VLAN + { + public Voice Voice { get; set; } + } + + public class Network + { + public string id { get; set; } + public DNS DNS { get; set; } + public IEEE8021X IEEE8021X { get; set; } + public IPStack IPStack { get; set; } + public IPv4 IPv4 { get; set; } + public IPv6 IPv6 { get; set; } + public MTU MTU { get; set; } + public QoS QoS { get; set; } + public RemoteAccess RemoteAccess { get; set; } + public Speed Speed { get; set; } + public VLAN VLAN { get; set; } + } + + public class Mode16 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class CDP + { + public Mode16 Mode { get; set; } + } + + public class Mode17 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class H3232 + { + public Mode17 Mode { get; set; } + } + + public class Mode18 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class HTTP + { + public Mode18 Mode { get; set; } + } + + public class MinimumTLSVersion + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Server2 + { + public MinimumTLSVersion MinimumTLSVersion { get; set; } + } + + public class StrictTransportSecurity + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class VerifyClientCertificate + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class VerifyServerCertificate + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class HTTPS + { + public Server2 Server { get; set; } + public StrictTransportSecurity StrictTransportSecurity { get; set; } + public VerifyClientCertificate VerifyClientCertificate { get; set; } + public VerifyServerCertificate VerifyServerCertificate { get; set; } + } + + public class Mode19 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Address6 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Server3 + { + public string id { get; set; } + public Address6 Address { get; set; } + } + + public class NTP2 + { + public Mode19 Mode { get; set; } + public List Server { get; set; } + } + + public class Mode20 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class SIP + { + public Mode20 Mode { get; set; } + } + + public class CommunityName + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Address7 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Host + { + public string id { get; set; } + public Address7 Address { get; set; } + } + + public class Mode21 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class SystemContact + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class SystemLocation + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class SNMP + { + public CommunityName CommunityName { get; set; } + public List Host { get; set; } + public Mode21 Mode { get; set; } + public SystemContact SystemContact { get; set; } + public SystemLocation SystemLocation { get; set; } + } + + public class Mode22 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class SSH + { + public Mode22 Mode { get; set; } + } + + public class Mode23 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class UPnP + { + public Mode23 Mode { get; set; } + } + + public class WelcomeText + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class NetworkServices + { + public CDP CDP { get; set; } + public H3232 H323 { get; set; } + public HTTP HTTP { get; set; } + public HTTPS HTTPS { get; set; } + public NTP2 NTP { get; set; } + public SIP SIP { get; set; } + public SNMP SNMP { get; set; } + public SSH SSH { get; set; } + public UPnP UPnP { get; set; } + public WelcomeText WelcomeText { get; set; } + } + + public class Cameras2 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class ControlSystems + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class TouchPanels + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Profile + { + public Cameras2 Cameras { get; set; } + public ControlSystems ControlSystems { get; set; } + public TouchPanels TouchPanels { get; set; } + } + + public class Peripherals + { + public Profile Profile { get; set; } + } + + public class ID2 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Type + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class URL + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Server4 + { + public string id { get; set; } + public ID2 ID { get; set; } + public Type Type { get; set; } + public URL URL { get; set; } + } + + public class Phonebook + { + public List Server { get; set; } + } + + public class Connectivity + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Address8 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class AlternateAddress + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Domain2 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Path + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Protocol2 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class ExternalManager + { + public Address8 Address { get; set; } + public AlternateAddress AlternateAddress { get; set; } + public Domain2 Domain { get; set; } + public Path Path { get; set; } + public Protocol2 Protocol { get; set; } + } + + public class HttpMethod + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class LoginName2 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Mode24 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Password3 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Provisioning + { + public Connectivity Connectivity { get; set; } + public ExternalManager ExternalManager { get; set; } + public HttpMethod HttpMethod { get; set; } + public LoginName2 LoginName { get; set; } + public Mode24 Mode { get; set; } + public Password3 Password { get; set; } + } + + public class Mode25 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class CallControl + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class FromClients + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class ToClients + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class ContentShare + { + public FromClients FromClients { get; set; } + public ToClients ToClients { get; set; } + } + + public class Services + { + public CallControl CallControl { get; set; } + public ContentShare ContentShare { get; set; } + } + + public class Proximity + { + public Mode25 Mode { get; set; } + public Services Services { get; set; } + } + + public class PeopleCountOutOfCall + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class PeoplePresenceDetector + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class RoomAnalytics + { + public PeopleCountOutOfCall PeopleCountOutOfCall { get; set; } + public PeoplePresenceDetector PeoplePresenceDetector { get; set; } + } + + public class Password4 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class UserName + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Authentication2 + { + public Password4 Password { get; set; } + public UserName UserName { get; set; } + } + + public class DefaultTransport + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class DisplayName + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class DefaultCandidate + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Mode26 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Ice + { + public DefaultCandidate DefaultCandidate { get; set; } + public Mode26 Mode { get; set; } + } + + public class ListenPort + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Address9 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Proxy + { + public string id { get; set; } + public Address9 Address { get; set; } + } + + public class Password5 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Server5 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class UserName2 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Turn + { + public Password5 Password { get; set; } + public Server5 Server { get; set; } + public UserName2 UserName { get; set; } + } + + public class URI + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class SIP2 + { + public Authentication2 Authentication { get; set; } + public DefaultTransport DefaultTransport { get; set; } + public DisplayName DisplayName { get; set; } + public Ice Ice { get; set; } + public ListenPort ListenPort { get; set; } + public List Proxy { get; set; } + public Turn Turn { get; set; } + public URI URI { get; set; } + } + + public class BaudRate + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class LoginRequired + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Mode27 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class SerialPort + { + public BaudRate BaudRate { get; set; } + public LoginRequired LoginRequired { get; set; } + public Mode27 Mode { get; set; } + } + + public class BootAction + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Control + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Delay2 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class StandbyAction + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class WakeupAction + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Standby + { + public BootAction BootAction { get; set; } + public Control Control { get; set; } + public Delay2 Delay { get; set; } + public StandbyAction StandbyAction { get; set; } + public WakeupAction WakeupAction { get; set; } + } + + public class Name2 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class SystemUnit + { + public Name2 Name { get; set; } + } + + public class DateFormat + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class TimeFormat + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Zone + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Time + { + public DateFormat DateFormat { get; set; } + public TimeFormat TimeFormat { get; set; } + public Zone Zone { get; set; } + } + + public class Type2 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class ContactInfo + { + public Type2 Type { get; set; } + } + + public class Mode28 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class KeyTones + { + public Mode28 Mode { get; set; } + } + + public class Language + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Output2 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class OSD + { + public Output2 Output { get; set; } + } + + public class UserInterface + { + public ContactInfo ContactInfo { get; set; } + public KeyTones KeyTones { get; set; } + public Language Language { get; set; } + public OSD OSD { get; set; } + } + + public class Filter + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Group + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Admin + { + public Filter Filter { get; set; } + public Group Group { get; set; } + } + + public class Attribute + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class BaseDN + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Encryption3 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class MinimumTLSVersion2 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Mode29 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Address10 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Port + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Server6 + { + public Address10 Address { get; set; } + public Port Port { get; set; } + } + + public class VerifyServerCertificate2 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class LDAP + { + public Admin Admin { get; set; } + public Attribute Attribute { get; set; } + public BaseDN BaseDN { get; set; } + public Encryption3 Encryption { get; set; } + public MinimumTLSVersion2 MinimumTLSVersion { get; set; } + public Mode29 Mode { get; set; } + public Server6 Server { get; set; } + public VerifyServerCertificate2 VerifyServerCertificate { get; set; } + } + + public class UserManagement + { + public LDAP LDAP { get; set; } + } + + public class DefaultMainSource + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class CameraId + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Mode30 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class CameraControl + { + public CameraId CameraId { get; set; } + public Mode30 Mode { get; set; } + } + + public class InputSourceType + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Name3 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Visibility + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class PreferredResolution + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class PresentationSelection + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Quality + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Connector + { + public string id { get; set; } + public CameraControl CameraControl { get; set; } + public InputSourceType InputSourceType { get; set; } + public Name3 Name { get; set; } + public Visibility Visibility { get; set; } + public PreferredResolution PreferredResolution { get; set; } + public PresentationSelection PresentationSelection { get; set; } + public Quality Quality { get; set; } + } + + public class Input2 + { + public List Connector { get; set; } + } + + public class Monitors + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Mode31 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class CEC + { + public Mode31 Mode { get; set; } + } + + public class MonitorRole + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Resolution + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Connector2 + { + public string id { get; set; } + public CEC CEC { get; set; } + public MonitorRole MonitorRole { get; set; } + public Resolution Resolution { get; set; } + } + + public class Output3 + { + public List Connector { get; set; } + } + + public class DefaultSource + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Presentation + { + public DefaultSource DefaultSource { get; set; } + } + + public class FullscreenMode + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Mode32 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class OnMonitorRole + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class PIPPosition + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Default + { + public FullscreenMode FullscreenMode { get; set; } + public Mode32 Mode { get; set; } + public OnMonitorRole OnMonitorRole { get; set; } + public PIPPosition PIPPosition { get; set; } + } + + public class Duration + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class Mode33 + { + public string valueSpaceRef { get; set; } + public string Value { get; set; } + } + + public class OnCall + { + public Duration Duration { get; set; } + public Mode33 Mode { get; set; } + } + + public class Selfview + { + public Default Default { get; set; } + public OnCall OnCall { get; set; } + } + + public class Video2 + { + public DefaultMainSource DefaultMainSource { get; set; } + public Input2 Input { get; set; } + public Monitors Monitors { get; set; } + public Output3 Output { get; set; } + public Presentation Presentation { get; set; } + public Selfview Selfview { get; set; } + } + + public class Configuration + { + public Audio Audio { get; set; } + public Cameras Cameras { get; set; } + public Conference Conference { get; set; } + public H323 H323 { get; set; } + public List Network { get; set; } + public NetworkServices NetworkServices { get; set; } + public Peripherals Peripherals { get; set; } + public Phonebook Phonebook { get; set; } + public Provisioning Provisioning { get; set; } + public Proximity Proximity { get; set; } + public RoomAnalytics RoomAnalytics { get; set; } + public SIP2 SIP { get; set; } + public SerialPort SerialPort { get; set; } + public Standby Standby { get; set; } + public SystemUnit SystemUnit { get; set; } + public Time Time { get; set; } + public UserInterface UserInterface { get; set; } + public UserManagement UserManagement { get; set; } + public Video2 Video { get; set; } + } + + public class RootObject + { + public Configuration Configuration { get; set; } + } + } } \ No newline at end of file diff --git a/Essentials Devices Common/Essentials Devices Common/VC/CiscoCodec/xEvent.cs b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/xEvent.cs similarity index 96% rename from Essentials Devices Common/Essentials Devices Common/VC/CiscoCodec/xEvent.cs rename to Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/xEvent.cs index 5df6faf8..d66974b5 100644 --- a/Essentials Devices Common/Essentials Devices Common/VC/CiscoCodec/xEvent.cs +++ b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/xEvent.cs @@ -1,138 +1,138 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Crestron.SimplSharp; - -namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco -{ - public class CiscoCodecEvents - { - public class CauseValue - { - public string id { get; set; } - public string Value { get; set; } - } - - public class CauseType - { - public string id { get; set; } - public string Value { get; set; } - } - - public class CauseString - { - public string id { get; set; } - public string Value { get; set; } - } - - public class OrigCallDirection - { - public string id { get; set; } - public string Value { get; set; } - } - - public class RemoteURI - { - public string id { get; set; } - public string Value { get; set; } - } - - public class DisplayName - { - public string id { get; set; } - public string Value { get; set; } - } - - public class CallId - { - public string id { get; set; } - public string Value { get; set; } - } - - public class CauseCode - { - public string id { get; set; } - public string Value { get; set; } - } - - public class CauseOrigin - { - public string id { get; set; } - public string Value { get; set; } - } - - public class Protocol - { - public string id { get; set; } - public string Value { get; set; } - } - - public class Duration - { - public string id { get; set; } - public string Value { get; set; } - } - - public class CallType - { - public string id { get; set; } - public string Value { get; set; } - } - - public class CallRate - { - public string id { get; set; } - public string Value { get; set; } - } - - public class Encryption - { - public string id { get; set; } - public string Value { get; set; } - } - - public class RequestedURI - { - public string id { get; set; } - public string Value { get; set; } - } - - public class PeopleCountAverage - { - public string id { get; set; } - public string Value { get; set; } - } - - public class CallDisconnect - { - public string id { get; set; } - public CauseValue CauseValue { get; set; } - public CauseType CauseType { get; set; } - public CauseString CauseString { get; set; } - public OrigCallDirection OrigCallDirection { get; set; } - public RemoteURI RemoteURI { get; set; } - public DisplayName DisplayName { get; set; } - public CallId CallId { get; set; } - public CauseCode CauseCode { get; set; } - public CauseOrigin CauseOrigin { get; set; } - public Protocol Protocol { get; set; } - public Duration Duration { get; set; } - public CallType CallType { get; set; } - public CallRate CallRate { get; set; } - public Encryption Encryption { get; set; } - public RequestedURI RequestedURI { get; set; } - public PeopleCountAverage PeopleCountAverage { get; set; } - } - - public class Event - { - public CallDisconnect CallDisconnect { get; set; } - } - - public class RootObject - { - public Event Event { get; set; } - } - } +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; + +namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco +{ + public class CiscoCodecEvents + { + public class CauseValue + { + public string id { get; set; } + public string Value { get; set; } + } + + public class CauseType + { + public string id { get; set; } + public string Value { get; set; } + } + + public class CauseString + { + public string id { get; set; } + public string Value { get; set; } + } + + public class OrigCallDirection + { + public string id { get; set; } + public string Value { get; set; } + } + + public class RemoteURI + { + public string id { get; set; } + public string Value { get; set; } + } + + public class DisplayName + { + public string id { get; set; } + public string Value { get; set; } + } + + public class CallId + { + public string id { get; set; } + public string Value { get; set; } + } + + public class CauseCode + { + public string id { get; set; } + public string Value { get; set; } + } + + public class CauseOrigin + { + public string id { get; set; } + public string Value { get; set; } + } + + public class Protocol + { + public string id { get; set; } + public string Value { get; set; } + } + + public class Duration + { + public string id { get; set; } + public string Value { get; set; } + } + + public class CallType + { + public string id { get; set; } + public string Value { get; set; } + } + + public class CallRate + { + public string id { get; set; } + public string Value { get; set; } + } + + public class Encryption + { + public string id { get; set; } + public string Value { get; set; } + } + + public class RequestedURI + { + public string id { get; set; } + public string Value { get; set; } + } + + public class PeopleCountAverage + { + public string id { get; set; } + public string Value { get; set; } + } + + public class CallDisconnect + { + public string id { get; set; } + public CauseValue CauseValue { get; set; } + public CauseType CauseType { get; set; } + public CauseString CauseString { get; set; } + public OrigCallDirection OrigCallDirection { get; set; } + public RemoteURI RemoteURI { get; set; } + public DisplayName DisplayName { get; set; } + public CallId CallId { get; set; } + public CauseCode CauseCode { get; set; } + public CauseOrigin CauseOrigin { get; set; } + public Protocol Protocol { get; set; } + public Duration Duration { get; set; } + public CallType CallType { get; set; } + public CallRate CallRate { get; set; } + public Encryption Encryption { get; set; } + public RequestedURI RequestedURI { get; set; } + public PeopleCountAverage PeopleCountAverage { get; set; } + } + + public class Event + { + public CallDisconnect CallDisconnect { get; set; } + } + + public class RootObject + { + public Event Event { get; set; } + } + } } \ No newline at end of file diff --git a/Essentials Devices Common/Essentials Devices Common/VC/CiscoCodec/xStatus.cs b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/xStatus.cs similarity index 96% rename from Essentials Devices Common/Essentials Devices Common/VC/CiscoCodec/xStatus.cs rename to Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/xStatus.cs index 35fa2a77..d376dfed 100644 --- a/Essentials Devices Common/Essentials Devices Common/VC/CiscoCodec/xStatus.cs +++ b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/xStatus.cs @@ -1,1635 +1,1635 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Crestron.SimplSharp; -using Crestron.SimplSharp.CrestronXml.Serialization; - -namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco -{ - public class CiscoCodecStatus - { - // Helper Classes for Proerties - public abstract class ValueProperty - { - /// - /// Triggered when Value is set - /// - public Action ValueChangedAction { get; set; } - - protected void OnValueChanged() - { - var a = ValueChangedAction; - if (a != null) - a(); - } - - } - - public class ConnectionStatus - { - public string Value { get; set; } - } - - public class Microphone - { - public string id { get; set; } - public ConnectionStatus ConnectionStatus { get; set; } - } - - public class Connectors - { - public List Microphone { get; set; } - } - - public class Input - { - public Connectors Connectors { get; set; } - } - - public class Mute : ValueProperty - { - public bool BoolValue { get; private set; } - - public string Value - { - set - { - // If the incoming value is "On" it sets the BoolValue true, otherwise sets it false - BoolValue = value == "On"; - OnValueChanged(); - } - } - } - - public class Microphones - { - public Mute Mute { get; set; } - } - - public class ConnectionStatus2 - { - public string Value { get; set; } - } - - public class DelayMs - { - public string Value { get; set; } - } - - public class Line - { - public string id { get; set; } - public ConnectionStatus2 ConnectionStatus { get; set; } - public DelayMs DelayMs { get; set; } - } - - public class Connectors2 - { - public List Line { get; set; } - } - - public class Output - { - public Connectors2 Connectors { get; set; } - } - - public class Volume : ValueProperty - { - string _Value; - - /// - /// Sets Value and triggers the action when set - /// - public string Value - { - get - { - return _Value; - } - set - { - _Value = value; - OnValueChanged(); - } - } - - /// - /// Converted value of _Value for use as feedback - /// - public int IntValue - { - get - { - if (!string.IsNullOrEmpty(_Value)) - return Convert.ToInt32(_Value); - else - return 0; - } - } - } - - public class VolumeMute : ValueProperty - { - public bool BoolValue { get; private set; } - - public string Value - { - set - { - // If the incoming value is "On" it sets the BoolValue true, otherwise sets it false - BoolValue = value == "On"; - OnValueChanged(); - } - } - } - - public class Audio - { - public Input Input { get; set; } - public Microphones Microphones { get; set; } // Can we have this setter fire the update on the CiscoCodec feedback? - public Output Output { get; set; } - public Volume Volume { get; set; } - public VolumeMute VolumeMute { get; set; } - - public Audio() - { - Volume = new Volume(); - } - } - - public class Id - { - public string Value { get; set; } - } - - public class Current - { - public Id Id { get; set; } - } - - public class Bookings - { - public Current Current { get; set; } - } - - public class Options - { - public string Value { get; set; } - } - - public class Capabilities - { - public Options Options { get; set; } - } - - public class Connected - { - public string Value { get; set; } - } - - public class Framerate - { - public string Value { get; set; } - } - - public class Manufacturer - { - public string Value { get; set; } - } - - public class Model - { - public string Value { get; set; } - } - - public class Pan - { - public string Value { get; set; } - } - - public class Tilt - { - public string Value { get; set; } - } - - public class Zoom - { - public string Value { get; set; } - } - - public class Position - { - public Pan Pan { get; set; } - public Tilt Tilt { get; set; } - public Zoom Zoom { get; set; } - } - - public class Camera - { - public string id { get; set; } - public Capabilities Capabilities { get; set; } - public Connected Connected { get; set; } - public Framerate Framerate { get; set; } - public Manufacturer Manufacturer { get; set; } - public Model Model { get; set; } - public Position Position { get; set; } - } - - public class Availability - { - public string Value { get; set; } - } - - public class Status2 - { - public string Value { get; set; } - } - - public class SpeakerTrack - { - public Availability Availability { get; set; } - public Status2 Status { get; set; } - } - - public class Cameras - { - public List Camera { get; set; } - public SpeakerTrack SpeakerTrack { get; set; } - } - - public class MaxActiveCalls - { - public string Value { get; set; } - } - - public class MaxAudioCalls - { - public string Value { get; set; } - } - - public class MaxCalls - { - public string Value { get; set; } - } - - public class MaxVideoCalls - { - public string Value { get; set; } - } - - public class Conference - { - public MaxActiveCalls MaxActiveCalls { get; set; } - public MaxAudioCalls MaxAudioCalls { get; set; } - public MaxCalls MaxCalls { get; set; } - public MaxVideoCalls MaxVideoCalls { get; set; } - } - - public class Capabilities2 - { - public Conference Conference { get; set; } - } - - public class CallId - { - public string Value { get; set; } - } - - public class ActiveSpeaker - { - public CallId CallId { get; set; } - } - - public class DoNotDisturb - { - public string Value { get; set; } - } - - public class Mode - { - public string Value { get; set; } - } - - public class Multipoint - { - public Mode Mode { get; set; } - } - - public class CallId2 - { - public string Value { get; set; } - } - - public class Mode2 - { - public string Value { get; set; } - } - - public class Mode3 - { - public string Value { get; set; } - } - - public class ReleaseFloorAvailability - { - public string Value { get; set; } - } - - public class RequestFloorAvailability - { - public string Value { get; set; } - } - - public class Whiteboard - { - public Mode3 Mode { get; set; } - public ReleaseFloorAvailability ReleaseFloorAvailability { get; set; } - public RequestFloorAvailability RequestFloorAvailability { get; set; } - } - - public class Presentation - { - public CallId2 CallId { get; set; } - public Mode2 Mode { get; set; } - public Whiteboard Whiteboard { get; set; } - } - - public class CallId3 - { - public string Value { get; set; } - } - - public class Mode4 - { - public string Value { get; set; } - } - - public class SpeakerLock - { - public CallId3 CallId { get; set; } - public Mode4 Mode { get; set; } - } - - public class Conference2 - { - public ActiveSpeaker ActiveSpeaker { get; set; } - public DoNotDisturb DoNotDisturb { get; set; } - public Multipoint Multipoint { get; set; } - public Presentation Presentation { get; set; } - public SpeakerLock SpeakerLock { get; set; } - } - - public class Description - { - public string Value { get; set; } - } - - public class Level - { - public string Value { get; set; } - } - - public class References - { - public string Value { get; set; } - } - - public class Type - { - public string Value { get; set; } - } - - public class Message - { - public string id { get; set; } - public Description Description { get; set; } - public Level Level { get; set; } - public References References { get; set; } - public Type Type { get; set; } - } - - public class Diagnostics - { - public List Message { get; set; } - } - - public class Conference3 - { - } - - public class Experimental - { - public Conference3 Conference { get; set; } - } - - public class Address - { - public string Value { get; set; } - } - - public class Port - { - public string Value { get; set; } - } - - public class Reason - { - public string Value { get; set; } - } - - public class Status3 - { - public string Value { get; set; } - } - - public class Gatekeeper - { - public Address Address { get; set; } - public Port Port { get; set; } - public Reason Reason { get; set; } - public Status3 Status { get; set; } - } - - public class Reason2 - { - public string Value { get; set; } - } - - public class Status4 - { - public string Value { get; set; } - } - - public class Mode5 - { - public Reason2 Reason { get; set; } - public Status4 Status { get; set; } - } - - public class H323 - { - public Gatekeeper Gatekeeper { get; set; } - public Mode5 Mode { get; set; } - } - - public class Expression - { - public string id { get; set; } - public string Value { get; set; } - } - - public class Format - { - public string Value { get; set; } - } - - public class URL - { - public string Value { get; set; } - } - - public class HttpFeedback - { - public string id { get; set; } - public List Expression { get; set; } - public Format Format { get; set; } - public URL URL { get; set; } - } - - public class MediaChannels - { - } - - public class Address2 - { - public string Value { get; set; } - } - - public class Capabilities3 - { - public string Value { get; set; } - } - - public class DeviceId - { - public string Value { get; set; } - } - - public class Duplex - { - public string Value { get; set; } - } - - public class Platform - { - public string Value { get; set; } - } - - public class PortID - { - public string Value { get; set; } - } - - public class PrimaryMgmtAddress - { - public string Value { get; set; } - } - - public class SysName - { - public string Value { get; set; } - } - - public class SysObjectID - { - public string Value { get; set; } - } - - public class VTPMgmtDomain - { - public string Value { get; set; } - } - - public class Version - { - public string Value { get; set; } - } - - public class VoIPApplianceVlanID - { - public string Value { get; set; } - } - - public class CDP - { - public Address2 Address { get; set; } - public Capabilities3 Capabilities { get; set; } - public DeviceId DeviceId { get; set; } - public Duplex Duplex { get; set; } - public Platform Platform { get; set; } - public PortID PortID { get; set; } - public PrimaryMgmtAddress PrimaryMgmtAddress { get; set; } - public SysName SysName { get; set; } - public SysObjectID SysObjectID { get; set; } - public VTPMgmtDomain VTPMgmtDomain { get; set; } - public Version Version { get; set; } - public VoIPApplianceVlanID VoIPApplianceVlanID { get; set; } - } - - public class Name - { - public string Value { get; set; } - } - - public class Domain - { - public Name Name { get; set; } - } - - public class Address3 - { - public string Value { get; set; } - } - - public class Server - { - public string id { get; set; } - public Address3 Address { get; set; } - } - - public class DNS - { - public Domain Domain { get; set; } - public List Server { get; set; } - } - - public class MacAddress - { - public string Value { get; set; } - } - - public class Speed - { - public string Value { get; set; } - } - - public class Ethernet - { - public MacAddress MacAddress { get; set; } - public Speed Speed { get; set; } - } - - public class Address4 - { - public string Value { get; set; } - } - - public class Gateway - { - public string Value { get; set; } - } - - public class SubnetMask - { - public string Value { get; set; } - } - - public class IPv4 - { - public Address4 Address { get; set; } - public Gateway Gateway { get; set; } - public SubnetMask SubnetMask { get; set; } - } - - public class Address5 - { - public string Value { get; set; } - } - - public class Gateway2 - { - public string Value { get; set; } - } - - public class IPv6 - { - public Address5 Address { get; set; } - public Gateway2 Gateway { get; set; } - } - - public class VlanId - { - public string Value { get; set; } - } - - public class Voice - { - public VlanId VlanId { get; set; } - } - - public class VLAN - { - public Voice Voice { get; set; } - } - - public class Network - { - public string id { get; set; } - public CDP CDP { get; set; } - public DNS DNS { get; set; } - public Ethernet Ethernet { get; set; } - public IPv4 IPv4 { get; set; } - public IPv6 IPv6 { get; set; } - public VLAN VLAN { get; set; } - } - - public class CurrentAddress - { - public string Value { get; set; } - } - - public class Address6 - { - public string Value { get; set; } - } - - public class Server2 - { - public string id { get; set; } - public Address6 Address { get; set; } - } - - public class Status5 - { - public string Value { get; set; } - } - - public class NTP - { - public CurrentAddress CurrentAddress { get; set; } - public List Server { get; set; } - public Status5 Status { get; set; } - } - - public class NetworkServices - { - public NTP NTP { get; set; } - } - - public class HardwareInfo - { - public string Value { get; set; } - } - - public class ID2 - { - public string Value { get; set; } - } - - public class Name2 - { - public string Value { get; set; } - } - - public class SoftwareInfo - { - public string Value { get; set; } - } - - public class Status6 - { - public string Value { get; set; } - } - - public class Type2 - { - public string Value { get; set; } - } - - public class UpgradeStatus - { - public string Value { get; set; } - } - - public class ConnectedDevice - { - public string id { get; set; } - public HardwareInfo HardwareInfo { get; set; } - public ID2 ID { get; set; } - public Name2 Name { get; set; } - public SoftwareInfo SoftwareInfo { get; set; } - public Status6 Status { get; set; } - public Type2 Type { get; set; } - public UpgradeStatus UpgradeStatus { get; set; } - } - - public class Peripherals - { - public List ConnectedDevice { get; set; } - } - - public class Enabled - { - public string Value { get; set; } - } - - public class LastLoggedInUserId - { - public string Value { get; set; } - } - - public class LoggedIn - { - public string Value { get; set; } - } - - public class ExtensionMobility - { - public Enabled Enabled { get; set; } - public LastLoggedInUserId LastLoggedInUserId { get; set; } - public LoggedIn LoggedIn { get; set; } - } - - public class CUCM - { - public ExtensionMobility ExtensionMobility { get; set; } - } - - public class CompletedAt - { - public string Value { get; set; } - } - - public class URL2 - { - public string Value { get; set; } - } - - public class VersionId - { - public string Value { get; set; } - } - - public class Current2 - { - public CompletedAt CompletedAt { get; set; } - public URL2 URL { get; set; } - public VersionId VersionId { get; set; } - } - - public class LastChange - { - public string Value { get; set; } - } - - public class Message2 - { - public string Value { get; set; } - } - - public class Phase - { - public string Value { get; set; } - } - - public class SessionId - { - public string Value { get; set; } - } - - public class Status7 - { - public string Value { get; set; } - } - - public class URL3 - { - public string Value { get; set; } - } - - public class VersionId2 - { - public string Value { get; set; } - } - - public class UpgradeStatus2 - { - public LastChange LastChange { get; set; } - public Message2 Message { get; set; } - public Phase Phase { get; set; } - public SessionId SessionId { get; set; } - public Status7 Status { get; set; } - public URL3 URL { get; set; } - public VersionId2 VersionId { get; set; } - } - - public class Software - { - public Current2 Current { get; set; } - public UpgradeStatus2 UpgradeStatus { get; set; } - } - - public class Status8 - { - public string Value { get; set; } - } - - public class Provisioning - { - public CUCM CUCM { get; set; } - public Software Software { get; set; } - public Status8 Status { get; set; } - } - - public class Availability2 - { - public string Value { get; set; } - } - - public class Services - { - public Availability2 Availability { get; set; } - } - - public class Proximity - { - public Services Services { get; set; } - } - - public class Current3 - { - public string Value { get; set; } - } - - public class PeopleCount - { - public Current3 Current { get; set; } - } - - public class PeoplePresence - { - public string Value { get; set; } - } - - public class RoomAnalytics - { - public PeopleCount PeopleCount { get; set; } - public PeoplePresence PeoplePresence { get; set; } - } - - public class Authentication - { - public string Value { get; set; } - } - - public class DisplayName - { - public string Value { get; set; } - } - - public class Mode6 - { - public string Value { get; set; } - } - - public class URI - { - public string Value { get; set; } - } - - public class CallForward - { - public DisplayName DisplayName { get; set; } - public Mode6 Mode { get; set; } - public URI URI { get; set; } - } - - public class MessagesWaiting - { - public string Value { get; set; } - } - - public class URI2 - { - public string Value { get; set; } - } - - public class Mailbox - { - public MessagesWaiting MessagesWaiting { get; set; } - public URI2 URI { get; set; } - } - - public class Address7 - { - public string Value { get; set; } - } - - public class Status9 - { - public string Value { get; set; } - } - - public class Proxy - { - public string id { get; set; } - public Address7 Address { get; set; } - public Status9 Status { get; set; } - } - - public class Reason3 - { - public string Value { get; set; } - } - - public class Status10 - { - public string Value { get; set; } - } - - public class URI3 - { - public string Value { get; set; } - } - - public class Registration - { - public string id { get; set; } - public Reason3 Reason { get; set; } - public Status10 Status { get; set; } - public URI3 URI { get; set; } - } - - public class Secure - { - public string Value { get; set; } - } - - public class Verified - { - public string Value { get; set; } - } - - public class SIP - { - public Authentication Authentication { get; set; } - public CallForward CallForward { get; set; } - public Mailbox Mailbox { get; set; } - public List Proxy { get; set; } - public List Registration { get; set; } - public Secure Secure { get; set; } - public Verified Verified { get; set; } - } - - public class Mode7 - { - public string Value { get; set; } - } - - public class FIPS - { - public Mode7 Mode { get; set; } - } - - public class CallHistory - { - public string Value { get; set; } - } - - public class Configurations - { - public string Value { get; set; } - } - - public class DHCP - { - public string Value { get; set; } - } - - public class InternalLogging - { - public string Value { get; set; } - } - - public class LocalPhonebook - { - public string Value { get; set; } - } - - public class Persistency - { - public CallHistory CallHistory { get; set; } - public Configurations Configurations { get; set; } - public DHCP DHCP { get; set; } - public InternalLogging InternalLogging { get; set; } - public LocalPhonebook LocalPhonebook { get; set; } - } - - public class Security - { - public FIPS FIPS { get; set; } - public Persistency Persistency { get; set; } - } - - public class State : ValueProperty - { - public bool BoolValue { get; private set; } - - public string Value // Valid values are Standby/EnteringStandby/Halfwake/Off - { - set - { - // If the incoming value is "Of" it sets the BoolValue true, otherwise sets it false - BoolValue = value == "Off"; - OnValueChanged(); - } - } - } - - public class Standby - { - public State State { get; set; } - - public Standby() - { - State = new State(); - } - } - - public class CompatibilityLevel - { - public string Value { get; set; } - } - - public class SerialNumber - { - public string Value { get; set; } - } - - public class Module - { - public CompatibilityLevel CompatibilityLevel { get; set; } - public SerialNumber SerialNumber { get; set; } - } - - public class Hardware - { - public Module Module { get; set; } - } - - public class ProductId - { - public string Value { get; set; } - } - - public class ProductPlatform - { - public string Value { get; set; } - } - - public class ProductType - { - public string Value { get; set; } - } - - public class DisplayName2 - { - public string Value { get; set; } - } - - public class Name3 - { - public string Value { get; set; } - } - - public class Encryption - { - public string Value { get; set; } - } - - public class MultiSite - { - public string Value { get; set; } - } - - public class RemoteMonitoring - { - public string Value { get; set; } - } - - public class OptionKeys - { - public Encryption Encryption { get; set; } - public MultiSite MultiSite { get; set; } - public RemoteMonitoring RemoteMonitoring { get; set; } - } - - public class ReleaseDate - { - public string Value { get; set; } - } - - public class Version2 - { - public string Value { get; set; } - } - - public class Software2 - { - public DisplayName2 DisplayName { get; set; } - public Name3 Name { get; set; } - public OptionKeys OptionKeys { get; set; } - public ReleaseDate ReleaseDate { get; set; } - public Version2 Version { get; set; } - } - - public class NumberOfActiveCalls - { - public string Value { get; set; } - } - - public class NumberOfInProgressCalls - { - public string Value { get; set; } - } - - public class NumberOfSuspendedCalls - { - public string Value { get; set; } - } - - public class State2 - { - public NumberOfActiveCalls NumberOfActiveCalls { get; set; } - public NumberOfInProgressCalls NumberOfInProgressCalls { get; set; } - public NumberOfSuspendedCalls NumberOfSuspendedCalls { get; set; } - } - - public class Uptime - { - public string Value { get; set; } - } - - public class SystemUnit - { - public Hardware Hardware { get; set; } - public ProductId ProductId { get; set; } - public ProductPlatform ProductPlatform { get; set; } - public ProductType ProductType { get; set; } - public Software2 Software { get; set; } - public State2 State { get; set; } - public Uptime Uptime { get; set; } - } - - public class SystemTime - { - public DateTime Value { get; set; } - } - - public class Time - { - public SystemTime SystemTime { get; set; } - } - - public class Number - { - public string Value { get; set; } - } - - public class ContactMethod - { - public string id { get; set; } - public Number Number { get; set; } - } - - public class Name4 - { - public string Value { get; set; } - } - - public class ContactInfo - { - public List ContactMethod { get; set; } - public Name4 Name { get; set; } - } - - public class UserInterface - { - public ContactInfo ContactInfo { get; set; } - } - - public class PIPPosition - { - public string Value { get; set; } - } - - public class ActiveSpeaker2 - { - public PIPPosition PIPPosition { get; set; } - } - - public class Connected2 - { - public string Value { get; set; } - } - - public class SignalState - { - public string Value { get; set; } - } - - public class SourceId - { - public string Value { get; set; } - } - - public class Type3 - { - public string Value { get; set; } - } - - public class Connector - { - public string id { get; set; } - public Connected2 Connected { get; set; } - public SignalState SignalState { get; set; } - public SourceId SourceId { get; set; } - public Type3 Type { get; set; } - } - - public class MainVideoSource - { - public string Value { get; set; } - } - - public class ConnectorId - { - public string Value { get; set; } - } - - public class FormatStatus - { - public string Value { get; set; } - } - - public class FormatType - { - public string Value { get; set; } - } - - public class MediaChannelId - { - public string Value { get; set; } - } - - public class Height - { - public string Value { get; set; } - } - - public class RefreshRate - { - public string Value { get; set; } - } - - public class Width - { - public string Value { get; set; } - } - - public class Resolution - { - public Height Height { get; set; } - public RefreshRate RefreshRate { get; set; } - public Width Width { get; set; } - } - - public class Source - { - public string id { get; set; } - public ConnectorId ConnectorId { get; set; } - public FormatStatus FormatStatus { get; set; } - public FormatType FormatType { get; set; } - public MediaChannelId MediaChannelId { get; set; } - public Resolution Resolution { get; set; } - } - - public class Input2 - { - public List Connector { get; set; } - public MainVideoSource MainVideoSource { get; set; } - public List Source { get; set; } - } - - public class Local - { - public string Value { get; set; } - } - - public class LayoutFamily - { - public Local Local { get; set; } - } - - public class Layout - { - public LayoutFamily LayoutFamily { get; set; } - } - - public class Monitors - { - public string Value { get; set; } - } - - public class Connected3 - { - public string Value { get; set; } - } - - public class Name5 - { - public string Value { get; set; } - } - - public class PreferredFormat - { - public string Value { get; set; } - } - - public class ConnectedDevice2 - { - public Name5 Name { get; set; } - public PreferredFormat PreferredFormat { get; set; } - } - - public class MonitorRole - { - public string Value { get; set; } - } - - public class Height2 - { - public string Value { get; set; } - } - - public class RefreshRate2 - { - public string Value { get; set; } - } - - public class Width2 - { - public string Value { get; set; } - } - - public class Resolution2 - { - public Height2 Height { get; set; } - public RefreshRate2 RefreshRate { get; set; } - public Width2 Width { get; set; } - } - - public class Type4 - { - public string Value { get; set; } - } - - public class Connector2 - { - public string id { get; set; } - public Connected3 Connected { get; set; } - public ConnectedDevice2 ConnectedDevice { get; set; } - public MonitorRole MonitorRole { get; set; } - public Resolution2 Resolution { get; set; } - public Type4 Type { get; set; } - } - - public class Output2 - { - public List Connector { get; set; } - } - - public class PIPPosition2 - { - public string Value { get; set; } - } - - public class Presentation2 - { - public PIPPosition2 PIPPosition { get; set; } - } - - public class FullscreenMode - { - public string Value { get; set; } - } - - public class Mode8 - { - public string Value { get; set; } - } - - public class OnMonitorRole - { - public string Value { get; set; } - } - - public class PIPPosition3 - { - public string Value { get; set; } - } - - public class Selfview - { - public FullscreenMode FullscreenMode { get; set; } - public Mode8 Mode { get; set; } - public OnMonitorRole OnMonitorRole { get; set; } - public PIPPosition3 PIPPosition { get; set; } - } - - public class Video - { - public ActiveSpeaker2 ActiveSpeaker { get; set; } - public Input2 Input { get; set; } - public Layout Layout { get; set; } - public Monitors Monitors { get; set; } - public Output2 Output { get; set; } - public Presentation2 Presentation { get; set; } - public Selfview Selfview { get; set; } - } - - public class AnswerState - { - public string Value { get; set; } - } - - public class CallType - { - public string Value { get; set; } - } - - public class CallbackNumber - { - public string Value { get; set; } - } - - public class DeviceType - { - public string Value { get; set; } - } - - public class Direction - { - public string Value { get; set; } - } - - public class Duration - { - public string Value { get; set; } - } - - - public class FacilityServiceId - { - public string Value { get; set; } - } - - public class HoldReason - { - public string Value { get; set; } - } - - public class PlacedOnHold - { - public string Value { get; set; } - } - - public class Protocol - { - public string Value { get; set; } - } - - public class ReceiveCallRate - { - public string Value { get; set; } - } - - public class RemoteNumber - { - public string Value { get; set; } - } - - public class TransmitCallRate - { - public string Value { get; set; } - } - - public class Call - { - public string id { get; set; } - public AnswerState AnswerState { get; set; } - public CallType CallType { get; set; } - public CallbackNumber CallbackNumber { get; set; } - public DeviceType DeviceType { get; set; } - public Direction Direction { get; set; } - public DisplayName DisplayName { get; set; } - public Duration Duration { get; set; } - public Encryption Encryption { get; set; } - public FacilityServiceId FacilityServiceId { get; set; } - public HoldReason HoldReason { get; set; } - public PlacedOnHold PlacedOnHold { get; set; } - public Protocol Protocol { get; set; } - public ReceiveCallRate ReceiveCallRate { get; set; } - public RemoteNumber RemoteNumber { get; set; } - public Status2 Status { get; set; } - public TransmitCallRate TransmitCallRate { get; set; } - } - - public class Status - { - public Audio Audio { get; set; } - public Bookings Bookings { get; set; } - public List Call { get; set; } - public Cameras Cameras { get; set; } - public Capabilities2 Capabilities { get; set; } - public Conference2 Conference { get; set; } - public Diagnostics Diagnostics { get; set; } - public Experimental Experimental { get; set; } - public H323 H323 { get; set; } - public List HttpFeedback { get; set; } - public MediaChannels MediaChannels { get; set; } - public List Network { get; set; } - public NetworkServices NetworkServices { get; set; } - public Peripherals Peripherals { get; set; } - public Provisioning Provisioning { get; set; } - public Proximity Proximity { get; set; } - public RoomAnalytics RoomAnalytics { get; set; } - public SIP SIP { get; set; } - public Security Security { get; set; } - public Standby Standby { get; set; } - public SystemUnit SystemUnit { get; set; } - public Time Time { get; set; } - public UserInterface UserInterface { get; set; } - public Video Video { get; set; } - - public Status() - { - Audio = new Audio(); - Call = new List(); - Standby = new Standby(); - } -#warning Figure out how to flag codec as InCall if Call.Count > 0 - } - - public class RootObject - { - public Status Status { get; set; } - - public RootObject() - { - Status = new Status(); - } - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; +using Crestron.SimplSharp.CrestronXml.Serialization; + +namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco +{ + public class CiscoCodecStatus + { + // Helper Classes for Proerties + public abstract class ValueProperty + { + /// + /// Triggered when Value is set + /// + public Action ValueChangedAction { get; set; } + + protected void OnValueChanged() + { + var a = ValueChangedAction; + if (a != null) + a(); + } + + } + + public class ConnectionStatus + { + public string Value { get; set; } + } + + public class Microphone + { + public string id { get; set; } + public ConnectionStatus ConnectionStatus { get; set; } + } + + public class Connectors + { + public List Microphone { get; set; } + } + + public class Input + { + public Connectors Connectors { get; set; } + } + + public class Mute : ValueProperty + { + public bool BoolValue { get; private set; } + + public string Value + { + set + { + // If the incoming value is "On" it sets the BoolValue true, otherwise sets it false + BoolValue = value == "On"; + OnValueChanged(); + } + } + } + + public class Microphones + { + public Mute Mute { get; set; } + } + + public class ConnectionStatus2 + { + public string Value { get; set; } + } + + public class DelayMs + { + public string Value { get; set; } + } + + public class Line + { + public string id { get; set; } + public ConnectionStatus2 ConnectionStatus { get; set; } + public DelayMs DelayMs { get; set; } + } + + public class Connectors2 + { + public List Line { get; set; } + } + + public class Output + { + public Connectors2 Connectors { get; set; } + } + + public class Volume : ValueProperty + { + string _Value; + + /// + /// Sets Value and triggers the action when set + /// + public string Value + { + get + { + return _Value; + } + set + { + _Value = value; + OnValueChanged(); + } + } + + /// + /// Converted value of _Value for use as feedback + /// + public int IntValue + { + get + { + if (!string.IsNullOrEmpty(_Value)) + return Convert.ToInt32(_Value); + else + return 0; + } + } + } + + public class VolumeMute : ValueProperty + { + public bool BoolValue { get; private set; } + + public string Value + { + set + { + // If the incoming value is "On" it sets the BoolValue true, otherwise sets it false + BoolValue = value == "On"; + OnValueChanged(); + } + } + } + + public class Audio + { + public Input Input { get; set; } + public Microphones Microphones { get; set; } // Can we have this setter fire the update on the CiscoCodec feedback? + public Output Output { get; set; } + public Volume Volume { get; set; } + public VolumeMute VolumeMute { get; set; } + + public Audio() + { + Volume = new Volume(); + } + } + + public class Id + { + public string Value { get; set; } + } + + public class Current + { + public Id Id { get; set; } + } + + public class Bookings + { + public Current Current { get; set; } + } + + public class Options + { + public string Value { get; set; } + } + + public class Capabilities + { + public Options Options { get; set; } + } + + public class Connected + { + public string Value { get; set; } + } + + public class Framerate + { + public string Value { get; set; } + } + + public class Manufacturer + { + public string Value { get; set; } + } + + public class Model + { + public string Value { get; set; } + } + + public class Pan + { + public string Value { get; set; } + } + + public class Tilt + { + public string Value { get; set; } + } + + public class Zoom + { + public string Value { get; set; } + } + + public class Position + { + public Pan Pan { get; set; } + public Tilt Tilt { get; set; } + public Zoom Zoom { get; set; } + } + + public class Camera + { + public string id { get; set; } + public Capabilities Capabilities { get; set; } + public Connected Connected { get; set; } + public Framerate Framerate { get; set; } + public Manufacturer Manufacturer { get; set; } + public Model Model { get; set; } + public Position Position { get; set; } + } + + public class Availability + { + public string Value { get; set; } + } + + public class Status2 + { + public string Value { get; set; } + } + + public class SpeakerTrack + { + public Availability Availability { get; set; } + public Status2 Status { get; set; } + } + + public class Cameras + { + public List Camera { get; set; } + public SpeakerTrack SpeakerTrack { get; set; } + } + + public class MaxActiveCalls + { + public string Value { get; set; } + } + + public class MaxAudioCalls + { + public string Value { get; set; } + } + + public class MaxCalls + { + public string Value { get; set; } + } + + public class MaxVideoCalls + { + public string Value { get; set; } + } + + public class Conference + { + public MaxActiveCalls MaxActiveCalls { get; set; } + public MaxAudioCalls MaxAudioCalls { get; set; } + public MaxCalls MaxCalls { get; set; } + public MaxVideoCalls MaxVideoCalls { get; set; } + } + + public class Capabilities2 + { + public Conference Conference { get; set; } + } + + public class CallId + { + public string Value { get; set; } + } + + public class ActiveSpeaker + { + public CallId CallId { get; set; } + } + + public class DoNotDisturb + { + public string Value { get; set; } + } + + public class Mode + { + public string Value { get; set; } + } + + public class Multipoint + { + public Mode Mode { get; set; } + } + + public class CallId2 + { + public string Value { get; set; } + } + + public class Mode2 + { + public string Value { get; set; } + } + + public class Mode3 + { + public string Value { get; set; } + } + + public class ReleaseFloorAvailability + { + public string Value { get; set; } + } + + public class RequestFloorAvailability + { + public string Value { get; set; } + } + + public class Whiteboard + { + public Mode3 Mode { get; set; } + public ReleaseFloorAvailability ReleaseFloorAvailability { get; set; } + public RequestFloorAvailability RequestFloorAvailability { get; set; } + } + + public class Presentation + { + public CallId2 CallId { get; set; } + public Mode2 Mode { get; set; } + public Whiteboard Whiteboard { get; set; } + } + + public class CallId3 + { + public string Value { get; set; } + } + + public class Mode4 + { + public string Value { get; set; } + } + + public class SpeakerLock + { + public CallId3 CallId { get; set; } + public Mode4 Mode { get; set; } + } + + public class Conference2 + { + public ActiveSpeaker ActiveSpeaker { get; set; } + public DoNotDisturb DoNotDisturb { get; set; } + public Multipoint Multipoint { get; set; } + public Presentation Presentation { get; set; } + public SpeakerLock SpeakerLock { get; set; } + } + + public class Description + { + public string Value { get; set; } + } + + public class Level + { + public string Value { get; set; } + } + + public class References + { + public string Value { get; set; } + } + + public class Type + { + public string Value { get; set; } + } + + public class Message + { + public string id { get; set; } + public Description Description { get; set; } + public Level Level { get; set; } + public References References { get; set; } + public Type Type { get; set; } + } + + public class Diagnostics + { + public List Message { get; set; } + } + + public class Conference3 + { + } + + public class Experimental + { + public Conference3 Conference { get; set; } + } + + public class Address + { + public string Value { get; set; } + } + + public class Port + { + public string Value { get; set; } + } + + public class Reason + { + public string Value { get; set; } + } + + public class Status3 + { + public string Value { get; set; } + } + + public class Gatekeeper + { + public Address Address { get; set; } + public Port Port { get; set; } + public Reason Reason { get; set; } + public Status3 Status { get; set; } + } + + public class Reason2 + { + public string Value { get; set; } + } + + public class Status4 + { + public string Value { get; set; } + } + + public class Mode5 + { + public Reason2 Reason { get; set; } + public Status4 Status { get; set; } + } + + public class H323 + { + public Gatekeeper Gatekeeper { get; set; } + public Mode5 Mode { get; set; } + } + + public class Expression + { + public string id { get; set; } + public string Value { get; set; } + } + + public class Format + { + public string Value { get; set; } + } + + public class URL + { + public string Value { get; set; } + } + + public class HttpFeedback + { + public string id { get; set; } + public List Expression { get; set; } + public Format Format { get; set; } + public URL URL { get; set; } + } + + public class MediaChannels + { + } + + public class Address2 + { + public string Value { get; set; } + } + + public class Capabilities3 + { + public string Value { get; set; } + } + + public class DeviceId + { + public string Value { get; set; } + } + + public class Duplex + { + public string Value { get; set; } + } + + public class Platform + { + public string Value { get; set; } + } + + public class PortID + { + public string Value { get; set; } + } + + public class PrimaryMgmtAddress + { + public string Value { get; set; } + } + + public class SysName + { + public string Value { get; set; } + } + + public class SysObjectID + { + public string Value { get; set; } + } + + public class VTPMgmtDomain + { + public string Value { get; set; } + } + + public class Version + { + public string Value { get; set; } + } + + public class VoIPApplianceVlanID + { + public string Value { get; set; } + } + + public class CDP + { + public Address2 Address { get; set; } + public Capabilities3 Capabilities { get; set; } + public DeviceId DeviceId { get; set; } + public Duplex Duplex { get; set; } + public Platform Platform { get; set; } + public PortID PortID { get; set; } + public PrimaryMgmtAddress PrimaryMgmtAddress { get; set; } + public SysName SysName { get; set; } + public SysObjectID SysObjectID { get; set; } + public VTPMgmtDomain VTPMgmtDomain { get; set; } + public Version Version { get; set; } + public VoIPApplianceVlanID VoIPApplianceVlanID { get; set; } + } + + public class Name + { + public string Value { get; set; } + } + + public class Domain + { + public Name Name { get; set; } + } + + public class Address3 + { + public string Value { get; set; } + } + + public class Server + { + public string id { get; set; } + public Address3 Address { get; set; } + } + + public class DNS + { + public Domain Domain { get; set; } + public List Server { get; set; } + } + + public class MacAddress + { + public string Value { get; set; } + } + + public class Speed + { + public string Value { get; set; } + } + + public class Ethernet + { + public MacAddress MacAddress { get; set; } + public Speed Speed { get; set; } + } + + public class Address4 + { + public string Value { get; set; } + } + + public class Gateway + { + public string Value { get; set; } + } + + public class SubnetMask + { + public string Value { get; set; } + } + + public class IPv4 + { + public Address4 Address { get; set; } + public Gateway Gateway { get; set; } + public SubnetMask SubnetMask { get; set; } + } + + public class Address5 + { + public string Value { get; set; } + } + + public class Gateway2 + { + public string Value { get; set; } + } + + public class IPv6 + { + public Address5 Address { get; set; } + public Gateway2 Gateway { get; set; } + } + + public class VlanId + { + public string Value { get; set; } + } + + public class Voice + { + public VlanId VlanId { get; set; } + } + + public class VLAN + { + public Voice Voice { get; set; } + } + + public class Network + { + public string id { get; set; } + public CDP CDP { get; set; } + public DNS DNS { get; set; } + public Ethernet Ethernet { get; set; } + public IPv4 IPv4 { get; set; } + public IPv6 IPv6 { get; set; } + public VLAN VLAN { get; set; } + } + + public class CurrentAddress + { + public string Value { get; set; } + } + + public class Address6 + { + public string Value { get; set; } + } + + public class Server2 + { + public string id { get; set; } + public Address6 Address { get; set; } + } + + public class Status5 + { + public string Value { get; set; } + } + + public class NTP + { + public CurrentAddress CurrentAddress { get; set; } + public List Server { get; set; } + public Status5 Status { get; set; } + } + + public class NetworkServices + { + public NTP NTP { get; set; } + } + + public class HardwareInfo + { + public string Value { get; set; } + } + + public class ID2 + { + public string Value { get; set; } + } + + public class Name2 + { + public string Value { get; set; } + } + + public class SoftwareInfo + { + public string Value { get; set; } + } + + public class Status6 + { + public string Value { get; set; } + } + + public class Type2 + { + public string Value { get; set; } + } + + public class UpgradeStatus + { + public string Value { get; set; } + } + + public class ConnectedDevice + { + public string id { get; set; } + public HardwareInfo HardwareInfo { get; set; } + public ID2 ID { get; set; } + public Name2 Name { get; set; } + public SoftwareInfo SoftwareInfo { get; set; } + public Status6 Status { get; set; } + public Type2 Type { get; set; } + public UpgradeStatus UpgradeStatus { get; set; } + } + + public class Peripherals + { + public List ConnectedDevice { get; set; } + } + + public class Enabled + { + public string Value { get; set; } + } + + public class LastLoggedInUserId + { + public string Value { get; set; } + } + + public class LoggedIn + { + public string Value { get; set; } + } + + public class ExtensionMobility + { + public Enabled Enabled { get; set; } + public LastLoggedInUserId LastLoggedInUserId { get; set; } + public LoggedIn LoggedIn { get; set; } + } + + public class CUCM + { + public ExtensionMobility ExtensionMobility { get; set; } + } + + public class CompletedAt + { + public string Value { get; set; } + } + + public class URL2 + { + public string Value { get; set; } + } + + public class VersionId + { + public string Value { get; set; } + } + + public class Current2 + { + public CompletedAt CompletedAt { get; set; } + public URL2 URL { get; set; } + public VersionId VersionId { get; set; } + } + + public class LastChange + { + public string Value { get; set; } + } + + public class Message2 + { + public string Value { get; set; } + } + + public class Phase + { + public string Value { get; set; } + } + + public class SessionId + { + public string Value { get; set; } + } + + public class Status7 + { + public string Value { get; set; } + } + + public class URL3 + { + public string Value { get; set; } + } + + public class VersionId2 + { + public string Value { get; set; } + } + + public class UpgradeStatus2 + { + public LastChange LastChange { get; set; } + public Message2 Message { get; set; } + public Phase Phase { get; set; } + public SessionId SessionId { get; set; } + public Status7 Status { get; set; } + public URL3 URL { get; set; } + public VersionId2 VersionId { get; set; } + } + + public class Software + { + public Current2 Current { get; set; } + public UpgradeStatus2 UpgradeStatus { get; set; } + } + + public class Status8 + { + public string Value { get; set; } + } + + public class Provisioning + { + public CUCM CUCM { get; set; } + public Software Software { get; set; } + public Status8 Status { get; set; } + } + + public class Availability2 + { + public string Value { get; set; } + } + + public class Services + { + public Availability2 Availability { get; set; } + } + + public class Proximity + { + public Services Services { get; set; } + } + + public class Current3 + { + public string Value { get; set; } + } + + public class PeopleCount + { + public Current3 Current { get; set; } + } + + public class PeoplePresence + { + public string Value { get; set; } + } + + public class RoomAnalytics + { + public PeopleCount PeopleCount { get; set; } + public PeoplePresence PeoplePresence { get; set; } + } + + public class Authentication + { + public string Value { get; set; } + } + + public class DisplayName + { + public string Value { get; set; } + } + + public class Mode6 + { + public string Value { get; set; } + } + + public class URI + { + public string Value { get; set; } + } + + public class CallForward + { + public DisplayName DisplayName { get; set; } + public Mode6 Mode { get; set; } + public URI URI { get; set; } + } + + public class MessagesWaiting + { + public string Value { get; set; } + } + + public class URI2 + { + public string Value { get; set; } + } + + public class Mailbox + { + public MessagesWaiting MessagesWaiting { get; set; } + public URI2 URI { get; set; } + } + + public class Address7 + { + public string Value { get; set; } + } + + public class Status9 + { + public string Value { get; set; } + } + + public class Proxy + { + public string id { get; set; } + public Address7 Address { get; set; } + public Status9 Status { get; set; } + } + + public class Reason3 + { + public string Value { get; set; } + } + + public class Status10 + { + public string Value { get; set; } + } + + public class URI3 + { + public string Value { get; set; } + } + + public class Registration + { + public string id { get; set; } + public Reason3 Reason { get; set; } + public Status10 Status { get; set; } + public URI3 URI { get; set; } + } + + public class Secure + { + public string Value { get; set; } + } + + public class Verified + { + public string Value { get; set; } + } + + public class SIP + { + public Authentication Authentication { get; set; } + public CallForward CallForward { get; set; } + public Mailbox Mailbox { get; set; } + public List Proxy { get; set; } + public List Registration { get; set; } + public Secure Secure { get; set; } + public Verified Verified { get; set; } + } + + public class Mode7 + { + public string Value { get; set; } + } + + public class FIPS + { + public Mode7 Mode { get; set; } + } + + public class CallHistory + { + public string Value { get; set; } + } + + public class Configurations + { + public string Value { get; set; } + } + + public class DHCP + { + public string Value { get; set; } + } + + public class InternalLogging + { + public string Value { get; set; } + } + + public class LocalPhonebook + { + public string Value { get; set; } + } + + public class Persistency + { + public CallHistory CallHistory { get; set; } + public Configurations Configurations { get; set; } + public DHCP DHCP { get; set; } + public InternalLogging InternalLogging { get; set; } + public LocalPhonebook LocalPhonebook { get; set; } + } + + public class Security + { + public FIPS FIPS { get; set; } + public Persistency Persistency { get; set; } + } + + public class State : ValueProperty + { + public bool BoolValue { get; private set; } + + public string Value // Valid values are Standby/EnteringStandby/Halfwake/Off + { + set + { + // If the incoming value is "Of" it sets the BoolValue true, otherwise sets it false + BoolValue = value == "Off"; + OnValueChanged(); + } + } + } + + public class Standby + { + public State State { get; set; } + + public Standby() + { + State = new State(); + } + } + + public class CompatibilityLevel + { + public string Value { get; set; } + } + + public class SerialNumber + { + public string Value { get; set; } + } + + public class Module + { + public CompatibilityLevel CompatibilityLevel { get; set; } + public SerialNumber SerialNumber { get; set; } + } + + public class Hardware + { + public Module Module { get; set; } + } + + public class ProductId + { + public string Value { get; set; } + } + + public class ProductPlatform + { + public string Value { get; set; } + } + + public class ProductType + { + public string Value { get; set; } + } + + public class DisplayName2 + { + public string Value { get; set; } + } + + public class Name3 + { + public string Value { get; set; } + } + + public class Encryption + { + public string Value { get; set; } + } + + public class MultiSite + { + public string Value { get; set; } + } + + public class RemoteMonitoring + { + public string Value { get; set; } + } + + public class OptionKeys + { + public Encryption Encryption { get; set; } + public MultiSite MultiSite { get; set; } + public RemoteMonitoring RemoteMonitoring { get; set; } + } + + public class ReleaseDate + { + public string Value { get; set; } + } + + public class Version2 + { + public string Value { get; set; } + } + + public class Software2 + { + public DisplayName2 DisplayName { get; set; } + public Name3 Name { get; set; } + public OptionKeys OptionKeys { get; set; } + public ReleaseDate ReleaseDate { get; set; } + public Version2 Version { get; set; } + } + + public class NumberOfActiveCalls + { + public string Value { get; set; } + } + + public class NumberOfInProgressCalls + { + public string Value { get; set; } + } + + public class NumberOfSuspendedCalls + { + public string Value { get; set; } + } + + public class State2 + { + public NumberOfActiveCalls NumberOfActiveCalls { get; set; } + public NumberOfInProgressCalls NumberOfInProgressCalls { get; set; } + public NumberOfSuspendedCalls NumberOfSuspendedCalls { get; set; } + } + + public class Uptime + { + public string Value { get; set; } + } + + public class SystemUnit + { + public Hardware Hardware { get; set; } + public ProductId ProductId { get; set; } + public ProductPlatform ProductPlatform { get; set; } + public ProductType ProductType { get; set; } + public Software2 Software { get; set; } + public State2 State { get; set; } + public Uptime Uptime { get; set; } + } + + public class SystemTime + { + public DateTime Value { get; set; } + } + + public class Time + { + public SystemTime SystemTime { get; set; } + } + + public class Number + { + public string Value { get; set; } + } + + public class ContactMethod + { + public string id { get; set; } + public Number Number { get; set; } + } + + public class Name4 + { + public string Value { get; set; } + } + + public class ContactInfo + { + public List ContactMethod { get; set; } + public Name4 Name { get; set; } + } + + public class UserInterface + { + public ContactInfo ContactInfo { get; set; } + } + + public class PIPPosition + { + public string Value { get; set; } + } + + public class ActiveSpeaker2 + { + public PIPPosition PIPPosition { get; set; } + } + + public class Connected2 + { + public string Value { get; set; } + } + + public class SignalState + { + public string Value { get; set; } + } + + public class SourceId + { + public string Value { get; set; } + } + + public class Type3 + { + public string Value { get; set; } + } + + public class Connector + { + public string id { get; set; } + public Connected2 Connected { get; set; } + public SignalState SignalState { get; set; } + public SourceId SourceId { get; set; } + public Type3 Type { get; set; } + } + + public class MainVideoSource + { + public string Value { get; set; } + } + + public class ConnectorId + { + public string Value { get; set; } + } + + public class FormatStatus + { + public string Value { get; set; } + } + + public class FormatType + { + public string Value { get; set; } + } + + public class MediaChannelId + { + public string Value { get; set; } + } + + public class Height + { + public string Value { get; set; } + } + + public class RefreshRate + { + public string Value { get; set; } + } + + public class Width + { + public string Value { get; set; } + } + + public class Resolution + { + public Height Height { get; set; } + public RefreshRate RefreshRate { get; set; } + public Width Width { get; set; } + } + + public class Source + { + public string id { get; set; } + public ConnectorId ConnectorId { get; set; } + public FormatStatus FormatStatus { get; set; } + public FormatType FormatType { get; set; } + public MediaChannelId MediaChannelId { get; set; } + public Resolution Resolution { get; set; } + } + + public class Input2 + { + public List Connector { get; set; } + public MainVideoSource MainVideoSource { get; set; } + public List Source { get; set; } + } + + public class Local + { + public string Value { get; set; } + } + + public class LayoutFamily + { + public Local Local { get; set; } + } + + public class Layout + { + public LayoutFamily LayoutFamily { get; set; } + } + + public class Monitors + { + public string Value { get; set; } + } + + public class Connected3 + { + public string Value { get; set; } + } + + public class Name5 + { + public string Value { get; set; } + } + + public class PreferredFormat + { + public string Value { get; set; } + } + + public class ConnectedDevice2 + { + public Name5 Name { get; set; } + public PreferredFormat PreferredFormat { get; set; } + } + + public class MonitorRole + { + public string Value { get; set; } + } + + public class Height2 + { + public string Value { get; set; } + } + + public class RefreshRate2 + { + public string Value { get; set; } + } + + public class Width2 + { + public string Value { get; set; } + } + + public class Resolution2 + { + public Height2 Height { get; set; } + public RefreshRate2 RefreshRate { get; set; } + public Width2 Width { get; set; } + } + + public class Type4 + { + public string Value { get; set; } + } + + public class Connector2 + { + public string id { get; set; } + public Connected3 Connected { get; set; } + public ConnectedDevice2 ConnectedDevice { get; set; } + public MonitorRole MonitorRole { get; set; } + public Resolution2 Resolution { get; set; } + public Type4 Type { get; set; } + } + + public class Output2 + { + public List Connector { get; set; } + } + + public class PIPPosition2 + { + public string Value { get; set; } + } + + public class Presentation2 + { + public PIPPosition2 PIPPosition { get; set; } + } + + public class FullscreenMode + { + public string Value { get; set; } + } + + public class Mode8 + { + public string Value { get; set; } + } + + public class OnMonitorRole + { + public string Value { get; set; } + } + + public class PIPPosition3 + { + public string Value { get; set; } + } + + public class Selfview + { + public FullscreenMode FullscreenMode { get; set; } + public Mode8 Mode { get; set; } + public OnMonitorRole OnMonitorRole { get; set; } + public PIPPosition3 PIPPosition { get; set; } + } + + public class Video + { + public ActiveSpeaker2 ActiveSpeaker { get; set; } + public Input2 Input { get; set; } + public Layout Layout { get; set; } + public Monitors Monitors { get; set; } + public Output2 Output { get; set; } + public Presentation2 Presentation { get; set; } + public Selfview Selfview { get; set; } + } + + public class AnswerState + { + public string Value { get; set; } + } + + public class CallType + { + public string Value { get; set; } + } + + public class CallbackNumber + { + public string Value { get; set; } + } + + public class DeviceType + { + public string Value { get; set; } + } + + public class Direction + { + public string Value { get; set; } + } + + public class Duration + { + public string Value { get; set; } + } + + + public class FacilityServiceId + { + public string Value { get; set; } + } + + public class HoldReason + { + public string Value { get; set; } + } + + public class PlacedOnHold + { + public string Value { get; set; } + } + + public class Protocol + { + public string Value { get; set; } + } + + public class ReceiveCallRate + { + public string Value { get; set; } + } + + public class RemoteNumber + { + public string Value { get; set; } + } + + public class TransmitCallRate + { + public string Value { get; set; } + } + + public class Call + { + public string id { get; set; } + public AnswerState AnswerState { get; set; } + public CallType CallType { get; set; } + public CallbackNumber CallbackNumber { get; set; } + public DeviceType DeviceType { get; set; } + public Direction Direction { get; set; } + public DisplayName DisplayName { get; set; } + public Duration Duration { get; set; } + public Encryption Encryption { get; set; } + public FacilityServiceId FacilityServiceId { get; set; } + public HoldReason HoldReason { get; set; } + public PlacedOnHold PlacedOnHold { get; set; } + public Protocol Protocol { get; set; } + public ReceiveCallRate ReceiveCallRate { get; set; } + public RemoteNumber RemoteNumber { get; set; } + public Status2 Status { get; set; } + public TransmitCallRate TransmitCallRate { get; set; } + } + + public class Status + { + public Audio Audio { get; set; } + public Bookings Bookings { get; set; } + public List Call { get; set; } + public Cameras Cameras { get; set; } + public Capabilities2 Capabilities { get; set; } + public Conference2 Conference { get; set; } + public Diagnostics Diagnostics { get; set; } + public Experimental Experimental { get; set; } + public H323 H323 { get; set; } + public List HttpFeedback { get; set; } + public MediaChannels MediaChannels { get; set; } + public List Network { get; set; } + public NetworkServices NetworkServices { get; set; } + public Peripherals Peripherals { get; set; } + public Provisioning Provisioning { get; set; } + public Proximity Proximity { get; set; } + public RoomAnalytics RoomAnalytics { get; set; } + public SIP SIP { get; set; } + public Security Security { get; set; } + public Standby Standby { get; set; } + public SystemUnit SystemUnit { get; set; } + public Time Time { get; set; } + public UserInterface UserInterface { get; set; } + public Video Video { get; set; } + + public Status() + { + Audio = new Audio(); + Call = new List(); + Standby = new Standby(); + } +#warning Figure out how to flag codec as InCall if Call.Count > 0 + } + + public class RootObject + { + public Status Status { get; set; } + + public RootObject() + { + Status = new Status(); + } + } + } +} diff --git a/Essentials Devices Common/Essentials Devices Common/VideoCodec/CodecActiveCallItem.cs b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CodecActiveCallItem.cs new file mode 100644 index 00000000..a1d3895e --- /dev/null +++ b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CodecActiveCallItem.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; + +namespace PepperDash.Essentials.Devices.Common.VideoCodec + +{ + public class CodecActiveCallItem + { + public string Name { get; private set; } + + public string Number { get; private set; } + + public eCodecCallType Type { get; private set; } + } + + public enum eCodecCallType + { + None, Audio, Video + } +} \ No newline at end of file diff --git a/Essentials Devices Common/Essentials Devices Common/VC/MockVC/MockVC.cs b/Essentials Devices Common/Essentials Devices Common/VideoCodec/MockVC/MockVC.cs similarity index 91% rename from Essentials Devices Common/Essentials Devices Common/VC/MockVC/MockVC.cs rename to Essentials Devices Common/Essentials Devices Common/VideoCodec/MockVC/MockVC.cs index f802689e..0bfdb681 100644 --- a/Essentials Devices Common/Essentials Devices Common/VC/MockVC/MockVC.cs +++ b/Essentials Devices Common/Essentials Devices Common/VideoCodec/MockVC/MockVC.cs @@ -1,306 +1,306 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Crestron.SimplSharp; - -using PepperDash.Core; -using PepperDash.Essentials.Core; - -namespace PepperDash.Essentials.Devices.Common.VideoCodec -{ - public class MockVC : VideoCodecBase - { - public MockVC(string key, string name) - : base(key, name) - { - MuteFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Mute={0}", _IsMuted); - VolumeLevelFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Volume={0}", _VolumeLevel); - InCallFeedback.OutputChange += (o, a) => Debug.Console(1, this, "InCall={0}", _InCall); - IncomingCallFeedback.OutputChange += (o, a) => Debug.Console(1, this, "IncomingCall={0}", _IncomingCall); - //ReceiveLevelFeedback.OutputChange += (o, a) => Debug.Console(1, this, "ReceiveLevel={0}", _ReceiveLevel); - //ReceiveMuteIsOnFeedback.OutputChange += (o, a) => Debug.Console(1, this, "ReceiveMute={0}", _ReceiveMute); - //TransmitLevelFeedback.OutputChange += (o, a) => Debug.Console(1, this, "TransmitLevel={0}", _TransmitLevel); - //TransmitMuteIsOnFeedback.OutputChange += (o, a) => Debug.Console(1, this, "TransmitMute={0}", _TransmitMute); - SharingSourceFeedback.OutputChange += (o, a) => Debug.Console(1, this, "SharingSource={0}", _SharingSource); - } - - protected override Func InCallFeedbackFunc - { - get { return () => _InCall; } - } - bool _InCall; - - protected override Func IncomingCallFeedbackFunc - { - get { return () => _IncomingCall; } - } - bool _IncomingCall; - - //protected override Func TransmitLevelFeedbackFunc - //{ - // get { return () => _TransmitLevel; } - //} - //int _TransmitLevel; - - //protected override Func TransmitMuteFeedbackFunc - //{ - // get { return () => _TransmitMute; } - //} - //bool _TransmitMute; - - //protected override Func ReceiveLevelFeedbackFunc - //{ - // get { return () => _ReceiveLevel; } - //} - //int _ReceiveLevel; - - //protected override Func ReceiveMuteFeedbackFunc - //{ - // get { return () => _ReceiveMute; } - //} - //bool _ReceiveMute; - - protected override Func PrivacyModeFeedbackFunc - { - get { return () => _PrivacyModeIsOn; } - } - bool _PrivacyModeIsOn; - - protected override Func VolumeLevelFeedbackFunc - { - get { return () => _VolumeLevel; } - } - int _VolumeLevel; - - protected override Func MuteFeedbackFunc - { - get { return () => _IsMuted; } - } - bool _IsMuted; - - protected override Func SharingSourceFeedbackFunc - { - get { return () => _SharingSource; } - } - string _SharingSource; - - /// - /// Dials, yo! - /// - public override void Dial(string s) - { - Debug.Console(1, this, "Dial: {0}", s); - - _InCall = true; - InCallFeedback.FireUpdate(); - } - - /// - /// - /// - public override void EndCall() - { - Debug.Console(1, this, "EndCall"); - _InCall = false; - InCallFeedback.FireUpdate(); - } - - /// - /// For a call from the test methods below - /// - public override void AcceptCall() - { - Debug.Console(1, this, "AcceptCall"); - } - - /// - /// For a call from the test methods below - /// - public override void RejectCall() - { - Debug.Console(1, this, "RejectCall"); - } - - /// - /// Makes horrible tones go out on the wire! - /// - /// - public override void SendDtmf(string s) - { - Debug.Console(1, this, "SendDTMF: {0}", s); - } - - public override void StartSharing() - { - - } - - public override void StopSharing() - { - - } - - /// - /// Called by routing to make it happen - /// - /// - public override void ExecuteSwitch(object selector) - { - Debug.Console(1, this, "ExecuteSwitch"); - _SharingSource = selector.ToString(); - - } - - public override void MuteOff() - { - _IsMuted = false; - MuteFeedback.FireUpdate(); - } - - public override void MuteOn() - { - _IsMuted = true; - MuteFeedback.FireUpdate(); - } - - public override void MuteToggle() - { - _IsMuted = !_IsMuted; - MuteFeedback.FireUpdate(); - } - - public override void SetVolume(ushort level) - { - _VolumeLevel = level; - VolumeLevelFeedback.FireUpdate(); - } - - public override void VolumeDown(bool pressRelease) - { - } - - public override void VolumeUp(bool pressRelease) - { - } - - - ///// - ///// - ///// - //public override void ReceiveMuteOff() - //{ - // Debug.Console(1, this, "ReceiveMuteOff"); - - // if (!_ReceiveMute) - // return; - // _ReceiveMute = false; - // ReceiveMuteIsOnFeedback.FireUpdate(); - //} - - ///// - ///// - ///// - //public override void ReceiveMuteOn() - //{ - // Debug.Console(1, this, "ReceiveMuteOn"); - // if (_ReceiveMute) - // return; - // ReceiveMuteIsOnFeedback.FireUpdate(); - //} - - ///// - ///// - ///// - //public override void ReceiveMuteToggle() - //{ - // Debug.Console(1, this, "ReceiveMuteToggle"); - - // _ReceiveMute = !_ReceiveMute; - // ReceiveMuteIsOnFeedback.FireUpdate(); - //} - - ///// - ///// - ///// - ///// - //public override void SetReceiveVolume(ushort level) - //{ - // Debug.Console(1, this, "SetReceiveVolume: {0}", level); - - //} - - ///// - ///// - ///// - //public override void TransmitMuteOff() - //{ - // Debug.Console(1, this, "TransmitMuteOff"); - - // if (!_TransmitMute) - // return; - // _TransmitMute = false; - // TransmitMuteIsOnFeedback.FireUpdate(); - //} - - ///// - ///// - ///// - //public override void TransmitMuteOn() - //{ - // Debug.Console(1, this, "TransmitMuteOn"); - // if (_TransmitMute) - // return; - // TransmitMuteIsOnFeedback.FireUpdate(); - //} - - //public override void TransmitMuteToggle() - //{ - - //} - - public override void PrivacyModeOn() - { - Debug.Console(1, this, "PrivacyMuteOn"); - if (_PrivacyModeIsOn) - return; - _PrivacyModeIsOn = true; - PrivacyModeIsOnFeedback.FireUpdate(); - - } - - public override void PrivacyModeOff() - { - Debug.Console(1, this, "PrivacyMuteOff"); - if (!_PrivacyModeIsOn) - return; - _PrivacyModeIsOn = false; - PrivacyModeIsOnFeedback.FireUpdate(); - } - - public override void PrivacyModeToggle() - { - _PrivacyModeIsOn = !_PrivacyModeIsOn; - Debug.Console(1, this, "PrivacyMuteToggle: {0}", _PrivacyModeIsOn); - PrivacyModeIsOnFeedback.FireUpdate(); - } - - //******************************************************** - // SIMULATION METHODS - - public void TestIncomingCall(string url) - { - Debug.Console(1, this, "TestIncomingCall"); - - _IncomingCall = true; - IncomingCallFeedback.FireUpdate(); - } - - public void TestFarEndHangup() - { - Debug.Console(1, this, "TestFarEndHangup"); - - } - - } +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; + +using PepperDash.Core; +using PepperDash.Essentials.Core; + +namespace PepperDash.Essentials.Devices.Common.VideoCodec +{ + public class MockVC : VideoCodecBase + { + public MockVC(string key, string name) + : base(key, name) + { + MuteFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Mute={0}", _IsMuted); + VolumeLevelFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Volume={0}", _VolumeLevel); + ActiveCallCountFeedback.OutputChange += (o, a) => Debug.Console(1, this, "InCall={0}", _ActiveCallCount); + IncomingCallFeedback.OutputChange += (o, a) => Debug.Console(1, this, "IncomingCall={0}", _IncomingCall); + //ReceiveLevelFeedback.OutputChange += (o, a) => Debug.Console(1, this, "ReceiveLevel={0}", _ReceiveLevel); + //ReceiveMuteIsOnFeedback.OutputChange += (o, a) => Debug.Console(1, this, "ReceiveMute={0}", _ReceiveMute); + //TransmitLevelFeedback.OutputChange += (o, a) => Debug.Console(1, this, "TransmitLevel={0}", _TransmitLevel); + //TransmitMuteIsOnFeedback.OutputChange += (o, a) => Debug.Console(1, this, "TransmitMute={0}", _TransmitMute); + SharingSourceFeedback.OutputChange += (o, a) => Debug.Console(1, this, "SharingSource={0}", _SharingSource); + } + + protected override Func ActiveCallCountFeedbackFunc + { + get { return () => _ActiveCallCount; } + } + int _ActiveCallCount; + + protected override Func IncomingCallFeedbackFunc + { + get { return () => _IncomingCall; } + } + bool _IncomingCall; + + //protected override Func TransmitLevelFeedbackFunc + //{ + // get { return () => _TransmitLevel; } + //} + //int _TransmitLevel; + + //protected override Func TransmitMuteFeedbackFunc + //{ + // get { return () => _TransmitMute; } + //} + //bool _TransmitMute; + + //protected override Func ReceiveLevelFeedbackFunc + //{ + // get { return () => _ReceiveLevel; } + //} + //int _ReceiveLevel; + + //protected override Func ReceiveMuteFeedbackFunc + //{ + // get { return () => _ReceiveMute; } + //} + //bool _ReceiveMute; + + protected override Func PrivacyModeIsOnFeedbackFunc + { + get { return () => _PrivacyModeIsOn; } + } + bool _PrivacyModeIsOn; + + protected override Func VolumeLevelFeedbackFunc + { + get { return () => _VolumeLevel; } + } + int _VolumeLevel; + + protected override Func MuteFeedbackFunc + { + get { return () => _IsMuted; } + } + bool _IsMuted; + + protected override Func SharingSourceFeedbackFunc + { + get { return () => _SharingSource; } + } + string _SharingSource; + + /// + /// Dials, yo! + /// + public override void Dial(string s) + { + Debug.Console(1, this, "Dial: {0}", s); + + //_InCall = true; + //IsInCall.FireUpdate(); + } + + /// + /// + /// + public override void EndCall() + { + Debug.Console(1, this, "EndCall"); + //_InCall = false; + //IsInCall.FireUpdate(); + } + + /// + /// For a call from the test methods below + /// + public override void AcceptCall() + { + Debug.Console(1, this, "AcceptCall"); + } + + /// + /// For a call from the test methods below + /// + public override void RejectCall() + { + Debug.Console(1, this, "RejectCall"); + } + + /// + /// Makes horrible tones go out on the wire! + /// + /// + public override void SendDtmf(string s) + { + Debug.Console(1, this, "SendDTMF: {0}", s); + } + + public override void StartSharing() + { + + } + + public override void StopSharing() + { + + } + + /// + /// Called by routing to make it happen + /// + /// + public override void ExecuteSwitch(object selector) + { + Debug.Console(1, this, "ExecuteSwitch"); + _SharingSource = selector.ToString(); + + } + + public override void MuteOff() + { + _IsMuted = false; + MuteFeedback.FireUpdate(); + } + + public override void MuteOn() + { + _IsMuted = true; + MuteFeedback.FireUpdate(); + } + + public override void MuteToggle() + { + _IsMuted = !_IsMuted; + MuteFeedback.FireUpdate(); + } + + public override void SetVolume(ushort level) + { + _VolumeLevel = level; + VolumeLevelFeedback.FireUpdate(); + } + + public override void VolumeDown(bool pressRelease) + { + } + + public override void VolumeUp(bool pressRelease) + { + } + + + ///// + ///// + ///// + //public override void ReceiveMuteOff() + //{ + // Debug.Console(1, this, "ReceiveMuteOff"); + + // if (!_ReceiveMute) + // return; + // _ReceiveMute = false; + // ReceiveMuteIsOnFeedback.FireUpdate(); + //} + + ///// + ///// + ///// + //public override void ReceiveMuteOn() + //{ + // Debug.Console(1, this, "ReceiveMuteOn"); + // if (_ReceiveMute) + // return; + // ReceiveMuteIsOnFeedback.FireUpdate(); + //} + + ///// + ///// + ///// + //public override void ReceiveMuteToggle() + //{ + // Debug.Console(1, this, "ReceiveMuteToggle"); + + // _ReceiveMute = !_ReceiveMute; + // ReceiveMuteIsOnFeedback.FireUpdate(); + //} + + ///// + ///// + ///// + ///// + //public override void SetReceiveVolume(ushort level) + //{ + // Debug.Console(1, this, "SetReceiveVolume: {0}", level); + + //} + + ///// + ///// + ///// + //public override void TransmitMuteOff() + //{ + // Debug.Console(1, this, "TransmitMuteOff"); + + // if (!_TransmitMute) + // return; + // _TransmitMute = false; + // TransmitMuteIsOnFeedback.FireUpdate(); + //} + + ///// + ///// + ///// + //public override void TransmitMuteOn() + //{ + // Debug.Console(1, this, "TransmitMuteOn"); + // if (_TransmitMute) + // return; + // TransmitMuteIsOnFeedback.FireUpdate(); + //} + + //public override void TransmitMuteToggle() + //{ + + //} + + public override void PrivacyModeOn() + { + Debug.Console(1, this, "PrivacyMuteOn"); + if (_PrivacyModeIsOn) + return; + _PrivacyModeIsOn = true; + PrivacyModeIsOnFeedback.FireUpdate(); + + } + + public override void PrivacyModeOff() + { + Debug.Console(1, this, "PrivacyMuteOff"); + if (!_PrivacyModeIsOn) + return; + _PrivacyModeIsOn = false; + PrivacyModeIsOnFeedback.FireUpdate(); + } + + public override void PrivacyModeToggle() + { + _PrivacyModeIsOn = !_PrivacyModeIsOn; + Debug.Console(1, this, "PrivacyMuteToggle: {0}", _PrivacyModeIsOn); + PrivacyModeIsOnFeedback.FireUpdate(); + } + + //******************************************************** + // SIMULATION METHODS + + public void TestIncomingCall(string url) + { + Debug.Console(1, this, "TestIncomingCall"); + + _IncomingCall = true; + IncomingCallFeedback.FireUpdate(); + } + + public void TestFarEndHangup() + { + Debug.Console(1, this, "TestFarEndHangup"); + + } + + } } \ No newline at end of file diff --git a/Essentials Devices Common/Essentials Devices Common/VC/MockVC/MockVC.cs.orig b/Essentials Devices Common/Essentials Devices Common/VideoCodec/MockVC/MockVC.cs.orig similarity index 100% rename from Essentials Devices Common/Essentials Devices Common/VC/MockVC/MockVC.cs.orig rename to Essentials Devices Common/Essentials Devices Common/VideoCodec/MockVC/MockVC.cs.orig diff --git a/Essentials Devices Common/Essentials Devices Common/VC/VideoCodecBase.cs b/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs similarity index 82% rename from Essentials Devices Common/Essentials Devices Common/VC/VideoCodecBase.cs rename to Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs index a3dd9aa0..920bf1b8 100644 --- a/Essentials Devices Common/Essentials Devices Common/VC/VideoCodecBase.cs +++ b/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs @@ -1,134 +1,140 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Crestron.SimplSharp; - -using PepperDash.Core; -using PepperDash.Essentials.Core; - -namespace PepperDash.Essentials.Devices.Common.VideoCodec -{ - public abstract class VideoCodecBase : Device, IRoutingSinkWithSwitching, IUsageTracking, IHasDialer, IHasSharing, ICodecAudio - { - #region IUsageTracking Members - - /// - /// This object can be added by outside users of this class to provide usage tracking - /// for various services - /// - public UsageTracking UsageTracker { get; set; } - - #endregion - - #region IRoutingInputs Members - - public RoutingPortCollection InputPorts { get; private set; } - - #endregion - - public BoolFeedback InCallFeedback { get; private set; } - public BoolFeedback IncomingCallFeedback { get; private set; } - - abstract protected Func InCallFeedbackFunc { get; } - abstract protected Func IncomingCallFeedbackFunc { get; } - abstract protected Func PrivacyModeFeedbackFunc { get; } - abstract protected Func VolumeLevelFeedbackFunc { get; } - abstract protected Func MuteFeedbackFunc { get; } - abstract protected Func SharingSourceFeedbackFunc { get; } - - public VideoCodecBase(string key, string name) - : base(key, name) - { - InCallFeedback = new BoolFeedback(InCallFeedbackFunc); - IncomingCallFeedback = new BoolFeedback(IncomingCallFeedbackFunc); - PrivacyModeIsOnFeedback = new BoolFeedback(PrivacyModeFeedbackFunc); - VolumeLevelFeedback = new IntFeedback(VolumeLevelFeedbackFunc); - MuteFeedback = new BoolFeedback(MuteFeedbackFunc); - SharingSourceFeedback = new StringFeedback(SharingSourceFeedbackFunc); - - InputPorts = new RoutingPortCollection(); - - InCallFeedback.OutputChange += new EventHandler(InCallFeedback_OutputChange); - } - - /// - /// - /// - /// - /// - void InCallFeedback_OutputChange(object sender, EventArgs e) - { - if (UsageTracker != null) - { - if (InCallFeedback.BoolValue) - UsageTracker.StartDeviceUsage(); - else - UsageTracker.EndDeviceUsage(); - } - } - #region IHasDialer Members - - 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 - { - get - { - return new List - { - InCallFeedback, - IncomingCallFeedback, - PrivacyModeIsOnFeedback, - SharingSourceFeedback - }; - } - } - - public abstract void ExecuteSwitch(object selector); - - #region ICodecAudio Members - - public abstract void PrivacyModeOn(); - public abstract void PrivacyModeOff(); - public abstract void PrivacyModeToggle(); - public BoolFeedback PrivacyModeIsOnFeedback { get; private set; } - - - public BoolFeedback MuteFeedback { get; private set; } - - public abstract void MuteOff(); - - public abstract void MuteOn(); - - public abstract void SetVolume(ushort level); - - public IntFeedback VolumeLevelFeedback { get; private set; } - - public abstract void MuteToggle(); - - public abstract void VolumeDown(bool pressRelease); - - - public abstract void VolumeUp(bool pressRelease); - - #endregion - - #region IHasSharing Members - - public abstract void StartSharing(); - public abstract void StopSharing(); - - public StringFeedback SharingSourceFeedback { get; private set; } - - #endregion - - - } +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; + +using PepperDash.Core; +using PepperDash.Essentials.Core; + +namespace PepperDash.Essentials.Devices.Common.VideoCodec +{ + public abstract class VideoCodecBase : Device, IRoutingSinkWithSwitching, IUsageTracking, IHasDialer, IHasSharing, ICodecAudio + { + #region IUsageTracking Members + + /// + /// This object can be added by outside users of this class to provide usage tracking + /// for various services + /// + public UsageTracking UsageTracker { get; set; } + + #endregion + + #region IRoutingInputs Members + + public RoutingPortCollection InputPorts { get; private set; } + + #endregion + + public bool IsInCall { get { return ActiveCallCountFeedback.IntValue > 0; } } + + public BoolFeedback IncomingCallFeedback { get; private set; } + + public IntFeedback ActiveCallCountFeedback { get; private set; } + + abstract protected Func ActiveCallCountFeedbackFunc { get; } + abstract protected Func IncomingCallFeedbackFunc { get; } + abstract protected Func PrivacyModeIsOnFeedbackFunc { get; } + abstract protected Func VolumeLevelFeedbackFunc { get; } + abstract protected Func MuteFeedbackFunc { get; } + abstract protected Func SharingSourceFeedbackFunc { get; } + + public List ActiveCalls { get; set; } + + public VideoCodecBase(string key, string name) + : base(key, name) + { + ActiveCallCountFeedback = new IntFeedback(ActiveCallCountFeedbackFunc); + IncomingCallFeedback = new BoolFeedback(IncomingCallFeedbackFunc); + PrivacyModeIsOnFeedback = new BoolFeedback(PrivacyModeIsOnFeedbackFunc); + VolumeLevelFeedback = new IntFeedback(VolumeLevelFeedbackFunc); + MuteFeedback = new BoolFeedback(MuteFeedbackFunc); + SharingSourceFeedback = new StringFeedback(SharingSourceFeedbackFunc); + + InputPorts = new RoutingPortCollection(); + + ActiveCallCountFeedback.OutputChange += new EventHandler(ActiveCallCountFeedback_OutputChange); + + ActiveCalls = new List(); + } + + /// + /// + /// + /// + /// + void ActiveCallCountFeedback_OutputChange(object sender, EventArgs e) + { + if (UsageTracker != null) + { + if (IsInCall) + UsageTracker.StartDeviceUsage(); + else + UsageTracker.EndDeviceUsage(); + } + } + #region IHasDialer Members + + 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 + { + get + { + return new List + { + IncomingCallFeedback, + PrivacyModeIsOnFeedback, + SharingSourceFeedback + }; + } + } + + public abstract void ExecuteSwitch(object selector); + + #region ICodecAudio Members + + public abstract void PrivacyModeOn(); + public abstract void PrivacyModeOff(); + public abstract void PrivacyModeToggle(); + public BoolFeedback PrivacyModeIsOnFeedback { get; private set; } + + + public BoolFeedback MuteFeedback { get; private set; } + + public abstract void MuteOff(); + + public abstract void MuteOn(); + + public abstract void SetVolume(ushort level); + + public IntFeedback VolumeLevelFeedback { get; private set; } + + public abstract void MuteToggle(); + + public abstract void VolumeDown(bool pressRelease); + + + public abstract void VolumeUp(bool pressRelease); + + #endregion + + #region IHasSharing Members + + public abstract void StartSharing(); + public abstract void StopSharing(); + + public StringFeedback SharingSourceFeedback { get; private set; } + + #endregion + + + } } \ No newline at end of file diff --git a/Essentials Devices Common/Essentials Devices Common/VC/VideoCodecBase.cs.orig b/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs.orig similarity index 100% rename from Essentials Devices Common/Essentials Devices Common/VC/VideoCodecBase.cs.orig rename to Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs.orig diff --git a/Essentials/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs b/Essentials/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs index c1b3d22a..b8800d60 100644 --- a/Essentials/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs +++ b/Essentials/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs @@ -11,11 +11,40 @@ using PepperDash.Essentials.Devices.Common.VideoCodec; namespace PepperDash.Essentials { - public class EssentialsHuddleVtc1Room : EssentialsRoomBase, IHasCurrentSourceInfoChange + public class EssentialsHuddleVtc1Room : EssentialsRoomBase, IHasCurrentSourceInfoChange, IPrivacy { public event EventHandler CurrentVolumeDeviceChange; public event SourceInfoChangeHandler CurrentSingleSourceChange; + + //************************ + // Call-related stuff + + public BoolFeedback InCallFeedback { get; private set; } + + /// + /// Make this more specific + /// + public List ActiveCalls { get; private set; } + + /// + /// States: 0 for on hook, 1 for video, 2 for audio, 3 for telekenesis + /// + public IntFeedback CallTypeFeedback { get; private set; } + + /// + /// + /// + public BoolFeedback PrivacyModeIsOnFeedback { get; private set; } + + /// + /// When something in the room is sharing with the far end or through other means + /// + public BoolFeedback IsSharingFeedback { get; private set; } + + //************************ + + protected override Func OnFeedbackFunc { get @@ -162,6 +191,7 @@ namespace PepperDash.Essentials DefaultDisplay = defaultDisplay; VideoCodec = vc; DefaultAudioDevice = defaultAudio; + if (defaultAudio is IBasicVolumeControls) DefaultVolumeControls = defaultAudio as IBasicVolumeControls; else if (defaultAudio is IHasVolumeDevice) @@ -195,6 +225,12 @@ namespace PepperDash.Essentials (DefaultDisplay as IBasicVolumeWithFeedback).SetVolume(DefaultVolume); }; } + + InCallFeedback = new BoolFeedback(() => false); //################################################### + IsSharingFeedback = new BoolFeedback(() => false); //########################################################## + PrivacyModeIsOnFeedback = new BoolFeedback(() => false); //#################################################### + CallTypeFeedback = new IntFeedback(() => 0); //###################################################### + SourceListKey = "default"; EnablePowerOnToLastSource = true; @@ -401,5 +437,25 @@ namespace PepperDash.Essentials foreach (var room in allRooms) (room as EssentialsHuddleSpaceRoom).RunRouteAction("roomOff"); } - } + + #region IPrivacy Members + + + public void PrivacyModeOff() + { + // Turn off privacy on all things (codec only for now) + } + + public void PrivacyModeOn() + { + // Turn on ... + } + + public void PrivacyModeToggle() + { + + } + + #endregion + } } \ No newline at end of file diff --git a/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs b/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs index 163432ad..6cce71d9 100644 --- a/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs +++ b/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs @@ -93,7 +93,7 @@ namespace PepperDash.Essentials.UIDrivers.VC DialStringBackspaceVisibleFeedback .LinkInputSig(TriList.BooleanInput[UIBoolJoin.KeyboardClearVisible]); - Codec.InCallFeedback.OutputChange += new EventHandler(InCallFeedback_OutputChange); + Codec.ActiveCallCountFeedback.OutputChange += new EventHandler(InCallFeedback_OutputChange); } /// @@ -190,7 +190,7 @@ namespace PepperDash.Essentials.UIDrivers.VC /// void ConnectPress() { - if (Codec.InCallFeedback.BoolValue) + if (Codec.IsInCall) Codec.EndCall(); else Codec.Dial(DialStringBuilder.ToString()); @@ -201,13 +201,13 @@ namespace PepperDash.Essentials.UIDrivers.VC /// void InCallFeedback_OutputChange(object sender, EventArgs e) { - var inCall = Codec.InCallFeedback.BoolValue; + var inCall = Codec.IsInCall; Debug.Console(1, "*#* Codec Driver InCallFeedback change={0}", InCall); TriList.UShortInput[UIUshortJoin.VCStagingConnectButtonMode].UShortValue = (ushort)(inCall ? 1 : 0); StagingBarInterlock.ShowInterlocked( inCall ? UIBoolJoin.VCStagingActivePopoverVisible : UIBoolJoin.VCStagingInactivePopoverVisible); - - if (Codec.InCallFeedback.BoolValue) // Call is starting + + if (Codec.IsInCall) // Call is starting { // Header icon // Volume bar needs to have mic mute diff --git a/Release Package/PepperDashEssentials.cpz b/Release Package/PepperDashEssentials.cpz index ae9fb33e..5b4033f2 100644 Binary files a/Release Package/PepperDashEssentials.cpz and b/Release Package/PepperDashEssentials.cpz differ diff --git a/Release Package/PepperDashEssentials.dll b/Release Package/PepperDashEssentials.dll index bfd8e389..7c3da2ff 100644 Binary files a/Release Package/PepperDashEssentials.dll and b/Release Package/PepperDashEssentials.dll differ