net.sf.asterisk.fastagi.command
Class GetVariableCommand

java.lang.Object
  extended by net.sf.asterisk.fastagi.command.AGICommand
      extended by net.sf.asterisk.fastagi.command.GetVariableCommand
All Implemented Interfaces:
java.io.Serializable

public class GetVariableCommand
extends AGICommand

Returns the value of the given channel varible.
Since Asterisk 1.2 you can also use this command to use custom Asterisk functions. Syntax is "func(args)".
Returns 0 if the variable is not set. Returns 1 if the variable is set and returns the variable in parenthesis.
Example return code: 200 result=1 (testvariable)

Version:
$Id: GetVariableCommand.java,v 1.6 2005/11/08 21:11:31 srt Exp $
Author:
srt
See Also:
Serialized Form

Constructor Summary
GetVariableCommand(java.lang.String variable)
          Creates a new GetVariableCommand.
 
Method Summary
 java.lang.String buildCommand()
          Returns a string suitable to be sent to asterisk.
 java.lang.String getVariable()
          Returns the name of the variable to retrieve.
 void setVariable(java.lang.String variable)
          Sets the name of the variable to retrieve.
Since Asterisk 1.2 you can also use custom dialplan functions (like "func(args)") as variable.
 
Methods inherited from class net.sf.asterisk.fastagi.command.AGICommand
escapeAndQuote, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GetVariableCommand

public GetVariableCommand(java.lang.String variable)
Creates a new GetVariableCommand.

Parameters:
variable - the name of the variable to retrieve.
Method Detail

getVariable

public java.lang.String getVariable()
Returns the name of the variable to retrieve.

Returns:
the the name of the variable to retrieve.

setVariable

public void setVariable(java.lang.String variable)
Sets the name of the variable to retrieve.
Since Asterisk 1.2 you can also use custom dialplan functions (like "func(args)") as variable.

Parameters:
variable - the name of the variable to retrieve.

buildCommand

public java.lang.String buildCommand()
Description copied from class: AGICommand
Returns a string suitable to be sent to asterisk.

Specified by:
buildCommand in class AGICommand
Returns:
a string suitable to be sent to asterisk.


Copyright © 2004-2005 Stefan Reuter. All Rights Reserved.