mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 05:05:00 +00:00
feat(essentials): Adds ability to select and dial contact methods for directory contacts via SIMPL bridge
This commit is contained in:
@@ -510,6 +510,20 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
|
|||||||
JoinType = eJoinType.Digital
|
JoinType = eJoinType.Digital
|
||||||
});
|
});
|
||||||
|
|
||||||
|
[JoinName("DirectoryDialSelectedContactMethod")]
|
||||||
|
public JoinDataComplete DirectoryDialSelectedContactMethod = new JoinDataComplete(
|
||||||
|
new JoinData
|
||||||
|
{
|
||||||
|
JoinNumber = 108,
|
||||||
|
JoinSpan = 1
|
||||||
|
},
|
||||||
|
new JoinMetadata
|
||||||
|
{
|
||||||
|
Description = "Pulse to dial the selected contact method",
|
||||||
|
JoinCapabilities = eJoinCapabilities.FromSIMPL,
|
||||||
|
JoinType = eJoinType.Digital
|
||||||
|
});
|
||||||
|
|
||||||
[JoinName("CameraTiltUp")]
|
[JoinName("CameraTiltUp")]
|
||||||
public JoinDataComplete CameraTiltUp = new JoinDataComplete(
|
public JoinDataComplete CameraTiltUp = new JoinDataComplete(
|
||||||
new JoinData
|
new JoinData
|
||||||
@@ -1232,6 +1246,20 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
|
|||||||
JoinType = eJoinType.Analog
|
JoinType = eJoinType.Analog
|
||||||
});
|
});
|
||||||
|
|
||||||
|
[JoinName("SelectContactMethod")]
|
||||||
|
public JoinDataComplete SelectContactMethod = new JoinDataComplete(
|
||||||
|
new JoinData
|
||||||
|
{
|
||||||
|
JoinNumber = 103,
|
||||||
|
JoinSpan = 1
|
||||||
|
},
|
||||||
|
new JoinMetadata
|
||||||
|
{
|
||||||
|
Description = "Selects a contact method by index",
|
||||||
|
JoinCapabilities = eJoinCapabilities.FromSIMPL,
|
||||||
|
JoinType = eJoinType.Analog
|
||||||
|
});
|
||||||
|
|
||||||
[JoinName("CameraPresetSelect")]
|
[JoinName("CameraPresetSelect")]
|
||||||
public JoinDataComplete CameraPresetSelect = new JoinDataComplete(
|
public JoinDataComplete CameraPresetSelect = new JoinDataComplete(
|
||||||
new JoinData
|
new JoinData
|
||||||
|
|||||||
@@ -980,31 +980,51 @@ ScreenIndexIsPinnedTo: {8} (a{17})
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
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 < 1 || i > codec.CurrentDirectoryResult.CurrentDirectoryResults.Count) return;
|
||||||
|
|
||||||
var entry = codec.CurrentDirectoryResult.CurrentDirectoryResults[i - 1];
|
_selectedDirectoryItem = codec.CurrentDirectoryResult.CurrentDirectoryResults[i - 1];
|
||||||
|
|
||||||
if (entry is DirectoryFolder)
|
|
||||||
|
if (_selectedDirectoryItem is DirectoryFolder)
|
||||||
{
|
{
|
||||||
codec.GetDirectoryFolderContents(entry.FolderId);
|
codec.GetDirectoryFolderContents(_selectedDirectoryItem.FolderId);
|
||||||
trilist.SetUshort(joinMap.SelectedContactMethodCount.JoinNumber, 0);
|
trilist.SetUshort(joinMap.SelectedContactMethodCount.JoinNumber, 0);
|
||||||
|
trilist.SetString(joinMap.DirectorySelectedFolderName.JoinNumber, _selectedDirectoryItem.Name);
|
||||||
|
trilist.SetString(joinMap.DirectoryEntrySelectedName.JoinNumber, string.Empty);
|
||||||
|
trilist.ClearUShortSigAction(joinMap.SelectContactMethod.JoinNumber);
|
||||||
|
trilist.ClearBoolSigAction(joinMap.DirectoryDialSelectedLine.JoinNumber);
|
||||||
|
trilist.ClearBoolSigAction(joinMap.DirectoryDialSelectedContactMethod.JoinNumber);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allow auto dial of selected line
|
// not a folder. Clear this value
|
||||||
|
trilist.SetString(joinMap.DirectorySelectedFolderName.JoinNumber, string.Empty);
|
||||||
|
|
||||||
|
var selectedContact = _selectedDirectoryItem as DirectoryContact;
|
||||||
|
if (selectedContact != null)
|
||||||
|
{
|
||||||
|
trilist.SetString(joinMap.DirectoryEntrySelectedName.JoinNumber, selectedContact.Name);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Allow auto dial of selected line. Always dials first contact method
|
||||||
if (!trilist.GetBool(joinMap.DirectoryDisableAutoDialSelectedLine.JoinNumber))
|
if (!trilist.GetBool(joinMap.DirectoryDisableAutoDialSelectedLine.JoinNumber))
|
||||||
{
|
{
|
||||||
var dialableEntry = entry as IInvitableContact;
|
var invitableEntry = _selectedDirectoryItem as IInvitableContact;
|
||||||
|
|
||||||
if (dialableEntry != null)
|
if (invitableEntry != null)
|
||||||
{
|
{
|
||||||
Dial(dialableEntry);
|
Dial(invitableEntry);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var entryToDial = entry as DirectoryContact;
|
var entryToDial = _selectedDirectoryItem as DirectoryContact;
|
||||||
|
|
||||||
|
trilist.SetString(joinMap.DirectoryEntrySelectedNumber.JoinNumber, selectedContact.ContactMethods[0].Number);
|
||||||
|
|
||||||
if (entryToDial == null) return;
|
if (entryToDial == null) return;
|
||||||
|
|
||||||
@@ -1014,18 +1034,32 @@ ScreenIndexIsPinnedTo: {8} (a{17})
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// If auto dial is disabled...
|
// If auto dial is disabled...
|
||||||
var entryToDial = entry as DirectoryContact;
|
var entryToDial = _selectedDirectoryItem as DirectoryContact;
|
||||||
|
|
||||||
if (entryToDial == null)
|
if (entryToDial == null)
|
||||||
{
|
{
|
||||||
|
// Clear out values and actions from last selected item
|
||||||
trilist.SetUshort(joinMap.SelectedContactMethodCount.JoinNumber, 0);
|
trilist.SetUshort(joinMap.SelectedContactMethodCount.JoinNumber, 0);
|
||||||
|
trilist.SetString(joinMap.DirectoryEntrySelectedName.JoinNumber, string.Empty);
|
||||||
|
trilist.ClearUShortSigAction(joinMap.SelectContactMethod.JoinNumber);
|
||||||
|
trilist.ClearBoolSigAction(joinMap.DirectoryDialSelectedLine.JoinNumber);
|
||||||
|
trilist.ClearBoolSigAction(joinMap.DirectoryDialSelectedContactMethod.JoinNumber);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
trilist.SetSigFalseAction(joinMap.DirectoryDialSelectedLine.JoinNumber, () => Dial(entryToDial.ContactMethods[0].Number));
|
|
||||||
|
|
||||||
trilist.SetUshort(joinMap.SelectedContactMethodCount.JoinNumber, (ushort)entryToDial.ContactMethods.Count);
|
trilist.SetUshort(joinMap.SelectedContactMethodCount.JoinNumber, (ushort)entryToDial.ContactMethods.Count);
|
||||||
|
|
||||||
|
// Update the action to dial the selected contact method
|
||||||
|
trilist.SetUShortSigAction(joinMap.SelectContactMethod.JoinNumber, (u) =>
|
||||||
|
{
|
||||||
|
if (u < 1 || u > entryToDial.ContactMethods.Count) return;
|
||||||
|
|
||||||
|
trilist.SetSigFalseAction(joinMap.DirectoryDialSelectedContactMethod.JoinNumber, () => Dial(entryToDial.ContactMethods[u].Number));
|
||||||
|
});
|
||||||
|
|
||||||
|
// Sets DirectoryDialSelectedLine join action to dial first contact method
|
||||||
|
trilist.SetSigFalseAction(joinMap.DirectoryDialSelectedLine.JoinNumber, () => Dial(entryToDial.ContactMethods[0].Number));
|
||||||
|
|
||||||
var clearBytes = XSigHelpers.ClearOutputs();
|
var clearBytes = XSigHelpers.ClearOutputs();
|
||||||
|
|
||||||
trilist.SetString(joinMap.ContactMethods.JoinNumber,
|
trilist.SetString(joinMap.ContactMethods.JoinNumber,
|
||||||
@@ -1034,7 +1068,6 @@ ScreenIndexIsPinnedTo: {8} (a{17})
|
|||||||
|
|
||||||
trilist.SetString(joinMap.ContactMethods.JoinNumber, contactMethodsXSig);
|
trilist.SetString(joinMap.ContactMethods.JoinNumber, contactMethodsXSig);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -1599,6 +1632,7 @@ ScreenIndexIsPinnedTo: {8} (a{17})
|
|||||||
// Following fields only used for Bridging
|
// Following fields only used for Bridging
|
||||||
private int _selectedRecentCallItemIndex;
|
private int _selectedRecentCallItemIndex;
|
||||||
private CodecCallHistory.CallHistoryEntry _selectedRecentCallItem;
|
private CodecCallHistory.CallHistoryEntry _selectedRecentCallItem;
|
||||||
|
private DirectoryItem _selectedDirectoryItem;
|
||||||
|
|
||||||
private void LinkVideoCodecCallHistoryToApi(IHasCallHistory codec, BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
private void LinkVideoCodecCallHistoryToApi(IHasCallHistory codec, BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user