diff --git a/Essentials Core/PepperDashEssentialsBase/Devices/CodecInterfaces.cs b/Essentials Core/PepperDashEssentialsBase/Devices/CodecInterfaces.cs index d7a00aa6..daf46197 100644 --- a/Essentials Core/PepperDashEssentialsBase/Devices/CodecInterfaces.cs +++ b/Essentials Core/PepperDashEssentialsBase/Devices/CodecInterfaces.cs @@ -14,17 +14,14 @@ namespace PepperDash.Essentials.Core // Add requirements for Dialer functionality void Dial(string number); - void EndCall(); + void EndCall(string number); void AcceptCall(); void RejectCall(); void SendDtmf(string digit); IntFeedback ActiveCallCountFeedback { get; } - BoolFeedback IncomingCallFeedback { get; } - - - + BoolFeedback IncomingCallFeedback { get; } } /// 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 d6c399c7..0f08d7ee 100644 --- a/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoCodec.cs +++ b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoCodec.cs @@ -551,7 +551,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco SendText(string.Format("xCommand Dial BookingId: {0}", s)); } - public override void EndCall() + public override void EndCall(string s) { SendText(string.Format("xCommand Call Disconnect CallId: {0}", GetCallId())); } @@ -703,7 +703,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco protected override Func ActiveCallCountFeedbackFunc { - get { throw new NotImplementedException(); } + get { return () => 0; } } } diff --git a/Essentials Devices Common/Essentials Devices Common/VideoCodec/CodecActiveCallItem.cs b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CodecActiveCallItem.cs index a1d3895e..e06a0dfa 100644 --- a/Essentials Devices Common/Essentials Devices Common/VideoCodec/CodecActiveCallItem.cs +++ b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CodecActiveCallItem.cs @@ -14,6 +14,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec public string Number { get; private set; } public eCodecCallType Type { get; private set; } + + public CodecActiveCallItem(string name, string number, eCodecCallType type) + { + Name = name; + Number = number; + Type = type; + } } public enum eCodecCallType 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 0bfdb681..03917220 100644 --- a/Essentials Devices Common/Essentials Devices Common/VideoCodec/MockVC/MockVC.cs +++ b/Essentials Devices Common/Essentials Devices Common/VideoCodec/MockVC/MockVC.cs @@ -14,22 +14,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec public MockVC(string key, string name) : base(key, name) { - MuteFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Mute={0}", _IsMuted); - VolumeLevelFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Volume={0}", _VolumeLevel); - ActiveCallCountFeedback.OutputChange += (o, a) => Debug.Console(1, this, "InCall={0}", _ActiveCallCount); + // Debug helpers + ActiveCallCountFeedback.OutputChange += (o, a) => Debug.Console(1, this, "InCall={0}", ActiveCallCountFeedback.IntValue); IncomingCallFeedback.OutputChange += (o, a) => Debug.Console(1, this, "IncomingCall={0}", _IncomingCall); - //ReceiveLevelFeedback.OutputChange += (o, a) => Debug.Console(1, this, "ReceiveLevel={0}", _ReceiveLevel); - //ReceiveMuteIsOnFeedback.OutputChange += (o, a) => Debug.Console(1, this, "ReceiveMute={0}", _ReceiveMute); - //TransmitLevelFeedback.OutputChange += (o, a) => Debug.Console(1, this, "TransmitLevel={0}", _TransmitLevel); - //TransmitMuteIsOnFeedback.OutputChange += (o, a) => Debug.Console(1, this, "TransmitMute={0}", _TransmitMute); + MuteFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Mute={0}", _IsMuted); + PrivacyModeIsOnFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Privacy={0}", _PrivacyModeIsOn); 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 ActiveCallCountFeedbackFunc { - get { return () => _ActiveCallCount; } + get { return () => ActiveCalls.Count; } } - int _ActiveCallCount; protected override Func IncomingCallFeedbackFunc { @@ -37,35 +34,23 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec } bool _IncomingCall; - //protected override Func TransmitLevelFeedbackFunc - //{ - // get { return () => _TransmitLevel; } - //} - //int _TransmitLevel; - - //protected override Func TransmitMuteFeedbackFunc - //{ - // get { return () => _TransmitMute; } - //} - //bool _TransmitMute; - - //protected override Func ReceiveLevelFeedbackFunc - //{ - // get { return () => _ReceiveLevel; } - //} - //int _ReceiveLevel; - - //protected override Func ReceiveMuteFeedbackFunc - //{ - // get { return () => _ReceiveMute; } - //} - //bool _ReceiveMute; + protected override Func MuteFeedbackFunc + { + get { return () => _IsMuted; } + } + bool _IsMuted; protected override Func PrivacyModeIsOnFeedbackFunc { get { return () => _PrivacyModeIsOn; } } bool _PrivacyModeIsOn; + + protected override Func SharingSourceFeedbackFunc + { + get { return () => _SharingSource; } + } + string _SharingSource; protected override Func VolumeLevelFeedbackFunc { @@ -73,37 +58,24 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec } int _VolumeLevel; - protected override Func MuteFeedbackFunc - { - get { return () => _IsMuted; } - } - bool _IsMuted; - - protected override Func SharingSourceFeedbackFunc - { - get { return () => _SharingSource; } - } - string _SharingSource; - /// /// Dials, yo! /// public override void Dial(string s) { Debug.Console(1, this, "Dial: {0}", s); - - //_InCall = true; - //IsInCall.FireUpdate(); + ActiveCalls.Add(new CodecActiveCallItem(s,s, eCodecCallType.Video)); + ActiveCallCountFeedback.FireUpdate(); } /// /// /// - public override void EndCall() + public override void EndCall(string s) { Debug.Console(1, this, "EndCall"); - //_InCall = false; - //IsInCall.FireUpdate(); + ActiveCalls.RemoveAll(i => i.Name == s); + ActiveCallCountFeedback.FireUpdate(); } /// @@ -131,14 +103,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec Debug.Console(1, this, "SendDTMF: {0}", s); } + /// + /// + /// public override void StartSharing() { - } + /// + /// + /// public override void StopSharing() { - } /// @@ -152,113 +128,62 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec } + /// + /// + /// public override void MuteOff() { _IsMuted = false; MuteFeedback.FireUpdate(); } + /// + /// + /// public override void MuteOn() { _IsMuted = true; MuteFeedback.FireUpdate(); } + /// + /// + /// public override void MuteToggle() { _IsMuted = !_IsMuted; MuteFeedback.FireUpdate(); } + /// + /// + /// + /// public override void SetVolume(ushort level) { _VolumeLevel = level; VolumeLevelFeedback.FireUpdate(); } + /// + /// + /// + /// public override void VolumeDown(bool pressRelease) { } + /// + /// + /// + /// public override void VolumeUp(bool pressRelease) { } - - ///// - ///// - ///// - //public override void ReceiveMuteOff() - //{ - // Debug.Console(1, this, "ReceiveMuteOff"); - - // if (!_ReceiveMute) - // return; - // _ReceiveMute = false; - // ReceiveMuteIsOnFeedback.FireUpdate(); - //} - - ///// - ///// - ///// - //public override void ReceiveMuteOn() - //{ - // Debug.Console(1, this, "ReceiveMuteOn"); - // if (_ReceiveMute) - // return; - // ReceiveMuteIsOnFeedback.FireUpdate(); - //} - - ///// - ///// - ///// - //public override void ReceiveMuteToggle() - //{ - // Debug.Console(1, this, "ReceiveMuteToggle"); - - // _ReceiveMute = !_ReceiveMute; - // ReceiveMuteIsOnFeedback.FireUpdate(); - //} - - ///// - ///// - ///// - ///// - //public override void SetReceiveVolume(ushort level) - //{ - // Debug.Console(1, this, "SetReceiveVolume: {0}", level); - - //} - - ///// - ///// - ///// - //public override void TransmitMuteOff() - //{ - // Debug.Console(1, this, "TransmitMuteOff"); - - // if (!_TransmitMute) - // return; - // _TransmitMute = false; - // TransmitMuteIsOnFeedback.FireUpdate(); - //} - - ///// - ///// - ///// - //public override void TransmitMuteOn() - //{ - // Debug.Console(1, this, "TransmitMuteOn"); - // if (_TransmitMute) - // return; - // TransmitMuteIsOnFeedback.FireUpdate(); - //} - - //public override void TransmitMuteToggle() - //{ - - //} - + /// + /// + /// public override void PrivacyModeOn() { Debug.Console(1, this, "PrivacyMuteOn"); @@ -269,6 +194,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec } + /// + /// + /// public override void PrivacyModeOff() { Debug.Console(1, this, "PrivacyMuteOff"); @@ -278,6 +206,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec PrivacyModeIsOnFeedback.FireUpdate(); } + /// + /// + /// public override void PrivacyModeToggle() { _PrivacyModeIsOn = !_PrivacyModeIsOn; @@ -288,6 +219,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec //******************************************************** // SIMULATION METHODS + /// + /// + /// + /// public void TestIncomingCall(string url) { Debug.Console(1, this, "TestIncomingCall"); @@ -296,11 +231,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec IncomingCallFeedback.FireUpdate(); } + /// + /// + /// public void TestFarEndHangup() { Debug.Console(1, this, "TestFarEndHangup"); } - } } \ No newline at end of file diff --git a/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs b/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs index 920bf1b8..d218ea23 100644 --- a/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs +++ b/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs @@ -27,6 +27,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec #endregion + /// + /// Returns true when ActiveCallCountFeedback is > 0 + /// public bool IsInCall { get { return ActiveCallCountFeedback.IntValue > 0; } } public BoolFeedback IncomingCallFeedback { get; private set; } @@ -77,7 +80,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec #region IHasDialer Members public abstract void Dial(string s); - public abstract void EndCall(); + public abstract void EndCall(string s); public abstract void AcceptCall(); public abstract void RejectCall(); public abstract void SendDtmf(string s); diff --git a/Essentials/PepperDashEssentials/ControlSystem.cs b/Essentials/PepperDashEssentials/ControlSystem.cs index f46e4ff8..b9e6e5f6 100644 --- a/Essentials/PepperDashEssentials/ControlSystem.cs +++ b/Essentials/PepperDashEssentials/ControlSystem.cs @@ -128,15 +128,21 @@ namespace PepperDash.Essentials } // 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 = - new PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoCodec("TestCodec-1", "Cisco Spark Room Kit", TestCodecClient, 8080); + PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoCodec TestCodec = + new PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoCodec("TestCodec-1", "Cisco Spark Room Kit", TestCodecClient, 8080); - TestCodec.CommDebuggingIsOn = true; - - TestCodec.CustomActivate(); + TestCodec.CommDebuggingIsOn = true; + TestCodec.CustomActivate(); + } + catch (Exception e) + { + Debug.Console(0, "Error in something Neil is working on ;) \r{0}", e); + } // CODEC TESTING } diff --git a/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs b/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs index 6cce71d9..b7f27e28 100644 --- a/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs +++ b/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs @@ -191,7 +191,7 @@ namespace PepperDash.Essentials.UIDrivers.VC void ConnectPress() { if (Codec.IsInCall) - Codec.EndCall(); + Codec.EndCall("end whatever is selected"); else Codec.Dial(DialStringBuilder.ToString()); } diff --git a/Release Package/PepperDashEssentials.cpz b/Release Package/PepperDashEssentials.cpz index 5b4033f2..d37ea309 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 7c3da2ff..3b28f501 100644 Binary files a/Release Package/PepperDashEssentials.dll and b/Release Package/PepperDashEssentials.dll differ