Merge pull request #225 from ddyner/HangupRequestEvent

add HangupRequest event
This commit is contained in:
Deantwo 2020-01-27 15:40:33 +01:00 committed by GitHub
commit 6ca6304196
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 0 deletions

View file

@ -0,0 +1,23 @@
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; }
}
}

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;
@ -544,6 +548,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));