mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 12:44:58 +00:00
Merge remote-tracking branch 'origin/feature/ecs-407' into feature/cisco-spark-2
Conflicts: Essentials Devices Common/Essentials Devices Common/Codec/CodecActiveCallItem.cs
This commit is contained in:
@@ -6,34 +6,6 @@ using Crestron.SimplSharp;
|
|||||||
|
|
||||||
namespace PepperDash.Essentials.Core
|
namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Requirements for a device that has dialing capabilities
|
|
||||||
/// </summary>
|
|
||||||
public interface IHasDialer
|
|
||||||
{
|
|
||||||
// Add requirements for Dialer functionality
|
|
||||||
|
|
||||||
void Dial(string number);
|
|
||||||
void EndCall(object activeCall);
|
|
||||||
void EndAllCalls();
|
|
||||||
void AcceptCall();
|
|
||||||
void RejectCall();
|
|
||||||
void SendDtmf(string digit);
|
|
||||||
|
|
||||||
IntFeedback ActiveCallCountFeedback { get; }
|
|
||||||
BoolFeedback IncomingCallFeedback { get; }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Defines minimum volume controls for a codec device with dialing capabilities
|
|
||||||
/// </summary>
|
|
||||||
public interface ICodecAudio : IBasicVolumeWithFeedback, IPrivacy
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds control of codec receive volume
|
/// Adds control of codec receive volume
|
||||||
|
|||||||
@@ -0,0 +1,92 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Requirements for a device that has dialing capabilities
|
||||||
|
/// </summary>
|
||||||
|
public interface IHasDialer
|
||||||
|
{
|
||||||
|
// Add requirements for Dialer functionality
|
||||||
|
|
||||||
|
void Dial(string number);
|
||||||
|
<<<<<<< HEAD
|
||||||
|
void EndCall(string number);
|
||||||
|
=======
|
||||||
|
void EndCall(object activeCall);
|
||||||
|
void EndAllCalls();
|
||||||
|
>>>>>>> origin/feature/cisco-spark-2
|
||||||
|
void AcceptCall();
|
||||||
|
void RejectCall();
|
||||||
|
void SendDtmf(string digit);
|
||||||
|
|
||||||
|
IntFeedback ActiveCallCountFeedback { get; }
|
||||||
|
BoolFeedback IncomingCallFeedback { get; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines minimum volume controls for a codec device with dialing capabilities
|
||||||
|
/// </summary>
|
||||||
|
public interface ICodecAudio : IBasicVolumeWithFeedback, IPrivacy
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds control of codec receive volume
|
||||||
|
/// </summary>
|
||||||
|
public interface IReceiveVolume
|
||||||
|
{
|
||||||
|
// Break this out into 3 interfaces
|
||||||
|
void SetReceiveVolume(ushort level);
|
||||||
|
void ReceiveMuteOn();
|
||||||
|
void ReceiveMuteOff();
|
||||||
|
void ReceiveMuteToggle();
|
||||||
|
IntFeedback ReceiveLevelFeedback { get; }
|
||||||
|
BoolFeedback ReceiveMuteIsOnFeedback { get; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds control of codec transmit volume
|
||||||
|
/// </summary>
|
||||||
|
public interface ITransmitVolume
|
||||||
|
{
|
||||||
|
void SetTransmitVolume(ushort level);
|
||||||
|
void TransmitMuteOn();
|
||||||
|
void TransmitMuteOff();
|
||||||
|
void TransmitMuteToggle();
|
||||||
|
IntFeedback TransmitLevelFeedback { get; }
|
||||||
|
BoolFeedback TransmitMuteIsOnFeedback { get; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds control of codec privacy function (microphone mute)
|
||||||
|
/// </summary>
|
||||||
|
public interface IPrivacy
|
||||||
|
{
|
||||||
|
void PrivacyModeOn();
|
||||||
|
void PrivacyModeOff();
|
||||||
|
void PrivacyModeToggle();
|
||||||
|
BoolFeedback PrivacyModeIsOnFeedback { get; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IHasCallHistory
|
||||||
|
{
|
||||||
|
// Add recent calls list
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IHasDirectory
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IHasObtp
|
||||||
|
{
|
||||||
|
|
||||||
|
// Upcoming Meeting warning event
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Devices.Common.Codec
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Defines minimum volume controls for a codec device with dialing capabilities
|
||||||
|
/// </summary>
|
||||||
|
public interface ICodecAudio : IBasicVolumeWithFeedback, IPrivacy
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Devices.Common.Codec
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Requirements for a device that has dialing capabilities
|
||||||
|
/// </summary>
|
||||||
|
public interface IHasDialer
|
||||||
|
{
|
||||||
|
// Add requirements for Dialer functionality
|
||||||
|
|
||||||
|
void Dial(string number);
|
||||||
|
void EndCall(CodecActiveCallItem activeCall);
|
||||||
|
void EndAllCalls();
|
||||||
|
void AcceptCall(CodecActiveCallItem item);
|
||||||
|
void RejectCall(CodecActiveCallItem item);
|
||||||
|
void SendDtmf(string digit);
|
||||||
|
|
||||||
|
IntFeedback ActiveCallCountFeedback { get; }
|
||||||
|
BoolFeedback IncomingCallFeedback { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -103,6 +103,8 @@
|
|||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="Codec\iCodecAudio.cs" />
|
||||||
|
<Compile Include="Codec\iHasDialer.cs" />
|
||||||
<Compile Include="Crestron\Gateways\CenRfgwController.cs" />
|
<Compile Include="Crestron\Gateways\CenRfgwController.cs" />
|
||||||
<Compile Include="Display\ComTcpDisplayBase.cs" />
|
<Compile Include="Display\ComTcpDisplayBase.cs" />
|
||||||
<Compile Include="Display\SamsungMDCDisplay.cs" />
|
<Compile Include="Display\SamsungMDCDisplay.cs" />
|
||||||
@@ -131,7 +133,7 @@
|
|||||||
<Compile Include="VideoCodec\CiscoCodec\xConfiguration.cs" />
|
<Compile Include="VideoCodec\CiscoCodec\xConfiguration.cs" />
|
||||||
<Compile Include="VideoCodec\CiscoCodec\xEvent.cs" />
|
<Compile Include="VideoCodec\CiscoCodec\xEvent.cs" />
|
||||||
<Compile Include="VideoCodec\CiscoCodec\HttpApiServer.cs" />
|
<Compile Include="VideoCodec\CiscoCodec\HttpApiServer.cs" />
|
||||||
<Compile Include="VideoCodec\CodecActiveCallItem.cs" />
|
<Compile Include="Codec\CodecActiveCallItem.cs" />
|
||||||
<Compile Include="VideoCodec\MockVC\MockVC.cs" />
|
<Compile Include="VideoCodec\MockVC\MockVC.cs" />
|
||||||
<Compile Include="VideoCodec\CiscoCodec\xStatus.cs" />
|
<Compile Include="VideoCodec\CiscoCodec\xStatus.cs" />
|
||||||
<Compile Include="VideoCodec\VideoCodecBase.cs" />
|
<Compile Include="VideoCodec\VideoCodecBase.cs" />
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ using Cisco_SX80_Corporate_Phone_Book;
|
|||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Routing;
|
using PepperDash.Essentials.Core.Routing;
|
||||||
|
using PepperDash.Essentials.Devices.Common.Codec;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||||
{
|
{
|
||||||
@@ -654,12 +655,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void AcceptCall()
|
public override void AcceptCall(CodecActiveCallItem item)
|
||||||
{
|
{
|
||||||
SendText("xCommand Call Accept");
|
SendText("xCommand Call Accept");
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void RejectCall()
|
public override void RejectCall(CodecActiveCallItem item)
|
||||||
{
|
{
|
||||||
SendText("xCommand Call Reject");
|
SendText("xCommand Call Reject");
|
||||||
}
|
}
|
||||||
@@ -801,7 +802,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
|
|
||||||
protected override Func<int> ActiveCallCountFeedbackFunc
|
protected override Func<int> ActiveCallCountFeedbackFunc
|
||||||
{
|
{
|
||||||
get { throw new NotImplementedException(); }
|
get { return () => 0; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,785 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and returns the scaled volume of the codec
|
||||||
|
/// </summary>
|
||||||
|
protected override Func<int> VolumeLevelFeedbackFunc
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return () => CrestronEnvironment.ScaleWithLimits(CodecStatus.Status.Audio.Volume.IntValue, 100, 0, 65535, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override Func<bool> PrivacyModeIsOnFeedbackFunc
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return () => CodecStatus.Status.Audio.Microphones.Mute.BoolValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Func<bool> StandbyStateFeedbackFunc
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return () => CodecStatus.Status.Standby.State.BoolValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override Func<string> SharingSourceFeedbackFunc
|
||||||
|
{
|
||||||
|
get { return () => "Fix me fuckers"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override Func<bool> 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();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Starts the HTTP feedback server and syncronizes state of codec
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
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<GenericSocketStatusChageEventArgs>(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<Crestron.SimplSharp.Net.Http.OnHttpRequestArgs>(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 =
|
||||||
|
// "<Command><HttpFeedback><Register command=\"True\"><FeedbackSlot>1</FeedbackSlot>" +
|
||||||
|
// string.Format("<ServerUrl>http://{0}:{1}/cisco/api</ServerUrl>", CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0), ServerPort) +
|
||||||
|
// "<Format>JSON</Format>" +
|
||||||
|
// "<Expression item=\"1\">/Configuration</Expression>" +
|
||||||
|
// "<Expression item=\"2\">/Event/CallDisconnect</Expression>" +
|
||||||
|
// "<Expression item=\"3\">/Status/Call</Expression>" +
|
||||||
|
// "</Register>" +
|
||||||
|
// "</HttpFeedback>" +
|
||||||
|
// "</Command>";
|
||||||
|
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 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.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dev"></param>
|
||||||
|
/// <param name="args"></param>
|
||||||
|
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("<HttpFeedbackRegisterResult status=\"OK\">") > 1)
|
||||||
|
// // {
|
||||||
|
// // // Get the initial configruation for sync purposes
|
||||||
|
// // SendHttpCommand("", eCommandType.GetConfiguration);
|
||||||
|
// // }
|
||||||
|
// // else
|
||||||
|
// // {
|
||||||
|
// // try
|
||||||
|
// // {
|
||||||
|
// // if (resp.ContentString.IndexOf("</Configuration>") > -1)
|
||||||
|
// // {
|
||||||
|
// // XmlReaderSettings settings = new XmlReaderSettings();
|
||||||
|
|
||||||
|
// // XmlReader reader = new XmlReader(resp.ContentString, settings);
|
||||||
|
|
||||||
|
// // CodecConfiguration = CrestronXMLSerialization.DeSerializeObject<CiscoCodecConfiguration.RootObject>(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("</Status>") > -1)
|
||||||
|
// // {
|
||||||
|
// // XmlReaderSettings settings = new XmlReaderSettings();
|
||||||
|
|
||||||
|
// // XmlReader reader = new XmlReader(resp.ContentString, settings);
|
||||||
|
|
||||||
|
// // CodecStatus = CrestronXMLSerialization.DeSerializeObject<CiscoCodecStatus.RootObject>(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<bool> InCallFeedbackFunc { get { return () => false; } }
|
||||||
|
|
||||||
|
protected override Func<bool> IncomingCallFeedbackFunc { get { return () => false; } }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the first CallId or returns null
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
|
public override void EndCall(string s)
|
||||||
|
{
|
||||||
|
SendText(string.Format("xCommand Call Disconnect CallId: {0}", GetCallId()));
|
||||||
|
=======
|
||||||
|
public override void EndCall(CodecActiveCallItem activeCall)
|
||||||
|
{
|
||||||
|
SendText(string.Format("xCommand Call Disconnect CallId: {0}", activeCall.Id));
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void EndAllCalls()
|
||||||
|
{
|
||||||
|
foreach (CodecActiveCallItem activeCall in ActiveCalls)
|
||||||
|
{
|
||||||
|
SendText(string.Format("xCommand Call Disconnect CallId: {0}", activeCall.Id));
|
||||||
|
}
|
||||||
|
>>>>>>> origin/feature/cisco-spark-2
|
||||||
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Select source 1 as the presetnation source
|
||||||
|
/// </summary>
|
||||||
|
public void SelectPresentationSource1()
|
||||||
|
{
|
||||||
|
SelectPresentationSource(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Select source 2 as the presetnation source
|
||||||
|
/// </summary>
|
||||||
|
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");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Increments the voluem
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pressRelease"></param>
|
||||||
|
public override void VolumeUp(bool pressRelease)
|
||||||
|
{
|
||||||
|
SendText("xCommand Audio Volume Increase");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Decrements the volume
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pressRelease"></param>
|
||||||
|
public override void VolumeDown(bool pressRelease)
|
||||||
|
{
|
||||||
|
SendText("xCommand Audio Volume Decrease");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Scales the level and sets the codec to the specified level within its range
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="level">level from slider (0-65535 range)</param>
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Recalls the default volume on the codec
|
||||||
|
/// </summary>
|
||||||
|
public void VolumeSetToDefault()
|
||||||
|
{
|
||||||
|
SendText("xCommand Audio Volume SetToDefault");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Puts the codec in standby mode
|
||||||
|
/// </summary>
|
||||||
|
public void StandbyActivate()
|
||||||
|
{
|
||||||
|
SendText("xCommand Standby Activate");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Wakes the codec from standby
|
||||||
|
/// </summary>
|
||||||
|
public void StandbyDeactivate()
|
||||||
|
{
|
||||||
|
SendText("xCommand Standby Deactivate");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Reboots the codec
|
||||||
|
/// </summary>
|
||||||
|
public void Reboot()
|
||||||
|
{
|
||||||
|
SendText("xCommand SystemUnit Boot Action: Restart");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override Func<int> ActiveCallCountFeedbackFunc
|
||||||
|
{
|
||||||
|
get { return () => 0; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Tracks the initial sycnronization state of the codec when making a connection
|
||||||
|
/// </summary>
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
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; set; }
|
||||||
|
|
||||||
|
public string Number { get; set; }
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
|
public eCodecCallType Type { get; private set; }
|
||||||
|
|
||||||
|
public CodecActiveCallItem(string name, string number, eCodecCallType type)
|
||||||
|
{
|
||||||
|
Name = name;
|
||||||
|
Number = number;
|
||||||
|
Type = type;
|
||||||
|
}
|
||||||
|
=======
|
||||||
|
public eCodecCallType Type { get; set; }
|
||||||
|
|
||||||
|
public eCodecCallStatus Status { get; set; }
|
||||||
|
|
||||||
|
public string Id { get; set; }
|
||||||
|
>>>>>>> origin/feature/cisco-spark-2
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum eCodecCallType
|
||||||
|
{
|
||||||
|
None, Audio, Video
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum eCodecCallStatus
|
||||||
|
{
|
||||||
|
Dialing, Established, Incoming
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,30 +6,29 @@ using Crestron.SimplSharp;
|
|||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Routing;
|
||||||
|
using PepperDash.Essentials.Devices.Common.Codec;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||||
{
|
{
|
||||||
public class MockVC : VideoCodecBase
|
public class MockVC : VideoCodecBase, IRoutingOutputs
|
||||||
{
|
{
|
||||||
public MockVC(string key, string name)
|
public MockVC(string key, string name)
|
||||||
: base(key, name)
|
: base(key, name)
|
||||||
{
|
{
|
||||||
MuteFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Mute={0}", _IsMuted);
|
// Debug helpers
|
||||||
VolumeLevelFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Volume={0}", _VolumeLevel);
|
ActiveCallCountFeedback.OutputChange += (o, a) => Debug.Console(1, this, "InCall={0}", ActiveCallCountFeedback.IntValue);
|
||||||
ActiveCallCountFeedback.OutputChange += (o, a) => Debug.Console(1, this, "InCall={0}", _ActiveCallCount);
|
|
||||||
IncomingCallFeedback.OutputChange += (o, a) => Debug.Console(1, this, "IncomingCall={0}", _IncomingCall);
|
IncomingCallFeedback.OutputChange += (o, a) => Debug.Console(1, this, "IncomingCall={0}", _IncomingCall);
|
||||||
//ReceiveLevelFeedback.OutputChange += (o, a) => Debug.Console(1, this, "ReceiveLevel={0}", _ReceiveLevel);
|
MuteFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Mute={0}", _IsMuted);
|
||||||
//ReceiveMuteIsOnFeedback.OutputChange += (o, a) => Debug.Console(1, this, "ReceiveMute={0}", _ReceiveMute);
|
PrivacyModeIsOnFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Privacy={0}", _PrivacyModeIsOn);
|
||||||
//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);
|
SharingSourceFeedback.OutputChange += (o, a) => Debug.Console(1, this, "SharingSource={0}", _SharingSource);
|
||||||
}
|
VolumeLevelFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Volume={0}", _VolumeLevel);
|
||||||
|
}
|
||||||
|
|
||||||
protected override Func<int> ActiveCallCountFeedbackFunc
|
protected override Func<int> ActiveCallCountFeedbackFunc
|
||||||
{
|
{
|
||||||
get { return () => _ActiveCallCount; }
|
get { return () => ActiveCalls.Count; }
|
||||||
}
|
}
|
||||||
int _ActiveCallCount;
|
|
||||||
|
|
||||||
protected override Func<bool> IncomingCallFeedbackFunc
|
protected override Func<bool> IncomingCallFeedbackFunc
|
||||||
{
|
{
|
||||||
@@ -37,29 +36,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
}
|
}
|
||||||
bool _IncomingCall;
|
bool _IncomingCall;
|
||||||
|
|
||||||
//protected override Func<int> TransmitLevelFeedbackFunc
|
protected override Func<bool> MuteFeedbackFunc
|
||||||
//{
|
{
|
||||||
// get { return () => _TransmitLevel; }
|
get { return () => _IsMuted; }
|
||||||
//}
|
}
|
||||||
//int _TransmitLevel;
|
bool _IsMuted;
|
||||||
|
|
||||||
//protected override Func<bool> TransmitMuteFeedbackFunc
|
|
||||||
//{
|
|
||||||
// get { return () => _TransmitMute; }
|
|
||||||
//}
|
|
||||||
//bool _TransmitMute;
|
|
||||||
|
|
||||||
//protected override Func<int> ReceiveLevelFeedbackFunc
|
|
||||||
//{
|
|
||||||
// get { return () => _ReceiveLevel; }
|
|
||||||
//}
|
|
||||||
//int _ReceiveLevel;
|
|
||||||
|
|
||||||
//protected override Func<bool> ReceiveMuteFeedbackFunc
|
|
||||||
//{
|
|
||||||
// get { return () => _ReceiveMute; }
|
|
||||||
//}
|
|
||||||
//bool _ReceiveMute;
|
|
||||||
|
|
||||||
protected override Func<bool> PrivacyModeIsOnFeedbackFunc
|
protected override Func<bool> PrivacyModeIsOnFeedbackFunc
|
||||||
{
|
{
|
||||||
@@ -67,33 +48,36 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
}
|
}
|
||||||
bool _PrivacyModeIsOn;
|
bool _PrivacyModeIsOn;
|
||||||
|
|
||||||
protected override Func<int> VolumeLevelFeedbackFunc
|
|
||||||
{
|
|
||||||
get { return () => _VolumeLevel; }
|
|
||||||
}
|
|
||||||
int _VolumeLevel;
|
|
||||||
|
|
||||||
protected override Func<bool> MuteFeedbackFunc
|
|
||||||
{
|
|
||||||
get { return () => _IsMuted; }
|
|
||||||
}
|
|
||||||
bool _IsMuted;
|
|
||||||
|
|
||||||
protected override Func<string> SharingSourceFeedbackFunc
|
protected override Func<string> SharingSourceFeedbackFunc
|
||||||
{
|
{
|
||||||
get { return () => _SharingSource; }
|
get { return () => _SharingSource; }
|
||||||
}
|
}
|
||||||
string _SharingSource;
|
string _SharingSource;
|
||||||
|
|
||||||
|
protected override Func<int> VolumeLevelFeedbackFunc
|
||||||
|
{
|
||||||
|
get { return () => _VolumeLevel; }
|
||||||
|
}
|
||||||
|
int _VolumeLevel;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Dials, yo!
|
/// Dials, yo!
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override void Dial(string s)
|
public override void Dial(string s)
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "Dial: {0}", s);
|
Debug.Console(1, this, "Dial: {0}", s);
|
||||||
|
var item = new CodecActiveCallItem() { Name = s, Number = s, Id = s, Status = eCodecCallStatus.Dialing };
|
||||||
//_InCall = true;
|
ActiveCalls.Add(item);
|
||||||
//IsInCall.FireUpdate();
|
OnCallStatusChange(eCodecCallStatus.Unknown, item.Status, item);
|
||||||
|
ActiveCallCountFeedback.FireUpdate();
|
||||||
|
// Simulate 2-second ring
|
||||||
|
new CTimer(o =>
|
||||||
|
{
|
||||||
|
var prevStatus = item.Status;
|
||||||
|
item.Status = eCodecCallStatus.Connected;
|
||||||
|
item.Type = eCodecCallType.Video;
|
||||||
|
OnCallStatusChange(prevStatus, item.Status, item);
|
||||||
|
}, 2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -102,27 +86,36 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
public override void EndCall(CodecActiveCallItem activeCall)
|
public override void EndCall(CodecActiveCallItem activeCall)
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "EndCall");
|
Debug.Console(1, this, "EndCall");
|
||||||
//_InCall = false;
|
ActiveCalls.Remove(activeCall);
|
||||||
//IsInCall.FireUpdate();
|
var prevStatus = activeCall.Status;
|
||||||
|
activeCall.Status = eCodecCallStatus.Disconnected;
|
||||||
|
OnCallStatusChange(prevStatus, activeCall.Status, activeCall);
|
||||||
|
ActiveCallCountFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public override void EndAllCalls()
|
public override void EndAllCalls()
|
||||||
{
|
{
|
||||||
|
Debug.Console(1, this, "EndAllCalls");
|
||||||
|
ActiveCalls.Clear();
|
||||||
|
ActiveCallCountFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// For a call from the test methods below
|
/// For a call from the test methods below
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override void AcceptCall()
|
public override void AcceptCall(CodecActiveCallItem item)
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "AcceptCall");
|
Debug.Console(1, this, "AcceptCall");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// For a call from the test methods below
|
/// For a call from the test methods below
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override void RejectCall()
|
public override void RejectCall(CodecActiveCallItem item)
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "RejectCall");
|
Debug.Console(1, this, "RejectCall");
|
||||||
}
|
}
|
||||||
@@ -136,14 +129,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
Debug.Console(1, this, "SendDTMF: {0}", s);
|
Debug.Console(1, this, "SendDTMF: {0}", s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public override void StartSharing()
|
public override void StartSharing()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public override void StopSharing()
|
public override void StopSharing()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -154,116 +151,64 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
{
|
{
|
||||||
Debug.Console(1, this, "ExecuteSwitch");
|
Debug.Console(1, this, "ExecuteSwitch");
|
||||||
_SharingSource = selector.ToString();
|
_SharingSource = selector.ToString();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public override void MuteOff()
|
public override void MuteOff()
|
||||||
{
|
{
|
||||||
_IsMuted = false;
|
_IsMuted = false;
|
||||||
MuteFeedback.FireUpdate();
|
MuteFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public override void MuteOn()
|
public override void MuteOn()
|
||||||
{
|
{
|
||||||
_IsMuted = true;
|
_IsMuted = true;
|
||||||
MuteFeedback.FireUpdate();
|
MuteFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public override void MuteToggle()
|
public override void MuteToggle()
|
||||||
{
|
{
|
||||||
_IsMuted = !_IsMuted;
|
_IsMuted = !_IsMuted;
|
||||||
MuteFeedback.FireUpdate();
|
MuteFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="level"></param>
|
||||||
public override void SetVolume(ushort level)
|
public override void SetVolume(ushort level)
|
||||||
{
|
{
|
||||||
_VolumeLevel = level;
|
_VolumeLevel = level;
|
||||||
VolumeLevelFeedback.FireUpdate();
|
VolumeLevelFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pressRelease"></param>
|
||||||
public override void VolumeDown(bool pressRelease)
|
public override void VolumeDown(bool pressRelease)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pressRelease"></param>
|
||||||
public override void VolumeUp(bool pressRelease)
|
public override void VolumeUp(bool pressRelease)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
///// <summary>
|
///
|
||||||
/////
|
/// </summary>
|
||||||
///// </summary>
|
|
||||||
//public override void ReceiveMuteOff()
|
|
||||||
//{
|
|
||||||
// Debug.Console(1, this, "ReceiveMuteOff");
|
|
||||||
|
|
||||||
// if (!_ReceiveMute)
|
|
||||||
// return;
|
|
||||||
// _ReceiveMute = false;
|
|
||||||
// ReceiveMuteIsOnFeedback.FireUpdate();
|
|
||||||
//}
|
|
||||||
|
|
||||||
///// <summary>
|
|
||||||
/////
|
|
||||||
///// </summary>
|
|
||||||
//public override void ReceiveMuteOn()
|
|
||||||
//{
|
|
||||||
// Debug.Console(1, this, "ReceiveMuteOn");
|
|
||||||
// if (_ReceiveMute)
|
|
||||||
// return;
|
|
||||||
// ReceiveMuteIsOnFeedback.FireUpdate();
|
|
||||||
//}
|
|
||||||
|
|
||||||
///// <summary>
|
|
||||||
/////
|
|
||||||
///// </summary>
|
|
||||||
//public override void ReceiveMuteToggle()
|
|
||||||
//{
|
|
||||||
// Debug.Console(1, this, "ReceiveMuteToggle");
|
|
||||||
|
|
||||||
// _ReceiveMute = !_ReceiveMute;
|
|
||||||
// ReceiveMuteIsOnFeedback.FireUpdate();
|
|
||||||
//}
|
|
||||||
|
|
||||||
///// <summary>
|
|
||||||
/////
|
|
||||||
///// </summary>
|
|
||||||
///// <param name="level"></param>
|
|
||||||
//public override void SetReceiveVolume(ushort level)
|
|
||||||
//{
|
|
||||||
// Debug.Console(1, this, "SetReceiveVolume: {0}", level);
|
|
||||||
|
|
||||||
//}
|
|
||||||
|
|
||||||
///// <summary>
|
|
||||||
/////
|
|
||||||
///// </summary>
|
|
||||||
//public override void TransmitMuteOff()
|
|
||||||
//{
|
|
||||||
// Debug.Console(1, this, "TransmitMuteOff");
|
|
||||||
|
|
||||||
// if (!_TransmitMute)
|
|
||||||
// return;
|
|
||||||
// _TransmitMute = false;
|
|
||||||
// TransmitMuteIsOnFeedback.FireUpdate();
|
|
||||||
//}
|
|
||||||
|
|
||||||
///// <summary>
|
|
||||||
/////
|
|
||||||
///// </summary>
|
|
||||||
//public override void TransmitMuteOn()
|
|
||||||
//{
|
|
||||||
// Debug.Console(1, this, "TransmitMuteOn");
|
|
||||||
// if (_TransmitMute)
|
|
||||||
// return;
|
|
||||||
// TransmitMuteIsOnFeedback.FireUpdate();
|
|
||||||
//}
|
|
||||||
|
|
||||||
//public override void TransmitMuteToggle()
|
|
||||||
//{
|
|
||||||
|
|
||||||
//}
|
|
||||||
|
|
||||||
public override void PrivacyModeOn()
|
public override void PrivacyModeOn()
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "PrivacyMuteOn");
|
Debug.Console(1, this, "PrivacyMuteOn");
|
||||||
@@ -271,9 +216,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
return;
|
return;
|
||||||
_PrivacyModeIsOn = true;
|
_PrivacyModeIsOn = true;
|
||||||
PrivacyModeIsOnFeedback.FireUpdate();
|
PrivacyModeIsOnFeedback.FireUpdate();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public override void PrivacyModeOff()
|
public override void PrivacyModeOff()
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "PrivacyMuteOff");
|
Debug.Console(1, this, "PrivacyMuteOff");
|
||||||
@@ -283,6 +230,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
PrivacyModeIsOnFeedback.FireUpdate();
|
PrivacyModeIsOnFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public override void PrivacyModeToggle()
|
public override void PrivacyModeToggle()
|
||||||
{
|
{
|
||||||
_PrivacyModeIsOn = !_PrivacyModeIsOn;
|
_PrivacyModeIsOn = !_PrivacyModeIsOn;
|
||||||
@@ -293,19 +243,44 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
//********************************************************
|
//********************************************************
|
||||||
// SIMULATION METHODS
|
// SIMULATION METHODS
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="url"></param>
|
||||||
public void TestIncomingCall(string url)
|
public void TestIncomingCall(string url)
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "TestIncomingCall");
|
Debug.Console(1, this, "TestIncomingCall from {0}", url);
|
||||||
|
var item = new CodecActiveCallItem() { Name = url, Id = url, Number = url, Status = eCodecCallStatus.Incoming, Type= eCodecCallType.Unknown };
|
||||||
|
ActiveCalls.Add(item);
|
||||||
_IncomingCall = true;
|
_IncomingCall = true;
|
||||||
IncomingCallFeedback.FireUpdate();
|
IncomingCallFeedback.FireUpdate();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public void TestFarEndHangup()
|
public void TestFarEndHangup()
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "TestFarEndHangup");
|
Debug.Console(1, this, "TestFarEndHangup");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ListCalls()
|
||||||
|
{
|
||||||
|
var sb = new StringBuilder();
|
||||||
|
foreach (var c in ActiveCalls)
|
||||||
|
sb.AppendFormat("{0} {1} -- {2}\r", c.Id, c.Number, c.Name);
|
||||||
|
Debug.Console(1, "{0}", sb.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
#region IRoutingOutputs Members
|
||||||
|
|
||||||
|
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
||||||
|
{
|
||||||
|
get { throw new NotImplementedException(); }
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -14,25 +14,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
public MockVC(string key, string name)
|
public MockVC(string key, string name)
|
||||||
: base(key, name)
|
: base(key, name)
|
||||||
{
|
{
|
||||||
MuteFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Mute={0}", _IsMuted);
|
// Debug helpers
|
||||||
VolumeLevelFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Volume={0}", _VolumeLevel);
|
ActiveCallCountFeedback.OutputChange += (o, a) => Debug.Console(1, this, "InCall={0}", ActiveCallCountFeedback.IntValue);
|
||||||
InCallFeedback.OutputChange += (o, a) => Debug.Console(1, this, "InCall={0}", _InCall);
|
|
||||||
IncomingCallFeedback.OutputChange += (o, a) => Debug.Console(1, this, "IncomingCall={0}", _IncomingCall);
|
IncomingCallFeedback.OutputChange += (o, a) => Debug.Console(1, this, "IncomingCall={0}", _IncomingCall);
|
||||||
<<<<<<< HEAD
|
MuteFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Mute={0}", _IsMuted);
|
||||||
ReceiveLevelFeedback.OutputChange += (o, a) => Debug.Console(1, this, "ReceiveLevel={0}", _ReceiveLevel);
|
PrivacyModeIsOnFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Privacy={0}", _PrivacyModeIsOn);
|
||||||
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);
|
SharingSourceFeedback.OutputChange += (o, a) => Debug.Console(1, this, "SharingSource={0}", _SharingSource);
|
||||||
=======
|
VolumeLevelFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Volume={0}", _VolumeLevel);
|
||||||
>>>>>>> origin/feature/cisco-spark
|
}
|
||||||
}
|
|
||||||
|
|
||||||
protected override Func<bool> InCallFeedbackFunc
|
protected override Func<int> ActiveCallCountFeedbackFunc
|
||||||
{
|
{
|
||||||
get { return () => _InCall; }
|
get { return () => ActiveCalls.Count; }
|
||||||
}
|
}
|
||||||
bool _InCall;
|
|
||||||
|
|
||||||
protected override Func<bool> IncomingCallFeedbackFunc
|
protected override Func<bool> IncomingCallFeedbackFunc
|
||||||
{
|
{
|
||||||
@@ -40,76 +34,55 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
}
|
}
|
||||||
bool _IncomingCall;
|
bool _IncomingCall;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
protected override Func<int> TransmitLevelFeedbackFunc
|
|
||||||
{
|
|
||||||
get { return () => _TransmitLevel; }
|
|
||||||
}
|
|
||||||
int _TransmitLevel;
|
|
||||||
|
|
||||||
protected override Func<bool> TransmitMuteFeedbackFunc
|
|
||||||
{
|
|
||||||
get { return () => _TransmitMute; }
|
|
||||||
}
|
|
||||||
bool _TransmitMute;
|
|
||||||
|
|
||||||
protected override Func<int> ReceiveLevelFeedbackFunc
|
|
||||||
{
|
|
||||||
get { return () => _ReceiveLevel; }
|
|
||||||
}
|
|
||||||
int _ReceiveLevel;
|
|
||||||
|
|
||||||
protected override Func<bool> ReceiveMuteFeedbackFunc
|
|
||||||
{
|
|
||||||
get { return () => _ReceiveMute; }
|
|
||||||
}
|
|
||||||
bool _ReceiveMute;
|
|
||||||
=======
|
|
||||||
>>>>>>> origin/feature/cisco-spark
|
|
||||||
|
|
||||||
protected override Func<bool> PrivacyModeFeedbackFunc
|
|
||||||
{
|
|
||||||
get { return () => _PrivacyModeIsOn; }
|
|
||||||
}
|
|
||||||
bool _PrivacyModeIsOn;
|
|
||||||
|
|
||||||
protected override Func<int> VolumeLevelFeedbackFunc
|
|
||||||
{
|
|
||||||
get { return () => _VolumeLevel; }
|
|
||||||
}
|
|
||||||
int _VolumeLevel;
|
|
||||||
|
|
||||||
protected override Func<bool> MuteFeedbackFunc
|
protected override Func<bool> MuteFeedbackFunc
|
||||||
{
|
{
|
||||||
get { return () => _IsMuted; }
|
get { return () => _IsMuted; }
|
||||||
}
|
}
|
||||||
bool _IsMuted;
|
bool _IsMuted;
|
||||||
|
|
||||||
|
protected override Func<bool> PrivacyModeIsOnFeedbackFunc
|
||||||
|
{
|
||||||
|
get { return () => _PrivacyModeIsOn; }
|
||||||
|
}
|
||||||
|
bool _PrivacyModeIsOn;
|
||||||
|
|
||||||
protected override Func<string> SharingSourceFeedbackFunc
|
protected override Func<string> SharingSourceFeedbackFunc
|
||||||
{
|
{
|
||||||
get { return () => _SharingSource; }
|
get { return () => _SharingSource; }
|
||||||
}
|
}
|
||||||
string _SharingSource;
|
string _SharingSource;
|
||||||
|
|
||||||
|
protected override Func<int> VolumeLevelFeedbackFunc
|
||||||
|
{
|
||||||
|
get { return () => _VolumeLevel; }
|
||||||
|
}
|
||||||
|
int _VolumeLevel;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Dials, yo!
|
/// Dials, yo!
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override void Dial(string s)
|
public override void Dial(string s)
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "Dial: {0}", s);
|
Debug.Console(1, this, "Dial: {0}", s);
|
||||||
|
ActiveCalls.Add(new CodecActiveCallItem(s,s, eCodecCallType.Video));
|
||||||
_InCall = true;
|
ActiveCallCountFeedback.FireUpdate();
|
||||||
InCallFeedback.FireUpdate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override void EndCall()
|
public override void EndCall(CodecActiveCallItem activeCall)
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "EndCall");
|
Debug.Console(1, this, "EndCall");
|
||||||
_InCall = false;
|
ActiveCalls.RemoveAll(i => i.Name == s);
|
||||||
InCallFeedback.FireUpdate();
|
ActiveCallCountFeedback.FireUpdate();
|
||||||
|
//_InCall = false;
|
||||||
|
//IsInCall.FireUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void EndAllCalls()
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -137,14 +110,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
Debug.Console(1, this, "SendDTMF: {0}", s);
|
Debug.Console(1, this, "SendDTMF: {0}", s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public override void StartSharing()
|
public override void StartSharing()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public override void StopSharing()
|
public override void StopSharing()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -154,124 +131,66 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
public override void ExecuteSwitch(object selector)
|
public override void ExecuteSwitch(object selector)
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "ExecuteSwitch");
|
Debug.Console(1, this, "ExecuteSwitch");
|
||||||
|
_SharingSource = selector.ToString();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public override void MuteOff()
|
public override void MuteOff()
|
||||||
{
|
{
|
||||||
_IsMuted = false;
|
_IsMuted = false;
|
||||||
MuteFeedback.FireUpdate();
|
MuteFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public override void MuteOn()
|
public override void MuteOn()
|
||||||
{
|
{
|
||||||
_IsMuted = true;
|
_IsMuted = true;
|
||||||
MuteFeedback.FireUpdate();
|
MuteFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public override void MuteToggle()
|
public override void MuteToggle()
|
||||||
{
|
{
|
||||||
_IsMuted = !_IsMuted;
|
_IsMuted = !_IsMuted;
|
||||||
MuteFeedback.FireUpdate();
|
MuteFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="level"></param>
|
||||||
public override void SetVolume(ushort level)
|
public override void SetVolume(ushort level)
|
||||||
{
|
{
|
||||||
_VolumeLevel = level;
|
_VolumeLevel = level;
|
||||||
VolumeLevelFeedback.FireUpdate();
|
VolumeLevelFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pressRelease"></param>
|
||||||
public override void VolumeDown(bool pressRelease)
|
public override void VolumeDown(bool pressRelease)
|
||||||
<<<<<<< HEAD
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pressRelease"></param>
|
||||||
public override void VolumeUp(bool pressRelease)
|
public override void VolumeUp(bool pressRelease)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override void ReceiveMuteOff()
|
|
||||||
{
|
|
||||||
Debug.Console(1, this, "ReceiveMuteOff");
|
|
||||||
|
|
||||||
if (!_ReceiveMute)
|
|
||||||
return;
|
|
||||||
_ReceiveMute = false;
|
|
||||||
ReceiveMuteIsOnFeedback.FireUpdate();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public override void ReceiveMuteOn()
|
|
||||||
{
|
|
||||||
Debug.Console(1, this, "ReceiveMuteOn");
|
|
||||||
if (_ReceiveMute)
|
|
||||||
return;
|
|
||||||
ReceiveMuteIsOnFeedback.FireUpdate();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public override void ReceiveMuteToggle()
|
|
||||||
{
|
|
||||||
Debug.Console(1, this, "ReceiveMuteToggle");
|
|
||||||
|
|
||||||
_ReceiveMute = !_ReceiveMute;
|
|
||||||
ReceiveMuteIsOnFeedback.FireUpdate();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="level"></param>
|
|
||||||
public override void SetReceiveVolume(ushort level)
|
|
||||||
{
|
|
||||||
Debug.Console(1, this, "SetReceiveVolume: {0}", level);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public override void TransmitMuteOff()
|
|
||||||
{
|
|
||||||
Debug.Console(1, this, "TransmitMuteOff");
|
|
||||||
|
|
||||||
if (!_TransmitMute)
|
|
||||||
return;
|
|
||||||
_TransmitMute = false;
|
|
||||||
TransmitMuteIsOnFeedback.FireUpdate();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public override void TransmitMuteOn()
|
|
||||||
{
|
|
||||||
Debug.Console(1, this, "TransmitMuteOn");
|
|
||||||
if (_TransmitMute)
|
|
||||||
return;
|
|
||||||
TransmitMuteIsOnFeedback.FireUpdate();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void TransmitMuteToggle()
|
|
||||||
=======
|
|
||||||
>>>>>>> origin/feature/cisco-spark
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void VolumeUp(bool pressRelease)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void PrivacyModeOn()
|
public override void PrivacyModeOn()
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "PrivacyMuteOn");
|
Debug.Console(1, this, "PrivacyMuteOn");
|
||||||
@@ -282,6 +201,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public override void PrivacyModeOff()
|
public override void PrivacyModeOff()
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "PrivacyMuteOff");
|
Debug.Console(1, this, "PrivacyMuteOff");
|
||||||
@@ -291,6 +213,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
PrivacyModeIsOnFeedback.FireUpdate();
|
PrivacyModeIsOnFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public override void PrivacyModeToggle()
|
public override void PrivacyModeToggle()
|
||||||
{
|
{
|
||||||
_PrivacyModeIsOn = !_PrivacyModeIsOn;
|
_PrivacyModeIsOn = !_PrivacyModeIsOn;
|
||||||
@@ -301,6 +226,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
//********************************************************
|
//********************************************************
|
||||||
// SIMULATION METHODS
|
// SIMULATION METHODS
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="url"></param>
|
||||||
public void TestIncomingCall(string url)
|
public void TestIncomingCall(string url)
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "TestIncomingCall");
|
Debug.Console(1, this, "TestIncomingCall");
|
||||||
@@ -309,11 +238,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
IncomingCallFeedback.FireUpdate();
|
IncomingCallFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public void TestFarEndHangup()
|
public void TestFarEndHangup()
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "TestFarEndHangup");
|
Debug.Console(1, this, "TestFarEndHangup");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,11 +6,18 @@ using Crestron.SimplSharp;
|
|||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Devices.Common;
|
||||||
|
using PepperDash.Essentials.Devices.Common.Codec;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||||
{
|
{
|
||||||
public abstract class VideoCodecBase : Device, IRoutingSinkWithSwitching, IUsageTracking, IHasDialer, IHasSharing, ICodecAudio
|
public abstract class VideoCodecBase : Device, IRoutingSinkWithSwitching, IUsageTracking, IHasDialer, IHasSharing, ICodecAudio
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Fires when the status of any active, dialing, or incoming call changes or is new
|
||||||
|
/// </summary>
|
||||||
|
public event EventHandler<CodecCallStatusItemChangeEventArgs> CallStatusChange;
|
||||||
|
|
||||||
#region IUsageTracking Members
|
#region IUsageTracking Members
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -27,6 +34,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns true when ActiveCallCountFeedback is > 0
|
||||||
|
/// </summary>
|
||||||
public bool IsInCall { get { return ActiveCallCountFeedback.IntValue > 0; } }
|
public bool IsInCall { get { return ActiveCallCountFeedback.IntValue > 0; } }
|
||||||
|
|
||||||
public BoolFeedback IncomingCallFeedback { get; private set; }
|
public BoolFeedback IncomingCallFeedback { get; private set; }
|
||||||
@@ -83,8 +93,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
}
|
}
|
||||||
public abstract void EndCall(CodecActiveCallItem activeCall);
|
public abstract void EndCall(CodecActiveCallItem activeCall);
|
||||||
public abstract void EndAllCalls();
|
public abstract void EndAllCalls();
|
||||||
public abstract void AcceptCall();
|
public abstract void AcceptCall(CodecActiveCallItem call);
|
||||||
public abstract void RejectCall();
|
public abstract void RejectCall(CodecActiveCallItem call);
|
||||||
public abstract void SendDtmf(string s);
|
public abstract void SendDtmf(string s);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -104,6 +114,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
|
|
||||||
public abstract void ExecuteSwitch(object selector);
|
public abstract void ExecuteSwitch(object selector);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="previousStatus"></param>
|
||||||
|
/// <param name="newStatus"></param>
|
||||||
|
/// <param name="item"></param>
|
||||||
|
protected void OnCallStatusChange(eCodecCallStatus previousStatus, eCodecCallStatus newStatus, CodecActiveCallItem item)
|
||||||
|
{
|
||||||
|
var handler = CallStatusChange;
|
||||||
|
if (handler != null)
|
||||||
|
handler(this, new CodecCallStatusItemChangeEventArgs(previousStatus, newStatus, item));
|
||||||
|
}
|
||||||
|
|
||||||
#region ICodecAudio Members
|
#region ICodecAudio Members
|
||||||
|
|
||||||
public abstract void PrivacyModeOn();
|
public abstract void PrivacyModeOn();
|
||||||
@@ -139,7 +162,25 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
public StringFeedback SharingSourceFeedback { get; private set; }
|
public StringFeedback SharingSourceFeedback { get; private set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class CodecCallStatusItemChangeEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
public CodecActiveCallItem CallItem { get; private set; }
|
||||||
|
|
||||||
|
public eCodecCallStatus PreviousStatus { get; private set; }
|
||||||
|
|
||||||
|
public eCodecCallStatus NewStatus { get; private set; }
|
||||||
|
|
||||||
|
public CodecCallStatusItemChangeEventArgs(eCodecCallStatus previousStatus,
|
||||||
|
eCodecCallStatus newStatus, CodecActiveCallItem item)
|
||||||
|
{
|
||||||
|
PreviousStatus = previousStatus;
|
||||||
|
NewStatus = newStatus;
|
||||||
|
CallItem = item;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -13,6 +13,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
{
|
{
|
||||||
#region IUsageTracking Members
|
#region IUsageTracking Members
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This object can be added by outside users of this class to provide usage tracking
|
||||||
|
/// for various services
|
||||||
|
/// </summary>
|
||||||
public UsageTracking UsageTracker { get; set; }
|
public UsageTracking UsageTracker { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -23,50 +27,51 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public BoolFeedback InCallFeedback { get; protected set; }
|
/// <summary>
|
||||||
public BoolFeedback IncomingCallFeedback { get; protected set; }
|
/// Returns true when ActiveCallCountFeedback is > 0
|
||||||
|
/// </summary>
|
||||||
|
public bool IsInCall { get { return ActiveCallCountFeedback.IntValue > 0; } }
|
||||||
|
|
||||||
abstract protected Func<bool> InCallFeedbackFunc { get; }
|
public BoolFeedback IncomingCallFeedback { get; private set; }
|
||||||
|
|
||||||
|
public IntFeedback ActiveCallCountFeedback { get; private set; }
|
||||||
|
|
||||||
|
abstract protected Func<int> ActiveCallCountFeedbackFunc { get; }
|
||||||
abstract protected Func<bool> IncomingCallFeedbackFunc { get; }
|
abstract protected Func<bool> IncomingCallFeedbackFunc { get; }
|
||||||
<<<<<<< HEAD
|
abstract protected Func<bool> PrivacyModeIsOnFeedbackFunc { get; }
|
||||||
abstract protected Func<bool> TransmitMuteFeedbackFunc { get; }
|
|
||||||
abstract protected Func<int> TransmitLevelFeedbackFunc { get; }
|
|
||||||
abstract protected Func<bool> ReceiveMuteFeedbackFunc { get; }
|
|
||||||
abstract protected Func<int> ReceiveLevelFeedbackFunc { get; }
|
|
||||||
=======
|
|
||||||
>>>>>>> origin/feature/cisco-spark
|
|
||||||
abstract protected Func<bool> PrivacyModeFeedbackFunc { get; }
|
|
||||||
abstract protected Func<int> VolumeLevelFeedbackFunc { get; }
|
abstract protected Func<int> VolumeLevelFeedbackFunc { get; }
|
||||||
abstract protected Func<bool> MuteFeedbackFunc { get; }
|
abstract protected Func<bool> MuteFeedbackFunc { get; }
|
||||||
abstract protected Func<string> SharingSourceFeedbackFunc { get; }
|
abstract protected Func<string> SharingSourceFeedbackFunc { get; }
|
||||||
|
|
||||||
|
public List<CodecActiveCallItem> ActiveCalls { get; set; }
|
||||||
|
|
||||||
public VideoCodecBase(string key, string name)
|
public VideoCodecBase(string key, string name)
|
||||||
: base(key, name)
|
: base(key, name)
|
||||||
{
|
{
|
||||||
InCallFeedback = new BoolFeedback(InCallFeedbackFunc);
|
ActiveCallCountFeedback = new IntFeedback(ActiveCallCountFeedbackFunc);
|
||||||
IncomingCallFeedback = new BoolFeedback(IncomingCallFeedbackFunc);
|
IncomingCallFeedback = new BoolFeedback(IncomingCallFeedbackFunc);
|
||||||
<<<<<<< HEAD
|
PrivacyModeIsOnFeedback = new BoolFeedback(PrivacyModeIsOnFeedbackFunc);
|
||||||
ReceiveLevelFeedback = new IntFeedback(ReceiveLevelFeedbackFunc);
|
|
||||||
ReceiveMuteIsOnFeedback = new BoolFeedback(ReceiveMuteFeedbackFunc);
|
|
||||||
TransmitMuteIsOnFeedback = new BoolFeedback(TransmitMuteFeedbackFunc);
|
|
||||||
TransmitLevelFeedback = new IntFeedback(TransmitLevelFeedbackFunc);
|
|
||||||
=======
|
|
||||||
>>>>>>> origin/feature/cisco-spark
|
|
||||||
PrivacyModeIsOnFeedback = new BoolFeedback(PrivacyModeFeedbackFunc);
|
|
||||||
VolumeLevelFeedback = new IntFeedback(VolumeLevelFeedbackFunc);
|
VolumeLevelFeedback = new IntFeedback(VolumeLevelFeedbackFunc);
|
||||||
MuteFeedback = new BoolFeedback(MuteFeedbackFunc);
|
MuteFeedback = new BoolFeedback(MuteFeedbackFunc);
|
||||||
SharingSourceFeedback = new StringFeedback(SharingSourceFeedbackFunc);
|
SharingSourceFeedback = new StringFeedback(SharingSourceFeedbackFunc);
|
||||||
|
|
||||||
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
||||||
|
|
||||||
InCallFeedback.OutputChange += new EventHandler<EventArgs>(InCallFeedback_OutputChange);
|
ActiveCallCountFeedback.OutputChange += new EventHandler<EventArgs>(ActiveCallCountFeedback_OutputChange);
|
||||||
|
|
||||||
|
ActiveCalls = new List<CodecActiveCallItem>();
|
||||||
}
|
}
|
||||||
|
|
||||||
void InCallFeedback_OutputChange(object sender, EventArgs e)
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
void ActiveCallCountFeedback_OutputChange(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (UsageTracker != null)
|
if (UsageTracker != null)
|
||||||
{
|
{
|
||||||
if (InCallFeedback.BoolValue)
|
if (IsInCall)
|
||||||
UsageTracker.StartDeviceUsage();
|
UsageTracker.StartDeviceUsage();
|
||||||
else
|
else
|
||||||
UsageTracker.EndDeviceUsage();
|
UsageTracker.EndDeviceUsage();
|
||||||
@@ -75,7 +80,16 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
#region IHasDialer Members
|
#region IHasDialer Members
|
||||||
|
|
||||||
public abstract void Dial(string s);
|
public abstract void Dial(string s);
|
||||||
public abstract void EndCall();
|
<<<<<<< HEAD
|
||||||
|
public abstract void EndCall(string s);
|
||||||
|
=======
|
||||||
|
public void EndCall(object activeCall)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public abstract void EndCall(CodecActiveCallItem activeCall);
|
||||||
|
public abstract void EndAllCalls();
|
||||||
|
>>>>>>> origin/feature/cisco-spark-2
|
||||||
public abstract void AcceptCall();
|
public abstract void AcceptCall();
|
||||||
public abstract void RejectCall();
|
public abstract void RejectCall();
|
||||||
public abstract void SendDtmf(string s);
|
public abstract void SendDtmf(string s);
|
||||||
@@ -88,9 +102,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
{
|
{
|
||||||
return new List<Feedback>
|
return new List<Feedback>
|
||||||
{
|
{
|
||||||
InCallFeedback,
|
|
||||||
IncomingCallFeedback,
|
IncomingCallFeedback,
|
||||||
PrivacyModeIsOnFeedback
|
PrivacyModeIsOnFeedback,
|
||||||
|
SharingSourceFeedback
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,15 +128,21 @@ namespace PepperDash.Essentials
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CODEC TESTING
|
// CODEC TESTING
|
||||||
GenericSshClient TestCodecClient = new GenericSshClient("TestCodec-1--SshClient", "10.11.50.135", 22, "crestron", "2H3Zu&OvgXp6");
|
try
|
||||||
|
{
|
||||||
|
GenericSshClient TestCodecClient = new GenericSshClient("TestCodec-1--SshClient", "10.11.50.135", 22, "crestron", "2H3Zu&OvgXp6");
|
||||||
|
|
||||||
PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoCodec TestCodec =
|
PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoCodec TestCodec =
|
||||||
new PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoCodec("TestCodec-1", "Cisco Spark Room Kit", TestCodecClient, 8080);
|
new PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoCodec("TestCodec-1", "Cisco Spark Room Kit", TestCodecClient, 8080);
|
||||||
|
|
||||||
TestCodec.CommDebuggingIsOn = true;
|
TestCodec.CommDebuggingIsOn = true;
|
||||||
|
|
||||||
TestCodec.CustomActivate();
|
|
||||||
|
|
||||||
|
TestCodec.CustomActivate();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "Error in something Neil is working on ;) \r{0}", e);
|
||||||
|
}
|
||||||
// CODEC TESTING
|
// CODEC TESTING
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -164,6 +164,7 @@
|
|||||||
<Compile Include="FOR REFERENCE UI\PageControllers\PageControllerLargeSetTopBoxGeneric.cs" />
|
<Compile Include="FOR REFERENCE UI\PageControllers\PageControllerLargeSetTopBoxGeneric.cs" />
|
||||||
<Compile Include="FOR REFERENCE UI\PageControllers\LargeTouchpanelControllerBase.cs" />
|
<Compile Include="FOR REFERENCE UI\PageControllers\LargeTouchpanelControllerBase.cs" />
|
||||||
<Compile Include="FOR REFERENCE UI\Panels\SmartGraphicsTouchpanelControllerBase.cs" />
|
<Compile Include="FOR REFERENCE UI\Panels\SmartGraphicsTouchpanelControllerBase.cs" />
|
||||||
|
<Compile Include="UIDrivers\EssentialsHuddleVTC\EssentialsHuddlePresentationUiDriver.cs" />
|
||||||
<Compile Include="UI\SubpageReferenceListCallStagingItem.cs" />
|
<Compile Include="UI\SubpageReferenceListCallStagingItem.cs" />
|
||||||
<Compile Include="UIDrivers\VC\EssentialsVideoCodecUiDriver.cs" />
|
<Compile Include="UIDrivers\VC\EssentialsVideoCodecUiDriver.cs" />
|
||||||
<Compile Include="UIDrivers\JoinedSigInterlock.cs" />
|
<Compile Include="UIDrivers\JoinedSigInterlock.cs" />
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using Crestron.SimplSharp;
|
|||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Room.Config;
|
using PepperDash.Essentials.Room.Config;
|
||||||
|
using PepperDash.Essentials.Devices.Common.Codec;
|
||||||
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||||
|
|
||||||
namespace PepperDash.Essentials
|
namespace PepperDash.Essentials
|
||||||
@@ -246,12 +247,13 @@ namespace PepperDash.Essentials
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Routes the default source item, if any
|
/// Routes the default source item, if any. Returns true when default route exists
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void RunDefaultRoute()
|
public bool RunDefaultRoute()
|
||||||
{
|
{
|
||||||
if (DefaultSourceItem != null)
|
if (DefaultSourceItem != null)
|
||||||
RunRouteAction(DefaultSourceItem);
|
RunRouteAction(DefaultSourceItem);
|
||||||
|
return DefaultSourceItem != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
//using System;
|
||||||
|
//using System.Linq;
|
||||||
|
//using System.Collections.Generic;
|
||||||
|
//using Crestron.SimplSharp;
|
||||||
|
//using Crestron.SimplSharpPro;
|
||||||
|
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
//using Crestron.SimplSharpPro.UI;
|
||||||
|
|
||||||
|
//using PepperDash.Core;
|
||||||
|
//using PepperDash.Essentials.Core;
|
||||||
|
//using PepperDash.Essentials.Core.SmartObjects;
|
||||||
|
//using PepperDash.Essentials.Core.PageManagers;
|
||||||
|
//using PepperDash.Essentials.Room.Config;
|
||||||
|
|
||||||
|
//namespace PepperDash.Essentials
|
||||||
|
//{
|
||||||
|
// public class EssentialsHuddleVtc1PresentationUiDriver : PanelDriverBase
|
||||||
|
// {
|
||||||
|
// /// <summary>
|
||||||
|
// ///
|
||||||
|
// /// </summary>
|
||||||
|
// EssentialsHuddleVtc1Room CurrentRoom;
|
||||||
|
|
||||||
|
|
||||||
|
// public EssentialsHuddleVtc1PresentationUiDriver(BasicTriListWithSmartObject triList,
|
||||||
|
// EssentialsHuddleVtc1Room room)
|
||||||
|
// : base(triList)
|
||||||
|
// {
|
||||||
|
// CurrentRoom = room;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// /// <summary>
|
||||||
|
// /// Smart Object 3200
|
||||||
|
// /// </summary>
|
||||||
|
// SubpageReferenceList SourceStagingSrl;
|
||||||
|
|
||||||
|
// /// <summary>
|
||||||
|
// /// The AV page mangagers that have been used, to keep them alive for later
|
||||||
|
// /// </summary>
|
||||||
|
// Dictionary<object, PageManager> PageManagers = new Dictionary<object, PageManager>();
|
||||||
|
|
||||||
|
// /// <summary>
|
||||||
|
// /// Current page manager running for a source
|
||||||
|
// /// </summary>
|
||||||
|
// PageManager CurrentSourcePageManager;
|
||||||
|
|
||||||
|
|
||||||
|
// }
|
||||||
|
//}
|
||||||
@@ -301,33 +301,33 @@ namespace PepperDash.Essentials
|
|||||||
base.Show();
|
base.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// Puts the UI into the "start" mode. System is off. Logo shows. Activity SRL is clear
|
///// Puts the UI into the "start" mode. System is off. Logo shows. Activity SRL is clear
|
||||||
/// </summary>
|
///// </summary>
|
||||||
void ShowStartMode()
|
//void ShowStartMode()
|
||||||
{
|
//{
|
||||||
SetupActivityFooterWhenRoomOff();
|
// SetupActivityFooterWhenRoomOff();
|
||||||
|
|
||||||
ShareButtonSig.BoolValue = false;
|
// ShareButtonSig.BoolValue = false;
|
||||||
CallButtonSig.BoolValue = false;
|
// CallButtonSig.BoolValue = false;
|
||||||
ShowLogo();
|
// ShowLogo();
|
||||||
StagingBarInterlock.ShowInterlocked(UIBoolJoin.StartPageVisible);
|
// StagingBarInterlock.ShowInterlocked(UIBoolJoin.StartPageVisible);
|
||||||
StagingBarInterlock.HideAndClear();
|
// StagingBarInterlock.HideAndClear();
|
||||||
}
|
//}
|
||||||
|
|
||||||
void ShowShareMode()
|
//void ShowShareMode()
|
||||||
{
|
//{
|
||||||
ShareButtonSig.BoolValue = true;
|
// ShareButtonSig.BoolValue = true;
|
||||||
CallButtonSig.BoolValue = false;
|
// CallButtonSig.BoolValue = false;
|
||||||
StagingBarInterlock.ShowInterlocked(UIBoolJoin.SourceStagingBarVisible);
|
// StagingBarInterlock.ShowInterlocked(UIBoolJoin.SourceStagingBarVisible);
|
||||||
}
|
//}
|
||||||
|
|
||||||
void ShowVideoCallMode()
|
//void ShowVideoCallMode()
|
||||||
{
|
//{
|
||||||
ShareButtonSig.BoolValue = false;
|
// ShareButtonSig.BoolValue = false;
|
||||||
CallButtonSig.BoolValue = true;
|
// CallButtonSig.BoolValue = true;
|
||||||
StagingBarInterlock.ShowInterlocked(UIBoolJoin.CallStagingBarVisible);
|
// StagingBarInterlock.ShowInterlocked(UIBoolJoin.CallStagingBarVisible);
|
||||||
}
|
//}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -347,6 +347,15 @@ namespace PepperDash.Essentials
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
void HideLogo()
|
||||||
|
{
|
||||||
|
TriList.SetBool(UIBoolJoin.LogoDefaultVisible, false);
|
||||||
|
TriList.SetBool(UIBoolJoin.LogoUrlVisible, false);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -404,9 +413,12 @@ namespace PepperDash.Essentials
|
|||||||
return;
|
return;
|
||||||
CallButtonSig.BoolValue = true;
|
CallButtonSig.BoolValue = true;
|
||||||
ShareButtonSig.BoolValue = false;
|
ShareButtonSig.BoolValue = false;
|
||||||
|
HideLogo();
|
||||||
TriList.SetBool(UIBoolJoin.StartPageVisible, false);
|
TriList.SetBool(UIBoolJoin.StartPageVisible, false);
|
||||||
TriList.SetBool(UIBoolJoin.SourceStagingBarVisible, false);
|
TriList.SetBool(UIBoolJoin.SourceStagingBarVisible, false);
|
||||||
TriList.SetBool(UIBoolJoin.SelectASourceVisible, false);
|
TriList.SetBool(UIBoolJoin.SelectASourceVisible, false);
|
||||||
|
if (CurrentSourcePageManager != null)
|
||||||
|
CurrentSourcePageManager.Hide();
|
||||||
VCDriver.Show();
|
VCDriver.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -421,10 +433,18 @@ namespace PepperDash.Essentials
|
|||||||
CallButtonSig.BoolValue = false;
|
CallButtonSig.BoolValue = false;
|
||||||
TriList.SetBool(UIBoolJoin.StartPageVisible, false);
|
TriList.SetBool(UIBoolJoin.StartPageVisible, false);
|
||||||
TriList.SetBool(UIBoolJoin.SourceStagingBarVisible, true);
|
TriList.SetBool(UIBoolJoin.SourceStagingBarVisible, true);
|
||||||
TriList.SetBool(UIBoolJoin.SelectASourceVisible, true);
|
|
||||||
// Run default source when room is off and share is pressed
|
// Run default source when room is off and share is pressed
|
||||||
if (!CurrentRoom.OnFeedback.BoolValue)
|
if (!CurrentRoom.OnFeedback.BoolValue)
|
||||||
CurrentRoom.RunDefaultRoute();
|
{
|
||||||
|
// If there's no default, show UI elements
|
||||||
|
if(!CurrentRoom.RunDefaultRoute())
|
||||||
|
TriList.SetBool(UIBoolJoin.SelectASourceVisible, true);
|
||||||
|
}
|
||||||
|
else // show what's active
|
||||||
|
{
|
||||||
|
if (CurrentSourcePageManager != null)
|
||||||
|
CurrentSourcePageManager.Show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -729,7 +749,10 @@ namespace PepperDash.Essentials
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (VCDriver.IsVisible)
|
||||||
|
VCDriver.Hide();
|
||||||
SetupActivityFooterWhenRoomOff();
|
SetupActivityFooterWhenRoomOff();
|
||||||
|
ShowLogo();
|
||||||
TriList.BooleanInput[UIBoolJoin.StartPageVisible].BoolValue = true;
|
TriList.BooleanInput[UIBoolJoin.StartPageVisible].BoolValue = true;
|
||||||
TriList.BooleanInput[UIBoolJoin.VolumeSingleMute1Visible].BoolValue = false;
|
TriList.BooleanInput[UIBoolJoin.VolumeSingleMute1Visible].BoolValue = false;
|
||||||
TriList.BooleanInput[UIBoolJoin.SourceStagingBarVisible].BoolValue = false;
|
TriList.BooleanInput[UIBoolJoin.SourceStagingBarVisible].BoolValue = false;
|
||||||
|
|||||||
@@ -0,0 +1,250 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
|
||||||
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Essentials;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.SmartObjects;
|
||||||
|
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.UIDrivers.VC
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This fella will likely need to interact with the room's source, although that is routed via the spark...
|
||||||
|
/// Probably needs event or FB to feed AV driver - to show two-mute volume when appropriate.
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class EssentialsVideoCodecUiDriver : PanelDriverBase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
VideoCodecBase Codec;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
SmartObjectDynamicList DirectorySrl; // ***************** SRL ???
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To drive UI elements outside of this driver that may be dependent on this.
|
||||||
|
/// </summary>
|
||||||
|
BoolFeedback InCall;
|
||||||
|
BoolFeedback LocalPrivacyIsMuted;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// For the subpages above the bar
|
||||||
|
/// </summary>
|
||||||
|
JoinedSigInterlock VCControlsInterlock;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// For the different staging bars: Active, inactive
|
||||||
|
/// </summary>
|
||||||
|
JoinedSigInterlock StagingBarInterlock;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// For the staging button feedbacks
|
||||||
|
/// </summary>
|
||||||
|
JoinedSigInterlock StagingButtonFeedbackInterlock;
|
||||||
|
|
||||||
|
SmartObjectNumeric DialKeypad;
|
||||||
|
|
||||||
|
// These are likely temp until we get a keyboard built
|
||||||
|
StringFeedback DialStringFeedback;
|
||||||
|
StringBuilder DialStringBuilder = new StringBuilder();
|
||||||
|
BoolFeedback DialStringBackspaceVisibleFeedback;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="triList"></param>
|
||||||
|
/// <param name="codec"></param>
|
||||||
|
public EssentialsVideoCodecUiDriver(BasicTriListWithSmartObject triList, VideoCodecBase codec)
|
||||||
|
: base(triList)
|
||||||
|
{
|
||||||
|
Codec = codec;
|
||||||
|
SetupCallStagingPopover();
|
||||||
|
SetupDialKeypad();
|
||||||
|
|
||||||
|
InCall = new BoolFeedback(() => false);
|
||||||
|
LocalPrivacyIsMuted = new BoolFeedback(() => false);
|
||||||
|
|
||||||
|
//DirectorySrl = new SubpageReferenceList(triList, UISmartObjectJoin.VCDirectoryList, 3, 3, 3);
|
||||||
|
|
||||||
|
VCControlsInterlock = new JoinedSigInterlock(triList);
|
||||||
|
VCControlsInterlock.SetButDontShow(UIBoolJoin.VCDirectoryVisible);
|
||||||
|
|
||||||
|
StagingBarInterlock = new JoinedSigInterlock(triList);
|
||||||
|
StagingBarInterlock.SetButDontShow(UIBoolJoin.VCStagingInactivePopoverVisible);
|
||||||
|
|
||||||
|
StagingButtonFeedbackInterlock = new JoinedSigInterlock(triList);
|
||||||
|
StagingButtonFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCRecentsVisible);
|
||||||
|
|
||||||
|
DialStringFeedback = new StringFeedback(() => DialStringBuilder.ToString());
|
||||||
|
DialStringFeedback.LinkInputSig(triList.StringInput[UIStringJoin.KeyboardText]);
|
||||||
|
|
||||||
|
DialStringBackspaceVisibleFeedback = new BoolFeedback(() => DialStringBuilder.Length > 0);
|
||||||
|
DialStringBackspaceVisibleFeedback
|
||||||
|
.LinkInputSig(TriList.BooleanInput[UIBoolJoin.KeyboardClearVisible]);
|
||||||
|
|
||||||
|
Codec.ActiveCallCountFeedback.OutputChange += new EventHandler<EventArgs>(InCallFeedback_OutputChange);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public override void Show()
|
||||||
|
{
|
||||||
|
VCControlsInterlock.Show();
|
||||||
|
StagingBarInterlock.Show();
|
||||||
|
base.Show();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public override void Hide()
|
||||||
|
{
|
||||||
|
VCControlsInterlock.Hide();
|
||||||
|
StagingBarInterlock.Hide();
|
||||||
|
base.Hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Builds the call stage
|
||||||
|
/// </summary>
|
||||||
|
void SetupCallStagingPopover()
|
||||||
|
{
|
||||||
|
TriList.SetSigFalseAction(UIBoolJoin.VCStagingDirectoryPress, ShowDirectory);
|
||||||
|
TriList.SetSigFalseAction(UIBoolJoin.VCStagingConnectPress, ConnectPress);
|
||||||
|
TriList.SetSigFalseAction(UIBoolJoin.VCStagingKeypadPress, ShowKeypad);
|
||||||
|
TriList.SetSigFalseAction(UIBoolJoin.VCStagingRecentsPress, ShowRecents);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
void SetupDialKeypad()
|
||||||
|
{
|
||||||
|
if(TriList.SmartObjects.Contains(UISmartObjectJoin.VCDialKeypad))
|
||||||
|
{
|
||||||
|
DialKeypad = new SmartObjectNumeric(TriList.SmartObjects[UISmartObjectJoin.VCDialKeypad], true);
|
||||||
|
DialKeypad.Digit0.SetSigFalseAction(() => DialKeypadPress("0"));
|
||||||
|
DialKeypad.Digit1.SetSigFalseAction(() => DialKeypadPress("1"));
|
||||||
|
DialKeypad.Digit2.SetSigFalseAction(() => DialKeypadPress("2"));
|
||||||
|
DialKeypad.Digit3.SetSigFalseAction(() => DialKeypadPress("3"));
|
||||||
|
DialKeypad.Digit4.SetSigFalseAction(() => DialKeypadPress("4"));
|
||||||
|
DialKeypad.Digit5.SetSigFalseAction(() => DialKeypadPress("5"));
|
||||||
|
DialKeypad.Digit6.SetSigFalseAction(() => DialKeypadPress("6"));
|
||||||
|
DialKeypad.Digit7.SetSigFalseAction(() => DialKeypadPress("7"));
|
||||||
|
DialKeypad.Digit8.SetSigFalseAction(() => DialKeypadPress("8"));
|
||||||
|
DialKeypad.Digit9.SetSigFalseAction(() => DialKeypadPress("9"));
|
||||||
|
DialKeypad.Misc1SigName = "*";
|
||||||
|
DialKeypad.Misc1.SetSigFalseAction(() => DialKeypadPress("*"));
|
||||||
|
DialKeypad.Misc2SigName = "#";
|
||||||
|
DialKeypad.Misc2.SetSigFalseAction(() => DialKeypadPress("#"));
|
||||||
|
TriList.SetSigFalseAction(UIBoolJoin.KeyboardClearPress, DialKeypadBackspacePress);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Debug.Console(0, "Trilist {0:x2}, VC dial keypad object {1} not found. Check SGD file or VTP",
|
||||||
|
TriList.ID, UISmartObjectJoin.VCDialKeypad);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
void ShowCameraControls()
|
||||||
|
{
|
||||||
|
VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCCameraVisible);
|
||||||
|
StagingButtonFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingCameraPress);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShowKeypad()
|
||||||
|
{
|
||||||
|
VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCKeypadVisible);
|
||||||
|
StagingButtonFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingKeypadPress);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShowDirectory()
|
||||||
|
{
|
||||||
|
// populate directory
|
||||||
|
VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCDirectoryVisible);
|
||||||
|
StagingButtonFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingDirectoryPress);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShowRecents()
|
||||||
|
{
|
||||||
|
//populate recents
|
||||||
|
VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCDirectoryVisible);
|
||||||
|
StagingButtonFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingRecentsPress);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
void ConnectPress()
|
||||||
|
{
|
||||||
|
if (Codec.IsInCall)
|
||||||
|
<<<<<<< HEAD
|
||||||
|
Codec.EndCall("end whatever is selected");
|
||||||
|
=======
|
||||||
|
Codec.EndAllCalls();
|
||||||
|
>>>>>>> origin/feature/cisco-spark-2
|
||||||
|
else
|
||||||
|
Codec.Dial(DialStringBuilder.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
void InCallFeedback_OutputChange(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
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.IsInCall) // Call is starting
|
||||||
|
{
|
||||||
|
// Header icon
|
||||||
|
// Volume bar needs to have mic mute
|
||||||
|
}
|
||||||
|
else // ending
|
||||||
|
{
|
||||||
|
// Header icon
|
||||||
|
// Volume bar no mic mute (or hidden if no source?)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="i"></param>
|
||||||
|
void DialKeypadPress(string i)
|
||||||
|
{
|
||||||
|
DialStringBuilder.Append(i);
|
||||||
|
DialStringFeedback.FireUpdate();
|
||||||
|
TriList.BooleanInput[UIBoolJoin.KeyboardClearVisible].BoolValue =
|
||||||
|
DialStringBuilder.Length > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
void DialKeypadBackspacePress()
|
||||||
|
{
|
||||||
|
DialStringBuilder.Remove(DialStringBuilder.Length - 1, 1);
|
||||||
|
DialStringFeedback.FireUpdate();
|
||||||
|
TriList.BooleanInput[UIBoolJoin.KeyboardClearVisible].BoolValue =
|
||||||
|
DialStringBuilder.Length > 0;
|
||||||
|
TriList.SetBool(UIBoolJoin.VCStagingConnectEnable, DialStringBuilder.Length > 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user