Added FromNumber and ToNumber
All checks were successful
Branch Build / build-test-deploy (push) Successful in 47s
All checks were successful
Branch Build / build-test-deploy (push) Successful in 47s
This commit is contained in:
@@ -29,15 +29,47 @@ namespace AMWD.Net.Api.Fritz.CallMonitor
|
||||
public int? LinePort { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the external number displayed in the FRITZ!Box.
|
||||
/// Gets the external phone number displayed in the FRITZ!Box.
|
||||
/// </summary>
|
||||
public string? ExternalNumber { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the internal number registered in the FRITZ!Box.
|
||||
/// Gets the internal phone number (part) registered in the FRITZ!Box.
|
||||
/// </summary>
|
||||
public string? InternalNumber { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the phone number from which the call was initiated.
|
||||
/// </summary>
|
||||
public string? FromNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return Event switch
|
||||
{
|
||||
EventType.Ring => ExternalNumber,
|
||||
EventType.Call => InternalNumber,
|
||||
_ => null
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the phone number to which the call was directed.
|
||||
/// </summary>
|
||||
public string? ToNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return Event switch
|
||||
{
|
||||
EventType.Ring => InternalNumber,
|
||||
EventType.Call => ExternalNumber,
|
||||
_ => null
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the duration of the call (only on <see cref="EventType.Disconnect"/> event).
|
||||
/// </summary>
|
||||
|
||||
@@ -158,7 +158,7 @@ namespace AMWD.Net.Api.Fritz.CallMonitor.Utils
|
||||
if (delay > 60 * 1000)
|
||||
delay = 60 * 1000;
|
||||
|
||||
Logger?.LogWarning(ex, $"Failed to connect to {_host}:{_port}. Retrying in {delay}ms...");
|
||||
Logger?.LogWarning(ex, "Failed to connect to {Hostname}:{RemotePort}. Retrying in {DelayMS}ms...", _host, _port, delay);
|
||||
try
|
||||
{
|
||||
await Task.Delay(delay, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
Reference in New Issue
Block a user