public class CommandAction extends AbstractManagerAction
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| Constructor and Description |
|---|
CommandAction()
Creates a new CommandAction.
|
CommandAction(String command)
Creates a new CommandAction with the given command.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getAction()
Returns the name of this action, i.e.
|
String |
getCommand()
Returns the command.
|
void |
setCommand(String command)
Sets the CLI command to send to the Asterisk server.
|
getActionId, setActionId, toStringprotected String command
public CommandAction()
public CommandAction(String command)
command - the CLI command to execute.public String getAction()
getAction in interface ManagerActiongetAction in class AbstractManagerActionpublic String getCommand()
public void setCommand(String command)
Copyright © 2004–2020. All rights reserved.