Asterisk - The Open Source Telephony Project GIT-master-7e7a603
|
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 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) |
Enumerations | |
enum | add_filter_result { FILTER_SUCCESS , FILTER_ALLOC_FAILED , FILTER_COMPILE_FAIL } |
enum | error_type { UNKNOWN_ACTION = 1 , UNKNOWN_CATEGORY , UNSPECIFIED_CATEGORY , UNSPECIFIED_ARGUMENT , FAILURE_ALLOCATION , FAILURE_NEWCAT , FAILURE_DELCAT , FAILURE_EMPTYCAT , FAILURE_UPDATE , FAILURE_DELETE , FAILURE_APPEND , FAILURE_TEMPLATE } |
enum | mansession_message_parsing { MESSAGE_OKAY , MESSAGE_LINE_TOO_LONG } |
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 struct ast_aoc_decoded * | action_aoc_de_message (struct mansession *s, const struct message *m) |
static struct ast_aoc_decoded * | action_aoc_s_message (struct mansession *s, const struct message *m) |
static int | action_aoc_s_submessage (struct mansession *s, const struct message *m, struct ast_aoc_decoded *decoded) |
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_coreshowchannelmap (struct mansession *s, const struct message *m) |
Manager command "CoreShowChannelMap" - Lists all channels connected to the specified channel. 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 (event_docs) |
A container of event documentation nodes. More... | |
static | AO2_GLOBAL_OBJ_STATIC (mgr_sessions) |
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... | |
int | ast_manager_hangup_helper (struct mansession *s, const struct message *m, manager_hangup_handler_t hangup_handler, manager_hangup_cause_validator_t cause_validator) |
A manager helper function that hangs up a channel using a supplied channel type specific hangup function and cause code validator. 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_live_dangerously (int new_live_dangerously) |
Enable/disable the inclusion of 'dangerous' configurations outside of the ast_config_AST_CONFIG_DIR. 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 int | coreshowchannelmap_add_connected_channels (struct ao2_container *channel_map, struct ast_channel_snapshot *channel_snapshot, struct ast_bridge_snapshot *bridge_snapshot) |
Recursive function to get all channels in a bridge. Follow local channels as well. More... | |
static int | coreshowchannelmap_add_to_map (struct ao2_container *c, const char *s) |
Helper function to add a channel name to the vector. More... | |
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_kickmanconn (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
CLI command manager kick session. More... | |
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 int | 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 | restrictedFile (const char *filename) |
Check if a file is restricted or not. More... | |
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 int | live_dangerously |
Set to true (non-zero) to globally allow all dangerous AMI actions to run. More... | |
static char * | manager_channelvars |
static int | manager_debug = 0 |
static char * | manager_disabledevents |
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 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)) |
#define ASTMAN_APPEND_BUF_INITSIZE 256 |
#define EVENT_FLAG_SHUTDOWN -1 |
#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.
#define MSG_MOREDATA ((char *)astman_send_response) |
enum add_filter_result |
Enumerator | |
---|---|
FILTER_SUCCESS | |
FILTER_ALLOC_FAILED | |
FILTER_COMPILE_FAIL |
enum error_type |
Doxygen group
Definition at line 1564 of file manager.c.
Enumerator | |
---|---|
MESSAGE_OKAY | |
MESSAGE_LINE_TOO_LONG |
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 8016 of file manager.c.
References __manager_event_sessions_va(), any_manager_listeners, ao2_cleanup, ao2_global_obj_ref, chancount, make_ari_stubs::file, and sessions.
|
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 3005 of file manager.c.
References ast_skip_blanks(), ast_strlen_zero(), GET_HEADER_LAST_MATCH, GET_HEADER_SKIP_EMPTY, message::hdrcount, message::headers, result, value, and var.
Referenced by action_aoc_s_submessage(), astman_get_header(), and process_message().
|
static |
thread local buffer for astman_append
Definition at line 3283 of file manager.c.
|
static |
|
static |
Definition at line 7994 of file manager.c.
References __manager_event_sessions_va(), chancount, make_ari_stubs::file, and sessions.
|
static |
Definition at line 7887 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_debug, ast_in_delimited_string(), 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, make_ari_stubs::file, manager_custom_hook::helper, manager_debug, manager_disabledevents, manager_event_buf, MANAGER_EVENT_BUF_INITSIZE, MAX_AUTH_PERM_STRING, seq, session, sessions, timestampevents, and unref_mansession().
Referenced by __ast_manager_event_multichan(), and __manager_event_sessions().
|
static |
Definition at line 10458 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 1685 of file manager.c.
References acl_change_stasis_cb(), acl_change_sub, 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 1695 of file manager.c.
References acl_change_sub, and stasis_unsubscribe_and_join().
Referenced by __init_manager(), and manager_shutdown().
|
static |
Definition at line 5823 of file manager.c.
References 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_E, 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_strlen_zero(), astman_get_header(), astman_send_error(), and NULL.
Referenced by action_aocmessage().
|
static |
Definition at line 6218 of file manager.c.
References action_aoc_s_submessage(), ast_aoc_create(), ast_aoc_destroy_decoded(), AST_AOC_S, ast_aoc_s_get_count(), astman_send_error(), message::hdrcount, message::headers, and NULL.
Referenced by action_aocmessage().
|
static |
Definition at line 5994 of file manager.c.
References __astman_get_header(), AST_AOC_CHARGED_ITEM_BASIC_COMMUNICATION, AST_AOC_CHARGED_ITEM_CALL_ATTEMPT, AST_AOC_CHARGED_ITEM_CALL_SETUP, AST_AOC_CHARGED_ITEM_NA, AST_AOC_CHARGED_ITEM_SPECIAL_ARRANGEMENT, AST_AOC_CHARGED_ITEM_SUPPLEMENTARY_SERVICE, AST_AOC_CHARGED_ITEM_USER_USER_INFO, 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_RATE_TYPE_DURATION, AST_AOC_RATE_TYPE_FLAT, AST_AOC_RATE_TYPE_FREE, AST_AOC_RATE_TYPE_FREE_FROM_BEGINNING, AST_AOC_RATE_TYPE_NA, AST_AOC_RATE_TYPE_SPECIAL_CODE, AST_AOC_RATE_TYPE_VOLUME, ast_aoc_s_add_rate_duration(), ast_aoc_s_add_rate_flat(), ast_aoc_s_add_rate_free(), ast_aoc_s_add_rate_na(), ast_aoc_s_add_rate_special_charge_code(), ast_aoc_s_add_rate_volume(), ast_aoc_s_add_special_arrangement(), AST_AOC_TIME_SCALE_DAY, AST_AOC_TIME_SCALE_HOUR, AST_AOC_TIME_SCALE_HUNDREDTH_SECOND, AST_AOC_TIME_SCALE_MINUTE, AST_AOC_TIME_SCALE_SECOND, AST_AOC_TIME_SCALE_TEN_SECOND, AST_AOC_TIME_SCALE_TENTH_SECOND, AST_AOC_VOLUME_UNIT_MESSAGE, AST_AOC_VOLUME_UNIT_OCTET, AST_AOC_VOLUME_UNIT_SEGMENT, ast_strlen_zero(), astman_send_error(), and GET_HEADER_LAST_MATCH.
Referenced by action_aoc_s_message().
|
static |
Definition at line 6261 of file manager.c.
References action_aoc_de_message(), action_aoc_s_message(), ast_aoc_destroy_decoded(), ast_aoc_destroy_encoded(), ast_aoc_encode(), 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(), and NULL.
Referenced by __init_manager().
|
static |
Definition at line 5471 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(), voicemailpwcheck::context, digit, name, NULL, and pbx_builtin_setvar_helper().
Referenced by __init_manager().
|
static |
Definition at line 5425 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(), voicemailpwcheck::context, name, and NULL.
Referenced by __init_manager().
|
static |
Definition at line 5525 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 4736 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 5602 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 6874 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_opt_sounds_search_custom, 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 "CoreShowChannelMap" - Lists all channels connected to the specified channel.
Definition at line 7158 of file manager.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_cleanup, AO2_CONTAINER_ALLOC_OPT_DUPS_OBJ_REJECT, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_bridge_get_snapshot_by_uniqueid(), ast_channel_snapshot_get_latest_by_name(), ast_str_container_alloc_options(), ast_strlen_zero(), astman_append(), astman_get_header(), astman_send_error(), astman_send_list_complete_end(), astman_send_list_complete_start(), astman_send_listack(), coreshowchannelmap_add_connected_channels(), NULL, RAII_VAR, and total.
Referenced by __init_manager().
|
static |
Manager command "CoreShowChannels" - List currently defined channels and some information about them.
Definition at line 6990 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 6918 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 4482 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 8153 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 4637 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 6571 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(), voicemailpwcheck::context, NULL, and status.
Referenced by __init_manager().
|
static |
Manager command to add an event filter to a manager session.
Definition at line 6708 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 1856 of file manager.c.
References manager_action::action, ao2_t_ref, AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, and name.
Referenced by ast_hook_send_action(), and process_message().
|
static |
Definition at line 3896 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(), CONFIG_FLAG_NOCACHE, CONFIG_FLAG_WITHCOMMENTS, CONFIG_STATUS_FILEINVALID, CONFIG_STATUS_FILEMISSING, filter(), ast_variable::name, ast_variable::next, NULL, restrictedFile(), templates, and ast_variable::value.
Referenced by __init_manager().
|
static |
Definition at line 4034 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(), CONFIG_FLAG_NOCACHE, CONFIG_FLAG_WITHCOMMENTS, CONFIG_STATUS_FILEINVALID, filter(), ast_variable::name, ast_variable::next, NULL, restrictedFile(), templates, and ast_variable::value.
Referenced by __init_manager().
|
static |
Definition at line 4914 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 4875 of file manager.c.
References ast_channel_softhangup_withcause_locked(), ast_manager_hangup_helper(), and NULL.
Referenced by __init_manager().
|
static |
Definition at line 3968 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(), CONFIG_FLAG_NOCACHE, CONFIG_FLAG_WITHCOMMENTS, CONFIG_STATUS_FILEINVALID, match(), and NULL.
Referenced by __init_manager().
|
static |
Definition at line 4618 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 7232 of file manager.c.
References ast_logger_rotate(), astman_send_ack(), and astman_send_error().
Referenced by __init_manager().
|
static |
Definition at line 4687 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 4681 of file manager.c.
References astman_send_response().
Referenced by __init_manager().
|
static |
Definition at line 6550 of file manager.c.
References ast_app_inboxcount2(), ast_strlen_zero(), astman_append(), astman_get_header(), astman_send_error(), astman_start_ack(), and voicemailpwcheck::mailbox.
Referenced by __init_manager().
|
static |
Definition at line 6533 of file manager.c.
References ast_app_has_voicemail(), ast_strlen_zero(), astman_append(), astman_get_header(), astman_send_error(), astman_start_ack(), voicemailpwcheck::mailbox, and NULL.
Referenced by __init_manager().
|
static |
Definition at line 6320 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_predial(), 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, codecs, voicemailpwcheck::context, destroy_fast_originate_helper(), fast_originate_helper::early_media, EVENT_FLAG_SYSTEM, 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 3824 of file manager.c.
References ast_strlen_zero(), ast_tvnow(), astman_append(), and astman_get_header().
Referenced by __init_manager().
|
static |
Definition at line 6601 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 5280 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, voicemailpwcheck::context, name, NULL, and priority.
Referenced by __init_manager().
|
static |
Send a reload event.
Definition at line 6958 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 5237 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 4881 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 5081 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, ast_channel::name, NULL, S_OR, mansession::session, and mansession_session::writeperm.
Referenced by __init_manager().
|
static |
Definition at line 6641 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, and name.
Referenced by __init_manager().
|
static |
Definition at line 4391 of file manager.c.
References ast_config_destroy(), ast_config_load2(), ast_config_text_file_save2(), ast_false(), 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, restrictedFile(), result, UNKNOWN_ACTION, UNKNOWN_CATEGORY, UNSPECIFIED_ARGUMENT, and UNSPECIFIED_CATEGORY.
Referenced by __init_manager().
|
static |
Definition at line 6853 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 4500 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, and mansession_session::waiting_thread.
Referenced by __init_manager().
Definition at line 2975 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 |
A container of event documentation nodes.
|
static |
Active manager connection sessions container.
|
static |
Definition at line 5798 of file manager.c.
References ast_str_alloca, ast_str_buffer(), ast_str_set(), ast_strlen_zero(), astman_get_header(), and str.
Referenced by action_aoc_de_message().
|
static |
Definition at line 7867 of file manager.c.
References ao2_ref, ast_channel_get_manager_vars(), ast_channel_name(), AST_LIST_TRAVERSE, ast_str_append(), 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 7843 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(), NULL, seq, str, and tmp().
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 3159 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 2264 of file manager.c.
Referenced by get_perm().
int ast_manager_check_enabled | ( | void | ) |
Check if AMI is enabled.
Definition at line 2101 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.
NULL | on error |
Definition at line 1877 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.
NULL | on error |
Definition at line 1872 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(), pbx_load_users(), publish_load_message_type(), queue_publish_member_blob(), and stasis_app_user_event().
int ast_manager_hangup_helper | ( | struct mansession * | s, |
const struct message * | m, | ||
manager_hangup_handler_t | handler, | ||
manager_hangup_cause_validator_t | cause_validator | ||
) |
A manager helper function that hangs up a channel using a supplied channel type specific hangup function and cause code validator.
This function handles the lookup of channel(s) and the AMI interaction but uses the supplied callbacks to actually perform the hangup. It can be used to implement a custom AMI 'Hangup' action without having to duplicate all the code in the standard Hangup action.
s | Session |
m | Message |
handler | Function that actually performs the hangup |
cause_validator | Function that validates the cause code |
0 | on success. |
non-zero | on error. |
Definition at line 4754 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_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 action_hangup(), and pjsip_action_hangup().
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_generic_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_generic_type message.
Definition at line 2055 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(), stasis_publish(), and type.
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_span_alarm(), publish_span_alarm_clear(), really_quit(), and reset_user_pw().
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 8167 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, NULL, and synopsis.
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 2086 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 8112 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 |
NULL | on error |
Definition at line 1973 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 8041 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 2094 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 2106 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 3302 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(), action_agents(), action_challenge(), action_command(), action_confbridgelist_item(), action_confbridgelistrooms(), action_coresettings(), action_coreshowchannelmap(), action_coreshowchannels(), action_corestatus(), action_dahdishowchannels(), action_dahdishowstatus(), action_devicestatelist(), action_events(), action_extensionstate(), action_extensionstatelist(), action_getconfig(), action_getconfigjson(), action_getvar(), 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_vmbox_info_astman(), append_vmu_info_astman(), ast_cli_netstats(), ast_manager_hangup_helper(), ast_sip_format_contact_ami(), astman_append_json(), astman_send_list_complete_end(), 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_db_tree_get(), 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_stop_mixmonitor(), mwi_mailbox_get(), send_bridge_info_item_cb(), send_bridge_list_item_cb(), send_identify_ami_event(), session_do(), and spandsp_manager_fax_session().
|
static |
Append additional headers into the message structure from params.
Definition at line 3052 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 4025 of file manager.c.
References ast_alloca, astman_append(), buf, json_escape(), and str.
Referenced by action_getconfigjson().
|
static |
Definition at line 3290 of file manager.c.
References ast_str_buffer(), ast_verbose(), buf, 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 3066 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 manager transaction.
Definition at line 3042 of file manager.c.
References __astman_get_header(), GET_HEADER_FIRST_MATCH, and var.
Referenced by action_add_agi_cmd(), action_agent_logoff(), action_agents(), action_aoc_de_message(), 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_coreshowchannelmap(), action_coreshowchannels(), action_corestatus(), action_createconfig(), action_dahdidialoffhook(), action_dahdidndoff(), action_dahdidndon(), action_dahdishowchannels(), action_dahdishowstatus(), action_devicestatelist(), action_events(), action_extensionstate(), action_extensionstatelist(), action_filter(), action_getconfig(), action_getconfigjson(), action_getvar(), 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(), ast_manager_hangup_helper(), astman_send_list_complete_start_common(), astman_send_response_full(), authenticate(), controlplayback_manager(), 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_db_tree_get(), 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_get_mailbox_summary(), 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_notify_endpoint(), manager_notify_uri(), 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_request_withdraw_caller_from_queue(), manager_send_flash(), manager_show_dialplan(), manager_status_voicemail_user(), manager_stop_mixmonitor(), manager_voicemail_forward(), manager_voicemail_move(), manager_voicemail_remove(), 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(), and sorcery_memory_cache_ami_stale_object().
struct ast_variable * astman_get_variables | ( | const struct message * | m | ) |
Get a linked list of the Variable: headers.
Definition at line 3128 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 3133 of file manager.c.
References ast_variables_reverse(), message::hdrcount, message::headers, man_do_variable_value(), NULL, order, and ORDER_NATURAL.
Referenced by action_messagesend(), astman_get_variables(), manager_notify_channel(), manager_notify_endpoint(), and manager_notify_uri().
void astman_live_dangerously | ( | int | new_live_dangerously | ) |
Enable/disable the inclusion of 'dangerous' configurations outside of the ast_config_AST_CONFIG_DIR.
This function can globally enable/disable the loading of configuration files outside of ast_config_AST_CONFIG_DIR.
new_live_dangerously | If true, enable the access of files outside ast_config_AST_CONFIG_DIR from astman. |
Definition at line 3842 of file manager.c.
References ast_log, live_dangerously, LOG_NOTICE, and LOG_WARNING.
Referenced by load_asterisk_conf().
void astman_send_ack | ( | struct mansession * | s, |
const struct message * | m, | ||
char * | msg | ||
) |
Send ack in manager transaction.
Definition at line 3413 of file manager.c.
References astman_send_response_full(), and NULL.
Referenced by 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_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(), ast_manager_hangup_helper(), controlplayback_manager(), 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_get_mailbox_summary(), manager_jabber_send(), manager_list_voicemail_users(), manager_moduleload(), 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_request_withdraw_caller_from_queue(), manager_send_flash(), manager_send_response(), manager_status_voicemail_user(), manager_voicemail_forward(), manager_voicemail_move(), manager_voicemail_refresh(), manager_voicemail_remove(), 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(), and sorcery_memory_cache_ami_stale_object().
void astman_send_error | ( | struct mansession * | s, |
const struct message * | m, | ||
char * | error | ||
) |
Send error in manager transaction.
Definition at line 3381 of file manager.c.
References astman_send_response_full(), error(), and NULL.
Referenced by action_add_agi_cmd(), action_agent_logoff(), action_aoc_de_message(), action_aoc_s_message(), action_aoc_s_submessage(), 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_coreshowchannelmap(), action_createconfig(), action_dahdidialoffhook(), action_dahdidndoff(), action_dahdidndon(), action_dahdirestart(), action_dahdishowstatus(), action_devicestatelist(), action_events(), action_extensionstate(), action_extensionstatelist(), action_filter(), action_getconfig(), action_getconfigjson(), action_getvar(), 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(), ast_manager_hangup_helper(), controlplayback_manager(), do_message(), 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_db_tree_get(), manager_dbdel(), manager_dbdeltree(), manager_dbget(), manager_dbput(), manager_dialplan_extension_add(), manager_dialplan_extension_remove(), manager_fax_session(), manager_get_mailbox_summary(), manager_jabber_send(), manager_mixmonitor(), manager_modulecheck(), manager_moduleload(), manager_mute_mixmonitor(), manager_mutestream(), manager_notify(), 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_request_withdraw_caller_from_queue(), manager_send_flash(), manager_send_response(), manager_show_dialplan(), manager_show_dialplan_helper(), manager_status_voicemail_user(), manager_stop_mixmonitor(), manager_voicemail_forward(), manager_voicemail_move(), manager_voicemail_remove(), 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(), and sorcery_memory_cache_ami_stale_object().
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 3386 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_originate(), action_presencestate(), ami_show_endpoint(), ast_manager_hangup_helper(), ast_sip_create_ami_event(), format_ami_endpoint_transport(), manager_notify_endpoint(), manager_notify_uri(), manager_send_response(), mwi_mailbox_delete(), mwi_mailbox_get(), and mwi_mailbox_update().
|
static |
Definition at line 3450 of file manager.c.
References ast_str_append(), astman_flush(), astman_send_list_complete_start_common(), and buf.
Referenced by action_coreshowchannels(), and ast_manager_hangup_helper().
void astman_send_list_complete_end | ( | struct mansession * | s | ) |
End the list complete event.
s | - AMI session control struct. |
Definition at line 3467 of file manager.c.
References astman_append().
Referenced by action_agents(), action_confbridgelist(), action_confbridgelistrooms(), action_coreshowchannelmap(), action_dahdishowchannels(), action_dahdishowstatus(), 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(), append_vmbox_info_astman(), manager_bridge_info(), manager_bridge_tech_list(), manager_bridges_list(), manager_db_tree_get(), 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_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 3459 of file manager.c.
References astman_flush(), astman_send_list_complete_start_common(), and buf.
Referenced by action_agents(), action_confbridgelist(), action_confbridgelistrooms(), action_coreshowchannelmap(), action_dahdishowchannels(), action_dahdishowstatus(), 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(), append_vmbox_info_astman(), manager_bridge_info(), manager_bridge_tech_list(), manager_bridges_list(), manager_db_tree_get(), 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_status_voicemail_user(), and mwi_mailbox_get().
|
static |
Definition at line 3428 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 3423 of file manager.c.
References astman_send_response_full().
Referenced by action_agents(), action_confbridgelist(), action_confbridgelistrooms(), action_coreshowchannelmap(), action_coreshowchannels(), action_dahdishowchannels(), action_dahdishowstatus(), 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(), append_vmbox_info_astman(), ast_manager_hangup_helper(), manager_bridge_info(), manager_bridge_tech_list(), manager_bridges_list(), manager_db_tree_get(), 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_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 3376 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 3345 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 3418 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 3727 of file manager.c.
References 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, mansession_session::challenge, mansession_session::chanvars, error(), get_manager_by_name_locked(), len(), LOG_NOTICE, md5(), MD5Final(), MD5Init(), MD5Update(), NULL, mansession_session::readperm, report_auth_success(), report_failed_acl(), report_failed_challenge_response(), report_inval_password(), report_invalid_user(), S_OR, mansession::session, mansession_session::sessionstart, mansession_session::sessionstart_tv, set_eventmask(), mansession_session::username, mansession_session::whitefilters, mansession_session::writeperm, and mansession_session::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 2236 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 |
|
static |
Allocate manager session structure and add it to the list of sessions.
Definition at line 2381 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 5566 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 2434 of file manager.c.
References ao2_find, ao2_global_obj_ref, ao2_ref, mansession_session::inuse, name, session, sessions, and unref_mansession().
Referenced by process_message().
|
static |
Recursive function to get all channels in a bridge. Follow local channels as well.
Definition at line 7074 of file manager.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_begins_with(), ast_bridge_get_snapshot_by_uniqueid(), ast_channel_snapshot_get_latest(), ast_channel_snapshot_get_latest_by_name(), ast_copy_string(), ast_debug, ast_ends_with(), ast_channel_snapshot::base, ast_channel_snapshot::bridge, ast_bridge_snapshot::channels, coreshowchannelmap_add_connected_channels(), coreshowchannelmap_add_to_map(), ast_channel_snapshot_bridge::id, ast_channel_snapshot_base::name, and ast_channel_snapshot_base::uniqueid.
Referenced by action_coreshowchannelmap(), and coreshowchannelmap_add_connected_channels().
|
static |
Helper function to add a channel name to the vector.
Definition at line 7057 of file manager.c.
References ast_log, ast_str_container_add(), ast_strdup, c, LOG_ERROR, and str.
Referenced by coreshowchannelmap_add_connected_channels().
|
static |
Definition at line 5710 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 7624 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 2344 of file manager.c.
Referenced by manager_add_filter().
|
static |
Definition at line 5718 of file manager.c.
References 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(), destroy_fast_originate_helper(), EVENT_FLAG_CALL, in, NULL, S_OR, and ast_assigned_ids::uniqueid.
Referenced by action_originate().
|
static |
Checks to see if a string which can be used to evaluate functions should be rejected.
Definition at line 2198 of file manager.c.
References EVENT_FLAG_SYSTEM.
Referenced by action_getvar(), and action_status().
|
static |
Definition at line 4966 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 7503 of file manager.c.
References mansession_session::addr, ao2_lock, ao2_unlock, ast_debug, 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, mansession_session::kicked, 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 2457 of file manager.c.
References AST_RWLIST_TRAVERSE, name, NULL, and user.
Referenced by __init_manager(), auth_http_callback(), authenticate(), function_amiclient(), handle_showmanager(), manager_displayconnects(), and process_message().
|
static |
Definition at line 2283 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 2115 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 kick session.
Definition at line 2807 of file manager.c.
References a, 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_mutex_lock, ast_mutex_unlock, AST_PTHREADT_NULL, CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, NULL, session, sessions, unref_mansession(), and ast_cli_entry::usage.
|
static |
CLI command manager reload.
Definition at line 2956 of file manager.c.
References a, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, NULL, reload_module(), and ast_cli_entry::usage.
|
static |
Definition at line 2624 of file manager.c.
References a, ast_cli(), CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, manager_debug, NULL, and ast_cli_entry::usage.
|
static |
Definition at line 7607 of file manager.c.
References astman_send_error(), error(), mansession_lock(), mansession_unlock(), MESSAGE_OKAY, and mansession::parsing.
Referenced by do_message().
|
static |
Definition at line 2649 of file manager.c.
References a, 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, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, get_manager_by_name_locked(), MAX_AUTH_PERM_STRING, ast_variable::name, ast_variable::next, NULL, S_OR, ast_cli_entry::usage, user_authority_to_str(), and ast_variable::value.
|
static |
Definition at line 2722 of file manager.c.
References a, 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, NULL, and ast_cli_entry::usage.
|
static |
Definition at line 2492 of file manager.c.
References a, manager_action::action, manager_action::arguments, ast_xml_doc_item::arguments, 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, ast_xml_doc_item::description, manager_action::docsrc, 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, ast_xml_doc_item::seealso, synopsis, manager_action::synopsis, manager_action::syntax, ast_xml_doc_item::syntax, term_color(), and ast_cli_entry::usage.
|
static |
CLI command manager list commands.
Definition at line 2765 of file manager.c.
References a, manager_action::action, ast_cli(), AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, CLI_GENERATE, CLI_INIT, CLI_SUCCESS, ast_cli_entry::command, HSMC_FORMAT, MGR_SHOW_TERMINAL_WIDTH, NULL, manager_action::synopsis, and ast_cli_entry::usage.
|
static |
CLI command manager list connected.
Definition at line 2877 of file manager.c.
References a, 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, HSMCONN_FORMAT1, HSMCONN_FORMAT2, NULL, session, sessions, unref_mansession(), and ast_cli_entry::usage.
|
static |
CLI command manager list eventq.
Definition at line 2928 of file manager.c.
References a, ast_cli(), AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, eventqent::category, CLI_GENERATE, CLI_INIT, CLI_SUCCESS, ast_cli_entry::command, NULL, ast_cli_entry::usage, and eventqent::usecount.
|
static |
helper function for action_updateconfig
Definition at line 4108 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, 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 4007 of file manager.c.
Referenced by astman_append_json().
|
static |
Definition at line 7336 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 3084 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, 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 |
whitefilters,blackfilters |
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 6760 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 1990 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 2474 of file manager.c.
References AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, get_manager_by_name_locked(), NULL, and session.
Referenced by action_login(), generic_http_callback(), purge_sessions(), and session_do().
|
static |
Definition at line 2021 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 1907 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 1917 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 1932 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(), and manager_json_obj_with_key().
|
static |
Definition at line 1882 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 value.
Referenced by manager_json_to_ast_str().
|
static |
Manager function to check if module is loaded.
Definition at line 7244 of file manager.c.
References ast_debug, ast_module_check(), ast_strlen_zero(), astman_append(), astman_get_header(), and astman_send_error().
Referenced by __init_manager().
|
static |
Definition at line 7273 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 8071 of file manager.c.
References ast_extension_state2str(), ast_get_hint(), AST_HINT_UPDATE_DEVICE, AST_HINT_UPDATE_PRESENCE, ast_presence_state2str(), voicemailpwcheck::context, EVENT_FLAG_CALL, sip_to_pjsip::info(), manager_event, and NULL.
Referenced by __init_manager().
|
static |
Definition at line 2414 of file manager.c.
References CMP_MATCH, str, and mansession_session::username.
Referenced by __init_manager().
|
static |
Definition at line 3501 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 3473 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 3479 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 6791 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 9598 of file manager.c.
References a, 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_xml_doc_item::seealso, synopsis, ast_xml_doc_item::synopsis, ast_xml_doc_item::syntax, and term_color().
Referenced by handle_manager_show_event(), and handle_showmancmd().
|
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 6825 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, mansession_session::stream, and mansession::write_error.
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 7375 of file manager.c.
References __astman_get_header(), manager_action::action, action_find(), 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 2135 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 7803 of file manager.c.
References 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, manager_displayconnects(), NULL, session, session_destroy(), sessions, unref_mansession(), 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 |
-1 | on error |
0 | on success |
Definition at line 5169 of file manager.c.
References ast_control_read_action_payload::action, AST_CONTROL_READ_ACTION, ast_free, ast_malloc, ast_queue_control_data(), ast_control_read_action_payload::payload, and ast_control_read_action_payload::payload_size.
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 |
-1 | on error |
0 | on success |
Definition at line 5202 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 |
-1 | on error |
0 | on success |
Definition at line 5218 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 10482 of file manager.c.
References __init_manager().
Referenced by handle_manager_reload().
|
static |
Definition at line 3582 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 3532 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 3665 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 3557 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 3507 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 3636 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 3607 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 3695 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_tcptls_session_args::local_address, mansession_get_transport(), ast_tcptls_session_instance::parent, mansession::session, session_limit, mansession_session::sessionstart_tv, mansession::tcptls_session, and mansession_session::username.
Referenced by process_message().
|
static |
Check if a file is restricted or not.
Definition at line 3863 of file manager.c.
References ast_asprintf, ast_begins_with(), ast_config_AST_CONFIG_DIR, ast_free, ast_std_free(), ast_strdupa, ast_strip(), live_dangerously, NULL, and RAII_VAR.
Referenced by action_getconfig(), action_getconfigjson(), and action_updateconfig().
|
static |
helper function to send a string to the socket. Return -1 on error (e.g. buffer full).
Definition at line 3247 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 2421 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 2350 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(), session, and eventqent::usecount.
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 7709 of file manager.c.
References 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(), authlimit, authtimeout, build_mansession(), displayconnects, do_message(), done, errno, grab_last(), mansession::lock, LOG_ERROR, LOG_WARNING, manager_displayconnects(), NULL, ast_tcptls_session_instance::remote_address, mansession::session, session, session_destroy(), ast_tcptls_session_instance::stream, mansession::stream, mansession::tcptls_session, unauth_sessions, 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 3488 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 2304 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 2335 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_kickmanconn(), 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 2212 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 |
|
static |
Definition at line 1633 of file manager.c.
Referenced by acl_change_stasis_subscribe(), and acl_change_stasis_unsubscribe().
|
static |
|
static |
|
static |
Definition at line 1616 of file manager.c.
Referenced by __init_manager(), and handle_manager_show_settings().
|
static |
Definition at line 3283 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 1625 of file manager.c.
Referenced by __init_manager(), manager_set_defaults(), and session_do().
|
static |
Definition at line 1624 of file manager.c.
Referenced by __init_manager(), do_message(), get_input(), manager_set_defaults(), and session_do().
|
static |
Definition at line 1619 of file manager.c.
Referenced by __init_manager(), action_events(), and manager_set_defaults().
const struct { ... } command_blacklist[] |
Referenced by check_blacklist().
|
static |
Definition at line 1615 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 1630 of file manager.c.
Referenced by __init_manager(), auth_http_callback(), and manager_set_defaults().
|
static |
Definition at line 1618 of file manager.c.
Referenced by __init_manager(), auth_http_callback(), generic_http_callback(), handle_manager_show_settings(), and purge_events().
|
static |
Set to true (non-zero) to globally allow all dangerous AMI actions to run.
Definition at line 1650 of file manager.c.
Referenced by astman_live_dangerously(), load_asterisk_conf(), and restrictedFile().
|
static |
Definition at line 1626 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 1623 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 1627 of file manager.c.
Referenced by __manager_event_sessions_va(), handle_manager_show_settings(), load_disabledevents(), and manager_shutdown().
|
static |
Definition at line 1620 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 7884 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 1636 of file manager.c.
Referenced by __init_manager(), ast_manager_get_topic(), load_module(), manager_bridging_init(), manager_channels_init(), manager_mwi_init(), manager_shutdown(), manager_subscriptions_init(), manager_system_init(), and state_id_by_topic().
|
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.
Definition at line 1642 of file manager.c.
Referenced by manager_shutdown(), and manager_subscriptions_init().
|
static |
The stasis_subscription for forwarding the Security topic to the AMI topic.
Definition at line 1645 of file manager.c.
Referenced by manager_shutdown(), and manager_subscriptions_init().
|
static |
The stasis_message_router for all Stasis Message Bus API messages.
Definition at line 1639 of file manager.c.
Referenced by ast_manager_get_message_router(), manager_shutdown(), and manager_subscriptions_init().
|
static |
Definition at line 1621 of file manager.c.
Referenced by __init_manager(), bridge_app_subscribed_involved(), bridge_attended_transfer_handler(), and subscribe_all().
|
static |
Definition at line 1617 of file manager.c.
Referenced by __init_manager(), __manager_event_sessions_va(), and handle_manager_show_settings().
|
static |
Definition at line 1632 of file manager.c.
Referenced by action_login(), and session_do().
|
static |
Definition at line 3285 of file manager.c.
Referenced by action_userevent().
|
static |
|
static |
Definition at line 1622 of file manager.c.
Referenced by __init_manager(), ast_webmanager_check_enabled(), and handle_manager_show_settings().
const char* words[AST_MAX_CMD_LEN] |