mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 12:44:58 +00:00
Moved around base class items and interfaces. Added CodecStatusItems to many methods.
This commit is contained in:
@@ -6,31 +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
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
namespace PepperDash.Essentials.Devices.Common.Codec
|
||||||
|
|
||||||
{
|
{
|
||||||
public class CodecActiveCallItem
|
public class CodecActiveCallItem
|
||||||
@@ -22,11 +22,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
|
|
||||||
public enum eCodecCallType
|
public enum eCodecCallType
|
||||||
{
|
{
|
||||||
None, Audio, Video
|
Unknown = 0, Audio, Video
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum eCodecCallStatus
|
public enum eCodecCallStatus
|
||||||
{
|
{
|
||||||
Dialing, Established, Incoming
|
Unknown = 0, Dialing, Connected, Incoming, OnHold, Disconnected
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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
|
||||||
{
|
{
|
||||||
@@ -564,12 +565,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");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ 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.Core.Routing;
|
||||||
|
using PepperDash.Essentials.Devices.Common.Codec;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||||
{
|
{
|
||||||
@@ -65,8 +66,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
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() { Name = s, Number = s });
|
var item = new CodecActiveCallItem() { Name = s, Number = s, Id = s, Status = eCodecCallStatus.Dialing };
|
||||||
|
ActiveCalls.Add(item);
|
||||||
|
OnCallStatusChange(eCodecCallStatus.Unknown, item.Status, item);
|
||||||
ActiveCallCountFeedback.FireUpdate();
|
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>
|
||||||
@@ -76,6 +87,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
{
|
{
|
||||||
Debug.Console(1, this, "EndCall");
|
Debug.Console(1, this, "EndCall");
|
||||||
ActiveCalls.Remove(activeCall);
|
ActiveCalls.Remove(activeCall);
|
||||||
|
var prevStatus = activeCall.Status;
|
||||||
|
activeCall.Status = eCodecCallStatus.Disconnected;
|
||||||
|
OnCallStatusChange(prevStatus, activeCall.Status, activeCall);
|
||||||
ActiveCallCountFeedback.FireUpdate();
|
ActiveCallCountFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,15 +106,16 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
/// <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");
|
||||||
}
|
}
|
||||||
@@ -234,10 +249,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
/// <param name="url"></param>
|
/// <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>
|
||||||
@@ -248,5 +265,22 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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>
|
||||||
@@ -86,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
|
||||||
@@ -107,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();
|
||||||
@@ -142,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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -11,12 +11,6 @@ using PepperDash.Essentials.Core.SmartObjects;
|
|||||||
using PepperDash.Essentials.Core.PageManagers;
|
using PepperDash.Essentials.Core.PageManagers;
|
||||||
using PepperDash.Essentials.Room.Config;
|
using PepperDash.Essentials.Room.Config;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#warning END MEETING on call page doesn't clear call mode
|
|
||||||
#warning END MEETING doesn't restore logo page
|
|
||||||
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials
|
namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user