diff --git a/PepperDashEssentials/AppServer/Messengers/Ddvc01VtcMessenger.cs b/PepperDashEssentials/AppServer/Messengers/Ddvc01VtcMessenger.cs index f79efab5..56706b96 100644 --- a/PepperDashEssentials/AppServer/Messengers/Ddvc01VtcMessenger.cs +++ b/PepperDashEssentials/AppServer/Messengers/Ddvc01VtcMessenger.cs @@ -17,7 +17,6 @@ namespace PepperDash.Essentials.AppServer.Messengers BasicTriList EISC; /********* Bools *********/ - /// /// 724 /// @@ -55,13 +54,21 @@ namespace PepperDash.Essentials.AppServer.Messengers /// const uint BDirectorySearchBusy = 800; /// + /// 801 + /// + const uint BDirectoryLineSelected = 801; + /// /// 801 when selected entry is a contact /// const uint BDirectoryEntryIsContact = 801; /// /// 802 To show/hide back button /// - const uint BDirectoryIsAtTop = 802; + const uint BDirectoryIsRoot = 802; + /// + /// 803 Pulse from system to inform us when directory is ready + /// + const uint DDirectoryHasChanged = 803; /// /// 811 /// @@ -107,13 +114,13 @@ namespace PepperDash.Essentials.AppServer.Messengers /// const uint SCurrentDialString = 701; /// - /// 711 + /// 702 /// - const uint SCurrentCallNumber = 711; + const uint SCurrentCallNumber = 702; /// - /// 712 + /// 703 /// - const uint SCurrentCallName = 712; + const uint SCurrentCallName = 703; /// /// 731 /// @@ -170,7 +177,6 @@ namespace PepperDash.Essentials.AppServer.Messengers CodecActiveCallItem CurrentCallItem; CodecActiveCallItem IncomingCallItem; - /// /// /// @@ -253,6 +259,42 @@ namespace PepperDash.Essentials.AppServer.Messengers SendCallsList(); }); + // Directory insanity + EISC.SetUShortSigAction(UDirectoryRowCount, u => + { + var items = new List(); + 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 Action addPHAction = (s, u) => 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); } })); + + // Directory madness + AppServerController.AddAction(MessagePath + "/directorySelectLine", new Action(u => + { + EISC.SetUshort(UDirectorySelectRow, u); + EISC.PulseBool(BDirectoryLineSelected); + })); + } void SendCallsList() diff --git a/PepperDashEssentials/AppServer/RoomBridges/CotijaDdvc01RoomBridge.cs b/PepperDashEssentials/AppServer/RoomBridges/CotijaDdvc01RoomBridge.cs index 0c1262ad..d1269f2a 100644 --- a/PepperDashEssentials/AppServer/RoomBridges/CotijaDdvc01RoomBridge.cs +++ b/PepperDashEssentials/AppServer/RoomBridges/CotijaDdvc01RoomBridge.cs @@ -56,7 +56,10 @@ namespace PepperDash.Essentials.Room.Cotija /// 1 /// public const uint MasterVolumeMuteToggle = 1; - + /// + /// 1 + /// + public const uint VolumeMutesJoinStart = 1; /// /// 61 /// @@ -85,6 +88,7 @@ namespace PepperDash.Essentials.Room.Cotija /// 601 /// public const uint SourceShareDisableStartJoin = 601; + } public class UshortJoin @@ -93,15 +97,26 @@ namespace PepperDash.Essentials.Room.Cotija /// 1 /// public const uint MasterVolumeLevel = 1; - + /// + /// 1 + /// + public const uint VolumeSlidersJoinStart = 1; /// /// 61 /// public const uint ShutdownPromptDuration = 61; + /// + /// 101 + /// + public const uint VolumeSliderCount = 101; } public class StringJoin { + /// + /// 1 + /// + public const uint VolumeSliderNamesJoinStart = 1; /// /// 71 /// @@ -145,6 +160,23 @@ namespace PepperDash.Essentials.Room.Cotija /// 402 /// public const uint ServerUrl = 402; + /// + /// 512 + /// + public const uint RoomSpeedDialNamesJoinStart = 512; + /// + /// 516 + /// + public const uint RoomSpeedDialNumberssJoinStart = 516; + /// + /// 601 + /// + public const uint SourceNameJoinStart = 601; + /// + /// 621 + /// + public const uint SourceIconJoinStart = 621; + } /// @@ -405,7 +437,7 @@ namespace PepperDash.Essentials.Room.Cotija Debug.Console(0, this, "Replacing Room[0] in config"); co.Rooms[0] = rm; } - rm.Name = EISC.StringOutput[501].StringValue; + rm.Name = EISC.StringOutput[StringJoin.ConfigRoomName].StringValue; rm.Key = "room1"; rm.Type = "ddvc01"; @@ -416,15 +448,17 @@ namespace PepperDash.Essentials.Room.Cotija rmProps = JsonConvert.DeserializeObject(rm.Properties.ToString()); rmProps.Help = new EssentialsHelpPropertiesConfig(); - rmProps.Help.CallButtonText = EISC.StringOutput[503].StringValue; - rmProps.Help.Message = EISC.StringOutput[502].StringValue; + rmProps.Help.CallButtonText = EISC.StringOutput[StringJoin.ConfigHelpNumber].StringValue; + rmProps.Help.Message = EISC.StringOutput[StringJoin.ConfigHelpMessage].StringValue; rmProps.Environment = new EssentialsEnvironmentPropertiesConfig(); // enabled defaults to false - rmProps.RoomPhoneNumber = EISC.StringOutput[504].StringValue; - rmProps.RoomURI = EISC.StringOutput[505].StringValue; + rmProps.RoomPhoneNumber = EISC.StringOutput[StringJoin.ConfigRoomPhoneNumber].StringValue; + rmProps.RoomURI = EISC.StringOutput[StringJoin.ConfigRoomURI].StringValue; rmProps.SpeedDials = new List(); // 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) { var num = EISC.StringOutput[i].StringValue; @@ -436,10 +470,10 @@ namespace PepperDash.Essentials.Room.Cotija // This MAY need a check rmProps.AudioCodecKey = "audioCodec"; - rmProps.VideoCodecKey = null; // "videoCodec"; + rmProps.VideoCodecKey = "videoCodec"; // volume control names - var volCount = EISC.UShortOutput[701].UShortValue; + var volCount = EISC.UShortOutput[UshortJoin.VolumeSliderCount].UShortValue; //// use Volumes object or? //rmProps.VolumeSliderNames = new List(); @@ -470,7 +504,7 @@ namespace PepperDash.Essentials.Room.Cotija // add sources... 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)) break; var icon = EISC.StringOutput[651 + i].StringValue; @@ -545,7 +579,41 @@ namespace PepperDash.Essentials.Room.Cotija Properties = JToken.FromObject(acProps) }; co.Devices.Add(acConf); - } + } + + if (!string.IsNullOrEmpty(rmProps.VideoCodecKey)) + { +#warning Break out these video codec favs + var favs = new List(); + 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));