using System;
namespace AsterNET.FastAGI.Command
{
///
/// Retrieves an entry in the Asterisk database for a given family and key.
/// Returns 0 if is not set. Returns 1 if the variable is set and returns the
/// value in parenthesis.
/// Example return code: 200 result=1 (testvariable)
///
public class DatabaseGetCommand : AGICommand
{
/// The family of the key to retrieve.
private string family;
/// The key to retrieve.
private string varKey;
///
/// Get/Set
///
public string Family
{
get { return family; }
set { this.family = value; }
}
///
/// Get/Set the the key to retrieve.
///
public string Key
{
get { return varKey; }
set { this.varKey = value; }
}
///
/// Creates a new DatabaseGetCommand.
///
/// the family of the key to retrieve.
/// the key to retrieve.
public DatabaseGetCommand(string family, string key)
{
this.family = family;
this.varKey = key;
}
public override string BuildCommand()
{
return "DATABASE GET " + EscapeAndQuote(family) + " " + EscapeAndQuote(varKey);
}
}
}