feat: add Dial method with password support and implement ICodecCallControlsMessenger for call control messaging

This commit is contained in:
Neil Dorin 2026-06-25 20:30:48 -06:00
parent 8748157362
commit b945ecb470
7 changed files with 57 additions and 8 deletions

View file

@ -18,4 +18,11 @@ public interface ICodecCallControls : IHasDialer
/// </summary>
/// <param name="meeting">The meeting to dial</param>
void Dial(Meeting meeting);
/// <summary>
/// Dials the specified number with an optional password
/// </summary>
/// <param name="number">The number to dial</param>
/// <param name="password">The optional password for the call</param>
void Dial(string number, string password);
}

View file

@ -205,6 +205,26 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
}
public override void Dial(string number, string password)
{
Debug.LogMessage(LogEventLevel.Debug, this, "Dial: {0} with password: {1}", number, password);
var call = new CodecActiveCallItem() { Name = number, Number = number, Id = number, Status = eCodecCallStatus.Dialing, Direction = eCodecCallDirection.Outgoing, Type = eCodecCallType.Video };
ActiveCalls.Add(call);
OnCallStatusChange(call);
//ActiveCallCountFeedback.FireUpdate();
// Simulate 2-second ring, then connecting, then connected
var dialTimer = new Timer(2000) { AutoReset = false };
dialTimer.Elapsed += (s, e) =>
{
call.Type = eCodecCallType.Video;
SetNewCallStatusAndFireCallStatusChange(eCodecCallStatus.Connecting, call);
var connectTimer = new Timer(1000) { AutoReset = false };
connectTimer.Elapsed += (ss, ee) => SetNewCallStatusAndFireCallStatusChange(eCodecCallStatus.Connected, call);
connectTimer.Start();
};
dialTimer.Start();
}
/// <inheritdoc />
public override void EndCall(CodecActiveCallItem call)
{

View file

@ -272,6 +272,8 @@ public abstract class VideoCodecBase : ReconfigurableDevice, IRoutingSource,
/// </summary>
public abstract void Dial(string number);
public abstract void Dial(string number, string password);
/// <summary>
/// Ends the specified call
/// </summary>