fix(essentials): various bug fixes for hold FB, individual call end, incoming name-number fb, ipv4 address fb

This commit is contained in:
Jonathan Arndt
2022-02-11 16:39:47 -08:00
parent b0e3fddec7
commit d88a454499
4 changed files with 64 additions and 8 deletions

View File

@@ -664,8 +664,16 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
foreach (var camera in CodecStatus.Status.Cameras.Camera) foreach (var camera in CodecStatus.Status.Cameras.Camera)
{ {
Debug.Console(0, this,
@"Camera id: {0}
Name: {1}
ConnectorID: {2}"
, camera.id
, camera.Manufacturer.Value
, camera.Model.Value);
var id = Convert.ToUInt16(camera.id); var id = Convert.ToUInt16(camera.id);
var info = new CameraInfo() { CameraNumber = id, Name = string.Format("{0} {1}", camera.Manufacturer, camera.Model), SourceId = camera.DetectedConnector.ConnectorId }; var info = new CameraInfo() { CameraNumber = id, Name = string.Format("{0} {1}", camera.Manufacturer.Value, camera.Model.Value), SourceId = camera.DetectedConnector.ConnectorId };
cameraInfo.Add(info); cameraInfo.Add(info);
} }
@@ -1994,7 +2002,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
} }
Cameras.Add(internalCamera); Cameras.Add(internalCamera);
DeviceManager.AddDevice(internalCamera); //DeviceManager.AddDevice(internalCamera);
} }
else else
{ {
@@ -2132,12 +2140,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
{ {
get get
{ {
if (CodecConfiguration.Configuration.Network != null) var address = string.Empty;
if (CodecConfiguration.Configuration.Network.Count > 0)
{ {
if (CodecConfiguration.Configuration.Network.Count > 0) if(!string.IsNullOrEmpty(CodecConfiguration.Configuration.Network[0].IPv4.Address.Value))
return CodecConfiguration.Configuration.Network[0].IPv4.Address.Value; address = CodecConfiguration.Configuration.Network[0].IPv4.Address.Value;
} }
return string.Empty;
if (string.IsNullOrEmpty(address) && CodecStatus.Status.Network.Count > 0)
{
if(!string.IsNullOrEmpty(CodecStatus.Status.Network[0].IPv4.Address.Value))
address = CodecStatus.Status.Network[0].IPv4.Address.Value;
}
return address;
} }
} }
public override string E164Alias public override string E164Alias

View File

@@ -738,6 +738,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public Assignment Assignment { get; set; } public Assignment Assignment { get; set; }
public Gateway Gateway { get; set; } public Gateway Gateway { get; set; }
public SubnetMask SubnetMask { get; set; } public SubnetMask SubnetMask { get; set; }
public IPv4()
{
Address = new Address4();
}
} }
public class Address5 public class Address5
@@ -889,6 +894,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public RemoteAccess RemoteAccess { get; set; } public RemoteAccess RemoteAccess { get; set; }
public Speed Speed { get; set; } public Speed Speed { get; set; }
public VLAN VLAN { get; set; } public VLAN VLAN { get; set; }
public Network()
{
IPv4 = new IPv4();
}
} }
public class Mode19 public class Mode19
@@ -1850,6 +1860,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
{ {
Audio = new Audio(); Audio = new Audio();
Conference = new Conference(); Conference = new Conference();
Network = new List<Network>();
} }
} }

View File

@@ -270,7 +270,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
{ {
get get
{ {
return Convert.ToUInt16(Value); if(!string.IsNullOrEmpty(Value))
{
return Convert.ToUInt16(Value);
}
else
return -1;
} }
} }
} }
@@ -289,6 +294,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public Position Position { get; set; } public Position Position { get; set; }
public SerialNumber SerialNumber { get; set; } public SerialNumber SerialNumber { get; set; }
public SoftwareID SoftwareID { get; set; } public SoftwareID SoftwareID { get; set; }
public Camera()
{
Manufacturer = new Manufacturer();
Model = new Model();
DetectedConnector = new DectectedConnector();
}
} }
public class Availability : ValueProperty public class Availability : ValueProperty
@@ -957,6 +969,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public Address4 Address { get; set; } public Address4 Address { get; set; }
public Gateway Gateway { get; set; } public Gateway Gateway { get; set; }
public SubnetMask SubnetMask { get; set; } public SubnetMask SubnetMask { get; set; }
public IPv4()
{
Address = new Address4();
}
} }
public class Address5 public class Address5
@@ -999,6 +1016,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public IPv4 IPv4 { get; set; } public IPv4 IPv4 { get; set; }
public IPv6 IPv6 { get; set; } public IPv6 IPv6 { get; set; }
public VLAN VLAN { get; set; } public VLAN VLAN { get; set; }
public Network()
{
IPv4 = new IPv4();
}
} }
public class CurrentAddress public class CurrentAddress
@@ -2222,6 +2244,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
SystemUnit = new SystemUnit(); SystemUnit = new SystemUnit();
Video = new Video(); Video = new Video();
Conference = new Conference2(); Conference = new Conference2();
Network = new List<Network>();
} }
} }

View File

@@ -1158,9 +1158,16 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
//End a specific call, specified by index. Maximum 8 calls supported //End a specific call, specified by index. Maximum 8 calls supported
for (int i = 0; i < joinMap.EndCallStart.JoinSpan; i++) for (int i = 0; i < joinMap.EndCallStart.JoinSpan; i++)
{ {
var callIndex = i;
trilist.SetSigFalseAction((uint)(joinMap.EndCallStart.JoinNumber + i), () => trilist.SetSigFalseAction((uint)(joinMap.EndCallStart.JoinNumber + i), () =>
{ {
var callIndex = i;
if (callIndex < 0 || callIndex >= ActiveCalls.Count)
{
Debug.Console(2, this, "Cannot end call. No call found at index: {0}", callIndex);
return;
}
var call = ActiveCalls[callIndex]; var call = ActiveCalls[callIndex];
if (call != null) if (call != null)