Skip to content
Permalink
Browse files

Merge pull request #178 from moldypenguins/DTMF

Added DTMFBegin and DTMFEnd events.
  • Loading branch information...
Deantwo committed Sep 14, 2018
2 parents 03f51ba + 41ed827 commit 912b8b3251679b91a7ceda9ffbf40145e4a0a4e3
@@ -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; }
}
}
@@ -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 @@ public class ManagerConnection
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 @@ public ManagerConnection()
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));

0 comments on commit 912b8b3

Please sign in to comment.
You can’t perform that action at this time.