astxx::manager::action::command Class Reference

#include <astxx/manager/action/command.h>

Inheritance diagram for astxx::manager::action::command:

Inheritance graph
[legend]
Collaboration diagram for astxx::manager::action::command:

Collaboration graph
[legend]

List of all members.


Detailed Description

Execute an Asterisk CLI command.

This action is some what of a hack. If possible use manager actions instead of CLI commands.

Definition at line 41 of file command.h.


Public Member Functions

message::action action () const
 Format this command as a header for sending to Asterisk.
virtual void action_id (const std::string &id)
 Set the ActionID for this action.
virtual std::string action_id () const
 Get the ActionID for this action.
 command (const std::string &command)
 Execute an Asterisk CLI command.
message::response handle_response (message::response response)
 Handle the response from Asterisk.
message::response operator() (connection &c)
 Send this action over this connection and handle the response.
std::string result ()
 Get the result of the command.

Constructor & Destructor Documentation

astxx::manager::action::command::command ( const std::string &  command  )  [inline]

Execute an Asterisk CLI command.

Parameters:
command the command to execute

Definition at line 46 of file command.h.


Member Function Documentation

message::action astxx::manager::action::command::action (  )  const [inline, virtual]

Format this command as a header for sending to Asterisk.

This function is called by manager::connection::send_action() to get the data to send to Asterisk.

Returns:
a message::action message to send to Asterisk

Implements astxx::manager::basic_action.

Definition at line 49 of file command.h.

virtual std::string astxx::manager::basic_action::action_id (  )  const [inline, virtual, inherited]

Get the ActionID for this action.

Returns:
the ActionID for this action.

Definition at line 62 of file basic_action.h.

Referenced by astxx::manager::action::status::action(), and astxx::manager::connection::send_action_async().

message::response astxx::manager::action::command::handle_response ( message::response  response  )  [inline, virtual]

Handle the response from Asterisk.

Parameters:
response the response
Returns:
the response

Reimplemented from astxx::manager::basic_action.

Definition at line 59 of file command.h.

References astxx::manager::message::basic_message< message_traits >::data, and astxx::manager::basic_action::handle_response().

message::response astxx::manager::basic_action::operator() ( connection c  )  [inherited]

Send this action over this connection and handle the response.

Parameters:
c the connection to use
This function sends this action over the give connection to Asterisk and then passes the response through basic_action::handle_response() before returning it. basic_action::handle_response() will throw exceptions for most common errors.

Returns:
the response from Asterisk

Definition at line 103 of file basic_action.cc.

References astxx::manager::basic_action::handle_response().

std::string astxx::manager::action::command::result (  )  [inline]

Get the result of the command.

Returns:
the result of the command

Definition at line 68 of file command.h.


The documentation for this class was generated from the following file:

Generated on Thu Jul 3 01:32:49 2008 for Astxx by  doxygen 1.5.6