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