mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 21:24:54 +00:00
Compare commits
8 Commits
hotfix/114
...
1.10.7-alp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d302a1b06b | ||
|
|
780ec0aa4b | ||
|
|
c2deaf9534 | ||
|
|
cf3563d6b6 | ||
|
|
e45643e9ab | ||
|
|
03a640d3d4 | ||
|
|
96cc263dbe | ||
|
|
9860e5f498 |
@@ -398,6 +398,22 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
|
|||||||
JoinType = eJoinType.Digital
|
JoinType = eJoinType.Digital
|
||||||
});
|
});
|
||||||
|
|
||||||
|
[JoinName("DirectoryClearSelection")]
|
||||||
|
public JoinDataComplete DirectoryClearSelection = new JoinDataComplete(
|
||||||
|
new JoinData
|
||||||
|
{
|
||||||
|
JoinNumber = 100,
|
||||||
|
JoinSpan = 1
|
||||||
|
},
|
||||||
|
new JoinMetadata
|
||||||
|
{
|
||||||
|
Description = "Directory Search Busy FB",
|
||||||
|
JoinCapabilities = eJoinCapabilities.FromSIMPL,
|
||||||
|
JoinType = eJoinType.Digital
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[JoinName("DirectoryEntryIsContact")]
|
[JoinName("DirectoryEntryIsContact")]
|
||||||
public JoinDataComplete DirectoryEntryIsContact = new JoinDataComplete(
|
public JoinDataComplete DirectoryEntryIsContact = new JoinDataComplete(
|
||||||
new JoinData
|
new JoinData
|
||||||
@@ -1256,11 +1272,12 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
|
|||||||
},
|
},
|
||||||
new JoinMetadata
|
new JoinMetadata
|
||||||
{
|
{
|
||||||
Description = "Directory Select Row",
|
Description = "Directory Select Row and Feedback",
|
||||||
JoinCapabilities = eJoinCapabilities.FromSIMPL,
|
JoinCapabilities = eJoinCapabilities.FromSIMPL,
|
||||||
JoinType = eJoinType.Analog
|
JoinType = eJoinType.Analog
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
[JoinName("SelectedContactMethodCount")]
|
[JoinName("SelectedContactMethodCount")]
|
||||||
public JoinDataComplete SelectedContactMethodCount = new JoinDataComplete(
|
public JoinDataComplete SelectedContactMethodCount = new JoinDataComplete(
|
||||||
new JoinData
|
new JoinData
|
||||||
@@ -1289,6 +1306,22 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
|
|||||||
JoinType = eJoinType.Analog
|
JoinType = eJoinType.Analog
|
||||||
});
|
});
|
||||||
|
|
||||||
|
[JoinName("DirectorySelectRowFeedback")]
|
||||||
|
public JoinDataComplete DirectorySelectRowFeedback = new JoinDataComplete(
|
||||||
|
new JoinData
|
||||||
|
{
|
||||||
|
JoinNumber = 104,
|
||||||
|
JoinSpan = 1
|
||||||
|
},
|
||||||
|
new JoinMetadata
|
||||||
|
{
|
||||||
|
Description = "Directory Select Row and Feedback",
|
||||||
|
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||||
|
JoinType = eJoinType.Analog
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[JoinName("CameraPresetSelect")]
|
[JoinName("CameraPresetSelect")]
|
||||||
public JoinDataComplete CameraPresetSelect = new JoinDataComplete(
|
public JoinDataComplete CameraPresetSelect = new JoinDataComplete(
|
||||||
new JoinData
|
new JoinData
|
||||||
|
|||||||
@@ -131,4 +131,15 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string MinimumEssentialsFrameworkVersion { get; protected set; }
|
public string MinimumEssentialsFrameworkVersion { get; protected set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public abstract class EssentialsPluginDevelopmentDeviceFactory<T> : EssentialsDeviceFactory<T>, IPluginDevelopmentDeviceFactory where T : EssentialsDevice
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Specifies the minimum version of Essentials required for a plugin to run. Must use the format Major.Minor.Build (ex. "1.4.33")
|
||||||
|
/// </summary>
|
||||||
|
public string MinimumEssentialsFrameworkVersion { get; protected set; }
|
||||||
|
|
||||||
|
public List<string> DevelopmentEssentialsFrameworkVersions { get; protected set; }
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
@@ -122,6 +123,38 @@ namespace PepperDash.Essentials.Core
|
|||||||
AssemblyVersion = assemblyVersion;
|
AssemblyVersion = assemblyVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool IsRunningDevelopmentVersion(List<string> developmentVersions, string minimumVersion)
|
||||||
|
{
|
||||||
|
if (Regex.Match(AssemblyVersion, @"^(\d*).(\d*).(\d*).*").Groups[1].Value == "0")
|
||||||
|
{
|
||||||
|
Debug.Console(2, "Running Local Build. Bypassing Dependency Check.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (developmentVersions == null)
|
||||||
|
{
|
||||||
|
Debug.Console(0,
|
||||||
|
"Development Plugin does not specify a list of versions. Loading plugin may not work as expected. Checking Minumum version");
|
||||||
|
return IsRunningMinimumVersionOrHigher(minimumVersion);
|
||||||
|
}
|
||||||
|
|
||||||
|
Debug.Console(2, "Comparing running version '{0}' to minimum versions '{1}'", AssemblyVersion, developmentVersions);
|
||||||
|
|
||||||
|
var versionMatch = developmentVersions.FirstOrDefault(x => x == AssemblyVersion);
|
||||||
|
|
||||||
|
if (String.IsNullOrEmpty(versionMatch))
|
||||||
|
{
|
||||||
|
Debug.Console(0, "Essentials Build does not match any builds required for plugin load. Bypassing Plugin Load.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Debug.Console(2, "Essentials Build {0} matches list of development builds", AssemblyVersion);
|
||||||
|
return IsRunningMinimumVersionOrHigher(minimumVersion);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks to see if the running version meets or exceed the minimum specified version. For beta versions (0.xx.yy), will always return true.
|
/// Checks to see if the running version meets or exceed the minimum specified version. For beta versions (0.xx.yy), will always return true.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
|
||||||
@@ -15,5 +16,10 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public interface IPluginDevelopmentDeviceFactory : IPluginDeviceFactory
|
||||||
|
{
|
||||||
|
List<string> DevelopmentEssentialsFrameworkVersions { get; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -425,7 +425,11 @@ namespace PepperDash.Essentials
|
|||||||
/// <param name="loadedAssembly"></param>
|
/// <param name="loadedAssembly"></param>
|
||||||
static void LoadCustomPlugin(IPluginDeviceFactory plugin, LoadedAssembly loadedAssembly)
|
static void LoadCustomPlugin(IPluginDeviceFactory plugin, LoadedAssembly loadedAssembly)
|
||||||
{
|
{
|
||||||
var passed = Global.IsRunningMinimumVersionOrHigher(plugin.MinimumEssentialsFrameworkVersion);
|
var developmentPlugin = plugin as IPluginDevelopmentDeviceFactory;
|
||||||
|
|
||||||
|
var passed = developmentPlugin != null ? Global.IsRunningDevelopmentVersion
|
||||||
|
(developmentPlugin.DevelopmentEssentialsFrameworkVersions, developmentPlugin.MinimumEssentialsFrameworkVersion)
|
||||||
|
: Global.IsRunningMinimumVersionOrHigher(plugin.MinimumEssentialsFrameworkVersion);
|
||||||
|
|
||||||
if (!passed)
|
if (!passed)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -108,7 +108,7 @@
|
|||||||
<Compile Include="Codec\eCodecCallStatus.cs" />
|
<Compile Include="Codec\eCodecCallStatus.cs" />
|
||||||
<Compile Include="Codec\eMeetingPrivacy.cs" />
|
<Compile Include="Codec\eMeetingPrivacy.cs" />
|
||||||
<Compile Include="Codec\iCodecAudio.cs" />
|
<Compile Include="Codec\iCodecAudio.cs" />
|
||||||
<Compile Include="VideoCodec\IConvertiblePreset.cs" />
|
<Compile Include="VideoCodec\ConvertiblePreset.cs" />
|
||||||
<Compile Include="Codec\IHasCallHold.cs" />
|
<Compile Include="Codec\IHasCallHold.cs" />
|
||||||
<Compile Include="Codec\IHasDoNotDisturb.cs" />
|
<Compile Include="Codec\IHasDoNotDisturb.cs" />
|
||||||
<Compile Include="Codec\IHasExternalSourceSwitching.cs" />
|
<Compile Include="Codec\IHasExternalSourceSwitching.cs" />
|
||||||
|
|||||||
@@ -1023,7 +1023,7 @@ ConnectorID: {2}"
|
|||||||
if (tempPresets.Count > 0)
|
if (tempPresets.Count > 0)
|
||||||
{
|
{
|
||||||
// Create temporary list to store the existing items from the CiscoCodecStatus.RoomPreset collection
|
// Create temporary list to store the existing items from the CiscoCodecStatus.RoomPreset collection
|
||||||
var existingRoomPresets = new List<IConvertiblePreset>();
|
var existingRoomPresets = new List<CiscoCodecStatus.RoomPreset>();
|
||||||
// Add the existing items to the temporary list
|
// Add the existing items to the temporary list
|
||||||
existingRoomPresets.AddRange(CodecStatus.Status.RoomPreset);
|
existingRoomPresets.AddRange(CodecStatus.Status.RoomPreset);
|
||||||
// Populate the CodecStatus object (this will append new values to the RoomPreset collection
|
// Populate the CodecStatus object (this will append new values to the RoomPreset collection
|
||||||
@@ -1031,8 +1031,6 @@ ConnectorID: {2}"
|
|||||||
|
|
||||||
var jResponse = JObject.Parse(response);
|
var jResponse = JObject.Parse(response);
|
||||||
|
|
||||||
List<CiscoCodecStatus.RoomPreset> convertedRoomPresets =
|
|
||||||
existingRoomPresets.Select(a => (CiscoCodecStatus.RoomPreset) a).ToList();
|
|
||||||
|
|
||||||
IList<JToken> roomPresets = jResponse["Status"]["RoomPreset"].Children().ToList();
|
IList<JToken> roomPresets = jResponse["Status"]["RoomPreset"].Children().ToList();
|
||||||
// Iterate the new items in this response agains the temporary list. Overwrite any existing items and add new ones.
|
// Iterate the new items in this response agains the temporary list. Overwrite any existing items and add new ones.
|
||||||
@@ -1041,7 +1039,7 @@ ConnectorID: {2}"
|
|||||||
var preset = camPreset as CiscoCodecStatus.RoomPreset;
|
var preset = camPreset as CiscoCodecStatus.RoomPreset;
|
||||||
if (preset == null) continue;
|
if (preset == null) continue;
|
||||||
// First fine the existing preset that matches the id
|
// First fine the existing preset that matches the id
|
||||||
var existingPreset = convertedRoomPresets.FirstOrDefault(p => p.id.Equals(preset.id));
|
var existingPreset = existingRoomPresets.FirstOrDefault(p => p.id.Equals(preset.id));
|
||||||
if (existingPreset != null)
|
if (existingPreset != null)
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "Existing Room Preset with ID: {0} found. Updating.", existingPreset.id);
|
Debug.Console(1, this, "Existing Room Preset with ID: {0} found. Updating.", existingPreset.id);
|
||||||
@@ -1073,7 +1071,7 @@ ConnectorID: {2}"
|
|||||||
CodecStatus.Status.RoomPreset = existingRoomPresets;
|
CodecStatus.Status.RoomPreset = existingRoomPresets;
|
||||||
|
|
||||||
// Generecise the list
|
// Generecise the list
|
||||||
NearEndPresets = existingRoomPresets.GetGenericPresets<CodecRoomPreset>();
|
NearEndPresets = existingRoomPresets.GetGenericPresets<CiscoCodecStatus.RoomPreset, CodecRoomPreset>();
|
||||||
|
|
||||||
var handler = CodecRoomPresetsListHasChanged;
|
var handler = CodecRoomPresetsListHasChanged;
|
||||||
if (handler != null)
|
if (handler != null)
|
||||||
|
|||||||
@@ -32,12 +32,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="presets"></param>
|
/// <param name="presets"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static List<T> GetGenericPresets<T>(this List<IConvertiblePreset> presets)
|
public static List<TDestination> GetGenericPresets<TSource, TDestination>(this List<TSource> presets) where TSource : ConvertiblePreset where TDestination : PresetBase
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
presets.Select(preset => preset.ConvertCodecPreset())
|
presets.Select(preset => preset.ConvertCodecPreset())
|
||||||
.Where(newPreset => newPreset != null)
|
.Where(newPreset => newPreset != null)
|
||||||
.Cast<T>()
|
.Cast<TDestination>()
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2186,7 +2186,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class RoomPreset : IConvertiblePreset
|
public class RoomPreset : ConvertiblePreset
|
||||||
{
|
{
|
||||||
public string id { get; set; }
|
public string id { get; set; }
|
||||||
public Defined Defined { get; set; }
|
public Defined Defined { get; set; }
|
||||||
@@ -2200,7 +2200,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
Type = new Type5();
|
Type = new Type5();
|
||||||
}
|
}
|
||||||
|
|
||||||
public PresetBase ConvertCodecPreset()
|
public override PresetBase ConvertCodecPreset()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -2240,7 +2240,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
public Proximity Proximity { get; set; }
|
public Proximity Proximity { get; set; }
|
||||||
public RoomAnalytics RoomAnalytics { get; set; }
|
public RoomAnalytics RoomAnalytics { get; set; }
|
||||||
|
|
||||||
public List<IConvertiblePreset> RoomPreset { get; set; }
|
public List<RoomPreset> RoomPreset { get; set; }
|
||||||
|
|
||||||
public SIP SIP { get; set; }
|
public SIP SIP { get; set; }
|
||||||
public Security Security { get; set; }
|
public Security Security { get; set; }
|
||||||
@@ -2257,7 +2257,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
Standby = new Standby();
|
Standby = new Standby();
|
||||||
Cameras = new Cameras();
|
Cameras = new Cameras();
|
||||||
RoomAnalytics = new RoomAnalytics();
|
RoomAnalytics = new RoomAnalytics();
|
||||||
RoomPreset = new List<IConvertiblePreset>();
|
RoomPreset = new List<RoomPreset>();
|
||||||
Conference = new Conference2();
|
Conference = new Conference2();
|
||||||
SystemUnit = new SystemUnit();
|
SystemUnit = new SystemUnit();
|
||||||
Video = new Video();
|
Video = new Video();
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||||
{
|
{
|
||||||
public interface IConvertiblePreset
|
public abstract class ConvertiblePreset
|
||||||
{
|
{
|
||||||
PresetBase ConvertCodecPreset();
|
public abstract PresetBase ConvertCodecPreset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -10,6 +10,7 @@ using PepperDash.Core;
|
|||||||
using PepperDash.Core.Intersystem;
|
using PepperDash.Core.Intersystem;
|
||||||
using PepperDash.Core.Intersystem.Tokens;
|
using PepperDash.Core.Intersystem.Tokens;
|
||||||
using PepperDash.Core.WebApi.Presets;
|
using PepperDash.Core.WebApi.Presets;
|
||||||
|
using Crestron.SimplSharp.Reflection;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
@@ -462,10 +463,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
}
|
}
|
||||||
|
|
||||||
SharingContentIsOnFeedback.FireUpdate();
|
SharingContentIsOnFeedback.FireUpdate();
|
||||||
|
|
||||||
trilist.SetBool(joinMap.HookState.JoinNumber, IsInCall);
|
|
||||||
|
|
||||||
trilist.SetString(joinMap.CurrentCallData.JoinNumber, UpdateCallStatusXSig());
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -792,7 +789,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
trilist.SetSigFalseAction(joinMap.SourceShareStart.JoinNumber, StartSharing);
|
trilist.SetSigFalseAction(joinMap.SourceShareStart.JoinNumber, StartSharing);
|
||||||
trilist.SetSigFalseAction(joinMap.SourceShareEnd.JoinNumber, StopSharing);
|
trilist.SetSigFalseAction(joinMap.SourceShareEnd.JoinNumber, StopSharing);
|
||||||
|
|
||||||
trilist.SetBoolSigAction(joinMap.SourceShareAutoStart.JoinNumber, (b) => AutoShareContentWhileInCall = b);
|
trilist.SetBoolSigAction(joinMap.SourceShareAutoStart.JoinNumber, b => AutoShareContentWhileInCall = b);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Meeting> _currentMeetings = new List<Meeting>();
|
private List<Meeting> _currentMeetings = new List<Meeting>();
|
||||||
@@ -803,7 +800,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
|
|
||||||
trilist.SetUShortSigAction(joinMap.MinutesBeforeMeetingStart.JoinNumber, (i) =>
|
trilist.SetUShortSigAction(joinMap.MinutesBeforeMeetingStart.JoinNumber, (i) =>
|
||||||
{
|
{
|
||||||
codec.CodecSchedule.MeetingWarningMinutes = i;
|
codec.CodecSchedule.MeetingWarningMinutes = i;
|
||||||
});
|
});
|
||||||
|
|
||||||
trilist.SetSigFalseAction(joinMap.DialMeeting1.JoinNumber, () =>
|
trilist.SetSigFalseAction(joinMap.DialMeeting1.JoinNumber, () =>
|
||||||
@@ -1001,6 +998,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
|
|
||||||
trilist.SetUShortSigAction(joinMap.DirectorySelectRow.JoinNumber, (i) => SelectDirectoryEntry(codec, i, trilist, joinMap));
|
trilist.SetUShortSigAction(joinMap.DirectorySelectRow.JoinNumber, (i) => SelectDirectoryEntry(codec, i, trilist, joinMap));
|
||||||
|
|
||||||
|
trilist.SetBoolSigAction(joinMap.DirectoryClearSelection.JoinNumber,
|
||||||
|
delegate { SelectDirectoryEntry(codec, 0, trilist, joinMap); });
|
||||||
|
|
||||||
// Report feedback for number of contact methods for selected contact
|
// Report feedback for number of contact methods for selected contact
|
||||||
|
|
||||||
trilist.SetSigFalseAction(joinMap.DirectoryRoot.JoinNumber, codec.SetCurrentDirectoryToRoot);
|
trilist.SetSigFalseAction(joinMap.DirectoryRoot.JoinNumber, codec.SetCurrentDirectoryToRoot);
|
||||||
@@ -1015,7 +1015,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
|
|
||||||
trilist.SetString(joinMap.DirectoryEntries.JoinNumber,
|
trilist.SetString(joinMap.DirectoryEntries.JoinNumber,
|
||||||
Encoding.GetEncoding(XSigEncoding).GetString(clearBytes, 0, clearBytes.Length));
|
Encoding.GetEncoding(XSigEncoding).GetString(clearBytes, 0, clearBytes.Length));
|
||||||
var directoryXSig = UpdateDirectoryXSig(codec.DirectoryRoot, !codec.CurrentDirectoryResultIsNotDirectoryRoot.BoolValue);
|
var directoryXSig = UpdateDirectoryXSig(codec.DirectoryRoot,
|
||||||
|
codec.CurrentDirectoryResultIsNotDirectoryRoot.BoolValue == false);
|
||||||
|
|
||||||
Debug.Console(2, this, "Directory XSig Length: {0}", directoryXSig.Length);
|
Debug.Console(2, this, "Directory XSig Length: {0}", directoryXSig.Length);
|
||||||
|
|
||||||
@@ -1030,8 +1031,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
|
|
||||||
trilist.SetString(joinMap.DirectoryEntries.JoinNumber,
|
trilist.SetString(joinMap.DirectoryEntries.JoinNumber,
|
||||||
Encoding.GetEncoding(XSigEncoding).GetString(clearBytes, 0, clearBytes.Length));
|
Encoding.GetEncoding(XSigEncoding).GetString(clearBytes, 0, clearBytes.Length));
|
||||||
var directoryXSig = UpdateDirectoryXSig(args.Directory, !codec.CurrentDirectoryResultIsNotDirectoryRoot.BoolValue);
|
var directoryXSig = UpdateDirectoryXSig(args.Directory,
|
||||||
|
codec.CurrentDirectoryResultIsNotDirectoryRoot.BoolValue == false);
|
||||||
Debug.Console(2, this, "Directory XSig Length: {0}", directoryXSig.Length);
|
Debug.Console(2, this, "Directory XSig Length: {0}", directoryXSig.Length);
|
||||||
|
|
||||||
trilist.SetString(joinMap.DirectoryEntries.JoinNumber, directoryXSig);
|
trilist.SetString(joinMap.DirectoryEntries.JoinNumber, directoryXSig);
|
||||||
@@ -1041,21 +1042,21 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
{
|
{
|
||||||
if (!args.DeviceOnLine) return;
|
if (!args.DeviceOnLine) return;
|
||||||
|
|
||||||
// TODO [ ] Issue #868
|
var clearBytes = XSigHelpers.ClearOutputs();
|
||||||
trilist.SetString(joinMap.DirectoryEntries.JoinNumber, "\xFC");
|
trilist.SetString(joinMap.DirectoryEntries.JoinNumber,
|
||||||
UpdateDirectoryXSig(codec.CurrentDirectoryResult,
|
Encoding.GetEncoding(XSigEncoding).GetString(clearBytes, 0, clearBytes.Length));
|
||||||
!codec.CurrentDirectoryResultIsNotDirectoryRoot.BoolValue);
|
var directoryXSig = UpdateDirectoryXSig(codec.DirectoryRoot, codec.CurrentDirectoryResultIsNotDirectoryRoot.BoolValue == false);
|
||||||
|
trilist.SetString(joinMap.DirectoryEntries.JoinNumber, directoryXSig);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void SelectDirectoryEntry(IHasDirectory codec, ushort i, BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
private void SelectDirectoryEntry(IHasDirectory codec, ushort i, BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
||||||
{
|
{
|
||||||
if (i < 1 || i > codec.CurrentDirectoryResult.CurrentDirectoryResults.Count) return;
|
if (i > codec.CurrentDirectoryResult.CurrentDirectoryResults.Count) return;
|
||||||
|
_selectedDirectoryItem = i == 0 ? null : codec.CurrentDirectoryResult.CurrentDirectoryResults[i - 1];
|
||||||
_selectedDirectoryItem = codec.CurrentDirectoryResult.CurrentDirectoryResults[i - 1];
|
|
||||||
|
|
||||||
|
trilist.SetUshort(joinMap.DirectorySelectRow.JoinNumber, i);
|
||||||
|
|
||||||
if (_selectedDirectoryItem is DirectoryFolder)
|
if (_selectedDirectoryItem is DirectoryFolder)
|
||||||
{
|
{
|
||||||
@@ -1073,13 +1074,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
trilist.SetString(joinMap.DirectorySelectedFolderName.JoinNumber, string.Empty);
|
trilist.SetString(joinMap.DirectorySelectedFolderName.JoinNumber, string.Empty);
|
||||||
|
|
||||||
var selectedContact = _selectedDirectoryItem as DirectoryContact;
|
var selectedContact = _selectedDirectoryItem as DirectoryContact;
|
||||||
if (selectedContact != null)
|
|
||||||
{
|
|
||||||
trilist.SetString(joinMap.DirectoryEntrySelectedName.JoinNumber, selectedContact.Name);
|
|
||||||
|
|
||||||
}
|
trilist.SetString(joinMap.DirectoryEntrySelectedName.JoinNumber,
|
||||||
|
selectedContact != null ? selectedContact.Name : string.Empty);
|
||||||
|
|
||||||
// Allow auto dial of selected line. Always dials first contact method
|
// Allow auto dial of selected line. Always dials first contact method
|
||||||
if (!trilist.GetBool(joinMap.DirectoryDisableAutoDialSelectedLine.JoinNumber))
|
if (!trilist.GetBool(joinMap.DirectoryDisableAutoDialSelectedLine.JoinNumber))
|
||||||
{
|
{
|
||||||
var invitableEntry = _selectedDirectoryItem as IInvitableContact;
|
var invitableEntry = _selectedDirectoryItem as IInvitableContact;
|
||||||
@@ -1092,12 +1091,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
|
|
||||||
var entryToDial = _selectedDirectoryItem as DirectoryContact;
|
var entryToDial = _selectedDirectoryItem as DirectoryContact;
|
||||||
|
|
||||||
trilist.SetString(joinMap.DirectoryEntrySelectedNumber.JoinNumber, selectedContact.ContactMethods[0].Number);
|
trilist.SetString(joinMap.DirectoryEntrySelectedNumber.JoinNumber,
|
||||||
|
selectedContact != null ? selectedContact.ContactMethods[0].Number : string.Empty);
|
||||||
|
|
||||||
if (entryToDial == null) return;
|
if (entryToDial == null) return;
|
||||||
|
|
||||||
Dial(entryToDial.ContactMethods[0].Number);
|
Dial(entryToDial.ContactMethods[0].Number);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1185,32 +1184,45 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
|
|
||||||
private string UpdateDirectoryXSig(CodecDirectory directory, bool isRoot)
|
private string UpdateDirectoryXSig(CodecDirectory directory, bool isRoot)
|
||||||
{
|
{
|
||||||
var contactIndex = 1;
|
const int xSigMaxIndex = 1023;
|
||||||
var tokenArray = new XSigToken[directory.CurrentDirectoryResults.Count];
|
var tokenArray = new XSigToken[directory.CurrentDirectoryResults.Count > xSigMaxIndex
|
||||||
|
? xSigMaxIndex
|
||||||
|
: directory.CurrentDirectoryResults.Count];
|
||||||
|
|
||||||
Debug.Console(2, this, "Is root {0} Directory Count: {1}", isRoot, directory.CurrentDirectoryResults.Count);
|
Debug.Console(2, this, "IsRoot: {0}, Directory Count: {1}, TokenArray.Length: {2}", isRoot, directory.CurrentDirectoryResults.Count, tokenArray.Length);
|
||||||
|
|
||||||
foreach (var entry in directory.CurrentDirectoryResults)
|
var contacts = directory.CurrentDirectoryResults.Count > xSigMaxIndex
|
||||||
{
|
? directory.CurrentDirectoryResults.Take(xSigMaxIndex)
|
||||||
var arrayIndex = contactIndex - 1;
|
: directory.CurrentDirectoryResults;
|
||||||
|
|
||||||
Debug.Console(2, this, "Entry Name: {0}, Folder ID: {1}", entry.Name, entry.FolderId);
|
var contactsToDisplay = isRoot
|
||||||
|
? contacts.Where(c => c.ParentFolderId == "root")
|
||||||
|
: contacts.Where(c => c.ParentFolderId != "root");
|
||||||
|
|
||||||
if (entry is DirectoryFolder && entry.ParentFolderId == "root")
|
var counterIndex = 1;
|
||||||
{
|
foreach (var entry in contactsToDisplay)
|
||||||
tokenArray[arrayIndex] = new XSigSerialToken(contactIndex, String.Format("[+] {0}", entry.Name));
|
{
|
||||||
|
var arrayIndex = counterIndex - 1;
|
||||||
|
var entryIndex = counterIndex;
|
||||||
|
|
||||||
contactIndex++;
|
Debug.Console(2, this, "Entry{2:0000} Name: {0}, Folder ID: {1}, Type: {3}, ParentFolderId: {4}",
|
||||||
|
entry.Name, entry.FolderId, entryIndex, entry.GetType().GetCType().FullName, entry.ParentFolderId);
|
||||||
|
|
||||||
continue;
|
if (entry is DirectoryFolder)
|
||||||
}
|
{
|
||||||
|
tokenArray[arrayIndex] = new XSigSerialToken(entryIndex, String.Format("[+] {0}", entry.Name));
|
||||||
|
|
||||||
tokenArray[arrayIndex] = new XSigSerialToken(contactIndex, entry.Name);
|
counterIndex++;
|
||||||
|
|
||||||
contactIndex++;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
return GetXSigString(tokenArray);
|
tokenArray[arrayIndex] = new XSigSerialToken(entryIndex, entry.Name);
|
||||||
|
|
||||||
|
counterIndex++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return GetXSigString(tokenArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LinkVideoCodecCallControlsToApi(BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
private void LinkVideoCodecCallControlsToApi(BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
||||||
|
|||||||
Reference in New Issue
Block a user