Fixed PR conflicts
This commit is contained in:
parent
0f61e78fe6
commit
d69f7ffd64
|
@ -288,8 +288,8 @@ Ctrl-C to exit");
|
|||
|
||||
Console.WriteLine("Redirect Call from " + ORIGINATE_CHANNEL + " to " + ORIGINATE_EXTRA_CHANNEL + " or press ESC.");
|
||||
// Wait for Dial Event from ORIGINATE_CHANNEL
|
||||
EventHandler<DialEvent> de = dam_Dial;
|
||||
manager.Dial += new EventHandler<DialEvent>(de);
|
||||
EventHandler<DialEvent> de = new EventHandler<DialEvent>(dam_Dial);
|
||||
manager.Dial += de;
|
||||
while (transferChannel == null)
|
||||
{
|
||||
System.Threading.Thread.Sleep(100);
|
||||
|
@ -324,7 +324,7 @@ Ctrl-C to exit");
|
|||
Console.WriteLine("Monitor call. Please call " + ORIGINATE_CHANNEL + " and answer or press ESC.");
|
||||
// Wait for Link event
|
||||
EventHandler<LinkEvent> le = new EventHandler<LinkEvent>(dam_Link);
|
||||
manager.Link += new EventHandler<LinkEvent>(le);
|
||||
manager.Link += le;
|
||||
while (monitorChannel == null)
|
||||
{
|
||||
System.Threading.Thread.Sleep(100);
|
||||
|
|
|
@ -167,6 +167,7 @@
|
|||
<Compile Include="Manager\Action\DBPutAction.cs" />
|
||||
<Compile Include="Manager\Action\EventsAction.cs" />
|
||||
<Compile Include="Manager\Action\ExtensionStateAction.cs" />
|
||||
<Compile Include="Manager\Action\FilterAction.cs" />
|
||||
<Compile Include="Manager\Action\GetConfigAction.cs" />
|
||||
<Compile Include="Manager\Action\GetVarAction.cs" />
|
||||
<Compile Include="Manager\Action\HangupAction.cs" />
|
||||
|
@ -195,6 +196,7 @@
|
|||
<Compile Include="Manager\Action\QueueResetAction.cs" />
|
||||
<Compile Include="Manager\Action\QueueRuleAction.cs" />
|
||||
<Compile Include="Manager\Action\QueueStatusAction.cs" />
|
||||
<Compile Include="Manager\Action\QueueSummaryAction.cs" />
|
||||
<Compile Include="Manager\Action\RedirectAction.cs" />
|
||||
<Compile Include="Manager\Action\SetCDRUserFieldAction.cs" />
|
||||
<Compile Include="Manager\Action\SetVarAction.cs" />
|
||||
|
@ -256,6 +258,7 @@
|
|||
<Compile Include="Manager\Event\QueueMemberPauseEvent.cs" />
|
||||
<Compile Include="Manager\Event\QueueMemberPenaltyEvent.cs" />
|
||||
<Compile Include="Manager\Event\QueueMemberRinginuseEvent.cs" />
|
||||
<Compile Include="Manager\Event\QueueSummaryEvent.cs" />
|
||||
<Compile Include="Manager\Event\RTPReceiverStatEvent.cs" />
|
||||
<Compile Include="Manager\Event\RTCPSentEvent.cs" />
|
||||
<Compile Include="Manager\Event\RTCPReceivedEvent.cs" />
|
||||
|
@ -323,6 +326,11 @@
|
|||
<Compile Include="Manager\Event\PeerStatusEvent.cs" />
|
||||
<Compile Include="Manager\Event\QueueEntryEvent.cs" />
|
||||
<Compile Include="Manager\Event\QueueEvent.cs" />
|
||||
<Compile Include="Manager\Event\ChallengeResponseFailedEvent.cs" />
|
||||
<Compile Include="Manager\Event\InvalidAccountIDEvent.cs" />
|
||||
<Compile Include="Manager\Event\DeviceStateChangeEvent.cs" />
|
||||
<Compile Include="Manager\Event\ChallengeSentEvent.cs" />
|
||||
<Compile Include="Manager\Event\SuccessfulAuthEvent.cs" />
|
||||
<Compile Include="Manager\Event\QueueMemberAddedEvent.cs" />
|
||||
<Compile Include="Manager\Event\QueueMemberEvent.cs" />
|
||||
<Compile Include="Manager\Event\QueueMemberPausedEvent.cs" />
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
|
@ -233,13 +234,29 @@ namespace AsterNET.FastAGI
|
|||
var ipAddress = IPAddress.Parse(address);
|
||||
serverSocket = new ServerSocket(port, ipAddress, SocketEncoding);
|
||||
}
|
||||
catch (IOException ex)
|
||||
catch (Exception ex)
|
||||
{
|
||||
#if LOGGER
|
||||
logger.Error("Unable start AGI Server: cannot to bind to " + address + ":" + port + ".", ex);
|
||||
if (ex is IOException)
|
||||
{
|
||||
logger.Error("Unable start AGI Server: cannot to bind to " + address + ":" + port + ".", ex);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (serverSocket != null)
|
||||
{
|
||||
serverSocket.Close();
|
||||
serverSocket = null;
|
||||
}
|
||||
|
||||
pool.Shutdown();
|
||||
#if LOGGER
|
||||
logger.Info("AGI Server shut down.");
|
||||
#endif
|
||||
|
||||
throw ex;
|
||||
}
|
||||
|
||||
#if LOGGER
|
||||
logger.Info("Listening on " + address + ":" + port + ".");
|
||||
#endif
|
||||
|
@ -287,7 +304,7 @@ namespace AsterNET.FastAGI
|
|||
serverSocket = null;
|
||||
pool.Shutdown();
|
||||
#if LOGGER
|
||||
logger.Info("AGIServer shut down.");
|
||||
logger.Info("AGI Server shut down.");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,6 +47,7 @@ namespace AsterNET.FastAGI.MappingStrategies
|
|||
/// </summary>
|
||||
public string ScriptAssmebly { get; set; }
|
||||
|
||||
[XmlIgnoreAttribute]
|
||||
public Assembly PreLoadedAssembly { get; set; }
|
||||
|
||||
public static List<ScriptMapping> LoadMappings(string pathToXml)
|
||||
|
|
|
@ -872,7 +872,7 @@ namespace AsterNET
|
|||
|
||||
#endregion
|
||||
|
||||
#region RegisterEventHandler(Dictionary<int, Action<ManagerEvent>> list, Type eventType, Action<ManagerEvent> action)
|
||||
#region RegisterEventHandler(Dictionary<int, int> list, int index, Type eventType)
|
||||
|
||||
internal static void RegisterEventHandler(Dictionary<int, Func<ManagerEvent, bool>> list, Type eventType, Func<ManagerEvent, bool> action)
|
||||
{
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace AsterNET.IO
|
|||
private TcpClient tcpClient;
|
||||
private NetworkStream networkStream;
|
||||
private StreamReader reader;
|
||||
private StreamWriter writer;
|
||||
private BinaryWriter writer;
|
||||
private Encoding encoding;
|
||||
private bool initial;
|
||||
|
||||
|
@ -29,8 +29,7 @@ namespace AsterNET.IO
|
|||
this.tcpClient = new TcpClient(host, port);
|
||||
this.networkStream = this.tcpClient.GetStream();
|
||||
this.reader = new StreamReader(this.networkStream, encoding);
|
||||
this.writer = new StreamWriter(this.networkStream, encoding);
|
||||
this.writer.AutoFlush = true;
|
||||
this.writer = new BinaryWriter(this.networkStream, encoding);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
@ -47,8 +46,7 @@ namespace AsterNET.IO
|
|||
this.tcpClient = tcpClient;
|
||||
this.networkStream = this.tcpClient.GetStream();
|
||||
this.reader = new StreamReader(this.networkStream, encoding);
|
||||
this.writer = new StreamWriter(this.networkStream, encoding);
|
||||
this.writer.AutoFlush = true;
|
||||
this.writer = new BinaryWriter(this.networkStream, encoding);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
@ -156,7 +154,8 @@ namespace AsterNET.IO
|
|||
/// <summary>connection has already been closed.</summary>
|
||||
public void Write(string s)
|
||||
{
|
||||
writer.Write(s);
|
||||
writer.Write(encoding.GetBytes(s));
|
||||
writer.Flush();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
|
55
Asterisk.2013/Asterisk.NET/Manager/Action/FilterAction.cs
Normal file
55
Asterisk.2013/Asterisk.NET/Manager/Action/FilterAction.cs
Normal file
|
@ -0,0 +1,55 @@
|
|||
namespace AsterNET.Manager.Action
|
||||
{
|
||||
/// <summary>
|
||||
/// Dynamically add filters for the current manager session
|
||||
/// The filters added are only used for the current session. Once the connection is closed the filters are removed.
|
||||
/// This comand requires the system permission because this command can be used to create filters that may bypass filters defined in manager.conf
|
||||
/// </summary>
|
||||
public class FilterAction : ManagerAction
|
||||
{
|
||||
#region Action
|
||||
|
||||
/// <summary>
|
||||
/// Get the name of this action, i.e. "Filter".
|
||||
/// </summary>
|
||||
public override string Action
|
||||
{
|
||||
get { return "Filter"; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Operation
|
||||
|
||||
/// <summary>
|
||||
/// Add - Add a filter
|
||||
/// </summary>
|
||||
public string Operation { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Filter
|
||||
|
||||
/// <summary>
|
||||
/// Filters can be whitelist or blacklist
|
||||
/// Example whitelist filter: "Event: Newchannel"
|
||||
/// Example blacklist filter: "!Channel: DAHDI.*"
|
||||
/// </summary>
|
||||
public string Filter { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region FilterAction(string filter)
|
||||
|
||||
/// <summary>
|
||||
/// Add - Add a filter
|
||||
/// </summary>
|
||||
/// <param name="filter"></param>
|
||||
public FilterAction(string filter)
|
||||
{
|
||||
Filter = filter;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -159,7 +159,7 @@ namespace AsterNET.Manager.Action
|
|||
/// Example: "VAR1=abc|VAR2=def" sets the channel variables VAR1 to "abc" and VAR2 to "def".
|
||||
/// </summary>
|
||||
|
||||
[Obsolete("Don't use this anymore - the delimiter is not server context aware", true)]
|
||||
[Obsolete("Use GetVariables and SetVariables instead.", true)]
|
||||
public string Variable
|
||||
{
|
||||
get { return null; /* return Helper.JoinVariables(variables, Common.GET_VAR_DELIMITER(this.Server), "="); */ }
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
using AsterNET.Manager.Event;
|
||||
using System;
|
||||
|
||||
namespace AsterNET.Manager.Action
|
||||
{
|
||||
/// <summary>
|
||||
/// Show queue summary
|
||||
/// </summary>
|
||||
/// <seealso cref="Manager.Action.QueueStatusAction" />
|
||||
public class QueueSummaryAction : ManagerActionEvent
|
||||
{
|
||||
#region Action
|
||||
|
||||
/// <summary>
|
||||
/// Get the name of this action, i.e. "Filter".
|
||||
/// </summary>
|
||||
public override string Action
|
||||
{
|
||||
get { return "QueueSummary"; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region MyRegion
|
||||
|
||||
/// <summary>
|
||||
/// Name of queue
|
||||
/// </summary>
|
||||
public string Queue { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region QueueSummaryAction(string queue)
|
||||
|
||||
public QueueSummaryAction(string queue)
|
||||
{
|
||||
Queue = queue;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ActionCompleteEventClass()
|
||||
|
||||
public override Type ActionCompleteEventClass()
|
||||
{
|
||||
return typeof(QueueSummaryEvent);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -18,26 +18,26 @@ namespace AsterNET.Manager.Event
|
|||
/// Get/Set the variables to set on the queue call in native asterisk format.<br/>
|
||||
/// Example: "VAR1=abc|VAR2=def".
|
||||
/// </summary>
|
||||
[Obsolete("Don't use this anymore - the delimiter is not server context aware", true)]
|
||||
public string Variable
|
||||
{
|
||||
get { return null; /* return Helper.JoinVariables(variables, Common.GET_VAR_DELIMITER(this.Server), "="); */ }
|
||||
set { /* variables = Helper.ParseVariables(variables, value, Common.GET_VAR_DELIMITER(this.Server)); */ }
|
||||
}
|
||||
[Obsolete("Use GetVariables and SetVariables instead.", true)]
|
||||
public string Variable
|
||||
{
|
||||
get { return null; /* return Helper.JoinVariables(variables, Common.GET_VAR_DELIMITER(this.Server), "="); */ }
|
||||
set { /* variables = Helper.ParseVariables(variables, value, Common.GET_VAR_DELIMITER(this.Server)); */ }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region GetVariables()
|
||||
/// <summary>
|
||||
/// Get the variables dictionary to set on the originated call.
|
||||
/// </summary>
|
||||
public Dictionary<string, string> GetVariables()
|
||||
public Dictionary<string, string> GetVariables()
|
||||
{
|
||||
return variables;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region SetVariables(Dictionary<string, string> vars)
|
||||
/// <summary>
|
||||
#region SetVariables(Dictionary<string, string> vars)
|
||||
/// <summary>
|
||||
/// Set the variables dictionary to set on the originated call.
|
||||
/// </summary>
|
||||
public void SetVariables(Dictionary<string, string> vars)
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
namespace AsterNET.Manager.Event
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Raised when a request's attempt to authenticate has been challenged, and the request failed the authentication challenge.<br />
|
||||
/// </summary>
|
||||
public class ChallengeResponseFailedEvent : ManagerEvent
|
||||
{
|
||||
public ChallengeResponseFailedEvent(ManagerConnection source)
|
||||
: base(source)
|
||||
{
|
||||
}
|
||||
|
||||
public string Status { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
namespace AsterNET.Manager.Event
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Raised when an Asterisk service sends an authentication challenge to a request..<br />
|
||||
/// </summary>
|
||||
public class ChallengeSentEvent : ManagerEvent
|
||||
{
|
||||
public ChallengeSentEvent(ManagerConnection source)
|
||||
: base(source)
|
||||
{
|
||||
}
|
||||
|
||||
public string Status { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
namespace AsterNET.Manager.Event
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Raised when a device state changes.<br />
|
||||
/// This differs from the ExtensionStatus event because this event is raised for all device state changes, not only for changes that affect dialplan hints.
|
||||
/// </summary>
|
||||
public class DeviceStateChangeEvent : ManagerEvent
|
||||
{
|
||||
public DeviceStateChangeEvent(ManagerConnection source)
|
||||
: base(source)
|
||||
{
|
||||
}
|
||||
|
||||
public string Status { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
namespace AsterNET.Manager.Event
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Raised when a request fails an authentication check due to an invalid account ID.<br />
|
||||
/// </summary>
|
||||
public class InvalidAccountIDEvent : ManagerEvent
|
||||
{
|
||||
public InvalidAccountIDEvent(ManagerConnection source)
|
||||
: base(source)
|
||||
{
|
||||
}
|
||||
|
||||
public string Status { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,13 +1,21 @@
|
|||
namespace AsterNET.Manager.Event
|
||||
{
|
||||
/// <summary>
|
||||
/// A QueueCallerJoinEvent is triggered when a channel joins a queue.<br/>
|
||||
/// </summary>
|
||||
public class QueueCallerJoinEvent : QueueEvent
|
||||
{
|
||||
public string Position { get; set; }
|
||||
/// <summary>
|
||||
/// A QueueCallerJoinEvent is triggered when a channel joins a queue.<br/>
|
||||
/// </summary>
|
||||
public class QueueCallerJoinEvent : JoinEvent
|
||||
{
|
||||
// "Channel" in ManagerEvent.cs
|
||||
|
||||
public QueueCallerJoinEvent(ManagerConnection source)
|
||||
// "Queue" in QueueEvent.cs
|
||||
|
||||
// "CallerId" in JoinEvent.cs
|
||||
|
||||
// "CallerIdName" in JoinEvent.cs
|
||||
|
||||
// "Position" in JoinEvent.cs
|
||||
|
||||
public QueueCallerJoinEvent(ManagerConnection source)
|
||||
: base(source)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -1,13 +1,17 @@
|
|||
namespace AsterNET.Manager.Event
|
||||
{
|
||||
/// <summary>
|
||||
/// A QueueCallerLeaveEvent is triggered when a channel leaves a queue.<br/>
|
||||
/// </summary>
|
||||
public class QueueCallerLeaveEvent : QueueEvent
|
||||
{
|
||||
public string Position { get; set; }
|
||||
/// <summary>
|
||||
/// A QueueCallerLeaveEvent is triggered when a channel leaves a queue.<br/>
|
||||
/// </summary>
|
||||
public class QueueCallerLeaveEvent : LeaveEvent
|
||||
{
|
||||
// "Channel" in ManagerEvent.cs
|
||||
|
||||
public QueueCallerLeaveEvent(ManagerConnection source)
|
||||
// "Queue" in QueueEvent.cs
|
||||
|
||||
// "Count" in QueueEvent.cs
|
||||
|
||||
public QueueCallerLeaveEvent(ManagerConnection source)
|
||||
: base(source)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -1,71 +1,19 @@
|
|||
namespace AsterNET.Manager.Event
|
||||
{
|
||||
/// <summary>
|
||||
/// A QueueMemberAddedEvent is triggered when a queue member is added to a queue.<br/>
|
||||
/// It is implemented in apps/app_queue.c.<br/>
|
||||
/// <para>
|
||||
/// <b>Available since : </b> <see href="http://www.voip-info.org/wiki/view/Asterisk+v1.2" target="_blank" alt="Asterisk 1.2 wiki docs">Asterisk 1.2</see>.<br/>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public class QueueMemberAddedEvent : AbstractQueueMemberEvent
|
||||
/// <summary>
|
||||
/// A QueueMemberAddedEvent is triggered when a queue member is added to a queue.<br/>
|
||||
/// It is implemented in apps/app_queue.c.<br/>
|
||||
/// <para>
|
||||
/// <b>Available since : </b> <see href="http://www.voip-info.org/wiki/view/Asterisk+v1.2" target="_blank" alt="Asterisk 1.2 wiki docs">Asterisk 1.2</see>.<br/>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public class QueueMemberAddedEvent : AbstractQueueMemberEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns the name of the member's interface.<br/>
|
||||
/// E.g. the channel name or agent group.
|
||||
/// Creates a new QueueMemberAddedEvent
|
||||
/// </summary>
|
||||
public new string MemberName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Get/Set if the added member is a dynamic or static queue member.
|
||||
/// "dynamic" if the added member is a dynamic queue member,
|
||||
/// "static" if the added member is a static queue member.
|
||||
/// </summary>
|
||||
public new string Membership { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Get/Set the penalty for the added member. When calls are distributed
|
||||
/// members with higher penalties are considered last.
|
||||
/// </summary>
|
||||
public new int Penalty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Get/Set the number of calls answered by the member.
|
||||
/// </summary>
|
||||
public new int CallsTaken { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Get/Set the time (in seconds since 01/01/1970) the last successful call answered by the added member was hungup.
|
||||
/// </summary>
|
||||
public new long LastCall { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Get/Set the status of this queue member.<br/>
|
||||
/// Valid status codes are:<br/>
|
||||
/// <list type="number" start="0">
|
||||
/// <item>AST_DEVICE_UNKNOWN</item>
|
||||
/// <item>AST_DEVICE_NOT_INUSE</item>
|
||||
/// <item>AST_DEVICE_INUSE</item>
|
||||
/// <item>AST_DEVICE_BUSY</item>
|
||||
/// <item>AST_DEVICE_INVALID</item>
|
||||
/// <item>AST_DEVICE_UNAVAILABLE</item>
|
||||
/// <item>AST_DEVICE_RINGING</item>
|
||||
/// <item>AST_DEVICE_RINGINUSE</item>
|
||||
/// <item>AST_DEVICE_ONHOLD</item>
|
||||
/// </list>
|
||||
/// </summary>
|
||||
public new int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Get/Set value if this queue member is paused (not accepting calls).<br/>
|
||||
/// true if this member has been paused or false if not.
|
||||
/// </summary>
|
||||
public new bool Paused { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new QueueMemberAddedEvent
|
||||
/// </summary>
|
||||
/// <param name="source">ManagerConnection passed through in the event.</param>
|
||||
public QueueMemberAddedEvent(ManagerConnection source)
|
||||
/// <param name="source">ManagerConnection passed through in the event.</param>
|
||||
public QueueMemberAddedEvent(ManagerConnection source)
|
||||
: base(source)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -2,39 +2,29 @@ using System;
|
|||
|
||||
namespace AsterNET.Manager.Event
|
||||
{
|
||||
/// <summary>
|
||||
/// A QueueMemberPausedEvent is triggered when a queue member is paused or unpaused.<br/>
|
||||
/// It is implemented in apps/app_queue.c.<br/>
|
||||
/// <para>
|
||||
/// <b>Available since : </b> <see href="http://www.voip-info.org/wiki/view/Asterisk+v1.2" target="_blank" alt="Asterisk 1.2 wiki docs">Asterisk 1.2</see>.<br/>
|
||||
/// <b>Replaced by : </b> <see cref="QueueMemberPauseEvent"/> since <see href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+Documentation" target="_blank" alt="Asterisk 12 wiki docs">Asterisk 12</see>.<br/>
|
||||
/// <b>Removed since : </b> <see href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Documentation" target="_blank" alt="Asterisk 13 wiki docs">Asterisk 13</see>.<br/>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// A QueueMemberPausedEvent is triggered when a queue member is paused or unpaused.<br/>
|
||||
/// It is implemented in apps/app_queue.c.<br/>
|
||||
/// <para>
|
||||
/// <b>Available since : </b> <see href="http://www.voip-info.org/wiki/view/Asterisk+v1.2" target="_blank" alt="Asterisk 1.2 wiki docs">Asterisk 1.2</see>.<br/>
|
||||
/// <b>Replaced by : </b> <see cref="QueueMemberPauseEvent"/> since <see href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+Documentation" target="_blank" alt="Asterisk 12 wiki docs">Asterisk 12</see>.<br/>
|
||||
/// <b>Removed since : </b> <see href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Documentation" target="_blank" alt="Asterisk 13 wiki docs">Asterisk 13</see>.<br/>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public class QueueMemberPausedEvent : AbstractQueueMemberEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// The reason a member was paused
|
||||
/// </summary>
|
||||
public string Reason { get; set; }
|
||||
/// <summary>
|
||||
/// The reason a member was paused
|
||||
/// </summary>
|
||||
public string Reason { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <b>Not Available</b>, use <see cref="QueueMemberPauseEvent"/> instead.
|
||||
/// </summary>
|
||||
public new string PausedReason { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <b>Not Available</b>, use <see cref="QueueMemberPauseEvent"/> instead.
|
||||
/// </summary>
|
||||
public new bool InCall { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new QueueMemberPausedEvent
|
||||
/// </summary>
|
||||
/// <param name="source">ManagerConnection passed through in the event.</param>
|
||||
public QueueMemberPausedEvent(ManagerConnection source)
|
||||
/// <summary>
|
||||
/// Creates a new QueueMemberPausedEvent
|
||||
/// </summary>
|
||||
/// <param name="source">ManagerConnection passed through in the event.</param>
|
||||
public QueueMemberPausedEvent(ManagerConnection source)
|
||||
: base(source)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,15 +6,10 @@ namespace AsterNET.Manager.Event
|
|||
public class QueueMemberPenaltyEvent : AbstractQueueMemberEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Get/Set the penalty for the queue location.
|
||||
/// Creates a new QueueMemberPenaltyEvent
|
||||
/// </summary>
|
||||
public new int Penalty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new QueueMemberPenaltyEvent
|
||||
/// </summary>
|
||||
/// <param name="source">ManagerConnection passed through in the event.</param>
|
||||
public QueueMemberPenaltyEvent(ManagerConnection source)
|
||||
/// <param name="source">ManagerConnection passed through in the event.</param>
|
||||
public QueueMemberPenaltyEvent(ManagerConnection source)
|
||||
: base(source)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -1,24 +1,18 @@
|
|||
namespace AsterNET.Manager.Event
|
||||
{
|
||||
/// <summary>
|
||||
/// A QueueMemberRemovedEvent is triggered when a queue member is removed from a queue.<br/>
|
||||
/// It is implemented in apps/app_queue.c.<br/>
|
||||
/// <para>
|
||||
/// <b>Available since : </b> <see href="http://www.voip-info.org/wiki/view/Asterisk+v1.2" target="_blank" alt="Asterisk 1.2 wiki docs">Asterisk 1.2</see>.<br/>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public class QueueMemberRemovedEvent : AbstractQueueMemberEvent
|
||||
/// <summary>
|
||||
/// A QueueMemberRemovedEvent is triggered when a queue member is removed from a queue.<br/>
|
||||
/// It is implemented in apps/app_queue.c.<br/>
|
||||
/// <para>
|
||||
/// <b>Available since : </b> <see href="http://www.voip-info.org/wiki/view/Asterisk+v1.2" target="_blank" alt="Asterisk 1.2 wiki docs">Asterisk 1.2</see>.<br/>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public class QueueMemberRemovedEvent : AbstractQueueMemberEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns the name of the member's interface.<br/>
|
||||
/// E.g. the channel name or agent group.
|
||||
/// Creates a new QueueMemberRemovedEvent
|
||||
/// </summary>
|
||||
public new string MemberName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new QueueMemberRemovedEvent
|
||||
/// </summary>
|
||||
/// <param name="source">ManagerConnection passed through in the event.</param>
|
||||
/// <param name="source">ManagerConnection passed through in the event.</param>
|
||||
public QueueMemberRemovedEvent(ManagerConnection source)
|
||||
: base(source)
|
||||
{
|
||||
|
|
|
@ -1,21 +1,14 @@
|
|||
namespace AsterNET.Manager.Event
|
||||
{
|
||||
/// <summary>
|
||||
/// Raised when a member's ringinuse setting is changed
|
||||
/// </summary>
|
||||
public class QueueMemberRinginuseEvent : AbstractQueueMemberEvent
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Evaluates <see langword="true"/> if Ringinuse,
|
||||
/// <see langword="false"/> if not.<br />
|
||||
/// </summary>
|
||||
public new bool Ringinuse { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new QueueMemberRinginuseEvent
|
||||
/// </summary>
|
||||
/// <param name="source">ManagerConnection passed through in the event.</param>
|
||||
/// <summary>
|
||||
/// Raised when a member's ringinuse setting is changed
|
||||
/// </summary>
|
||||
public class QueueMemberRinginuseEvent : AbstractQueueMemberEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a new QueueMemberRinginuseEvent
|
||||
/// </summary>
|
||||
/// <param name="source">ManagerConnection passed through in the event.</param>
|
||||
public QueueMemberRinginuseEvent(ManagerConnection source)
|
||||
: base(source)
|
||||
{
|
||||
|
|
|
@ -1,77 +1,14 @@
|
|||
namespace AsterNET.Manager.Event
|
||||
{
|
||||
/// <summary>
|
||||
/// Raised when a Queue member's status has changed
|
||||
/// </summary>
|
||||
public class QueueMemberStatusEvent : AbstractQueueMemberEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns the name of the member's interface.<br/>
|
||||
/// E.g. the channel name or agent group.
|
||||
/// </summary>
|
||||
public new string MemberName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Channel technology or location from which to read device state changes.<br />
|
||||
/// </summary>
|
||||
public new string StateInterface { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Get/Set if the added member is a dynamic or static queue member.
|
||||
/// "dynamic" if the added member is a dynamic queue member,
|
||||
/// "static" if the added member is a static queue member.
|
||||
/// </summary>
|
||||
public new string Membership { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Get/Set the penalty for the added member. When calls are distributed
|
||||
/// members with higher penalties are considered last.
|
||||
/// </summary>
|
||||
public new int Penalty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Get/Set the number of calls answered by the member.
|
||||
/// </summary>
|
||||
public new int CallsTaken { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Get/Set the time (in seconds since 01/01/1970) the last successful call answered by the added member was hungup.
|
||||
/// </summary>
|
||||
public new long LastCall { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Evaluates <see langword="true"/> if member is in call,
|
||||
/// <see langword="false"/> after LastCall time is updated.<br />
|
||||
/// </summary>
|
||||
public new bool InCall { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Get/Set the status of this queue member.<br/>
|
||||
/// Valid status codes are:<br/>
|
||||
/// <list type="number" start="0">
|
||||
/// <item>AST_DEVICE_UNKNOWN</item>
|
||||
/// <item>AST_DEVICE_NOT_INUSE</item>
|
||||
/// <item>AST_DEVICE_INUSE</item>
|
||||
/// <item>AST_DEVICE_BUSY</item>
|
||||
/// <item>AST_DEVICE_INVALID</item>
|
||||
/// <item>AST_DEVICE_UNAVAILABLE</item>
|
||||
/// <item>AST_DEVICE_RINGING</item>
|
||||
/// <item>AST_DEVICE_RINGINUSE</item>
|
||||
/// <item>AST_DEVICE_ONHOLD</item>
|
||||
/// </list>
|
||||
/// </summary>
|
||||
public new int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Get/Set value if this queue member is paused (not accepting calls).<br/>
|
||||
/// true if this member has been paused or false if not.
|
||||
/// </summary>
|
||||
public new bool Paused { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new QueueMemberStatusEvent
|
||||
/// </summary>
|
||||
/// <param name="source">ManagerConnection passed through in the event.</param>
|
||||
/// <summary>
|
||||
/// Raised when a Queue member's status has changed
|
||||
/// </summary>
|
||||
public class QueueMemberStatusEvent : AbstractQueueMemberEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a new QueueMemberStatusEvent
|
||||
/// </summary>
|
||||
/// <param name="source">ManagerConnection passed through in the event.</param>
|
||||
public QueueMemberStatusEvent(ManagerConnection source)
|
||||
: base(source)
|
||||
{
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
namespace AsterNET.Manager.Event
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class QueueSummaryEvent : ManagerEvent
|
||||
{
|
||||
public QueueSummaryEvent(ManagerConnection source)
|
||||
: base(source)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Queue name
|
||||
/// </summary>
|
||||
public string Queue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Logged operators count in queue
|
||||
/// </summary>
|
||||
public int LoggedIn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Available operators in queue
|
||||
/// </summary>
|
||||
public int Available { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Calls count
|
||||
/// </summary>
|
||||
public int Callers { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int HoldTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Total talk time
|
||||
/// </summary>
|
||||
public int TalkTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int LongestHoldTime { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
namespace AsterNET.Manager.Event
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Raised when a request successfully authenticates with a service..<br />
|
||||
/// </summary>
|
||||
public class SuccessfulAuthEvent : ManagerEvent
|
||||
{
|
||||
public SuccessfulAuthEvent(ManagerConnection source)
|
||||
: base(source)
|
||||
{
|
||||
}
|
||||
|
||||
public string Status { get; set; }
|
||||
}
|
||||
}
|
|
@ -196,7 +196,7 @@ namespace AsterNET.Manager
|
|||
/// A MeetMeLeave is triggered if a channel leaves a meet me conference.<br/>
|
||||
/// </summary>
|
||||
public event EventHandler<MeetmeLeaveEvent> MeetMeLeave;
|
||||
// public event MeetMeStopTalkingEventHandler MeetMeStopTalking;
|
||||
// public event EventHandler<MeetMeStopTalkingEvent> MeetMeStopTalking;
|
||||
/// <summary>
|
||||
/// A MeetMeTalkingEvent is triggered when a user starts talking in a meet me conference.<br/>
|
||||
/// To enable talker detection you must pass the option 'T' to the MeetMe application.
|
||||
|
@ -222,15 +222,15 @@ namespace AsterNET.Manager
|
|||
/// A NewState is triggered when the state of a channel has changed.<br/>
|
||||
/// </summary>
|
||||
public event EventHandler<NewStateEvent> NewState;
|
||||
// public event OriginateEventHandler Originate;
|
||||
// public event EventHandler<OriginateEvent> Originate;
|
||||
/// <summary>
|
||||
/// An OriginateFailure is triggered when the execution of an OriginateAction failed.
|
||||
/// </summary>
|
||||
// public event OriginateFailureEventHandler OriginateFailure;
|
||||
// public event EventHandler<OriginateFailureEvent> OriginateFailure;
|
||||
/// <summary>
|
||||
/// An OriginateSuccess is triggered when the execution of an OriginateAction succeeded.
|
||||
/// </summary>
|
||||
// public event OriginateSuccessEventHandler OriginateSuccess;
|
||||
// public event EventHandler<OriginateSuccessEvent> OriginateSuccess;
|
||||
/// <summary>
|
||||
/// An OriginateResponse is triggered when the execution of an Originate.
|
||||
/// </summary>
|
||||
|
@ -426,6 +426,36 @@ namespace AsterNET.Manager
|
|||
/// </summary>
|
||||
public event EventHandler<QueueMemberPauseEvent> QueueMemberPause;
|
||||
|
||||
/// <summary>
|
||||
/// A ChallengeResponseFailed is triggered when a request's attempt to authenticate has been challenged, and the request failed the authentication challenge.
|
||||
/// </summary>
|
||||
public event EventHandler<ChallengeResponseFailedEvent> ChallengeResponseFailed;
|
||||
|
||||
/// <summary>
|
||||
/// A InvalidAccountID is triggered when a request fails an authentication check due to an invalid account ID.
|
||||
/// </summary>
|
||||
public event EventHandler<InvalidAccountIDEvent> InvalidAccountID;
|
||||
|
||||
/// <summary>
|
||||
/// A DeviceStateChanged is triggered when a device state changes.
|
||||
/// </summary>
|
||||
public event EventHandler<DeviceStateChangeEvent> DeviceStateChanged;
|
||||
|
||||
/// <summary>
|
||||
/// A ChallengeSent is triggered when an Asterisk service sends an authentication challenge to a request..
|
||||
/// </summary>
|
||||
public event EventHandler<ChallengeSentEvent> ChallengeSent;
|
||||
|
||||
/// <summary>
|
||||
/// A SuccessfulAuth is triggered when a request successfully authenticates with a service.
|
||||
/// </summary>
|
||||
public event EventHandler<SuccessfulAuthEvent> SuccessfulAuth;
|
||||
|
||||
/// <summary>
|
||||
/// Raised when call queue summary
|
||||
/// </summary>
|
||||
public event EventHandler<QueueSummaryEvent> QueueSummary;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor - ManagerConnection()
|
||||
|
@ -462,7 +492,6 @@ namespace AsterNET.Manager
|
|||
|
||||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(DBGetResponseEvent), arg => fireEvent(DBGetResponse, arg));
|
||||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(DialEvent), arg => fireEvent(Dial, arg));
|
||||
|
||||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(DNDStateEvent), arg => fireEvent(DNDState, arg));
|
||||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(ExtensionStatusEvent), arg => fireEvent(ExtensionStatus, arg));
|
||||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(HangupEvent), arg => fireEvent(Hangup, arg));
|
||||
|
@ -484,8 +513,8 @@ namespace AsterNET.Manager
|
|||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(ParkedCallEvent), arg => fireEvent(ParkedCall, arg));
|
||||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(ParkedCallGiveUpEvent), arg => fireEvent(ParkedCallGiveUp, arg));
|
||||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(ParkedCallsCompleteEvent), arg => fireEvent(ParkedCallsComplete, arg));
|
||||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(ParkedCallTimeOutEvent), arg => fireEvent(ParkedCallsComplete, arg));
|
||||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(PeerEntryEvent), arg => fireEvent(ParkedCallTimeOut, arg));
|
||||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(ParkedCallTimeOutEvent), arg => fireEvent(ParkedCallTimeOut, arg));
|
||||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(PeerEntryEvent), arg => fireEvent(PeerEntry, arg));
|
||||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(PeerlistCompleteEvent), arg => fireEvent(PeerlistComplete, arg));
|
||||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(PeerStatusEvent), arg => fireEvent(PeerStatus, arg));
|
||||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(QueueEntryEvent), arg => fireEvent(QueueEntry, arg));
|
||||
|
@ -540,11 +569,16 @@ 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(ChallengeResponseFailedEvent), arg => fireEvent(ChallengeResponseFailed, arg));
|
||||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(InvalidAccountIDEvent), arg => fireEvent(InvalidAccountID, arg));
|
||||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(DeviceStateChangeEvent), arg => fireEvent(DeviceStateChanged, arg));
|
||||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(ChallengeSentEvent), arg => fireEvent(ChallengeSent, arg));
|
||||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(SuccessfulAuthEvent), arg => fireEvent(SuccessfulAuth, arg));
|
||||
Helper.RegisterEventHandler(registeredEventHandlers, typeof(QueueSummaryEvent), arg => fireEvent(QueueSummary, arg));
|
||||
|
||||
#endregion
|
||||
|
||||
this.internalEvent += new EventHandler<ManagerEvent>(internalEventHandler);
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
@ -574,7 +608,7 @@ namespace AsterNET.Manager
|
|||
/// <param name="port">the port where Asterisk listens for incoming Manager API connections, usually 5038.</param>
|
||||
/// <param name="username">the username to use for login</param>
|
||||
/// <param name="password">the password to use for login</param>
|
||||
/// <param name="encoding">text encoding to asterisk input/output stream</param>
|
||||
/// <param name="socketEncoding">text encoding to asterisk input/output stream</param>
|
||||
public ManagerConnection(string hostname, int port, string username, string password, Encoding encoding)
|
||||
: this()
|
||||
{
|
||||
|
@ -1180,7 +1214,7 @@ namespace AsterNET.Manager
|
|||
enableEvents = true;
|
||||
reconnected = false;
|
||||
disconnect(true);
|
||||
fireInternalEvent(new DisconnectEvent(this));
|
||||
fireEvent(new DisconnectEvent(this));
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
@ -1763,7 +1797,7 @@ namespace AsterNET.Manager
|
|||
ConnectEvent ce = new ConnectEvent(this);
|
||||
ce.Reconnect = true;
|
||||
ce.ProtocolIdentifier = protocolIdentifier;
|
||||
fireInternalEvent(ce);
|
||||
fireEvent(ce);
|
||||
}
|
||||
else if (keepAliveAfterAuthenticationFailure)
|
||||
reconnect(true);
|
||||
|
@ -1861,32 +1895,30 @@ namespace AsterNET.Manager
|
|||
if (reconnected && e is DisconnectEvent)
|
||||
{
|
||||
((DisconnectEvent)e).Reconnect = true;
|
||||
fireInternalEvent(e);
|
||||
fireEvent(e);
|
||||
reconnect(false);
|
||||
}
|
||||
else if (!reconnected && reconnectEnable && (e is DisconnectEvent || e is ReloadEvent || e is ShutdownEvent))
|
||||
{
|
||||
((ConnectionStateEvent)e).Reconnect = true;
|
||||
fireInternalEvent(e);
|
||||
fireEvent(e);
|
||||
reconnect(true);
|
||||
}
|
||||
else
|
||||
fireInternalEvent(e);
|
||||
fireEvent(e);
|
||||
}
|
||||
|
||||
private void eventComplete(IAsyncResult result)
|
||||
{
|
||||
}
|
||||
|
||||
private void fireInternalEvent(ManagerEvent e)
|
||||
private void fireEvent(ManagerEvent e)
|
||||
{
|
||||
if (enableEvents && internalEvent != null)
|
||||
{
|
||||
if (UseASyncEvents)
|
||||
internalEvent.BeginInvoke(this, e, new AsyncCallback(eventComplete), null);
|
||||
else
|
||||
internalEvent.Invoke(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
[![Build Status](https://travis-ci.org/AsterNET/AsterNET.svg?branch=master)](https://travis-ci.org/AsterNET/AsterNET)
|
||||
[![NuGet](https://img.shields.io/nuget/v/AsterNET.svg)](https://www.nuget.org/packages/AsterNET)
|
||||
|
||||
AsterNET is an open source 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.
|
||||
|
||||
|
|
Loading…
Reference in a new issue