Compare commits

...

29 Commits

Author SHA1 Message Date
Neil Dorin
102ae3ad4f fix(essentials): second attempt to get on hold fb working 2022-02-09 16:41:37 -07:00
Neil Dorin
7dd6b3a9b6 fix(essentials): fixes index off by 1 error and updates call status to check for "OnHold" as status value 2022-02-09 16:31:31 -07:00
Neil Dorin
e24965eb54 fix(essentials): fixes ValueChagnedAction to run both feedback updates instead of one 2022-02-09 15:37:55 -07:00
Neil Dorin
9d80954214 fix(essentials): Adds check for SendingMode property value before attempting to set fb 2022-02-09 15:10:39 -07:00
Jonathan Arndt
70c5df9040 Removed add camera to device manager 2022-02-09 14:09:07 -08:00
Neil Dorin
89a7f2aa80 fix(essentials): Add a condition to check for an empty configuration.presentation object response and return to avoid null ref ex 2022-02-09 14:54:19 -07:00
Neil Dorin
90023621dc fix(essentials): Adds some better console log comments and calls SetUpCameras() after reading data from codec. 2022-02-09 14:48:45 -07:00
Neil Dorin
adbce916ba feat(essentials): Adds ability to read camera info from codec rather than just from config 2022-02-09 14:34:25 -07:00
Neil Dorin
b97783603b feat(essentials): Adds analog fb join for recent calls count to VideoCodecControllerJoinMap and bridge 2022-02-09 14:14:44 -07:00
Neil Dorin
db526cdd40 fix(essentials): fixes exception when parsing presentation local instance ghosted response 2022-02-09 14:09:54 -07:00
Neil Dorin
db982f4490 feat(essentials): Adds ability to select and dial contact methods for directory contacts via SIMPL bridge 2022-02-09 14:00:49 -07:00
Jonathan Arndt
c84525ddef Update recent call history and call method to protect for zero value from SIMPL 2022-02-09 11:39:35 -08:00
Jonathan Arndt
faabdde3f7 Update VideoCodecBase class UpdateDirectoryXSig method removing the check if the FolderId is null or empty as that check would be device specific 2022-02-08 16:31:45 -08:00
Jonathan Arndt
402754b69e Update VideoCodecBase class UpdateDirectoryXSig method removing the check if the FolderId is null or empty as that check would be device specific 2022-02-08 16:31:26 -08:00
Jonathan Arndt
84b39a959e Update VideoCodecBase class UpdateDirectoryXSig method removing the check if the FolderId is null or empty as that check would be device specific 2022-02-08 16:31:18 -08:00
Jonathan Arndt
93bfcc7baa Add logic to subscribe to PhoneBookSyncState during the CustomActivate method within CiscoSparkCodec class 2022-02-08 16:24:54 -08:00
Jonathan Arndt
64352811c5 Update VideoCodecBase.LinkVideoCodecCameraToApi FOR loop checking camera names to first check camera count 2022-02-08 13:31:13 -08:00
Jonathan Arndt
b5589364ff Instantiate xConfiguration members of Configuration, AutoAnswer, and Conference classes 2022-02-08 12:15:29 -08:00
Neil Dorin
611f0bec2e fix(essentials): #865 Adds DialselectedRecentCallItem join 2021-12-07 19:40:03 -07:00
Neil Dorin
90e22e9136 fix(essentials): #865 Adds SelectedContactMethodCount join to report the number of methods for the selected contact 2021-12-07 16:45:14 -07:00
Neil Dorin
4552a15cbb fix(essentials): #865 Updates to join map and bridging based on feedback from testing 2021-12-07 16:22:15 -07:00
Neil Dorin
c685608f67 fix(essentials): reworks logic for setting up cameras to wait until codec communication sync has finished 2021-11-17 12:24:58 -07:00
Neil Dorin
cdafaf1bcb fix(essentials): Adds missing constructor for Configuration RootObject 2021-11-17 11:37:29 -07:00
Neil Dorin
d8aef1a0da feat(essentials): #865 More updates
Adds ability to disable auto dialing behavior of selected directory contact.
Adds XSig to send contact method info across bridge
Adds XSig to send call history data across bridge and also joins to manipulate
2021-11-12 22:07:11 -07:00
Neil Dorin
0ff29695e7 feat(essentials): #865 Updates join map and bridge for new features
Adds control and feedback for presentation source
Updates camera setup, selection and feedback
Adds ringtone volume control/feedback
Adds call hold/resume/join control to bridge
Adds new config properties for camera info
2021-11-11 21:05:57 -07:00
Neil Dorin
8aae23db9e feat(essentials): #865 Updates to Bridging
Adds ability to end individual calls, report connected call count, report call duration and hold status, send DTMF tones to individual call index and select far end presets
2021-11-11 17:23:11 -07:00
Neil Dorin
a043309bb1 feat(essentials): More updates to add ringtone volume and focus near/far to bridge 2021-11-10 18:02:23 -07:00
Neil Dorin
dc53ce42e7 feat(essentials): Adds interface and implementation to join calls 2021-11-10 14:08:12 -07:00
Neil Dorin
6dd882b1a0 feat(essentials): Adds hold/resume/duration features to call status 2021-11-10 13:49:43 -07:00
17 changed files with 1736 additions and 236 deletions

View File

@@ -22,7 +22,7 @@ env:
RELEASE_BRANCH: main
jobs:
Build_Project:
runs-on: windows-latest
runs-on: windows-2019
steps:
# First we checkout the source repo
- name: Checkout repo
@@ -98,7 +98,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Push_Nuget_Package:
needs: Build_Project
runs-on: windows-latest
runs-on: windows-2019
steps:
- name: Download Build Version Info
uses: actions/download-artifact@v1

View File

@@ -19,7 +19,7 @@ env:
RELEASE_BRANCH: main
jobs:
Build_Project:
runs-on: windows-latest
runs-on: windows-2019
steps:
# First we checkout the source repo
- name: Checkout repo
@@ -82,7 +82,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Push_Nuget_Package:
needs: Build_Project
runs-on: windows-latest
runs-on: windows-2019
steps:
- name: Download Build Version Info
uses: actions/download-artifact@v1

View File

@@ -20,7 +20,21 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
JoinType = eJoinType.Digital
});
[JoinName("1")]
[JoinName("SendDtmfToSpecificCallIndex")]
public JoinDataComplete SendDtmfToSpecificCallIndex = new JoinDataComplete(
new JoinData
{
JoinNumber = 10,
JoinSpan = 1
},
new JoinMetadata
{
Description = "If High, will send DTMF tones to the call set by SelectCall analog. If low sends DTMF tones to last connected call.",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("Dtmf1")]
public JoinDataComplete Dtmf1 = new JoinDataComplete(
new JoinData
{
@@ -34,7 +48,7 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
JoinType = eJoinType.Digital
});
[JoinName("2")]
[JoinName("Dtmf2")]
public JoinDataComplete Dtmf2 = new JoinDataComplete(
new JoinData
{
@@ -48,7 +62,7 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
JoinType = eJoinType.Digital
});
[JoinName("3")]
[JoinName("Dtmf3")]
public JoinDataComplete Dtmf3 = new JoinDataComplete(
new JoinData
{
@@ -62,7 +76,7 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
JoinType = eJoinType.Digital
});
[JoinName("4")]
[JoinName("Dtmf4")]
public JoinDataComplete Dtmf4 = new JoinDataComplete(
new JoinData
{
@@ -76,7 +90,7 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
JoinType = eJoinType.Digital
});
[JoinName("5")]
[JoinName("Dtmf5")]
public JoinDataComplete Dtmf5 = new JoinDataComplete(
new JoinData
{
@@ -90,7 +104,7 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
JoinType = eJoinType.Digital
});
[JoinName("6")]
[JoinName("Dtmf6")]
public JoinDataComplete Dtmf6 = new JoinDataComplete(
new JoinData
{
@@ -104,7 +118,7 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
JoinType = eJoinType.Digital
});
[JoinName("7")]
[JoinName("Dtmf7")]
public JoinDataComplete Dtmf7 = new JoinDataComplete(
new JoinData
{
@@ -118,7 +132,7 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
JoinType = eJoinType.Digital
});
[JoinName("8")]
[JoinName("Dtmf8")]
public JoinDataComplete Dtmf8 = new JoinDataComplete(
new JoinData
{
@@ -132,7 +146,7 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
JoinType = eJoinType.Digital
});
[JoinName("9")]
[JoinName("Dtmf9")]
public JoinDataComplete Dtmf9 = new JoinDataComplete(
new JoinData
{
@@ -146,7 +160,7 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
JoinType = eJoinType.Digital
});
[JoinName("0")]
[JoinName("Dtmf0")]
public JoinDataComplete Dtmf0 = new JoinDataComplete(
new JoinData
{
@@ -160,7 +174,7 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
JoinType = eJoinType.Digital
});
[JoinName("*")]
[JoinName("DtmfStar")]
public JoinDataComplete DtmfStar = new JoinDataComplete(
new JoinData
{
@@ -174,7 +188,7 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
JoinType = eJoinType.Digital
});
[JoinName("#")]
[JoinName("DtmfPound")]
public JoinDataComplete DtmfPound = new JoinDataComplete(
new JoinData
{
@@ -188,8 +202,8 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
JoinType = eJoinType.Digital
});
[JoinName("EndCall")]
public JoinDataComplete EndCall = new JoinDataComplete(
[JoinName("EndAllCalls")]
public JoinDataComplete EndAllCalls = new JoinDataComplete(
new JoinData
{
JoinNumber = 24,
@@ -197,7 +211,7 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
},
new JoinMetadata
{
Description = "Hang Up",
Description = "End All Calls",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
@@ -226,7 +240,7 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
new JoinMetadata
{
Description = "Speed Dial",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
@@ -281,12 +295,12 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
},
new JoinMetadata
{
Description = "Dial manual string",
Description = "Dial manual string specified by CurrentDialString serial join",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("DialPhoneCall")]
[JoinName("DialPhone")]
public JoinDataComplete DialPhone = new JoinDataComplete(
new JoinData
{
@@ -314,7 +328,7 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
JoinType = eJoinType.Digital
});
[JoinName("EndPhoneCall")]
[JoinName("HangUpPhone")]
public JoinDataComplete HangUpPhone = new JoinDataComplete(
new JoinData
{
@@ -323,11 +337,53 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
},
new JoinMetadata
{
Description = "Hang Up PHone",
Description = "Hang Up Phone",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("EndCallStart")]
public JoinDataComplete EndCallStart = new JoinDataComplete(
new JoinData
{
JoinNumber = 81,
JoinSpan = 8
},
new JoinMetadata
{
Description = "End a specific call by call index. ",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("JoinAllCalls")]
public JoinDataComplete JoinAllCalls = new JoinDataComplete(
new JoinData
{
JoinNumber = 90,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Join all calls",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("JoinCallStart")]
public JoinDataComplete JoinCallStart = new JoinDataComplete(
new JoinData
{
JoinNumber = 91,
JoinSpan = 8
},
new JoinMetadata
{
Description = "Join a specific call by call index. ",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("DirectorySearchBusy")]
public JoinDataComplete DirectorySearchBusy = new JoinDataComplete(
new JoinData
@@ -408,7 +464,7 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
new JoinMetadata
{
Description = "Go to Directory Root",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
@@ -440,6 +496,33 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
JoinType = eJoinType.Digital
});
[JoinName("DirectoryDisableAutoDialSelectedLine")]
public JoinDataComplete DirectoryDisableAutoDialSelectedLine = new JoinDataComplete(
new JoinData
{
JoinNumber = 107,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Set high to disable automatic dialing of a contact when selected",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
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")]
public JoinDataComplete CameraTiltUp = new JoinDataComplete(
@@ -525,6 +608,48 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
JoinType = eJoinType.Digital
});
[JoinName("CameraFocusNear")]
public JoinDataComplete CameraFocusNear = new JoinDataComplete(
new JoinData
{
JoinNumber = 117,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Camera Focus Near",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraFocusFar")]
public JoinDataComplete CameraFocusFar = new JoinDataComplete(
new JoinData
{
JoinNumber = 118,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Camera Focus Far",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraFocusAuto")]
public JoinDataComplete CameraFocusAuto = new JoinDataComplete(
new JoinData
{
JoinNumber = 119,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Camera Auto Focus Trigger",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraPresetSave")]
public JoinDataComplete CameraPresetSave = new JoinDataComplete(
new JoinData
@@ -534,7 +659,7 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
},
new JoinMetadata
{
Description = "Save Selected Preset",
Description = "Pulse to save selected preset spcified by CameraPresetSelect analog join. FB will pulse for 3s when preset saved.",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
@@ -548,7 +673,7 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
},
new JoinMetadata
{
Description = "Camera Mode Auto",
Description = "Camera Mode Auto. Enables camera auto tracking mode, with feedback",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
@@ -562,7 +687,7 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
},
new JoinMetadata
{
Description = "Camera Mode Manual",
Description = "Camera Mode Manual. Disables camera auto tracking mode, with feedback",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
@@ -576,7 +701,7 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
},
new JoinMetadata
{
Description = "Camera Mode Off",
Description = "Camera Mode Off. Disables camera video, with feedback. Works like video mute.",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
@@ -805,6 +930,34 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
JoinType = eJoinType.Digital
});
[JoinName("RemoveSelectedRecentCallItem")]
public JoinDataComplete RemoveSelectedRecentCallItem = new JoinDataComplete(
new JoinData
{
JoinNumber = 181,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Pulse to remove the selected recent call item specified by the SelectRecentCallItem analog join",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("DialSelectedRecentCallItem")]
public JoinDataComplete DialSelectedRecentCallItem = new JoinDataComplete(
new JoinData
{
JoinNumber = 182,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Pulse to dial the selected recent call item specified by the SelectRecentCallItem analog join",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("SourceShareStart")]
public JoinDataComplete SourceShareStart = new JoinDataComplete(
new JoinData
@@ -870,11 +1023,67 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
},
new JoinMetadata
{
Description = "advance selfview position",
Description = "Toggles selfview position",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("HoldCallsStart")]
public JoinDataComplete HoldCallsStart = new JoinDataComplete(
new JoinData
{
JoinNumber = 221,
JoinSpan = 8
},
new JoinMetadata
{
Description = "Holds Call at specified index. FB reported on Call Status XSIG",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("ResumeCallsStart")]
public JoinDataComplete ResumeCallsStart = new JoinDataComplete(
new JoinData
{
JoinNumber = 231,
JoinSpan = 8
},
new JoinMetadata
{
Description = "Resume Call at specified index",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("MultiSiteOptionIsEnabled")]
public JoinDataComplete MultiSiteOptionIsEnabled = new JoinDataComplete(
new JoinData
{
JoinNumber = 301,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Multi site option is enabled FB",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("AutoAnswerEnabled")]
public JoinDataComplete AutoAnswerEnabled = new JoinDataComplete(
new JoinData
{
JoinNumber = 302,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Auto Answer is enabled FB",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("ParticipantAudioMuteToggleStart")]
public JoinDataComplete ParticipantAudioMuteToggleStart = new JoinDataComplete(
new JoinData
@@ -924,6 +1133,35 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
#region Analog
[JoinName("SelectCall")]
public JoinDataComplete SelectCall = new JoinDataComplete(
new JoinData
{
JoinNumber = 24,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Sets the selected Call for DTMF commands. Valid values 1-8",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Analog
});
[JoinName("ConnectedCallCount")]
public JoinDataComplete ConnectedCallCount = new JoinDataComplete(
new JoinData
{
JoinNumber = 25,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Reports the number of currently connected calls",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Analog
});
[JoinName("MinutesBeforeMeetingStart")]
public JoinDataComplete MinutesBeforeMeetingStart = new JoinDataComplete(
new JoinData
@@ -947,11 +1185,25 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
},
new JoinMetadata
{
Description = "Camera Number Select/FB",
Description = "Camera Number Select/FB. 1 based index. Valid range is 1 to the value reported by CameraCount.",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Analog
});
[JoinName("CameraCount")]
public JoinDataComplete CameraCount = new JoinDataComplete(
new JoinData
{
JoinNumber = 61,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Reports the number of cameras",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Analog
});
[JoinName("DirectoryRowCount")]
public JoinDataComplete DirectoryRowCount = new JoinDataComplete(
new JoinData
@@ -980,6 +1232,34 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
JoinType = eJoinType.Analog
});
[JoinName("SelectedContactMethodCount")]
public JoinDataComplete SelectedContactMethodCount = new JoinDataComplete(
new JoinData
{
JoinNumber = 102,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Reports the number of contact methods for the selected contact",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
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")]
public JoinDataComplete CameraPresetSelect = new JoinDataComplete(
new JoinData
@@ -990,10 +1270,24 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
new JoinMetadata
{
Description = "Camera Preset Select",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Analog
});
[JoinName("FarEndPresetSelect")]
public JoinDataComplete FarEndPresetSelect = new JoinDataComplete(
new JoinData
{
JoinNumber = 122,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Far End Preset Preset Select",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Analog
});
[JoinName("ParticipantCount")]
public JoinDataComplete ParticipantCount = new JoinDataComplete(
new JoinData
@@ -1036,6 +1330,48 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
JoinType = eJoinType.Analog
});
[JoinName("SelectRecentCallItem")]
public JoinDataComplete SelectRecentCallItem = new JoinDataComplete(
new JoinData
{
JoinNumber = 180,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Select/FB for Recent Call Item. Valid values 1 - 10",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Analog
});
[JoinName("RecentCallOccurrenceType")]
public JoinDataComplete RecentCallOccurrenceType = new JoinDataComplete(
new JoinData
{
JoinNumber = 181,
JoinSpan = 10
},
new JoinMetadata
{
Description = "Recent Call Occurrence Type. [0-3] 0 = Unknown, 1 = Placed, 2 = Received, 3 = NoAnswer",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Analog
});
[JoinName("RecentCallCount")]
public JoinDataComplete RecentCallCount = new JoinDataComplete(
new JoinData
{
JoinNumber = 191,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Recent Call Count",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Analog
});
#endregion
@@ -1051,12 +1387,12 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
},
new JoinMetadata
{
Description = "Current Dial String",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
Description = "Value to dial when ManualDial digital join is pulsed",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("PhoneString")]
[JoinName("PhoneDialString")]
public JoinDataComplete PhoneDialString = new JoinDataComplete(
new JoinData
{
@@ -1070,7 +1406,7 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
JoinType = eJoinType.Serial
});
[JoinName("CurrentCallName")]
[JoinName("CurrentCallData")]
public JoinDataComplete CurrentCallData = new JoinDataComplete(
new JoinData
{
@@ -1169,6 +1505,20 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
JoinType = eJoinType.Serial
});
[JoinName("ContactMethods")]
public JoinDataComplete ContactMethods = new JoinDataComplete(
new JoinData
{
JoinNumber = 103,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Contact Methods - XSig, 10 entries",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("CameraPresetNames")]
public JoinDataComplete CameraPresetNames = new JoinDataComplete(
new JoinData
@@ -1183,8 +1533,8 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
JoinType = eJoinType.Serial
});
[JoinName("CameraLayoutStringFb")]
public JoinDataComplete CameraLayoutStringFb = new JoinDataComplete(
[JoinName("CurrentLayoutStringFb")]
public JoinDataComplete CurrentLayoutStringFb = new JoinDataComplete(
new JoinData
{
JoinNumber = 141,
@@ -1211,6 +1561,76 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
JoinType = eJoinType.Serial
});
[JoinName("CameraNamesFb")]
public JoinDataComplete CameraNamesFb = new JoinDataComplete(
new JoinData
{
JoinNumber = 161,
JoinSpan = 10
},
new JoinMetadata
{
Description = "Camera Name Fb",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("SelectedRecentCallName")]
public JoinDataComplete SelectedRecentCallName = new JoinDataComplete(
new JoinData
{
JoinNumber = 171,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Selected Recent Call Name",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("SelectedRecentCallNumber")]
public JoinDataComplete SelectedRecentCallNumber = new JoinDataComplete(
new JoinData
{
JoinNumber = 172,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Selected Recent Call Number",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("RecentCallNamesStart")]
public JoinDataComplete RecentCallNamesStart = new JoinDataComplete(
new JoinData
{
JoinNumber = 181,
JoinSpan = 10
},
new JoinMetadata
{
Description = "Recent Call Names",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("RecentCallTimesStart")]
public JoinDataComplete RecentCallTimesStart = new JoinDataComplete(
new JoinData
{
JoinNumber = 191,
JoinSpan = 10
},
new JoinMetadata
{
Description = "Recent Calls Times",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("CurrentSource")]
public JoinDataComplete CurrentSource = new JoinDataComplete(
new JoinData
@@ -1237,7 +1657,77 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
Description = "advance selfview position",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
});
[JoinName("DeviceIpAddresss")]
public JoinDataComplete DeviceIpAddresss = new JoinDataComplete(
new JoinData
{
JoinNumber = 301,
JoinSpan = 1
},
new JoinMetadata
{
Description = "IP Address of device",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("SipPhoneNumber")]
public JoinDataComplete SipPhoneNumber = new JoinDataComplete(
new JoinData
{
JoinNumber = 302,
JoinSpan = 1
},
new JoinMetadata
{
Description = "SIP phone number of device",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("E164Alias")]
public JoinDataComplete E164Alias = new JoinDataComplete(
new JoinData
{
JoinNumber = 303,
JoinSpan = 1
},
new JoinMetadata
{
Description = "E164 alias of device",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("H323Id")]
public JoinDataComplete H323Id = new JoinDataComplete(
new JoinData
{
JoinNumber = 304,
JoinSpan = 1
},
new JoinMetadata
{
Description = "H323 ID of device",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("SipUri")]
public JoinDataComplete SipUri = new JoinDataComplete(
new JoinData
{
JoinNumber = 305,
JoinSpan = 1
},
new JoinMetadata
{
Description = "SIP URI of device",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("DirectoryEntrySelectedName")]
public JoinDataComplete DirectoryEntrySelectedName = new JoinDataComplete(

View File

@@ -12,34 +12,40 @@ namespace PepperDash.Essentials.Devices.Common.Codec
{
public class CodecActiveCallItem
{
[JsonProperty("name")]
[JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
public string Name { get; set; }
[JsonProperty("number")]
[JsonProperty("number", NullValueHandling = NullValueHandling.Ignore)]
public string Number { get; set; }
[JsonProperty("type")]
[JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(StringEnumConverter))]
public eCodecCallType Type { get; set; }
[JsonProperty("status")]
[JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(StringEnumConverter))]
public eCodecCallStatus Status { get; set; }
[JsonProperty("direction")]
[JsonProperty("direction", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(StringEnumConverter))]
public eCodecCallDirection Direction { get; set; }
[JsonProperty("id")]
[JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)]
public string Id { get; set; }
[JsonProperty("isOnHold", NullValueHandling = NullValueHandling.Ignore)]
public bool IsOnHold { get; set; }
[JsonProperty("duration", NullValueHandling = NullValueHandling.Ignore)]
public TimeSpan Duration { get; set; }
//public object CallMetaData { get; set; }
/// <summary>
/// Returns true when this call is any status other than
/// Unknown, Disconnected, Disconnecting
/// </summary>
[JsonProperty("isActiveCall")]
[JsonProperty("isActiveCall", NullValueHandling = NullValueHandling.Ignore)]
public bool IsActiveCall
{
get

View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Devices.Common.Codec
{
public interface IHasCallHold
{
/// <summary>
/// Put the specified call on hold
/// </summary>
/// <param name="activeCall"></param>
void HoldCall(CodecActiveCallItem activeCall);
/// <summary>
/// Resume the specified call
/// </summary>
/// <param name="activeCall"></param>
void ResumeCall(CodecActiveCallItem activeCall);
}
}

View File

@@ -23,9 +23,9 @@ namespace PepperDash.Essentials.Devices.Common.Codec
public enum eCodecOccurrenceType
{
Unknown = 0,
Placed,
Received,
NoAnswer
Placed = 1,
Received = 2,
NoAnswer = 3,
}
/// <summary>

View File

@@ -108,6 +108,7 @@
<Compile Include="Codec\eCodecCallStatus.cs" />
<Compile Include="Codec\eMeetingPrivacy.cs" />
<Compile Include="Codec\iCodecAudio.cs" />
<Compile Include="Codec\IHasCallHold.cs" />
<Compile Include="Codec\IHasDoNotDisturb.cs" />
<Compile Include="Codec\IHasExternalSourceSwitching.cs" />
<Compile Include="ImageProcessors\TVOneCorio.cs" />
@@ -129,6 +130,7 @@
<Compile Include="VideoCodec\Interfaces\IHasSelfviewSize.cs" />
<Compile Include="VideoCodec\Interfaces\IHasStandbyMode.cs" />
<Compile Include="VideoCodec\Interfaces\IHasStartMeeting.cs" />
<Compile Include="VideoCodec\Interfaces\IJoinCalls.cs" />
<Compile Include="VideoCodec\Interfaces\iVideoCodecInfo.cs" />
<Compile Include="Codec\iHasCallFavorites.cs" />
<Compile Include="Codec\iHasCallHistory.cs" />

View File

@@ -116,7 +116,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
/// <summary>
/// The ID of the camera on the codec
/// </summary>
protected uint CameraId { get; private set; }
public uint CameraId { get; private set; }
/// <summary>
/// Valid range 1-15

View File

@@ -9,11 +9,39 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
{
#region Digital
[JoinName("PresentationLocalOnly")]
public JoinDataComplete PresentationLocalOnly = new JoinDataComplete(
new JoinData
{
JoinNumber = 205,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Presentation Local Only Feedback",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("PresentationLocalRemote")]
public JoinDataComplete PresentationLocalRemote = new JoinDataComplete(
new JoinData
{
JoinNumber = 206,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Presentation Local and Remote Feedback",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("ActivateDoNotDisturbMode")]
public JoinDataComplete ActivateDoNotDisturbMode = new JoinDataComplete(
new JoinData
{
JoinNumber = 221,
JoinNumber = 241,
JoinSpan = 1
},
new JoinMetadata
@@ -27,7 +55,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public JoinDataComplete DeactivateDoNotDisturbMode = new JoinDataComplete(
new JoinData
{
JoinNumber = 222,
JoinNumber = 242,
JoinSpan = 1
},
new JoinMetadata
@@ -41,7 +69,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public JoinDataComplete ToggleDoNotDisturbMode = new JoinDataComplete(
new JoinData
{
JoinNumber = 223,
JoinNumber = 243,
JoinSpan = 1
},
new JoinMetadata
@@ -55,7 +83,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public JoinDataComplete ActivateStandby = new JoinDataComplete(
new JoinData
{
JoinNumber = 226,
JoinNumber = 246,
JoinSpan = 1
},
new JoinMetadata
@@ -69,7 +97,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public JoinDataComplete DeactivateStandby = new JoinDataComplete(
new JoinData
{
JoinNumber = 227,
JoinNumber = 247,
JoinSpan = 1
},
new JoinMetadata
@@ -83,7 +111,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public JoinDataComplete ActivateHalfWakeMode = new JoinDataComplete(
new JoinData
{
JoinNumber = 228,
JoinNumber = 248,
JoinSpan = 1
},
new JoinMetadata
@@ -97,7 +125,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public JoinDataComplete EnteringStandbyMode = new JoinDataComplete(
new JoinData
{
JoinNumber = 229,
JoinNumber = 249,
JoinSpan = 1
},
new JoinMetadata
@@ -112,12 +140,55 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
#region Analog
[JoinName("RingtoneVolume")]
public JoinDataComplete RingtoneVolume = new JoinDataComplete(
new JoinData
{
JoinNumber = 21,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Ringtone volume set/FB. Valid values are 0 - 100 in increments of 5 (5, 10, 15, 20, etc.)",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Analog
});
[JoinName("PresentationSource")]
public JoinDataComplete PresentationSource = new JoinDataComplete(
new JoinData
{
JoinNumber = 201,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Presentation set/FB. Valid values are 0 - 6 depending on the codec model.",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Analog
});
#endregion
#region Serials
[JoinName("CommandToDevice")]
public JoinDataComplete CommandToDevice = new JoinDataComplete(
new JoinData
{
JoinNumber = 5,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Sends a serial command to the device. Do not include the delimiter, it will be added automatically.",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Serial
});
#endregion

View File

@@ -30,8 +30,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
IHasScheduleAwareness, IOccupancyStatusProvider, IHasCodecLayouts, IHasCodecSelfView,
ICommunicationMonitor, IRouting, IHasCodecCameras, IHasCameraAutoMode, IHasCodecRoomPresets,
IHasExternalSourceSwitching, IHasBranding, IHasCameraOff, IHasCameraMute, IHasDoNotDisturbMode,
IHasHalfWakeMode
IHasHalfWakeMode, IHasCallHold, IJoinCalls
{
private CiscoSparkCodecPropertiesConfig _config;
private bool _externalSourceChangeRequested;
public event EventHandler<DirectoryEventArgs> DirectoryResultReturned;
@@ -42,11 +44,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public StatusMonitorBase CommunicationMonitor { get; private set; }
private GenericQueue ReceiveQueue;
private GenericQueue _receiveQueue;
public BoolFeedback PresentationViewMaximizedFeedback { get; private set; }
string CurrentPresentationView;
private string _currentPresentationView;
public BoolFeedback RoomIsOccupiedFeedback { get; private set; }
@@ -64,9 +66,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public BoolFeedback FarEndIsSharingContentFeedback { get; private set; }
private CodecCommandWithLabel CurrentSelfviewPipPosition;
public IntFeedback RingtoneVolumeFeedback { get; private set; }
private CodecCommandWithLabel CurrentLocalLayout;
private CodecCommandWithLabel _currentSelfviewPipPosition;
private CodecCommandWithLabel _currentLocalLayout;
/// <summary>
/// List the available positions for the selfview PIP window
@@ -165,7 +169,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
{
get
{
return () => PresentationSourceKey;
return () => _presentationSourceKey;
}
}
@@ -229,7 +233,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
{
get
{
return () => CurrentSelfviewPipPosition.Label;
return () => _currentSelfviewPipPosition.Label;
}
}
@@ -237,7 +241,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
{
get
{
return () => CurrentLocalLayout.Label;
return () => _currentLocalLayout.Label;
}
}
@@ -245,43 +249,58 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
{
get
{
return () => CurrentLocalLayout.Label == "Prominent";
return () => _currentLocalLayout.Label == "Prominent";
}
}
private string CliFeedbackRegistrationExpression;
private string _cliFeedbackRegistrationExpression;
private CodecSyncState SyncState;
private CodecSyncState _syncState;
public CodecPhonebookSyncState PhonebookSyncState { get; private set; }
private StringBuilder JsonMessage;
private StringBuilder _jsonMessage;
private bool JsonFeedbackMessageIsIncoming;
private bool _jsonFeedbackMessageIsIncoming;
public bool CommDebuggingIsOn;
string Delimiter = "\r\n";
public IntFeedback PresentationSourceFeedback { get; private set; }
public BoolFeedback PresentationSendingLocalOnlyFeedback { get; private set; }
public BoolFeedback PresentationSendingLocalRemoteFeedback { get; private set; }
/// <summary>
/// Used to track the current connector used for the presentation source
/// </summary>
int PresentationSource;
private int _presentationSource;
string PresentationSourceKey;
/// <summary>
/// Used to track the connector that is desired to be the current presentation source (until the command is send)
/// </summary>
private int _desiredPresentationSource;
string PhonebookMode = "Local"; // Default to Local
private string _presentationSourceKey;
uint PhonebookResultsLimit = 255; // Could be set later by config.
private bool _presentationLocalOnly;
CTimer LoginMessageReceivedTimer;
CTimer RetryConnectionTimer;
private bool _presentationLocalRemote;
private string _phonebookMode = "Local"; // Default to Local
private uint _phonebookResultsLimit = 255; // Could be set later by config.
private CTimer _loginMessageReceivedTimer;
private CTimer _retryConnectionTimer;
// **___________________________________________________________________**
// Timers to be moved to the global system timer at a later point....
CTimer BookingsRefreshTimer;
CTimer PhonebookRefreshTimer;
private CTimer BookingsRefreshTimer;
private CTimer PhonebookRefreshTimer;
// **___________________________________________________________________**
public RoutingInputPort CodecOsdIn { get; private set; }
@@ -297,14 +316,16 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
{
var props = JsonConvert.DeserializeObject<Codec.CiscoSparkCodecPropertiesConfig>(config.Properties.ToString());
_config = props;
// Use the configured phonebook results limit if present
if (props.PhonebookResultsLimit > 0)
{
PhonebookResultsLimit = props.PhonebookResultsLimit;
_phonebookResultsLimit = props.PhonebookResultsLimit;
}
// The queue that will collect the repsonses in the order they are received
ReceiveQueue = new GenericQueue(this.Key + "-rxQueue", 25);
_receiveQueue = new GenericQueue(this.Key + "-rxQueue", 25);
RoomIsOccupiedFeedback = new BoolFeedback(RoomIsOccupiedFeedbackFunc);
PeopleCountFeedback = new IntFeedback(PeopleCountFeedbackFunc);
@@ -322,7 +343,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
HalfWakeModeIsOnFeedback = new BoolFeedback(() => CodecStatus.Status.Standby.State.Value.ToLower() == "halfwake");
EnteringStandbyModeFeedback = new BoolFeedback(() => CodecStatus.Status.Standby.State.Value.ToLower() == "enteringstandby");
PresentationViewMaximizedFeedback = new BoolFeedback(() => CurrentPresentationView == "Maximized");
PresentationViewMaximizedFeedback = new BoolFeedback(() => _currentPresentationView == "Maximized");
RingtoneVolumeFeedback = new IntFeedback(() => CodecConfiguration.Configuration.Audio.SoundsAndAlerts.RingVolume.Volume);
PresentationSourceFeedback = new IntFeedback(() => _presentationSource);
PresentationSendingLocalOnlyFeedback = new BoolFeedback(() => _presentationLocalOnly);
PresentationSendingLocalRemoteFeedback = new BoolFeedback(() => _presentationLocalRemote);
Communication = comm;
@@ -342,13 +369,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
DeviceManager.AddDevice(CommunicationMonitor);
PhonebookMode = props.PhonebookMode;
_phonebookMode = props.PhonebookMode;
SyncState = new CodecSyncState(Key + "--Sync");
_syncState = new CodecSyncState(Key + "--Sync");
PhonebookSyncState = new CodecPhonebookSyncState(Key + "--PhonebookSync");
SyncState.InitialSyncCompleted += new EventHandler<EventArgs>(SyncState_InitialSyncCompleted);
_syncState.InitialSyncCompleted += new EventHandler<EventArgs>(SyncState_InitialSyncCompleted);
PortGather = new CommunicationGather(Communication, Delimiter);
PortGather.IncludeDelimiter = true;
@@ -394,9 +421,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
InputPorts.Add(HdmiIn2);
InputPorts.Add(HdmiIn3);
OutputPorts.Add(HdmiOut1);
SetUpCameras();
CreateOsdSource();
ExternalSourceListEnabled = props.ExternalSourceListEnabled;
@@ -432,10 +456,15 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
CodecStatus.Status.Video.Selfview.Mode.ValueChangedAction = SelfviewIsOnFeedback.FireUpdate;
CodecStatus.Status.Video.Selfview.PIPPosition.ValueChangedAction = ComputeSelfviewPipStatus;
CodecStatus.Status.Video.Layout.LayoutFamily.Local.ValueChangedAction = ComputeLocalLayout;
CodecStatus.Status.Conference.Presentation.Mode.ValueChangedAction = SharingContentIsOnFeedback.FireUpdate;
CodecStatus.Status.Conference.Presentation.Mode.ValueChangedAction = FarEndIsSharingContentFeedback.FireUpdate;
CodecStatus.Status.Conference.Presentation.Mode.ValueChangedAction = () =>
{
SharingContentIsOnFeedback.FireUpdate();
FarEndIsSharingContentFeedback.FireUpdate();
};
CodecStatus.Status.Conference.DoNotDisturb.ValueChangedAction = DoNotDisturbModeIsOnFeedback.FireUpdate;
CodecConfiguration.Configuration.Audio.SoundsAndAlerts.RingVolume.ValueChangedAction = RingtoneVolumeFeedback.FireUpdate;
try
{
CodecStatus.Status.Video.Input.MainVideoMute.ValueChangedAction = CameraIsOffFeedback.FireUpdate;
@@ -564,9 +593,16 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
CrestronConsole.AddNewConsoleCommand(GetPhonebook, "GetCodecPhonebook", "Triggers a refresh of the codec phonebook", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(GetBookings, "GetCodecBookings", "Triggers a refresh of the booking data for today", ConsoleAccessLevelEnum.AccessOperator);
PhonebookSyncState.InitialSyncCompleted += new EventHandler<EventArgs>(PhonebookSyncState_InitialSyncCompleted);
return base.CustomActivate();
}
void PhonebookSyncState_InitialSyncCompleted(object sender, EventArgs e)
{
OnDirectoryResultReturned(DirectoryRoot);
}
#region Overrides of Device
public override void Initialize()
@@ -583,7 +619,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
const string prefix = "xFeedback register ";
CliFeedbackRegistrationExpression =
_cliFeedbackRegistrationExpression =
prefix + "/Configuration" + Delimiter +
prefix + "/Status/Audio" + Delimiter +
prefix + "/Status/Call" + Delimiter +
@@ -613,8 +649,36 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
/// <param name="e"></param>
void SyncState_InitialSyncCompleted(object sender, EventArgs e)
{
// Fire the ready event
SetIsReady();
// Check for camera config info first
if (_config.CameraInfo.Count > 0)
{
Debug.Console(0, this, "Reading codec cameraInfo from config properties.");
SetUpCameras(_config.CameraInfo);
}
else
{
Debug.Console(0, this, "No cameraInfo defined in video codec config. Attempting to get camera info from codec status data");
try
{
var cameraInfo = new List<CameraInfo>();
foreach (var camera in CodecStatus.Status.Cameras.Camera)
{
var id = Convert.ToUInt16(camera.id);
var info = new CameraInfo() { CameraNumber = id, Name = string.Format("{0} {1}", camera.Manufacturer, camera.Model), SourceId = camera.DetectedConnector.ConnectorId };
cameraInfo.Add(info);
}
Debug.Console(0, this, "Successfully got cameraInfo for {0} cameras from codec.", cameraInfo.Count);
SetUpCameras(cameraInfo);
}
catch (Exception ex)
{
Debug.Console(2, this, "Error generating camera info from codec status data: {0}", ex);
}
}
//CommDebuggingIsOn = false;
GetCallHistory();
@@ -624,6 +688,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
BookingsRefreshTimer = new CTimer(GetBookings, 900000, 900000); // 15 minute timer to check for new booking info
GetBookings(null);
// Fire the ready event
SetIsReady();
}
public void SetCommDebug(string s)
@@ -645,12 +712,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
Debug.Console(1, this, "Socket status change {0}", e.Client.ClientStatus);
if (e.Client.IsConnected)
{
if(!SyncState.LoginMessageWasReceived)
LoginMessageReceivedTimer = new CTimer(o => DisconnectClientAndReconnect(), 5000);
if(!_syncState.LoginMessageWasReceived)
_loginMessageReceivedTimer = new CTimer(o => DisconnectClientAndReconnect(), 5000);
}
else
{
SyncState.CodecDisconnected();
_syncState.CodecDisconnected();
PhonebookSyncState.CodecDisconnected();
if (PhonebookRefreshTimer != null)
@@ -673,7 +740,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
Communication.Disconnect();
RetryConnectionTimer = new CTimer(o => Communication.Connect(), 2000);
_retryConnectionTimer = new CTimer(o => Communication.Connect(), 2000);
//CrestronEnvironment.Sleep(2000);
@@ -690,66 +757,66 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
{
if (CommDebuggingIsOn)
{
if (!JsonFeedbackMessageIsIncoming)
if (!_jsonFeedbackMessageIsIncoming)
Debug.Console(1, this, "RX: '{0}'", args.Text);
}
if (args.Text == "{" + Delimiter) // Check for the beginning of a new JSON message
{
JsonFeedbackMessageIsIncoming = true;
_jsonFeedbackMessageIsIncoming = true;
if (CommDebuggingIsOn)
Debug.Console(1, this, "Incoming JSON message...");
JsonMessage = new StringBuilder();
_jsonMessage = new StringBuilder();
}
else if (args.Text == "}" + Delimiter) // Check for the end of a JSON message
{
JsonFeedbackMessageIsIncoming = false;
_jsonFeedbackMessageIsIncoming = false;
JsonMessage.Append(args.Text);
_jsonMessage.Append(args.Text);
if (CommDebuggingIsOn)
Debug.Console(1, this, "Complete JSON Received:\n{0}", JsonMessage.ToString());
Debug.Console(1, this, "Complete JSON Received:\n{0}", _jsonMessage.ToString());
// Enqueue the complete message to be deserialized
ReceiveQueue.Enqueue(new ProcessStringMessage(JsonMessage.ToString(), DeserializeResponse));
_receiveQueue.Enqueue(new ProcessStringMessage(_jsonMessage.ToString(), DeserializeResponse));
return;
}
if(JsonFeedbackMessageIsIncoming)
if(_jsonFeedbackMessageIsIncoming)
{
JsonMessage.Append(args.Text);
_jsonMessage.Append(args.Text);
//Debug.Console(1, this, "Building JSON:\n{0}", JsonMessage.ToString());
return;
}
if (!SyncState.InitialSyncComplete)
if (!_syncState.InitialSyncComplete)
{
switch (args.Text.Trim().ToLower()) // remove the whitespace
{
case "*r login successful":
{
SyncState.LoginMessageReceived();
_syncState.LoginMessageReceived();
if(LoginMessageReceivedTimer != null)
LoginMessageReceivedTimer.Stop();
if(_loginMessageReceivedTimer != null)
_loginMessageReceivedTimer.Stop();
SendText("xPreferences outputmode json");
break;
}
case "xpreferences outputmode json":
{
if (!SyncState.InitialStatusMessageWasReceived)
if (!_syncState.InitialStatusMessageWasReceived)
SendText("xStatus");
break;
}
case "xfeedback register /event/calldisconnect":
{
SyncState.FeedbackRegistered();
_syncState.FeedbackRegistered();
break;
}
}
@@ -792,14 +859,35 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
// Check to see if the message contains /Status/Conference/Presentation/LocalInstance and extract source value
var conference = tempCodecStatus.Status.Conference;
if (conference.Presentation != null && conference.Presentation.LocalInstance == null)
{
// Handles an empty presentation object response
return;
}
if (conference.Presentation.LocalInstance.Count > 0)
{
if (!string.IsNullOrEmpty(conference.Presentation.LocalInstance[0].ghost))
PresentationSource = 0;
{
_presentationSource = 0;
_presentationLocalOnly = false;
_presentationLocalRemote = false;
}
else if (conference.Presentation.LocalInstance[0].Source != null)
{
PresentationSource = conference.Presentation.LocalInstance[0].Source.IntValue;
_presentationSource = conference.Presentation.LocalInstance[0].Source.IntValue;
// Check for any values in the SendingMode property
if (conference.Presentation.LocalInstance.Any((i) => !string.IsNullOrEmpty(i.SendingMode.Value)))
{
_presentationLocalOnly = conference.Presentation.LocalInstance.Any((i) => i.SendingMode.LocalOnly);
_presentationLocalRemote = conference.Presentation.LocalInstance.Any((i) => i.SendingMode.LocalRemote);
}
}
PresentationSourceFeedback.FireUpdate();
PresentationSendingLocalOnlyFeedback.FireUpdate();
PresentationSendingLocalRemoteFeedback.FireUpdate();
}
// Check to see if this is a call status message received after the initial status message
@@ -821,6 +909,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
if (!string.IsNullOrEmpty(call.Status.Value))
{
tempActiveCall.Status = CodecCallStatus.ConvertToStatusEnum(call.Status.Value);
tempActiveCall.IsOnHold = tempActiveCall.Status == eCodecCallStatus.OnHold;
if (newStatus == eCodecCallStatus.Connected)
GetCallHistory();
@@ -847,6 +936,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
changeDetected = true;
}
}
if(call.Duration != null)
{
if(!string.IsNullOrEmpty(call.Duration.Value))
{
tempActiveCall.Duration = call.Duration.DurationValue;
changeDetected = true;
}
}
if(call.PlacedOnHold != null)
{
tempActiveCall.IsOnHold = call.PlacedOnHold.BoolValue;
changeDetected = true;
}
if (changeDetected)
{
@@ -865,7 +967,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
Name = call.DisplayName.Value,
Number = call.RemoteNumber.Value,
Type = CodecCallType.ConvertToTypeEnum(call.CallType.Value),
Direction = CodecCallDirection.ConvertToDirectionEnum(call.Direction.Value)
Direction = CodecCallDirection.ConvertToDirectionEnum(call.Direction.Value),
Duration = call.Duration.DurationValue,
IsOnHold = call.PlacedOnHold.BoolValue,
};
// Add it to the ActiveCalls List
@@ -945,11 +1049,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
JsonConvert.PopulateObject(response, CodecStatus);
}
if (!SyncState.InitialStatusMessageWasReceived)
if (!_syncState.InitialStatusMessageWasReceived)
{
SyncState.InitialStatusMessageReceived();
_syncState.InitialStatusMessageReceived();
if (!SyncState.InitialConfigurationMessageWasReceived)
if (!_syncState.InitialConfigurationMessageWasReceived)
SendText("xConfiguration");
}
}
@@ -959,12 +1063,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
JsonConvert.PopulateObject(response, CodecConfiguration);
if (!SyncState.InitialConfigurationMessageWasReceived)
if (!_syncState.InitialConfigurationMessageWasReceived)
{
SyncState.InitialConfigurationMessageReceived();
if (!SyncState.FeedbackWasRegistered)
_syncState.InitialConfigurationMessageReceived();
if (!_syncState.FeedbackWasRegistered)
{
SendText(CliFeedbackRegistrationExpression);
SendText(_cliFeedbackRegistrationExpression);
}
}
@@ -1094,6 +1198,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
var handler = DirectoryResultReturned;
if (handler != null)
{
Debug.Console(2, this, "Directory result returned");
handler(this, new DirectoryEventArgs()
{
Directory = result,
@@ -1137,7 +1242,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public override void ExecuteSwitch(object selector)
{
(selector as Action)();
PresentationSourceKey = selector.ToString();
_presentationSourceKey = selector.ToString();
}
/// <summary>
@@ -1147,7 +1252,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
{
ExecuteSwitch(inputSelector);
PresentationSourceKey = inputSelector.ToString();
_presentationSourceKey = inputSelector.ToString();
}
@@ -1226,13 +1331,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
private void GetPhonebookFolders()
{
// Get Phonebook Folders (determine local/corporate from config, and set results limit)
SendText(string.Format("xCommand Phonebook Search PhonebookType: {0} ContactType: Folder", PhonebookMode));
SendText(string.Format("xCommand Phonebook Search PhonebookType: {0} ContactType: Folder", _phonebookMode));
}
private void GetPhonebookContacts()
{
// Get Phonebook Folders (determine local/corporate from config, and set results limit)
SendText(string.Format("xCommand Phonebook Search PhonebookType: {0} ContactType: Contact Limit: {1}", PhonebookMode, PhonebookResultsLimit));
SendText(string.Format("xCommand Phonebook Search PhonebookType: {0} ContactType: Contact Limit: {1}", _phonebookMode, _phonebookResultsLimit));
}
/// <summary>
@@ -1241,7 +1346,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
/// <param name="searchString"></param>
public void SearchDirectory(string searchString)
{
SendText(string.Format("xCommand Phonebook Search SearchString: \"{0}\" PhonebookType: {1} ContactType: Contact Limit: {2}", searchString, PhonebookMode, PhonebookResultsLimit));
SendText(string.Format("xCommand Phonebook Search SearchString: \"{0}\" PhonebookType: {1} ContactType: Contact Limit: {2}", searchString, _phonebookMode, _phonebookResultsLimit));
}
/// <summary>
@@ -1250,7 +1355,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
/// <param name="folderId"></param>
public void GetDirectoryFolderContents(string folderId)
{
SendText(string.Format("xCommand Phonebook Search FolderId: {0} PhonebookType: {1} ContactType: Any Limit: {2}", folderId, PhonebookMode, PhonebookResultsLimit));
SendText(string.Format("xCommand Phonebook Search FolderId: {0} PhonebookType: {1} ContactType: Any Limit: {2}", folderId, _phonebookMode, _phonebookResultsLimit));
}
/// <summary>
@@ -1348,7 +1453,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
{
SendText(string.Format("xCommand Dial Number: \"{0}\" Protocol: {1} CallRate: {2} CallType: {3} BookingId: {4}", number, protocol, callRate, callType, meetingId));
}
public override void EndCall(CodecActiveCallItem activeCall)
{
SendText(string.Format("xCommand Call Disconnect CallId: {0}", activeCall.Id));
@@ -1372,18 +1478,94 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
SendText("xCommand Call Reject");
}
#region IHasCallHold Members
public void HoldCall(CodecActiveCallItem activeCall)
{
SendText(string.Format("xCommand Call Hold CallId: {0}", activeCall.Id));
}
public void ResumeCall(CodecActiveCallItem activeCall)
{
SendText(string.Format("xCommand Call Resume CallId: {0}", activeCall.Id));
}
#endregion
#region IJoinCalls
public void JoinCall(CodecActiveCallItem activeCall)
{
SendText(string.Format("xCommand Call Join CallId: {0}", activeCall.Id));
}
public void JoinAllCalls()
{
StringBuilder ids = new StringBuilder();
foreach (var call in ActiveCalls)
{
if (call.IsActiveCall)
{
ids.Append(string.Format(" CallId: {0}", call.Id));
}
}
if (ids.Length > 0)
{
SendText(string.Format("xCommand Call Join {0}", ids.ToString()));
}
}
#endregion
/// <summary>
/// Sends tones to the last connected call
/// </summary>
/// <param name="s"></param>
public override void SendDtmf(string s)
{
SendText(string.Format("xCommand Call DTMFSend CallId: {0} DTMFString: \"{1}\"", GetCallId(), s));
}
/// <summary>
/// Sends tones to a specific call
/// </summary>
/// <param name="s"></param>
/// <param name="activeCall"></param>
public override void SendDtmf(string s, CodecActiveCallItem activeCall)
{
SendText(string.Format("xCommand Call DTMFSend CallId: {0} DTMFString: \"{1}\"", activeCall.Id, s));
}
public void SelectPresentationSource(int source)
{
PresentationSource = source;
_desiredPresentationSource = source;
StartSharing();
}
/// <summary>
/// Sets the ringtone volume level
/// </summary>
/// <param name="volume">level from 0 - 100 in increments of 5</param>
public void SetRingtoneVolume(int volume)
{
if (volume < 0 || volume > 100)
{
Debug.Console(0, this, "Cannot set ringtone volume to '{0}'. Value must be between 0 - 100", volume);
return;
}
if (volume % 5 != 0)
{
Debug.Console(0, this, "Cannot set ringtone volume to '{0}'. Value must be between 0 - 100 and a multiple of 5", volume);
return;
}
SendText(string.Format("xConfiguration Audio SoundsAndAlerts RingVolume: {0}", volume));
}
/// <summary>
/// Select source 1 as the presetnation source
/// </summary>
@@ -1400,6 +1582,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
SelectPresentationSource(3);
}
/// <summary>
/// Starts presentation sharing
/// </summary>
@@ -1412,8 +1596,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
else
sendingMode = "LocalOnly";
if(PresentationSource > 0)
SendText(string.Format("xCommand Presentation Start PresentationSource: {0} SendingMode: {1}", PresentationSource, sendingMode));
if (_desiredPresentationSource > 0)
SendText(string.Format("xCommand Presentation Start PresentationSource: {0} SendingMode: {1}", _desiredPresentationSource, sendingMode));
}
/// <summary>
@@ -1421,11 +1605,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
/// </summary>
public override void StopSharing()
{
PresentationSource = 0;
_desiredPresentationSource = 0;
SendText("xCommand Presentation Stop");
}
public override void PrivacyModeOn()
{
SendText("xCommand Audio Microphones Mute");
@@ -1531,6 +1717,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public void LinkCiscoCodecToApi(BasicTriList trilist, CiscoCodecJoinMap joinMap)
{
// Custom commands to codec
trilist.SetStringSigAction(joinMap.CommandToDevice.JoinNumber, (s) => this.SendText(s));
var dndCodec = this as IHasDoNotDisturbMode;
if (dndCodec != null)
{
@@ -1554,6 +1744,17 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
trilist.SetSigFalseAction(joinMap.DeactivateStandby.JoinNumber, () => halfwakeCodec.StandbyDeactivate());
trilist.SetSigFalseAction(joinMap.ActivateHalfWakeMode.JoinNumber, () => halfwakeCodec.HalfwakeActivate());
}
// Ringtone volume
trilist.SetUShortSigAction(joinMap.RingtoneVolume.JoinNumber, (u) => SetRingtoneVolume(u));
RingtoneVolumeFeedback.LinkInputSig(trilist.UShortInput[joinMap.RingtoneVolume.JoinNumber]);
// Presentation Source
trilist.SetUShortSigAction(joinMap.PresentationSource.JoinNumber, (u) => SelectPresentationSource(u));
PresentationSourceFeedback.LinkInputSig(trilist.UShortInput[joinMap.PresentationSource.JoinNumber]);
PresentationSendingLocalOnlyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PresentationLocalOnly.JoinNumber]);
PresentationSendingLocalRemoteFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PresentationLocalRemote.JoinNumber]);
}
/// <summary>
@@ -1627,9 +1828,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
/// </summary>
public void SelfviewPipPositionToggle()
{
if (CurrentSelfviewPipPosition != null)
if (_currentSelfviewPipPosition != null)
{
var nextPipPositionIndex = SelfviewPipPositions.IndexOf(CurrentSelfviewPipPosition) + 1;
var nextPipPositionIndex = SelfviewPipPositions.IndexOf(_currentSelfviewPipPosition) + 1;
if (nextPipPositionIndex >= SelfviewPipPositions.Count) // Check if we need to loop back to the first item in the list
nextPipPositionIndex = 0;
@@ -1652,9 +1853,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
/// </summary>
public void LocalLayoutToggle()
{
if(CurrentLocalLayout != null)
if(_currentLocalLayout != null)
{
var nextLocalLayoutIndex = LocalLayouts.IndexOf(CurrentLocalLayout) + 1;
var nextLocalLayoutIndex = LocalLayouts.IndexOf(_currentLocalLayout) + 1;
if (nextLocalLayoutIndex >= LocalLayouts.Count) // Check if we need to loop back to the first item in the list
nextLocalLayoutIndex = 0;
@@ -1668,9 +1869,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
/// </summary>
public void LocalLayoutToggleSingleProminent()
{
if (CurrentLocalLayout != null)
if (_currentLocalLayout != null)
{
if (CurrentLocalLayout.Label != "Prominent")
if (_currentLocalLayout.Label != "Prominent")
LocalLayoutSet(LocalLayouts.FirstOrDefault(l => l.Label.Equals("Prominent")));
else
LocalLayoutSet(LocalLayouts.FirstOrDefault(l => l.Label.Equals("Single")));
@@ -1684,11 +1885,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public void MinMaxLayoutToggle()
{
if (PresentationViewMaximizedFeedback.BoolValue)
CurrentPresentationView = "Minimized";
_currentPresentationView = "Minimized";
else
CurrentPresentationView = "Maximized";
_currentPresentationView = "Maximized";
SendText(string.Format("xCommand Video PresentationView Set View: {0}", CurrentPresentationView));
SendText(string.Format("xCommand Video PresentationView Set View: {0}", _currentPresentationView));
PresentationViewMaximizedFeedback.FireUpdate();
}
@@ -1697,9 +1898,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
/// </summary>
void ComputeSelfviewPipStatus()
{
CurrentSelfviewPipPosition = SelfviewPipPositions.FirstOrDefault(p => p.Command.ToLower().Equals(CodecStatus.Status.Video.Selfview.PIPPosition.Value.ToLower()));
_currentSelfviewPipPosition = SelfviewPipPositions.FirstOrDefault(p => p.Command.ToLower().Equals(CodecStatus.Status.Video.Selfview.PIPPosition.Value.ToLower()));
if(CurrentSelfviewPipPosition != null)
if(_currentSelfviewPipPosition != null)
SelfviewIsOnFeedback.FireUpdate();
}
@@ -1708,9 +1909,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
/// </summary>
void ComputeLocalLayout()
{
CurrentLocalLayout = LocalLayouts.FirstOrDefault(l => l.Command.ToLower().Equals(CodecStatus.Status.Video.Layout.LayoutFamily.Local.Value.ToLower()));
_currentLocalLayout = LocalLayouts.FirstOrDefault(l => l.Command.ToLower().Equals(CodecStatus.Status.Video.Layout.LayoutFamily.Local.Value.ToLower()));
if (CurrentLocalLayout != null)
if (_currentLocalLayout != null)
LocalLayoutFeedback.FireUpdate();
}
@@ -1758,30 +1959,70 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
/// <summary>
/// Builds the cameras List. Could later be modified to build from config data
/// </summary>
void SetUpCameras()
void SetUpCameras(List<CameraInfo> cameraInfo)
{
// Add the internal camera
Cameras = new List<CameraBase>();
var internalCamera = new CiscoSparkCamera(Key + "-camera1", "Near End", this, 1);
var camCount = CodecStatus.Status.Cameras.Camera.Count;
if(CodecStatus.Status.Cameras.Camera.Count > 0)
internalCamera.SetCapabilites(CodecStatus.Status.Cameras.Camera[0].Capabilities.Options.Value);
Debug.Console(0, this, "Codec reports {0} cameras", camCount);
// Deal with the case of 1 or no reported cameras
if (camCount <= 1)
{
var internalCamera = new CiscoSparkCamera(Key + "-camera1", "Near End", this, 1);
if (camCount > 0)
{
// Try to get the capabilities from the codec
if (CodecStatus.Status.Cameras.Camera[0] != null && CodecStatus.Status.Cameras.Camera[0].Capabilities != null)
{
internalCamera.SetCapabilites(CodecStatus.Status.Cameras.Camera[0].Capabilities.Options.Value);
}
}
Cameras.Add(internalCamera);
DeviceManager.AddDevice(internalCamera);
}
else
// Somehow subscribe to the event on the Options.Value property and update when it changes.
{
// Setup all the cameras
for (int i = 0; i < camCount; i++)
{
var cam = CodecStatus.Status.Cameras.Camera[i];
Cameras.Add(internalCamera);
var id = (uint)i;
var name = string.Format("Camera {0}", id);
// Check for a config object that matches the camera number
var camInfo = cameraInfo.FirstOrDefault(c => c.CameraNumber == i + 1);
if (camInfo != null)
{
id = (uint)camInfo.SourceId;
name = camInfo.Name;
}
var key = string.Format("{0}-camera{1}", Key, id);
var camera = new CiscoSparkCamera(key, name, this, id);
if (cam.Capabilities != null)
{
camera.SetCapabilites(cam.Capabilities.Options.Value);
}
Cameras.Add(camera);
}
}
// Add the far end camera
var farEndCamera = new CiscoFarEndCamera(Key + "-cameraFar", "Far End", this);
Cameras.Add(farEndCamera);
SelectedCameraFeedback = new StringFeedback(() => SelectedCamera.Key);
SelectedCameraFeedback = new StringFeedback(() => SelectedCamera.Key);
ControllingFarEndCameraFeedback = new BoolFeedback(() => SelectedCamera is IAmFarEndCamera);
DeviceManager.AddDevice(internalCamera);
DeviceManager.AddDevice(farEndCamera);
ControllingFarEndCameraFeedback = new BoolFeedback(() => SelectedCamera is IAmFarEndCamera);
NearEndPresets = new List<CodecRoomPreset>(15);
@@ -1794,7 +2035,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
FarEndRoomPresets.Add(new CodecRoomPreset(i, label, true, false));
}
SelectedCamera = internalCamera; ; // call the method to select the camera and ensure the feedbacks get updated.
SelectedCamera = Cameras[0]; ; // call the method to select the camera and ensure the feedbacks get updated.
}
#region IHasCodecCameras Members
@@ -1842,6 +2084,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
}
else
Debug.Console(2, this, "Unable to select camera with key: '{0}'", key);
var ciscoCam = camera as CiscoSparkCamera;
if (ciscoCam != null)
{
SendText(string.Format("xCommand Video Input SetMainVideoSource SourceId: {0}", ciscoCam.CameraId));
}
}
public CameraBase FarEndCamera { get; private set; }
@@ -1959,10 +2207,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
{
get
{
if (CodecConfiguration.Configuration.Conference.AutoAnswer.Mode.Value.ToLower() == "on")
return true;
else
return false;
if (CodecConfiguration.Configuration.Conference.AutoAnswer.Mode.Value == null) return false;
return CodecConfiguration.Configuration.Conference.AutoAnswer.Mode.Value.ToLower() == "on";
}
}

View File

@@ -50,8 +50,16 @@ namespace PepperDash.Essentials.Devices.Common.Codec
public uint PhonebookResultsLimit { get; set; }
[JsonProperty("UiBranding")]
public BrandingLogoProperties UiBranding { get; set; }
public BrandingLogoProperties UiBranding { get; set; }
[JsonProperty("cameraInfo")]
public List<CameraInfo> CameraInfo { get; set; }
public CiscoSparkCodecPropertiesConfig()
{
CameraInfo = new List<CameraInfo>();
}
}
public class SharingProperties
@@ -68,4 +76,14 @@ namespace PepperDash.Essentials.Devices.Common.Codec
[JsonProperty("brandingUrl")]
public string BrandingUrl { get; set; }
}
/// <summary>
/// Describes configuration information for the near end cameras
/// </summary>
public class CameraInfo
{
public int CameraNumber { get; set; }
public string Name { get; set; }
public int SourceId { get; set; }
}
}

View File

@@ -26,6 +26,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
void CodecRoomPresetSelect(int preset);
void CodecRoomPresetStore(int preset, string description);
void SelectFarEndPreset(int preset);
}
public static class RoomPresets

View File

@@ -112,16 +112,46 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public string Value { get; set; }
}
public class RingVolume
public class RingVolume : ValueProperty
{
public string valueSpaceRef { get; set; }
public string Value { get; set; }
string _Value;
/// <summary>
/// Sets Value and triggers the action when set
/// </summary>
public string Value
{
get
{
return _Value;
}
set
{
_Value = value;
OnValueChanged();
}
}
public int Volume
{
get
{
return Int32.Parse(_Value);
}
}
}
public class SoundsAndAlerts
{
public RingTone RingTone { get; set; }
public RingVolume RingVolume { get; set; }
public SoundsAndAlerts()
{
RingVolume = new RingVolume();
}
}
public class Audio
@@ -131,6 +161,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public Microphones Microphones { get; set; }
public Output Output { get; set; }
public SoundsAndAlerts SoundsAndAlerts { get; set; }
public Audio()
{
SoundsAndAlerts = new SoundsAndAlerts();
}
}
public class DefaultMode
@@ -340,6 +376,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public Delay Delay { get; set; }
public Mode9 Mode { get; set; }
public Mute2 Mute { get; set; }
public AutoAnswer()
{
Mode = new Mode9();
Delay = new Delay();
Mute = new Mute2();
}
}
public class Protocol
@@ -440,6 +483,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public MaxTotalTransmitCallRate MaxTotalTransmitCallRate { get; set; }
public MaxTransmitCallRate MaxTransmitCallRate { get; set; }
public MultiStream MultiStream { get; set; }
public Conference()
{
AutoAnswer = new AutoAnswer();
}
}
public class LoginName
@@ -1797,11 +1845,22 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public UserInterface UserInterface { get; set; }
public UserManagement UserManagement { get; set; }
public Video2 Video { get; set; }
public Configuration()
{
Audio = new Audio();
Conference = new Conference();
}
}
public class RootObject
{
public Configuration Configuration { get; set; }
public RootObject()
{
Configuration = new Configuration();
}
}
}
}

View File

@@ -12,28 +12,28 @@ using PepperDash.Essentials.Devices.Common.VideoCodec.CiscoCodec;
namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
{
// Helper Classes for Proerties
public abstract class ValueProperty
{
/// <summary>
/// Triggered when Value is set
/// </summary>
public Action ValueChangedAction { get; set; }
protected void OnValueChanged()
{
var a = ValueChangedAction;
if (a != null)
a();
}
}
/// <summary>
/// This class exists to capture serialized data sent back by a Cisco codec in JSON output mode
/// </summary>
public class CiscoCodecStatus
{
// Helper Classes for Proerties
public abstract class ValueProperty
{
/// <summary>
/// Triggered when Value is set
/// </summary>
public Action ValueChangedAction { get; set; }
protected void OnValueChanged()
{
var a = ValueChangedAction;
if (a != null)
a();
}
}
public class ConnectionStatus
{
@@ -262,11 +262,25 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public string Value { get; set; }
}
public class DectectedConnector
{
public string Value { get; set; }
public int ConnectorId
{
get
{
return Convert.ToUInt16(Value);
}
}
}
public class Camera
{
public string id { get; set; }
public Capabilities Capabilities { get; set; }
public Connected Connected { get; set; }
public DectectedConnector DetectedConnector { get; set; }
public Flip Flip { get; set; }
public HardwareID HardwareID { get; set; }
public MacAddress MacAddress { get; set; }
@@ -298,11 +312,34 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
}
}
public class CallStatus : ValueProperty
{
string _Value;
public bool BoolValue { get; private set; }
public string Value
{
get
{
return _Value;
}
set
{
// If the incoming value is "Active" it sets the BoolValue true, otherwise sets it false
_Value = value;
BoolValue = value == "Connected";
OnValueChanged();
}
}
}
public class Status2 : ValueProperty
{
string _Value;
public bool BoolValue { get; private set; }
public string Value
{
get
@@ -558,9 +595,47 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
}
}
public class SendingMode
public class SendingMode : ValueProperty
{
public string Value { get; set; }
string _Value;
/// <summary>
/// Sets Value and triggers the action when set
/// </summary>
public string Value
{
get
{
return _Value;
}
set
{
_Value = value;
OnValueChanged();
}
}
public bool LocalOnly
{
get
{
if(string.IsNullOrEmpty(_Value))
return false;
return _Value.ToLower() == "localonly";
}
}
public bool LocalRemote
{
get
{
if(string.IsNullOrEmpty(_Value))
return false;
return _Value.ToLower() == "localremote";
}
}
}
public class LocalInstance
@@ -573,6 +648,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public LocalInstance()
{
Source = new Source2();
SendingMode = new SendingMode();
}
}
@@ -1949,9 +2025,30 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public string Value { get; set; }
}
public class Duration
public class Duration : ValueProperty
{
public string Value { get; set; }
private string _Value;
public string Value
{
get
{
return _Value;
}
set
{
_Value = value;
OnValueChanged();
}
}
public TimeSpan DurationValue
{
get
{
return new TimeSpan(0, 0, Int32.Parse(_Value));
}
}
}
public class FacilityServiceId
@@ -1964,9 +2061,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public string Value { get; set; }
}
public class PlacedOnHold
public class PlacedOnHold : ValueProperty
{
public string Value { get; set; }
public bool BoolValue { get; private set; }
public string Value
{
set
{
// If the incoming value is "True" it sets the BoolValue true, otherwise sets it false
BoolValue = value == "True";
OnValueChanged();
}
}
}
public class Protocol
@@ -2007,13 +2114,15 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public Protocol Protocol { get; set; }
public ReceiveCallRate ReceiveCallRate { get; set; }
public RemoteNumber RemoteNumber { get; set; }
public Status2 Status { get; set; }
public CallStatus Status { get; set; }
public TransmitCallRate TransmitCallRate { get; set; }
public Call()
{
CallType = new CallType();
Status = new Status2();
Status = new CallStatus();
Duration = new Duration();
PlacedOnHold = new PlacedOnHold();
}
}

View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Devices.Common.Codec;
namespace PepperDash.Essentials.Devices.Common.VideoCodec
{
public interface IJoinCalls
{
void JoinCall(CodecActiveCallItem activeCall);
void JoinAllCalls();
}
}

View File

@@ -751,6 +751,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
SetConfig(Config);
}
public void SelectFarEndPreset(int i)
{
Debug.Console(1, this, "Selecting Far End Preset: {0}", i);
}
#endregion
protected override void CustomSetConfig(DeviceConfig config)

View File

@@ -149,6 +149,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
public abstract void AcceptCall(CodecActiveCallItem call);
public abstract void RejectCall(CodecActiveCallItem call);
public abstract void SendDtmf(string s);
public virtual void SendDtmf(string s, CodecActiveCallItem call) { }
#endregion
@@ -327,15 +328,22 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
LinkVideoCodecVolumeToApi(trilist, joinMap);
LinkVideoCodecInfoToApi(trilist, joinMap);
// Register for this event to link any functions that require the codec to be ready first
codec.IsReadyChange += (o, a) =>
{
if (codec is IHasCodecCameras)
{
LinkVideoCodecCameraToApi(codec as IHasCodecCameras, trilist, joinMap);
}
};
if (codec is ICommunicationMonitor)
{
LinkVideoCodecCommMonitorToApi(codec as ICommunicationMonitor, trilist, joinMap);
}
if (codec is IHasCodecCameras)
{
LinkVideoCodecCameraToApi(codec as IHasCodecCameras, trilist, joinMap);
}
if (codec is IHasCodecSelfView)
{
@@ -389,6 +397,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
LinkVideoCodecPhoneToApi(codec as IHasPhoneDialing, trilist, joinMap);
}
if (codec is IHasCallHistory)
{
LinkVideoCodecCallHistoryToApi(codec as IHasCallHistory, trilist, joinMap);
}
trilist.OnlineStatusChange += (device, args) =>
{
if (!args.DeviceOnLine) return;
@@ -435,6 +448,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
(codec as IHasPhoneDialing).PhoneOffHookFeedback.FireUpdate();
}
if (codec is IHasCallHistory)
{
UpdateCallHistory((codec as IHasCallHistory), trilist, joinMap);
}
SharingContentIsOnFeedback.FireUpdate();
trilist.SetBool(joinMap.HookState.JoinNumber, IsInCall);
@@ -443,6 +461,31 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
};
}
private void LinkVideoCodecInfoToApi(BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
{
trilist.SetBool(joinMap.MultiSiteOptionIsEnabled.JoinNumber, this.CodecInfo.MultiSiteOptionIsEnabled);
trilist.SetBool(joinMap.AutoAnswerEnabled.JoinNumber, this.CodecInfo.AutoAnswerEnabled);
trilist.SetString(joinMap.DeviceIpAddresss.JoinNumber, this.CodecInfo.IpAddress);
trilist.SetString(joinMap.SipPhoneNumber.JoinNumber, this.CodecInfo.SipPhoneNumber);
trilist.SetString(joinMap.E164Alias.JoinNumber, this.CodecInfo.E164Alias);
trilist.SetString(joinMap.H323Id.JoinNumber, this.CodecInfo.H323Id);
trilist.SetString(joinMap.SipUri.JoinNumber, this.CodecInfo.SipUri);
trilist.OnlineStatusChange += (o, a) =>
{
if (a.DeviceOnLine)
{
trilist.SetBool(joinMap.MultiSiteOptionIsEnabled.JoinNumber, this.CodecInfo.MultiSiteOptionIsEnabled);
trilist.SetBool(joinMap.AutoAnswerEnabled.JoinNumber, this.CodecInfo.AutoAnswerEnabled);
trilist.SetString(joinMap.DeviceIpAddresss.JoinNumber, this.CodecInfo.IpAddress);
trilist.SetString(joinMap.SipPhoneNumber.JoinNumber, this.CodecInfo.SipPhoneNumber);
trilist.SetString(joinMap.E164Alias.JoinNumber, this.CodecInfo.E164Alias);
trilist.SetString(joinMap.H323Id.JoinNumber, this.CodecInfo.H323Id);
trilist.SetString(joinMap.SipUri.JoinNumber, this.CodecInfo.SipUri);
}
};
}
private void LinkVideoCodecPhoneToApi(IHasPhoneDialing codec, BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
{
codec.PhoneOffHookFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PhoneHookState.JoinNumber]);
@@ -894,18 +937,33 @@ ScreenIndexIsPinnedTo: {8} (a{17})
private void LinkVideoCodecDirectoryToApi(IHasDirectory codec, BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
{
codec.CurrentDirectoryResultIsNotDirectoryRoot.LinkComplementInputSig(
trilist.BooleanInput[joinMap.DirectoryIsRoot.JoinNumber]);
trilist.SetSigFalseAction(joinMap.DirectoryRoot.JoinNumber, codec.SetCurrentDirectoryToRoot);
trilist.BooleanInput[joinMap.DirectoryIsRoot.JoinNumber]);
trilist.SetStringSigAction(joinMap.DirectorySearchString.JoinNumber, codec.SearchDirectory);
trilist.SetUShortSigAction(joinMap.DirectorySelectRow.JoinNumber, (i) => SelectDirectoryEntry(codec, i));
trilist.SetUShortSigAction(joinMap.DirectorySelectRow.JoinNumber, (i) => SelectDirectoryEntry(codec, i, trilist, joinMap));
// Report feedback for number of contact methods for selected contact
trilist.SetSigFalseAction(joinMap.DirectoryRoot.JoinNumber, codec.SetCurrentDirectoryToRoot);
trilist.SetSigFalseAction(joinMap.DirectoryFolderBack.JoinNumber, codec.GetDirectoryParentFolderContents);
if (codec.DirectoryRoot != null)
{
trilist.SetUshort(joinMap.DirectoryRowCount.JoinNumber, (ushort)codec.DirectoryRoot.CurrentDirectoryResults.Count);
var clearBytes = XSigHelpers.ClearOutputs();
trilist.SetString(joinMap.DirectoryEntries.JoinNumber,
Encoding.GetEncoding(XSigEncoding).GetString(clearBytes, 0, clearBytes.Length));
var directoryXSig = UpdateDirectoryXSig(codec.DirectoryRoot, !codec.CurrentDirectoryResultIsNotDirectoryRoot.BoolValue);
Debug.Console(2, this, "Directory XSig Length: {0}", directoryXSig.Length);
trilist.SetString(joinMap.DirectoryEntries.JoinNumber, directoryXSig);
}
codec.DirectoryResultReturned += (sender, args) =>
{
trilist.SetUshort(joinMap.DirectoryRowCount.JoinNumber, (ushort)args.Directory.CurrentDirectoryResults.Count);
@@ -916,44 +974,160 @@ ScreenIndexIsPinnedTo: {8} (a{17})
Encoding.GetEncoding(XSigEncoding).GetString(clearBytes, 0, clearBytes.Length));
var directoryXSig = UpdateDirectoryXSig(args.Directory, !codec.CurrentDirectoryResultIsNotDirectoryRoot.BoolValue);
Debug.Console(2, this, "Directory XSig Length: {0}", directoryXSig.Length);
trilist.SetString(joinMap.DirectoryEntries.JoinNumber, directoryXSig);
};
}
private void SelectDirectoryEntry(IHasDirectory codec, ushort i)
private void SelectDirectoryEntry(IHasDirectory codec, ushort i, BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
{
var entry = codec.CurrentDirectoryResult.CurrentDirectoryResults[i - 1];
if (i < 1 || i > codec.CurrentDirectoryResult.CurrentDirectoryResults.Count) return;
if (entry is DirectoryFolder)
_selectedDirectoryItem = codec.CurrentDirectoryResult.CurrentDirectoryResults[i - 1];
if (_selectedDirectoryItem is DirectoryFolder)
{
codec.GetDirectoryFolderContents(entry.FolderId);
return;
codec.GetDirectoryFolderContents(_selectedDirectoryItem.FolderId);
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;
}
var dialableEntry = entry as IInvitableContact;
// not a folder. Clear this value
trilist.SetString(joinMap.DirectorySelectedFolderName.JoinNumber, string.Empty);
if (dialableEntry != null)
{
Dial(dialableEntry);
return;
}
var selectedContact = _selectedDirectoryItem as DirectoryContact;
if (selectedContact != null)
{
trilist.SetString(joinMap.DirectoryEntrySelectedName.JoinNumber, selectedContact.Name);
}
var entryToDial = entry as DirectoryContact;
// Allow auto dial of selected line. Always dials first contact method
if (!trilist.GetBool(joinMap.DirectoryDisableAutoDialSelectedLine.JoinNumber))
{
var invitableEntry = _selectedDirectoryItem as IInvitableContact;
if (entryToDial == null) return;
if (invitableEntry != null)
{
Dial(invitableEntry);
return;
}
Dial(entryToDial.ContactMethods[0].Number);
var entryToDial = _selectedDirectoryItem as DirectoryContact;
trilist.SetString(joinMap.DirectoryEntrySelectedNumber.JoinNumber, selectedContact.ContactMethods[0].Number);
if (entryToDial == null) return;
Dial(entryToDial.ContactMethods[0].Number);
return;
}
else
{
// If auto dial is disabled...
var entryToDial = _selectedDirectoryItem as DirectoryContact;
if (entryToDial == null)
{
// Clear out values and actions from last selected item
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;
}
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 - 1].Number));
});
// Sets DirectoryDialSelectedLine join action to dial first contact method
trilist.SetSigFalseAction(joinMap.DirectoryDialSelectedLine.JoinNumber, () => Dial(entryToDial.ContactMethods[0].Number));
var clearBytes = XSigHelpers.ClearOutputs();
trilist.SetString(joinMap.ContactMethods.JoinNumber,
Encoding.GetEncoding(XSigEncoding).GetString(clearBytes, 0, clearBytes.Length));
var contactMethodsXSig = UpdateContactMethodsXSig(entryToDial);
trilist.SetString(joinMap.ContactMethods.JoinNumber, contactMethodsXSig);
}
}
/// <summary>
/// Generates the XSig data representing the available contact methods for the selected DirectoryContact
/// </summary>
/// <param name="contact"></param>
/// <returns></returns>
private string UpdateContactMethodsXSig(DirectoryContact contact)
{
const int maxMethods = 10;
const int maxStrings = 3;
const int offset = maxStrings;
var stringIndex = 0;
var arrayIndex = 0;
// Create a new token array and set the size to the number of methods times the total number of signals
var tokenArray = new XSigToken[maxMethods * offset];
Debug.Console(2, this, "Creating XSIG token array with size {0}", maxMethods * offset);
// TODO: Add code to generate XSig data
foreach (var method in contact.ContactMethods)
{
if (arrayIndex >= maxMethods * offset)
break;
//serials
tokenArray[arrayIndex + 1] = new XSigSerialToken(stringIndex + 1, method.Number);
tokenArray[arrayIndex + 2] = new XSigSerialToken(stringIndex + 2, method.ContactMethodId.ToString());
tokenArray[arrayIndex + 3] = new XSigSerialToken(stringIndex + 3, method.Device.ToString());
arrayIndex += offset;
stringIndex += maxStrings;
}
while (arrayIndex < maxMethods)
{
tokenArray[arrayIndex + 1] = new XSigSerialToken(stringIndex + 1, String.Empty);
tokenArray[arrayIndex + 2] = new XSigSerialToken(stringIndex + 2, String.Empty);
tokenArray[arrayIndex + 3] = new XSigSerialToken(stringIndex + 3, String.Empty);
arrayIndex += offset;
stringIndex += maxStrings;
}
return GetXSigString(tokenArray);
}
private string UpdateDirectoryXSig(CodecDirectory directory, bool isRoot)
{
var contactIndex = 1;
var tokenArray = new XSigToken[directory.CurrentDirectoryResults.Count];
Debug.Console(2, this, "Is root {0} Directory Count: {1}", isRoot, directory.CurrentDirectoryResults.Count);
foreach (var entry in directory.CurrentDirectoryResults)
{
var arrayIndex = contactIndex - 1;
Debug.Console(2, this, "Entry Name: {0}, Folder ID: {1}", entry.Name, entry.FolderId);
if (entry is DirectoryFolder && entry.ParentFolderId == "root")
{
tokenArray[arrayIndex] = new XSigSerialToken(contactIndex, String.Format("[+] {0}", entry.Name));
@@ -963,8 +1137,6 @@ ScreenIndexIsPinnedTo: {8} (a{17})
continue;
}
if (isRoot && String.IsNullOrEmpty(entry.FolderId)) continue;
tokenArray[arrayIndex] = new XSigSerialToken(contactIndex, entry.Name);
contactIndex++;
@@ -978,8 +1150,25 @@ ScreenIndexIsPinnedTo: {8} (a{17})
trilist.SetSigFalseAction(joinMap.ManualDial.JoinNumber,
() => Dial(trilist.StringOutput[joinMap.CurrentDialString.JoinNumber].StringValue));
//End All calls for now
trilist.SetSigFalseAction(joinMap.EndCall.JoinNumber, EndAllCalls);
//End All calls
trilist.SetSigFalseAction(joinMap.EndAllCalls.JoinNumber, EndAllCalls);
//End a specific call, specified by index. Maximum 8 calls supported
for (int i = 0; i < joinMap.EndCallStart.JoinSpan; i++)
{
trilist.SetSigFalseAction((uint)(joinMap.EndCallStart.JoinNumber + i), () =>
{
var call = ActiveCalls[i];
if (call != null)
{
EndCall(call);
}
else
{
Debug.Console(0, this, "[End Call] Unable to find call at index '{0}'", i);
}
});
}
trilist.SetBool(joinMap.HookState.JoinNumber, IsInCall);
@@ -998,13 +1187,73 @@ ScreenIndexIsPinnedTo: {8} (a{17})
}
trilist.SetString(joinMap.CurrentCallData.JoinNumber, UpdateCallStatusXSig());
trilist.SetUshort(joinMap.ConnectedCallCount.JoinNumber, (ushort)ActiveCalls.Count);
};
var joinCodec = this as IJoinCalls;
if (joinCodec != null)
{
trilist.SetSigFalseAction(joinMap.JoinAllCalls.JoinNumber, () => joinCodec.JoinAllCalls());
for (int i = 0; i < joinMap.JoinCallStart.JoinSpan; i++)
{
trilist.SetSigFalseAction((uint)(joinMap.JoinCallStart.JoinNumber + i), () =>
{
var call = ActiveCalls[i];
if (call != null)
{
joinCodec.JoinCall(call);
}
else
{
Debug.Console(0, this, "[Join Call] Unable to find call at index '{0}'", i);
}
});
}
}
var holdCodec = this as IHasCallHold;
if (holdCodec != null)
{
for (int i = 0; i < joinMap.HoldCallsStart.JoinSpan; i++)
{
trilist.SetSigFalseAction((uint)(joinMap.HoldCallsStart.JoinNumber + i), () =>
{
var call = ActiveCalls[i];
if (call != null)
{
holdCodec.HoldCall(call);
}
else
{
Debug.Console(0, this, "[Hold Call] Unable to find call at index '{0}'", i);
}
});
trilist.SetSigFalseAction((uint)(joinMap.ResumeCallsStart.JoinNumber + i), () =>
{
var call = ActiveCalls[i];
if (call != null)
{
holdCodec.ResumeCall(call);
}
else
{
Debug.Console(0, this, "[Resume Call] Unable to find call at index '{0}'", i);
}
});
}
}
}
private string UpdateCallStatusXSig()
{
const int maxCalls = 8;
const int maxStrings = 5;
const int maxStrings = 6;
const int offset = 6;
var stringIndex = 0;
var digitalIndex = maxStrings * maxCalls;
@@ -1018,6 +1267,7 @@ ScreenIndexIsPinnedTo: {8} (a{17})
break;
//digitals
tokenArray[arrayIndex] = new XSigDigitalToken(digitalIndex + 1, call.IsActiveCall);
tokenArray[arrayIndex + 1] = new XSigDigitalToken(digitalIndex + 2, call.IsOnHold);
//serials
tokenArray[arrayIndex + 1] = new XSigSerialToken(stringIndex + 1, call.Name ?? String.Empty);
@@ -1025,6 +1275,12 @@ ScreenIndexIsPinnedTo: {8} (a{17})
tokenArray[arrayIndex + 3] = new XSigSerialToken(stringIndex + 3, call.Direction.ToString());
tokenArray[arrayIndex + 4] = new XSigSerialToken(stringIndex + 4, call.Type.ToString());
tokenArray[arrayIndex + 5] = new XSigSerialToken(stringIndex + 5, call.Status.ToString());
if(call.Duration != null)
{
// May need to verify correct string format here
var dur = string.Format("{0:c}", call.Duration);
tokenArray[arrayIndex + 6] = new XSigSerialToken(stringIndex + 6, dur);
}
arrayIndex += offset;
stringIndex += maxStrings;
@@ -1034,13 +1290,16 @@ ScreenIndexIsPinnedTo: {8} (a{17})
{
//digitals
tokenArray[arrayIndex] = new XSigDigitalToken(digitalIndex + 1, false);
tokenArray[arrayIndex + 1] = new XSigDigitalToken(digitalIndex + 2, false);
//serials
//serials
tokenArray[arrayIndex + 1] = new XSigSerialToken(stringIndex + 1, String.Empty);
tokenArray[arrayIndex + 2] = new XSigSerialToken(stringIndex + 2, String.Empty);
tokenArray[arrayIndex + 3] = new XSigSerialToken(stringIndex + 3, String.Empty);
tokenArray[arrayIndex + 4] = new XSigSerialToken(stringIndex + 4, String.Empty);
tokenArray[arrayIndex + 5] = new XSigSerialToken(stringIndex + 5, String.Empty);
tokenArray[arrayIndex + 6] = new XSigSerialToken(stringIndex + 6, String.Empty);
arrayIndex += offset;
stringIndex += maxStrings;
@@ -1052,25 +1311,61 @@ ScreenIndexIsPinnedTo: {8} (a{17})
private void LinkVideoCodecDtmfToApi(BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
{
trilist.SetSigFalseAction(joinMap.Dtmf0.JoinNumber, () => SendDtmf("0"));
trilist.SetSigFalseAction(joinMap.Dtmf1.JoinNumber, () => SendDtmf("1"));
trilist.SetSigFalseAction(joinMap.Dtmf2.JoinNumber, () => SendDtmf("2"));
trilist.SetSigFalseAction(joinMap.Dtmf3.JoinNumber, () => SendDtmf("3"));
trilist.SetSigFalseAction(joinMap.Dtmf4.JoinNumber, () => SendDtmf("4"));
trilist.SetSigFalseAction(joinMap.Dtmf5.JoinNumber, () => SendDtmf("5"));
trilist.SetSigFalseAction(joinMap.Dtmf6.JoinNumber, () => SendDtmf("6"));
trilist.SetSigFalseAction(joinMap.Dtmf7.JoinNumber, () => SendDtmf("7"));
trilist.SetSigFalseAction(joinMap.Dtmf8.JoinNumber, () => SendDtmf("8"));
trilist.SetSigFalseAction(joinMap.Dtmf9.JoinNumber, () => SendDtmf("9"));
trilist.SetSigFalseAction(joinMap.DtmfStar.JoinNumber, () => SendDtmf("*"));
trilist.SetSigFalseAction(joinMap.DtmfPound.JoinNumber, () => SendDtmf("#"));
trilist.SetSigFalseAction(joinMap.Dtmf0.JoinNumber, () => SendDtmfAction("0", trilist, joinMap));
trilist.SetSigFalseAction(joinMap.Dtmf1.JoinNumber, () => SendDtmfAction("1", trilist, joinMap));
trilist.SetSigFalseAction(joinMap.Dtmf2.JoinNumber, () => SendDtmfAction("2", trilist, joinMap));
trilist.SetSigFalseAction(joinMap.Dtmf3.JoinNumber, () => SendDtmfAction("3", trilist, joinMap));
trilist.SetSigFalseAction(joinMap.Dtmf4.JoinNumber, () => SendDtmfAction("4", trilist, joinMap));
trilist.SetSigFalseAction(joinMap.Dtmf5.JoinNumber, () => SendDtmfAction("5", trilist, joinMap));
trilist.SetSigFalseAction(joinMap.Dtmf6.JoinNumber, () => SendDtmfAction("6", trilist, joinMap));
trilist.SetSigFalseAction(joinMap.Dtmf7.JoinNumber, () => SendDtmfAction("7", trilist, joinMap));
trilist.SetSigFalseAction(joinMap.Dtmf8.JoinNumber, () => SendDtmfAction("8", trilist, joinMap));
trilist.SetSigFalseAction(joinMap.Dtmf9.JoinNumber, () => SendDtmfAction("9", trilist, joinMap));
trilist.SetSigFalseAction(joinMap.DtmfStar.JoinNumber, () => SendDtmfAction("*", trilist, joinMap));
trilist.SetSigFalseAction(joinMap.DtmfPound.JoinNumber, () => SendDtmfAction("#", trilist, joinMap));
}
/// <summary>
/// Sends the specified string as a DTMF command.
/// Reads the value of the SendDtmfToSpecificCallInstance digital join and SelectCall analog join to determine
/// Whther to send to a specific call index or to the last connected call
/// </summary>
/// <param name="s"></param>
/// <param name="trilist"></param>
/// <param name="joinMap"></param>
private void SendDtmfAction(string s, BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
{
if (!trilist.GetBool(joinMap.SendDtmfToSpecificCallIndex.JoinNumber))
{
SendDtmf(s);
}
else
{
var callIndex = trilist.GetUshort(joinMap.SelectCall.JoinNumber);
if (callIndex > 0 && callIndex <= 8)
{
var call = ActiveCalls[callIndex - 1];
if (call != null && call.IsActiveCall)
{
SendDtmf(s, call);
}
else
{
Debug.Console(0, this, "Warning: No call found at index {0} or call is not active.", callIndex);
}
}
else
{
Debug.Console(0, this, "Warning: Invalid call index specified. Please use a value of 1-8.");
}
}
}
private void LinkVideoCodecCameraLayoutsToApi(IHasCodecLayouts codec, BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
{
trilist.SetSigFalseAction(joinMap.CameraLayout.JoinNumber, codec.LocalLayoutToggle);
codec.LocalLayoutFeedback.LinkInputSig(trilist.StringInput[joinMap.CameraLayoutStringFb.JoinNumber]);
codec.LocalLayoutFeedback.LinkInputSig(trilist.StringInput[joinMap.CurrentLayoutStringFb.JoinNumber]);
}
private void LinkVideoCodecCameraModeToApi(IHasCameraAutoMode codec, BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
@@ -1201,18 +1496,81 @@ ScreenIndexIsPinnedTo: {8} (a{17})
else camera.ZoomStop();
});
trilist.SetBoolSigAction(joinMap.CameraFocusNear.JoinNumber, (b) =>
{
if (codec.SelectedCamera == null) return;
var camera = codec.SelectedCamera as IHasCameraFocusControl;
if (camera == null) return;
if (b) camera.FocusNear();
else camera.FocusStop();
});
trilist.SetBoolSigAction(joinMap.CameraFocusFar.JoinNumber, (b) =>
{
if (codec.SelectedCamera == null) return;
var camera = codec.SelectedCamera as IHasCameraFocusControl;
if (camera == null) return;
if (b) camera.FocusFar();
else camera.FocusStop();
});
trilist.SetSigFalseAction(joinMap.CameraFocusAuto.JoinNumber, () =>
{
if (codec.SelectedCamera == null) return;
var camera = codec.SelectedCamera as IHasCameraFocusControl;
if (camera == null) return;
camera.TriggerAutoFocus();
});
// Camera count
trilist.SetUshort(joinMap.CameraCount.JoinNumber, (ushort)codec.Cameras.Count);
// Camera names
for (uint i = 0; i < joinMap.CameraNamesFb.JoinSpan; i++)
{
//Check the count first
if (i < codec.Cameras.Count && codec.Cameras[(int)i] != null)
{
trilist.SetString(joinMap.CameraNamesFb.JoinNumber + i, codec.Cameras[(int)i].Name);
}
else
{
trilist.SetString(joinMap.CameraNamesFb.JoinNumber + i, "");
}
}
//Camera Select
trilist.SetUShortSigAction(joinMap.CameraNumberSelect.JoinNumber, (i) =>
{
if (codec.SelectedCamera == null) return;
codec.SelectCamera(codec.Cameras[i].Key);
if (i > 0 && i <= codec.Cameras.Count)
{
codec.SelectCamera(codec.Cameras[i - 1].Key);
}
else
{
Debug.Console(0, this, "Unable to select. No camera found at index {0}", i);
}
});
// Set initial selected camera feedback
if (codec.SelectedCamera != null)
{
trilist.SetUshort(joinMap.CameraNumberSelect.JoinNumber, (ushort)codec.Cameras.FindIndex((c) => c.Key == codec.SelectedCamera.Key));
}
codec.CameraSelected += (sender, args) =>
{
var i = (ushort)codec.Cameras.FindIndex((c) => c.Key == args.SelectedCamera.Key);
trilist.SetUshort(joinMap.CameraNumberSelect.JoinNumber, (ushort)(i + 1));
if (codec is IHasCodecRoomPresets)
{
return;
@@ -1255,10 +1613,16 @@ ScreenIndexIsPinnedTo: {8} (a{17})
trilist.SetUShortSigAction(joinMap.CameraPresetSelect.JoinNumber, (i) =>
{
presetCodec.CodecRoomPresetSelect(i);
trilist.SetUshort(joinMap.CameraPresetSelect.JoinNumber, i);
});
// Far End Presets
trilist.SetUShortSigAction(joinMap.FarEndPresetSelect.JoinNumber, (i) =>
{
presetCodec.SelectFarEndPreset(i);
});
trilist.SetSigFalseAction(joinMap.CameraPresetSave.JoinNumber,
() =>
{
@@ -1268,7 +1632,96 @@ ScreenIndexIsPinnedTo: {8} (a{17})
});
}
private string SetCameraPresetNames(IEnumerable<CodecRoomPreset> presets)
// Following fields only used for Bridging
private int _selectedRecentCallItemIndex;
private CodecCallHistory.CallHistoryEntry _selectedRecentCallItem;
private DirectoryItem _selectedDirectoryItem;
private void LinkVideoCodecCallHistoryToApi(IHasCallHistory codec, BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
{
codec.CallHistory.RecentCallsListHasChanged += (o, a) =>
{
UpdateCallHistory(codec, trilist, joinMap);
};
// Selected item action and feedback
trilist.SetUShortSigAction(joinMap.SelectRecentCallItem.JoinNumber, (u) =>
{
if (u == 0 || u > codec.CallHistory.RecentCalls.Count)
{
Debug.Console(2, this, "Recent Call History index out of range");
return;
}
_selectedRecentCallItemIndex = (int)(u - 1);
trilist.SetUshort(joinMap.SelectRecentCallItem.JoinNumber, u);
var _selectedRecentCallItem = codec.CallHistory.RecentCalls[_selectedRecentCallItemIndex];
if (_selectedRecentCallItem != null)
{
trilist.SetString(joinMap.SelectedRecentCallName.JoinNumber, _selectedRecentCallItem.Name);
trilist.SetString(joinMap.SelectedRecentCallNumber.JoinNumber, _selectedRecentCallItem.Number);
trilist.SetSigFalseAction(joinMap.RemoveSelectedRecentCallItem.JoinNumber, () => codec.RemoveCallHistoryEntry(_selectedRecentCallItem));
trilist.SetSigFalseAction(joinMap.DialSelectedRecentCallItem.JoinNumber, () => this.Dial(_selectedRecentCallItem.Number));
}
else
{
trilist.SetString(joinMap.SelectedRecentCallName.JoinNumber, string.Empty);
trilist.SetString(joinMap.SelectedRecentCallNumber.JoinNumber, string.Empty);
trilist.ClearBoolSigAction(joinMap.RemoveSelectedRecentCallItem.JoinNumber);
trilist.ClearBoolSigAction(joinMap.DialSelectedRecentCallItem.JoinNumber);
}
});
}
private void UpdateCallHistory(IHasCallHistory codec, BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
{
// Clear out selected item
_selectedRecentCallItemIndex = 0;
_selectedRecentCallItem = null;
trilist.SetUshort(joinMap.SelectRecentCallItem.JoinNumber, 0);
trilist.SetString(joinMap.SelectedRecentCallName.JoinNumber, string.Empty);
trilist.SetString(joinMap.SelectedRecentCallNumber.JoinNumber, string.Empty);
trilist.ClearBoolSigAction(joinMap.RemoveSelectedRecentCallItem.JoinNumber);
//
trilist.SetUshort(joinMap.RecentCallCount.JoinNumber, (ushort)codec.CallHistory.RecentCalls.Count);
// Update the call history joins
var maxItems = joinMap.RecentCallNamesStart.JoinSpan;
// Create history
uint index = 0;
for (uint i = 0; i < maxItems && i < codec.CallHistory.RecentCalls.Count; i++)
{
trilist.SetString(joinMap.RecentCallNamesStart.JoinNumber + i, codec.CallHistory.RecentCalls[(int)i].Name);
trilist.SetString(joinMap.RecentCallTimesStart.JoinNumber + i, codec.CallHistory.RecentCalls[(int)i].StartTime.ToShortTimeString());
trilist.SetUshort(joinMap.RecentCallOccurrenceType.JoinNumber + i, (ushort)codec.CallHistory.RecentCalls[(int)i].OccurrenceType);
//i++;
index = i;
}
//foreach(var item in codec.CallHistory.RecentCalls)
//{
// trilist.SetString(joinMap.RecentCallNamesStart.JoinNumber + i, item.Name);
// trilist.SetString(joinMap.RecentCallTimesStart.JoinNumber + i, item.StartTime.ToShortTimeString());
// trilist.SetUshort(joinMap.RecentCallOccurrenceType.JoinNumber + i, (ushort)item.OccurrenceType);
// i++;
//}
// Clears existing items
for (uint j = index; j < maxItems; j++)
{
trilist.SetString(joinMap.RecentCallNamesStart.JoinNumber + j, string.Empty);
trilist.SetString(joinMap.RecentCallTimesStart.JoinNumber + j, string.Empty);
trilist.SetUshort(joinMap.RecentCallOccurrenceType.JoinNumber + j, 0);
}
}
private string SetCameraPresetNames(IEnumerable<CodecRoomPreset> presets)
{
return SetCameraPresetNames(presets.Select(p => p.Description).ToList());
}