asternet/Asterisk.2013/Asterisk.NET/Manager/Action/QueuePauseAction.cs

100 lines
3.8 KiB
C#
Raw Normal View History

2014-01-08 14:16:39 +00:00
namespace AsterNET.Manager.Action
{
2015-01-03 15:37:29 +00:00
/// <summary>
/// The QueuePauseAction makes a queue member temporarily unavailabe (or available again).<br />
/// Available since Asterisk 1.2.
/// </summary>
public class QueuePauseAction : ManagerAction
{
/// <summary>
/// Creates a new empty QueuePauseAction.
/// </summary>
public QueuePauseAction()
{
}
/// <summary>
/// Creates a new QueuePauseAction that makes the member on the given
/// interface unavailable on all queues.
/// </summary>
/// <param name="iface">the interface of the member to make unavailable</param>
public QueuePauseAction(string iface)
{
this.Interface = iface;
Paused = true;
}
/// <summary>
/// Creates a new QueuePauseAction that makes the member on the given
/// interface unavailable on the given queue.
/// </summary>
/// <param name="iface">the interface of the member to make unavailable</param>
/// <param name="queue">the queue the member is made unvailable on</param>
public QueuePauseAction(string iface, string queue)
{
this.Interface = iface;
this.Queue = queue;
Paused = true;
}
/// <summary>
/// Creates a new QueuePauseAction that makes the member on the given
/// interface available or unavailable on all queues.
/// </summary>
/// <param name="iface">the interface of the member to make unavailable</param>
/// <param name="paused">true to make the member unavailbale, false to make the member available</param>
2015-01-03 15:37:29 +00:00
public QueuePauseAction(string iface, bool paused)
{
this.Interface = iface;
this.Paused = paused;
}
/// <summary>
/// Creates a new QueuePauseAction that makes the member on the given
/// interface unavailable on the given queue.
/// </summary>
/// <param name="iface">the interface of the member to make unavailable</param>
/// <param name="queue">the queue the member is made unvailable on</param>
/// <param name="paused">true to make the member unavailbale, false to make the member available</param>
/// <param name="reason">the reason for paused when the member is made unavailable</param>
public QueuePauseAction(string iface, string queue, bool paused, string reason = null)
2015-01-03 15:37:29 +00:00
{
this.Interface = iface;
this.Queue = queue;
this.Paused = paused;
this.Reason = reason;
2015-01-03 15:37:29 +00:00
}
/// <summary>
/// Get the name of this action, i.e. "QueuePause".
/// </summary>
public override string Action
{
get { return "QueuePause"; }
}
/// <summary>
/// The name of the interface (tech/name) to pause or unpause.<br />
2015-01-03 15:37:29 +00:00
/// This property is mandatory.
/// </summary>
public string Interface { get; set; }
/// <summary>
/// The name of the queue in which to pause or unpause this member.<br />
/// If null, the member will be paused or unpaused in all the queues it is a member of.
2015-01-03 15:37:29 +00:00
/// </summary>
public string Queue { get; set; }
2015-01-03 15:37:29 +00:00
/// <summary>
/// Pause or unpause the interface.<br />
// Set to 'true' to pause the member or 'false' to unpause.
2015-01-03 15:37:29 +00:00
/// </summary>
public bool Paused { get; set; }
/// <summary>
/// Text description, returned in the event QueueMemberPaused.
/// </summary>
public string Reason { get; set; }
2015-01-03 15:37:29 +00:00
}
}