|
Asterisk-Java | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
AgiCommand
Field Summary | |
---|---|
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. |
Method Summary | |
---|---|
java.lang.String |
getAttribute(java.lang.String name)
Returns an additional attribute contained in the reply. |
java.lang.String |
getExtra()
Returns the text in parenthesis contained in this reply. |
java.lang.String |
getFirstLine()
Returns the first line of the raw reply. |
java.util.List<java.lang.String> |
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. |
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 |
---|
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.
Method Detail |
---|
java.lang.String getFirstLine()
java.util.List<java.lang.String> getLines()
int getResultCode()
char getResultCodeAsChar()
java.lang.String getResult()
int getStatus()
Supported status codes are:
SC_SUCCESS
,
SC_INVALID_OR_UNKNOWN_COMMAND
,
SC_DEAD_CHANNEL
,
SC_INVALID_COMMAND_SYNTAX
java.lang.String getAttribute(java.lang.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.java.lang.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.java.lang.String getSynopsis()
null
if there
were no syntax errors.java.lang.String getUsage()
null
if there were
no syntax errors.
|
Asterisk-Java | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |