feat: add actions to accept and reject calls in IHasDialerMessenger

This commit is contained in:
Neil Dorin 2026-06-17 22:25:38 -06:00
parent cff46532be
commit 747b595b59

View file

@ -47,6 +47,18 @@ namespace PepperDash.Essentials.AppServer.Messengers
var s = content.ToObject<MobileControlSimpleContent<string>>();
_dialer.SendDtmf(s.Value);
});
AddAction("/acceptCall", (id, content) =>
{
var callItem = content.ToObject<CodecActiveCallItem>();
_dialer.AcceptCall(callItem);
});
AddAction("/rejectCall", (id, content) =>
{
var callItem = content.ToObject<CodecActiveCallItem>();
_dialer.RejectCall(callItem);
});
}
private void Dialer_CallStatusChange(object sender, CodecCallStatusItemChangeEventArgs e)
@ -55,7 +67,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
{
var state = new IHasDialerStateMessage
{
IsInCall = _dialer.IsInCall
IsInCall = _dialer.IsInCall,
CallItem = e.CallItem
};
PostStatusMessage(state);
@ -94,5 +107,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
/// </summary>
[JsonProperty("isInCall", NullValueHandling = NullValueHandling.Ignore)]
public bool? IsInCall { get; set; }
[JsonProperty("callItem", NullValueHandling = NullValueHandling.Ignore)]
public CodecActiveCallItem CallItem { get; set; }
}
}