This commit is contained in:
Heath Volmer
2017-09-18 17:38:05 -06:00
parent 95a6f3948f
commit cc6e555f25
9 changed files with 94 additions and 144 deletions

View File

@@ -14,17 +14,14 @@ namespace PepperDash.Essentials.Core
// Add requirements for Dialer functionality // Add requirements for Dialer functionality
void Dial(string number); void Dial(string number);
void EndCall(); void EndCall(string number);
void AcceptCall(); void AcceptCall();
void RejectCall(); void RejectCall();
void SendDtmf(string digit); void SendDtmf(string digit);
IntFeedback ActiveCallCountFeedback { get; } IntFeedback ActiveCallCountFeedback { get; }
BoolFeedback IncomingCallFeedback { get; } BoolFeedback IncomingCallFeedback { get; }
} }
/// <summary> /// <summary>

View File

@@ -551,7 +551,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
SendText(string.Format("xCommand Dial BookingId: {0}", s)); 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())); SendText(string.Format("xCommand Call Disconnect CallId: {0}", GetCallId()));
} }
@@ -703,7 +703,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; }
} }
} }

View File

@@ -14,6 +14,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
public string Number { get; private set; } public string Number { get; private set; }
public eCodecCallType Type { 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 public enum eCodecCallType

View File

@@ -14,22 +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);
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,35 +34,23 @@ 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
{ {
get { return () => _PrivacyModeIsOn; } get { return () => _PrivacyModeIsOn; }
} }
bool _PrivacyModeIsOn; bool _PrivacyModeIsOn;
protected override Func<string> SharingSourceFeedbackFunc
{
get { return () => _SharingSource; }
}
string _SharingSource;
protected override Func<int> VolumeLevelFeedbackFunc protected override Func<int> VolumeLevelFeedbackFunc
{ {
@@ -73,37 +58,24 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
} }
int _VolumeLevel; int _VolumeLevel;
protected override Func<bool> MuteFeedbackFunc
{
get { return () => _IsMuted; }
}
bool _IsMuted;
protected override Func<string> SharingSourceFeedbackFunc
{
get { return () => _SharingSource; }
}
string _SharingSource;
/// <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();
//IsInCall.FireUpdate();
} }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public override void EndCall() public override void EndCall(string s)
{ {
Debug.Console(1, this, "EndCall"); Debug.Console(1, this, "EndCall");
//_InCall = false; ActiveCalls.RemoveAll(i => i.Name == s);
//IsInCall.FireUpdate(); ActiveCallCountFeedback.FireUpdate();
} }
/// <summary> /// <summary>
@@ -131,14 +103,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>
@@ -152,113 +128,62 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
} }
/// <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");
@@ -269,6 +194,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");
@@ -278,6 +206,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;
@@ -288,6 +219,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");
@@ -296,11 +231,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");
} }
} }
} }

View File

@@ -27,6 +27,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; }
@@ -77,7 +80,7 @@ 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(); public abstract void EndCall(string s);
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);

View File

@@ -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
} }

View File

@@ -191,7 +191,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
void ConnectPress() void ConnectPress()
{ {
if (Codec.IsInCall) if (Codec.IsInCall)
Codec.EndCall(); Codec.EndCall("end whatever is selected");
else else
Codec.Dial(DialStringBuilder.ToString()); Codec.Dial(DialStringBuilder.ToString());
} }