mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-02 22:34:57 +00:00
Adds SIMPLAtcJoinMap and SIMPLVtcJoinMap and implements them on respective messengers
This commit is contained in:
@@ -16,75 +16,77 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
BasicTriList EISC;
|
||||
|
||||
/// <summary>
|
||||
/// 221
|
||||
/// </summary>
|
||||
const uint BDialHangupOnHook = 221;
|
||||
public SIMPLAtcJoinMap JoinMap {get; private set;}
|
||||
|
||||
/// <summary>
|
||||
/// 251
|
||||
/// </summary>
|
||||
const uint BIncomingAnswer = 251;
|
||||
/// <summary>
|
||||
/// 252
|
||||
/// </summary>
|
||||
const uint BIncomingReject = 252;
|
||||
/// <summary>
|
||||
/// 241
|
||||
/// </summary>
|
||||
const uint BSpeedDial1 = 241;
|
||||
/// <summary>
|
||||
/// 242
|
||||
/// </summary>
|
||||
const uint BSpeedDial2 = 242;
|
||||
/// <summary>
|
||||
/// 243
|
||||
/// </summary>
|
||||
const uint BSpeedDial3 = 243;
|
||||
/// <summary>
|
||||
/// 244
|
||||
/// </summary>
|
||||
const uint BSpeedDial4 = 244;
|
||||
///// <summary>
|
||||
///// 221
|
||||
///// </summary>
|
||||
//const uint BDialHangupOnHook = 221;
|
||||
|
||||
/// <summary>
|
||||
/// 201
|
||||
/// </summary>
|
||||
const uint SCurrentDialString = 201;
|
||||
/// <summary>
|
||||
/// 211
|
||||
/// </summary>
|
||||
const uint SCurrentCallNumber = 211;
|
||||
/// <summary>
|
||||
/// 212
|
||||
/// </summary>
|
||||
const uint SCurrentCallName = 212;
|
||||
/// <summary>
|
||||
/// 221
|
||||
/// </summary>
|
||||
const uint SHookState = 221;
|
||||
/// <summary>
|
||||
/// 222
|
||||
/// </summary>
|
||||
const uint SCallDirection = 222;
|
||||
///// <summary>
|
||||
///// 251
|
||||
///// </summary>
|
||||
//const uint BIncomingAnswer = 251;
|
||||
///// <summary>
|
||||
///// 252
|
||||
///// </summary>
|
||||
//const uint BIncomingReject = 252;
|
||||
///// <summary>
|
||||
///// 241
|
||||
///// </summary>
|
||||
//const uint BSpeedDial1 = 241;
|
||||
///// <summary>
|
||||
///// 242
|
||||
///// </summary>
|
||||
//const uint BSpeedDial2 = 242;
|
||||
///// <summary>
|
||||
///// 243
|
||||
///// </summary>
|
||||
//const uint BSpeedDial3 = 243;
|
||||
///// <summary>
|
||||
///// 244
|
||||
///// </summary>
|
||||
//const uint BSpeedDial4 = 244;
|
||||
|
||||
/// <summary>
|
||||
/// 201-212 0-9*#
|
||||
/// </summary>
|
||||
Dictionary<string, uint> DTMFMap = new Dictionary<string, uint>
|
||||
{
|
||||
{ "1", 201 },
|
||||
{ "2", 202 },
|
||||
{ "3", 203 },
|
||||
{ "4", 204 },
|
||||
{ "5", 205 },
|
||||
{ "6", 206 },
|
||||
{ "7", 207 },
|
||||
{ "8", 208 },
|
||||
{ "9", 209 },
|
||||
{ "0", 210 },
|
||||
{ "*", 211 },
|
||||
{ "#", 212 },
|
||||
};
|
||||
///// <summary>
|
||||
///// 201
|
||||
///// </summary>
|
||||
//const uint SCurrentDialString = 201;
|
||||
///// <summary>
|
||||
///// 211
|
||||
///// </summary>
|
||||
//const uint SCurrentCallNumber = 211;
|
||||
///// <summary>
|
||||
///// 212
|
||||
///// </summary>
|
||||
//const uint SCurrentCallName = 212;
|
||||
///// <summary>
|
||||
///// 221
|
||||
///// </summary>
|
||||
//const uint SHookState = 221;
|
||||
///// <summary>
|
||||
///// 222
|
||||
///// </summary>
|
||||
//const uint SCallDirection = 222;
|
||||
|
||||
///// <summary>
|
||||
///// 201-212 0-9*#
|
||||
///// </summary>
|
||||
//Dictionary<string, uint> DTMFMap = new Dictionary<string, uint>
|
||||
//{
|
||||
// { "1", 201 },
|
||||
// { "2", 202 },
|
||||
// { "3", 203 },
|
||||
// { "4", 204 },
|
||||
// { "5", 205 },
|
||||
// { "6", 206 },
|
||||
// { "7", 207 },
|
||||
// { "8", 208 },
|
||||
// { "9", 209 },
|
||||
// { "0", 210 },
|
||||
// { "*", 211 },
|
||||
// { "#", 212 },
|
||||
//};
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
@@ -100,7 +102,12 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
public SIMPLAtcMessenger(string key, BasicTriList eisc, string messagePath)
|
||||
: base(key, messagePath)
|
||||
{
|
||||
EISC = eisc;
|
||||
EISC = eisc;
|
||||
|
||||
JoinMap = new SIMPLAtcJoinMap();
|
||||
|
||||
// TODO: Take in JoinStart value from config
|
||||
JoinMap.OffsetJoinNumbers(201);
|
||||
|
||||
CurrentCallItem = new CodecActiveCallItem();
|
||||
CurrentCallItem.Type = eCodecCallType.Audio;
|
||||
@@ -117,9 +124,9 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
this.PostStatusMessage(new
|
||||
{
|
||||
calls = GetCurrentCallList(),
|
||||
currentCallString = EISC.GetString(SCurrentCallNumber),
|
||||
currentDialString = EISC.GetString(SCurrentDialString),
|
||||
isInCall = EISC.GetString(SHookState) == "Connected"
|
||||
currentCallString = EISC.GetString(JoinMap.GetJoinForKey(SIMPLAtcJoinMap.CurrentCallName)),
|
||||
currentDialString = EISC.GetString(JoinMap.GetJoinForKey(SIMPLAtcJoinMap.CurrentDialString)),
|
||||
isInCall = EISC.GetString(JoinMap.GetJoinForKey(SIMPLAtcJoinMap.HookState)) == "Connected"
|
||||
});
|
||||
}
|
||||
|
||||
@@ -131,26 +138,26 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
//EISC.SetStringSigAction(SCurrentDialString, s => PostStatusMessage(new { currentDialString = s }));
|
||||
|
||||
EISC.SetStringSigAction(SHookState, s =>
|
||||
EISC.SetStringSigAction(JoinMap.GetJoinForKey(SIMPLAtcJoinMap.HookState), s =>
|
||||
{
|
||||
CurrentCallItem.Status = (eCodecCallStatus)Enum.Parse(typeof(eCodecCallStatus), s, true);
|
||||
//GetCurrentCallList();
|
||||
SendFullStatus();
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(SCurrentCallNumber, s =>
|
||||
EISC.SetStringSigAction(JoinMap.GetJoinForKey(SIMPLAtcJoinMap.CurrentCallNumber), s =>
|
||||
{
|
||||
CurrentCallItem.Number = s;
|
||||
SendCallsList();
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(SCurrentCallName, s =>
|
||||
EISC.SetStringSigAction(JoinMap.GetJoinForKey(SIMPLAtcJoinMap.CurrentCallName), s =>
|
||||
{
|
||||
CurrentCallItem.Name = s;
|
||||
SendCallsList();
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(SCallDirection, s =>
|
||||
EISC.SetStringSigAction(JoinMap.GetJoinForKey(SIMPLAtcJoinMap.CallDirection), s =>
|
||||
{
|
||||
CurrentCallItem.Direction = (eCodecCallDirection)Enum.Parse(typeof(eCodecCallDirection), s, true);
|
||||
SendCallsList();
|
||||
@@ -163,25 +170,31 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
// Add straight pulse calls
|
||||
Action<string, uint> addAction = (s, u) =>
|
||||
AppServerController.AddAction(MessagePath + s, new Action(() => EISC.PulseBool(u, 100)));
|
||||
addAction("/endCallById", BDialHangupOnHook);
|
||||
addAction("/endAllCalls", BDialHangupOnHook);
|
||||
addAction("/acceptById", BIncomingAnswer);
|
||||
addAction("/rejectById", BIncomingReject);
|
||||
addAction("/speedDial1", BSpeedDial1);
|
||||
addAction("/speedDial2", BSpeedDial2);
|
||||
addAction("/speedDial3", BSpeedDial3);
|
||||
addAction("/speedDial4", BSpeedDial4);
|
||||
addAction("/endCallById", JoinMap.GetJoinForKey(SIMPLAtcJoinMap.EndCall));
|
||||
addAction("/endAllCalls", JoinMap.GetJoinForKey(SIMPLAtcJoinMap.EndCall));
|
||||
addAction("/acceptById", JoinMap.GetJoinForKey(SIMPLAtcJoinMap.IncomingAnswer));
|
||||
addAction("/rejectById", JoinMap.GetJoinForKey(SIMPLAtcJoinMap.IncomingReject));
|
||||
|
||||
var speeddialStart = JoinMap.GetJoinForKey(SIMPLAtcJoinMap.SpeedDialStart);
|
||||
var speeddialEnd = JoinMap.GetJoinForKey(SIMPLAtcJoinMap.SpeedDialStart) + JoinMap.GetJoinSpanForKey(SIMPLAtcJoinMap.SpeedDialStart);
|
||||
|
||||
var speedDialIndex = 1;
|
||||
for (uint i = speeddialStart; i < speeddialEnd; i++)
|
||||
{
|
||||
addAction(string.Format("/speedDial{0}", speedDialIndex), i);
|
||||
}
|
||||
|
||||
// Get status
|
||||
AppServerController.AddAction(MessagePath + "/fullStatus", new Action(SendFullStatus));
|
||||
// Dial on string
|
||||
AppServerController.AddAction(MessagePath + "/dial", new Action<string>(s => EISC.SetString(SCurrentDialString, s)));
|
||||
AppServerController.AddAction(MessagePath + "/dial", new Action<string>(s => EISC.SetString(JoinMap.GetJoinForKey(SIMPLAtcJoinMap.CurrentDialString), s)));
|
||||
// Pulse DTMF
|
||||
AppServerController.AddAction(MessagePath + "/dtmf", new Action<string>(s =>
|
||||
{
|
||||
if (DTMFMap.ContainsKey(s))
|
||||
var join = JoinMap.GetJoinForKey(s);
|
||||
if (join > 0)
|
||||
{
|
||||
EISC.PulseBool(DTMFMap[s], 100);
|
||||
EISC.PulseBool(join, 100);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -17,223 +17,225 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
BasicTriList EISC;
|
||||
|
||||
/********* Bools *********/
|
||||
/// <summary>
|
||||
/// 724
|
||||
/// </summary>
|
||||
const uint BDialHangup = 724;
|
||||
/// <summary>
|
||||
/// 750
|
||||
/// </summary>
|
||||
const uint BCallIncoming = 750;
|
||||
/// <summary>
|
||||
/// 751
|
||||
/// </summary>
|
||||
const uint BIncomingAnswer = 751;
|
||||
/// <summary>
|
||||
/// 752
|
||||
/// </summary>
|
||||
const uint BIncomingReject = 752;
|
||||
/// <summary>
|
||||
/// 741
|
||||
/// </summary>
|
||||
const uint BSpeedDial1 = 741;
|
||||
/// <summary>
|
||||
/// 742
|
||||
/// </summary>
|
||||
const uint BSpeedDial2 = 742;
|
||||
/// <summary>
|
||||
/// 743
|
||||
/// </summary>
|
||||
const uint BSpeedDial3 = 743;
|
||||
/// <summary>
|
||||
/// 744
|
||||
/// </summary>
|
||||
const uint BSpeedDial4 = 744;
|
||||
/// <summary>
|
||||
/// 800
|
||||
/// </summary>
|
||||
const uint BDirectorySearchBusy = 800;
|
||||
/// <summary>
|
||||
/// 801
|
||||
/// </summary>
|
||||
const uint BDirectoryLineSelected = 801;
|
||||
/// <summary>
|
||||
/// 801 when selected entry is a contact
|
||||
/// </summary>
|
||||
const uint BDirectoryEntryIsContact = 801;
|
||||
/// <summary>
|
||||
/// 802 To show/hide back button
|
||||
/// </summary>
|
||||
const uint BDirectoryIsRoot = 802;
|
||||
/// <summary>
|
||||
/// 803 Pulse from system to inform us when directory is ready
|
||||
/// </summary>
|
||||
const uint DDirectoryHasChanged = 803;
|
||||
/// <summary>
|
||||
/// 804
|
||||
/// </summary>
|
||||
const uint BDirectoryRoot = 804;
|
||||
/// <summary>
|
||||
/// 805
|
||||
/// </summary>
|
||||
const uint BDirectoryFolderBack = 805;
|
||||
/// <summary>
|
||||
/// 806
|
||||
/// </summary>
|
||||
const uint BDirectoryDialSelectedLine = 806;
|
||||
/// <summary>
|
||||
/// 811
|
||||
/// </summary>
|
||||
const uint BCameraControlUp = 811;
|
||||
/// <summary>
|
||||
/// 812
|
||||
/// </summary>
|
||||
const uint BCameraControlDown = 812;
|
||||
/// <summary>
|
||||
/// 813
|
||||
/// </summary>
|
||||
const uint BCameraControlLeft = 813;
|
||||
/// <summary>
|
||||
/// 814
|
||||
/// </summary>
|
||||
const uint BCameraControlRight = 814;
|
||||
/// <summary>
|
||||
/// 815
|
||||
/// </summary>
|
||||
const uint BCameraControlZoomIn = 815;
|
||||
/// <summary>
|
||||
/// 816
|
||||
/// </summary>
|
||||
const uint BCameraControlZoomOut = 816;
|
||||
/// <summary>
|
||||
/// 821 - 826
|
||||
/// </summary>
|
||||
const uint BCameraPresetStart = 821;
|
||||
public SIMPLVtcJoinMap JoinMap { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 831
|
||||
/// </summary>
|
||||
const uint BCameraModeAuto = 831;
|
||||
/// <summary>
|
||||
/// 832
|
||||
/// </summary>
|
||||
const uint BCameraModeManual = 832;
|
||||
/// <summary>
|
||||
/// 833
|
||||
/// </summary>
|
||||
const uint BCameraModeOff = 833;
|
||||
///********* Bools *********/
|
||||
///// <summary>
|
||||
///// 724
|
||||
///// </summary>
|
||||
//const uint BDialHangup = 724;
|
||||
///// <summary>
|
||||
///// 750
|
||||
///// </summary>
|
||||
//const uint BCallIncoming = 750;
|
||||
///// <summary>
|
||||
///// 751
|
||||
///// </summary>
|
||||
//const uint BIncomingAnswer = 751;
|
||||
///// <summary>
|
||||
///// 752
|
||||
///// </summary>
|
||||
//const uint BIncomingReject = 752;
|
||||
///// <summary>
|
||||
///// 741
|
||||
///// </summary>
|
||||
//const uint BSpeedDial1 = 741;
|
||||
///// <summary>
|
||||
///// 742
|
||||
///// </summary>
|
||||
//const uint BSpeedDial2 = 742;
|
||||
///// <summary>
|
||||
///// 743
|
||||
///// </summary>
|
||||
//const uint BSpeedDial3 = 743;
|
||||
///// <summary>
|
||||
///// 744
|
||||
///// </summary>
|
||||
//const uint BSpeedDial4 = 744;
|
||||
///// <summary>
|
||||
///// 800
|
||||
///// </summary>
|
||||
//const uint BDirectorySearchBusy = 800;
|
||||
///// <summary>
|
||||
///// 801
|
||||
///// </summary>
|
||||
//const uint BDirectoryLineSelected = 801;
|
||||
///// <summary>
|
||||
///// 801 when selected entry is a contact
|
||||
///// </summary>
|
||||
//const uint BDirectoryEntryIsContact = 801;
|
||||
///// <summary>
|
||||
///// 802 To show/hide back button
|
||||
///// </summary>
|
||||
//const uint BDirectoryIsRoot = 802;
|
||||
///// <summary>
|
||||
///// 803 Pulse from system to inform us when directory is ready
|
||||
///// </summary>
|
||||
//const uint BDirectoryHasChanged = 803;
|
||||
///// <summary>
|
||||
///// 804
|
||||
///// </summary>
|
||||
//const uint BDirectoryRoot = 804;
|
||||
///// <summary>
|
||||
///// 805
|
||||
///// </summary>
|
||||
//const uint BDirectoryFolderBack = 805;
|
||||
///// <summary>
|
||||
///// 806
|
||||
///// </summary>
|
||||
//const uint BDirectoryDialSelectedLine = 806;
|
||||
///// <summary>
|
||||
///// 811
|
||||
///// </summary>
|
||||
//const uint BCameraControlUp = 811;
|
||||
///// <summary>
|
||||
///// 812
|
||||
///// </summary>
|
||||
//const uint BCameraControlDown = 812;
|
||||
///// <summary>
|
||||
///// 813
|
||||
///// </summary>
|
||||
//const uint BCameraControlLeft = 813;
|
||||
///// <summary>
|
||||
///// 814
|
||||
///// </summary>
|
||||
//const uint BCameraControlRight = 814;
|
||||
///// <summary>
|
||||
///// 815
|
||||
///// </summary>
|
||||
//const uint BCameraControlZoomIn = 815;
|
||||
///// <summary>
|
||||
///// 816
|
||||
///// </summary>
|
||||
//const uint BCameraControlZoomOut = 816;
|
||||
///// <summary>
|
||||
///// 821 - 826
|
||||
///// </summary>
|
||||
//const uint BCameraPresetStart = 821;
|
||||
|
||||
/// <summary>
|
||||
/// 841
|
||||
/// </summary>
|
||||
const uint BCameraSelfView = 841;
|
||||
///// <summary>
|
||||
///// 831
|
||||
///// </summary>
|
||||
//const uint BCameraModeAuto = 831;
|
||||
///// <summary>
|
||||
///// 832
|
||||
///// </summary>
|
||||
//const uint BCameraModeManual = 832;
|
||||
///// <summary>
|
||||
///// 833
|
||||
///// </summary>
|
||||
//const uint BCameraModeOff = 833;
|
||||
|
||||
/// <summary>
|
||||
/// 842
|
||||
/// </summary>
|
||||
const uint BCameraLayout = 842;
|
||||
/// <summary>
|
||||
/// 843
|
||||
/// </summary>
|
||||
const uint BCameraSupportsAutoMode = 843;
|
||||
/// <summary>
|
||||
/// 844
|
||||
/// </summary>
|
||||
const uint BCameraSupportsOffMode = 844;
|
||||
///// <summary>
|
||||
///// 841
|
||||
///// </summary>
|
||||
//const uint BCameraSelfView = 841;
|
||||
|
||||
///// <summary>
|
||||
///// 842
|
||||
///// </summary>
|
||||
//const uint BCameraLayout = 842;
|
||||
///// <summary>
|
||||
///// 843
|
||||
///// </summary>
|
||||
//const uint BCameraSupportsAutoMode = 843;
|
||||
///// <summary>
|
||||
///// 844
|
||||
///// </summary>
|
||||
//const uint BCameraSupportsOffMode = 844;
|
||||
|
||||
|
||||
/********* Ushorts *********/
|
||||
/// <summary>
|
||||
/// 760
|
||||
/// </summary>
|
||||
const uint UCameraNumberSelect = 760;
|
||||
/// <summary>
|
||||
/// 801
|
||||
/// </summary>
|
||||
const uint UDirectorySelectRow = 801;
|
||||
/// <summary>
|
||||
/// 801
|
||||
/// </summary>
|
||||
const uint UDirectoryRowCount = 801;
|
||||
///********* Ushorts *********/
|
||||
///// <summary>
|
||||
///// 760
|
||||
///// </summary>
|
||||
//const uint UCameraNumberSelect = 760;
|
||||
///// <summary>
|
||||
///// 801
|
||||
///// </summary>
|
||||
//const uint UDirectorySelectRow = 801;
|
||||
///// <summary>
|
||||
///// 801
|
||||
///// </summary>
|
||||
//const uint UDirectoryRowCount = 801;
|
||||
|
||||
|
||||
|
||||
/********* Strings *********/
|
||||
/// <summary>
|
||||
/// 701
|
||||
/// </summary>
|
||||
const uint SCurrentDialString = 701;
|
||||
/// <summary>
|
||||
/// 702
|
||||
/// </summary>
|
||||
const uint SCurrentCallName = 702;
|
||||
/// <summary>
|
||||
/// 703
|
||||
/// </summary>
|
||||
const uint SCurrentCallNumber = 703;
|
||||
/// <summary>
|
||||
/// 731
|
||||
/// </summary>
|
||||
const uint SHookState = 731;
|
||||
/// <summary>
|
||||
/// 722
|
||||
/// </summary>
|
||||
const uint SCallDirection = 722;
|
||||
/// <summary>
|
||||
/// 751
|
||||
/// </summary>
|
||||
const uint SIncomingCallName = 751;
|
||||
/// <summary>
|
||||
/// 752
|
||||
/// </summary>
|
||||
const uint SIncomingCallNumber = 752;
|
||||
///********* Strings *********/
|
||||
///// <summary>
|
||||
///// 701
|
||||
///// </summary>
|
||||
//const uint SCurrentDialString = 701;
|
||||
///// <summary>
|
||||
///// 702
|
||||
///// </summary>
|
||||
//const uint SCurrentCallName = 702;
|
||||
///// <summary>
|
||||
///// 703
|
||||
///// </summary>
|
||||
//const uint SCurrentCallNumber = 703;
|
||||
///// <summary>
|
||||
///// 731
|
||||
///// </summary>
|
||||
//const uint SHookState = 731;
|
||||
///// <summary>
|
||||
///// 722
|
||||
///// </summary>
|
||||
//const uint SCallDirection = 722;
|
||||
///// <summary>
|
||||
///// 751
|
||||
///// </summary>
|
||||
//const uint SIncomingCallName = 751;
|
||||
///// <summary>
|
||||
///// 752
|
||||
///// </summary>
|
||||
//const uint SIncomingCallNumber = 752;
|
||||
|
||||
/// <summary>
|
||||
/// 800
|
||||
/// </summary>
|
||||
const uint SDirectorySearchString = 800;
|
||||
/// <summary>
|
||||
/// 801-1055
|
||||
/// </summary>
|
||||
const uint SDirectoryEntriesStart = 801;
|
||||
/// <summary>
|
||||
/// 1056
|
||||
/// </summary>
|
||||
const uint SDirectoryEntrySelectedName = 1056;
|
||||
/// <summary>
|
||||
/// 1057
|
||||
/// </summary>
|
||||
const uint SDirectoryEntrySelectedNumber = 1057;
|
||||
/// <summary>
|
||||
/// 1058
|
||||
/// </summary>
|
||||
const uint SDirectorySelectedFolderName = 1058;
|
||||
///// <summary>
|
||||
///// 800
|
||||
///// </summary>
|
||||
//const uint SDirectorySearchString = 800;
|
||||
///// <summary>
|
||||
///// 801-1055
|
||||
///// </summary>
|
||||
//const uint SDirectoryEntriesStart = 801;
|
||||
///// <summary>
|
||||
///// 1056
|
||||
///// </summary>
|
||||
//const uint SDirectoryEntrySelectedName = 1056;
|
||||
///// <summary>
|
||||
///// 1057
|
||||
///// </summary>
|
||||
//const uint SDirectoryEntrySelectedNumber = 1057;
|
||||
///// <summary>
|
||||
///// 1058
|
||||
///// </summary>
|
||||
//const uint SDirectorySelectedFolderName = 1058;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 701-712 0-9*#
|
||||
/// </summary>
|
||||
Dictionary<string, uint> DTMFMap = new Dictionary<string, uint>
|
||||
{
|
||||
{ "1", 701 },
|
||||
{ "2", 702 },
|
||||
{ "3", 703 },
|
||||
{ "4", 704 },
|
||||
{ "5", 705 },
|
||||
{ "6", 706 },
|
||||
{ "7", 707 },
|
||||
{ "8", 708 },
|
||||
{ "9", 709 },
|
||||
{ "0", 710 },
|
||||
{ "*", 711 },
|
||||
{ "#", 712 },
|
||||
};
|
||||
///// <summary>
|
||||
///// 701-712 0-9*#
|
||||
///// </summary>
|
||||
//Dictionary<string, uint> DTMFMap = new Dictionary<string, uint>
|
||||
//{
|
||||
// { "1", 701 },
|
||||
// { "2", 702 },
|
||||
// { "3", 703 },
|
||||
// { "4", 704 },
|
||||
// { "5", 705 },
|
||||
// { "6", 706 },
|
||||
// { "7", 707 },
|
||||
// { "8", 708 },
|
||||
// { "9", 709 },
|
||||
// { "0", 710 },
|
||||
// { "*", 711 },
|
||||
// { "#", 712 },
|
||||
//};
|
||||
|
||||
CodecActiveCallItem CurrentCallItem;
|
||||
CodecActiveCallItem IncomingCallItem;
|
||||
|
||||
ushort PreviousDirectoryLength = 0;
|
||||
ushort PreviousDirectoryLength = 701;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
@@ -245,6 +247,12 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
EISC = eisc;
|
||||
|
||||
JoinMap = new SIMPLVtcJoinMap();
|
||||
|
||||
// TODO: Take in JoinStart value from config
|
||||
JoinMap.OffsetJoinNumbers(200);
|
||||
|
||||
|
||||
CurrentCallItem = new CodecActiveCallItem();
|
||||
CurrentCallItem.Type = eCodecCallType.Video;
|
||||
CurrentCallItem.Id = "-video-";
|
||||
@@ -257,31 +265,31 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
var asc = appServerController;
|
||||
EISC.SetStringSigAction(SHookState, s =>
|
||||
EISC.SetStringSigAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.HookState), s =>
|
||||
{
|
||||
CurrentCallItem.Status = (eCodecCallStatus)Enum.Parse(typeof(eCodecCallStatus), s, true);
|
||||
PostFullStatus(); // SendCallsList();
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(SCurrentCallNumber, s =>
|
||||
EISC.SetStringSigAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CurrentCallNumber), s =>
|
||||
{
|
||||
CurrentCallItem.Number = s;
|
||||
PostCallsList();
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(SCurrentCallName, s =>
|
||||
EISC.SetStringSigAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CurrentCallName), s =>
|
||||
{
|
||||
CurrentCallItem.Name = s;
|
||||
PostCallsList();
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(SCallDirection, s =>
|
||||
EISC.SetStringSigAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CallDirection), s =>
|
||||
{
|
||||
CurrentCallItem.Direction = (eCodecCallDirection)Enum.Parse(typeof(eCodecCallDirection), s, true);
|
||||
PostCallsList();
|
||||
});
|
||||
|
||||
EISC.SetBoolSigAction(BCallIncoming, b =>
|
||||
EISC.SetBoolSigAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.IncomingCall), b =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
@@ -289,8 +297,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
Direction = eCodecCallDirection.Incoming,
|
||||
Id = "-video-incoming",
|
||||
Name = EISC.GetString(SIncomingCallName),
|
||||
Number = EISC.GetString(SIncomingCallNumber),
|
||||
Name = EISC.GetString(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.IncomingCallName)),
|
||||
Number = EISC.GetString(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.IncomingCallNumber)),
|
||||
Status = eCodecCallStatus.Ringing,
|
||||
Type = eCodecCallType.Video
|
||||
};
|
||||
@@ -303,14 +311,14 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
PostCallsList();
|
||||
});
|
||||
|
||||
EISC.SetBoolSigAction(BCameraSupportsAutoMode, b =>
|
||||
EISC.SetBoolSigAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraSupportsAutoMode), b =>
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
cameraSupportsAutoMode = b
|
||||
});
|
||||
});
|
||||
EISC.SetBoolSigAction(BCameraSupportsOffMode, b =>
|
||||
EISC.SetBoolSigAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraSupportsOffMode), b =>
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
@@ -319,91 +327,97 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
});
|
||||
|
||||
// Directory insanity
|
||||
EISC.SetUShortSigAction(UDirectoryRowCount, u =>
|
||||
EISC.SetUShortSigAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryRowCount), u =>
|
||||
{
|
||||
// The length of the list comes in before the list does.
|
||||
// Splice the sig change operation onto the last string sig that will be changing
|
||||
// when the directory entries make it through.
|
||||
if (PreviousDirectoryLength > 0)
|
||||
{
|
||||
EISC.ClearStringSigAction(SDirectoryEntriesStart + PreviousDirectoryLength - 1);
|
||||
EISC.ClearStringSigAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryEntriesStart) + PreviousDirectoryLength - 1);
|
||||
}
|
||||
EISC.SetStringSigAction(SDirectoryEntriesStart + u - 1, s => PostDirectory());
|
||||
EISC.SetStringSigAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryEntriesStart) + u - 1, s => PostDirectory());
|
||||
PreviousDirectoryLength = u;
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(SDirectoryEntrySelectedName, s =>
|
||||
EISC.SetStringSigAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryEntrySelectedName), s =>
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
directoryContactSelected = new
|
||||
{
|
||||
name = EISC.GetString(SDirectoryEntrySelectedName),
|
||||
name = EISC.GetString(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryEntrySelectedName)),
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(SDirectoryEntrySelectedNumber, s =>
|
||||
EISC.SetStringSigAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryEntrySelectedNumber), s =>
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
directoryContactSelected = new
|
||||
{
|
||||
number = EISC.GetString(SDirectoryEntrySelectedNumber),
|
||||
number = EISC.GetString(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryEntrySelectedNumber)),
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(SDirectorySelectedFolderName, s => PostStatusMessage(new
|
||||
EISC.SetStringSigAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectorySelectedFolderName), s => PostStatusMessage(new
|
||||
{
|
||||
directorySelectedFolderName = EISC.GetString(SDirectorySelectedFolderName)
|
||||
directorySelectedFolderName = EISC.GetString(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectorySelectedFolderName))
|
||||
}));
|
||||
|
||||
EISC.SetSigTrueAction(BCameraModeAuto, () => PostCameraMode());
|
||||
EISC.SetSigTrueAction(BCameraModeManual, () => PostCameraMode());
|
||||
EISC.SetSigTrueAction(BCameraModeOff, () => PostCameraMode());
|
||||
EISC.SetSigTrueAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraModeAuto), () => PostCameraMode());
|
||||
EISC.SetSigTrueAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraModeManual), () => PostCameraMode());
|
||||
EISC.SetSigTrueAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraModeOff), () => PostCameraMode());
|
||||
|
||||
EISC.SetBoolSigAction(BCameraSelfView, b => PostStatusMessage(new
|
||||
EISC.SetBoolSigAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraSelfView), b => PostStatusMessage(new
|
||||
{
|
||||
cameraSelfView = b
|
||||
}));
|
||||
|
||||
EISC.SetUShortSigAction(UCameraNumberSelect, (u) => PostSelectedCamera());
|
||||
EISC.SetUShortSigAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraNumberSelect), (u) => PostSelectedCamera());
|
||||
|
||||
|
||||
// Add press and holds using helper action
|
||||
Action<string, uint> addPHAction = (s, u) =>
|
||||
AppServerController.AddAction(MessagePath + s, new PressAndHoldAction(b => EISC.SetBool(u, b)));
|
||||
addPHAction("/cameraUp", BCameraControlUp);
|
||||
addPHAction("/cameraDown", BCameraControlDown);
|
||||
addPHAction("/cameraLeft", BCameraControlLeft);
|
||||
addPHAction("/cameraRight", BCameraControlRight);
|
||||
addPHAction("/cameraZoomIn", BCameraControlZoomIn);
|
||||
addPHAction("/cameraZoomOut", BCameraControlZoomOut);
|
||||
addPHAction("/cameraUp", JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraTiltUp));
|
||||
addPHAction("/cameraDown", JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraTiltDown));
|
||||
addPHAction("/cameraLeft", JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraPanLeft));
|
||||
addPHAction("/cameraRight", JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraPanRight));
|
||||
addPHAction("/cameraZoomIn", JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraZoomIn));
|
||||
addPHAction("/cameraZoomOut", JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraZoomOut));
|
||||
|
||||
// Add straight pulse calls using helper action
|
||||
Action<string, uint> addAction = (s, u) =>
|
||||
AppServerController.AddAction(MessagePath + s, new Action(() => EISC.PulseBool(u, 100)));
|
||||
addAction("/endCallById", BDialHangup);
|
||||
addAction("/endAllCalls", BDialHangup);
|
||||
addAction("/acceptById", BIncomingAnswer);
|
||||
addAction("/rejectById", BIncomingReject);
|
||||
addAction("/speedDial1", BSpeedDial1);
|
||||
addAction("/speedDial2", BSpeedDial2);
|
||||
addAction("/speedDial3", BSpeedDial3);
|
||||
addAction("/speedDial4", BSpeedDial4);
|
||||
addAction("/cameraModeAuto", BCameraModeAuto);
|
||||
addAction("/cameraModeManual", BCameraModeManual);
|
||||
addAction("/cameraModeOff", BCameraModeOff);
|
||||
addAction("/cameraSelfView", BCameraSelfView);
|
||||
addAction("/cameraLayout", BCameraLayout);
|
||||
addAction("/endCallById", JoinMap.GetJoinForKey(SIMPLVtcJoinMap.EndCall));
|
||||
addAction("/endAllCalls", JoinMap.GetJoinForKey(SIMPLVtcJoinMap.EndCall));
|
||||
addAction("/acceptById", JoinMap.GetJoinForKey(SIMPLVtcJoinMap.IncomingAnswer));
|
||||
addAction("/rejectById", JoinMap.GetJoinForKey(SIMPLVtcJoinMap.IncomingReject));
|
||||
|
||||
var speeddialStart = JoinMap.GetJoinForKey(SIMPLAtcJoinMap.SpeedDialStart);
|
||||
var speeddialEnd = JoinMap.GetJoinForKey(SIMPLAtcJoinMap.SpeedDialStart) + JoinMap.GetJoinSpanForKey(SIMPLAtcJoinMap.SpeedDialStart);
|
||||
|
||||
var speedDialIndex = 1;
|
||||
for (uint i = speeddialStart; i < speeddialEnd; i++)
|
||||
{
|
||||
addAction(string.Format("/speedDial{0}", speedDialIndex), i);
|
||||
}
|
||||
|
||||
addAction("/cameraModeAuto", JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraModeAuto));
|
||||
addAction("/cameraModeManual", JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraModeManual));
|
||||
addAction("/cameraModeOff", JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraModeOff));
|
||||
addAction("/cameraSelfView", JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraSelfView));
|
||||
addAction("/cameraLayout", JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraLayout));
|
||||
|
||||
asc.AddAction("/cameraSelect", new Action<string>(SelectCamera));
|
||||
|
||||
// camera presets
|
||||
for(uint i = 0; i < 6; i++)
|
||||
{
|
||||
addAction("/cameraPreset" + (i + 1), BCameraPresetStart + i);
|
||||
addAction("/cameraPreset" + (i + 1), JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraPresetStart) + i);
|
||||
}
|
||||
|
||||
asc.AddAction(MessagePath + "/isReady", new Action(PostIsReady));
|
||||
@@ -411,27 +425,28 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
asc.AddAction(MessagePath + "/fullStatus", new Action(PostFullStatus));
|
||||
// Dial on string
|
||||
asc.AddAction(MessagePath + "/dial", new Action<string>(s =>
|
||||
EISC.SetString(SCurrentDialString, s)));
|
||||
// Pulse DTMF
|
||||
asc.AddAction(MessagePath + "/dtmf", new Action<string>(s =>
|
||||
{
|
||||
if (DTMFMap.ContainsKey(s))
|
||||
{
|
||||
EISC.PulseBool(DTMFMap[s], 100);
|
||||
}
|
||||
}));
|
||||
EISC.SetString(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CurrentDialString), s)));
|
||||
// Pulse DTMF
|
||||
AppServerController.AddAction(MessagePath + "/dtmf", new Action<string>(s =>
|
||||
{
|
||||
var join = JoinMap.GetJoinForKey(s);
|
||||
if (join > 0)
|
||||
{
|
||||
EISC.PulseBool(join, 100);
|
||||
}
|
||||
}));
|
||||
|
||||
// Directory madness
|
||||
asc.AddAction(MessagePath + "/directoryRoot", new Action(() => EISC.PulseBool(BDirectoryRoot)));
|
||||
asc.AddAction(MessagePath + "/directoryBack", new Action(() => EISC.PulseBool(BDirectoryFolderBack)));
|
||||
asc.AddAction(MessagePath + "/directoryRoot", new Action(() => EISC.PulseBool(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryRoot))));
|
||||
asc.AddAction(MessagePath + "/directoryBack", new Action(() => EISC.PulseBool(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryFolderBack))));
|
||||
asc.AddAction(MessagePath + "/directoryById", new Action<string>(s =>
|
||||
{
|
||||
// the id should contain the line number to forward to simpl
|
||||
try
|
||||
{
|
||||
var u = ushort.Parse(s);
|
||||
EISC.SetUshort(UDirectorySelectRow, u);
|
||||
EISC.PulseBool(BDirectoryLineSelected);
|
||||
EISC.SetUshort(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectorySelectRow), u);
|
||||
EISC.PulseBool(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryLineSelected));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -445,8 +460,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
try
|
||||
{
|
||||
var u = ushort.Parse(s);
|
||||
EISC.SetUshort(UDirectorySelectRow, u);
|
||||
EISC.PulseBool(BDirectoryLineSelected);
|
||||
EISC.SetUshort(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectorySelectRow), u);
|
||||
EISC.PulseBool(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryLineSelected));
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -454,17 +469,17 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
}
|
||||
}));
|
||||
asc.AddAction(MessagePath + "/directoryDialContact", new Action(() => {
|
||||
EISC.PulseBool(BDirectoryDialSelectedLine);
|
||||
EISC.PulseBool(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryDialSelectedLine));
|
||||
}));
|
||||
asc.AddAction(MessagePath + "/getDirectory", new Action(() =>
|
||||
{
|
||||
if (EISC.GetUshort(UDirectoryRowCount) > 0)
|
||||
if (EISC.GetUshort(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryRowCount)) > 0)
|
||||
{
|
||||
PostDirectory();
|
||||
}
|
||||
else
|
||||
{
|
||||
EISC.PulseBool(BDirectoryRoot);
|
||||
EISC.PulseBool(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryRoot));
|
||||
}
|
||||
}));
|
||||
}
|
||||
@@ -478,18 +493,18 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
calls = GetCurrentCallList(),
|
||||
cameraMode = GetCameraMode(),
|
||||
cameraSelfView = EISC.GetBool(BCameraSelfView),
|
||||
cameraSupportsAutoMode = EISC.GetBool(BCameraSupportsAutoMode),
|
||||
cameraSupportsOffMode = EISC.GetBool(BCameraSupportsOffMode),
|
||||
currentCallString = EISC.GetString(SCurrentCallNumber),
|
||||
currentDialString = EISC.GetString(SCurrentDialString),
|
||||
cameraSelfView = EISC.GetBool(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraSelfView)),
|
||||
cameraSupportsAutoMode = EISC.GetBool(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraSupportsAutoMode)),
|
||||
cameraSupportsOffMode = EISC.GetBool(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraSupportsOffMode)),
|
||||
currentCallString = EISC.GetString(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CurrentCallNumber)),
|
||||
currentDialString = EISC.GetString(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CurrentDialString)),
|
||||
directoryContactSelected = new
|
||||
{
|
||||
name = EISC.GetString(SDirectoryEntrySelectedName),
|
||||
number = EISC.GetString(SDirectoryEntrySelectedNumber)
|
||||
name = EISC.GetString(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryEntrySelectedName)),
|
||||
number = EISC.GetString(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryEntrySelectedNumber))
|
||||
},
|
||||
directorySelectedFolderName = EISC.GetString(SDirectorySelectedFolderName),
|
||||
isInCall = EISC.GetString(SHookState) == "Connected",
|
||||
directorySelectedFolderName = EISC.GetString(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectorySelectedFolderName)),
|
||||
isInCall = EISC.GetString(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.HookState)) == "Connected",
|
||||
hasDirectory = true,
|
||||
hasDirectorySearch = false,
|
||||
hasRecents = !EISC.BooleanOutput[502].BoolValue,
|
||||
@@ -504,11 +519,11 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
/// </summary>
|
||||
void PostDirectory()
|
||||
{
|
||||
var u = EISC.GetUshort(UDirectoryRowCount);
|
||||
var u = EISC.GetUshort(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryRowCount));
|
||||
var items = new List<object>();
|
||||
for (uint i = 0; i < u; i++)
|
||||
{
|
||||
var name = EISC.GetString(SDirectoryEntriesStart + i);
|
||||
var name = EISC.GetString(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryEntriesStart) + i);
|
||||
var id = (i + 1).ToString();
|
||||
// is folder or contact?
|
||||
if (name.StartsWith("[+]"))
|
||||
@@ -533,7 +548,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
currentDirectory = new
|
||||
{
|
||||
isRootDirectory = EISC.GetBool(BDirectoryIsRoot),
|
||||
isRootDirectory = EISC.GetBool(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryIsRoot)),
|
||||
directoryResults = items
|
||||
}
|
||||
};
|
||||
@@ -558,8 +573,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
string GetCameraMode()
|
||||
{
|
||||
string m;
|
||||
if (EISC.GetBool(BCameraModeAuto)) m = eCameraControlMode.Auto.ToString().ToLower();
|
||||
else if (EISC.GetBool(BCameraModeManual)) m = eCameraControlMode.Manual.ToString().ToLower();
|
||||
if (EISC.GetBool(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraModeAuto))) m = eCameraControlMode.Auto.ToString().ToLower();
|
||||
else if (EISC.GetBool(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraModeManual))) m = eCameraControlMode.Manual.ToString().ToLower();
|
||||
else m = eCameraControlMode.Off.ToString().ToLower();
|
||||
return m;
|
||||
}
|
||||
@@ -577,7 +592,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
/// </summary>
|
||||
string GetSelectedCamera()
|
||||
{
|
||||
var num = EISC.GetUshort(UCameraNumberSelect);
|
||||
var num = EISC.GetUshort(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraNumberSelect));
|
||||
string m;
|
||||
if (num == 100)
|
||||
{
|
||||
@@ -621,11 +636,11 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
var cam = s.Substring(6);
|
||||
if (cam.ToLower() == "far")
|
||||
{
|
||||
EISC.SetUshort(UCameraNumberSelect, 100);
|
||||
EISC.SetUshort(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraNumberSelect), 100);
|
||||
}
|
||||
else
|
||||
{
|
||||
EISC.SetUshort(UCameraNumberSelect, UInt16.Parse(cam));
|
||||
EISC.SetUshort(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraNumberSelect), UInt16.Parse(cam));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -640,7 +655,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
list.Add(CurrentCallItem);
|
||||
}
|
||||
if (EISC.GetBool(BCallIncoming)) {
|
||||
if (EISC.GetBool(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CallIncoming))) {
|
||||
|
||||
}
|
||||
return list;
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.AppServer
|
||||
{
|
||||
public class SIMPLAtcJoinMap : JoinMapBase
|
||||
{
|
||||
public const string EndCall = "EndCall";
|
||||
public const string IncomingAnswer = "IncomingAnswer";
|
||||
public const string IncomingReject = "IncomingReject";
|
||||
public const string SpeedDialStart = "SpeedDialStart";
|
||||
public const string CurrentDialString = "CurrentDialString";
|
||||
public const string CurrentCallNumber = "CurrentCallNumber";
|
||||
public const string CurrentCallName = "CurrentCallName";
|
||||
public const string HookState = "HookState";
|
||||
public const string CallDirection = "CallDirection";
|
||||
public const string Dtmf0 = "0";
|
||||
public const string Dtmf1 = "1";
|
||||
public const string Dtmf2 = "2";
|
||||
public const string Dtmf3 = "3";
|
||||
public const string Dtmf4 = "4";
|
||||
public const string Dtmf5 = "5";
|
||||
public const string Dtmf6 = "6";
|
||||
public const string Dtmf7 = "7";
|
||||
public const string Dtmf8 = "8";
|
||||
public const string Dtmf9 = "9";
|
||||
public const string DtmfStar = "*";
|
||||
public const string DtmfPound = "#";
|
||||
|
||||
|
||||
public SIMPLAtcJoinMap()
|
||||
{
|
||||
Joins.Add(EndCall, new JoinMetadata() { JoinNumber = 21, Label = "Hang Up", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(IncomingAnswer, new JoinMetadata() { JoinNumber = 51, Label = "Answer Incoming Call", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(IncomingReject, new JoinMetadata() { JoinNumber = 52, Label = "Reject Incoming Call", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(SpeedDialStart, new JoinMetadata() { JoinNumber = 41, Label = "Speed Dial", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 4, JoinType = eJoinType.Digital });
|
||||
Joins.Add(CurrentDialString, new JoinMetadata() { JoinNumber = 1, Label = "Current Dial String", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
Joins.Add(CurrentCallNumber, new JoinMetadata() { JoinNumber = 11, Label = "Current Call Number", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
Joins.Add(CurrentCallName, new JoinMetadata() { JoinNumber = 12, Label = "Current Call Name", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
Joins.Add(HookState, new JoinMetadata() { JoinNumber = 21, Label = "Current Hook State", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
Joins.Add(CallDirection, new JoinMetadata() { JoinNumber = 21, Label = "Current Call Direction", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
Joins.Add(Dtmf1, new JoinMetadata() { JoinNumber = 1, Label = "DTMF 1", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf2, new JoinMetadata() { JoinNumber = 2, Label = "DTMF 2", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf3, new JoinMetadata() { JoinNumber = 3, Label = "DTMF 3", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf4, new JoinMetadata() { JoinNumber = 4, Label = "DTMF 4", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf5, new JoinMetadata() { JoinNumber = 5, Label = "DTMF 5", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf6, new JoinMetadata() { JoinNumber = 6, Label = "DTMF 6", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf7, new JoinMetadata() { JoinNumber = 7, Label = "DTMF 7", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf8, new JoinMetadata() { JoinNumber = 8, Label = "DTMF 8", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf9, new JoinMetadata() { JoinNumber = 9, Label = "DTMF 9", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf0, new JoinMetadata() { JoinNumber = 10, Label = "DTMF 0", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(DtmfStar, new JoinMetadata() { JoinNumber = 11, Label = "DTMF *", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(DtmfPound, new JoinMetadata() { JoinNumber = 12, Label = "DTMF #", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
foreach (var join in Joins)
|
||||
{
|
||||
join.Value.JoinNumber = join.Value.JoinNumber + joinOffset;
|
||||
}
|
||||
|
||||
PrintJoinMapInfo();
|
||||
}
|
||||
}
|
||||
}
|
||||
116
PepperDashEssentials/AppServer/SIMPLJoinMaps/SIMPLVtcJoinMap.cs
Normal file
116
PepperDashEssentials/AppServer/SIMPLJoinMaps/SIMPLVtcJoinMap.cs
Normal file
@@ -0,0 +1,116 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.AppServer
|
||||
{
|
||||
public class SIMPLVtcJoinMap : JoinMapBase
|
||||
{
|
||||
public const string EndCall = "EndCall";
|
||||
public const string IncomingCall = "IncomingCall";
|
||||
public const string IncomingAnswer = "IncomingAnswer";
|
||||
public const string IncomingReject = "IncomingReject";
|
||||
public const string SpeedDialStart = "SpeedDialStart";
|
||||
public const string DirectorySearchBusy = "DirectorySearchBusy";
|
||||
public const string DirectoryLineSelected = "DirectoryLineSelected";
|
||||
public const string DirectoryEntryIsContact = "DirectoryEntryIsContact";
|
||||
public const string DirectoryIsRoot = "DirectoryIsRoot";
|
||||
public const string DDirectoryHasChanged = "DDirectoryHasChanged";
|
||||
public const string DirectoryRoot = "DirectoryRoot";
|
||||
public const string DirectoryFolderBack = "DirectoryFoldeBrack";
|
||||
public const string DirectoryDialSelectedLine = "DirectoryDialSelectedLine";
|
||||
|
||||
public const string CameraTiltUp = "CameraTiltUp";
|
||||
public const string CameraTiltDown = "CameraTiltDown";
|
||||
public const string CameraPanLeft = "CameraPanLeft";
|
||||
public const string CameraPanRight = "CameraPanRight";
|
||||
public const string CameraZoomIn = "CameraZoomIn";
|
||||
public const string CameraZoomOut = "CameraZoomOut";
|
||||
public const string CameraPresetStart = "CameraPresetStart";
|
||||
public const string CameraModeAuto = "CameraModeAuto";
|
||||
public const string CameraModeManual = "CameraModeManual";
|
||||
public const string CameraModeOff = "CameraModeOff";
|
||||
|
||||
public const string CameraSelfView = "CameraSelfView";
|
||||
public const string CameraLayout = "CameraLayout";
|
||||
|
||||
public const string CameraSupportsAutoMode = "CameraSupportsAutoMode";
|
||||
public const string CameraSupportsOffMode = "CameraSupportsOffMode";
|
||||
|
||||
public const string CameraNumberSelect = "CameraNumberSelect";
|
||||
public const string DirectorySelectRow = "DirectorySelectRow";
|
||||
public const string DirectoryRowCount = "DirectoryRowCount";
|
||||
|
||||
public const string CurrentDialString = "CurrentDialString";
|
||||
public const string CurrentCallNumber = "CurrentCallNumber";
|
||||
public const string CurrentCallName = "CurrentCallName";
|
||||
public const string HookState = "HookState";
|
||||
public const string CallDirection = "CallDirection";
|
||||
public const string IncomingCallName = "IncomingCallName";
|
||||
public const string IncomingCallNumber = "IncomingCallNumber";
|
||||
public const string DirectorySearchString = "DirectorySearchString";
|
||||
public const string DirectoryEntriesStart = "EndCaDirectoryEntriesStartll";
|
||||
public const string DirectoryEntrySelectedName = "DirectoryEntrySelectedName";
|
||||
public const string DirectoryEntrySelectedNumber = "DirectoryEntrySelectedNumber";
|
||||
public const string DirectorySelectedFolderName = "DirectorySelectedFolderName";
|
||||
|
||||
public const string Dtmf0 = "0";
|
||||
public const string Dtmf1 = "1";
|
||||
public const string Dtmf2 = "2";
|
||||
public const string Dtmf3 = "3";
|
||||
public const string Dtmf4 = "4";
|
||||
public const string Dtmf5 = "5";
|
||||
public const string Dtmf6 = "6";
|
||||
public const string Dtmf7 = "7";
|
||||
public const string Dtmf8 = "8";
|
||||
public const string Dtmf9 = "9";
|
||||
public const string DtmfStar = "*";
|
||||
public const string DtmfPound = "#";
|
||||
|
||||
|
||||
public SIMPLVtcJoinMap()
|
||||
{
|
||||
// TODO: Set Join metedata
|
||||
|
||||
Joins.Add(EndCall, new JoinMetadata() { JoinNumber = 21, Label = "Hang Up", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(IncomingAnswer, new JoinMetadata() { JoinNumber = 51, Label = "Answer Incoming Call", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(IncomingReject, new JoinMetadata() { JoinNumber = 52, Label = "Reject Incoming Call", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(SpeedDialStart, new JoinMetadata() { JoinNumber = 41, Label = "Speed Dial", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 4, JoinType = eJoinType.Digital });
|
||||
Joins.Add(CurrentDialString, new JoinMetadata() { JoinNumber = 1, Label = "Current Dial String", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
Joins.Add(CurrentCallNumber, new JoinMetadata() { JoinNumber = 11, Label = "Current Call Number", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
Joins.Add(CurrentCallName, new JoinMetadata() { JoinNumber = 12, Label = "Current Call Name", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
Joins.Add(HookState, new JoinMetadata() { JoinNumber = 21, Label = "Current Hook State", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
Joins.Add(CallDirection, new JoinMetadata() { JoinNumber = 21, Label = "Current Call Direction", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
Joins.Add(Dtmf1, new JoinMetadata() { JoinNumber = 1, Label = "DTMF 1", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf2, new JoinMetadata() { JoinNumber = 2, Label = "DTMF 2", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf3, new JoinMetadata() { JoinNumber = 3, Label = "DTMF 3", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf4, new JoinMetadata() { JoinNumber = 4, Label = "DTMF 4", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf5, new JoinMetadata() { JoinNumber = 5, Label = "DTMF 5", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf6, new JoinMetadata() { JoinNumber = 6, Label = "DTMF 6", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf7, new JoinMetadata() { JoinNumber = 7, Label = "DTMF 7", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf8, new JoinMetadata() { JoinNumber = 8, Label = "DTMF 8", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf9, new JoinMetadata() { JoinNumber = 9, Label = "DTMF 9", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf0, new JoinMetadata() { JoinNumber = 10, Label = "DTMF 0", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(DtmfStar, new JoinMetadata() { JoinNumber = 11, Label = "DTMF *", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(DtmfPound, new JoinMetadata() { JoinNumber = 12, Label = "DTMF #", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
foreach (var join in Joins)
|
||||
{
|
||||
join.Value.JoinNumber = join.Value.JoinNumber + joinOffset;
|
||||
}
|
||||
|
||||
PrintJoinMapInfo();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -120,6 +120,8 @@
|
||||
<Compile Include="AppServer\Messengers\SIMPLRouteMessenger.cs" />
|
||||
<Compile Include="AppServer\Messengers\SystemMonitorMessenger.cs" />
|
||||
<Compile Include="AppServer\Messengers\VideoCodecBaseMessenger.cs" />
|
||||
<Compile Include="AppServer\SIMPLJoinMaps\SIMPLVtcJoinMap.cs" />
|
||||
<Compile Include="AppServer\SIMPLJoinMaps\SIMPLAtcJoinMap.cs" />
|
||||
<Compile Include="AppServer\SIMPLJoinMaps\MobileControlSIMPLRoomJoinMap.cs" />
|
||||
<Compile Include="Audio\EssentialsVolumeLevelConfig.cs" />
|
||||
<Compile Include="Bridges\AppleTvBridge.cs" />
|
||||
|
||||
@@ -185,4 +185,40 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
}
|
||||
|
||||
public enum eBiologicalSex
|
||||
{
|
||||
Unknown = 0,
|
||||
Female = 1,
|
||||
Male = 2,
|
||||
Intersex = Male | Female
|
||||
}
|
||||
|
||||
public class Human
|
||||
{
|
||||
|
||||
eBiologicalSex BiologicalSex;
|
||||
|
||||
public bool IsMale
|
||||
{
|
||||
get { return (BiologicalSex & eBiologicalSex.Male) == eBiologicalSex.Male; }
|
||||
}
|
||||
|
||||
public bool IsFemale
|
||||
{
|
||||
get { return (BiologicalSex & eBiologicalSex.Female) == eBiologicalSex.Female; }
|
||||
}
|
||||
|
||||
public bool IsIntersex
|
||||
{
|
||||
get { return (BiologicalSex & eBiologicalSex.Intersex) == eBiologicalSex.Intersex; }
|
||||
}
|
||||
|
||||
public bool IsDeservingOfBasicHumanRights
|
||||
{
|
||||
get
|
||||
{
|
||||
return this is Human;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user