add HangupRequest event

This commit is contained in:
Denis Dyner 2020-01-24 22:13:52 +03:00
parent 2428cc1e8b
commit e1c51cafcb
2 changed files with 33 additions and 0 deletions

View file

@ -0,0 +1,28 @@
namespace AsterNET.Manager.Event
{
/// <summary>
/// A HangupRequestEvent is raised when a channel is hang up.<br/>
/// </summary>
public class HangupRequestEvent : AbstractChannelEvent
{
/// <inheritdoc />
public HangupRequestEvent(ManagerConnection source) : base(source)
{
}
/// <summary>
/// Uniqueid of the oldest channel associated with this channel.
/// </summary>
public string LinkedId { get; set; }
/// <summary>
/// Get/Set the cause of the hangup.
/// </summary>
public int Cause { get; set; }
/// <summary>
/// Get/Set the textual representation of the hangup cause.
/// </summary>
public string CauseTxt { get; set; }
}
}

View file

@ -177,6 +177,10 @@ namespace AsterNET.Manager
/// </summary> /// </summary>
public event EventHandler<HangupEvent> Hangup; public event EventHandler<HangupEvent> Hangup;
/// <summary> /// <summary>
/// A HangupRequestEvent is raised when a channel is hang up.<br/>
/// </summary>
public event EventHandler<HangupRequestEvent> HangupRequest;
/// <summary>
/// A HoldedCall is triggered when a channel is put on hold.<br/> /// A HoldedCall is triggered when a channel is put on hold.<br/>
/// </summary> /// </summary>
public event EventHandler<HoldedCallEvent> HoldedCall; public event EventHandler<HoldedCallEvent> HoldedCall;
@ -534,6 +538,7 @@ namespace AsterNET.Manager
Helper.RegisterEventHandler(registeredEventHandlers, typeof(DNDStateEvent), arg => fireEvent(DNDState, arg)); Helper.RegisterEventHandler(registeredEventHandlers, typeof(DNDStateEvent), arg => fireEvent(DNDState, arg));
Helper.RegisterEventHandler(registeredEventHandlers, typeof(ExtensionStatusEvent), arg => fireEvent(ExtensionStatus, arg)); Helper.RegisterEventHandler(registeredEventHandlers, typeof(ExtensionStatusEvent), arg => fireEvent(ExtensionStatus, arg));
Helper.RegisterEventHandler(registeredEventHandlers, typeof(HangupEvent), arg => fireEvent(Hangup, arg)); Helper.RegisterEventHandler(registeredEventHandlers, typeof(HangupEvent), arg => fireEvent(Hangup, arg));
Helper.RegisterEventHandler(registeredEventHandlers, typeof(HangupRequestEvent), arg => fireEvent(HangupRequest, arg));
Helper.RegisterEventHandler(registeredEventHandlers, typeof(HoldedCallEvent), arg => fireEvent(HoldedCall, arg)); Helper.RegisterEventHandler(registeredEventHandlers, typeof(HoldedCallEvent), arg => fireEvent(HoldedCall, arg));
Helper.RegisterEventHandler(registeredEventHandlers, typeof(HoldEvent), arg => fireEvent(Hold, arg)); Helper.RegisterEventHandler(registeredEventHandlers, typeof(HoldEvent), arg => fireEvent(Hold, arg));
Helper.RegisterEventHandler(registeredEventHandlers, typeof(JoinEvent), arg => fireEvent(Join, arg)); Helper.RegisterEventHandler(registeredEventHandlers, typeof(JoinEvent), arg => fireEvent(Join, arg));