diff --git a/Asterisk.2013/Asterisk.NET/Manager/Event/HangupRequestEvent.cs b/Asterisk.2013/Asterisk.NET/Manager/Event/HangupRequestEvent.cs new file mode 100644 index 0000000..51ad4c7 --- /dev/null +++ b/Asterisk.2013/Asterisk.NET/Manager/Event/HangupRequestEvent.cs @@ -0,0 +1,28 @@ +namespace AsterNET.Manager.Event +{ + /// + /// A HangupRequestEvent is raised when a channel is hang up.
+ ///
+ public class HangupRequestEvent : AbstractChannelEvent + { + /// + public HangupRequestEvent(ManagerConnection source) : base(source) + { + } + + /// + /// Uniqueid of the oldest channel associated with this channel. + /// + public string LinkedId { get; set; } + + /// + /// Get/Set the cause of the hangup. + /// + public int Cause { get; set; } + + /// + /// Get/Set the textual representation of the hangup cause. + /// + public string CauseTxt { get; set; } + } +} \ No newline at end of file diff --git a/Asterisk.2013/Asterisk.NET/Manager/ManagerConnection.cs b/Asterisk.2013/Asterisk.NET/Manager/ManagerConnection.cs index f44421c..d35fde7 100644 --- a/Asterisk.2013/Asterisk.NET/Manager/ManagerConnection.cs +++ b/Asterisk.2013/Asterisk.NET/Manager/ManagerConnection.cs @@ -177,6 +177,10 @@ namespace AsterNET.Manager /// public event EventHandler Hangup; /// + /// A HangupRequestEvent is raised when a channel is hang up.
+ ///
+ public event EventHandler HangupRequest; + /// /// A HoldedCall is triggered when a channel is put on hold.
///
public event EventHandler HoldedCall; @@ -534,6 +538,7 @@ namespace AsterNET.Manager Helper.RegisterEventHandler(registeredEventHandlers, typeof(DNDStateEvent), arg => fireEvent(DNDState, arg)); Helper.RegisterEventHandler(registeredEventHandlers, typeof(ExtensionStatusEvent), arg => fireEvent(ExtensionStatus, 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(HoldEvent), arg => fireEvent(Hold, arg)); Helper.RegisterEventHandler(registeredEventHandlers, typeof(JoinEvent), arg => fireEvent(Join, arg));