diff --git a/Asterisk.2013/Asterisk.NET/Manager/Event/MusicOnHoldEvent.cs b/Asterisk.2013/Asterisk.NET/Manager/Event/MusicOnHoldEvent.cs deleted file mode 100644 index 2655688..0000000 --- a/Asterisk.2013/Asterisk.NET/Manager/Event/MusicOnHoldEvent.cs +++ /dev/null @@ -1,40 +0,0 @@ -namespace AsterNET.Manager.Event -{ - /// - /// The MusicOnHoldEvent event triggers when the music starts or ends playing the hold music.
- /// See LINK - ///
- public class MusicOnHoldEvent : ManagerEvent - { - /// - /// Creates a new empty using the given . - /// - public MusicOnHoldEvent(ManagerConnection source) : base(source) - { - } - - /// - /// States - /// - public enum MusicOnHoldStates - { - /// - /// Unknown - /// - Unknown, - /// - /// Music on hold is started. - /// - Start, - /// - /// Music on hold is stopped. - /// - Stop - } - - /// - /// Get or set state - /// - public MusicOnHoldStates State { get; set; } - } -} diff --git a/Asterisk.2013/Asterisk.NET/Manager/Event/MusicOnHoldStartEvent.cs b/Asterisk.2013/Asterisk.NET/Manager/Event/MusicOnHoldStartEvent.cs new file mode 100644 index 0000000..bfefb31 --- /dev/null +++ b/Asterisk.2013/Asterisk.NET/Manager/Event/MusicOnHoldStartEvent.cs @@ -0,0 +1,38 @@ +namespace AsterNET.Manager.Event +{ + /// + /// Raised when music on hold has started on a channel.
+ /// See https://wiki.asterisk.org/wiki/display/AST/Asterisk+16+ManagerEvent_MusicOnHoldStart + ///
+ public class MusicOnHoldStartEvent : ManagerEvent + { + /// + /// Creates a new . + /// + /// + public MusicOnHoldStartEvent(ManagerConnection source) : base(source) + { + } + + /// + /// Gets or sets the class of music being played on the channel. + /// + public string Class { get; set; } + + public string ChannelState { get; set; } + public string ChannelStateDesc { get; set; } + + public string CallerIDNum { get; set; } + public string CallerIDName { get; set; } + + public string ConnectedLineNum { get; set; } + public string ConnectedLineName { get; set; } + + public string Language { get; set; } + public string AccountCode { get; set; } + public string Context { get; set; } + public string Exten { get; set; } + public string Priority { get; set; } + + } +} diff --git a/Asterisk.2013/Asterisk.NET/Manager/Event/MusicOnHoldStopEvent.cs b/Asterisk.2013/Asterisk.NET/Manager/Event/MusicOnHoldStopEvent.cs new file mode 100644 index 0000000..66598f3 --- /dev/null +++ b/Asterisk.2013/Asterisk.NET/Manager/Event/MusicOnHoldStopEvent.cs @@ -0,0 +1,33 @@ +namespace AsterNET.Manager.Event +{ + /// + /// Raised when music on hold has stopped on a channel.
+ /// See https://wiki.asterisk.org/wiki/display/AST/Asterisk+16+ManagerEvent_MusicOnHoldStop + ///
+ public class MusicOnHoldStopEvent : ManagerEvent + { + /// + /// Creates a new . + /// + /// + public MusicOnHoldStopEvent(ManagerConnection source) : base(source) + { + } + + public string ChannelState { get; set; } + public string ChannelStateDesc { get; set; } + + public string CallerIDNum { get; set; } + public string CallerIDName { get; set; } + + public string ConnectedLineNum { get; set; } + public string ConnectedLineName { get; set; } + + public string Language { get; set; } + public string AccountCode { get; set; } + public string Context { get; set; } + public string Exten { get; set; } + public string Priority { get; set; } + + } +} diff --git a/Asterisk.2013/Asterisk.NET/Manager/ManagerConnection.cs b/Asterisk.2013/Asterisk.NET/Manager/ManagerConnection.cs index 37f983a..d6a34f1 100644 --- a/Asterisk.2013/Asterisk.NET/Manager/ManagerConnection.cs +++ b/Asterisk.2013/Asterisk.NET/Manager/ManagerConnection.cs @@ -427,9 +427,14 @@ namespace AsterNET.Manager public event EventHandler QueueMemberPause; /// - /// Raised when started or stopped music on hold by channel. + /// Raised when music on hold has started on a channel. /// - public event EventHandler MusicOnHold; + public event EventHandler MusicOnHoldStart; + + /// + /// Raised when music on hold has stopped on a channel. + /// + public event EventHandler MusicOnHoldStop; /// /// A ChallengeResponseFailed is triggered when a request's attempt to authenticate has been challenged, and the request failed the authentication challenge. @@ -574,7 +579,8 @@ namespace AsterNET.Manager Helper.RegisterEventHandler(registeredEventHandlers, typeof(QueueCallerJoinEvent), arg => fireEvent(QueueCallerJoin, arg)); Helper.RegisterEventHandler(registeredEventHandlers, typeof(QueueCallerLeaveEvent), arg => fireEvent(QueueCallerLeave, arg)); Helper.RegisterEventHandler(registeredEventHandlers, typeof(QueueMemberPauseEvent), arg => fireEvent(QueueMemberPause, arg)); - Helper.RegisterEventHandler(registeredEventHandlers, typeof(MusicOnHoldEvent), arg => fireEvent(MusicOnHold, arg)); + Helper.RegisterEventHandler(registeredEventHandlers, typeof(MusicOnHoldStartEvent), arg => fireEvent(MusicOnHoldStart, arg)); + Helper.RegisterEventHandler(registeredEventHandlers, typeof(MusicOnHoldStopEvent), arg => fireEvent(MusicOnHoldStop, arg)); Helper.RegisterEventHandler(registeredEventHandlers, typeof(ChallengeResponseFailedEvent), arg => fireEvent(ChallengeResponseFailed, arg)); Helper.RegisterEventHandler(registeredEventHandlers, typeof(InvalidAccountIDEvent), arg => fireEvent(InvalidAccountID, arg)); Helper.RegisterEventHandler(registeredEventHandlers, typeof(DeviceStateChangeEvent), arg => fireEvent(DeviceStateChanged, arg));