Compare commits

...

12 Commits

Author SHA1 Message Date
Neil Dorin
59bfa354e4 feat(essentials): switches to userId argument 2021-11-04 16:15:59 -06:00
Neil Dorin
536e82ef22 feat(essentials): adds new features for ZoomRoom
Adds IHasMeetingLock and adds new methods to IHasParticipants
2021-11-04 16:11:26 -06:00
Andrew Welker
63cd322fd0 Merge pull request #858 from PepperDash/hotfix/add-logging-if-no-defaultAudioDevice-set
Adds more deliberate exception and logging for missing `defaultAudioKey` property value
2021-11-03 16:35:52 -06:00
Andrew Welker
489ba2da04 Merge branch 'main' into hotfix/add-logging-if-no-defaultAudioDevice-set 2021-11-03 14:56:27 -06:00
Neil Dorin
8087aa7a75 Adds more deliberate exception and logging for missing defaultAudioKey property value 2021-11-03 14:48:10 -06:00
Neil Dorin
a8d0dfb327 Merge pull request #852 from PepperDash/hotfix/dm-usb-routing
Hotfix/dm usb routing
2021-10-27 10:39:17 -06:00
Andrew Welker
cef9e0a9a6 Update UsbOutput routing 2021-10-27 07:46:50 -06:00
Andrew Welker
16369e31cf fix USB routing 2021-10-27 07:46:50 -06:00
Andrew Welker
38959414ff Fix USB Routing issue 2021-10-27 07:46:50 -06:00
Neil Dorin
bc3247297e Merge pull request #846 from PepperDash/hotfix/zoom-meetings-simpl 2021-10-07 12:48:32 -06:00
Andrew Welker
f7bf728263 fix(Devices_Common): Clear meeting list and fire event if no meetings are scheduled 2021-10-07 09:48:02 -06:00
Neil Dorin
025bf7adfb Merge pull request #840 from PepperDash/hotfix/PD-Core-update-initialize
Implement Initialize Method & Update PD Core
2021-09-28 13:09:25 -06:00
8 changed files with 263 additions and 20 deletions

View File

@@ -214,17 +214,25 @@ namespace PepperDash.Essentials
VideoCodec = DeviceManager.GetDeviceForKey(PropertiesConfig.VideoCodecKey) as
PepperDash.Essentials.Devices.Common.VideoCodec.VideoCodecBase;
if (VideoCodec == null)
throw new ArgumentNullException("codec cannot be null");
{
Debug.Console(0, Debug.ErrorLogLevel.Error, "No Video Codec set. Please check 'videoCodecKey' property in room config");
throw new ArgumentNullException("VideoCodec cannot be null");
}
AudioCodec = DeviceManager.GetDeviceForKey(PropertiesConfig.AudioCodecKey) as
PepperDash.Essentials.Devices.Common.AudioCodec.AudioCodecBase;
if (AudioCodec == null)
Debug.Console(0, this, "No Audio Codec Found");
DefaultAudioDevice = DeviceManager.GetDeviceForKey(PropertiesConfig.DefaultAudioKey) as IBasicVolumeControls;
if (DefaultAudioDevice == null)
{
Debug.Console(0, Debug.ErrorLogLevel.Error, "No Default Audio Device set. Please check 'defaultAudioKey' property in room config");
throw new ArgumentNullException("DefaultAudioDevice cannot be null");
}
InitializeRoom();
}

View File

@@ -1285,7 +1285,10 @@ namespace PepperDash.Essentials.DM
var output = outputSelector as DMOutput;
if (output == null)
var isUsbInput = (sigType & eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput;
var isUsbOutput = (sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput;
if (output == null && !(isUsbOutput || isUsbInput))
{
Debug.Console(0, this, Debug.ErrorLogLevel.Warning,
"Unable to execute switch for inputSelector {0} to outputSelector {1}", inputSelector,
@@ -1316,7 +1319,10 @@ namespace PepperDash.Essentials.DM
if ((sigType & eRoutingSignalType.Video) == eRoutingSignalType.Video)
{
Chassis.VideoEnter.BoolValue = true;
output.VideoOut = input; //Chassis.Outputs[output].VideoOut = inCard;
if (output != null)
{
output.VideoOut = input; //Chassis.Outputs[output].VideoOut = inCard;
}
}
if ((sigType & eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
@@ -1326,17 +1332,66 @@ namespace PepperDash.Essentials.DM
{
dmMdMnxn.AudioEnter.BoolValue = true;
}
output.AudioOut = input;
//Chassis.Outputs[output].AudioOut = inCard;
if (output != null)
{
output.AudioOut = input;
}
}
if ((sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput || (sigType & eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput)
if ((sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput)
{
Chassis.USBEnter.BoolValue = true;
output.USBRoutedTo = input;
Chassis.USBEnter.BoolValue = true;
if (inputSelector == null && output != null)
{
//clearing the route is intended
output.USBRoutedTo = null;
return;
}
if (inputSelector != null && input == null)
{
//input selector is DMOutput...we're doing a out to out route
var tempInput = inputSelector as DMOutput;
if (tempInput == null || output == null)
{
return;
}
output.USBRoutedTo = tempInput;
return;
}
if (input != null & output != null)
{
output.USBRoutedTo = input;
}
}
if((sigType & eRoutingSignalType.UsbInput) != eRoutingSignalType.UsbInput)
{
return;
}
Chassis.USBEnter.BoolValue = true;
if (output != null)
{
output.USBRoutedTo = input;
return;
}
var tempOutput = outputSelector as DMInput;
if (tempOutput == null)
{
Debug.Console(0, this, Debug.ErrorLogLevel.Warning,
"Unable to execute switch for inputSelector {0} to outputSelector {1}", inputSelector,
outputSelector);
return;
}
tempOutput.USBRoutedTo = input;
}
#endregion
#region IRoutingNumeric Members
@@ -1349,8 +1404,10 @@ namespace PepperDash.Essentials.DM
DMInputOutputBase dmCard;
//Routing Input to Input or Output to Input
if ((sigType & eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput)
{
Debug.Console(2, this, "Executing USB Input switch.\r\n in:{0} output: {1}", inputSelector, outputSelector);
if (outputSelector > chassisSize)
{
uint outputIndex;
@@ -1370,13 +1427,14 @@ namespace PepperDash.Essentials.DM
dmCard = Chassis.Inputs[inputSelector];
}
ExecuteSwitch(dmCard, Chassis.Outputs[outputSelector], sigType);
ExecuteSwitch(dmCard, Chassis.Inputs[outputSelector], sigType);
return;
}
if ((sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput)
{
Debug.Console(2, this, "Executing USB Output switch.\r\n in:{0} output: {1}", inputSelector, outputSelector);
//routing Output to Output or Input to Output
if (inputSelector > chassisSize)
{
//wanting to route an output to an output. Subtract chassis size and get output, unless it's 8x8

View File

@@ -121,6 +121,7 @@
<Compile Include="Cameras\CameraControl.cs" />
<Compile Include="Display\PanasonicThDisplay.cs" />
<Compile Include="VideoCodec\Interfaces\IHasMeetingInfo.cs" />
<Compile Include="VideoCodec\Interfaces\IHasMeetingLock.cs" />
<Compile Include="VideoCodec\Interfaces\IHasParticipants.cs" />
<Compile Include="VideoCodec\Interfaces\IHasPresentationOnlyMeeting.cs" />
<Compile Include="VideoCodec\Interfaces\IHasSelfviewPosition.cs" />

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces
{
public interface IHasMeetingLock
{
BoolFeedback MeetingIsLockedFeedback { get; }
void LockMeeting();
void UnLockMeeting();
void ToggleMeetingLock();
}
}

View File

@@ -12,6 +12,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces
public interface IHasParticipants
{
CodecParticipants Participants { get; }
/// <summary>
/// Removes the participant from the meeting
/// </summary>
/// <param name="participant"></param>
void RemoveParticipant(int userId);
/// <summary>
/// Sets the participant as the new host
/// </summary>
/// <param name="participant"></param>
void SetParticipantAsHost(int userId);
}
/// <summary>
@@ -29,6 +41,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces
/// </summary>
public interface IHasParticipantAudioMute : IHasParticipantVideoMute
{
/// <summary>
/// Mute audio of all participants
/// </summary>
void MuteAudioForAllParticipants();
void MuteAudioForParticipant(int userId);
void UnmuteAudioForParticipant(int userId);
void ToggleAudioForParticipant(int userId);

View File

@@ -298,6 +298,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
}
LinkVideoCodecToApi(codec, trilist, joinMap);
trilist.OnlineStatusChange += (device, args) =>
{
if (!args.DeviceOnLine) return;
trilist.SetString(joinMap.Schedule.JoinNumber, "\xFC");
};
}
/// <summary>
@@ -785,6 +792,16 @@ ScreenIndexIsPinnedTo: {8} (a{17})
_currentMeetings = codec.CodecSchedule.Meetings.Where(m => m.StartTime >= currentTime || m.EndTime >= currentTime).ToList();
if (_currentMeetings.Count == 0)
{
var emptyXSigByteArray = XSigHelpers.ClearOutputs();
var emptyXSigString = Encoding.GetEncoding(XSigEncoding)
.GetString(emptyXSigByteArray, 0, emptyXSigByteArray.Length);
trilist.SetString(joinMap.Schedule.JoinNumber, emptyXSigString);
return;
}
var meetingsData = UpdateMeetingsListXSig(_currentMeetings);
trilist.SetString(joinMap.Schedule.JoinNumber, meetingsData);
trilist.SetUshort(joinMap.MeetingCount.JoinNumber, (ushort)_currentMeetings.Count);

View File

@@ -1123,9 +1123,25 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
}
}
public class Lock
public class Lock : NotifiableObject
{
public bool Enable { get; set; }
private bool _enable;
public bool Enable
{
get
{
return _enable;
}
set
{
if (value != _enable)
{
_enable = value;
NotifyPropertyChanged("Enable");
}
}
}
}
public class ClosedCaption

View File

@@ -26,7 +26,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
IRouting,
IHasScheduleAwareness, IHasCodecCameras, IHasParticipants, IHasCameraOff, IHasCameraMute, IHasCameraAutoMode,
IHasFarEndContentStatus, IHasSelfviewPosition, IHasPhoneDialing, IHasZoomRoomLayouts, IHasParticipantPinUnpin,
IHasParticipantAudioMute, IHasSelfviewSize, IPasswordPrompt, IHasStartMeeting, IHasMeetingInfo, IHasPresentationOnlyMeeting
IHasParticipantAudioMute, IHasSelfviewSize, IPasswordPrompt, IHasStartMeeting, IHasMeetingInfo, IHasPresentationOnlyMeeting, IHasMeetingLock
{
private const long MeetingRefreshTimer = 60000;
public uint DefaultMeetingDurationMin { get; private set; }
@@ -147,6 +147,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
ContentSwappedWithThumbnailFeedback = new BoolFeedback(ContentSwappedWithThumbnailFeedbackFunc);
NumberOfScreensFeedback = new IntFeedback(NumberOfScreensFeedbackFunc);
MeetingIsLockedFeedback = new BoolFeedback(() => Configuration.Call.Lock.Enable );
}
public CommunicationGather PortGather { get; private set; }
@@ -597,6 +599,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
}
};
Configuration.Call.Lock.PropertyChanged += (o, a) =>
{
if (a.PropertyName == "Enable")
{
MeetingIsLockedFeedback.FireUpdate();
}
};
// This is to deal with incorrect object structure coming back from the Zoom Room on v 5.6.3
Configuration.Client.Call.Layout.PropertyChanged += (o, a) =>
{
@@ -1306,11 +1316,16 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
var codecBookings = JsonConvert.DeserializeObject<List<zCommand.BookingsListResult>>(
responseObj.ToString());
if (codecBookings != null && codecBookings.Count > 0)
{
CodecSchedule.Meetings = zCommand.GetGenericMeetingsFromBookingResult(
codecBookings, CodecSchedule.MeetingWarningMinutes);
}
if (codecBookings != null && codecBookings.Count > 0)
{
CodecSchedule.Meetings = zCommand.GetGenericMeetingsFromBookingResult(
codecBookings, CodecSchedule.MeetingWarningMinutes);
}
else
{
//need to clear the list if it's empty
CodecSchedule.Meetings = new List<Meeting>();
}
break;
}
@@ -2329,6 +2344,56 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
}
}
/// <summary>
/// Invites contacts to a new meeting for a specified duration
/// </summary>
/// <param name="contacts"></param>
/// <param name="duration"></param>
public void InviteContactsToNewMeeting(InvitableDirectoryContact[] contacts, uint duration)
{
if(duration == 0)
{
duration = DefaultMeetingDurationMin;
}
StringBuilder message = new StringBuilder();
// Add the prefix
message.Append(string.Format("zCommand Invite Duration: {0}", duration));
// Add each invitee
foreach (var contact in contacts)
{
var invitee = string.Format(" user: {0}", contact.ContactId);
message.Append(invitee);
}
SendText(message.ToString());
}
/// <summary>
/// Invites contacts to an existing meeting
/// </summary>
/// <param name="contacts"></param>
public void InviteContactsToExistingMeeting(InvitableDirectoryContact[] contacts)
{
StringBuilder message = new StringBuilder();
// Add the prefix
message.Append(string.Format("zCommand Call Invite"));
// Add each invitee
foreach (var contact in contacts)
{
var invitee = string.Format(" user: {0}", contact.ContactId);
message.Append(invitee);
}
SendText(message.ToString());
}
/// <summary>
/// Starts a PMI Meeting for the specified duration (or default meeting duration if 0 is specified)
@@ -2464,10 +2529,25 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public CodecParticipants Participants { get; private set; }
public void RemoveParticipant(int userId)
{
SendText(string.Format("zCommand Call Expel Id: {0}", userId));
}
public void SetParticipantAsHost(int userId)
{
SendText(string.Format("zCommand Call HostChange Id: {0}", userId));
}
#endregion
#region IHasParticipantAudioMute Members
public void MuteAudioForAllParticipants()
{
SendText(string.Format("zCommand Call MuteAll Mute: on"));
}
public void MuteAudioForParticipant(int userId)
{
SendText(string.Format("zCommand Call MuteParticipant Mute: on Id: {0}", userId));
@@ -3029,7 +3109,35 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
}
#endregion
}
#region IHasMeetingLock Members
public BoolFeedback MeetingIsLockedFeedback { get; private set; }
public void LockMeeting()
{
SendText(string.Format("zConfiguration Call Lock Enable: on"));
}
public void UnLockMeeting()
{
SendText(string.Format("zConfiguration Call Lock Enable: off"));
}
public void ToggleMeetingLock()
{
if (MeetingIsLockedFeedback.BoolValue)
{
UnLockMeeting();
}
else
{
LockMeeting();
}
}
#endregion
}
/// <summary>
/// Zoom Room specific info object