|
Asterisk-Java | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.asteriskjava.manager.action.AbstractManagerAction
org.asteriskjava.manager.action.CommandAction
public class CommandAction
The CommandAction sends a command line interface (CLI) command to the asterisk server.
For a list of supported commands type help on Asterisk's
command line.
In response to a CommandAction you will receive a CommandResponse that contains the CLI output.
Example:
CommandAction commandAction = new CommandAction("iax2 show peers");
CommandResponse response = (CommandResponse) c.sendAction(commandAction);
for (String line : response.getResult())
{
System.out.println(line);
}
Where c is an instance of
ManagerConnection.
CommandResponse,
Serialized Form| Field Summary | |
|---|---|
protected java.lang.String |
command
|
| Constructor Summary | |
|---|---|
CommandAction()
Creates a new CommandAction. |
|
CommandAction(java.lang.String command)
Creates a new CommandAction with the given command. |
|
| Method Summary | |
|---|---|
java.lang.String |
getAction()
Returns the name of this action, i.e. |
java.lang.String |
getCommand()
Returns the command. |
void |
setCommand(java.lang.String command)
Sets the CLI command to send to the Asterisk server. |
| Methods inherited from class org.asteriskjava.manager.action.AbstractManagerAction |
|---|
getActionId, setActionId, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String command
| Constructor Detail |
|---|
public CommandAction()
public CommandAction(java.lang.String command)
command - the CLI command to execute.| Method Detail |
|---|
public java.lang.String getAction()
getAction in interface ManagerActiongetAction in class AbstractManagerActionpublic java.lang.String getCommand()
public void setCommand(java.lang.String command)
|
Asterisk-Java | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||