diff --git a/Asterisk.2013/Asterisk.NET/Manager/Event/MusicOnHoldEvent.cs b/Asterisk.2013/Asterisk.NET/Manager/Event/MusicOnHoldEvent.cs new file mode 100644 index 0000000..b460ccf --- /dev/null +++ b/Asterisk.2013/Asterisk.NET/Manager/Event/MusicOnHoldEvent.cs @@ -0,0 +1,45 @@ +namespace AsterNET.Manager.Event +{ + /// + /// A MusicOnHoldEvent is triggered when music on hold starts or stops on a channel.
+ /// It is implemented in res/res_musiconhold.c.
+ /// Available since Asterisk 1.6 + ///
+ public class MusicOnHoldEvent : ManagerEvent + { + /// + /// Creates a new . + /// + /// + public MusicOnHoldEvent(ManagerConnection source) : base(source) + { + } + + /// + /// Gets or sets the state. + /// + public string State { get; set; } + + /// + /// Gets or sets the class.
+ /// The class of music being played on the channel. + ///
+ public string Class { get; set; } + + /// + /// Gets or sets the account code. + /// + public string AccountCode { get; set; } + + /// + /// Gets or sets the language. + /// + public string Language { get; set; } + + /// + /// Gets or sets the Linked Id
+ /// UniqueId of the oldest channel associated with this channel. + ///
+ public string LinkedId { get; set; } + } +} diff --git a/Asterisk.2013/Asterisk.NET/Manager/Event/MusicOnHoldStartEvent.cs b/Asterisk.2013/Asterisk.NET/Manager/Event/MusicOnHoldStartEvent.cs index bfefb31..f54096c 100644 --- a/Asterisk.2013/Asterisk.NET/Manager/Event/MusicOnHoldStartEvent.cs +++ b/Asterisk.2013/Asterisk.NET/Manager/Event/MusicOnHoldStartEvent.cs @@ -15,24 +15,71 @@ } /// - /// Gets or sets the class of music being played on the channel. + /// Gets or sets the class.
+ /// The class of music being played on the channel. ///
public string Class { get; set; } + /// + /// Gets or sets the channel state.
+ /// A numeric code for the channel's current state, related to ChannelStateDesc + ///
public string ChannelState { get; set; } + + /// + /// Gets or sets the channel state description. + /// public string ChannelStateDesc { get; set; } + /// + /// Gets or sets the Caller*ID number. + /// public string CallerIDNum { get; set; } + + /// + /// Gets or sets the Caller*ID name. + /// public string CallerIDName { get; set; } + /// + /// Gets or sets the connected line number. + /// public string ConnectedLineNum { get; set; } + + /// + /// Gets or sets the connected line name. + /// public string ConnectedLineName { get; set; } + /// + /// Gets or sets the language. + /// public string Language { get; set; } + + /// + /// Gets or sets the account code. + /// public string AccountCode { get; set; } + + /// + /// Gets or sets the context. + /// public string Context { get; set; } + + /// + /// Gets or sets the exten. + /// public string Exten { get; set; } + + /// + /// Gets or sets the priority. + /// public string Priority { get; set; } + /// + /// Gets or sets the Linked Id + /// UniqueId of the oldest channel associated with this channel. + /// + public string LinkedId { get; set; } } } diff --git a/Asterisk.2013/Asterisk.NET/Manager/Event/MusicOnHoldStopEvent.cs b/Asterisk.2013/Asterisk.NET/Manager/Event/MusicOnHoldStopEvent.cs index 66598f3..4789628 100644 --- a/Asterisk.2013/Asterisk.NET/Manager/Event/MusicOnHoldStopEvent.cs +++ b/Asterisk.2013/Asterisk.NET/Manager/Event/MusicOnHoldStopEvent.cs @@ -13,21 +13,67 @@ public MusicOnHoldStopEvent(ManagerConnection source) : base(source) { } - + + /// + /// Gets or sets the channel state.
+ /// A numeric code for the channel's current state, related to ChannelStateDesc + ///
public string ChannelState { get; set; } + + /// + /// Gets or sets the channel state description. + /// public string ChannelStateDesc { get; set; } - + + /// + /// Gets or sets the Caller*ID number. + /// public string CallerIDNum { get; set; } + + /// + /// Gets or sets the Caller*ID name. + /// public string CallerIDName { get; set; } + /// + /// Gets or sets the connected line number. + /// public string ConnectedLineNum { get; set; } + + /// + /// Gets or sets the connected line name. + /// public string ConnectedLineName { get; set; } + /// + /// Gets or sets the language. + /// public string Language { get; set; } + + /// + /// Gets or sets the account code. + /// public string AccountCode { get; set; } + + /// + /// Gets or sets the context. + /// public string Context { get; set; } + + /// + /// Gets or sets the exten. + /// public string Exten { get; set; } + + /// + /// Gets or sets the priority. + /// public string Priority { get; set; } + /// + /// Gets or sets the Linked Id + /// UniqueId of the oldest channel associated with this channel. + /// + public string LinkedId { get; set; } } } diff --git a/Asterisk.2013/Asterisk.NET/Manager/ManagerConnection.cs b/Asterisk.2013/Asterisk.NET/Manager/ManagerConnection.cs index d6a34f1..e17075a 100644 --- a/Asterisk.2013/Asterisk.NET/Manager/ManagerConnection.cs +++ b/Asterisk.2013/Asterisk.NET/Manager/ManagerConnection.cs @@ -427,12 +427,20 @@ namespace AsterNET.Manager public event EventHandler QueueMemberPause; /// - /// Raised when music on hold has started on a channel. + /// Raised when music on hold has started/stopped on a channel.
+ /// Available since : Asterisk 1.6. + ///
+ public event EventHandler MusicOnHold; + + /// + /// Raised when music on hold has started on a channel.
+ /// Available since : Asterisk 12. ///
public event EventHandler MusicOnHoldStart; /// - /// Raised when music on hold has stopped on a channel. + /// Raised when music on hold has stopped on a channel.
+ /// Available since : Asterisk 12. ///
public event EventHandler MusicOnHoldStop; @@ -579,6 +587,7 @@ 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));