mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 13:15:03 +00:00
Directory browsing largely alive for Weil
This commit is contained in:
@@ -78,6 +78,10 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
const uint BDirectoryFolderBack = 805;
|
const uint BDirectoryFolderBack = 805;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 806
|
||||||
|
/// </summary>
|
||||||
|
const uint BDirectoryDialSelectedLine = 806;
|
||||||
|
/// <summary>
|
||||||
/// 811
|
/// 811
|
||||||
/// </summary>
|
/// </summary>
|
||||||
const uint BCameraControlUp = 811;
|
const uint BCameraControlUp = 811;
|
||||||
@@ -184,8 +188,19 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
|
|
||||||
CodecActiveCallItem CurrentCallItem;
|
CodecActiveCallItem CurrentCallItem;
|
||||||
CodecActiveCallItem IncomingCallItem;
|
CodecActiveCallItem IncomingCallItem;
|
||||||
|
|
||||||
ushort PreviousDirectoryLength = 0;
|
ushort PreviousDirectoryLength = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// For tracking the directory-selected name while waiting for number
|
||||||
|
/// </summary>
|
||||||
|
string QueuedDirectorySelectedName;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// For tracking the directory-selected number while waiting for the name
|
||||||
|
/// </summary>
|
||||||
|
string QueuedDirectorySelectedNumber;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -201,61 +216,6 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
CurrentCallItem.Id = "-video-";
|
CurrentCallItem.Id = "-video-";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
void SendFullStatus()
|
|
||||||
{
|
|
||||||
this.PostStatusMessage(new
|
|
||||||
{
|
|
||||||
calls = GetCurrentCallList(),
|
|
||||||
currentCallString = EISC.GetString(SCurrentCallNumber),
|
|
||||||
currentDialString = EISC.GetString(SCurrentDialString),
|
|
||||||
isInCall = EISC.GetString(SHookState) == "Connected",
|
|
||||||
hasDirectory = true,
|
|
||||||
hasRecents = true,
|
|
||||||
hasCameras = true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
void PostDirectory()
|
|
||||||
{
|
|
||||||
var u = EISC.GetUshort(UDirectoryRowCount);
|
|
||||||
var items = new List<object>();
|
|
||||||
for (uint i = 0; i < u; i++)
|
|
||||||
{
|
|
||||||
var name = EISC.GetString(SDirectoryEntriesStart + i);
|
|
||||||
var id = (i + 1).ToString();
|
|
||||||
// is folder or contact?
|
|
||||||
if(name.StartsWith("[+]"))
|
|
||||||
{
|
|
||||||
items.Add(new
|
|
||||||
{
|
|
||||||
folderId = id,
|
|
||||||
name = name
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
items.Add(new
|
|
||||||
{
|
|
||||||
contactId = id,
|
|
||||||
name = name
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var directoryMessage = new
|
|
||||||
{
|
|
||||||
currentDirectory = new
|
|
||||||
{
|
|
||||||
isRootDirectory = EISC.GetBool(BDirectoryIsRoot),
|
|
||||||
directoryResults = items
|
|
||||||
}
|
|
||||||
};
|
|
||||||
PostStatusMessage(directoryMessage);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -321,19 +281,28 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
}
|
}
|
||||||
EISC.SetStringSigAction(SDirectoryEntriesStart + u - 1, s => PostDirectory());
|
EISC.SetStringSigAction(SDirectoryEntriesStart + u - 1, s => PostDirectory());
|
||||||
PreviousDirectoryLength = u;
|
PreviousDirectoryLength = u;
|
||||||
//PostDirectory();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
EISC.SetStringSigAction(SDirectoryEntrySelectedName, s =>
|
EISC.SetStringSigAction(SDirectoryEntrySelectedName, s =>
|
||||||
{
|
{
|
||||||
PostStatusMessage(new { content = new {
|
PostStatusMessage(new
|
||||||
directorySelectedEntryName = EISC.GetString(SDirectoryEntrySelectedName) } });
|
{
|
||||||
|
directoryContactSelected = new
|
||||||
|
{
|
||||||
|
name = EISC.GetString(SDirectoryEntrySelectedName),
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
EISC.SetStringSigAction(SDirectoryEntrySelectedNumber, s =>
|
EISC.SetStringSigAction(SDirectoryEntrySelectedNumber, s =>
|
||||||
{
|
{
|
||||||
PostStatusMessage(new { content = new {
|
PostStatusMessage(new
|
||||||
directorySelectedEntryNumber = EISC.GetString(SDirectoryEntrySelectedNumber) } });
|
{
|
||||||
|
directoryContactSelected = new
|
||||||
|
{
|
||||||
|
number = EISC.GetString(SDirectoryEntrySelectedNumber),
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add press and holds using helper action
|
// Add press and holds using helper action
|
||||||
@@ -407,6 +376,9 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
|
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
asc.AddAction(MessagePath + "/directoryDialContact", new Action(() => {
|
||||||
|
EISC.PulseBool(BDirectoryDialSelectedLine);
|
||||||
|
}));
|
||||||
asc.AddAction(MessagePath + "/getDirectory", new Action(() =>
|
asc.AddAction(MessagePath + "/getDirectory", new Action(() =>
|
||||||
{
|
{
|
||||||
if (EISC.GetUshort(UDirectoryRowCount) > 0)
|
if (EISC.GetUshort(UDirectoryRowCount) > 0)
|
||||||
@@ -425,6 +397,94 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
//}));
|
//}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
void SendFullStatus()
|
||||||
|
{
|
||||||
|
this.PostStatusMessage(new
|
||||||
|
{
|
||||||
|
calls = GetCurrentCallList(),
|
||||||
|
currentCallString = EISC.GetString(SCurrentCallNumber),
|
||||||
|
currentDialString = EISC.GetString(SCurrentDialString),
|
||||||
|
directoryContactSelected = new
|
||||||
|
{
|
||||||
|
name = EISC.GetString(SDirectoryEntrySelectedName),
|
||||||
|
number = EISC.GetString(SDirectoryEntrySelectedNumber)
|
||||||
|
},
|
||||||
|
isInCall = EISC.GetString(SHookState) == "Connected",
|
||||||
|
hasDirectory = true,
|
||||||
|
hasRecents = true,
|
||||||
|
hasCameras = true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
void PostDirectory()
|
||||||
|
{
|
||||||
|
var u = EISC.GetUshort(UDirectoryRowCount);
|
||||||
|
var items = new List<object>();
|
||||||
|
for (uint i = 0; i < u; i++)
|
||||||
|
{
|
||||||
|
var name = EISC.GetString(SDirectoryEntriesStart + i);
|
||||||
|
var id = (i + 1).ToString();
|
||||||
|
// is folder or contact?
|
||||||
|
if (name.StartsWith("[+]"))
|
||||||
|
{
|
||||||
|
items.Add(new
|
||||||
|
{
|
||||||
|
folderId = id,
|
||||||
|
name = name
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
items.Add(new
|
||||||
|
{
|
||||||
|
contactId = id,
|
||||||
|
name = name
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var directoryMessage = new
|
||||||
|
{
|
||||||
|
currentDirectory = new
|
||||||
|
{
|
||||||
|
isRootDirectory = EISC.GetBool(BDirectoryIsRoot),
|
||||||
|
directoryResults = items
|
||||||
|
}
|
||||||
|
};
|
||||||
|
PostStatusMessage(directoryMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
//void SendDirectorySelectedNameNumberWhenReady()
|
||||||
|
//{
|
||||||
|
// if (!string.IsNullOrEmpty(QueuedDirectorySelectedName) &&
|
||||||
|
// !string.IsNullOrEmpty(QueuedDirectorySelectedNumber))
|
||||||
|
// {
|
||||||
|
// var qName = QueuedDirectorySelectedName;
|
||||||
|
// var qNum = QueuedDirectorySelectedNumber;
|
||||||
|
// QueuedDirectorySelectedName = null;
|
||||||
|
// QueuedDirectorySelectedNumber = null;
|
||||||
|
// PostStatusMessage(new
|
||||||
|
// {
|
||||||
|
// directoryContactSelected = new
|
||||||
|
// {
|
||||||
|
// name = qName,
|
||||||
|
// number = qNum
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user