add DialBeginEvent

This commit is contained in:
Herman van den Berg 2016-09-20 15:29:46 +02:00
parent 75e737f694
commit 959c53de8c
4 changed files with 47 additions and 13 deletions

View file

@ -232,6 +232,7 @@
<Compile Include="Manager\Event\BridgeEvent.cs" />
<Compile Include="Manager\Event\ChannelReloadEvent.cs" />
<Compile Include="Manager\Event\ChannelUpdateEvent.cs" />
<Compile Include="Manager\Event\DialBeginEvent.cs" />
<Compile Include="Manager\Event\FailedACLEvent.cs" />
<Compile Include="Manager\Event\MeetmeMuteEvent.cs" />
<Compile Include="Manager\Event\DTMFEvent.cs" />

View file

@ -0,0 +1,18 @@
namespace AsterNET.Manager.Event
{
/// <summary>
/// A dial begin event is triggered whenever a phone attempts to dial someone.<br/>
/// This event is implemented in apps/app_dial.c.<br/>
/// Available since Asterisk 1.2.
/// </summary>
public class DialBeginEvent : DialEvent
{
/// <summary>
/// Creates a new DialBeginEvent.
/// </summary>
public DialBeginEvent(ManagerConnection source)
: base(source)
{
}
}
}

View file

@ -95,15 +95,16 @@ namespace AsterNET.Manager
public delegate void BridgeDestroyEventHandler(object sender, Event.BridgeDestroyEvent e);
public delegate void BridgeEnterEventHandler(object sender, Event.BridgeEnterEvent e);
public delegate void BridgeLeaveEventHandler(object sender, Event.BridgeLeaveEvent e);
public delegate void DialBeginEventHandler(object sender, Event.DialBeginEvent e);
#endregion
#endregion
/// <summary>
/// Default implemention of the ManagerConnection interface.
/// </summary>
public class ManagerConnection
/// <summary>
/// Default implemention of the ManagerConnection interface.
/// </summary>
public class ManagerConnection
{
#region Variables
@ -486,11 +487,16 @@ namespace AsterNET.Manager
public event BridgeEnterEventHandler BridgeEnter;
public event BridgeLeaveEventHandler BridgeLeave;
#endregion
/// <summary>
/// Raised when a dial action has started.<br/>
/// </summary>
public event DialBeginEventHandler DialBegin;
#region Constructor - ManagerConnection()
/// <summary> Creates a new instance.</summary>
public ManagerConnection()
#endregion
#region Constructor - ManagerConnection()
/// <summary> Creates a new instance.</summary>
public ManagerConnection()
{
callerThread = Thread.CurrentThread;
@ -595,11 +601,11 @@ namespace AsterNET.Manager
Helper.RegisterEventHandler(registeredEventHandlers, 90, typeof(BridgeEnterEvent));
Helper.RegisterEventHandler(registeredEventHandlers, 91, typeof(BridgeLeaveEvent));
Helper.RegisterEventHandler(registeredEventHandlers, 92, typeof(BlindTransferEvent));
Helper.RegisterEventHandler(registeredEventHandlers, 93, typeof(DialBeginEvent));
#endregion
#endregion
this.internalEvent += new ManagerEventHandler(internalEventHandler);
this.internalEvent += new ManagerEventHandler(internalEventHandler);
}
#endregion
@ -1214,7 +1220,13 @@ namespace AsterNET.Manager
BlindTransfer(this, (BlindTransferEvent)e);
}
break;
default:
case 93:
if (DialBegin != null)
{
DialBegin(this, (DialBeginEvent)e);
}
break;
default:
if (UnhandledEvent != null)
UnhandledEvent(this, e);
return;

View file

@ -1,3 +1,6 @@
20.09.2016 (herman1vdb)
Added DialBeginEvent
05.01.2015 (Skrusty)
Added a sandcastle documentation project to AsterNET. Initial draft includes CHM and HTML output based on AsterNET 1.0.0.