mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-17 21:54:54 +00:00
Push before merge with Heath
This commit is contained in:
@@ -13,7 +13,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
{
|
{
|
||||||
// Add requirements for Dialer functionality
|
// Add requirements for Dialer functionality
|
||||||
|
|
||||||
void Dial();
|
void Dial(string number);
|
||||||
void EndCall();
|
void EndCall();
|
||||||
void AcceptCall();
|
void AcceptCall();
|
||||||
void RejectCall();
|
void RejectCall();
|
||||||
|
|||||||
@@ -46,9 +46,9 @@
|
|||||||
<GenerateSerializationAssemblies>off</GenerateSerializationAssemblies>
|
<GenerateSerializationAssemblies>off</GenerateSerializationAssemblies>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Cisco One Button To Push, Version=1.0.0.30876, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Cisco One Button To Push, Version=1.0.0.29558, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\..\CodeBlue\libraries\Cisco CODEC\Cisco One Button To Push\Cisco One Button To Push\bin\Cisco One Button To Push.dll</HintPath>
|
<HintPath>..\..\..\Crestron Cisco OBTP\OBTP\bin\Cisco One Button To Push.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Cisco SX80 Corporate Phone Book, Version=1.0.0.15355, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Cisco SX80 Corporate Phone Book, Version=1.0.0.15355, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharp.Net.Http;
|
using Crestron.SimplSharp.Net.Https;
|
||||||
using Crestron.SimplSharp.CrestronXml;
|
using Crestron.SimplSharp.CrestronXml;
|
||||||
using Crestron.SimplSharp.CrestronXml.Serialization;
|
using Crestron.SimplSharp.CrestronXml.Serialization;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
@@ -31,7 +31,7 @@ namespace PepperDash.Essentials.Devices.VideoCodec.Cisco
|
|||||||
|
|
||||||
private CiscoCodecStatus.Status CodecStatus;
|
private CiscoCodecStatus.Status CodecStatus;
|
||||||
|
|
||||||
private HttpClient Client;
|
private HttpsClient Client;
|
||||||
|
|
||||||
private HttpApiServer Server;
|
private HttpApiServer Server;
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ namespace PepperDash.Essentials.Devices.VideoCodec.Cisco
|
|||||||
|
|
||||||
CodecStatus = new CiscoCodecStatus.Status();
|
CodecStatus = new CiscoCodecStatus.Status();
|
||||||
|
|
||||||
Client = new HttpClient();
|
Client = new HttpsClient();
|
||||||
|
|
||||||
Server = new HttpApiServer();
|
Server = new HttpApiServer();
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@ namespace PepperDash.Essentials.Devices.VideoCodec.Cisco
|
|||||||
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 2000, 120000, 300000, "xStatus SystemUnit Software Version\r");
|
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 2000, 120000, 300000, "xStatus SystemUnit Software Version\r");
|
||||||
DeviceManager.AddDevice(CommunicationMonitor);
|
DeviceManager.AddDevice(CommunicationMonitor);
|
||||||
|
|
||||||
Client = new HttpClient();
|
Client = new HttpsClient();
|
||||||
|
|
||||||
Client.Verbose = true;
|
Client.Verbose = true;
|
||||||
Client.KeepAlive = true;
|
Client.KeepAlive = true;
|
||||||
@@ -108,7 +108,7 @@ namespace PepperDash.Essentials.Devices.VideoCodec.Cisco
|
|||||||
|
|
||||||
//CodecObtp.GetMeetings();
|
//CodecObtp.GetMeetings();
|
||||||
|
|
||||||
PhoneBook.DownloadPhoneBook(Corporate_Phone_Book.ePhoneBookLocation.Corporate);
|
//PhoneBook.DownloadPhoneBook(Corporate_Phone_Book.ePhoneBookLocation.Corporate);
|
||||||
|
|
||||||
return base.CustomActivate();
|
return base.CustomActivate();
|
||||||
}
|
}
|
||||||
@@ -125,13 +125,16 @@ namespace PepperDash.Essentials.Devices.VideoCodec.Cisco
|
|||||||
|
|
||||||
private void SendHttpCommand(string command, eCommandType commandType)
|
private void SendHttpCommand(string command, eCommandType commandType)
|
||||||
{
|
{
|
||||||
HttpClientRequest request = new HttpClientRequest();
|
HttpsClientRequest request = new HttpsClientRequest();
|
||||||
|
|
||||||
string urlSuffix = null;
|
string urlSuffix = null;
|
||||||
|
|
||||||
Client.UserName = null;
|
Client.UserName = null;
|
||||||
Client.Password = null;
|
Client.Password = null;
|
||||||
|
|
||||||
|
Client.PeerVerification = false;
|
||||||
|
Client.HostVerification = false;
|
||||||
|
|
||||||
request.RequestType = RequestType.Post;
|
request.RequestType = RequestType.Post;
|
||||||
|
|
||||||
if(!string.IsNullOrEmpty(HttpSessionId))
|
if(!string.IsNullOrEmpty(HttpSessionId))
|
||||||
@@ -165,13 +168,15 @@ namespace PepperDash.Essentials.Devices.VideoCodec.Cisco
|
|||||||
case eCommandType.GetStatus:
|
case eCommandType.GetStatus:
|
||||||
{
|
{
|
||||||
request.RequestType = RequestType.Get;
|
request.RequestType = RequestType.Get;
|
||||||
urlSuffix = "/status.xml";
|
request.Header.SetHeaderValue("Content-Type", "text/xml");
|
||||||
|
urlSuffix = "/getxml?location=/Status";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case eCommandType.GetConfiguration:
|
case eCommandType.GetConfiguration:
|
||||||
{
|
{
|
||||||
request.RequestType = RequestType.Get;
|
request.RequestType = RequestType.Get;
|
||||||
urlSuffix = "/configuration.xml";
|
request.Header.SetHeaderValue("Content-Type", "text/xml");
|
||||||
|
urlSuffix = "/getxml?location=/Configuration";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -185,7 +190,7 @@ namespace PepperDash.Essentials.Devices.VideoCodec.Cisco
|
|||||||
Client.DispatchAsync(request, PostConnectionCallback);
|
Client.DispatchAsync(request, PostConnectionCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PostConnectionCallback(HttpClientResponse resp, HTTP_CALLBACK_ERROR err)
|
void PostConnectionCallback(HttpsClientResponse resp, HTTP_CALLBACK_ERROR err)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -199,9 +204,6 @@ namespace PepperDash.Essentials.Devices.VideoCodec.Cisco
|
|||||||
{
|
{
|
||||||
// Get the initial configruation for sync purposes
|
// Get the initial configruation for sync purposes
|
||||||
SendHttpCommand("", eCommandType.GetConfiguration);
|
SendHttpCommand("", eCommandType.GetConfiguration);
|
||||||
|
|
||||||
// Get the initial status for sync purposes
|
|
||||||
SendHttpCommand("", eCommandType.GetStatus);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -209,20 +211,31 @@ namespace PepperDash.Essentials.Devices.VideoCodec.Cisco
|
|||||||
{
|
{
|
||||||
if (resp.ContentString.IndexOf("</Configuration>") > -1)
|
if (resp.ContentString.IndexOf("</Configuration>") > -1)
|
||||||
{
|
{
|
||||||
CodecConfiguration = CrestronXMLSerialization.DeSerializeObject<CiscoCodecConfiguration.Configuration>(resp.ContentString);
|
XmlReaderSettings settings = new XmlReaderSettings();
|
||||||
|
|
||||||
|
XmlReader reader = new XmlReader(resp.ContentString, settings);
|
||||||
|
|
||||||
|
CodecConfiguration = CrestronXMLSerialization.DeSerializeObject<CiscoCodecConfiguration.Configuration>(reader);
|
||||||
|
|
||||||
Debug.Console(1, this, "Product Name: {0} Software Version: {1} ApiVersion: {2}", CodecConfiguration.Product, CodecConfiguration.Version, CodecConfiguration.ApiVersion);
|
Debug.Console(1, this, "Product Name: {0} Software Version: {1} ApiVersion: {2}", CodecConfiguration.Product, CodecConfiguration.Version, CodecConfiguration.ApiVersion);
|
||||||
|
|
||||||
|
// Get the initial status for sync purposes
|
||||||
|
SendHttpCommand("", eCommandType.GetStatus);
|
||||||
}
|
}
|
||||||
else if (resp.ContentString.IndexOf("</Status>") > -1)
|
else if (resp.ContentString.IndexOf("</Status>") > -1)
|
||||||
{
|
{
|
||||||
CodecStatus = CrestronXMLSerialization.DeSerializeObject<CiscoCodecStatus.Status>(resp.ContentString);
|
XmlReaderSettings settings = new XmlReaderSettings();
|
||||||
|
|
||||||
|
XmlReader reader = new XmlReader(resp.ContentString, settings);
|
||||||
|
|
||||||
|
CodecStatus = CrestronXMLSerialization.DeSerializeObject<CiscoCodecStatus.Status>(reader);
|
||||||
|
|
||||||
Debug.Console(1, this, "Product Name: {0} Software Version: {1} ApiVersion: {2} Volume: {3}", CodecStatus.Product, CodecStatus.Version, CodecStatus.ApiVersion, CodecStatus.Audio.Volume);
|
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)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "Error Deserializing feedback from codec: {0}", ex);
|
Debug.Console(1, this, "Error Deserializing XML document from codec: {0}", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
|
|
||||||
// CODEC TESTING
|
// CODEC TESTING
|
||||||
GenericSshClient TestCodecClient = new GenericSshClient("TestCodec-1--SshClient", "10.11.50.135", 22, "crestron", "e##3nti@ls");
|
GenericSshClient TestCodecClient = new GenericSshClient("TestCodec-1--SshClient", "10.11.50.135", 22, "crestron", "2H3Zu&OvgXp6");
|
||||||
|
|
||||||
PepperDash.Essentials.Devices.VideoCodec.Cisco.CiscoCodec TestCodec =
|
PepperDash.Essentials.Devices.VideoCodec.Cisco.CiscoCodec TestCodec =
|
||||||
new PepperDash.Essentials.Devices.VideoCodec.Cisco.CiscoCodec("TestCodec-1", "Cisco Spark Room Kit", TestCodecClient, 8080);
|
new PepperDash.Essentials.Devices.VideoCodec.Cisco.CiscoCodec("TestCodec-1", "Cisco Spark Room Kit", TestCodecClient, 8080);
|
||||||
|
|||||||
Reference in New Issue
Block a user