net.sf.asterisk.fastagi.reply
Interface AGIReply

All Known Implementing Classes:
AGIReplyImpl

public interface AGIReply

Reply received in response to an AGICommand.
The AGIReply contains information about success or failure of the execution of an AGICommand and - depending on the command sent - additional information returned, for example the value of a variable requested by a GetVariableCommand.

Version:
$Id: AGIReply.java,v 1.14 2005/10/25 22:37:34 srt Exp $
Author:
srt
See Also:
AGICommand

Field Summary
static int SC_INVALID_COMMAND_SYNTAX
          Status code (520) indicating Asterisk was unable to process the AGICommand because the syntax used was not correct.
static int SC_INVALID_OR_UNKNOWN_COMMAND
          Status code (510) indicating Asterisk was unable to process the AGICommand because there is no command with the given name available.
static int SC_SUCCESS
          Status code (200) indicating Asterisk successfully processed the AGICommand.
 
Method Summary
 java.lang.String getAttribute(java.lang.String name)
          Returns an additional attribute contained in the reply.
For example the reply to the StreamFileCommand contains an additional endpos attribute indicating the frame where the playback was stopped.
 java.lang.String getExtra()
          Returns the text in parenthesis contained in this reply.
The meaning of this property depends on the command sent.
 java.lang.String getFirstLine()
          Returns the first line of the raw reply.
 java.util.List getLines()
          Returns a List containing the lines of the raw reply.
 java.lang.String getResult()
          Returns the result, that is the part directly following the "result=" string.
 int getResultCode()
          Returns the return code (the result as int).
 char getResultCodeAsChar()
          Returns the return code as character.
 int getStatus()
          Returns the status code.
Supported status codes are: 200 Success 510 Invalid or unknown command 520 Invalid command syntax
 java.lang.String getSynopsis()
          Returns the synopsis of the command sent if Asterisk expected a different syntax (getStatus() == SC_INVALID_COMMAND_SYNTAX).
 java.lang.String getUsage()
          Returns the usage of the command sent if Asterisk expected a different syntax (getStatus() == SC_INVALID_COMMAND_SYNTAX).
 

Field Detail

SC_SUCCESS

static final int SC_SUCCESS
Status code (200) indicating Asterisk successfully processed the AGICommand.

See Also:
Constant Field Values

SC_INVALID_OR_UNKNOWN_COMMAND

static final int SC_INVALID_OR_UNKNOWN_COMMAND
Status code (510) indicating Asterisk was unable to process the AGICommand because there is no command with the given name available.

See Also:
Constant Field Values

SC_INVALID_COMMAND_SYNTAX

static final int SC_INVALID_COMMAND_SYNTAX
Status code (520) indicating Asterisk was unable to process the AGICommand because the syntax used was not correct. This is most likely due to missing required parameters or additional parameters sent that are not understood.
Ensure proper quoting of the parameters when you receive this status code.

See Also:
Constant Field Values
Method Detail

getFirstLine

java.lang.String getFirstLine()
Returns the first line of the raw reply.

Returns:
the first line of the raw reply.

getLines

java.util.List getLines()
Returns a List containing the lines of the raw reply.

Returns:
a List containing the lines of the raw reply.

getResultCode

int getResultCode()
Returns the return code (the result as int).

Returns:
the return code or -1 if the result is not an int.

getResultCodeAsChar

char getResultCodeAsChar()
Returns the return code as character.

Returns:
the return code as character.

getResult

java.lang.String getResult()
Returns the result, that is the part directly following the "result=" string.

Returns:
the result.

getStatus

int getStatus()
Returns the status code.
Supported status codes are:

Returns:
the status code.

getAttribute

java.lang.String getAttribute(java.lang.String name)
Returns an additional attribute contained in the reply.
For example the reply to the StreamFileCommand contains an additional endpos attribute indicating the frame where the playback was stopped. This can be retrieved by calling getAttribute("endpos") on the corresponding reply.

Parameters:
name - the name of the attribute to retrieve. The name is case insensitive.
Returns:
the value of the attribute or null if it is not set.

getExtra

java.lang.String getExtra()
Returns the text in parenthesis contained in this reply.
The meaning of this property depends on the command sent. Sometimes it contains a flag like "timeout" or "hangup" or - in case of the GetVariableCommand - the value of the variable.

Returns:
the text in the parenthesis or null if not set.

getSynopsis

java.lang.String getSynopsis()
Returns the synopsis of the command sent if Asterisk expected a different syntax (getStatus() == SC_INVALID_COMMAND_SYNTAX).

Returns:
the synopsis of the command sent, null if there were no syntax errors.

getUsage

java.lang.String getUsage()
Returns the usage of the command sent if Asterisk expected a different syntax (getStatus() == SC_INVALID_COMMAND_SYNTAX).

Returns:
the usage of the command sent, null if there were no syntax errors.


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