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
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; }
}
/// <summary>

View File

@@ -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<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 eCodecCallType Type { get; private set; }
public CodecActiveCallItem(string name, string number, eCodecCallType type)
{
Name = name;
Number = number;
Type = type;
}
}
public enum eCodecCallType

View File

@@ -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<int> ActiveCallCountFeedbackFunc
{
get { return () => _ActiveCallCount; }
get { return () => ActiveCalls.Count; }
}
int _ActiveCallCount;
protected override Func<bool> IncomingCallFeedbackFunc
{
@@ -37,35 +34,23 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
}
bool _IncomingCall;
//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;
protected override Func<bool> MuteFeedbackFunc
{
get { return () => _IsMuted; }
}
bool _IsMuted;
protected override Func<bool> PrivacyModeIsOnFeedbackFunc
{
get { return () => _PrivacyModeIsOn; }
}
bool _PrivacyModeIsOn;
protected override Func<string> SharingSourceFeedbackFunc
{
get { return () => _SharingSource; }
}
string _SharingSource;
protected override Func<int> VolumeLevelFeedbackFunc
{
@@ -73,37 +58,24 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
}
int _VolumeLevel;
protected override Func<bool> MuteFeedbackFunc
{
get { return () => _IsMuted; }
}
bool _IsMuted;
protected override Func<string> SharingSourceFeedbackFunc
{
get { return () => _SharingSource; }
}
string _SharingSource;
/// <summary>
/// Dials, yo!
/// </summary>
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();
}
/// <summary>
///
/// </summary>
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();
}
/// <summary>
@@ -131,14 +103,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
Debug.Console(1, this, "SendDTMF: {0}", s);
}
/// <summary>
///
/// </summary>
public override void StartSharing()
{
}
/// <summary>
///
/// </summary>
public override void StopSharing()
{
}
/// <summary>
@@ -152,113 +128,62 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
}
/// <summary>
///
/// </summary>
public override void MuteOff()
{
_IsMuted = false;
MuteFeedback.FireUpdate();
}
/// <summary>
///
/// </summary>
public override void MuteOn()
{
_IsMuted = true;
MuteFeedback.FireUpdate();
}
/// <summary>
///
/// </summary>
public override void MuteToggle()
{
_IsMuted = !_IsMuted;
MuteFeedback.FireUpdate();
}
/// <summary>
///
/// </summary>
/// <param name="level"></param>
public override void SetVolume(ushort level)
{
_VolumeLevel = level;
VolumeLevelFeedback.FireUpdate();
}
/// <summary>
///
/// </summary>
/// <param name="pressRelease"></param>
public override void VolumeDown(bool pressRelease)
{
}
/// <summary>
///
/// </summary>
/// <param name="pressRelease"></param>
public override void VolumeUp(bool pressRelease)
{
}
///// <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()
//{
//}
/// <summary>
///
/// </summary>
public override void PrivacyModeOn()
{
Debug.Console(1, this, "PrivacyMuteOn");
@@ -269,6 +194,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
}
/// <summary>
///
/// </summary>
public override void PrivacyModeOff()
{
Debug.Console(1, this, "PrivacyMuteOff");
@@ -278,6 +206,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
PrivacyModeIsOnFeedback.FireUpdate();
}
/// <summary>
///
/// </summary>
public override void PrivacyModeToggle()
{
_PrivacyModeIsOn = !_PrivacyModeIsOn;
@@ -288,6 +219,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
//********************************************************
// SIMULATION METHODS
/// <summary>
///
/// </summary>
/// <param name="url"></param>
public void TestIncomingCall(string url)
{
Debug.Console(1, this, "TestIncomingCall");
@@ -296,11 +231,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
IncomingCallFeedback.FireUpdate();
}
/// <summary>
///
/// </summary>
public void TestFarEndHangup()
{
Debug.Console(1, this, "TestFarEndHangup");
}
}
}

View File

@@ -27,6 +27,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
#endregion
/// <summary>
/// Returns true when ActiveCallCountFeedback is > 0
/// </summary>
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);

View File

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

View File

@@ -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());
}