Add MusicOnHoldEvent
This commit is contained in:
parent
03f51ba65e
commit
6da426507e
41
Asterisk.2013/Asterisk.NET/Manager/Event/MusicOnHoldEvent.cs
Normal file
41
Asterisk.2013/Asterisk.NET/Manager/Event/MusicOnHoldEvent.cs
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
namespace AsterNET.Manager.Event
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The MusicOnHoldEvent event triggers when the music starts or ends playing the hold music.
|
||||||
|
/// </summary>
|
||||||
|
public class MusicOnHoldEvent : ManagerEvent
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a new instance of the class <see cref="MusicOnHoldEvent"/>.
|
||||||
|
/// </summary>
|
||||||
|
public MusicOnHoldEvent(ManagerConnection source) : base(source)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// States
|
||||||
|
/// </summary>
|
||||||
|
public enum MusicOnHoldStates
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Unknown
|
||||||
|
/// </summary>
|
||||||
|
Unknown,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Music on hold is started.
|
||||||
|
/// </summary>
|
||||||
|
Start,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Music on hold is stoped.
|
||||||
|
/// </summary>
|
||||||
|
Stop
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get or set state
|
||||||
|
/// </summary>
|
||||||
|
public MusicOnHoldStates State { get; set; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -425,6 +425,10 @@ namespace AsterNET.Manager
|
||||||
/// <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>.
|
/// <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>
|
/// </summary>
|
||||||
public event EventHandler<QueueMemberPauseEvent> QueueMemberPause;
|
public event EventHandler<QueueMemberPauseEvent> QueueMemberPause;
|
||||||
|
/// <summary>
|
||||||
|
/// Raised when started or stopped music on hold by channel.
|
||||||
|
/// </summary>
|
||||||
|
public event EventHandler<MusicOnHoldEvent> MusicOnHold;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A ChallengeResponseFailed is triggered when a request's attempt to authenticate has been challenged, and the request failed the authentication challenge.
|
/// A ChallengeResponseFailed is triggered when a request's attempt to authenticate has been challenged, and the request failed the authentication challenge.
|
||||||
|
@ -569,6 +573,7 @@ namespace AsterNET.Manager
|
||||||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(QueueCallerJoinEvent), arg => fireEvent(QueueCallerJoin, arg));
|
Helper.RegisterEventHandler(registeredEventHandlers, typeof(QueueCallerJoinEvent), arg => fireEvent(QueueCallerJoin, arg));
|
||||||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(QueueCallerLeaveEvent), arg => fireEvent(QueueCallerLeave, arg));
|
Helper.RegisterEventHandler(registeredEventHandlers, typeof(QueueCallerLeaveEvent), arg => fireEvent(QueueCallerLeave, arg));
|
||||||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(QueueMemberPauseEvent), arg => fireEvent(QueueMemberPause, arg));
|
Helper.RegisterEventHandler(registeredEventHandlers, typeof(QueueMemberPauseEvent), arg => fireEvent(QueueMemberPause, arg));
|
||||||
|
Helper.RegisterEventHandler(registeredEventHandlers, typeof(MusicOnHoldEvent), arg => fireEvent(MusicOnHold, arg));
|
||||||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(ChallengeResponseFailedEvent), arg => fireEvent(ChallengeResponseFailed, arg));
|
Helper.RegisterEventHandler(registeredEventHandlers, typeof(ChallengeResponseFailedEvent), arg => fireEvent(ChallengeResponseFailed, arg));
|
||||||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(InvalidAccountIDEvent), arg => fireEvent(InvalidAccountID, arg));
|
Helper.RegisterEventHandler(registeredEventHandlers, typeof(InvalidAccountIDEvent), arg => fireEvent(InvalidAccountID, arg));
|
||||||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(DeviceStateChangeEvent), arg => fireEvent(DeviceStateChanged, arg));
|
Helper.RegisterEventHandler(registeredEventHandlers, typeof(DeviceStateChangeEvent), arg => fireEvent(DeviceStateChanged, arg));
|
||||||
|
@ -1314,13 +1319,13 @@ namespace AsterNET.Manager
|
||||||
/// <param name="action">action to send</param>
|
/// <param name="action">action to send</param>
|
||||||
/// <param name="timeout">timeout in milliseconds</param>
|
/// <param name="timeout">timeout in milliseconds</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public Response.ManagerResponse SendAction(ManagerAction action, int timeOut)
|
public Response.ManagerResponse SendAction(ManagerAction action, int timeout)
|
||||||
{
|
{
|
||||||
AutoResetEvent autoEvent = new AutoResetEvent(false);
|
AutoResetEvent autoEvent = new AutoResetEvent(false);
|
||||||
ResponseHandler handler = new ResponseHandler(action, autoEvent);
|
ResponseHandler handler = new ResponseHandler(action, autoEvent);
|
||||||
|
|
||||||
int hash = SendAction(action, handler);
|
int hash = SendAction(action, handler);
|
||||||
bool result = autoEvent.WaitOne(timeOut <= 0 ? -1 : timeOut, true);
|
bool result = autoEvent.WaitOne(timeout <= 0 ? -1 : timeout, true);
|
||||||
|
|
||||||
RemoveResponseHandler(handler);
|
RemoveResponseHandler(handler);
|
||||||
|
|
||||||
|
@ -1331,6 +1336,12 @@ namespace AsterNET.Manager
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region SendAction(action, responseHandler)
|
#region SendAction(action, responseHandler)
|
||||||
|
/// <summary>
|
||||||
|
/// Send action ans with timeout (milliseconds)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="action">action to send</param>
|
||||||
|
/// <param name="responseHandler">Response Handler</param>
|
||||||
|
/// <returns></returns>
|
||||||
public int SendAction(ManagerAction action, ResponseHandler responseHandler)
|
public int SendAction(ManagerAction action, ResponseHandler responseHandler)
|
||||||
{
|
{
|
||||||
if (action == null)
|
if (action == null)
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
<ProjectGuid>186124f7-82fa-4562-8b87-33d53a84e8ba</ProjectGuid>
|
<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, Name, and RootNamespace are not used by SHFB but Visual Studio adds them anyway -->
|
||||||
<AssemblyName>Documentation</AssemblyName>
|
<AssemblyName>Documentation</AssemblyName>
|
||||||
<RootNamespace>Documentation</RootNamespace>
|
<RootNamespace>Documentation</RootNamespace>
|
||||||
|
@ -58,7 +58,8 @@
|
||||||
<NamespaceSummaryItem name="AsterNET.Manager.Action" isDocumented="True" xmlns="">AsterNet Manager Action</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.Event" isDocumented="True" xmlns="">AsterNet Manager Event</NamespaceSummaryItem>
|
||||||
<NamespaceSummaryItem name="AsterNET.Manager.Response" isDocumented="True" xmlns="">AsterNet Manager Response</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.Util" isDocumented="True" xmlns="">AsterNet Util</NamespaceSummaryItem>
|
||||||
|
</NamespaceSummaries>
|
||||||
<ProjectSummary>
|
<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>
|
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>
|
</PropertyGroup>
|
||||||
|
|
Loading…
Reference in a new issue