mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 20:54:55 +00:00
Added CodecInfo object to VideoCodecBase
This commit is contained in:
@@ -15,8 +15,7 @@ namespace PepperDash.Essentials.Devices.Common.Codec
|
|||||||
Disconnected,
|
Disconnected,
|
||||||
Disconnecting,
|
Disconnecting,
|
||||||
EarlyMedia,
|
EarlyMedia,
|
||||||
Idle,
|
Idle,
|
||||||
Incoming,
|
|
||||||
OnHold,
|
OnHold,
|
||||||
Ringing,
|
Ringing,
|
||||||
Preserved,
|
Preserved,
|
||||||
@@ -64,10 +63,6 @@ namespace PepperDash.Essentials.Devices.Common.Codec
|
|||||||
{
|
{
|
||||||
return eCodecCallStatus.Idle;
|
return eCodecCallStatus.Idle;
|
||||||
}
|
}
|
||||||
case "Incoming":
|
|
||||||
{
|
|
||||||
return eCodecCallStatus.Incoming;
|
|
||||||
}
|
|
||||||
case "OnHold":
|
case "OnHold":
|
||||||
{
|
{
|
||||||
return eCodecCallStatus.OnHold;
|
return eCodecCallStatus.OnHold;
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Devices.Common.Codec
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Implements a common set of data about a codec
|
||||||
|
/// </summary>
|
||||||
|
public interface iCodecInfo
|
||||||
|
{
|
||||||
|
VideoCodecInfo CodecInfo { get; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stores general information about a codec
|
||||||
|
/// </summary>
|
||||||
|
public abstract class VideoCodecInfo
|
||||||
|
{
|
||||||
|
public abstract bool MultiSiteOptionIsEnabled { get; }
|
||||||
|
public abstract string IpAddress { get; }
|
||||||
|
public abstract string PhoneNumber { get; }
|
||||||
|
public abstract string SipUri { get; }
|
||||||
|
public abstract bool AutoAnswerEnabled { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -107,6 +107,7 @@
|
|||||||
<Compile Include="Codec\eCodecCallType.cs" />
|
<Compile Include="Codec\eCodecCallType.cs" />
|
||||||
<Compile Include="Codec\eCodecCallStatus.cs" />
|
<Compile Include="Codec\eCodecCallStatus.cs" />
|
||||||
<Compile Include="Codec\iCodecAudio.cs" />
|
<Compile Include="Codec\iCodecAudio.cs" />
|
||||||
|
<Compile Include="Codec\iCodecInfo.cs" />
|
||||||
<Compile Include="Codec\iHasCallFavorites.cs" />
|
<Compile Include="Codec\iHasCallFavorites.cs" />
|
||||||
<Compile Include="Codec\iHasCallHistory.cs" />
|
<Compile Include="Codec\iHasCallHistory.cs" />
|
||||||
<Compile Include="Codec\iHasDialer.cs" />
|
<Compile Include="Codec\iHasDialer.cs" />
|
||||||
|
|||||||
@@ -156,8 +156,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
|
|
||||||
public bool CommDebuggingIsOn;
|
public bool CommDebuggingIsOn;
|
||||||
|
|
||||||
public bool MultiSiteOptionIsEnabled;
|
|
||||||
|
|
||||||
string Delimiter = "\r\n";
|
string Delimiter = "\r\n";
|
||||||
|
|
||||||
int PresentationSource;
|
int PresentationSource;
|
||||||
@@ -211,6 +209,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
CodecConfiguration = new CiscoCodecConfiguration.RootObject();
|
CodecConfiguration = new CiscoCodecConfiguration.RootObject();
|
||||||
CodecStatus = new CiscoCodecStatus.RootObject();
|
CodecStatus = new CiscoCodecStatus.RootObject();
|
||||||
|
|
||||||
|
CodecInfo = new CiscoCodecInfo(CodecStatus, CodecConfiguration);
|
||||||
|
|
||||||
CallHistory = new CodecCallHistory();
|
CallHistory = new CodecCallHistory();
|
||||||
|
|
||||||
CallFavorites = new CodecCallFavorites();
|
CallFavorites = new CodecCallFavorites();
|
||||||
@@ -498,8 +498,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
{
|
{
|
||||||
SyncState.InitialStatusMessageReceived();
|
SyncState.InitialStatusMessageReceived();
|
||||||
|
|
||||||
SetStatusProperties(CodecStatus);
|
|
||||||
|
|
||||||
if (!SyncState.InitialConfigurationMessageWasReceived)
|
if (!SyncState.InitialConfigurationMessageWasReceived)
|
||||||
SendText("xConfiguration");
|
SendText("xConfiguration");
|
||||||
}
|
}
|
||||||
@@ -644,17 +642,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
|
|
||||||
protected override Func<bool> IncomingCallFeedbackFunc { get { return () => false; } }
|
protected override Func<bool> IncomingCallFeedbackFunc { get { return () => false; } }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Sets the properties based on a complete status message return
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="status"></param>
|
|
||||||
private void SetStatusProperties(CiscoCodecStatus.RootObject status)
|
|
||||||
{
|
|
||||||
if (status.Status.SystemUnit.Software.OptionKeys.MultiSite.Value == "true")
|
|
||||||
MultiSiteOptionIsEnabled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the first CallId or returns null
|
/// Gets the first CallId or returns null
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -917,6 +904,73 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
{
|
{
|
||||||
SendText(string.Format("xCommand CallHistory DeleteEntry CallHistoryId: {0} AcknowledgeConsecutiveDuplicates: True", entry.OccurrenceHistoryId));
|
SendText(string.Format("xCommand CallHistory DeleteEntry CallHistoryId: {0} AcknowledgeConsecutiveDuplicates: True", entry.OccurrenceHistoryId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class CiscoCodecInfo : VideoCodecInfo
|
||||||
|
{
|
||||||
|
public CiscoCodecStatus.RootObject CodecStatus { get; private set; }
|
||||||
|
|
||||||
|
public CiscoCodecConfiguration.RootObject CodecConfiguration { get; private set; }
|
||||||
|
|
||||||
|
public override bool MultiSiteOptionIsEnabled
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (CodecStatus.Status.SystemUnit.Software.OptionKeys.MultiSite.Value.ToLower() == "true")
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
public override string IpAddress
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (CodecConfiguration.Configuration.Network != null)
|
||||||
|
{
|
||||||
|
if (CodecConfiguration.Configuration.Network.Count > 0)
|
||||||
|
return CodecConfiguration.Configuration.Network[0].IPv4.Address.Value;
|
||||||
|
}
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public override string PhoneNumber
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (CodecConfiguration.Configuration.H323.H323Alias.E164 != null)
|
||||||
|
return CodecConfiguration.Configuration.H323.H323Alias.E164.Value;
|
||||||
|
else
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public override string SipUri
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (CodecConfiguration.Configuration.H323.H323Alias.ID != null)
|
||||||
|
return CodecConfiguration.Configuration.H323.H323Alias.ID.Value;
|
||||||
|
else
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public override bool AutoAnswerEnabled
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (CodecConfiguration.Configuration.Conference.AutoAnswer.Mode.Value.ToLower() == "on")
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public CiscoCodecInfo(CiscoCodecStatus.RootObject status, CiscoCodecConfiguration.RootObject configuration)
|
||||||
|
{
|
||||||
|
CodecStatus = status;
|
||||||
|
CodecConfiguration = configuration;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -1091,4 +1145,5 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
InitialSyncComplete = false;
|
InitialSyncComplete = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -269,9 +269,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
public void TestIncomingVideoCall(string url)
|
public void TestIncomingVideoCall(string url)
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "TestIncomingVideoCall from {0}", url);
|
Debug.Console(1, this, "TestIncomingVideoCall from {0}", url);
|
||||||
var call = new CodecActiveCallItem() { Name = url, Id = url, Number = url, Type= eCodecCallType.Video };
|
var call = new CodecActiveCallItem() { Name = url, Id = url, Number = url, Type= eCodecCallType.Video, Direction = eCodecCallDirection.Incoming };
|
||||||
ActiveCalls.Add(call);
|
ActiveCalls.Add(call);
|
||||||
SetNewCallStatusAndFireCallStatusChange(eCodecCallStatus.Incoming, call);
|
SetNewCallStatusAndFireCallStatusChange(eCodecCallStatus.Ringing, call);
|
||||||
_IncomingCall = true;
|
_IncomingCall = true;
|
||||||
IncomingCallFeedback.FireUpdate();
|
IncomingCallFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
@@ -283,9 +283,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
public void TestIncomingAudioCall(string url)
|
public void TestIncomingAudioCall(string url)
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "TestIncomingAudioCall from {0}", url);
|
Debug.Console(1, this, "TestIncomingAudioCall from {0}", url);
|
||||||
var call = new CodecActiveCallItem() { Name = url, Id = url, Number = url, Type = eCodecCallType.Audio };
|
var call = new CodecActiveCallItem() { Name = url, Id = url, Number = url, Type = eCodecCallType.Audio, Direction = eCodecCallDirection.Incoming };
|
||||||
ActiveCalls.Add(call);
|
ActiveCalls.Add(call);
|
||||||
SetNewCallStatusAndFireCallStatusChange(eCodecCallStatus.Incoming, call);
|
SetNewCallStatusAndFireCallStatusChange(eCodecCallStatus.Ringing, call);
|
||||||
_IncomingCall = true;
|
_IncomingCall = true;
|
||||||
IncomingCallFeedback.FireUpdate();
|
IncomingCallFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ using PepperDash.Essentials.Devices.Common.Codec;
|
|||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||||
{
|
{
|
||||||
public abstract class VideoCodecBase : Device, IRoutingInputsOutputs, IUsageTracking, IHasDialer, IHasSharing, ICodecAudio
|
public abstract class VideoCodecBase : Device, IRoutingInputsOutputs, IUsageTracking, IHasDialer, IHasSharing, ICodecAudio, iCodecInfo
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fires when the status of any active, dialing, or incoming call changes or is new
|
/// Fires when the status of any active, dialing, or incoming call changes or is new
|
||||||
@@ -45,7 +45,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
abstract protected Func<bool> MuteFeedbackFunc { get; }
|
abstract protected Func<bool> MuteFeedbackFunc { get; }
|
||||||
abstract protected Func<string> SharingSourceFeedbackFunc { get; }
|
abstract protected Func<string> SharingSourceFeedbackFunc { get; }
|
||||||
|
|
||||||
public List<CodecActiveCallItem> ActiveCalls { get; set; }
|
public List<CodecActiveCallItem> ActiveCalls { get; set; }
|
||||||
|
|
||||||
|
public VideoCodecInfo CodecInfo { get; protected set; }
|
||||||
|
|
||||||
public VideoCodecBase(string key, string name)
|
public VideoCodecBase(string key, string name)
|
||||||
: base(key, name)
|
: base(key, name)
|
||||||
@@ -59,7 +61,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
||||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
||||||
|
|
||||||
ActiveCalls = new List<CodecActiveCallItem>();
|
ActiveCalls = new List<CodecActiveCallItem>();
|
||||||
}
|
}
|
||||||
|
|
||||||
#region IHasDialer Members
|
#region IHasDialer Members
|
||||||
@@ -157,7 +159,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
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}\r", c.Id, c.Number, c.Name, c.Status);
|
||||||
Debug.Console(1, "{0}", sb.ToString());
|
Debug.Console(1, "{0}", sb.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -160,10 +160,6 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
break;
|
break;
|
||||||
case eCodecCallStatus.Idle:
|
case eCodecCallStatus.Idle:
|
||||||
break;
|
break;
|
||||||
case eCodecCallStatus.Incoming:
|
|
||||||
// fire up a modal
|
|
||||||
ShowIncomingModal(call);
|
|
||||||
break;
|
|
||||||
case eCodecCallStatus.OnHold:
|
case eCodecCallStatus.OnHold:
|
||||||
break;
|
break;
|
||||||
case eCodecCallStatus.Preserved:
|
case eCodecCallStatus.Preserved:
|
||||||
@@ -171,7 +167,12 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
case eCodecCallStatus.RemotePreserved:
|
case eCodecCallStatus.RemotePreserved:
|
||||||
break;
|
break;
|
||||||
case eCodecCallStatus.Ringing:
|
case eCodecCallStatus.Ringing:
|
||||||
break;
|
{
|
||||||
|
// fire up a modal
|
||||||
|
if( !Codec.CodecInfo.AutoAnswerEnabled && call.Direction == eCodecCallDirection.Incoming)
|
||||||
|
ShowIncomingModal(call);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user