using System;
namespace Asterisk.NET.Manager.Action
{
///
/// The SetVar action sets the value of a channel variable for a given channel.
///
public class SetVarAction : ManagerAction
{
/// The channel on which to set the variable.
public string channel;
/// The name of the variable to set.
public string varName;
/// The value to store.
public string varValue;
///
/// Get the name of this action, i.e. "SetVar".
///
override public string Action
{
get { return "SetVar"; }
}
///
/// Get/Set the name of the channel.
///
public string Channel
{
get { return channel; }
set { this.channel = value; }
}
///
/// Get/Set the name of the variable to set.
///
public string Variable
{
get { return this.varName; }
set { this.varName = value; }
}
///
/// Get/Set the value to store.
///
public string Value
{
get { return this.varValue; }
set { this.varValue = value; }
}
///
/// Creates a new empty SetVarAction.
///
public SetVarAction()
{
}
///
/// Creates a new SetVarAction that sets the given global variable to a new value.
///
/// the name of the global variable to set
/// the new value
public SetVarAction(string variable, string value)
{
this.varName = variable;
this.varValue = value;
}
///
/// Creates a new SetVarAction that sets the given channel variable of the
/// given channel to a new value.
///
/// the name of the channel to set the variable on
/// the name of the channel variable
/// the new value
public SetVarAction(string channel, string variable, string value)
{
this.channel = channel;
this.varName = variable;
this.varValue = value;
}
}
}