using System;
namespace Asterisk.NET.Manager.Action
{
///
/// The GetVarAction queries for a channel variable.
///
public class GetVarAction : ManagerAction
{
private string channel;
private string varName;
///
/// Creates a new empty GetVarAction.
///
public GetVarAction()
{
}
///
/// Creates a new GetVarAction that queries for the given global variable.
///
/// the name of the global variable to query.
public GetVarAction(string variable)
{
this.varName = variable;
}
///
/// Creates a new GetVarAction that queries for the given local channel variable.
///
/// the name of the channel, for example "SIP/1234-9cd".
/// the name of the variable to query.
public GetVarAction(string channel, string variable)
{
this.channel = channel;
this.varName = variable;
}
///
/// Get the name of this action, i.e. "GetVar".
///
override public string Action
{
get { return "GetVar"; }
}
///
/// Get/Set the name of the channel, if you query for a local channel variable.
/// Leave empty to query for a global variable.
///
public string Channel
{
get { return this.channel; }
set { this.channel = value; }
}
///
/// Get/Set the name of the variable to query.
///
public string Variable
{
get { return this.varName; }
set { this.varName = value; }
}
}
}