Merge pull request #178 from moldypenguins/DTMF
Added DTMFBegin and DTMFEnd events.
This commit is contained in:
commit
912b8b3251
28
Asterisk.2013/Asterisk.NET/Manager/Event/DTMFBeginEvent.cs
Normal file
28
Asterisk.2013/Asterisk.NET/Manager/Event/DTMFBeginEvent.cs
Normal file
|
@ -0,0 +1,28 @@
|
|||
namespace AsterNET.Manager.Event
|
||||
{
|
||||
/// <summary>
|
||||
/// Raised when a DTMF digit has started on a channel.<br/>
|
||||
/// See <see target="_blank" href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+ManagerEvent_DTMFBegin">https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+ManagerEvent_DTMFBegin</see>
|
||||
/// </summary>
|
||||
public class DTMFBeginEvent : ManagerEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="DTMFBeginEvent"/> using the given <see cref="ManagerConnection"/>.
|
||||
/// </summary>
|
||||
/// <param name="source"></param>
|
||||
public DTMFBeginEvent(ManagerConnection source)
|
||||
: base(source)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the direction.
|
||||
/// </summary>
|
||||
public string Direction { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the digit.
|
||||
/// </summary>
|
||||
public string Digit { get; set; }
|
||||
}
|
||||
}
|
33
Asterisk.2013/Asterisk.NET/Manager/Event/DTMFEndEvent.cs
Normal file
33
Asterisk.2013/Asterisk.NET/Manager/Event/DTMFEndEvent.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
namespace AsterNET.Manager.Event
|
||||
{
|
||||
/// <summary>
|
||||
/// Raised when a DTMF digit has ended on a channel.<br/>
|
||||
/// See <see target="_blank" href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+ManagerEvent_DTMFEnd">https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+ManagerEvent_DTMFEnd</see>
|
||||
/// </summary>
|
||||
public class DTMFEndEvent : ManagerEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="DTMFEndEvent"/> using the given <see cref="ManagerConnection"/>.
|
||||
/// </summary>
|
||||
/// <param name="source"></param>
|
||||
public DTMFEndEvent(ManagerConnection source)
|
||||
: base(source)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the direction.
|
||||
/// </summary>
|
||||
public string Direction { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the digit.
|
||||
/// </summary>
|
||||
public string Digit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the duration ms.
|
||||
/// </summary>
|
||||
public int DurationMs { get; set; }
|
||||
}
|
||||
}
|
|
@ -150,6 +150,14 @@ namespace AsterNET.Manager
|
|||
public event EventHandler<DialEvent> Dial;
|
||||
public event EventHandler<DTMFEvent> DTMF;
|
||||
/// <summary>
|
||||
/// An DTMFBeginEvent is triggered when a DTMF digit has started on a channel.
|
||||
/// </summary>
|
||||
public event EventHandler<DTMFBeginEvent> DTMFBegin;
|
||||
/// <summary>
|
||||
/// An DTMFEndEvent is triggered when a DTMF digit has ended on a channel.
|
||||
/// </summary>
|
||||
public event EventHandler<DTMFEndEvent> DTMFEnd;
|
||||
/// <summary>
|
||||
/// A DNDStateEvent is triggered by the Zap channel driver when a channel enters or leaves DND (do not disturb) state.
|
||||
/// </summary>
|
||||
public event EventHandler<DNDStateEvent> DNDState;
|
||||
|
@ -546,6 +554,8 @@ namespace AsterNET.Manager
|
|||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(BridgeEvent), arg => fireEvent(Bridge, arg));
|
||||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(TransferEvent), arg => fireEvent(Transfer, arg));
|
||||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(DTMFEvent), arg => fireEvent(DTMF, arg));
|
||||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(DTMFBeginEvent), arg => fireEvent(DTMFBegin, arg));
|
||||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(DTMFEndEvent), arg => fireEvent(DTMFEnd, arg));
|
||||
|
||||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(VarSetEvent), arg => fireEvent(VarSet, arg));
|
||||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(AGIExecEvent), arg => fireEvent(AGIExec, arg));
|
||||
|
|
Loading…
Reference in a new issue