Asterisk - The Open Source Telephony Project
18.5.0
|
Data Structures | |
struct | actions |
list of actions registered More... | |
struct | all_events |
struct | ast_manager_user |
user descriptor, as read from the config file. More... | |
struct | eventqent |
struct | fast_originate_helper |
helper function for originate More... | |
struct | manager_hooks |
list of hooks registered More... | |
struct | mansession |
In case you didn't read that giant block of text above the mansession_session struct, the struct mansession is named this solely to keep the API the same in Asterisk. This structure really represents data that is different from Manager action to Manager action. The mansession_session pointer contained within points to session-specific data. More... | |
struct | mansession_session |
struct | permalias |
struct | users |
list of users found in the config file More... | |
Macros | |
#define | any_manager_listeners(sessions) ((sessions && ao2_container_count(sessions)) || !AST_RWLIST_EMPTY(&manager_hooks)) |
#define | ASTMAN_APPEND_BUF_INITSIZE 256 |
initial allocated size for the astman_append_buf and astman_send_*_va More... | |
#define | DEFAULT_REALM "asterisk" |
#define | EVENT_FLAG_SHUTDOWN -1 |
Fake event class used to end sessions at shutdown. More... | |
#define | GET_HEADER_FIRST_MATCH 0 |
#define | GET_HEADER_LAST_MATCH 1 |
#define | GET_HEADER_SKIP_EMPTY 2 |
#define | MANAGER_EVENT_BUF_INITSIZE 256 |
#define | manager_event_sessions(sessions, category, event, contents, ...) __manager_event_sessions(sessions, category, event, 0, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__, contents , ## __VA_ARGS__) |
#define | MAX_AUTH_PERM_STRING 150 |
#define | MAX_BLACKLIST_CMD_LEN 2 |
Descriptor for a manager session, either on the AMI socket or over HTTP. More... | |
#define | MAX_VARS 128 |
#define | MGR_SHOW_TERMINAL_WIDTH 80 |
#define | MSG_MOREDATA ((char *)astman_send_response) |
Functions | |
int | __ast_manager_event_multichan (int category, const char *event, int chancount, struct ast_channel **chans, const char *file, int line, const char *func, const char *fmt,...) |
static const char * | __astman_get_header (const struct message *m, char *var, int mode) |
Return a matching header value. More... | |
static void | __init_astman_append_buf (void) |
thread local buffer for astman_append More... | |
static void | __init_manager_event_buf (void) |
static void | __init_userevent_buf (void) |
static int | __manager_event_sessions (struct ao2_container *sessions, int category, const char *event, int chancount, struct ast_channel **chans, const char *file, int line, const char *func, const char *fmt,...) |
static int | __manager_event_sessions_va (struct ao2_container *sessions, int category, const char *event, int chancount, struct ast_channel **chans, const char *file, int line, const char *func, const char *fmt, va_list ap) |
static void | acl_change_stasis_cb (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
static void | acl_change_stasis_subscribe (void) |
static void | acl_change_stasis_unsubscribe (void) |
static int | action_aocmessage (struct mansession *s, const struct message *m) |
static int | action_atxfer (struct mansession *s, const struct message *m) |
static int | action_blind_transfer (struct mansession *s, const struct message *m) |
static int | action_cancel_atxfer (struct mansession *s, const struct message *m) |
static int | action_challenge (struct mansession *s, const struct message *m) |
static int | action_command (struct mansession *s, const struct message *m) |
Manager command "command" - execute CLI command. More... | |
static int | action_coresettings (struct mansession *s, const struct message *m) |
Show PBX core settings information. More... | |
static int | action_coreshowchannels (struct mansession *s, const struct message *m) |
Manager command "CoreShowChannels" - List currently defined channels and some information about them. More... | |
static int | action_corestatus (struct mansession *s, const struct message *m) |
Show PBX core status information. More... | |
static int | action_createconfig (struct mansession *s, const struct message *m) |
static void | action_destroy (void *obj) |
static int | action_events (struct mansession *s, const struct message *m) |
static int | action_extensionstate (struct mansession *s, const struct message *m) |
static int | action_filter (struct mansession *s, const struct message *m) |
Manager command to add an event filter to a manager session. More... | |
static struct manager_action * | action_find (const char *name) |
static int | action_getconfig (struct mansession *s, const struct message *m) |
static int | action_getconfigjson (struct mansession *s, const struct message *m) |
static int | action_getvar (struct mansession *s, const struct message *m) |
static int | action_hangup (struct mansession *s, const struct message *m) |
static int | action_listcategories (struct mansession *s, const struct message *m) |
static int | action_listcommands (struct mansession *s, const struct message *m) |
static int | action_loggerrotate (struct mansession *s, const struct message *m) |
Manager command "LoggerRotate" - reloads and rotates the logger in the same manner as the CLI command 'logger rotate'. More... | |
static int | action_login (struct mansession *s, const struct message *m) |
static int | action_logoff (struct mansession *s, const struct message *m) |
static int | action_mailboxcount (struct mansession *s, const struct message *m) |
static int | action_mailboxstatus (struct mansession *s, const struct message *m) |
static int | action_originate (struct mansession *s, const struct message *m) |
static int | action_ping (struct mansession *s, const struct message *m) |
static int | action_presencestate (struct mansession *s, const struct message *m) |
static int | action_redirect (struct mansession *s, const struct message *m) |
action_redirect: The redirect manager command More... | |
static int | action_reload (struct mansession *s, const struct message *m) |
Send a reload event. More... | |
static int | action_sendtext (struct mansession *s, const struct message *m) |
static int | action_setvar (struct mansession *s, const struct message *m) |
static int | action_status (struct mansession *s, const struct message *m) |
Manager "status" command to show channels. More... | |
static int | action_timeout (struct mansession *s, const struct message *m) |
static int | action_updateconfig (struct mansession *s, const struct message *m) |
static int | action_userevent (struct mansession *s, const struct message *m) |
static int | action_waitevent (struct mansession *s, const struct message *m) |
static struct eventqent * | advance_event (struct eventqent *e) |
static | AO2_GLOBAL_OBJ_STATIC (mgr_sessions) |
static | AO2_GLOBAL_OBJ_STATIC (event_docs) |
A container of event documentation nodes. More... | |
static int | aocmessage_get_unit_entry (const struct message *m, struct ast_aoc_unit_entry *entry, unsigned int entry_num) |
static void | append_channel_vars (struct ast_str **pbuf, struct ast_channel *chan) |
static int | append_event (const char *str, int category) |
events are appended to a queue from where they can be dispatched to clients. More... | |
int | ast_hook_send_action (struct manager_custom_hook *hook, const char *msg) |
access for hooks to send action messages to ami More... | |
static int | ast_instring (const char *bigstr, const char *smallstr, const char delim) |
int | ast_manager_check_enabled (void) |
Check if AMI is enabled. More... | |
struct stasis_message_router * | ast_manager_get_message_router (void) |
Get the stasis_message_router for AMI. More... | |
struct stasis_topic * | ast_manager_get_topic (void) |
Get the Stasis Message Bus API topic for AMI. More... | |
void | ast_manager_publish_event (const char *type, int class_type, struct ast_json *obj) |
Publish an event to AMI. More... | |
int | ast_manager_register2 (const char *action, int auth, int(*func)(struct mansession *s, const struct message *m), struct ast_module *module, const char *synopsis, const char *description) |
register a new command with manager, including online help. This is the preferred way to register a manager command More... | |
void | ast_manager_register_hook (struct manager_custom_hook *hook) |
Add a custom hook to be called when an event is fired. More... | |
static int | ast_manager_register_struct (struct manager_action *act) |
struct ast_str * | ast_manager_str_from_json_object (struct ast_json *blob, key_exclusion_cb exclusion_cb) |
Convert a JSON object into an AMI compatible string. More... | |
int | ast_manager_unregister (const char *action) |
support functions to register/unregister AMI action handlers, More... | |
void | ast_manager_unregister_hook (struct manager_custom_hook *hook) |
Delete a custom hook to be called when an event is fired. More... | |
int | ast_webmanager_check_enabled (void) |
Check if AMI/HTTP is enabled. More... | |
void | astman_append (struct mansession *s, const char *fmt,...) |
static void | astman_append_headers (struct message *m, const struct ast_variable *params) |
Append additional headers into the message structure from params. More... | |
static void | astman_append_json (struct mansession *s, const char *str) |
static void | astman_flush (struct mansession *s, struct ast_str *buf) |
static void | astman_free_headers (struct message *m) |
Free headers inside message structure, but not the message structure itself. More... | |
const char * | astman_get_header (const struct message *m, char *var) |
Return the first matching variable from an array. More... | |
struct ast_variable * | astman_get_variables (const struct message *m) |
Get a linked list of the Variable: headers. More... | |
struct ast_variable * | astman_get_variables_order (const struct message *m, enum variable_orders order) |
Get a linked list of the Variable: headers with order specified. More... | |
void | astman_send_ack (struct mansession *s, const struct message *m, char *msg) |
Send ack in manager transaction. More... | |
void | astman_send_error (struct mansession *s, const struct message *m, char *error) |
Send error in manager transaction. More... | |
void | astman_send_error_va (struct mansession *s, const struct message *m, const char *fmt,...) |
Send error in manager transaction (with va_args support) More... | |
static void | astman_send_list_complete (struct mansession *s, const struct message *m, const char *event_name, int count) |
void | astman_send_list_complete_end (struct mansession *s) |
End the list complete event. More... | |
void | astman_send_list_complete_start (struct mansession *s, const struct message *m, const char *event_name, int count) |
Start the list complete event. More... | |
static struct ast_str * | astman_send_list_complete_start_common (struct mansession *s, const struct message *m, const char *event_name, int count) |
void | astman_send_listack (struct mansession *s, const struct message *m, char *msg, char *listflag) |
Send ack in manager transaction to begin a list. More... | |
void | astman_send_response (struct mansession *s, const struct message *m, char *resp, char *msg) |
Send response in manager transaction. More... | |
static void | astman_send_response_full (struct mansession *s, const struct message *m, char *resp, char *msg, char *listflag) |
send a response with an optional message, and terminate it with an empty line. m is used only to grab the 'ActionID' field. More... | |
static void | astman_start_ack (struct mansession *s, const struct message *m) |
static int | authenticate (struct mansession *s, const struct message *m) |
static const char * | authority_to_str (int authority, struct ast_str **res) |
Convert authority code to a list of options. Note that the EVENT_FLAG_ALL authority will always be returned. More... | |
static int | blackfilter_cmp_fn (void *obj, void *arg, void *data, int flags) |
static struct mansession_session * | build_mansession (const struct ast_sockaddr *addr) |
Allocate manager session structure and add it to the list of sessions. More... | |
static int | check_blacklist (const char *cmd) |
static int | check_manager_session_inuse (const char *name) |
static void | destroy_fast_originate_helper (struct fast_originate_helper *doomed) |
static int | do_message (struct mansession *s) |
static void | event_filter_destructor (void *obj) |
static void * | fast_originate (void *data) |
static int | function_capable_string_allowed_with_auths (const char *evaluating, int writepermlist) |
Checks to see if a string which can be used to evaluate functions should be rejected. More... | |
static void | generate_status (struct mansession *s, struct ast_channel *chan, char **vars, int varc, int all_variables, char *id_text, int *count) |
static int | get_input (struct mansession *s, char *output) |
static struct ast_manager_user * | get_manager_by_name_locked (const char *name) |
static int | get_perm (const char *instr) |
static struct eventqent * | grab_last (void) |
static char * | handle_manager_reload (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
CLI command manager reload. More... | |
static char * | handle_mandebug (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static void | handle_parse_error (struct mansession *s, struct message *m, char *error) |
static char * | handle_showmanager (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_showmanagers (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_showmancmd (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_showmancmds (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
CLI command manager list commands. More... | |
static char * | handle_showmanconn (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
CLI command manager list connected. More... | |
static char * | handle_showmaneventq (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
CLI command manager list eventq. More... | |
static enum error_type | handle_updates (struct mansession *s, const struct message *m, struct ast_config *cfg, const char *dfn) |
helper function for action_updateconfig More... | |
static void | json_escape (char *out, const char *in) |
static void | log_action (const struct message *m, const char *action) |
static struct ast_variable * | man_do_variable_value (struct ast_variable *head, const char *hdr_val) |
static enum add_filter_result | manager_add_filter (const char *filter_pattern, struct ao2_container *whitefilters, struct ao2_container *blackfilters) |
Add an event filter to a manager session. More... | |
static void | manager_default_msg_cb (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
static int | manager_displayconnects (struct mansession_session *session) |
Get displayconnects config option. More... | |
static void | manager_generic_msg_cb (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
static void | manager_json_array_with_key (struct ast_json *obj, const char *key, size_t index, struct ast_str **res, key_exclusion_cb exclusion_cb) |
static void | manager_json_obj_with_key (struct ast_json *obj, const char *key, const char *parent_key, struct ast_str **res, key_exclusion_cb exclusion_cb) |
static void | manager_json_to_ast_str (struct ast_json *obj, const char *key, struct ast_str **res, key_exclusion_cb exclusion_cb) |
static void | manager_json_value_str_append (struct ast_json *value, const char *key, struct ast_str **res) |
static int | manager_modulecheck (struct mansession *s, const struct message *m) |
Manager function to check if module is loaded. More... | |
static int | manager_moduleload (struct mansession *s, const struct message *m) |
static int | manager_state_cb (const char *context, const char *exten, struct ast_state_cb_info *info, void *data) |
static int | mansession_cmp_fn (void *obj, void *arg, int flags) |
static enum ast_transport | mansession_get_transport (const struct mansession *s) |
static void | mansession_lock (struct mansession *s) |
Lock the 'mansession' structure. More... | |
static void | mansession_unlock (struct mansession *s) |
Unlock the 'mansession' structure. More... | |
static int | match_filter (struct mansession *s, char *eventdata) |
static void | print_event_instance (struct ast_cli_args *a, struct ast_xml_doc_item *instance) |
static int | process_events (struct mansession *s) |
static int | process_message (struct mansession *s, const struct message *m) |
Process an AMI message, performing desired action. Return 0 on success, -1 on error that require the session to be destroyed. More... | |
static void | purge_events (void) |
static void | purge_sessions (int n_max) |
remove at most n_max stale session from the list. More... | |
static int | queue_read_action_payload (struct ast_channel *chan, const unsigned char *payload, size_t payload_size, enum ast_frame_read_action action) |
Queue a given read action containing a payload onto a channel. More... | |
static int | queue_sendtext (struct ast_channel *chan, const char *body) |
Queue a read action to send a text message. More... | |
static int | queue_sendtext_data (struct ast_channel *chan, const char *body, const char *content_type) |
Queue a read action to send a text data message. More... | |
static int | reload_module (void) |
static void | report_auth_success (const struct mansession *s) |
static void | report_failed_acl (const struct mansession *s, const char *username) |
static void | report_failed_challenge_response (const struct mansession *s, const char *response, const char *expected_response) |
static void | report_inval_password (const struct mansession *s, const char *username) |
static void | report_invalid_user (const struct mansession *s, const char *username) |
static void | report_req_bad_format (const struct mansession *s, const char *action) |
static void | report_req_not_allowed (const struct mansession *s, const char *action) |
static void | report_session_limit (const struct mansession *s) |
static int | send_string (struct mansession *s, char *string) |
static void | session_destroy (struct mansession_session *s) |
static void | session_destructor (void *obj) |
static void * | session_do (void *data) |
The body of the individual manager session. Call get_input() to read one line at a time (or be woken up on new events), collect the lines in a message until found an empty line, and execute the request. In any case, deliver events asynchronously through process_events() (called from here if no line is available, or at the end of process_message(). ) More... | |
static int | set_eventmask (struct mansession *s, const char *eventmask) |
Rather than braindead on,off this now can also accept a specific int mask value or a ',' delim list of mask strings (the same as manager.conf) -anthm. More... | |
static int | strings_to_mask (const char *string) |
static struct mansession_session * | unref_mansession (struct mansession_session *s) |
Unreference manager session object. If no more references, then go ahead and delete it. More... | |
static const char * | user_authority_to_str (int authority, struct ast_str **res) |
Convert authority code to a list of options for a user. This will only display those authority codes that have an explicit match on authority. More... | |
static int | whitefilter_cmp_fn (void *obj, void *arg, void *data, int flags) |
Variables | |
static struct stasis_subscription * | acl_change_sub |
static struct actions | actions = { .first = NULL, .last = NULL, .lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } , } |
static struct all_events | all_events = { .first = NULL, .last = NULL, .lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } , } |
static int | allowmultiplelogin = 1 |
static struct ast_threadstorage | astman_append_buf = { .once = PTHREAD_ONCE_INIT , .key_init = __init_astman_append_buf , .custom_init = NULL , } |
static int | authlimit |
static int | authtimeout |
static int | broken_events_action = 0 |
struct { | |
const char * words [AST_MAX_CMD_LEN] | |
} | command_blacklist [] |
static int | displayconnects = 1 |
static char | global_realm [MAXHOSTNAMELEN] |
static int | httptimeout = 60 |
static char * | manager_channelvars |
static int | manager_debug = 0 |
static int | manager_enabled = 0 |
static struct ast_threadstorage | manager_event_buf = { .once = PTHREAD_ONCE_INIT , .key_init = __init_manager_event_buf , .custom_init = NULL , } |
static struct manager_hooks | manager_hooks = { .first = NULL, .last = NULL, .lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } , } |
static struct stasis_topic * | manager_topic |
A stasis_topic that all topics AMI cares about will be forwarded to. More... | |
static const struct permalias | perms [] |
static struct stasis_forward * | rtp_topic_forwarder |
The stasis_subscription for forwarding the RTP topic to the AMI topic. More... | |
static struct stasis_forward * | security_topic_forwarder |
The stasis_subscription for forwarding the Security topic to the AMI topic. More... | |
static struct stasis_message_router * | stasis_router |
The stasis_message_router for all Stasis Message Bus API messages. More... | |
static int | subscribed = 0 |
static struct stasis_forward * | test_suite_forwarder |
The stasis_subscription for forwarding the Test topic to the AMI topic. More... | |
static int | timestampevents |
static int | unauth_sessions = 0 |
static struct ast_threadstorage | userevent_buf = { .once = PTHREAD_ONCE_INIT , .key_init = __init_userevent_buf , .custom_init = NULL , } |
static struct users | users = { .first = NULL, .last = NULL, .lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } , } |
static int | webmanager_enabled = 0 |
STASIS_MESSAGE_TYPE_DEFN (ast_manager_get_generic_type) | |
Define AMI message types. More... | |
#define any_manager_listeners | ( | sessions | ) | ((sessions && ao2_container_count(sessions)) || !AST_RWLIST_EMPTY(&manager_hooks)) |
Definition at line 1835 of file manager.c.
Referenced by __ast_manager_event_multichan(), manager_default_msg_cb(), and manager_generic_msg_cb().
#define ASTMAN_APPEND_BUF_INITSIZE 256 |
initial allocated size for the astman_append_buf and astman_send_*_va
Definition at line 3066 of file manager.c.
Referenced by astman_append(), astman_send_error_va(), astman_send_list_complete_start_common(), and astman_send_response_full().
#define DEFAULT_REALM "asterisk" |
Definition at line 1483 of file manager.c.
Referenced by manager_set_defaults().
#define EVENT_FLAG_SHUTDOWN -1 |
Fake event class used to end sessions at shutdown.
Definition at line 1511 of file manager.c.
Referenced by __manager_event_sessions_va(), authority_to_str(), manager_shutdown(), and process_events().
#define GET_HEADER_FIRST_MATCH 0 |
Definition at line 2766 of file manager.c.
Referenced by astman_get_header().
#define GET_HEADER_LAST_MATCH 1 |
Definition at line 2767 of file manager.c.
Referenced by __astman_get_header().
#define GET_HEADER_SKIP_EMPTY 2 |
Definition at line 2768 of file manager.c.
Referenced by __astman_get_header(), and process_message().
#define MANAGER_EVENT_BUF_INITSIZE 256 |
Definition at line 7110 of file manager.c.
Referenced by __manager_event_sessions_va().
#define manager_event_sessions | ( | sessions, | |
category, | |||
event, | |||
contents, | |||
... | |||
) | __manager_event_sessions(sessions, category, event, 0, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__, contents , ## __VA_ARGS__) |
Definition at line 1832 of file manager.c.
Referenced by manager_default_msg_cb(), and manager_generic_msg_cb().
#define MAX_AUTH_PERM_STRING 150 |
Maximum string length of the AMI authority permission string buildable from perms[].
Definition at line 2043 of file manager.c.
Referenced by __manager_event_sessions_va(), action_listcommands(), action_login(), handle_showmanager(), and handle_showmancmd().
#define MAX_BLACKLIST_CMD_LEN 2 |
Descriptor for a manager session, either on the AMI socket or over HTTP.
Definition at line 1523 of file manager.c.
Referenced by check_blacklist().
#define MAX_VARS 128 |
Definition at line 1508 of file manager.c.
Referenced by load_channelvars().
#define MGR_SHOW_TERMINAL_WIDTH 80 |
Definition at line 1506 of file manager.c.
Referenced by handle_showmancmds().
#define MSG_MOREDATA ((char *)astman_send_response) |
Definition at line 3114 of file manager.c.
Referenced by action_command(), astman_send_response_full(), and astman_start_ack().
enum add_filter_result |
Enumerator | |
---|---|
FILTER_SUCCESS | |
FILTER_ALLOC_FAILED | |
FILTER_COMPILE_FAIL |
enum error_type |
Doxygen group
Definition at line 1419 of file manager.c.
Enumerator | |
---|---|
MESSAGE_OKAY | |
MESSAGE_LINE_TOO_LONG |
Definition at line 1615 of file manager.c.
int __ast_manager_event_multichan | ( | int | category, |
const char * | event, | ||
int | chancount, | ||
struct ast_channel ** | chans, | ||
const char * | file, | ||
int | line, | ||
const char * | func, | ||
const char * | contents, | ||
... | |||
) |
External routines may send asterisk manager events this way
category | Event category, matches manager authorization |
event | Event name |
chancount | Number of channels in chans parameter |
chans | A pointer to an array of channels involved in the event |
file,line,func | |
contents | Format string describing event |
... |
Definition at line 7233 of file manager.c.
References __manager_event_sessions_va(), any_manager_listeners, ao2_cleanup, and ao2_global_obj_ref.
|
static |
Return a matching header value.
Generic function to return either the first or the last matching header from a list of variables, possibly skipping empty strings.
Definition at line 2783 of file manager.c.
References ast_skip_blanks(), ast_strlen_zero, GET_HEADER_LAST_MATCH, GET_HEADER_SKIP_EMPTY, message::hdrcount, message::headers, result, and value.
Referenced by astman_get_header(), and process_message().
|
static |
thread local buffer for astman_append
|
static |
|
static |
Definition at line 7211 of file manager.c.
References __manager_event_sessions_va().
|
static |
Definition at line 7112 of file manager.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, append_channel_vars(), append_event(), ast_atomic_fetchadd_int(), ast_config_AST_SYSTEM_NAME, ast_mutex_lock, ast_mutex_unlock, AST_PTHREADT_NULL, AST_RWLIST_EMPTY, AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, ast_str_alloca, ast_str_append(), ast_str_append_va(), ast_str_buffer(), ast_str_set(), ast_str_thread_get(), ast_strlen_zero, ast_tvnow(), authority_to_str(), buf, chancount, EVENT_FLAG_SHUTDOWN, manager_custom_hook::helper, manager_debug, manager_event_buf, MANAGER_EVENT_BUF_INITSIZE, MAX_AUTH_PERM_STRING, mansession_session::notify_lock, mansession_session::pending_event, eventqent::seq, session, timestampevents, unref_mansession(), and mansession_session::waiting_thread.
Referenced by __ast_manager_event_multichan(), and __manager_event_sessions().
|
static |
Definition at line 9637 of file manager.c.
References __init_manager(), ast_log, ast_named_acl_change_type(), LOG_NOTICE, and stasis_message_type().
Referenced by acl_change_stasis_subscribe().
|
static |
Definition at line 1534 of file manager.c.
References acl_change_stasis_cb(), ast_named_acl_change_type(), ast_security_topic(), NULL, stasis_subscribe, stasis_subscription_accept_message_type(), STASIS_SUBSCRIPTION_FILTER_SELECTIVE, and stasis_subscription_set_filter().
Referenced by __init_manager().
|
static |
Definition at line 1544 of file manager.c.
References stasis_unsubscribe_and_join().
Referenced by __init_manager(), and manager_shutdown().
|
static |
Definition at line 5518 of file manager.c.
References ast_aoc_unit_entry::amount, aocmessage_get_unit_entry(), ast_aoc_add_unit_entry(), AST_AOC_BILLING_CALL_DEFLECTION, AST_AOC_BILLING_CALL_FWD_BUSY, AST_AOC_BILLING_CALL_FWD_NO_REPLY, AST_AOC_BILLING_CALL_FWD_UNCONDITIONAL, AST_AOC_BILLING_CALL_TRANSFER, AST_AOC_BILLING_CREDIT_CARD, AST_AOC_BILLING_NA, AST_AOC_BILLING_NORMAL, AST_AOC_BILLING_REVERSE_CHARGE, AST_AOC_CHARGE_CURRENCY, AST_AOC_CHARGE_FREE, AST_AOC_CHARGE_NA, AST_AOC_CHARGE_UNIT, ast_aoc_create(), AST_AOC_D, ast_aoc_destroy_decoded(), ast_aoc_destroy_encoded(), AST_AOC_E, ast_aoc_encode(), AST_AOC_MULT_HUNDRED, AST_AOC_MULT_ONE, AST_AOC_MULT_ONEHUNDREDTH, AST_AOC_MULT_ONETENTH, AST_AOC_MULT_ONETHOUSANDTH, AST_AOC_MULT_TEN, AST_AOC_MULT_THOUSAND, ast_aoc_set_association_id(), ast_aoc_set_association_number(), ast_aoc_set_billing_id(), ast_aoc_set_currency_info(), ast_aoc_set_total_type(), AST_AOC_SUBTOTAL, AST_AOC_TOTAL, ast_channel_get_by_name(), ast_channel_get_by_name_prefix(), ast_channel_unref, AST_CONTROL_AOC, ast_indicate_data(), ast_strlen_zero, astman_get_header(), astman_send_ack(), astman_send_error(), NULL, ast_aoc_unit_entry::type, ast_aoc_unit_entry::valid_amount, and ast_aoc_unit_entry::valid_type.
Referenced by __init_manager().
|
static |
Definition at line 5164 of file manager.c.
References ast_channel_get_by_name(), ast_channel_lock, ast_channel_unlock, ast_channel_unref, AST_FEATURE_MAX_LEN, AST_FRAME_DTMF, ast_get_builtin_feature(), ast_queue_frame(), ast_strlen_zero, astman_get_header(), astman_send_ack(), astman_send_error(), context, digit, exten, name, NULL, and pbx_builtin_setvar_helper().
Referenced by __init_manager().
|
static |
Definition at line 5118 of file manager.c.
References ast_bridge_transfer_blind(), AST_BRIDGE_TRANSFER_FAIL, AST_BRIDGE_TRANSFER_INVALID, AST_BRIDGE_TRANSFER_NOT_PERMITTED, AST_BRIDGE_TRANSFER_SUCCESS, ast_channel_context(), ast_channel_get_by_name(), ast_channel_unref, ast_strlen_zero, astman_get_header(), astman_send_ack(), astman_send_error(), context, exten, name, and NULL.
Referenced by __init_manager().
|
static |
Definition at line 5218 of file manager.c.
References ast_channel_get_by_name(), ast_channel_lock, ast_channel_unlock, ast_channel_unref, AST_FRAME_DTMF, ast_free, ast_get_chan_features_atxferabort(), ast_queue_frame(), ast_strlen_zero, astman_get_header(), astman_send_ack(), astman_send_error(), digit, name, and NULL.
Referenced by __init_manager().
|
static |
Definition at line 4442 of file manager.c.
References ast_random(), ast_strlen_zero, astman_append(), astman_get_header(), astman_send_error(), astman_start_ack(), mansession_session::challenge, mansession_lock(), mansession_unlock(), and mansession::session.
Referenced by __init_manager().
|
static |
Manager command "command" - execute CLI command.
Definition at line 5295 of file manager.c.
References ast_free, ast_malloc, ast_strlen_zero, astman_append(), astman_get_header(), astman_send_error(), astman_send_error_va(), astman_send_response_full(), buf, check_blacklist(), errno, len(), MSG_MOREDATA, NULL, RESULT_SUCCESS, strsep(), and term_strip().
Referenced by __init_manager().
|
static |
Show PBX core settings information.
Definition at line 6276 of file manager.c.
References AMI_VERSION, ast_cdr_is_enabled(), AST_CLI_YESNO, ast_config_AST_RUN_GROUP, ast_config_AST_RUN_USER, ast_config_AST_SYSTEM_NAME, ast_get_version(), ast_option_maxcalls, ast_option_maxfiles, ast_option_maxload, ast_realtime_enabled(), ast_strlen_zero, ast_webmanager_check_enabled(), astman_append(), and astman_get_header().
Referenced by __init_manager().
|
static |
Manager command "CoreShowChannels" - List currently defined channels and some information about them.
Definition at line 6390 of file manager.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_channel_snapshot_dialplan::appl, ast_channel_cache_by_name(), ast_free, ast_manager_build_channel_state_string_prefix(), ast_str_buffer(), ast_strlen_zero, ast_tvdiff_ms(), ast_tvnow(), ast_tvzero(), astman_append(), astman_get_header(), astman_send_list_complete(), astman_send_listack(), ast_channel_snapshot::base, ast_channel_snapshot::bridge, channels, ast_channel_snapshot_base::creationtime, ast_channel_snapshot_dialplan::data, ast_channel_snapshot::dialplan, and ast_channel_snapshot_bridge::id.
Referenced by __init_manager().
|
static |
Show PBX core status information.
Definition at line 6318 of file manager.c.
References ast_active_channels(), ast_lastreloadtime, ast_localtime(), ast_startuptime, ast_strftime(), ast_strlen_zero, astman_append(), astman_get_header(), and NULL.
Referenced by __init_manager().
|
static |
Definition at line 4188 of file manager.c.
References ast_config_AST_CONFIG_DIR, AST_FILE_MODE, ast_str_alloca, ast_str_append(), ast_str_buffer(), ast_str_set(), astman_get_header(), astman_send_ack(), astman_send_error(), errno, and PATH_MAX.
Referenced by __init_manager().
|
static |
Definition at line 7372 of file manager.c.
References ao2_cleanup, ast_string_field_free_memory, manager_action::final_response, manager_action::list_responses, and manager_action::synopsis.
Referenced by ast_manager_register2().
|
static |
Definition at line 4343 of file manager.c.
References ARRAY_LEN, ast_strlen_zero, astman_append(), astman_get_header(), astman_send_error(), broken_events_action, permalias::num, perms, and set_eventmask().
Referenced by __init_manager().
|
static |
Definition at line 5974 of file manager.c.
References ast_extension_state(), ast_extension_state2str(), ast_get_hint(), ast_strlen_zero, astman_append(), astman_get_header(), astman_send_error(), astman_start_ack(), context, exten, NULL, and status.
Referenced by __init_manager().
|
static |
Manager command to add an event filter to a manager session.
Definition at line 6111 of file manager.c.
References astman_get_header(), astman_send_ack(), astman_send_error(), mansession_session::blackfilters, filter(), FILTER_ALLOC_FAILED, FILTER_COMPILE_FAIL, FILTER_SUCCESS, manager_add_filter(), mansession::session, and mansession_session::whitefilters.
Referenced by __init_manager().
|
static |
Definition at line 1704 of file manager.c.
References manager_action::action, ao2_t_ref, AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, and AST_RWLIST_UNLOCK.
Referenced by ast_hook_send_action(), and process_message().
|
static |
Definition at line 3620 of file manager.c.
References ast_category_browse_filtered(), ast_category_first(), ast_category_get_name(), ast_category_get_templates(), ast_category_is_template(), ast_config_destroy(), ast_config_load2(), ast_free, ast_str_buffer(), ast_str_strlen(), ast_strlen_zero, astman_append(), astman_get_header(), astman_send_error(), astman_start_ack(), eventqent::category, CONFIG_FLAG_NOCACHE, CONFIG_FLAG_WITHCOMMENTS, CONFIG_STATUS_FILEINVALID, CONFIG_STATUS_FILEMISSING, filter(), ast_variable::name, ast_variable::next, NULL, templates, and ast_variable::value.
Referenced by __init_manager().
|
static |
Definition at line 3750 of file manager.c.
References ast_category_browse_filtered(), ast_category_first(), ast_category_get_name(), ast_category_get_templates(), ast_category_is_template(), ast_config_destroy(), ast_config_load2(), ast_free, ast_str_buffer(), ast_str_strlen(), ast_strlen_zero, astman_append(), astman_append_json(), astman_get_header(), astman_send_error(), astman_start_ack(), eventqent::category, CONFIG_FLAG_NOCACHE, CONFIG_FLAG_WITHCOMMENTS, CONFIG_STATUS_FILEINVALID, filter(), ast_variable::name, ast_variable::next, NULL, templates, and ast_variable::value.
Referenced by __init_manager().
|
static |
Definition at line 4610 of file manager.c.
References ast_channel_get_by_name(), ast_channel_unref, ast_dummy_channel_alloc, ast_func_read(), ast_log, ast_strlen_zero, astman_append(), astman_get_header(), astman_send_error(), astman_start_ack(), c, function_capable_string_allowed_with_auths(), LOG_ERROR, name, NULL, pbx_retrieve_variable(), S_OR, mansession::session, and mansession_session::writeperm.
Referenced by __init_manager().
|
static |
Definition at line 4460 of file manager.c.
References mansession_session::addr, ast_channel_get_by_name(), ast_channel_iterator_all_new(), ast_channel_iterator_destroy(), ast_channel_iterator_next(), ast_channel_name(), ast_channel_softhangup_withcause_locked(), ast_channel_unref, ast_free, ast_log, ast_regex_string_to_regex_pattern(), ast_sockaddr_stringify_addr(), ast_str_buffer(), ast_str_create, ast_strlen_zero, ast_verb, astman_append(), astman_get_header(), astman_send_ack(), astman_send_error(), astman_send_error_va(), astman_send_list_complete(), astman_send_listack(), c, LOG_NOTICE, mansession_session::managerid, NULL, mansession::session, and mansession_session::username.
Referenced by __init_manager().
|
static |
Definition at line 3682 of file manager.c.
References ast_category_browse_filtered(), ast_category_get_name(), ast_config_destroy(), ast_config_load2(), ast_strlen_zero, astman_append(), astman_get_header(), astman_send_error(), astman_start_ack(), eventqent::category, CONFIG_FLAG_NOCACHE, CONFIG_FLAG_WITHCOMMENTS, CONFIG_STATUS_FILEINVALID, match(), and NULL.
Referenced by __init_manager().
|
static |
Definition at line 4324 of file manager.c.
References manager_action::action, AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, ast_str_alloca, astman_append(), astman_start_ack(), manager_action::authority, authority_to_str(), MAX_AUTH_PERM_STRING, mansession::session, manager_action::synopsis, and mansession_session::writeperm.
Referenced by __init_manager().
|
static |
Manager command "LoggerRotate" - reloads and rotates the logger in the same manner as the CLI command 'logger rotate'.
Definition at line 6458 of file manager.c.
References ast_logger_rotate(), astman_send_ack(), and astman_send_error().
Referenced by __init_manager().
|
static |
Definition at line 4393 of file manager.c.
References mansession_session::addr, ast_atomic_fetchadd_int(), ast_lastreloadtime, AST_OPT_FLAG_FULLY_BOOTED, ast_options, ast_sockaddr_stringify_addr(), ast_startuptime, ast_str_alloca, ast_test_flag, ast_tvnow(), ast_tvsub(), ast_verb, astman_append(), astman_send_ack(), astman_send_error(), authenticate(), mansession_session::authenticated, authority_to_str(), EVENT_FLAG_SYSTEM, manager_displayconnects(), mansession_session::managerid, MAX_AUTH_PERM_STRING, mansession_session::readperm, mansession_session::send_events, mansession::session, tmp(), unauth_sessions, and mansession_session::username.
Referenced by __init_manager().
|
static |
Definition at line 4387 of file manager.c.
References astman_send_response().
Referenced by __init_manager().
|
static |
Definition at line 5953 of file manager.c.
References ast_app_inboxcount2(), ast_strlen_zero, astman_append(), astman_get_header(), astman_send_error(), astman_start_ack(), and mailbox.
Referenced by __init_manager().
|
static |
Definition at line 5936 of file manager.c.
References ast_app_has_voicemail(), ast_strlen_zero, astman_append(), astman_get_header(), astman_send_error(), astman_start_ack(), mailbox, and NULL.
Referenced by __init_manager().
|
static |
Definition at line 5723 of file manager.c.
References ao2_cleanup, app, ast_callerid_parse(), ast_calloc, ast_copy_string(), ast_exists_extension(), ast_findlabel_extension(), ast_format_cap_alloc, ast_format_cap_append, AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_remove_by_type(), ast_format_cap_update_by_allow_disallow(), ast_format_slin, ast_free, AST_MAX_PUBLIC_UNIQUEID, AST_MEDIA_TYPE_UNKNOWN, AST_OUTGOING_WAIT, ast_pbx_outgoing_app(), ast_pbx_outgoing_exten(), ast_pthread_create_detached, ast_shrink_phone_number(), ast_string_field_build, ast_string_field_init, ast_string_field_set, ast_strlen_zero, ast_true(), ast_variables_destroy(), ast_variables_dup(), astman_get_header(), astman_get_variables(), astman_send_ack(), astman_send_error(), astman_send_error_va(), fast_originate_helper::cap, mansession_session::chanvars, cid_name, cid_num, codecs, context, destroy_fast_originate_helper(), fast_originate_helper::early_media, EVENT_FLAG_SYSTEM, exten, fast_originate(), name, ast_variable::next, NULL, priority, fast_originate_helper::priority, mansession::session, strcasestr(), fast_originate_helper::timeout, tmp(), ast_assigned_ids::uniqueid, ast_assigned_ids::uniqueid2, fast_originate_helper::vars, and mansession_session::writeperm.
Referenced by __init_manager().
|
static |
Definition at line 3602 of file manager.c.
References ast_strlen_zero, ast_tvnow(), astman_append(), and astman_get_header().
Referenced by __init_manager().
|
static |
Definition at line 6004 of file manager.c.
References AST_PRESENCE_INVALID, ast_presence_state2str(), ast_strlen_zero, astman_append(), astman_get_header(), astman_send_error(), astman_send_error_va(), astman_start_ack(), provider, and state.
Referenced by __init_manager().
|
static |
action_redirect: The redirect manager command
Definition at line 4973 of file manager.c.
References ast_async_goto(), ast_channel_clear_flag(), ast_channel_flags(), ast_channel_get_by_name(), ast_channel_is_bridged(), ast_channel_lock, ast_channel_unlock, ast_channel_unref, ast_check_hangup_locked(), ast_findlabel_extension(), AST_FLAG_BRIDGE_DUAL_REDIRECT_WAIT, ast_set_flag, ast_strlen_zero, astman_get_header(), astman_send_ack(), astman_send_error(), buf, context, exten, name, NULL, and priority.
Referenced by __init_manager().
|
static |
Send a reload event.
Definition at line 6358 of file manager.c.
References ast_module_reload(), AST_MODULE_RELOAD_ERROR, AST_MODULE_RELOAD_IN_PROGRESS, AST_MODULE_RELOAD_NOT_FOUND, AST_MODULE_RELOAD_NOT_IMPLEMENTED, AST_MODULE_RELOAD_QUEUED, AST_MODULE_RELOAD_SUCCESS, AST_MODULE_RELOAD_UNINITIALIZED, astman_get_header(), astman_send_ack(), astman_send_error(), NULL, and S_OR.
Referenced by __init_manager().
|
static |
Definition at line 4930 of file manager.c.
References ast_channel_get_by_name(), ast_channel_unref, ast_strlen_zero, astman_get_header(), astman_send_ack(), astman_send_error(), c, name, queue_sendtext(), and queue_sendtext_data().
Referenced by __init_manager().
|
static |
Definition at line 4577 of file manager.c.
References ast_channel_get_by_name(), ast_channel_unref, ast_strlen_zero, astman_get_header(), astman_send_ack(), astman_send_error(), c, name, NULL, pbx_builtin_setvar_helper(), and S_OR.
Referenced by __init_manager().
|
static |
Manager "status" command to show channels.
Definition at line 4777 of file manager.c.
References AST_APP_ARG, ast_channel_get_by_name(), ast_channel_iterator_all_new(), ast_channel_iterator_destroy(), ast_channel_iterator_next(), ast_channel_lock, ast_channel_unlock, ast_channel_unref, AST_DECLARE_APP_ARGS, AST_STANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero, ast_true(), astman_append(), astman_get_header(), astman_send_error(), astman_send_list_complete_end(), astman_send_list_complete_start(), astman_send_listack(), channels, function_capable_string_allowed_with_auths(), generate_status(), name, NULL, S_OR, mansession::session, and mansession_session::writeperm.
Referenced by __init_manager().
|
static |
Definition at line 6044 of file manager.c.
References ast_channel_get_by_name(), ast_channel_lock, ast_channel_setwhentohangup_tv(), ast_channel_unlock, ast_channel_unref, ast_strlen_zero, astman_get_header(), astman_send_ack(), astman_send_error(), c, name, and timeout.
Referenced by __init_manager().
|
static |
Definition at line 4102 of file manager.c.
References ast_config_destroy(), ast_config_load2(), ast_config_text_file_save2(), ast_include_rename(), ast_module_reload(), ast_strlen_zero, ast_true(), astman_get_header(), astman_send_ack(), astman_send_error(), CONFIG_FLAG_NOCACHE, CONFIG_FLAG_WITHCOMMENTS, CONFIG_SAVE_FLAG_NONE, CONFIG_SAVE_FLAG_PRESERVE_EFFECTIVE_CONTEXT, CONFIG_STATUS_FILEINVALID, FAILURE_ALLOCATION, FAILURE_APPEND, FAILURE_DELCAT, FAILURE_DELETE, FAILURE_EMPTYCAT, FAILURE_NEWCAT, FAILURE_TEMPLATE, FAILURE_UPDATE, handle_updates(), NULL, result, UNKNOWN_ACTION, UNKNOWN_CATEGORY, UNSPECIFIED_ARGUMENT, and UNSPECIFIED_CATEGORY.
Referenced by __init_manager().
|
static |
Definition at line 6255 of file manager.c.
References ast_str_append(), ast_str_buffer(), ast_str_reset(), ast_str_thread_get(), astman_get_header(), astman_send_ack(), EVENT_FLAG_USER, message::hdrcount, message::headers, manager_event, and userevent_buf.
Referenced by __init_manager().
|
static |
Definition at line 4206 of file manager.c.
References advance_event(), ao2_lock, ao2_unlock, ast_debug, ast_iostream_get_fd(), ast_mutex_lock, ast_mutex_unlock, AST_PTHREADT_NULL, AST_RWLIST_NEXT, ast_strlen_zero, ast_wait_for_input(), astman_append(), astman_get_header(), astman_send_response(), eventqent::category, mansession_session::last_ev, mansession_session::managerid, match_filter(), max, mansession_session::needdestroy, mansession_session::notify_lock, NULL, mansession_session::readperm, mansession_session::send_events, mansession::session, mansession_session::sessiontimeout, mansession_session::stream, timeout, and mansession_session::waiting_thread.
Referenced by __init_manager().
Definition at line 2753 of file manager.c.
References ast_atomic_fetchadd_int(), AST_RWLIST_NEXT, AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, and eventqent::usecount.
Referenced by action_waitevent(), and process_events().
|
static |
Active manager connection sessions container.
|
static |
A container of event documentation nodes.
|
static |
Definition at line 5493 of file manager.c.
References ast_aoc_unit_entry::amount, ast_str_alloca, ast_str_buffer(), ast_str_set(), ast_strlen_zero, astman_get_header(), str, ast_aoc_unit_entry::type, ast_aoc_unit_entry::valid_amount, and ast_aoc_unit_entry::valid_type.
Referenced by action_aocmessage().
|
static |
Definition at line 7092 of file manager.c.
References ao2_ref, ast_channel_get_manager_vars(), ast_channel_name(), AST_LIST_TRAVERSE, ast_str_append(), ast_var_t::name, ast_var_t::value, and var.
Referenced by __manager_event_sessions_va().
|
static |
events are appended to a queue from where they can be dispatched to clients.
Definition at line 7068 of file manager.c.
References ast_atomic_fetchadd_int(), ast_malloc, AST_RWLIST_INSERT_TAIL, AST_RWLIST_NEXT, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_tvnow(), eventqent::category, NULL, eventqent::seq, tmp(), eventqent::tv, and eventqent::usecount.
Referenced by __init_manager(), and __manager_event_sessions_va().
int ast_hook_send_action | ( | struct manager_custom_hook * | hook, |
const char * | msg | ||
) |
access for hooks to send action messages to ami
Registered hooks can call this function to invoke actions and they will receive responses through registered callback.
Definition at line 2937 of file manager.c.
References action_find(), ao2_lock, ao2_t_ref, ao2_unlock, ARRAY_LEN, ast_free, ast_module_running_ref, ast_module_unref, ast_strdup, astman_get_header(), manager_action::func, message::hdrcount, message::headers, mansession::hook, manager_action::module, NULL, manager_action::registered, and mansession::session.
Referenced by hook_send().
|
static |
Tells you if smallstr exists inside bigstr which is delim by delim and uses no buf or stringsep ast_instring("this|that|more","this",'|') == 1;
feel free to move this to app.c -anthm
Definition at line 2112 of file manager.c.
Referenced by get_perm().
int ast_manager_check_enabled | ( | void | ) |
Check if AMI is enabled.
Definition at line 1949 of file manager.c.
References manager_enabled.
Referenced by handle_show_settings().
struct stasis_message_router* ast_manager_get_message_router | ( | void | ) |
Get the stasis_message_router for AMI.
The | stasis_message_router for AMI |
NULL | on error |
Definition at line 1725 of file manager.c.
References stasis_router.
Referenced by manager_bridging_init(), manager_channels_init(), manager_mwi_init(), and manager_system_init().
struct stasis_topic* ast_manager_get_topic | ( | void | ) |
Get the Stasis Message Bus API topic for AMI.
The | Stasis Message Bus API topic for AMI |
NULL | on error |
Definition at line 1720 of file manager.c.
References manager_topic.
Referenced by aoc_publish_blob(), ast_manager_publish_event(), endpoint_state_cb(), load_module(), manager_bridging_init(), manager_channels_init(), manager_mwi_init(), manager_system_init(), publish_load_message_type(), queue_publish_member_blob(), and stasis_app_user_event().
void ast_manager_publish_event | ( | const char * | type, |
int | class_type, | ||
struct ast_json * | obj | ||
) |
Publish an event to AMI.
type | The type of AMI event to publish |
class_type | The class on which to publish the event |
obj | The event data to be published. |
Publishes a message to the Stasis Message Bus API message bus solely for the consumption of AMI. The message will be of the type provided by ast_manager_get_type, and will be published to the topic provided by ast_manager_get_topic. As such, the JSON must be constructed as defined by the ast_manager_get_type message.
Definition at line 1903 of file manager.c.
References ao2_cleanup, ast_json_pack(), ast_json_payload_create(), ast_json_ref(), ast_json_unref(), ast_manager_get_generic_type(), ast_manager_get_topic(), NULL, RAII_VAR, stasis_message_create(), and stasis_publish().
Referenced by analog_publish_channel_alarm_clear(), analog_publish_dnd_state(), publish_channel_alarm(), publish_channel_alarm_clear(), publish_dnd_state(), publish_fully_booted(), publish_qualify_peer_done(), publish_span_alarm(), publish_span_alarm_clear(), and really_quit().
int ast_manager_register2 | ( | const char * | action, |
int | auth, | ||
int(*)(struct mansession *s, const struct message *m) | func, | ||
struct ast_module * | module, | ||
const char * | synopsis, | ||
const char * | description | ||
) |
register a new command with manager, including online help. This is the preferred way to register a manager command
Register a manager command with the manager interface.
Definition at line 7386 of file manager.c.
References manager_action::action, action_destroy(), ao2_t_alloc, ao2_t_ref, ast_free, ast_manager_register_struct(), AST_STATIC_DOC, ast_string_field_init, ast_string_field_set, ast_strlen_zero, AST_XML_DOC, ast_xmldoc_build_arguments(), ast_xmldoc_build_description(), ast_xmldoc_build_final_response(), ast_xmldoc_build_list_responses(), ast_xmldoc_build_seealso(), ast_xmldoc_build_synopsis(), ast_xmldoc_build_syntax(), manager_action::authority, manager_action::docsrc, manager_action::final_response, manager_action::func, manager_action::list_responses, manager_action::module, and NULL.
void ast_manager_register_hook | ( | struct manager_custom_hook * | hook | ) |
Add a custom hook to be called when an event is fired.
Add a custom hook to be called when an event is fired
hook | struct manager_custom_hook object to add |
Definition at line 1934 of file manager.c.
References AST_RWLIST_INSERT_TAIL, AST_RWLIST_UNLOCK, and AST_RWLIST_WRLOCK.
Referenced by create_test_dialplan(), and register_hook().
|
static |
Definition at line 7329 of file manager.c.
References manager_action::action, ao2_t_ref, ast_log, AST_RWLIST_INSERT_AFTER, AST_RWLIST_INSERT_HEAD, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_verb, LOG_WARNING, NULL, ast_category::prev, and manager_action::registered.
Referenced by ast_manager_register2().
struct ast_str* ast_manager_str_from_json_object | ( | struct ast_json * | blob, |
key_exclusion_cb | exclusion_cb | ||
) |
Convert a JSON object into an AMI compatible string.
blob | The JSON blob containing key/value pairs to convert |
exclusion_cb | A key_exclusion_cb pointer to a function that will exclude keys from the final AMI string |
A | malloc'd ast_str object. Callers of this function should free the returned ast_str object |
NULL | on error |
Definition at line 1821 of file manager.c.
References ast_json_is_null(), ast_str_create, manager_json_to_ast_str(), and NULL.
Referenced by agi_channel_to_ami(), aoc_to_ami(), manager_generic_msg_cb(), multi_user_event_to_ami(), mwi_app_event_cb(), queue_channel_to_ami(), queue_member_to_ami(), and queue_multi_channel_to_ami().
int ast_manager_unregister | ( | const char * | action | ) |
support functions to register/unregister AMI action handlers,
Unregister a registered manager command.
Definition at line 7258 of file manager.c.
References manager_action::action, ao2_lock, ao2_t_ref, ao2_unlock, AST_RWLIST_REMOVE_CURRENT, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_verb, and manager_action::registered.
Referenced by __unload_module(), ast_res_pjsip_cleanup_options_handling(), ast_res_pjsip_destroy_configuration(), ast_sip_destroy_sorcery_auth(), ast_sip_destroy_sorcery_location(), astdb_atexit(), bridge_cleanup(), load_module(), local_shutdown(), manager_bridging_cleanup(), manager_shutdown(), message_shutdown(), unload_module(), unload_parking_manager(), and unload_pbx().
void ast_manager_unregister_hook | ( | struct manager_custom_hook * | hook | ) |
Delete a custom hook to be called when an event is fired.
Delete a custom hook to be called when an event is fired
hook | struct manager_custom_hook object to delete |
Definition at line 1942 of file manager.c.
References AST_RWLIST_REMOVE, AST_RWLIST_UNLOCK, and AST_RWLIST_WRLOCK.
Referenced by register_hook(), unload_module(), and unregister_hook().
int ast_webmanager_check_enabled | ( | void | ) |
Check if AMI/HTTP is enabled.
Definition at line 1954 of file manager.c.
References manager_enabled, and webmanager_enabled.
Referenced by action_coresettings(), and handle_show_settings().
void astman_append | ( | struct mansession * | s, |
const char * | fmt, | ||
... | |||
) |
utility functions for creating AMI replies
Definition at line 3080 of file manager.c.
References AST_DYNSTR_BUILD_FAILED, ast_str_buffer(), ast_str_set_va(), ast_str_thread_get(), ast_verbose(), astman_append_buf, ASTMAN_APPEND_BUF_INITSIZE, buf, mansession::hook, NULL, send_string(), ast_tcptls_session_instance::stream, and mansession::tcptls_session.
Referenced by _iax2_show_peers_one(), _sip_show_peer(), _sip_show_peers_one(), _skinny_show_device(), _skinny_show_devices(), _skinny_show_line(), _skinny_show_lines(), action_agents(), action_challenge(), action_command(), action_confbridgelist_item(), action_confbridgelistrooms(), action_coresettings(), action_coreshowchannels(), action_corestatus(), action_dahdishowchannels(), action_devicestatelist(), action_events(), action_extensionstate(), action_extensionstatelist(), action_getconfig(), action_getconfigjson(), action_getvar(), action_hangup(), action_listcategories(), action_listcommands(), action_login(), action_mailboxcount(), action_mailboxstatus(), action_meetmelist(), action_meetmelistrooms(), action_ping(), action_presencestate(), action_presencestatelist(), action_status(), action_waitevent(), ami_outbound_registration_task(), ami_registrations_aor(), ami_show_outbound_registrations(), ami_subscription_detail(), append_vmu_info_astman(), ast_cli_netstats(), ast_sip_format_contact_ami(), astman_append_json(), astman_send_list_complete_end(), dahdi_cc_callback(), do_print(), format_ami_aor_handler(), format_ami_aorlist_handler(), format_ami_auth_handler(), format_ami_authlist_handler(), format_ami_contactlist_handler(), format_ami_endpoint(), format_ami_endpoint_transport(), format_ami_endpoints(), format_ami_resource_lists(), generate_status(), manager_append_event_parking_lot_data_cb(), manager_bridge_info(), manager_bridge_tech_list(), manager_dbget(), manager_fax_sessions(), manager_fax_sessions_entry(), manager_fax_stats(), manager_iax2_show_netstats(), manager_iax2_show_registry(), manager_jabber_send(), manager_mixmonitor(), manager_modulecheck(), manager_mute_mixmonitor(), manager_mutestream(), manager_parking_status_all_lots(), manager_parking_status_single_lot(), manager_queue_rule_show(), manager_queues_status(), manager_queues_summary(), manager_show_dialplan(), manager_show_dialplan_helper(), manager_show_registry(), manager_sip_show_peer(), manager_skinny_show_device(), manager_skinny_show_line(), manager_stop_mixmonitor(), mwi_mailbox_get(), send_bridge_info_item_cb(), send_bridge_list_item_cb(), send_identify_ami_event(), send_manager_peer_status(), session_do(), and spandsp_manager_fax_session().
|
static |
Append additional headers into the message structure from params.
Definition at line 2830 of file manager.c.
References ARRAY_LEN, ast_asprintf, message::hdrcount, message::headers, ast_variable::name, ast_variable::next, and ast_variable::value.
Referenced by auth_http_callback(), and generic_http_callback().
|
static |
Definition at line 3741 of file manager.c.
References ast_alloca, astman_append(), buf, and json_escape().
Referenced by action_getconfigjson().
|
static |
Definition at line 3068 of file manager.c.
References ast_str_buffer(), ast_verbose(), mansession::hook, send_string(), ast_tcptls_session_instance::stream, and mansession::tcptls_session.
Referenced by astman_send_list_complete(), astman_send_list_complete_start(), and astman_send_response_full().
|
static |
Free headers inside message structure, but not the message structure itself.
Definition at line 2844 of file manager.c.
References ast_free, message::hdrcount, message::headers, and NULL.
Referenced by auth_http_callback(), do_message(), and generic_http_callback().
const char* astman_get_header | ( | const struct message * | m, |
char * | var | ||
) |
Return the first matching variable from an array.
Get header from mananger transaction.
Definition at line 2820 of file manager.c.
References __astman_get_header(), and GET_HEADER_FIRST_MATCH.
Referenced by _sip_qualify_peer(), _sip_show_peer(), _sip_show_peers(), _skinny_show_devices(), _skinny_show_lines(), action_add_agi_cmd(), action_agent_logoff(), action_agents(), action_aocmessage(), action_atxfer(), action_blind_transfer(), action_bridge(), action_cancel_atxfer(), action_challenge(), action_command(), action_confbridgekick(), action_confbridgelist(), action_confbridgelistrooms(), action_confbridgesetsinglevideosrc(), action_confbridgestartrecord(), action_confbridgestoprecord(), action_coresettings(), action_coreshowchannels(), action_corestatus(), action_createconfig(), action_dahdidialoffhook(), action_dahdidndoff(), action_dahdidndon(), action_dahdishowchannels(), action_devicestatelist(), action_events(), action_extensionstate(), action_extensionstatelist(), action_filter(), action_getconfig(), action_getconfigjson(), action_getvar(), action_hangup(), action_listcategories(), action_lock_unlock_helper(), action_mailboxcount(), action_mailboxstatus(), action_meetmelist(), action_meetmelistrooms(), action_messagesend(), action_mute_unmute_helper(), action_originate(), action_ping(), action_presencestate(), action_presencestatelist(), action_redirect(), action_reload(), action_sendtext(), action_setvar(), action_status(), action_timeout(), action_transfer(), action_transferhangup(), action_updateconfig(), action_userevent(), action_waitevent(), ami_register(), ami_show_aors(), ami_show_auths(), ami_show_contacts(), ami_show_endpoint(), ami_show_endpoints(), ami_show_outbound_registrations(), ami_show_registration_contact_statuses(), ami_show_registrations(), ami_show_resource_lists(), ami_show_subscriptions_inbound(), ami_show_subscriptions_outbound(), ami_sip_qualify(), ami_unregister(), aocmessage_get_unit_entry(), ast_hook_send_action(), astman_send_list_complete_start_common(), astman_send_response_full(), authenticate(), change_monitor_action(), controlplayback_manager(), dahdi_cc_callback(), do_pause_or_unpause(), handle_manager_bridge_tech_suspend(), handle_updates(), manager_add_queue_member(), manager_bridge_destroy(), manager_bridge_info(), manager_bridge_kick(), manager_bridge_tech_list(), manager_bridges_list(), manager_change_priority_caller_on_queue(), manager_dbdel(), manager_dbdeltree(), manager_dbget(), manager_dbput(), manager_dialplan_extension_add(), manager_dialplan_extension_remove(), manager_fax_session(), manager_fax_sessions(), manager_fax_stats(), manager_iax2_show_peer_list(), manager_iax2_show_peers(), manager_iax2_show_registry(), manager_jabber_send(), manager_list_voicemail_users(), manager_match_mailbox(), manager_mixmonitor(), manager_modulecheck(), manager_moduleload(), manager_mute_mixmonitor(), manager_mutestream(), manager_notify(), manager_optimize_away(), manager_park(), manager_parking_lot_list(), manager_parking_status(), manager_pause_queue_member(), manager_play_dtmf(), manager_play_mf(), manager_queue_log_custom(), manager_queue_member_penalty(), manager_queue_member_ringinuse(), manager_queue_reload(), manager_queue_reset(), manager_queue_rule_show(), manager_queues_status(), manager_queues_summary(), manager_remove_queue_member(), manager_show_dialplan(), manager_show_registry(), manager_sip_peer_status(), manager_sip_qualify_peer(), manager_sip_show_peer(), manager_sip_show_peers(), manager_sipnotify(), manager_skinny_show_device(), manager_skinny_show_line(), manager_status_voicemail_user(), manager_stop_mixmonitor(), meetmemute(), mwi_mailbox_delete(), mwi_mailbox_get(), mwi_mailbox_update(), process_message(), sorcery_memory_cache_ami_expire(), sorcery_memory_cache_ami_expire_object(), sorcery_memory_cache_ami_populate(), sorcery_memory_cache_ami_stale(), sorcery_memory_cache_ami_stale_object(), start_monitor_action(), and stop_monitor_action().
struct ast_variable* astman_get_variables | ( | const struct message * | m | ) |
Get a linked list of the Variable: headers.
Definition at line 2906 of file manager.c.
References astman_get_variables_order(), and ORDER_REVERSE.
Referenced by action_originate().
struct ast_variable* astman_get_variables_order | ( | const struct message * | m, |
enum variable_orders | order | ||
) |
Get a linked list of the Variable: headers with order specified.
Definition at line 2911 of file manager.c.
References ast_variables_reverse(), message::hdrcount, message::headers, man_do_variable_value(), NULL, and ORDER_NATURAL.
Referenced by action_messagesend(), astman_get_variables(), manager_notify_channel(), manager_notify_endpoint(), manager_notify_uri(), and manager_sipnotify().
void astman_send_ack | ( | struct mansession * | s, |
const struct message * | m, | ||
char * | msg | ||
) |
Send ack in manager transaction.
Definition at line 3191 of file manager.c.
References astman_send_response_full(), and NULL.
Referenced by _sip_qualify_peer(), action_add_agi_cmd(), action_agent_logoff(), action_aocmessage(), action_atxfer(), action_blind_transfer(), action_bridge(), action_cancel_atxfer(), action_confbridgekick(), action_confbridgesetsinglevideosrc(), action_confbridgestartrecord(), action_confbridgestoprecord(), action_createconfig(), action_dahdidialoffhook(), action_dahdidndoff(), action_dahdidndon(), action_dahdirestart(), action_filter(), action_hangup(), action_lock_unlock_helper(), action_loggerrotate(), action_login(), action_messagesend(), action_mute_unmute_helper(), action_originate(), action_redirect(), action_reload(), action_sendtext(), action_setvar(), action_timeout(), action_transfer(), action_transferhangup(), action_updateconfig(), action_userevent(), ami_register(), ami_sip_qualify(), ami_unregister(), change_monitor_action(), controlplayback_manager(), dahdi_cc_callback(), do_pause_or_unpause(), handle_manager_bridge_tech_suspend(), manager_add_queue_member(), manager_bridge_destroy(), manager_bridge_kick(), manager_change_priority_caller_on_queue(), manager_dbdel(), manager_dbdeltree(), manager_dbput(), manager_dialplan_extension_add(), manager_dialplan_extension_remove(), manager_fax_session(), manager_fax_stats(), manager_jabber_send(), manager_list_voicemail_users(), manager_moduleload(), manager_notify_channel(), manager_notify_endpoint(), manager_notify_uri(), manager_optimize_away(), manager_park_bridged(), manager_park_unbridged(), manager_pause_queue_member(), manager_play_dtmf(), manager_play_mf(), manager_queue_log_custom(), manager_queue_member_penalty(), manager_queue_member_ringinuse(), manager_queue_reload(), manager_queue_reset(), manager_remove_queue_member(), manager_sipnotify(), manager_status_voicemail_user(), manager_voicemail_refresh(), meetmemute(), mwi_mailbox_delete(), mwi_mailbox_update(), sorcery_memory_cache_ami_expire(), sorcery_memory_cache_ami_expire_object(), sorcery_memory_cache_ami_populate(), sorcery_memory_cache_ami_stale(), sorcery_memory_cache_ami_stale_object(), start_monitor_action(), and stop_monitor_action().
void astman_send_error | ( | struct mansession * | s, |
const struct message * | m, | ||
char * | error | ||
) |
Send error in manager transaction.
Definition at line 3159 of file manager.c.
References astman_send_response_full(), and NULL.
Referenced by _sip_qualify_peer(), _sip_show_peer(), action_add_agi_cmd(), action_agent_logoff(), action_aocmessage(), action_atxfer(), action_blind_transfer(), action_bridge(), action_cancel_atxfer(), action_challenge(), action_command(), action_confbridgekick(), action_confbridgelist(), action_confbridgelistrooms(), action_confbridgesetsinglevideosrc(), action_confbridgestartrecord(), action_confbridgestoprecord(), action_createconfig(), action_dahdidialoffhook(), action_dahdidndoff(), action_dahdidndon(), action_dahdirestart(), action_devicestatelist(), action_events(), action_extensionstate(), action_extensionstatelist(), action_filter(), action_getconfig(), action_getconfigjson(), action_getvar(), action_hangup(), action_listcategories(), action_lock_unlock_helper(), action_loggerrotate(), action_login(), action_mailboxcount(), action_mailboxstatus(), action_meetmelist(), action_meetmelistrooms(), action_messagesend(), action_mute_unmute_helper(), action_originate(), action_presencestate(), action_presencestatelist(), action_redirect(), action_reload(), action_sendtext(), action_setvar(), action_status(), action_timeout(), action_transfer(), action_transferhangup(), action_updateconfig(), ami_register(), ami_show_aors(), ami_show_auths(), ami_show_contacts(), ami_show_endpoints(), ami_show_outbound_registrations(), ami_show_resource_lists(), ami_sip_qualify(), ami_unregister(), change_monitor_action(), controlplayback_manager(), dahdi_cc_callback(), do_message(), do_pause_or_unpause(), handle_manager_bridge_tech_suspend(), handle_parse_error(), manager_add_queue_member(), manager_bridge_destroy(), manager_bridge_info(), manager_bridge_kick(), manager_bridge_tech_list(), manager_bridges_list(), manager_change_priority_caller_on_queue(), manager_dbdel(), manager_dbdeltree(), manager_dbget(), manager_dbput(), manager_dialplan_extension_add(), manager_dialplan_extension_remove(), manager_fax_session(), manager_jabber_send(), manager_mixmonitor(), manager_modulecheck(), manager_moduleload(), manager_mute_mixmonitor(), manager_mutestream(), manager_notify(), manager_notify_channel(), manager_notify_endpoint(), manager_notify_uri(), manager_optimize_away(), manager_park(), manager_park_bridged(), manager_park_unbridged(), manager_parking_lot_list(), manager_parking_status_all_lots(), manager_parking_status_single_lot(), manager_pause_queue_member(), manager_play_dtmf(), manager_play_mf(), manager_queue_log_custom(), manager_queue_member_penalty(), manager_queue_member_ringinuse(), manager_queue_reload(), manager_queue_reset(), manager_remove_queue_member(), manager_show_dialplan(), manager_show_dialplan_helper(), manager_sip_peer_status(), manager_sip_qualify_peer(), manager_sip_show_peer(), manager_sipnotify(), manager_skinny_show_device(), manager_skinny_show_line(), manager_status_voicemail_user(), manager_stop_mixmonitor(), meetmemute(), mwi_mailbox_delete(), mwi_mailbox_get(), mwi_mailbox_update(), process_message(), sorcery_memory_cache_ami_expire(), sorcery_memory_cache_ami_expire_object(), sorcery_memory_cache_ami_populate(), sorcery_memory_cache_ami_stale(), sorcery_memory_cache_ami_stale_object(), start_monitor_action(), and stop_monitor_action().
void astman_send_error_va | ( | struct mansession * | s, |
const struct message * | m, | ||
const char * | fmt, | ||
... | |||
) |
Send error in manager transaction (with va_args support)
Definition at line 3164 of file manager.c.
References AST_DYNSTR_BUILD_FAILED, ast_str_buffer(), ast_str_set_va(), ast_str_thread_get(), ast_strdupa, astman_append_buf, ASTMAN_APPEND_BUF_INITSIZE, astman_send_response_full(), buf, and NULL.
Referenced by action_command(), action_hangup(), action_originate(), action_presencestate(), ami_show_endpoint(), ast_sip_create_ami_event(), format_ami_endpoint_transport(), manager_notify_endpoint(), mwi_mailbox_delete(), mwi_mailbox_get(), and mwi_mailbox_update().
|
static |
Definition at line 3228 of file manager.c.
References ast_str_append(), astman_flush(), astman_send_list_complete_start_common(), and buf.
Referenced by action_coreshowchannels(), and action_hangup().
void astman_send_list_complete_end | ( | struct mansession * | s | ) |
End the list complete event.
s | - AMI session control struct. |
Definition at line 3245 of file manager.c.
References astman_append().
Referenced by action_agents(), action_confbridgelist(), action_confbridgelistrooms(), action_dahdishowchannels(), action_devicestatelist(), action_extensionstatelist(), action_meetmelist(), action_meetmelistrooms(), action_presencestatelist(), action_status(), ami_show_aors(), ami_show_auths(), ami_show_contacts(), ami_show_endpoint(), ami_show_endpoints(), ami_show_outbound_registrations(), ami_show_registration_contact_statuses(), ami_show_registrations(), ami_show_resource_lists(), ami_show_subscriptions_inbound(), ami_show_subscriptions_outbound(), manager_bridge_info(), manager_bridge_tech_list(), manager_bridges_list(), manager_dbget(), manager_fax_sessions(), manager_iax2_show_peer_list(), manager_iax2_show_peers(), manager_iax2_show_registry(), manager_list_voicemail_users(), manager_parking_lot_list(), manager_parking_status_all_lots(), manager_parking_status_single_lot(), manager_queues_status(), manager_queues_summary(), manager_show_dialplan(), manager_show_registry(), manager_sip_peer_status(), manager_sip_show_peers(), manager_skinny_show_devices(), manager_skinny_show_lines(), manager_status_voicemail_user(), and mwi_mailbox_get().
void astman_send_list_complete_start | ( | struct mansession * | s, |
const struct message * | m, | ||
const char * | event_name, | ||
int | count | ||
) |
Start the list complete event.
s | - AMI session control struct. |
m | - AMI action request that started the list. |
event_name | - AMI list complete event name. |
count | - Number of items in the list. |
Definition at line 3237 of file manager.c.
References astman_flush(), astman_send_list_complete_start_common(), and buf.
Referenced by action_agents(), action_confbridgelist(), action_confbridgelistrooms(), action_dahdishowchannels(), action_devicestatelist(), action_extensionstatelist(), action_meetmelist(), action_meetmelistrooms(), action_presencestatelist(), action_status(), ami_show_aors(), ami_show_auths(), ami_show_contacts(), ami_show_endpoint(), ami_show_endpoints(), ami_show_outbound_registrations(), ami_show_registration_contact_statuses(), ami_show_registrations(), ami_show_resource_lists(), ami_show_subscriptions_inbound(), ami_show_subscriptions_outbound(), manager_bridge_info(), manager_bridge_tech_list(), manager_bridges_list(), manager_dbget(), manager_fax_sessions(), manager_iax2_show_peer_list(), manager_iax2_show_peers(), manager_iax2_show_registry(), manager_list_voicemail_users(), manager_parking_lot_list(), manager_parking_status_all_lots(), manager_parking_status_single_lot(), manager_queues_status(), manager_queues_summary(), manager_show_dialplan(), manager_show_registry(), manager_sip_peer_status(), manager_sip_show_peers(), manager_skinny_show_devices(), manager_skinny_show_lines(), manager_status_voicemail_user(), and mwi_mailbox_get().
|
static |
Definition at line 3206 of file manager.c.
References ast_str_append(), ast_str_set(), ast_str_thread_get(), ast_strlen_zero, astman_append_buf, ASTMAN_APPEND_BUF_INITSIZE, astman_get_header(), buf, and NULL.
Referenced by astman_send_list_complete(), and astman_send_list_complete_start().
void astman_send_listack | ( | struct mansession * | s, |
const struct message * | m, | ||
char * | msg, | ||
char * | listflag | ||
) |
Send ack in manager transaction to begin a list.
s | - AMI session control struct. |
m | - AMI action request that started the list. |
msg | - Message contents describing the list to follow. |
listflag | - Should always be set to "start". |
Definition at line 3201 of file manager.c.
References astman_send_response_full().
Referenced by action_agents(), action_confbridgelist(), action_confbridgelistrooms(), action_coreshowchannels(), action_dahdishowchannels(), action_devicestatelist(), action_extensionstatelist(), action_hangup(), action_meetmelist(), action_meetmelistrooms(), action_presencestatelist(), action_status(), ami_show_aors(), ami_show_auths(), ami_show_contacts(), ami_show_endpoint(), ami_show_endpoints(), ami_show_outbound_registrations(), ami_show_registration_contact_statuses(), ami_show_registrations(), ami_show_resource_lists(), ami_show_subscriptions_inbound(), ami_show_subscriptions_outbound(), manager_bridge_info(), manager_bridge_tech_list(), manager_bridges_list(), manager_dbget(), manager_dpsendack(), manager_fax_sessions(), manager_iax2_show_peer_list(), manager_iax2_show_peers(), manager_iax2_show_registry(), manager_list_voicemail_users(), manager_parking_lot_list(), manager_parking_status_all_lots(), manager_parking_status_single_lot(), manager_queues_status(), manager_queues_summary(), manager_show_registry(), manager_sip_peer_status(), manager_sip_show_peers(), manager_skinny_show_devices(), manager_skinny_show_lines(), manager_status_voicemail_user(), and mwi_mailbox_get().
void astman_send_response | ( | struct mansession * | s, |
const struct message * | m, | ||
char * | resp, | ||
char * | msg | ||
) |
Send response in manager transaction.
Definition at line 3154 of file manager.c.
References astman_send_response_full(), and NULL.
Referenced by action_logoff(), and action_waitevent().
|
static |
send a response with an optional message, and terminate it with an empty line. m is used only to grab the 'ActionID' field.
Use the explicit constant MSG_MOREDATA to remove the empty line. XXX MSG_MOREDATA should go to a header file.
Definition at line 3123 of file manager.c.
References ast_str_append(), ast_str_set(), ast_str_thread_get(), ast_strlen_zero, astman_append_buf, ASTMAN_APPEND_BUF_INITSIZE, astman_flush(), astman_get_header(), buf, and MSG_MOREDATA.
Referenced by action_command(), astman_send_ack(), astman_send_error(), astman_send_error_va(), astman_send_listack(), astman_send_response(), and astman_start_ack().
|
static |
Definition at line 3196 of file manager.c.
References astman_send_response_full(), MSG_MOREDATA, and NULL.
Referenced by action_challenge(), action_extensionstate(), action_getconfig(), action_getconfigjson(), action_getvar(), action_listcategories(), action_listcommands(), action_mailboxcount(), action_mailboxstatus(), and action_presencestate().
|
static |
Definition at line 3505 of file manager.c.
References ast_manager_user::acl, mansession_session::addr, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_t_link, ao2_t_ref, ast_apply_acl(), ast_copy_string(), ast_debug, ast_log, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, AST_SENSE_DENY, ast_sockaddr_stringify_addr(), ast_strlen_zero, ast_tvnow(), ast_variables_dup(), astman_get_header(), mansession_session::blackfilters, ast_manager_user::blackfilters, mansession_session::challenge, mansession_session::chanvars, ast_manager_user::chanvars, error(), get_manager_by_name_locked(), len(), LOG_NOTICE, MD5Final(), MD5Init(), MD5Update(), NULL, password, mansession_session::readperm, ast_manager_user::readperm, report_auth_success(), report_failed_acl(), report_failed_challenge_response(), report_inval_password(), report_invalid_user(), S_OR, ast_manager_user::secret, mansession::session, mansession_session::sessionstart, mansession_session::sessionstart_tv, set_eventmask(), mansession_session::username, mansession_session::whitefilters, ast_manager_user::whitefilters, mansession_session::writeperm, ast_manager_user::writeperm, mansession_session::writetimeout, and ast_manager_user::writetimeout.
Referenced by action_login().
|
static |
Convert authority code to a list of options. Note that the EVENT_FLAG_ALL authority will always be returned.
Definition at line 2084 of file manager.c.
References ARRAY_LEN, ast_str_append(), ast_str_buffer(), ast_str_reset(), ast_str_strlen(), EVENT_FLAG_SHUTDOWN, and perms.
Referenced by __manager_event_sessions_va(), action_listcommands(), action_login(), and handle_showmancmd().
|
static |
Definition at line 6092 of file manager.c.
References CMP_MATCH, CMP_STOP, NULL, and result.
Referenced by match_filter().
|
static |
Allocate manager session structure and add it to the list of sessions.
Definition at line 2229 of file manager.c.
References mansession_session::addr, ao2_alloc, AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_list, ao2_global_obj_ref, ao2_link, ao2_ref, ast_mutex_init, AST_PTHREADT_NULL, ast_sockaddr_copy(), mansession_session::blackfilters, mansession_session::notify_lock, NULL, mansession_session::send_events, session_destructor(), sessions, mansession_session::waiting_thread, mansession_session::whitefilters, and mansession_session::writetimeout.
Referenced by auth_http_callback(), generic_http_callback(), and session_do().
|
static |
Definition at line 5259 of file manager.c.
References ARRAY_LEN, AST_MAX_CMD_LEN, ast_strdupa, ast_strip(), ast_strlen_zero, command_blacklist, match(), MAX_BLACKLIST_CMD_LEN, NULL, strsep(), and words.
Referenced by action_command().
|
static |
Definition at line 2282 of file manager.c.
References ao2_find, ao2_global_obj_ref, ao2_ref, mansession_session::inuse, session, sessions, and unref_mansession().
Referenced by process_message().
|
static |
Definition at line 5405 of file manager.c.
References ao2_cleanup, ast_free, ast_string_field_free_memory, ast_variables_destroy(), fast_originate_helper::cap, and fast_originate_helper::vars.
Referenced by action_originate(), and fast_originate().
|
static |
Definition at line 6852 of file manager.c.
References mansession_session::addr, ARRAY_LEN, ast_log, ast_sockaddr_stringify_addr(), ast_strdup, ast_strlen_zero, ast_verb, astman_free_headers(), astman_send_error(), mansession_session::authenticated, mansession_session::authstart, authtimeout, displayconnects, errno, get_input(), handle_parse_error(), message::hdrcount, message::headers, mansession_session::inbuf, LOG_ERROR, mansession_lock(), mansession_unlock(), MESSAGE_LINE_TOO_LONG, MESSAGE_OKAY, mansession::parsing, process_events(), process_message(), and mansession::session.
Referenced by session_do().
|
static |
Definition at line 2192 of file manager.c.
Referenced by manager_add_filter().
|
static |
Definition at line 5413 of file manager.c.
References fast_originate_helper::account, fast_originate_helper::app, fast_originate_helper::appdata, AST_CHANNEL_NAME, ast_channel_name(), ast_channel_uniqueid(), ast_channel_unlock, ast_channel_unref, ast_manager_event_multichan, AST_OUTGOING_WAIT, ast_pbx_outgoing_app(), ast_pbx_outgoing_exten(), ast_strlen_zero, fast_originate_helper::cap, fast_originate_helper::channelid, fast_originate_helper::cid_name, fast_originate_helper::cid_num, fast_originate_helper::context, fast_originate_helper::data, destroy_fast_originate_helper(), fast_originate_helper::early_media, EVENT_FLAG_CALL, fast_originate_helper::exten, fast_originate_helper::idtext, in, NULL, fast_originate_helper::otherchannelid, fast_originate_helper::priority, S_OR, fast_originate_helper::tech, fast_originate_helper::timeout, ast_assigned_ids::uniqueid, and fast_originate_helper::vars.
Referenced by action_originate().
|
static |
Checks to see if a string which can be used to evaluate functions should be rejected.
Definition at line 2046 of file manager.c.
References EVENT_FLAG_SYSTEM.
Referenced by action_getvar(), and action_status().
|
static |
Definition at line 4662 of file manager.c.
References ao2_cleanup, ast_channel_appl(), ast_channel_callgroup(), ast_channel_connected_effective_id(), ast_channel_creationtime(), ast_channel_data(), ast_channel_dialed(), ast_channel_get_bridge(), ast_channel_nativeformats(), ast_channel_pickupgroup(), ast_channel_readformat(), ast_channel_readtrans(), ast_channel_snapshot_get_latest(), ast_channel_tech(), ast_channel_uniqueid(), ast_channel_varshead(), ast_channel_whentohangup(), ast_channel_writeformat(), ast_channel_writetrans(), ast_format_cap_get_names(), AST_FORMAT_CAP_NAMES_LEN, ast_format_get_name(), ast_free, ast_func_read(), AST_LIST_TRAVERSE, ast_manager_build_channel_state_string(), ast_str_alloca, ast_str_append(), ast_str_buffer(), ast_str_create, ast_translate_path_to_str(), ast_tvdiff_sec(), ast_tvnow(), ast_var_name(), ast_var_value(), astman_append(), ast_party_id::name, NULL, ast_party_id::number, pbx_retrieve_variable(), RAII_VAR, S_COR, S_OR, ast_party_name::str, ast_party_number::str, type, ast_bridge::uniqueid, ast_party_name::valid, and ast_party_number::valid.
Referenced by action_status().
|
static |
Read one full line (including crlf) from the manager socket.
* \r\n is the only valid terminator for the line. * (Note that, later, '\0' will be considered as the end-of-line marker, * so everything between the '\0' and the '\r\n' will not be used). * Also note that we assume output to have at least "maxlen" space. *
Definition at line 6735 of file manager.c.
References mansession_session::addr, ao2_lock, ao2_unlock, ast_iostream_get_fd(), ast_iostream_read(), ast_log, ast_mutex_lock, ast_mutex_unlock, AST_PTHREADT_NULL, ast_sockaddr_stringify_addr(), ast_wait_for_input(), mansession_session::authenticated, mansession_session::authstart, authtimeout, errno, mansession_session::inbuf, mansession_session::inlen, LOG_ERROR, LOG_WARNING, MESSAGE_LINE_TOO_LONG, mansession_session::notify_lock, mansession::parsing, mansession_session::pending_event, mansession::session, mansession_session::stream, and mansession_session::waiting_thread.
Referenced by do_message().
|
static |
lookup an entry in the list of registered users. must be called with the list lock held.
Definition at line 2305 of file manager.c.
References AST_RWLIST_TRAVERSE, NULL, user, and ast_manager_user::username.
Referenced by __init_manager(), auth_http_callback(), authenticate(), function_amiclient(), handle_showmanager(), manager_displayconnects(), and process_message().
|
static |
Definition at line 2131 of file manager.c.
References ARRAY_LEN, ast_instring(), permalias::num, and perms.
Referenced by __init_manager(), and strings_to_mask().
|
static |
Grab a reference to the last event, update usecount as needed. Can handle a NULL pointer.
Definition at line 1963 of file manager.c.
References ast_atomic_fetchadd_int(), AST_RWLIST_LAST, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, and eventqent::usecount.
Referenced by auth_http_callback(), generic_http_callback(), and session_do().
|
static |
CLI command manager reload.
Definition at line 2734 of file manager.c.
References ast_cli_args::argc, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, NULL, reload_module(), and ast_cli_entry::usage.
|
static |
Definition at line 2472 of file manager.c.
References ast_cli_args::argc, ast_cli_args::argv, ast_cli(), CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, ast_cli_args::fd, manager_debug, NULL, and ast_cli_entry::usage.
|
static |
Definition at line 6835 of file manager.c.
References astman_send_error(), mansession_lock(), mansession_unlock(), MESSAGE_OKAY, and mansession::parsing.
Referenced by do_message().
|
static |
Definition at line 2497 of file manager.c.
References ast_manager_user::acl, ast_manager_user::allowmultiplelogin, ast_cli_args::argc, ast_cli_args::argv, ast_acl_list_is_empty(), ast_acl_output(), ast_cli(), ast_cli_completion_add(), AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, ast_str_alloca, ast_strdup, ast_manager_user::chanvars, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, ast_manager_user::displayconnects, ast_cli_args::fd, get_manager_by_name_locked(), MAX_AUTH_PERM_STRING, ast_variable::name, ast_variable::next, NULL, ast_cli_args::pos, ast_manager_user::readperm, S_OR, ast_manager_user::secret, ast_cli_entry::usage, user_authority_to_str(), ast_manager_user::username, ast_variable::value, ast_cli_args::word, and ast_manager_user::writeperm.
|
static |
Definition at line 2570 of file manager.c.
References ast_cli_args::argc, ast_cli(), AST_RWLIST_EMPTY, AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, ast_cli_args::fd, NULL, ast_cli_entry::usage, and ast_manager_user::username.
|
static |
Definition at line 2340 of file manager.c.
References manager_action::action, ast_cli_args::argc, manager_action::arguments, ast_cli_args::argv, ast_cli(), ast_cli_completion_add(), ast_free, AST_LIST_NEXT, AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, ast_str_alloca, ast_strdup, AST_XML_DOC, ast_xmldoc_printable(), manager_action::authority, authority_to_str(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, COLOR_MAGENTA, ast_cli_entry::command, manager_action::description, manager_action::docsrc, ast_cli_args::fd, manager_action::final_response, manager_action::list_responses, MAX_AUTH_PERM_STRING, ast_xml_doc_item::name, ast_xml_doc_item::next, NULL, print_event_instance(), S_OR, manager_action::seealso, synopsis, manager_action::synopsis, manager_action::syntax, term_color(), ast_cli_entry::usage, and ast_cli_args::word.
|
static |
CLI command manager list commands.
Definition at line 2613 of file manager.c.
References manager_action::action, ast_cli(), AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, CLI_GENERATE, CLI_INIT, CLI_SUCCESS, ast_cli_entry::command, ast_cli_args::fd, HSMC_FORMAT, MGR_SHOW_TERMINAL_WIDTH, NULL, manager_action::synopsis, and ast_cli_entry::usage.
|
static |
CLI command manager list connected.
Definition at line 2655 of file manager.c.
References mansession_session::addr, ao2_global_obj_ref, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_lock, ao2_ref, ao2_unlock, ast_cli(), ast_iostream_get_fd(), ast_sockaddr_stringify_addr(), CLI_GENERATE, CLI_INIT, CLI_SUCCESS, ast_cli_entry::command, ast_cli_args::fd, HSMCONN_FORMAT1, HSMCONN_FORMAT2, mansession_session::inuse, NULL, mansession_session::readperm, session, sessions, mansession_session::sessionstart, mansession_session::stream, unref_mansession(), ast_cli_entry::usage, mansession_session::username, and mansession_session::writeperm.
|
static |
CLI command manager list eventq.
Definition at line 2706 of file manager.c.
References ast_cli(), AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, eventqent::category, CLI_GENERATE, CLI_INIT, CLI_SUCCESS, ast_cli_entry::command, ast_cli_args::fd, NULL, reload_module(), ast_cli_entry::usage, and eventqent::usecount.
|
static |
helper function for action_updateconfig
Definition at line 3819 of file manager.c.
References ast_begins_with(), ast_category_append(), ast_category_browse_filtered(), ast_category_delete(), ast_category_destroy(), ast_category_empty(), ast_category_get(), ast_category_inherit(), ast_category_insert(), ast_category_new(), ast_category_new_template(), ast_category_rename(), ast_free, ast_log, ast_str_create, ast_strdup, ast_strlen_zero, ast_strsep(), AST_STRSEP_STRIP, ast_variable_append(), ast_variable_delete(), ast_variable_insert(), ast_variable_new, ast_variable_update(), astman_get_header(), c, eventqent::category, copy(), FAILURE_ALLOCATION, FAILURE_NEWCAT, FAILURE_TEMPLATE, FAILURE_UPDATE, LOG_WARNING, match(), NULL, ast_variable::object, options, RAII_VAR, result, UNKNOWN_ACTION, UNKNOWN_CATEGORY, UNSPECIFIED_ARGUMENT, UNSPECIFIED_CATEGORY, value, and var.
Referenced by action_updateconfig().
|
static |
The amount of space in out must be at least ( 2 * strlen(in) + 1 )
Definition at line 3721 of file manager.c.
References in.
Referenced by astman_append_json().
|
static |
Definition at line 6568 of file manager.c.
References ast_free, ast_str_append(), ast_str_buffer(), ast_str_create, ast_verbose(), buf, message::hdrcount, message::headers, and manager_debug.
Referenced by process_message().
|
static |
Definition at line 2862 of file manager.c.
References args, AST_APP_ARG, AST_DECLARE_APP_ARGS, ast_skip_blanks(), AST_STANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero, ast_variable_new, ast_variable::next, parse(), strsep(), and var.
Referenced by astman_get_variables_order().
|
static |
Add an event filter to a manager session.
filter_pattern | Filter syntax to add, see below for syntax |
Filter will be used to match against each line of a manager event Filter can be any valid regular expression Filter can be a valid regular expression prefixed with !, which will add the filter as a black filter
Examples:
Definition at line 6162 of file manager.c.
References ao2_ref, ao2_t_alloc, ao2_t_link, ao2_t_ref, event_filter_destructor(), FILTER_ALLOC_FAILED, FILTER_COMPILE_FAIL, and FILTER_SUCCESS.
Referenced by __init_manager(), and action_filter().
|
static |
Definition at line 1838 of file manager.c.
References any_manager_listeners, ao2_cleanup, ao2_global_obj_ref, ao2_ref, ast_manager_event_blob::event_flags, ast_manager_event_blob::extra_fields, ast_manager_event_blob::manager_event, manager_event_sessions, sessions, stasis_message_can_be_ami(), and stasis_message_to_ami().
Referenced by manager_subscriptions_init().
|
static |
Get displayconnects config option.
session | manager session to get parameter from. |
Definition at line 2322 of file manager.c.
References a, AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, ast_manager_user::displayconnects, get_manager_by_name_locked(), NULL, print_event_instance(), and mansession_session::username.
Referenced by action_login(), generic_http_callback(), purge_sessions(), and session_do().
|
static |
Definition at line 1869 of file manager.c.
References any_manager_listeners, ao2_cleanup, ao2_global_obj_ref, ast_free, ast_json_integer_get(), ast_json_object_get(), ast_json_string_get(), ast_log, AST_LOG_WARNING, ast_manager_str_from_json_object(), ast_str_buffer(), ast_json_payload::json, manager_event_sessions, NULL, sessions, stasis_message_data(), and type.
Referenced by manager_subscriptions_init().
|
static |
Definition at line 1755 of file manager.c.
References ast_str_alloca, ast_str_buffer(), ast_str_set(), and manager_json_to_ast_str().
Referenced by manager_json_to_ast_str().
|
static |
Definition at line 1765 of file manager.c.
References ast_str_alloca, ast_str_buffer(), ast_str_set(), and manager_json_to_ast_str().
Referenced by manager_json_to_ast_str().
|
static |
Definition at line 1780 of file manager.c.
References AST_JSON_ARRAY, ast_json_array_get(), ast_json_array_size(), AST_JSON_OBJECT, ast_json_object_iter(), ast_json_object_iter_key(), ast_json_object_iter_next(), ast_json_object_iter_value(), ast_json_typeof(), ast_str_create, manager_json_array_with_key(), manager_json_obj_with_key(), and manager_json_value_str_append().
Referenced by ast_manager_str_from_json_object(), manager_json_array_with_key(), manager_json_obj_with_key(), and manager_json_value_str_append().
|
static |
Definition at line 1730 of file manager.c.
References AST_JSON_FALSE, AST_JSON_INTEGER, ast_json_integer_get(), AST_JSON_STRING, ast_json_string_get(), AST_JSON_TRUE, ast_json_typeof(), ast_str_append(), and manager_json_to_ast_str().
Referenced by manager_json_to_ast_str().
|
static |
Manager function to check if module is loaded.
Definition at line 6470 of file manager.c.
References ast_copy_string(), ast_debug, ast_module_check(), ast_strlen_zero, astman_append(), astman_get_header(), astman_send_error(), and PATH_MAX.
Referenced by __init_manager().
|
static |
Definition at line 6505 of file manager.c.
References AST_FORCE_SOFT, ast_load_resource(), ast_module_reload(), AST_MODULE_RELOAD_ERROR, AST_MODULE_RELOAD_IN_PROGRESS, AST_MODULE_RELOAD_NOT_FOUND, AST_MODULE_RELOAD_NOT_IMPLEMENTED, AST_MODULE_RELOAD_QUEUED, AST_MODULE_RELOAD_SUCCESS, AST_MODULE_RELOAD_UNINITIALIZED, ast_strlen_zero, ast_unload_resource(), astman_get_header(), astman_send_ack(), astman_send_error(), and NULL.
Referenced by __init_manager().
|
static |
Definition at line 7288 of file manager.c.
References ast_extension_state2str(), ast_get_hint(), AST_HINT_UPDATE_DEVICE, AST_HINT_UPDATE_PRESENCE, ast_presence_state2str(), EVENT_FLAG_CALL, ast_state_cb_info::exten_state, manager_event, NULL, ast_state_cb_info::presence_message, ast_state_cb_info::presence_state, ast_state_cb_info::presence_subtype, and ast_state_cb_info::reason.
Referenced by __init_manager().
|
static |
Definition at line 2262 of file manager.c.
References CMP_MATCH, str, and mansession_session::username.
Referenced by __init_manager().
|
static |
Definition at line 3279 of file manager.c.
References AST_TRANSPORT_TCP, AST_TRANSPORT_TLS, ast_tcptls_session_instance::parent, mansession::tcptls_session, and ast_tcptls_session_args::tls_cfg.
Referenced by report_auth_success(), report_failed_acl(), report_failed_challenge_response(), report_inval_password(), report_invalid_user(), report_req_bad_format(), report_req_not_allowed(), and report_session_limit().
|
static |
Lock the 'mansession' structure.
Definition at line 3251 of file manager.c.
References ast_mutex_lock, and mansession::lock.
Referenced by action_challenge(), do_message(), handle_parse_error(), and process_message().
|
static |
Unlock the 'mansession' structure.
Definition at line 3257 of file manager.c.
References ast_mutex_unlock, and mansession::lock.
Referenced by action_challenge(), do_message(), handle_parse_error(), and process_message().
|
static |
Definition at line 6193 of file manager.c.
References ao2_container_count(), ao2_t_callback_data, ast_debug, ast_verbose(), blackfilter_cmp_fn(), mansession_session::blackfilters, manager_debug, OBJ_NODATA, result, mansession::session, whitefilter_cmp_fn(), and mansession_session::whitefilters.
Referenced by action_waitevent(), and process_events().
|
static |
Definition at line 8793 of file manager.c.
References ast_xml_doc_item::arguments, ast_cli(), ast_free, ast_str_buffer(), ast_strlen_zero, ast_xmldoc_printable(), COLOR_MAGENTA, ast_xml_doc_item::description, ast_cli_args::fd, ast_xml_doc_item::seealso, synopsis, ast_xml_doc_item::synopsis, ast_xml_doc_item::syntax, and term_color().
Referenced by handle_manager_show_event(), handle_showmancmd(), and manager_displayconnects().
|
static |
Send any applicable events to the client listening on this socket. Wait only for a finite time on each event, and drop all events whether they are successfully sent or not.
Definition at line 6227 of file manager.c.
References advance_event(), ao2_lock, ao2_unlock, ast_debug, mansession_session::authenticated, eventqent::category, EVENT_FLAG_SHUTDOWN, mansession_session::last_ev, match_filter(), NULL, mansession_session::readperm, mansession_session::send_events, send_string(), mansession::session, and mansession_session::stream.
Referenced by do_message(), and process_message().
|
static |
Process an AMI message, performing desired action. Return 0 on success, -1 on error that require the session to be destroyed.
Definition at line 6607 of file manager.c.
References __astman_get_header(), manager_action::action, action_find(), ast_manager_user::allowmultiplelogin, ao2_lock, ao2_t_ref, ao2_unlock, ast_debug, ast_log, ast_module_running_ref, ast_module_unref, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_shutting_down(), ast_strlen_zero, astman_get_header(), astman_send_error(), mansession_session::authenticated, manager_action::authority, buf, check_manager_session_inuse(), manager_action::func, GET_HEADER_SKIP_EMPTY, get_manager_by_name_locked(), log_action(), LOG_ERROR, mansession_lock(), mansession_unlock(), manager_action::module, NULL, process_events(), manager_action::registered, report_req_bad_format(), report_req_not_allowed(), report_session_limit(), mansession::session, and mansession_session::writeperm.
Referenced by auth_http_callback(), do_message(), and generic_http_callback().
|
static |
Purge unused events. Remove elements from the head as long as their usecount is 0 and there is a next element.
Definition at line 1983 of file manager.c.
References ast_free, AST_RWLIST_FIRST, AST_RWLIST_NEXT, AST_RWLIST_REMOVE_CURRENT, AST_RWLIST_REMOVE_HEAD, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_tvdiff_sec(), ast_tvnow(), httptimeout, eventqent::tv, and eventqent::usecount.
Referenced by purge_old_stuff().
|
static |
remove at most n_max stale session from the list.
Definition at line 7031 of file manager.c.
References mansession_session::addr, ao2_global_obj_ref, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_lock, ao2_ref, ao2_unlock, ast_sockaddr_stringify_addr(), ast_verb, mansession_session::authenticated, mansession_session::inuse, manager_displayconnects(), NULL, session, session_destroy(), sessions, mansession_session::sessiontimeout, unref_mansession(), mansession_session::username, and VERBOSITY_ATLEAST.
Referenced by purge_old_stuff().
|
static |
Queue a given read action containing a payload onto a channel.
This queues a READ_ACTION control frame that contains a given "payload", or data to be triggered and handled on the channel's read side. This ensures the "action" is handled by the channel's media reading thread.
chan | The channel to queue the action on |
payload | The read action's payload |
payload_size | The size of the given payload |
action | The type of read action to queue |
Definition at line 4864 of file manager.c.
References AST_CONTROL_READ_ACTION, ast_free, ast_malloc, and ast_queue_control_data().
Referenced by queue_sendtext(), and queue_sendtext_data().
|
static |
Queue a read action to send a text message.
chan | The channel to queue the action on |
body | The body of the message |
Definition at line 4896 of file manager.c.
References AST_FRAME_READ_ACTION_SEND_TEXT, and queue_read_action_payload().
Referenced by action_sendtext().
|
static |
Queue a read action to send a text data message.
chan | The channel to queue the action on |
body | The body of the message |
content_type | The message's content type |
Definition at line 4911 of file manager.c.
References AST_FRAME_READ_ACTION_SEND_TEXT_DATA, ast_free, ast_msg_data_alloc2(), ast_msg_data_get_length(), AST_MSG_DATA_SOURCE_TYPE_UNKNOWN, NULL, and queue_read_action_payload().
Referenced by action_sendtext().
|
static |
Definition at line 9661 of file manager.c.
References __init_manager().
Referenced by handle_manager_reload(), and handle_showmaneventq().
|
static |
Definition at line 3360 of file manager.c.
References mansession_session::addr, AST_SEC_EVT, ast_security_event_report(), AST_SECURITY_EVENT_SUCCESSFUL_AUTH, AST_SECURITY_EVENT_SUCCESSFUL_AUTH_VERSION, ast_security_event_successful_auth::common, ast_security_event_common::event_type, ast_tcptls_session_args::local_address, mansession_get_transport(), ast_tcptls_session_instance::parent, mansession::session, mansession_session::sessionstart_tv, mansession::tcptls_session, and mansession_session::username.
Referenced by authenticate().
|
static |
Definition at line 3310 of file manager.c.
References mansession_session::addr, AST_SEC_EVT, AST_SECURITY_EVENT_FAILED_ACL, AST_SECURITY_EVENT_FAILED_ACL_VERSION, ast_security_event_report(), ast_security_event_failed_acl::common, ast_security_event_common::event_type, ast_tcptls_session_args::local_address, mansession_get_transport(), ast_tcptls_session_instance::parent, mansession::session, mansession_session::sessionstart_tv, and mansession::tcptls_session.
Referenced by authenticate().
|
static |
Definition at line 3443 of file manager.c.
References mansession_session::addr, AST_SEC_EVT, AST_SECURITY_EVENT_CHAL_RESP_FAILED, AST_SECURITY_EVENT_CHAL_RESP_FAILED_VERSION, ast_security_event_report(), mansession_session::challenge, ast_security_event_chal_resp_failed::common, ast_security_event_common::event_type, ast_security_event_chal_resp_failed::expected_response, ast_tcptls_session_args::local_address, mansession_get_transport(), ast_tcptls_session_instance::parent, ast_security_event_chal_resp_failed::response, mansession::session, mansession_session::sessionstart_tv, mansession::tcptls_session, and mansession_session::username.
Referenced by authenticate().
|
static |
Definition at line 3335 of file manager.c.
References mansession_session::addr, AST_SEC_EVT, AST_SECURITY_EVENT_INVAL_PASSWORD, AST_SECURITY_EVENT_INVAL_PASSWORD_VERSION, ast_security_event_report(), ast_security_event_inval_password::common, ast_security_event_common::event_type, ast_tcptls_session_args::local_address, mansession_get_transport(), ast_tcptls_session_instance::parent, mansession::session, mansession_session::sessionstart_tv, and mansession::tcptls_session.
Referenced by authenticate().
|
static |
Definition at line 3285 of file manager.c.
References mansession_session::addr, AST_SEC_EVT, AST_SECURITY_EVENT_INVAL_ACCT_ID, AST_SECURITY_EVENT_INVAL_ACCT_ID_VERSION, ast_security_event_report(), ast_security_event_inval_acct_id::common, ast_security_event_common::event_type, ast_tcptls_session_args::local_address, mansession_get_transport(), ast_tcptls_session_instance::parent, mansession::session, mansession_session::sessionstart_tv, and mansession::tcptls_session.
Referenced by authenticate().
|
static |
Definition at line 3414 of file manager.c.
References mansession_session::addr, AST_SEC_EVT, ast_security_event_report(), AST_SECURITY_EVENT_REQ_BAD_FORMAT, AST_SECURITY_EVENT_REQ_BAD_FORMAT_VERSION, ast_security_event_req_bad_format::common, ast_security_event_common::event_type, ast_tcptls_session_args::local_address, mansession_get_transport(), ast_tcptls_session_instance::parent, ast_security_event_req_not_allowed::request_type, ast_security_event_req_bad_format::request_type, mansession::session, mansession_session::sessionstart_tv, mansession::tcptls_session, and mansession_session::username.
Referenced by process_message().
|
static |
Definition at line 3385 of file manager.c.
References mansession_session::addr, AST_SEC_EVT, ast_security_event_report(), AST_SECURITY_EVENT_REQ_NOT_ALLOWED, AST_SECURITY_EVENT_REQ_NOT_ALLOWED_VERSION, ast_security_event_req_not_allowed::common, ast_security_event_common::event_type, ast_tcptls_session_args::local_address, mansession_get_transport(), ast_tcptls_session_instance::parent, ast_security_event_req_not_allowed::request_type, mansession::session, mansession_session::sessionstart_tv, mansession::tcptls_session, and mansession_session::username.
Referenced by process_message().
|
static |
Definition at line 3473 of file manager.c.
References mansession_session::addr, AST_SEC_EVT, ast_security_event_report(), AST_SECURITY_EVENT_SESSION_LIMIT, AST_SECURITY_EVENT_SESSION_LIMIT_VERSION, ast_security_event_session_limit::common, ast_security_event_common::event_type, ast_tcptls_session_args::local_address, mansession_get_transport(), ast_tcptls_session_instance::parent, mansession::session, mansession_session::sessionstart_tv, mansession::tcptls_session, and mansession_session::username.
Referenced by process_message().
|
static |
helper function to send a string to the socket. Return -1 on error (e.g. buffer full).
Definition at line 3025 of file manager.c.
References ast_iostream_set_timeout_disable(), ast_iostream_set_timeout_inactivity(), ast_iostream_write(), EVENT_FLAG_HOOKRESPONSE, manager_custom_hook::helper, mansession::hook, len(), mansession::session, mansession_session::stream, mansession::stream, mansession::write_error, and mansession_session::writetimeout.
Referenced by astman_append(), astman_flush(), and process_events().
|
static |
Definition at line 2269 of file manager.c.
References ao2_global_obj_ref, ao2_ref, ao2_unlink, sessions, and unref_mansession().
Referenced by auth_http_callback(), generic_http_callback(), purge_sessions(), and session_do().
|
static |
Definition at line 2198 of file manager.c.
References ao2_t_ref, ast_atomic_fetchadd_int(), ast_datastore_free(), AST_LIST_REMOVE_HEAD, ast_mutex_destroy, ast_variables_destroy(), mansession_session::blackfilters, mansession_session::chanvars, mansession_session::datastores, mansession_session::last_ev, mansession_session::notify_lock, session, eventqent::usecount, and mansession_session::whitefilters.
Referenced by build_mansession().
|
static |
The body of the individual manager session. Call get_input() to read one line at a time (or be woken up on new events), collect the lines in a message until found an empty line, and execute the request. In any case, deliver events asynchronously through process_events() (called from here if no line is available, or at the end of process_message(). )
Definition at line 6937 of file manager.c.
References mansession_session::addr, AMI_VERSION, ao2_lock, ao2_ref, ao2_unlock, ast_atomic_fetchadd_int(), ast_iostream_get_fd(), ast_iostream_nonblock(), ast_iostream_set_exclusive_input(), ast_iostream_set_timeout_disable(), ast_iostream_set_timeout_sequence(), AST_LIST_HEAD_INIT_NOLOCK, ast_log, ast_mutex_destroy, ast_mutex_init, ast_sockaddr_copy(), ast_sockaddr_stringify_addr(), ast_tvnow(), ast_verb, astman_append(), mansession_session::authenticated, authlimit, mansession_session::authstart, authtimeout, build_mansession(), mansession_session::datastores, displayconnects, do_message(), done, errno, grab_last(), mansession_session::last_ev, mansession::lock, LOG_ERROR, LOG_WARNING, manager_displayconnects(), NULL, ast_tcptls_session_instance::remote_address, session, mansession::session, session_destroy(), ast_tcptls_session_instance::stream, mansession_session::stream, mansession::stream, mansession::tcptls_session, unauth_sessions, mansession_session::username, and mansession::write_error.
|
static |
Rather than braindead on,off this now can also accept a specific int mask value or a ',' delim list of mask strings (the same as manager.conf) -anthm.
Definition at line 3266 of file manager.c.
References ao2_lock, ao2_unlock, mansession_session::send_events, mansession::session, and strings_to_mask().
Referenced by action_events(), and authenticate().
STASIS_MESSAGE_TYPE_DEFN | ( | ast_manager_get_generic_type | ) |
Define AMI message types.
|
static |
A number returns itself, false returns 0, true returns all flags, other strings return the flags that are set.
Definition at line 2152 of file manager.c.
References ARRAY_LEN, ast_false(), ast_strlen_zero, ast_true(), get_perm(), permalias::num, and perms.
Referenced by set_eventmask().
|
static |
Unreference manager session object. If no more references, then go ahead and delete it.
Definition at line 2183 of file manager.c.
References ao2_ref, ast_debug, manager_debug, and NULL.
Referenced by __manager_event_sessions_va(), astman_is_authed(), astman_verify_session_readpermissions(), astman_verify_session_writepermissions(), check_manager_session_inuse(), find_session(), find_session_by_nonce(), generic_http_callback(), handle_showmanconn(), purge_sessions(), and session_destroy().
|
static |
Convert authority code to a list of options for a user. This will only display those authority codes that have an explicit match on authority.
Definition at line 2060 of file manager.c.
References ARRAY_LEN, ast_str_append(), ast_str_buffer(), ast_str_reset(), ast_str_strlen(), permalias::num, and perms.
Referenced by handle_showmanager().
|
static |
Definition at line 6078 of file manager.c.
References CMP_MATCH, CMP_STOP, NULL, and result.
Referenced by match_filter().
|
static |
|
static |
|
static |
|
static |
Definition at line 1471 of file manager.c.
Referenced by __init_manager(), and handle_manager_show_settings().
|
static |
Definition at line 3061 of file manager.c.
Referenced by astman_append(), astman_send_error_va(), astman_send_list_complete_start_common(), and astman_send_response_full().
|
static |
Definition at line 1480 of file manager.c.
Referenced by __init_manager(), manager_set_defaults(), and session_do().
|
static |
Definition at line 1479 of file manager.c.
Referenced by __init_manager(), do_message(), get_input(), manager_set_defaults(), and session_do().
|
static |
Definition at line 1474 of file manager.c.
Referenced by __init_manager(), action_events(), and manager_set_defaults().
const { ... } command_blacklist[] |
Referenced by check_blacklist().
|
static |
Definition at line 1470 of file manager.c.
Referenced by __init_manager(), do_message(), generic_http_callback(), handle_manager_show_settings(), manager_set_defaults(), and session_do().
|
static |
Default realm
Definition at line 1484 of file manager.c.
Referenced by __init_manager(), auth_http_callback(), and manager_set_defaults().
|
static |
Definition at line 1473 of file manager.c.
Referenced by __init_manager(), auth_http_callback(), generic_http_callback(), handle_manager_show_settings(), and purge_events().
|
static |
Definition at line 1481 of file manager.c.
Referenced by handle_manager_show_settings(), load_channelvars(), and manager_shutdown().
|
static |
enable some debugging code in the manager
Definition at line 1478 of file manager.c.
Referenced by __init_manager(), __manager_event_sessions_va(), handle_manager_show_settings(), handle_mandebug(), log_action(), manager_set_defaults(), match_filter(), and unref_mansession().
|
static |
Definition at line 1475 of file manager.c.
Referenced by __init_manager(), ast_manager_check_enabled(), ast_webmanager_check_enabled(), handle_manager_show_settings(), and manager_set_defaults().
|
static |
Definition at line 7109 of file manager.c.
Referenced by __manager_event_sessions_va().
|
static |
|
static |
A stasis_topic that all topics AMI cares about will be forwarded to.
Definition at line 1490 of file manager.c.
Referenced by ast_manager_get_topic(), load_module(), manager_bridging_init(), manager_channels_init(), manager_mwi_init(), and manager_system_init().
|
static |
Referenced by action_events(), authority_to_str(), get_perm(), strings_to_mask(), and user_authority_to_str().
|
static |
The stasis_subscription for forwarding the RTP topic to the AMI topic.
|
static |
The stasis_subscription for forwarding the Security topic to the AMI topic.
|
static |
The stasis_message_router for all Stasis Message Bus API messages.
Definition at line 1493 of file manager.c.
Referenced by ast_manager_get_message_router().
|
static |
Definition at line 1476 of file manager.c.
Referenced by __init_manager(), bridge_app_subscribed_involved(), bridge_attended_transfer_handler(), handle_request_subscribe(), and subscribe_all().
|
static |
The stasis_subscription for forwarding the Test topic to the AMI topic.
|
static |
Definition at line 1472 of file manager.c.
Referenced by __init_manager(), __manager_event_sessions_va(), and handle_manager_show_settings().
|
static |
Definition at line 1486 of file manager.c.
Referenced by action_login(), and session_do().
|
static |
Definition at line 3063 of file manager.c.
Referenced by action_userevent().
|
static |
|
static |
Definition at line 1477 of file manager.c.
Referenced by __init_manager(), ast_webmanager_check_enabled(), and handle_manager_show_settings().
const char* words[AST_MAX_CMD_LEN] |