re-add musiconholdevent

re-add musiconholdevent
add summaries
This commit is contained in:
Craig Roberts 2018-09-06 21:59:58 -04:00
parent bc29b8feb5
commit 5b2dece945
4 changed files with 152 additions and 5 deletions

View file

@ -0,0 +1,45 @@
namespace AsterNET.Manager.Event
{
/// <summary>
/// A MusicOnHoldEvent is triggered when music on hold starts or stops on a channel.<br/>
/// It is implemented in res/res_musiconhold.c.<br/>
/// Available since Asterisk 1.6
/// </summary>
public class MusicOnHoldEvent : ManagerEvent
{
/// <summary>
/// Creates a new <see cref="MusicOnHoldEvent" />.
/// </summary>
/// <param name="source"><see cref="ManagerConnection"/></param>
public MusicOnHoldEvent(ManagerConnection source) : base(source)
{
}
/// <summary>
/// Gets or sets the state.
/// </summary>
public string State { get; set; }
/// <summary>
/// Gets or sets the class.<br/>
/// The class of music being played on the channel.
/// </summary>
public string Class { get; set; }
/// <summary>
/// Gets or sets the account code.
/// </summary>
public string AccountCode { get; set; }
/// <summary>
/// Gets or sets the language.
/// </summary>
public string Language { get; set; }
/// <summary>
/// Gets or sets the Linked Id<br/>
/// UniqueId of the oldest channel associated with this channel.
/// </summary>
public string LinkedId { get; set; }
}
}

View file

@ -15,24 +15,71 @@
}
/// <summary>
/// Gets or sets the class of music being played on the channel.
/// Gets or sets the class.<br/>
/// The class of music being played on the channel.
/// </summary>
public string Class { get; set; }
/// <summary>
/// Gets or sets the channel state.<br/>
/// A numeric code for the channel's current state, related to ChannelStateDesc
/// </summary>
public string ChannelState { get; set; }
/// <summary>
/// Gets or sets the channel state description.
/// </summary>
public string ChannelStateDesc { get; set; }
/// <summary>
/// Gets or sets the Caller*ID number.
/// </summary>
public string CallerIDNum { get; set; }
/// <summary>
/// Gets or sets the Caller*ID name.
/// </summary>
public string CallerIDName { get; set; }
/// <summary>
/// Gets or sets the connected line number.
/// </summary>
public string ConnectedLineNum { get; set; }
/// <summary>
/// Gets or sets the connected line name.
/// </summary>
public string ConnectedLineName { get; set; }
/// <summary>
/// Gets or sets the language.
/// </summary>
public string Language { get; set; }
/// <summary>
/// Gets or sets the account code.
/// </summary>
public string AccountCode { get; set; }
/// <summary>
/// Gets or sets the context.
/// </summary>
public string Context { get; set; }
/// <summary>
/// Gets or sets the exten.
/// </summary>
public string Exten { get; set; }
/// <summary>
/// Gets or sets the priority.
/// </summary>
public string Priority { get; set; }
/// <summary>
/// Gets or sets the Linked Id
/// UniqueId of the oldest channel associated with this channel.
/// </summary>
public string LinkedId { get; set; }
}
}

View file

@ -13,21 +13,67 @@
public MusicOnHoldStopEvent(ManagerConnection source) : base(source)
{
}
/// <summary>
/// Gets or sets the channel state.<br/>
/// A numeric code for the channel's current state, related to ChannelStateDesc
/// </summary>
public string ChannelState { get; set; }
/// <summary>
/// Gets or sets the channel state description.
/// </summary>
public string ChannelStateDesc { get; set; }
/// <summary>
/// Gets or sets the Caller*ID number.
/// </summary>
public string CallerIDNum { get; set; }
/// <summary>
/// Gets or sets the Caller*ID name.
/// </summary>
public string CallerIDName { get; set; }
/// <summary>
/// Gets or sets the connected line number.
/// </summary>
public string ConnectedLineNum { get; set; }
/// <summary>
/// Gets or sets the connected line name.
/// </summary>
public string ConnectedLineName { get; set; }
/// <summary>
/// Gets or sets the language.
/// </summary>
public string Language { get; set; }
/// <summary>
/// Gets or sets the account code.
/// </summary>
public string AccountCode { get; set; }
/// <summary>
/// Gets or sets the context.
/// </summary>
public string Context { get; set; }
/// <summary>
/// Gets or sets the exten.
/// </summary>
public string Exten { get; set; }
/// <summary>
/// Gets or sets the priority.
/// </summary>
public string Priority { get; set; }
/// <summary>
/// Gets or sets the Linked Id
/// UniqueId of the oldest channel associated with this channel.
/// </summary>
public string LinkedId { get; set; }
}
}

View file

@ -427,12 +427,20 @@ namespace AsterNET.Manager
public event EventHandler<QueueMemberPauseEvent> QueueMemberPause;
/// <summary>
/// Raised when music on hold has started on a channel.
/// Raised when music on hold has started/stopped on a channel.<br />
/// <b>Available since : </b> Asterisk 1.6.
/// </summary>
public event EventHandler<MusicOnHoldEvent> MusicOnHold;
/// <summary>
/// Raised when music on hold has started on a channel.<br />
/// <b>Available since : </b> <see href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+Documentation" target="_blank" alt="Asterisk 12 wiki docs">Asterisk 12</see>.
/// </summary>
public event EventHandler<MusicOnHoldStartEvent> MusicOnHoldStart;
/// <summary>
/// Raised when music on hold has stopped on a channel.
/// Raised when music on hold has stopped on a channel.<br />
/// <b>Available since : </b> <see href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+Documentation" target="_blank" alt="Asterisk 12 wiki docs">Asterisk 12</see>.
/// </summary>
public event EventHandler<MusicOnHoldStopEvent> 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));