public interface AgiReply extends Serializable
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.
AgiCommand| Modifier and Type | Field and Description |
|---|---|
static int |
SC_DEAD_CHANNEL
Status code (511) indicating Asterisk was unable to execute the command
because the channel has been hung up.
|
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.
|
static int |
SC_TRYING
Status code (100) indicating Asterisk needs to process the
AgiCommand and will report a final result code soon.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getAttribute(String name)
Returns an additional attribute contained in the reply.
|
String |
getExtra()
Returns the text in parenthesis contained in this reply.
|
String |
getFirstLine()
Returns the first line of the raw reply.
|
List<String> |
getLines()
Returns a List containing the lines of the raw reply.
|
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.
|
String |
getSynopsis()
Returns the synopsis of the command sent if Asterisk expected a different
syntax (getStatus() == SC_INVALID_COMMAND_SYNTAX).
|
String |
getUsage()
Returns the usage of the command sent if Asterisk expected a different
syntax (getStatus() == SC_INVALID_COMMAND_SYNTAX).
|
static final int SC_TRYING
This code is only used by Asterisk-Java as an intermediate status and is never returned to the user.
static final int SC_SUCCESS
static final int SC_INVALID_OR_UNKNOWN_COMMAND
static final int SC_DEAD_CHANNEL
static final int SC_INVALID_COMMAND_SYNTAX
Ensure proper quoting of the parameters when you receive this status code.
String getFirstLine()
List<String> getLines()
int getResultCode()
char getResultCodeAsChar()
String getResult()
int getStatus()
Supported status codes are:
SC_TRYING,
SC_SUCCESS,
SC_INVALID_OR_UNKNOWN_COMMAND,
SC_DEAD_CHANNEL,
SC_INVALID_COMMAND_SYNTAXString getAttribute(String name)
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.
name - the name of the attribute to retrieve. The name is case
insensitive.null if it is not
set.String getExtra()
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.
null if not set.String getSynopsis()
null if there
were no syntax errors.String getUsage()
null if there were
no syntax errors.Copyright © 2004–2024. All rights reserved.