feat(essentials): Implements IPasswordPrompt on ZoomRoom

This commit is contained in:
Neil Dorin
2021-08-18 14:45:16 -06:00
parent f8129fe7ae
commit f298b5cc41
2 changed files with 53 additions and 3 deletions

View File

@@ -927,6 +927,15 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
PhoneCallStatus_InCall,
PhoneCallStatus_Init,
}
public class MeetingNeedsPassword
{
[JsonProperty("needsPassword")]
public bool NeedsPassword { get; set; }
[JsonProperty("wrongAndRetry")]
public bool WrongAndRetry { get; set; }
}
}
/// <summary>

View File

@@ -25,7 +25,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
IRouting,
IHasScheduleAwareness, IHasCodecCameras, IHasParticipants, IHasCameraOff, IHasCameraMute, IHasCameraAutoMode,
IHasFarEndContentStatus, IHasSelfviewPosition, IHasPhoneDialing, IHasZoomRoomLayouts, IHasParticipantPinUnpin,
IHasParticipantAudioMute, IHasSelfviewSize
IHasParticipantAudioMute, IHasSelfviewSize, IPasswordPrompt
{
private const long MeetingRefreshTimer = 60000;
private const uint DefaultMeetingDurationMin = 30;
@@ -45,6 +45,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
private StringBuilder _jsonMessage;
private int _previousVolumeLevel;
private CameraBase _selectedCamera;
private string _lastDialedMeetingNumber;
private readonly ZoomRoomPropertiesConfig _props;
@@ -1349,7 +1350,16 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
}
case "meetingneedspassword":
{
// TODO: notify user to enter a password
var meetingNeedsPassword =
responseObj.ToObject<zEvent.MeetingNeedsPassword>();
if (meetingNeedsPassword.NeedsPassword)
{
var prompt = "Password required to join this meeting. Please enter the meeting password.";
OnPasswordRequired(meetingNeedsPassword.WrongAndRetry, false, false, prompt);
}
break;
}
case "needwaitforhost":
@@ -2041,9 +2051,20 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public override void Dial(string number)
{
_lastDialedMeetingNumber = number;
SendText(string.Format("zCommand Dial Join meetingNumber: {0}", number));
}
/// <summary>
/// Dials a meeting with a password
/// </summary>
/// <param name="number"></param>
/// <param name="password"></param>
public void Dial(string number, string password)
{
SendText(string.Format("zCommand Dial Join meetingNumber: {0} password: {1}", number, password));
}
/// <summary>
/// Invites a contact to either a new meeting (if not already in a meeting) or the current meeting.
/// Currently only invites a single user
@@ -2672,7 +2693,27 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
}
#endregion
}
#region IPasswordPrompt Members
public event EventHandler<PasswordPromptEventArgs> PasswordRequired;
public void SubmitPassword(string password)
{
Dial(_lastDialedMeetingNumber, password);
}
void OnPasswordRequired(bool lastAttemptIncorrect, bool loginFailed, bool loginCancelled, string message)
{
var handler = PasswordRequired;
if (handler != null)
{
handler(this, new PasswordPromptEventArgs(lastAttemptIncorrect, loginFailed, loginCancelled, message));
}
}
#endregion
}
/// <summary>
/// Zoom Room specific info object