diff --git a/Essentials Core/PepperDashEssentialsBase/Devices/CodecInterfaces.cs b/Essentials Core/PepperDashEssentialsBase/Devices/CodecInterfaces.cs index b9b24394..f815525e 100644 --- a/Essentials Core/PepperDashEssentialsBase/Devices/CodecInterfaces.cs +++ b/Essentials Core/PepperDashEssentialsBase/Devices/CodecInterfaces.cs @@ -6,31 +6,6 @@ using Crestron.SimplSharp; namespace PepperDash.Essentials.Core { - /// - /// Requirements for a device that has dialing capabilities - /// - 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; } - } - - /// - /// Defines minimum volume controls for a codec device with dialing capabilities - /// - public interface ICodecAudio : IBasicVolumeWithFeedback, IPrivacy - { - - } /// /// Adds control of codec receive volume diff --git a/Essentials Devices Common/Essentials Devices Common/VideoCodec/CodecActiveCallItem.cs b/Essentials Devices Common/Essentials Devices Common/Codec/CodecActiveCallItem.cs similarity index 75% rename from Essentials Devices Common/Essentials Devices Common/VideoCodec/CodecActiveCallItem.cs rename to Essentials Devices Common/Essentials Devices Common/Codec/CodecActiveCallItem.cs index e75ac69b..5b8c8154 100644 --- a/Essentials Devices Common/Essentials Devices Common/VideoCodec/CodecActiveCallItem.cs +++ b/Essentials Devices Common/Essentials Devices Common/Codec/CodecActiveCallItem.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using Crestron.SimplSharp; -namespace PepperDash.Essentials.Devices.Common.VideoCodec +namespace PepperDash.Essentials.Devices.Common.Codec { public class CodecActiveCallItem @@ -22,11 +22,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec public enum eCodecCallType { - None, Audio, Video + Unknown = 0, Audio, Video } public enum eCodecCallStatus { - Dialing, Established, Incoming + Unknown = 0, Dialing, Connected, Incoming, OnHold, Disconnected } } \ No newline at end of file diff --git a/Essentials Devices Common/Essentials Devices Common/Codec/iCodecAudio.cs b/Essentials Devices Common/Essentials Devices Common/Codec/iCodecAudio.cs new file mode 100644 index 00000000..d61f7d26 --- /dev/null +++ b/Essentials Devices Common/Essentials Devices Common/Codec/iCodecAudio.cs @@ -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 +{ + /// + /// Defines minimum volume controls for a codec device with dialing capabilities + /// + public interface ICodecAudio : IBasicVolumeWithFeedback, IPrivacy + { + + } +} \ No newline at end of file diff --git a/Essentials Devices Common/Essentials Devices Common/Codec/iHasDialer.cs b/Essentials Devices Common/Essentials Devices Common/Codec/iHasDialer.cs new file mode 100644 index 00000000..c19f6d44 --- /dev/null +++ b/Essentials Devices Common/Essentials Devices Common/Codec/iHasDialer.cs @@ -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 +{ + /// + /// Requirements for a device that has dialing capabilities + /// + 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; } + } +} \ No newline at end of file diff --git a/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj b/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj index 7787f5c2..35459fa8 100644 --- a/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj +++ b/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj @@ -103,6 +103,8 @@ + + @@ -131,7 +133,7 @@ - + diff --git a/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoCodec.cs b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoCodec.cs index 4311d868..f13855f3 100644 --- a/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoCodec.cs +++ b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoCodec.cs @@ -13,6 +13,7 @@ using Cisco_SX80_Corporate_Phone_Book; using PepperDash.Core; using PepperDash.Essentials.Core; using PepperDash.Essentials.Core.Routing; +using PepperDash.Essentials.Devices.Common.Codec; 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"); } - public override void RejectCall() + public override void RejectCall(CodecActiveCallItem item) { SendText("xCommand Call Reject"); } diff --git a/Essentials Devices Common/Essentials Devices Common/VideoCodec/MockVC/MockVC.cs b/Essentials Devices Common/Essentials Devices Common/VideoCodec/MockVC/MockVC.cs index 9e1d383f..8de1f2a3 100644 --- a/Essentials Devices Common/Essentials Devices Common/VideoCodec/MockVC/MockVC.cs +++ b/Essentials Devices Common/Essentials Devices Common/VideoCodec/MockVC/MockVC.cs @@ -7,6 +7,7 @@ using Crestron.SimplSharp; using PepperDash.Core; using PepperDash.Essentials.Core; using PepperDash.Essentials.Core.Routing; +using PepperDash.Essentials.Devices.Common.Codec; namespace PepperDash.Essentials.Devices.Common.VideoCodec { @@ -65,8 +66,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec public override void Dial(string 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(); + // 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); } /// @@ -76,6 +87,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec { Debug.Console(1, this, "EndCall"); ActiveCalls.Remove(activeCall); + var prevStatus = activeCall.Status; + activeCall.Status = eCodecCallStatus.Disconnected; + OnCallStatusChange(prevStatus, activeCall.Status, activeCall); ActiveCallCountFeedback.FireUpdate(); } @@ -92,15 +106,16 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec /// /// For a call from the test methods below /// - public override void AcceptCall() + public override void AcceptCall(CodecActiveCallItem item) { Debug.Console(1, this, "AcceptCall"); + } /// /// For a call from the test methods below /// - public override void RejectCall() + public override void RejectCall(CodecActiveCallItem item) { Debug.Console(1, this, "RejectCall"); } @@ -234,10 +249,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec /// 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; IncomingCallFeedback.FireUpdate(); + } /// @@ -248,5 +265,22 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec 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 OutputPorts + { + get { throw new NotImplementedException(); } + } + + #endregion } } \ No newline at end of file diff --git a/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs b/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs index 7614d42a..7032dbe5 100644 --- a/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs +++ b/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs @@ -6,11 +6,18 @@ using Crestron.SimplSharp; using PepperDash.Core; using PepperDash.Essentials.Core; +using PepperDash.Essentials.Devices.Common; +using PepperDash.Essentials.Devices.Common.Codec; namespace PepperDash.Essentials.Devices.Common.VideoCodec { public abstract class VideoCodecBase : Device, IRoutingSinkWithSwitching, IUsageTracking, IHasDialer, IHasSharing, ICodecAudio { + /// + /// Fires when the status of any active, dialing, or incoming call changes or is new + /// + public event EventHandler CallStatusChange; + #region IUsageTracking Members /// @@ -86,8 +93,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec } public abstract void EndCall(CodecActiveCallItem activeCall); public abstract void EndAllCalls(); - public abstract void AcceptCall(); - public abstract void RejectCall(); + public abstract void AcceptCall(CodecActiveCallItem call); + public abstract void RejectCall(CodecActiveCallItem call); public abstract void SendDtmf(string s); #endregion @@ -107,6 +114,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec public abstract void ExecuteSwitch(object selector); + /// + /// + /// + /// + /// + /// + 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 public abstract void PrivacyModeOn(); @@ -142,7 +162,25 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec public StringFeedback SharingSourceFeedback { get; private set; } #endregion + } + /// + /// + /// + 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; + } } } \ No newline at end of file diff --git a/Essentials/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs b/Essentials/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs index 83df42e8..18fe2a39 100644 --- a/Essentials/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs +++ b/Essentials/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs @@ -7,6 +7,7 @@ using Crestron.SimplSharp; using PepperDash.Core; using PepperDash.Essentials.Core; using PepperDash.Essentials.Room.Config; +using PepperDash.Essentials.Devices.Common.Codec; using PepperDash.Essentials.Devices.Common.VideoCodec; namespace PepperDash.Essentials diff --git a/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/HuddleVTCPanelAvFunctionsDriver.cs b/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/HuddleVTCPanelAvFunctionsDriver.cs index 91f9b401..b4bbcb62 100644 --- a/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/HuddleVTCPanelAvFunctionsDriver.cs +++ b/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/HuddleVTCPanelAvFunctionsDriver.cs @@ -11,12 +11,6 @@ using PepperDash.Essentials.Core.SmartObjects; using PepperDash.Essentials.Core.PageManagers; 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 { /// diff --git a/Release Package/PepperDashEssentials.cpz b/Release Package/PepperDashEssentials.cpz index 04abe864..5e18ade3 100644 Binary files a/Release Package/PepperDashEssentials.cpz and b/Release Package/PepperDashEssentials.cpz differ diff --git a/Release Package/PepperDashEssentials.dll b/Release Package/PepperDashEssentials.dll index c82d72a2..f4e7788c 100644 Binary files a/Release Package/PepperDashEssentials.dll and b/Release Package/PepperDashEssentials.dll differ