using System;
namespace AsterNET.Manager.Action
{
///
/// The QueueAddAction adds a new member to a queue.
/// It is implemented in apps/app_queue.c
///
public class QueueAddAction : ManagerAction
{
private string queue;
private string iface;
private string memberName;
private int penalty;
private bool paused;
///
/// Get the name of this action, i.e. "QueueAdd".
///
override public string Action
{
get { return "QueueAdd"; }
}
///
/// Get/Set the name of the queue the new member will be added to.
/// This property is mandatory.
///
public string Queue
{
get { return this.queue; }
set { this.queue = value; }
}
///
/// Get/Set the interface to add. To add a specific channel just use the channel name, e.g. "SIP/1234".
/// This property is mandatory.
///
public string Interface
{
get { return this.iface; }
set { this.iface = value; }
}
///
/// Get/Set the member to add.
///
public string MemberName
{
get { return this.memberName; }
set { this.memberName = value; }
}
///
/// Get/Set the penalty for this member.
/// The penalty must be a positive integer or 0 for no penalty. If it is not set 0 is assumed.
/// When calls are distributed members with higher penalties are considered last.
///
public int Penalty
{
get { return this.penalty; }
set { this.penalty = value; }
}
///
/// Get/Set if the queue member should be paused when added.
/// true
if the queue member should be paused when added.
///
public bool Paused
{
get { return this.paused; }
set { this.paused = value; }
}
///
/// Creates a new empty QueueAddAction.
///
public QueueAddAction()
{
}
///
/// Creates a new QueueAddAction that adds a new member on the given interface to the given queue.
///
/// the name of the queue the new member will be added to
/// Sets the interface to add. To add a specific channel just use the channel name, e.g. "SIP/1234".
public QueueAddAction(string queue, string iface)
{
this.queue = queue;
this.iface = iface;
}
///
/// Creates a new QueueAddAction that adds a new member on the given interface to the given queue.
///
/// the name of the queue the new member will be added to
/// Sets the interface to add. To add a specific channel just use the channel name, e.g. "SIP/1234".
/// the name of the the new member will be added to
public QueueAddAction(string queue, string iface, string memberName)
{
this.queue = queue;
this.iface = iface;
this.memberName = memberName;
}
///
/// Creates a new QueueAddAction that adds a new member on the given
/// interface to the given queue with the given penalty.
///
/// the name of the queue the new member will be added to
/// Sets the interface to add. To add a specific channel just use the channel name, e.g. "SIP/1234".
/// the name of the the new member will be added to
/// the penalty for this member.
/// The penalty must be a positive integer or 0 for no penalty. When calls are
/// distributed members with higher penalties are considered last.
///
public QueueAddAction(string queue, string iface, string memberName, int penalty)
{
this.queue = queue;
this.iface = iface;
this.memberName = memberName;
this.penalty = penalty;
}
}
}