Various bug fixes

This commit is contained in:
Neil Dorin
2017-10-18 22:25:02 -06:00
parent 91cc452e03
commit b423d1cb58
10 changed files with 396 additions and 280 deletions

View File

@@ -15,6 +15,8 @@ namespace PepperDash.Essentials.Devices.Common.Codec
{ {
// Add requirements for Dialer functionality // Add requirements for Dialer functionality
event EventHandler<CodecCallStatusItemChangeEventArgs> CallStatusChange;
void Dial(string number); void Dial(string number);
void EndCall(CodecActiveCallItem activeCall); void EndCall(CodecActiveCallItem activeCall);
void EndAllCalls(); void EndAllCalls();
@@ -22,6 +24,27 @@ namespace PepperDash.Essentials.Devices.Common.Codec
void RejectCall(CodecActiveCallItem item); void RejectCall(CodecActiveCallItem item);
void SendDtmf(string digit); void SendDtmf(string digit);
BoolFeedback IncomingCallFeedback { get; } //BoolFeedback IncomingCallFeedback { get; }
}
/// <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;
}
} }
} }

View File

@@ -189,9 +189,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
} }
} }
#warning Figure out where this func is or disappeared to
protected override Func<bool> IncomingCallFeedbackFunc { get { return () => false; } }
private string CliFeedbackRegistrationExpression; private string CliFeedbackRegistrationExpression;
@@ -205,6 +202,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public bool CommDebuggingIsOn; public bool CommDebuggingIsOn;
string Delimiter = "\r\n"; string Delimiter = "\r\n";
int PresentationSource; int PresentationSource;
@@ -242,8 +240,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
Communication = comm; Communication = comm;
LoginMessageReceived = new CTimer(DisconnectClientAndReconnect, 5000);
if (props.CommunicationMonitorProperties != null) if (props.CommunicationMonitorProperties != null)
{ {
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, props.CommunicationMonitorProperties); CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, props.CommunicationMonitorProperties);
@@ -253,6 +249,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 30000, 120000, 300000, "xStatus SystemUnit Software Version\r"); CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 30000, 120000, 300000, "xStatus SystemUnit Software Version\r");
} }
if (props.Sharing != null)
AutoShareContentWhileInCall = props.Sharing.AutoShareContentWhileInCall;
ShowSelfViewByDefault = props.ShowSelfViewByDefault;
DeviceManager.AddDevice(CommunicationMonitor); DeviceManager.AddDevice(CommunicationMonitor);
PhonebookMode = props.PhonebookMode; PhonebookMode = props.PhonebookMode;
@@ -337,13 +338,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
/// <returns></returns> /// <returns></returns>
public override bool CustomActivate() public override bool CustomActivate()
{ {
//CrestronConsole.AddNewConsoleCommand(SendText, "send" + Key, "", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(SetCommDebug, "SetCodecCommDebug", "0 for Off, 1 for on", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(SetCommDebug, "SetCodecCommDebug", "0 for Off, 1 for on", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(GetPhonebook, "GetCodecPhonebook", "Triggers a refresh of the codec phonebook", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(GetPhonebook, "GetCodecPhonebook", "Triggers a refresh of the codec phonebook", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(GetBookings, "GetCodecBookings", "Triggers a refresh of the booking data for today", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(GetBookings, "GetCodecBookings", "Triggers a refresh of the booking data for today", ConsoleAccessLevelEnum.AccessOperator);
//CommDebuggingIsOn = true;
Communication.Connect(); Communication.Connect();
LoginMessageReceived = new CTimer(DisconnectClientAndReconnect, 5000);
var socket = Communication as ISocketStatus; var socket = Communication as ISocketStatus;
if (socket != null) if (socket != null)
{ {
@@ -550,22 +551,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
{ {
bool changeDetected = false; bool changeDetected = false;
eCodecCallStatus newStatus = eCodecCallStatus.Unknown;
// Update properties of ActiveCallItem // Update properties of ActiveCallItem
if(call.Status != null) if(call.Status != null)
if (!string.IsNullOrEmpty(call.Status.Value)) if (!string.IsNullOrEmpty(call.Status.Value))
{ {
eCodecCallStatus newStatus = eCodecCallStatus.Unknown; tempActiveCall.Status = CodecCallStatus.ConvertToStatusEnum(call.Status.Value);
newStatus = CodecCallStatus.ConvertToStatusEnum(call.Status.Value);
if (newStatus != eCodecCallStatus.Unknown)
{
changeDetected = true;
SetNewCallStatusAndFireCallStatusChange(newStatus, tempActiveCall);
}
if (newStatus == eCodecCallStatus.Connected) if (newStatus == eCodecCallStatus.Connected)
GetCallHistory(); GetCallHistory();
changeDetected = true;
} }
if (call.CallType != null) if (call.CallType != null)
if (!string.IsNullOrEmpty(call.CallType.Value)) if (!string.IsNullOrEmpty(call.CallType.Value))
@@ -590,6 +587,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
if (changeDetected) if (changeDetected)
{ {
SetSelfViewMode();
OnCallStatusChange(tempActiveCall);
ListCalls(); ListCalls();
} }
} }
@@ -611,7 +610,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
ListCalls(); ListCalls();
SetNewCallStatusAndFireCallStatusChange(newCallItem.Status, newCallItem); SetSelfViewMode();
OnCallStatusChange(newCallItem);
} }
} }
@@ -756,6 +756,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
ListCalls(); ListCalls();
SetSelfViewMode();
// Notify of the call disconnection // Notify of the call disconnection
SetNewCallStatusAndFireCallStatusChange(eCodecCallStatus.Disconnected, tempActiveCall); SetNewCallStatusAndFireCallStatusChange(eCodecCallStatus.Disconnected, tempActiveCall);
@@ -1100,6 +1101,24 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
SendText("xCommand SystemUnit Boot Action: Restart"); SendText("xCommand SystemUnit Boot Action: Restart");
} }
/// <summary>
/// Sets SelfView Mode based on config
/// </summary>
void SetSelfViewMode()
{
if (!IsInCall)
{
SelfviewModeOff();
}
else
{
if (ShowSelfViewByDefault)
SelfviewModeOn();
else
SelfviewModeOff();
}
}
/// <summary> /// <summary>
/// Turns on Selfview Mode /// Turns on Selfview Mode
/// </summary> /// </summary>

View File

@@ -13,8 +13,6 @@ namespace PepperDash.Essentials.Devices.Common.Codec
{ {
public CommunicationMonitorConfig CommunicationMonitorProperties { get; set; } public CommunicationMonitorConfig CommunicationMonitorProperties { get; set; }
//public ControlPropertiesConfig Control { get; set; }
public List<CodecActiveCallItem> Favorites { get; set; } public List<CodecActiveCallItem> Favorites { get; set; }
/// <summary> /// <summary>
@@ -22,5 +20,14 @@ namespace PepperDash.Essentials.Devices.Common.Codec
/// </summary> /// </summary>
public string PhonebookMode { get; set; } public string PhonebookMode { get; set; }
public bool ShowSelfViewByDefault { get; set; }
public SharingProperties Sharing { get; set; }
}
public class SharingProperties
{
public bool AutoShareContentWhileInCall { get; set; }
} }
} }

View File

@@ -15,6 +15,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
{ {
BoolFeedback SelfviewIsOnFeedback { get; } BoolFeedback SelfviewIsOnFeedback { get; }
bool ShowSelfViewByDefault { get; }
void SelfviewModeOn(); void SelfviewModeOn();
void SelfviewModeOff(); void SelfviewModeOff();

View File

@@ -36,7 +36,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
} }
// Debug helpers // Debug helpers
IncomingCallFeedback.OutputChange += (o, a) => Debug.Console(1, this, "IncomingCall={0}", _IncomingCall);
MuteFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Mute={0}", _IsMuted); MuteFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Mute={0}", _IsMuted);
PrivacyModeIsOnFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Privacy={0}", _PrivacyModeIsOn); PrivacyModeIsOnFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Privacy={0}", _PrivacyModeIsOn);
SharingSourceFeedback.OutputChange += (o, a) => Debug.Console(1, this, "SharingSource={0}", _SharingSource); SharingSourceFeedback.OutputChange += (o, a) => Debug.Console(1, this, "SharingSource={0}", _SharingSource);
@@ -64,12 +63,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
SetIsReady(); SetIsReady();
} }
protected override Func<bool> IncomingCallFeedbackFunc
{
get { return () => _IncomingCall; }
}
bool _IncomingCall;
protected override Func<bool> MuteFeedbackFunc protected override Func<bool> MuteFeedbackFunc
{ {
get { return () => _IsMuted; } get { return () => _IsMuted; }
@@ -102,7 +95,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
Debug.Console(1, this, "Dial: {0}", number); Debug.Console(1, this, "Dial: {0}", number);
var call = new CodecActiveCallItem() { Name = number, Number = number, Id = number, Status = eCodecCallStatus.Dialing }; var call = new CodecActiveCallItem() { Name = number, Number = number, Id = number, Status = eCodecCallStatus.Dialing };
ActiveCalls.Add(call); ActiveCalls.Add(call);
OnCallStatusChange(eCodecCallStatus.Unknown, call.Status, call); OnCallStatusChange(call);
//ActiveCallCountFeedback.FireUpdate(); //ActiveCallCountFeedback.FireUpdate();
// Simulate 2-second ring, then connecting, then connected // Simulate 2-second ring, then connecting, then connected
new CTimer(o => new CTimer(o =>
@@ -299,8 +292,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
var call = new CodecActiveCallItem() { Name = url, Id = url, Number = url, Type= eCodecCallType.Video, Direction = eCodecCallDirection.Incoming }; var call = new CodecActiveCallItem() { Name = url, Id = url, Number = url, Type= eCodecCallType.Video, Direction = eCodecCallDirection.Incoming };
ActiveCalls.Add(call); ActiveCalls.Add(call);
SetNewCallStatusAndFireCallStatusChange(eCodecCallStatus.Ringing, call); SetNewCallStatusAndFireCallStatusChange(eCodecCallStatus.Ringing, call);
_IncomingCall = true;
IncomingCallFeedback.FireUpdate(); //OnCallStatusChange(eCodecCallStatus.Unknown, eCodecCallStatus.Ringing, call);
} }
/// <summary> /// <summary>
@@ -313,8 +307,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
var call = new CodecActiveCallItem() { Name = url, Id = url, Number = url, Type = eCodecCallType.Audio, Direction = eCodecCallDirection.Incoming }; var call = new CodecActiveCallItem() { Name = url, Id = url, Number = url, Type = eCodecCallType.Audio, Direction = eCodecCallDirection.Incoming };
ActiveCalls.Add(call); ActiveCalls.Add(call);
SetNewCallStatusAndFireCallStatusChange(eCodecCallStatus.Ringing, call); SetNewCallStatusAndFireCallStatusChange(eCodecCallStatus.Ringing, call);
_IncomingCall = true;
IncomingCallFeedback.FireUpdate(); //OnCallStatusChange(eCodecCallStatus.Unknown, eCodecCallStatus.Ringing, call);
} }
/// <summary> /// <summary>

View File

@@ -40,9 +40,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
/// </summary> /// </summary>
public bool IsInCall { get { return ActiveCalls.Any(c => c.IsActiveCall); } } public bool IsInCall { get { return ActiveCalls.Any(c => c.IsActiveCall); } }
public BoolFeedback IncomingCallFeedback { get; private set; }
abstract protected Func<bool> IncomingCallFeedbackFunc { get; }
abstract protected Func<bool> PrivacyModeIsOnFeedbackFunc { get; } abstract protected Func<bool> PrivacyModeIsOnFeedbackFunc { get; }
abstract protected Func<int> VolumeLevelFeedbackFunc { get; } abstract protected Func<int> VolumeLevelFeedbackFunc { get; }
abstract protected Func<bool> MuteFeedbackFunc { get; } abstract protected Func<bool> MuteFeedbackFunc { get; }
@@ -52,12 +49,15 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
public VideoCodecInfo CodecInfo { get; protected set; } public VideoCodecInfo CodecInfo { get; protected set; }
public bool ShowSelfViewByDefault { get; protected set; }
public bool AutoShareContentWhileInCall { get; protected set; }
public bool IsReady { get; protected set; } public bool IsReady { get; protected set; }
public VideoCodecBase(string key, string name) public VideoCodecBase(string key, string name)
: base(key, name) : base(key, name)
{ {
IncomingCallFeedback = new BoolFeedback(IncomingCallFeedbackFunc);
PrivacyModeIsOnFeedback = new BoolFeedback(PrivacyModeIsOnFeedbackFunc); PrivacyModeIsOnFeedback = new BoolFeedback(PrivacyModeIsOnFeedbackFunc);
VolumeLevelFeedback = new IntFeedback(VolumeLevelFeedbackFunc); VolumeLevelFeedback = new IntFeedback(VolumeLevelFeedbackFunc);
MuteFeedback = new BoolFeedback(MuteFeedbackFunc); MuteFeedback = new BoolFeedback(MuteFeedbackFunc);
@@ -87,7 +87,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
{ {
return new List<Feedback> return new List<Feedback>
{ {
IncomingCallFeedback,
PrivacyModeIsOnFeedback, PrivacyModeIsOnFeedback,
SharingSourceFeedback SharingSourceFeedback
}; };
@@ -101,9 +100,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
/// </summary> /// </summary>
protected void SetNewCallStatusAndFireCallStatusChange(eCodecCallStatus newStatus, CodecActiveCallItem call) protected void SetNewCallStatusAndFireCallStatusChange(eCodecCallStatus newStatus, CodecActiveCallItem call)
{ {
var prevStatus = call.Status;
call.Status = newStatus; call.Status = newStatus;
OnCallStatusChange(prevStatus, newStatus, call);
OnCallStatusChange(call);
if (AutoShareContentWhileInCall)
StartSharing();
} }
/// <summary> /// <summary>
@@ -112,11 +114,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
/// <param name="previousStatus"></param> /// <param name="previousStatus"></param>
/// <param name="newStatus"></param> /// <param name="newStatus"></param>
/// <param name="item"></param> /// <param name="item"></param>
protected void OnCallStatusChange(eCodecCallStatus previousStatus, eCodecCallStatus newStatus, CodecActiveCallItem item) protected void OnCallStatusChange(CodecActiveCallItem item)
{ {
var handler = CallStatusChange; var handler = CallStatusChange;
if (handler != null) if (handler != null)
handler(this, new CodecCallStatusItemChangeEventArgs(previousStatus, newStatus, item)); handler(this, new CodecCallStatusItemChangeEventArgs(item));
} }
/// <summary> /// <summary>
@@ -174,31 +176,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
{ {
var sb = new StringBuilder(); var sb = new StringBuilder();
foreach (var c in ActiveCalls) foreach (var c in ActiveCalls)
sb.AppendFormat("{0} {1} -- {2} {3}\r", c.Id, c.Number, c.Name, c.Status); sb.AppendFormat("{0} {1} -- {2} {3}\n", c.Id, c.Number, c.Name, c.Status);
Debug.Console(1, "{0}", sb.ToString()); Debug.Console(1, this, "\n{0}\n", sb.ToString());
} }
} }
/// <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;
}
}
/// <summary> /// <summary>
/// Used to track the status of syncronizing the phonebook values when connecting to a codec or refreshing the phonebook info /// Used to track the status of syncronizing the phonebook values when connecting to a codec or refreshing the phonebook info

View File

@@ -37,6 +37,15 @@ namespace PepperDash.Essentials
/// 1003 - For tapping the text field to reveal the keyboard /// 1003 - For tapping the text field to reveal the keyboard
/// </summary> /// </summary>
public const uint CodecDirectorySearchTextPress = 1003; public const uint CodecDirectorySearchTextPress = 1003;
/// <summary>
/// 1004
/// </summary>
public const uint CallStopSharingPress = 1004;
/// <summary>
/// 1005
/// </summary>
public const uint CallSharedSourceInfoEnable = 1005;
// Audio Conference // Audio Conference
@@ -220,6 +229,7 @@ namespace PepperDash.Essentials
/// </summary> /// </summary>
public const uint VCSelfViewPipTogglePress = 1253; public const uint VCSelfViewPipTogglePress = 1253;
//****************************************************** //******************************************************
// Letter joins start at 2921; // Letter joins start at 2921;

View File

@@ -23,6 +23,11 @@ namespace PepperDash.Essentials
/// 1002 /// 1002
/// </summary> /// </summary>
public const uint CodecDirectorySearchEntryText = 1002; public const uint CodecDirectorySearchEntryText = 1002;
/// <summary>
/// 1004
/// </summary>
public const uint CallSharedSourceNameText = 1004;
/// <summary> /// <summary>
/// 1201 - 1230 range of joins for recents list /// 1201 - 1230 range of joins for recents list

View File

@@ -304,14 +304,27 @@ namespace PepperDash.Essentials
(CurrentRoom.DefaultDisplay as IPower).PowerToggle(); (CurrentRoom.DefaultDisplay as IPower).PowerToggle();
}); });
TriList.SetSigFalseAction(UIBoolJoin.HeaderCallStatusButtonPress, () => TriList.SetSigFalseAction(UIBoolJoin.HeaderCallStatusButtonPress, ShowActiveCallsList );
PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.HeaderActiveCallsListVisible));
SetupNextMeetingTimer(); SetupNextMeetingTimer();
base.Show(); base.Show();
} }
/// <summary>
/// Allows PopupInterlock to be toggled if the calls list is already visible, or if the codec is in a call
/// </summary>
void ShowActiveCallsList()
{
if(PopupInterlock.CurrentJoin == UIBoolJoin.HeaderActiveCallsListVisible)
PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.HeaderActiveCallsListVisible);
else
{
if((CurrentRoom.ScheduleSource as VideoCodecBase).IsInCall)
PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.HeaderActiveCallsListVisible);
}
}
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@@ -959,8 +972,7 @@ namespace PepperDash.Essentials
// Call button // Call button
HeaderCallButton = new HeaderListButton(HeaderButtonsList, nextIndex); HeaderCallButton = new HeaderListButton(HeaderButtonsList, nextIndex);
HeaderCallButton.SetIcon(HeaderListButton.OnHook); HeaderCallButton.SetIcon(HeaderListButton.OnHook);
HeaderCallButton.OutputSig.SetSigFalseAction(() => HeaderCallButton.OutputSig.SetSigFalseAction(ShowActiveCallsList);
PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.HeaderActiveCallsListVisible));
nextIndex--; nextIndex--;

View File

@@ -79,6 +79,9 @@ namespace PepperDash.Essentials.UIDrivers.VC
StringBuilder SearchStringBuilder = new StringBuilder(); StringBuilder SearchStringBuilder = new StringBuilder();
BoolFeedback SearchStringBackspaceVisibleFeedback; BoolFeedback SearchStringBackspaceVisibleFeedback;
BoolFeedback CallSharingInfoVisibleFeedback;
StringFeedback CallSharingInfoTextFeedback;
ModalDialog IncomingCallModal; ModalDialog IncomingCallModal;
eKeypadMode KeypadMode; eKeypadMode KeypadMode;
@@ -107,6 +110,8 @@ namespace PepperDash.Essentials.UIDrivers.VC
codec.CallStatusChange += new EventHandler<CodecCallStatusItemChangeEventArgs>(Codec_CallStatusChange); codec.CallStatusChange += new EventHandler<CodecCallStatusItemChangeEventArgs>(Codec_CallStatusChange);
codec.SharingSourceFeedback.OutputChange += new EventHandler<EventArgs>(SharingSourceFeedback_OutputChange);
// If the codec is ready, then get the values we want, otherwise wait // If the codec is ready, then get the values we want, otherwise wait
if (Codec.IsReady) if (Codec.IsReady)
Codec_IsReady(); Codec_IsReady();
@@ -153,7 +158,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
else else
{ {
Parent.Keyboard.DisableGoButton(); Parent.Keyboard.DisableGoButton();
return "Touch to Search"; return "Tap For Search Keyboard";
} }
}); });
SearchStringFeedback.LinkInputSig(triList.StringInput[UIStringJoin.CodecDirectorySearchEntryText]); SearchStringFeedback.LinkInputSig(triList.StringInput[UIStringJoin.CodecDirectorySearchEntryText]);
@@ -173,9 +178,46 @@ namespace PepperDash.Essentials.UIDrivers.VC
TriList.SetSigFalseAction(UIBoolJoin.VCDirectoryBackspacePress, SearchKeypadBackspacePress); TriList.SetSigFalseAction(UIBoolJoin.VCDirectoryBackspacePress, SearchKeypadBackspacePress);
CallSharingInfoVisibleFeedback = new BoolFeedback(() => !string.IsNullOrEmpty(Codec.SharingSourceFeedback.StringValue));
CallSharingInfoVisibleFeedback.LinkInputSig(triList.BooleanInput[UIBoolJoin.CallSharedSourceInfoEnable]);
CallSharingInfoTextFeedback = new StringFeedback(() => GetCurrentSourceName(Codec.SharingSourceFeedback.StringValue));
CallSharingInfoTextFeedback.LinkInputSig(triList.StringInput[UIStringJoin.CallSharedSourceNameText]);
TriList.SetSigFalseAction(UIBoolJoin.CallStopSharingPress, Codec.StopSharing);
// Address and number // Address and number
} }
/// <summary>
/// Returns the name of the source that matches the specified key
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
string GetCurrentSourceName(string key)
{
var device = DeviceManager.GetDeviceForKey(key);
return (device as SourceListItem).Name;
}
/// <summary>
/// Fires when the sharing source feedback of the codec changes
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void SharingSourceFeedback_OutputChange(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty((sender as IHasSharing).SharingSourceFeedback.StringValue))
{
// Source is being shared
}
}
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@@ -197,7 +239,14 @@ namespace PepperDash.Essentials.UIDrivers.VC
void Codec_CallStatusChange(object sender, CodecCallStatusItemChangeEventArgs e) void Codec_CallStatusChange(object sender, CodecCallStatusItemChangeEventArgs e)
{ {
var call = e.CallItem; var call = e.CallItem;
switch (e.NewStatus)
//var newStatus = e.NewStatus;
//// Catch events with no status and reuse previous status if found
//if (newStatus == eCodecCallStatus.Unknown && e.PreviousStatus != eCodecCallStatus.Unknown)
// newStatus = e.PreviousStatus;
switch (e.CallItem.Status)
{ {
case eCodecCallStatus.Connected: case eCodecCallStatus.Connected:
// fire at SRL item // fire at SRL item
@@ -214,7 +263,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
Parent.ShowNotificationRibbon("Connecting", 0); Parent.ShowNotificationRibbon("Connecting", 0);
break; break;
case eCodecCallStatus.Dialing: case eCodecCallStatus.Dialing:
Parent.ShowNotificationRibbon("Dialing", 0); Parent.ShowNotificationRibbon("Connecting", 0);
break; break;
case eCodecCallStatus.Disconnected: case eCodecCallStatus.Disconnected:
if (!Codec.IsInCall) if (!Codec.IsInCall)
@@ -255,14 +304,15 @@ namespace PepperDash.Essentials.UIDrivers.VC
Parent.ComputeHeaderCallStatus(Codec); Parent.ComputeHeaderCallStatus(Codec);
// Update list of calls // Update active call list
UpdateCallsHeaderList(call); UpdateHeaderActiveCallList();
} }
/// <summary> /// <summary>
/// Redraws the calls list on the header /// Redraws the calls list on the header
/// </summary> /// </summary>
void UpdateCallsHeaderList(CodecActiveCallItem call) void UpdateHeaderActiveCallList()
{ {
var activeList = Codec.ActiveCalls.Where(c => c.IsActiveCall).ToList(); var activeList = Codec.ActiveCalls.Where(c => c.IsActiveCall).ToList();
ActiveCallsSRL.Clear(); ActiveCallsSRL.Clear();
@@ -279,6 +329,10 @@ namespace PepperDash.Essentials.UIDrivers.VC
i++; i++;
} }
ActiveCallsSRL.Count = (ushort)activeList.Count; ActiveCallsSRL.Count = (ushort)activeList.Count;
// If Active Calls list is visible and codec is not in a call, hide the list
if (!Codec.IsInCall && Parent.PopupInterlock.CurrentJoin == UIBoolJoin.HeaderActiveCallsListVisible)
Parent.PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.HeaderActiveCallsListVisible);
} }
/// <summary> /// <summary>
@@ -431,7 +485,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
else if (c.OccurenceType == eCodecOccurrenceType.Placed) else if (c.OccurenceType == eCodecOccurrenceType.Placed)
iconName = "Misc-17_Light"; iconName = "Misc-17_Light";
else else
iconName = "Help"; iconName = "Delete";
RecentCallsList.SetItemIcon(i, iconName); RecentCallsList.SetItemIcon(i, iconName);
var call = c; // for lambda scope var call = c; // for lambda scope
@@ -609,16 +663,25 @@ namespace PepperDash.Essentials.UIDrivers.VC
var dc = r as DirectoryContact; var dc = r as DirectoryContact;
DirectoryList.SetItemButtonAction(i, b => if (dc.ContactMethods.Count > 1)
{ {
if (!b) // If more than one contact method, show contact method modal dialog
DirectoryList.SetItemButtonAction(i, b =>
{ {
// Refresh the contact methods list if (!b)
RefreshContactMethodsModalList(dc); {
Parent.PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.MeetingsOrContacMethodsListVisible); // Refresh the contact methods list
} RefreshContactMethodsModalList(dc);
}); Parent.PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.MeetingsOrContacMethodsListVisible);
}
});
}
else
{
// If only one contact method, just dial that method
DirectoryList.SetItemButtonAction(i, b => Codec.Dial(dc.ContactMethods[0].Number));
}
} }
else // is DirectoryFolder else // is DirectoryFolder
{ {
@@ -685,9 +748,6 @@ namespace PepperDash.Essentials.UIDrivers.VC
var svc = Codec as IHasCodecSelfview; var svc = Codec as IHasCodecSelfview;
if (svc != null) if (svc != null)
{ {
// Default Selfview to off
svc.SelfviewModeOff();
TriList.SetSigFalseAction(UIBoolJoin.VCSelfViewTogglePress, svc.SelfviewModeToggle); TriList.SetSigFalseAction(UIBoolJoin.VCSelfViewTogglePress, svc.SelfviewModeToggle);
svc.SelfviewIsOnFeedback.LinkInputSig(TriList.BooleanInput[UIBoolJoin.VCSelfViewTogglePress]); svc.SelfviewIsOnFeedback.LinkInputSig(TriList.BooleanInput[UIBoolJoin.VCSelfViewTogglePress]);
@@ -964,7 +1024,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
{ {
if (DialStringBuilder.Length == 0 && !Codec.IsInCall) if (DialStringBuilder.Length == 0 && !Codec.IsInCall)
{ {
return "Dial or touch to enter address"; return "Dial or Tap to Show Keyboard";
} }
if(Regex.Match(ds, @"^\d{4,7}$").Success) // 456-7890 if(Regex.Match(ds, @"^\d{4,7}$").Success) // 456-7890
return string.Format("{0}-{1}", ds.Substring(0, 3), ds.Substring(3)); return string.Format("{0}-{1}", ds.Substring(0, 3), ds.Substring(3));
@@ -985,7 +1045,8 @@ namespace PepperDash.Essentials.UIDrivers.VC
enum eKeypadMode enum eKeypadMode
{ {
Dial, DTMF Dial = 0,
DTMF
} }
} }
} }