mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 04:34:56 +00:00
Added missing join constants in Ddvc01RoomBridge
This commit is contained in:
@@ -17,7 +17,6 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
BasicTriList EISC;
|
BasicTriList EISC;
|
||||||
|
|
||||||
/********* Bools *********/
|
/********* Bools *********/
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 724
|
/// 724
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -55,13 +54,21 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
const uint BDirectorySearchBusy = 800;
|
const uint BDirectorySearchBusy = 800;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 801
|
||||||
|
/// </summary>
|
||||||
|
const uint BDirectoryLineSelected = 801;
|
||||||
|
/// <summary>
|
||||||
/// 801 when selected entry is a contact
|
/// 801 when selected entry is a contact
|
||||||
/// </summary>
|
/// </summary>
|
||||||
const uint BDirectoryEntryIsContact = 801;
|
const uint BDirectoryEntryIsContact = 801;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 802 To show/hide back button
|
/// 802 To show/hide back button
|
||||||
/// </summary>
|
/// </summary>
|
||||||
const uint BDirectoryIsAtTop = 802;
|
const uint BDirectoryIsRoot = 802;
|
||||||
|
/// <summary>
|
||||||
|
/// 803 Pulse from system to inform us when directory is ready
|
||||||
|
/// </summary>
|
||||||
|
const uint DDirectoryHasChanged = 803;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 811
|
/// 811
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -107,13 +114,13 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
const uint SCurrentDialString = 701;
|
const uint SCurrentDialString = 701;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 711
|
/// 702
|
||||||
/// </summary>
|
/// </summary>
|
||||||
const uint SCurrentCallNumber = 711;
|
const uint SCurrentCallNumber = 702;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 712
|
/// 703
|
||||||
/// </summary>
|
/// </summary>
|
||||||
const uint SCurrentCallName = 712;
|
const uint SCurrentCallName = 703;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 731
|
/// 731
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -170,7 +177,6 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
CodecActiveCallItem CurrentCallItem;
|
CodecActiveCallItem CurrentCallItem;
|
||||||
CodecActiveCallItem IncomingCallItem;
|
CodecActiveCallItem IncomingCallItem;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -253,6 +259,42 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
SendCallsList();
|
SendCallsList();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Directory insanity
|
||||||
|
EISC.SetUShortSigAction(UDirectoryRowCount, u =>
|
||||||
|
{
|
||||||
|
var items = new List<object>();
|
||||||
|
for (uint i = 0; i < u; i++)
|
||||||
|
{
|
||||||
|
var newItem = new
|
||||||
|
{
|
||||||
|
name = EISC.GetString(SDirectoryEntriesStart + i),
|
||||||
|
};
|
||||||
|
items.Add(newItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
var directoryMessage = new {
|
||||||
|
content = new {
|
||||||
|
currentDirectory = new {
|
||||||
|
isRootDirectory = EISC.GetBool(BDirectoryIsRoot),
|
||||||
|
directoryResults = items
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
PostStatusMessage(directoryMessage);
|
||||||
|
});
|
||||||
|
|
||||||
|
EISC.SetStringSigAction(SDirectoryEntrySelectedName, s =>
|
||||||
|
{
|
||||||
|
PostStatusMessage(new { content = new { directorySelectedEntryName = EISC.GetString(SDirectoryEntrySelectedName) } });
|
||||||
|
});
|
||||||
|
|
||||||
|
EISC.SetStringSigAction(SDirectoryEntrySelectedNumber, s =>
|
||||||
|
{
|
||||||
|
PostStatusMessage(new { content = new { directorySelectedEntryNumber = EISC.GetString(SDirectoryEntrySelectedNumber) } });
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Add press and holds using helper action
|
// Add press and holds using helper action
|
||||||
Action<string, uint> addPHAction = (s, u) =>
|
Action<string, uint> addPHAction = (s, u) =>
|
||||||
AppServerController.AddAction(MessagePath + s, new PressAndHoldAction(b => EISC.SetBool(u, b)));
|
AppServerController.AddAction(MessagePath + s, new PressAndHoldAction(b => EISC.SetBool(u, b)));
|
||||||
@@ -290,6 +332,14 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
EISC.PulseBool(DTMFMap[s], 100);
|
EISC.PulseBool(DTMFMap[s], 100);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
// Directory madness
|
||||||
|
AppServerController.AddAction(MessagePath + "/directorySelectLine", new Action<ushort>(u =>
|
||||||
|
{
|
||||||
|
EISC.SetUshort(UDirectorySelectRow, u);
|
||||||
|
EISC.PulseBool(BDirectoryLineSelected);
|
||||||
|
}));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendCallsList()
|
void SendCallsList()
|
||||||
|
|||||||
@@ -56,7 +56,10 @@ namespace PepperDash.Essentials.Room.Cotija
|
|||||||
/// 1
|
/// 1
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const uint MasterVolumeMuteToggle = 1;
|
public const uint MasterVolumeMuteToggle = 1;
|
||||||
|
/// <summary>
|
||||||
|
/// 1
|
||||||
|
/// </summary>
|
||||||
|
public const uint VolumeMutesJoinStart = 1;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 61
|
/// 61
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -85,6 +88,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
|||||||
/// 601
|
/// 601
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const uint SourceShareDisableStartJoin = 601;
|
public const uint SourceShareDisableStartJoin = 601;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class UshortJoin
|
public class UshortJoin
|
||||||
@@ -93,15 +97,26 @@ namespace PepperDash.Essentials.Room.Cotija
|
|||||||
/// 1
|
/// 1
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const uint MasterVolumeLevel = 1;
|
public const uint MasterVolumeLevel = 1;
|
||||||
|
/// <summary>
|
||||||
|
/// 1
|
||||||
|
/// </summary>
|
||||||
|
public const uint VolumeSlidersJoinStart = 1;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 61
|
/// 61
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const uint ShutdownPromptDuration = 61;
|
public const uint ShutdownPromptDuration = 61;
|
||||||
|
/// <summary>
|
||||||
|
/// 101
|
||||||
|
/// </summary>
|
||||||
|
public const uint VolumeSliderCount = 101;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class StringJoin
|
public class StringJoin
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 1
|
||||||
|
/// </summary>
|
||||||
|
public const uint VolumeSliderNamesJoinStart = 1;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 71
|
/// 71
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -145,6 +160,23 @@ namespace PepperDash.Essentials.Room.Cotija
|
|||||||
/// 402
|
/// 402
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const uint ServerUrl = 402;
|
public const uint ServerUrl = 402;
|
||||||
|
/// <summary>
|
||||||
|
/// 512
|
||||||
|
/// </summary>
|
||||||
|
public const uint RoomSpeedDialNamesJoinStart = 512;
|
||||||
|
/// <summary>
|
||||||
|
/// 516
|
||||||
|
/// </summary>
|
||||||
|
public const uint RoomSpeedDialNumberssJoinStart = 516;
|
||||||
|
/// <summary>
|
||||||
|
/// 601
|
||||||
|
/// </summary>
|
||||||
|
public const uint SourceNameJoinStart = 601;
|
||||||
|
/// <summary>
|
||||||
|
/// 621
|
||||||
|
/// </summary>
|
||||||
|
public const uint SourceIconJoinStart = 621;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -405,7 +437,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
|||||||
Debug.Console(0, this, "Replacing Room[0] in config");
|
Debug.Console(0, this, "Replacing Room[0] in config");
|
||||||
co.Rooms[0] = rm;
|
co.Rooms[0] = rm;
|
||||||
}
|
}
|
||||||
rm.Name = EISC.StringOutput[501].StringValue;
|
rm.Name = EISC.StringOutput[StringJoin.ConfigRoomName].StringValue;
|
||||||
rm.Key = "room1";
|
rm.Key = "room1";
|
||||||
rm.Type = "ddvc01";
|
rm.Type = "ddvc01";
|
||||||
|
|
||||||
@@ -416,15 +448,17 @@ namespace PepperDash.Essentials.Room.Cotija
|
|||||||
rmProps = JsonConvert.DeserializeObject<DDVC01RoomPropertiesConfig>(rm.Properties.ToString());
|
rmProps = JsonConvert.DeserializeObject<DDVC01RoomPropertiesConfig>(rm.Properties.ToString());
|
||||||
|
|
||||||
rmProps.Help = new EssentialsHelpPropertiesConfig();
|
rmProps.Help = new EssentialsHelpPropertiesConfig();
|
||||||
rmProps.Help.CallButtonText = EISC.StringOutput[503].StringValue;
|
rmProps.Help.CallButtonText = EISC.StringOutput[StringJoin.ConfigHelpNumber].StringValue;
|
||||||
rmProps.Help.Message = EISC.StringOutput[502].StringValue;
|
rmProps.Help.Message = EISC.StringOutput[StringJoin.ConfigHelpMessage].StringValue;
|
||||||
|
|
||||||
rmProps.Environment = new EssentialsEnvironmentPropertiesConfig(); // enabled defaults to false
|
rmProps.Environment = new EssentialsEnvironmentPropertiesConfig(); // enabled defaults to false
|
||||||
|
|
||||||
rmProps.RoomPhoneNumber = EISC.StringOutput[504].StringValue;
|
rmProps.RoomPhoneNumber = EISC.StringOutput[StringJoin.ConfigRoomPhoneNumber].StringValue;
|
||||||
rmProps.RoomURI = EISC.StringOutput[505].StringValue;
|
rmProps.RoomURI = EISC.StringOutput[StringJoin.ConfigRoomURI].StringValue;
|
||||||
rmProps.SpeedDials = new List<DDVC01SpeedDial>();
|
rmProps.SpeedDials = new List<DDVC01SpeedDial>();
|
||||||
// add speed dials as long as there are more - up to 4
|
// add speed dials as long as there are more - up to 4
|
||||||
|
|
||||||
|
#warning fix speed dials - 512-515 names, 516-519 numbers
|
||||||
for (uint i = 512; i <= 519; i = i + 2)
|
for (uint i = 512; i <= 519; i = i + 2)
|
||||||
{
|
{
|
||||||
var num = EISC.StringOutput[i].StringValue;
|
var num = EISC.StringOutput[i].StringValue;
|
||||||
@@ -436,10 +470,10 @@ namespace PepperDash.Essentials.Room.Cotija
|
|||||||
|
|
||||||
// This MAY need a check
|
// This MAY need a check
|
||||||
rmProps.AudioCodecKey = "audioCodec";
|
rmProps.AudioCodecKey = "audioCodec";
|
||||||
rmProps.VideoCodecKey = null; // "videoCodec";
|
rmProps.VideoCodecKey = "videoCodec";
|
||||||
|
|
||||||
// volume control names
|
// volume control names
|
||||||
var volCount = EISC.UShortOutput[701].UShortValue;
|
var volCount = EISC.UShortOutput[UshortJoin.VolumeSliderCount].UShortValue;
|
||||||
|
|
||||||
//// use Volumes object or?
|
//// use Volumes object or?
|
||||||
//rmProps.VolumeSliderNames = new List<string>();
|
//rmProps.VolumeSliderNames = new List<string>();
|
||||||
@@ -470,7 +504,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
|||||||
// add sources...
|
// add sources...
|
||||||
for (uint i = 0; i<= 19; i++)
|
for (uint i = 0; i<= 19; i++)
|
||||||
{
|
{
|
||||||
var name = EISC.StringOutput[601 + i].StringValue;
|
var name = EISC.StringOutput[StringJoin.SourceNameJoinStart + i].StringValue;
|
||||||
if(string.IsNullOrEmpty(name))
|
if(string.IsNullOrEmpty(name))
|
||||||
break;
|
break;
|
||||||
var icon = EISC.StringOutput[651 + i].StringValue;
|
var icon = EISC.StringOutput[651 + i].StringValue;
|
||||||
@@ -545,7 +579,41 @@ namespace PepperDash.Essentials.Room.Cotija
|
|||||||
Properties = JToken.FromObject(acProps)
|
Properties = JToken.FromObject(acProps)
|
||||||
};
|
};
|
||||||
co.Devices.Add(acConf);
|
co.Devices.Add(acConf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(rmProps.VideoCodecKey))
|
||||||
|
{
|
||||||
|
#warning Break out these video codec favs
|
||||||
|
var favs = new List<PepperDash.Essentials.Devices.Common.Codec.CodecActiveCallItem>();
|
||||||
|
for (uint i = 0; i < 4; i++)
|
||||||
|
{
|
||||||
|
if (!EISC.GetBool(BoolJoin.SpeedDialVisibleStartJoin + i))
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
favs.Add(new PepperDash.Essentials.Devices.Common.Codec.CodecActiveCallItem()
|
||||||
|
{
|
||||||
|
Name = EISC.GetString(StringJoin.SpeedDialNameStartJoin + i),
|
||||||
|
Number = EISC.GetString(StringJoin.SpeedDialNumberStartJoin + i),
|
||||||
|
Type = PepperDash.Essentials.Devices.Common.Codec.eCodecCallType.Audio
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
var props = new
|
||||||
|
{
|
||||||
|
favorites = favs
|
||||||
|
};
|
||||||
|
var str = "videoCodec";
|
||||||
|
var conf = new DeviceConfig()
|
||||||
|
{
|
||||||
|
Group = str,
|
||||||
|
Key = str,
|
||||||
|
Name = str,
|
||||||
|
Type = str,
|
||||||
|
Properties = JToken.FromObject(props)
|
||||||
|
};
|
||||||
|
co.Devices.Add(conf);
|
||||||
|
}
|
||||||
|
|
||||||
Debug.Console(0, this, "******* CONFIG FROM DDVC: \r{0}", JsonConvert.SerializeObject(ConfigReader.ConfigObject, Formatting.Indented));
|
Debug.Console(0, this, "******* CONFIG FROM DDVC: \r{0}", JsonConvert.SerializeObject(ConfigReader.ConfigObject, Formatting.Indented));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user