Merge pull request #172 from moldypenguins/MusicOnHoldEvent

Added MusicOnHoldEvent, MusicOnHoldStartEvent and MusicOnHoldStopEvent.
This commit is contained in:
Deantwo 2018-09-14 11:19:17 +02:00 committed by GitHub
commit 73a814f13d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 242 additions and 11 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

@ -0,0 +1,85 @@
namespace AsterNET.Manager.Event
{
/// <summary>
/// Raised when music on hold has started on a channel.<br />
/// See <see target="_blank" href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+16+ManagerEvent_MusicOnHoldStart">https://wiki.asterisk.org/wiki/display/AST/Asterisk+16+ManagerEvent_MusicOnHoldStart</see>
/// </summary>
public class MusicOnHoldStartEvent : ManagerEvent
{
/// <summary>
/// Creates a new <see cref="MusicOnHoldStartEvent" />.
/// </summary>
/// <param name="source"><see cref="ManagerConnection"/></param>
public MusicOnHoldStartEvent(ManagerConnection source) : base(source)
{
}
/// <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 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

@ -0,0 +1,79 @@
namespace AsterNET.Manager.Event
{
/// <summary>
/// Raised when music on hold has stopped on a channel.<br />
/// See <see target="_blank" href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+16+ManagerEvent_MusicOnHoldStop">https://wiki.asterisk.org/wiki/display/AST/Asterisk+16+ManagerEvent_MusicOnHoldStop</see>
/// </summary>
public class MusicOnHoldStopEvent : ManagerEvent
{
/// <summary>
/// Creates a new <see cref="MusicOnHoldStopEvent" />.
/// </summary>
/// <param name="source"><see cref="ManagerConnection"/></param>
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

@ -434,6 +434,24 @@ namespace AsterNET.Manager
/// </summary>
public event EventHandler<QueueMemberPauseEvent> QueueMemberPause;
/// <summary>
/// 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.<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;
/// <summary>
/// A ChallengeResponseFailed is triggered when a request's attempt to authenticate has been challenged, and the request failed the authentication challenge.
/// </summary>
@ -579,6 +597,9 @@ 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));

View file

@ -7,7 +7,7 @@
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>186124f7-82fa-4562-8b87-33d53a84e8ba</ProjectGuid>
<SHFBSchemaVersion>1.9.9.0</SHFBSchemaVersion>
<SHFBSchemaVersion>2017.9.26.0</SHFBSchemaVersion>
<!-- AssemblyName, Name, and RootNamespace are not used by SHFB but Visual Studio adds them anyway -->
<AssemblyName>Documentation</AssemblyName>
<RootNamespace>Documentation</RootNamespace>
@ -49,16 +49,17 @@
<ContentPlacement>AboveNamespaces</ContentPlacement>
<NamespaceSummaries>
<NamespaceSummaryItem name="(global)" isDocumented="False" xmlns="" />
<NamespaceSummaryItem name="AsterNET" isDocumented="True" xmlns="">AsterNet</NamespaceSummaryItem>
<NamespaceSummaryItem name="AsterNET.FastAGI" isDocumented="True" xmlns="">AsterNet FastAGI</NamespaceSummaryItem>
<NamespaceSummaryItem name="AsterNET.FastAGI.Command" isDocumented="True" xmlns="">AsterNet FastAGI Command</NamespaceSummaryItem>
<NamespaceSummaryItem name="AsterNET.FastAGI.MappingStrategies" isDocumented="True" xmlns="">AsterNet FastAGI Mapping Strategies</NamespaceSummaryItem>
<NamespaceSummaryItem name="AsterNET.IO" isDocumented="True" xmlns="">AsterNet IO</NamespaceSummaryItem>
<NamespaceSummaryItem name="AsterNET.Manager" isDocumented="True" xmlns="">AsterNet Manager</NamespaceSummaryItem>
<NamespaceSummaryItem name="AsterNET.Manager.Action" isDocumented="True" xmlns="">AsterNet Manager Action</NamespaceSummaryItem>
<NamespaceSummaryItem name="AsterNET.Manager.Event" isDocumented="True" xmlns="">AsterNet Manager Event</NamespaceSummaryItem>
<NamespaceSummaryItem name="AsterNET.Manager.Response" isDocumented="True" xmlns="">AsterNet Manager Response</NamespaceSummaryItem>
<NamespaceSummaryItem name="AsterNET.Util" isDocumented="True" xmlns="">AsterNet Util</NamespaceSummaryItem></NamespaceSummaries>
<NamespaceSummaryItem name="AsterNET" isDocumented="True" xmlns="">AsterNet</NamespaceSummaryItem>
<NamespaceSummaryItem name="AsterNET.FastAGI" isDocumented="True" xmlns="">AsterNet FastAGI</NamespaceSummaryItem>
<NamespaceSummaryItem name="AsterNET.FastAGI.Command" isDocumented="True" xmlns="">AsterNet FastAGI Command</NamespaceSummaryItem>
<NamespaceSummaryItem name="AsterNET.FastAGI.MappingStrategies" isDocumented="True" xmlns="">AsterNet FastAGI Mapping Strategies</NamespaceSummaryItem>
<NamespaceSummaryItem name="AsterNET.IO" isDocumented="True" xmlns="">AsterNet IO</NamespaceSummaryItem>
<NamespaceSummaryItem name="AsterNET.Manager" isDocumented="True" xmlns="">AsterNet Manager</NamespaceSummaryItem>
<NamespaceSummaryItem name="AsterNET.Manager.Action" isDocumented="True" xmlns="">AsterNet Manager Action</NamespaceSummaryItem>
<NamespaceSummaryItem name="AsterNET.Manager.Event" isDocumented="True" xmlns="">AsterNet Manager Event</NamespaceSummaryItem>
<NamespaceSummaryItem name="AsterNET.Manager.Response" isDocumented="True" xmlns="">AsterNet Manager Response</NamespaceSummaryItem>
<NamespaceSummaryItem name="AsterNET.Util" isDocumented="True" xmlns="">AsterNet Util</NamespaceSummaryItem>
</NamespaceSummaries>
<ProjectSummary>
AsterNET is an open source .NET framework for Asterisk AMI and FastAGI. AsterNET allows you to talk to Asterisk AMI from any .NET application and create FastAGI applications in any .NET language. http://www.xdev.net/projects/asternet/ </ProjectSummary>
</PropertyGroup>