#include <astxx/manager/basic_action.h>


This class should be derrived from to form actual manager commands. Derrived classes will be passed to the manager::connection::send_action() function which will then execute their basic_action::action() member function and send whatever it returns to Asterisk.
Definition at line 47 of file basic_action.h.
Public Member Functions | |
| virtual message::action | action () const =0 |
| 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. | |
| virtual message::response | handle_response (message::response response) |
| Handle a response from Asterisk. | |
| message::response | operator() (connection &c) |
| Send this action over this connection and handle the response. | |
| virtual message::action astxx::manager::basic_action::action | ( | ) | const [pure 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.
Implemented in astxx::manager::action::absolute_timeout, astxx::manager::action::command, astxx::manager::action::events, astxx::manager::action::extension_state, astxx::manager::action::getvar, astxx::manager::action::hangup, astxx::manager::action::list_commands, astxx::manager::action::login, astxx::manager::action::logoff, astxx::manager::action::mailbox_count, astxx::manager::action::mailbox_status, astxx::manager::action::originate, astxx::manager::action::ping, astxx::manager::action::redirect, astxx::manager::action::setvar, astxx::manager::action::status, and astxx::manager::action::user_event.
Referenced by handle_response(), and astxx::manager::connection::send_action_async().
| virtual std::string astxx::manager::basic_action::action_id | ( | ) | const [inline, virtual] |
Get 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::basic_action::handle_response | ( | message::response | response | ) | [virtual] |
Handle a response from Asterisk.
| response | the response to handle |
| manager::permission_denied | on a permission error | |
| manager::authentication_required | on an authentication error | |
| manager::action::missing_data | if required data was not provided | |
| manager::action::bad_data | if the given data was invalid (invalid priority, channel, timeout...) | |
| manager::action::channel_not_found | if the given channel was not found |
Reimplemented in astxx::manager::action::command, astxx::manager::action::getvar, and astxx::manager::action::login.
Definition at line 48 of file basic_action.cc.
References action().
Referenced by astxx::manager::action::login::handle_response(), astxx::manager::action::getvar::handle_response(), astxx::manager::action::command::handle_response(), and operator()().
| message::response astxx::manager::basic_action::operator() | ( | connection & | c | ) |
Send this action over this connection and handle the response.
| c | the connection to use |
Definition at line 103 of file basic_action.cc.
References handle_response().
1.5.6