mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 20:54:55 +00:00
Merge remote-tracking branch 'origin/feature/ecs-407' into feature/cisco-spark-2
Conflicts: Essentials Devices Common/Essentials Devices Common/Codec/CodecActiveCallItem.cs Essentials Devices Common/Essentials Devices Common/Codec/eCodecCallStatus.cs Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoCodec.cs Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs
This commit is contained in:
@@ -162,6 +162,14 @@ namespace PepperDash.Essentials.Core
|
|||||||
tl.BooleanInput[sigNum].BoolValue = value;
|
tl.BooleanInput[sigNum].BoolValue = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Helper method to set the value of a ushort Sig on TriList
|
||||||
|
/// </summary>
|
||||||
|
public static void SetUshort(this BasicTriList tl, uint sigNum, ushort value)
|
||||||
|
{
|
||||||
|
tl.UShortInput[sigNum].UShortValue = value;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Helper method to set the value of a string Sig on TriList
|
/// Helper method to set the value of a string Sig on TriList
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1,27 +1,38 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common.Codec
|
namespace PepperDash.Essentials.Devices.Common.Codec
|
||||||
|
|
||||||
{
|
{
|
||||||
public class CodecActiveCallItem
|
public class CodecActiveCallItem
|
||||||
{
|
{
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
public string Number { get; set; }
|
public string Number { get; set; }
|
||||||
|
|
||||||
public eCodecCallType Type { get; set; }
|
public eCodecCallType Type { get; set; }
|
||||||
|
|
||||||
public eCodecCallStatus Status { get; set; }
|
public eCodecCallStatus Status { get; set; }
|
||||||
|
|
||||||
public eCodecCallDirection Direction { get; set; }
|
public string Id { get; set; }
|
||||||
|
|
||||||
public string Id { get; set; }
|
public object CallMetaData { get; set; }
|
||||||
|
|
||||||
public object CallMetaData { get; set; }
|
/// <summary>
|
||||||
}
|
/// Returns true when this call is any status other than
|
||||||
|
/// Unknown, Disconnected, Disconnecting
|
||||||
|
/// </summary>
|
||||||
|
public bool IsActiveCall
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return !(Status == eCodecCallStatus.Disconnected
|
||||||
|
|| Status == eCodecCallStatus.Disconnecting
|
||||||
|
|| Status == eCodecCallStatus.Unknown);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -5,88 +5,21 @@ using System.Text;
|
|||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common.Codec
|
namespace PepperDash.Essentials.Devices.Common.Codec
|
||||||
|
|
||||||
{
|
{
|
||||||
public enum eCodecCallStatus
|
public enum eCodecCallStatus
|
||||||
{
|
{
|
||||||
Unknown = 0,
|
Unknown = 0,
|
||||||
Idle,
|
Connected,
|
||||||
Dialing,
|
Connecting,
|
||||||
Ringing,
|
Dialing,
|
||||||
Connecting,
|
Disconnected,
|
||||||
Connected,
|
Disconnecting,
|
||||||
Disconnecting,
|
EarlyMedia,
|
||||||
Incoming,
|
Idle,
|
||||||
OnHold,
|
Incoming,
|
||||||
EarlyMedia,
|
OnHold,
|
||||||
Preserved,
|
Ringing,
|
||||||
RemotePreserved,
|
Preserved,
|
||||||
Disconnected
|
RemotePreserved,
|
||||||
}
|
|
||||||
|
|
||||||
public class CodecCallStatus
|
|
||||||
{
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Takes the Cisco status and converts to the matching enum
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="s"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static eCodecCallStatus ConvertToStatusEnum(string s)
|
|
||||||
{
|
|
||||||
switch (s)
|
|
||||||
{
|
|
||||||
case "Idle":
|
|
||||||
{
|
|
||||||
return eCodecCallStatus.Idle;
|
|
||||||
}
|
|
||||||
case "Dialling":
|
|
||||||
{
|
|
||||||
return eCodecCallStatus.Dialing;
|
|
||||||
}
|
|
||||||
case "Ringing":
|
|
||||||
{
|
|
||||||
return eCodecCallStatus.Ringing;
|
|
||||||
}
|
|
||||||
case "Connecting":
|
|
||||||
{
|
|
||||||
return eCodecCallStatus.Connecting;
|
|
||||||
}
|
|
||||||
case "Connected":
|
|
||||||
{
|
|
||||||
return eCodecCallStatus.Connected;
|
|
||||||
}
|
|
||||||
case "Disconnecting":
|
|
||||||
{
|
|
||||||
return eCodecCallStatus.Disconnecting;
|
|
||||||
}
|
|
||||||
case "Incoming":
|
|
||||||
{
|
|
||||||
return eCodecCallStatus.Incoming;
|
|
||||||
}
|
|
||||||
case "OnHold":
|
|
||||||
{
|
|
||||||
return eCodecCallStatus.OnHold;
|
|
||||||
}
|
|
||||||
case "EarlyMedia":
|
|
||||||
{
|
|
||||||
return eCodecCallStatus.EarlyMedia;
|
|
||||||
}
|
|
||||||
case "Preserved":
|
|
||||||
{
|
|
||||||
return eCodecCallStatus.Preserved;
|
|
||||||
}
|
|
||||||
case "RemotePreserved":
|
|
||||||
{
|
|
||||||
return eCodecCallStatus.RemotePreserved;
|
|
||||||
}
|
|
||||||
case "Disconnected":
|
|
||||||
{
|
|
||||||
return eCodecCallStatus.Disconnected;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
return eCodecCallStatus.Unknown;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -22,7 +22,6 @@ namespace PepperDash.Essentials.Devices.Common.Codec
|
|||||||
void RejectCall(CodecActiveCallItem item);
|
void RejectCall(CodecActiveCallItem item);
|
||||||
void SendDtmf(string digit);
|
void SendDtmf(string digit);
|
||||||
|
|
||||||
IntFeedback ActiveCallCountFeedback { get; }
|
|
||||||
BoolFeedback IncomingCallFeedback { get; }
|
BoolFeedback IncomingCallFeedback { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
: base(key, name)
|
: base(key, name)
|
||||||
{
|
{
|
||||||
// Debug helpers
|
// Debug helpers
|
||||||
ActiveCallCountFeedback.OutputChange += (o, a) => Debug.Console(1, this, "InCall={0}", ActiveCallCountFeedback.IntValue);
|
//ActiveCallCountFeedback.OutputChange += (o, a) => Debug.Console(1, this, "InCall={0}", ActiveCallCountFeedback.IntValue);
|
||||||
IncomingCallFeedback.OutputChange += (o, a) => Debug.Console(1, this, "IncomingCall={0}", _IncomingCall);
|
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);
|
||||||
@@ -25,11 +25,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
VolumeLevelFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Volume={0}", _VolumeLevel);
|
VolumeLevelFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Volume={0}", _VolumeLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Func<int> ActiveCallCountFeedbackFunc
|
|
||||||
{
|
|
||||||
get { return () => ActiveCalls.Count; }
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override Func<bool> IncomingCallFeedbackFunc
|
protected override Func<bool> IncomingCallFeedbackFunc
|
||||||
{
|
{
|
||||||
get { return () => _IncomingCall; }
|
get { return () => _IncomingCall; }
|
||||||
@@ -69,7 +64,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
var call = new CodecActiveCallItem() { Name = s, Number = s, Id = s, Status = eCodecCallStatus.Dialing };
|
var call = new CodecActiveCallItem() { Name = s, Number = s, Id = s, Status = eCodecCallStatus.Dialing };
|
||||||
ActiveCalls.Add(call);
|
ActiveCalls.Add(call);
|
||||||
OnCallStatusChange(eCodecCallStatus.Unknown, call.Status, call);
|
OnCallStatusChange(eCodecCallStatus.Unknown, call.Status, 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 =>
|
||||||
{
|
{
|
||||||
@@ -86,9 +81,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
{
|
{
|
||||||
Debug.Console(1, this, "EndCall");
|
Debug.Console(1, this, "EndCall");
|
||||||
ActiveCalls.Remove(call);
|
ActiveCalls.Remove(call);
|
||||||
|
|
||||||
SetNewCallStatusAndFireCallStatusChange(eCodecCallStatus.Disconnected, call);
|
SetNewCallStatusAndFireCallStatusChange(eCodecCallStatus.Disconnected, call);
|
||||||
ActiveCallCountFeedback.FireUpdate();
|
//ActiveCallCountFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -102,7 +96,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
ActiveCalls.Remove(call);
|
ActiveCalls.Remove(call);
|
||||||
SetNewCallStatusAndFireCallStatusChange(eCodecCallStatus.Disconnected, call);
|
SetNewCallStatusAndFireCallStatusChange(eCodecCallStatus.Disconnected, call);
|
||||||
}
|
}
|
||||||
ActiveCallCountFeedback.FireUpdate();
|
//ActiveCallCountFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -122,6 +116,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
public override void RejectCall(CodecActiveCallItem call)
|
public override void RejectCall(CodecActiveCallItem call)
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "RejectCall");
|
Debug.Console(1, this, "RejectCall");
|
||||||
|
ActiveCalls.Remove(call);
|
||||||
|
SetNewCallStatusAndFireCallStatusChange(eCodecCallStatus.Disconnected, call);
|
||||||
|
//ActiveCallCountFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -259,7 +256,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
SetNewCallStatusAndFireCallStatusChange(eCodecCallStatus.Incoming, call);
|
SetNewCallStatusAndFireCallStatusChange(eCodecCallStatus.Incoming, call);
|
||||||
_IncomingCall = true;
|
_IncomingCall = true;
|
||||||
IncomingCallFeedback.FireUpdate();
|
IncomingCallFeedback.FireUpdate();
|
||||||
ActiveCallCountFeedback.FireUpdate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -274,7 +270,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
SetNewCallStatusAndFireCallStatusChange(eCodecCallStatus.Incoming, call);
|
SetNewCallStatusAndFireCallStatusChange(eCodecCallStatus.Incoming, call);
|
||||||
_IncomingCall = true;
|
_IncomingCall = true;
|
||||||
IncomingCallFeedback.FireUpdate();
|
IncomingCallFeedback.FireUpdate();
|
||||||
ActiveCallCountFeedback.FireUpdate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -286,17 +281,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
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
|
#region IRoutingOutputs Members
|
||||||
|
|
||||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
||||||
|
|||||||
@@ -35,24 +35,15 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns whether any call in ActiveCalls is actually "active"
|
/// Returns true when any call is not in state Unknown, Disconnecting, Disconnected
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsInCall
|
public bool IsInCall { get { return ActiveCalls.Any(c => c.IsActiveCall); } }
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return ActiveCalls.Any(c =>
|
|
||||||
!(c.Status == eCodecCallStatus.Unknown
|
|
||||||
|| c.Status == eCodecCallStatus.Disconnected
|
|
||||||
|| c.Status == eCodecCallStatus.Disconnecting));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public BoolFeedback IncomingCallFeedback { get; private set; }
|
public BoolFeedback IncomingCallFeedback { get; private set; }
|
||||||
|
|
||||||
public IntFeedback ActiveCallCountFeedback { get; private set; }
|
//public IntFeedback ActiveCallCountFeedback { get; private set; }
|
||||||
|
|
||||||
abstract protected Func<int> ActiveCallCountFeedbackFunc { get; }
|
//abstract protected Func<int> ActiveCallCountFeedbackFunc { get; }
|
||||||
abstract protected Func<bool> IncomingCallFeedbackFunc { get; }
|
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; }
|
||||||
@@ -64,7 +55,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
public VideoCodecBase(string key, string name)
|
public VideoCodecBase(string key, string name)
|
||||||
: base(key, name)
|
: base(key, name)
|
||||||
{
|
{
|
||||||
ActiveCallCountFeedback = new IntFeedback(ActiveCallCountFeedbackFunc);
|
|
||||||
IncomingCallFeedback = new BoolFeedback(IncomingCallFeedbackFunc);
|
IncomingCallFeedback = new BoolFeedback(IncomingCallFeedbackFunc);
|
||||||
PrivacyModeIsOnFeedback = new BoolFeedback(PrivacyModeIsOnFeedbackFunc);
|
PrivacyModeIsOnFeedback = new BoolFeedback(PrivacyModeIsOnFeedbackFunc);
|
||||||
VolumeLevelFeedback = new IntFeedback(VolumeLevelFeedbackFunc);
|
VolumeLevelFeedback = new IntFeedback(VolumeLevelFeedbackFunc);
|
||||||
@@ -73,26 +63,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
|
|
||||||
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
||||||
|
|
||||||
ActiveCallCountFeedback.OutputChange += new EventHandler<EventArgs>(ActiveCallCountFeedback_OutputChange);
|
|
||||||
|
|
||||||
ActiveCalls = new List<CodecActiveCallItem>();
|
ActiveCalls = new List<CodecActiveCallItem>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
void ActiveCallCountFeedback_OutputChange(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (UsageTracker != null)
|
|
||||||
{
|
|
||||||
if (IsInCall)
|
|
||||||
UsageTracker.StartDeviceUsage();
|
|
||||||
else
|
|
||||||
UsageTracker.EndDeviceUsage();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#region IHasDialer Members
|
#region IHasDialer Members
|
||||||
|
|
||||||
public abstract void Dial(string s);
|
public abstract void Dial(string s);
|
||||||
@@ -125,19 +98,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
protected void SetNewCallStatusAndFireCallStatusChange(eCodecCallStatus newStatus, CodecActiveCallItem call)
|
protected void SetNewCallStatusAndFireCallStatusChange(eCodecCallStatus newStatus, CodecActiveCallItem call)
|
||||||
{
|
{
|
||||||
var prevStatus = call.Status;
|
var prevStatus = call.Status;
|
||||||
call.Status = newStatus;
|
call.Status = newStatus;
|
||||||
OnCallStatusChange(prevStatus, newStatus, call);
|
OnCallStatusChange(prevStatus, newStatus, call);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Helper method to notify of call status change event
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <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(eCodecCallStatus previousStatus, eCodecCallStatus newStatus, CodecActiveCallItem item)
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "Call Status Changed from {0} to {1} on call {2}", previousStatus, newStatus, item.Id);
|
|
||||||
var handler = CallStatusChange;
|
var handler = CallStatusChange;
|
||||||
if (handler != null)
|
if (handler != null)
|
||||||
handler(this, new CodecCallStatusItemChangeEventArgs(previousStatus, newStatus, item));
|
handler(this, new CodecCallStatusItemChangeEventArgs(previousStatus, newStatus, item));
|
||||||
@@ -178,6 +150,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
public StringFeedback SharingSourceFeedback { get; private set; }
|
public StringFeedback SharingSourceFeedback { get; private set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
// **** DEBUGGING THINGS ****
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public virtual void ListCalls()
|
||||||
|
{
|
||||||
|
var sb = new StringBuilder();
|
||||||
|
foreach (var c in ActiveCalls)
|
||||||
|
sb.AppendFormat("{0} {1} -- {2} {3}\r", c.Id, c.Number, c.Name, c.Status);
|
||||||
|
Debug.Console(1, "{0}", sb.ToString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -40,5 +40,10 @@
|
|||||||
/// 3922
|
/// 3922
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const uint PresentationListCaretMode = 3922;
|
public const uint PresentationListCaretMode = 3922;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 15024 - Modes 0: On hook, 1: Phone, 2: Video
|
||||||
|
/// </summary>
|
||||||
|
public const uint CallHeaderButtonMode = 15024;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -155,6 +155,12 @@ namespace PepperDash.Essentials
|
|||||||
//PowerOffTimeout = 30000;
|
//PowerOffTimeout = 30000;
|
||||||
|
|
||||||
//TriList.StringInput[UIStringJoin.StartActivityText].StringValue = "Tap an activity below";
|
//TriList.StringInput[UIStringJoin.StartActivityText].StringValue = "Tap an activity below";
|
||||||
|
|
||||||
|
// Reveal proper header buttons with/without lighting
|
||||||
|
if(false) // has lighting
|
||||||
|
TriList.SetBool(UIBoolJoin.CallLeftHeaderButtonVisible, true);
|
||||||
|
else
|
||||||
|
TriList.SetBool(UIBoolJoin.CallRightHeaderButtonVisible, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -9,11 +9,16 @@ using PepperDash.Core;
|
|||||||
using PepperDash.Essentials;
|
using PepperDash.Essentials;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.SmartObjects;
|
using PepperDash.Essentials.Core.SmartObjects;
|
||||||
|
using PepperDash.Essentials.Devices.Common.Codec;
|
||||||
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.UIDrivers.VC
|
namespace PepperDash.Essentials.UIDrivers.VC
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
#warning When InCall, keypad text should clear. Keypad becomes DTMF only. Delete is gone and disabled. Send keypresses immediately to SendDTMF. Queue them in disaply string.
|
||||||
|
#warning when Call ends, clear keypad text.
|
||||||
|
#warning FOR SPARK - (GFX also) we need a staging bar for in call state where there is no camera button
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This fella will likely need to interact with the room's source, although that is routed via the spark...
|
/// This fella will likely need to interact with the room's source, although that is routed via the spark...
|
||||||
/// Probably needs event or FB to feed AV driver - to show two-mute volume when appropriate.
|
/// Probably needs event or FB to feed AV driver - to show two-mute volume when appropriate.
|
||||||
@@ -60,6 +65,8 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
StringBuilder DialStringBuilder = new StringBuilder();
|
StringBuilder DialStringBuilder = new StringBuilder();
|
||||||
BoolFeedback DialStringBackspaceVisibleFeedback;
|
BoolFeedback DialStringBackspaceVisibleFeedback;
|
||||||
|
|
||||||
|
ModalDialog IncomingCallModal;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -72,6 +79,8 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
SetupCallStagingPopover();
|
SetupCallStagingPopover();
|
||||||
SetupDialKeypad();
|
SetupDialKeypad();
|
||||||
|
|
||||||
|
codec.CallStatusChange += new EventHandler<CodecCallStatusItemChangeEventArgs>(Codec_CallStatusChange);
|
||||||
|
|
||||||
InCall = new BoolFeedback(() => false);
|
InCall = new BoolFeedback(() => false);
|
||||||
LocalPrivacyIsMuted = new BoolFeedback(() => false);
|
LocalPrivacyIsMuted = new BoolFeedback(() => false);
|
||||||
|
|
||||||
@@ -93,7 +102,98 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
DialStringBackspaceVisibleFeedback
|
DialStringBackspaceVisibleFeedback
|
||||||
.LinkInputSig(TriList.BooleanInput[UIBoolJoin.KeyboardClearVisible]);
|
.LinkInputSig(TriList.BooleanInput[UIBoolJoin.KeyboardClearVisible]);
|
||||||
|
|
||||||
Codec.ActiveCallCountFeedback.OutputChange += new EventHandler<EventArgs>(InCallFeedback_OutputChange);
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles status changes for calls
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
void Codec_CallStatusChange(object sender, CodecCallStatusItemChangeEventArgs e)
|
||||||
|
{
|
||||||
|
var call = e.CallItem;
|
||||||
|
Debug.Console(1, "*#* UI: Codec status {0}: {1} --> {2}", call.Name, e.PreviousStatus, e.NewStatus);
|
||||||
|
switch (e.NewStatus)
|
||||||
|
{
|
||||||
|
case eCodecCallStatus.Connected:
|
||||||
|
// fire at SRL item
|
||||||
|
Debug.Console(1, "*#* UI: Call Connected {0}", call.Name);
|
||||||
|
break;
|
||||||
|
case eCodecCallStatus.Connecting:
|
||||||
|
// fire at SRL item
|
||||||
|
Debug.Console(1, "*#* UI: Call Connecting {0}", call.Name);
|
||||||
|
break;
|
||||||
|
case eCodecCallStatus.Dialing:
|
||||||
|
Debug.Console(1, "*#* UI: Call Dialing {0}", call.Name);
|
||||||
|
break;
|
||||||
|
case eCodecCallStatus.Disconnected:
|
||||||
|
Debug.Console(1, "*#* UI: Call Disconnecting {0}", call.Name);
|
||||||
|
break;
|
||||||
|
case eCodecCallStatus.Disconnecting:
|
||||||
|
break;
|
||||||
|
case eCodecCallStatus.EarlyMedia:
|
||||||
|
break;
|
||||||
|
case eCodecCallStatus.Idle:
|
||||||
|
break;
|
||||||
|
case eCodecCallStatus.Incoming:
|
||||||
|
// fire up a modal
|
||||||
|
ShowIncomingModal(call);
|
||||||
|
break;
|
||||||
|
case eCodecCallStatus.OnHold:
|
||||||
|
break;
|
||||||
|
case eCodecCallStatus.Preserved:
|
||||||
|
break;
|
||||||
|
case eCodecCallStatus.RemotePreserved:
|
||||||
|
break;
|
||||||
|
case eCodecCallStatus.Ringing:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
TriList.UShortInput[UIUshortJoin.VCStagingConnectButtonMode].UShortValue = (ushort)(Codec.IsInCall ? 1 : 0);
|
||||||
|
StagingBarInterlock.ShowInterlocked(Codec.IsInCall ?
|
||||||
|
UIBoolJoin.VCStagingActivePopoverVisible : UIBoolJoin.VCStagingInactivePopoverVisible);
|
||||||
|
// Set mode of header button
|
||||||
|
if (!Codec.IsInCall)
|
||||||
|
TriList.SetUshort(UIUshortJoin.CallHeaderButtonMode, 0);
|
||||||
|
else if(Codec.ActiveCalls.Any(c => c.Type == eCodecCallType.Video))
|
||||||
|
TriList.SetUshort(UIUshortJoin.CallHeaderButtonMode, 2);
|
||||||
|
else
|
||||||
|
TriList.SetUshort(UIUshortJoin.CallHeaderButtonMode, 1);
|
||||||
|
|
||||||
|
// Update list of calls
|
||||||
|
var activeList = Codec.ActiveCalls.Where(c => c.IsActiveCall).ToList();
|
||||||
|
Debug.Console(1, "*#* UI - Codec has {0} calls", activeList.Count);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
void ShowIncomingModal(CodecActiveCallItem call)
|
||||||
|
{
|
||||||
|
IncomingCallModal = new ModalDialog(TriList);
|
||||||
|
string msg;
|
||||||
|
string icon;
|
||||||
|
if (call.Type == eCodecCallType.Audio)
|
||||||
|
{
|
||||||
|
icon = "Phone";
|
||||||
|
msg = string.Format("Incoming phone call from: {0}", call.Name);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
icon = "Camera";
|
||||||
|
msg = string.Format("Incoming video call from: {0}", call.Name);
|
||||||
|
}
|
||||||
|
IncomingCallModal.PresentModalDialog(2, "Incoming Call", icon, msg,
|
||||||
|
"Ignore", "Accept", false, false, b =>
|
||||||
|
{
|
||||||
|
if (b == 1)
|
||||||
|
Codec.RejectCall(call);
|
||||||
|
else //2
|
||||||
|
Codec.AcceptCall(call);
|
||||||
|
IncomingCallModal = null;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -196,28 +296,6 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
Codec.Dial(DialStringBuilder.ToString());
|
Codec.Dial(DialStringBuilder.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
void InCallFeedback_OutputChange(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
var inCall = Codec.IsInCall;
|
|
||||||
Debug.Console(1, "*#* Codec Driver InCallFeedback change={0}", InCall);
|
|
||||||
TriList.UShortInput[UIUshortJoin.VCStagingConnectButtonMode].UShortValue = (ushort)(inCall ? 1 : 0);
|
|
||||||
StagingBarInterlock.ShowInterlocked(
|
|
||||||
inCall ? UIBoolJoin.VCStagingActivePopoverVisible : UIBoolJoin.VCStagingInactivePopoverVisible);
|
|
||||||
|
|
||||||
if (Codec.IsInCall) // Call is starting
|
|
||||||
{
|
|
||||||
// Header icon
|
|
||||||
// Volume bar needs to have mic mute
|
|
||||||
}
|
|
||||||
else // ending
|
|
||||||
{
|
|
||||||
// Header icon
|
|
||||||
// Volume bar no mic mute (or hidden if no source?)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -8,4 +8,12 @@ devjson:1 {"deviceKey":"timer","methodName":"Cancel" }
|
|||||||
|
|
||||||
devjson:1 {"deviceKey":"timer","methodName":"Reset" }
|
devjson:1 {"deviceKey":"timer","methodName":"Reset" }
|
||||||
|
|
||||||
devjson:1 {"deviceKey":"room1","methodName":"Shutdown" }
|
devjson:1 {"deviceKey":"room1","methodName":"Shutdown" }
|
||||||
|
|
||||||
|
devjson:1 {"deviceKey":"mockVc-1", "methodName":"TestIncomingVideoCall", "params": ["123-456-7890"]}
|
||||||
|
|
||||||
|
devjson:1 {"deviceKey":"mockVc-1", "methodName":"TestIncomingAudioCall", "params": ["111-111-1111"]}
|
||||||
|
|
||||||
|
devjson:1 {"deviceKey":"mockVc-1", "methodName":"TestIncomingVideoCall", "params": ["444-444-4444"]}
|
||||||
|
|
||||||
|
devjson:1 {"deviceKey":"mockVc-1", "methodName":"ListCalls"}
|
||||||
|
|||||||
Reference in New Issue
Block a user