Asterisk-Java

org.asteriskjava.fastagi.command
Class GetFullVariableCommand

java.lang.Object
  extended by org.asteriskjava.fastagi.command.AbstractAgiCommand
      extended by org.asteriskjava.fastagi.command.GetFullVariableCommand
All Implemented Interfaces:
java.io.Serializable, AgiCommand

public class GetFullVariableCommand
extends AbstractAgiCommand

Returns the value of the given channel varible and understands complex variable names and builtin variables, unlike the GetVariableCommand.

You can also use this command to use custom Asterisk functions. Syntax is "func(args)".

Returns 0 if the variable is not set or channel does not exist. Returns 1 if the variable is set and returns the variable in parenthesis.

Available since Asterisk 1.2

Example return code: 200 result=1 (testvariable)

Since:
0.2
Version:
$Id: GetFullVariableCommand.java 938 2007-12-31 03:23:38Z srt $
Author:
srt
See Also:
GetVariableCommand, Serialized Form

Constructor Summary
GetFullVariableCommand(java.lang.String variable)
          Creates a new GetFullVariableCommand.
GetFullVariableCommand(java.lang.String variable, java.lang.String channel)
          Creates a new GetFullVariableCommand.
 
Method Summary
 java.lang.String buildCommand()
          Returns a string suitable to be sent to asterisk.
 java.lang.String getChannel()
          Returns the the name of the channel.
 java.lang.String getVariable()
          Returns the name of the variable to retrieve.
 void setChannel(java.lang.String channel)
          Sets the name of the channel.
 void setVariable(java.lang.String variable)
          Sets the name of the variable to retrieve.
 
Methods inherited from class org.asteriskjava.fastagi.command.AbstractAgiCommand
escapeAndQuote, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GetFullVariableCommand

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

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

GetFullVariableCommand

public GetFullVariableCommand(java.lang.String variable,
                              java.lang.String channel)
Creates a new GetFullVariableCommand.

Parameters:
variable - the name of the variable to retrieve.
channel - the name of the channel.
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.

You can also use custom dialplan functions (like "func(args)") as variable.

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

getChannel

public java.lang.String getChannel()
Returns the the name of the channel.

Returns:
the name of the channel.

setChannel

public void setChannel(java.lang.String channel)
Sets the name of the channel.

Parameters:
channel - the name of the channel.

buildCommand

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

Specified by:
buildCommand in interface AgiCommand
Specified by:
buildCommand in class AbstractAgiCommand
Returns:
a string suitable to be sent to asterisk.

Asterisk-Java

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