mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-07-02 10:38:16 +00:00
feat: add actions to accept and reject calls in IHasDialerMessenger
This commit is contained in:
parent
cff46532be
commit
747b595b59
1 changed files with 17 additions and 1 deletions
|
|
@ -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; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue