Asterisk - The Open Source Telephony Project
18.5.0
|
The AMI - Asterisk Manager Interface - is a TCP protocol created to manage Asterisk with third-party software. More...
#include "asterisk/network.h"
#include "asterisk/lock.h"
#include "asterisk/datastore.h"
#include "asterisk/xmldoc.h"
Go to the source code of this file.
Data Structures | |
struct | ast_manager_event_blob |
Struct containing info for an AMI event to send out. More... | |
struct | manager_action |
struct | manager_custom_hook |
struct | message |
Macros | |
#define | AMI_VERSION "7.0.1" |
#define | ast_manager_event(chan, category, event, contents, ...) |
#define | ast_manager_event_multichan(category, event, nchans, chans, contents, ...) __ast_manager_event_multichan(category, event, nchans, chans, __FILE__, __LINE__, __PRETTY_FUNCTION__, contents , ## __VA_ARGS__); |
#define | ast_manager_register(action, authority, func, synopsis) ast_manager_register2(action, authority, func, AST_MODULE_SELF, synopsis, NULL) |
External routines may register/unregister manager callbacks this way. More... | |
#define | ast_manager_register_xml(action, authority, func) ast_manager_register2(action, authority, func, AST_MODULE_SELF, NULL, NULL) |
Register a manager callback using XML documentation to describe the manager. More... | |
#define | ast_manager_register_xml_core(action, authority, func) ast_manager_register2(action, authority, func, NULL, NULL, NULL) |
Register a manager callback using XML documentation to describe the manager. More... | |
#define | AST_MAX_MANHEADERS 128 |
Export manager structures. More... | |
#define | DEFAULT_MANAGER_PORT 5038 /* Default port for Asterisk management via TCP */ |
#define | DEFAULT_MANAGER_TLS_PORT 5039 /* Default port for Asterisk management via TCP */ |
#define | manager_event(category, event, contents, ...) __ast_manager_event_multichan(category, event, 0, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__, contents , ## __VA_ARGS__) |
External routines may send asterisk manager events this way. More... | |
#define | NO_EXTRA_FIELDS "%s", "" |
Constant return values | |
| |
#define | AMI_SUCCESS (0) |
#define | AMI_DESTROY (-1) |
Manager event classes | |
#define | EVENT_FLAG_SYSTEM (1 << 0) /* System events such as module load/unload */ |
#define | EVENT_FLAG_CALL (1 << 1) /* Call event, such as state change, etc */ |
#define | EVENT_FLAG_LOG (1 << 2) /* Log events */ |
#define | EVENT_FLAG_VERBOSE (1 << 3) /* Verbose messages */ |
#define | EVENT_FLAG_COMMAND (1 << 4) /* Ability to read/set commands */ |
#define | EVENT_FLAG_AGENT (1 << 5) /* Ability to read/set agent info */ |
#define | EVENT_FLAG_USER (1 << 6) /* Ability to read/set user info */ |
#define | EVENT_FLAG_CONFIG (1 << 7) /* Ability to modify configurations */ |
#define | EVENT_FLAG_DTMF (1 << 8) /* Ability to read DTMF events */ |
#define | EVENT_FLAG_REPORTING (1 << 9) /* Reporting events such as rtcp sent */ |
#define | EVENT_FLAG_CDR (1 << 10) /* CDR events */ |
#define | EVENT_FLAG_DIALPLAN (1 << 11) /* Dialplan events (VarSet, NewExten) */ |
#define | EVENT_FLAG_ORIGINATE (1 << 12) /* Originate a call to an extension */ |
#define | EVENT_FLAG_AGI (1 << 13) /* AGI events */ |
#define | EVENT_FLAG_HOOKRESPONSE (1 << 14) /* Hook Response */ |
#define | EVENT_FLAG_CC (1 << 15) /* Call Completion events */ |
#define | EVENT_FLAG_AOC (1 << 16) /* Advice Of Charge events */ |
#define | EVENT_FLAG_TEST (1 << 17) /* Test event used to signal the Asterisk Test Suite */ |
#define | EVENT_FLAG_SECURITY (1 << 18) /* Security Message as AMI Event */ |
#define | EVENT_FLAG_MESSAGE (1 << 30) /* MESSAGE events. */ |
Typedefs | |
typedef int(* | key_exclusion_cb) (const char *key) |
Callback used to determine whether a key should be skipped when converting a JSON object to a manager blob. More... | |
typedef int(* | manager_hook_t) (int category, const char *event, char *body) |
Manager Helper Function. More... | |
Enumerations | |
enum | variable_orders { ORDER_NATURAL, ORDER_REVERSE } |
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 *contents,...) |
int | ast_hook_send_action (struct manager_custom_hook *hook, const char *msg) |
Registered hooks can call this function to invoke actions and they will receive responses through registered callback. More... | |
struct ast_str * | ast_manager_build_bridge_state_string (const struct ast_bridge_snapshot *snapshot) |
Generate the AMI message body from a bridge snapshot. More... | |
struct ast_str * | ast_manager_build_bridge_state_string_prefix (const struct ast_bridge_snapshot *snapshot, const char *prefix) |
Generate the AMI message body from a bridge snapshot. More... | |
struct ast_str * | ast_manager_build_channel_state_string (const struct ast_channel_snapshot *snapshot) |
Generate the AMI message body from a channel snapshot. More... | |
struct ast_str * | ast_manager_build_channel_state_string_prefix (const struct ast_channel_snapshot *snapshot, const char *prefix) |
Generate the AMI message body from a channel snapshot. More... | |
int | ast_manager_check_enabled (void) |
Check if AMI is enabled. More... | |
struct ast_manager_event_blob * | ast_manager_event_blob_create (int event_flags, const char *manager_event, const char *extra_fields_fmt,...) |
Construct a ast_manager_event_blob. More... | |
struct stasis_message_type * | ast_manager_get_generic_type (void) |
Get the stasis_message_type for generic messages. More... | |
struct stasis_message_router * | ast_manager_get_message_router (void) |
Get the stasis_message_router for AMI. More... | |
struct stasis_topic * | ast_manager_get_topic (void) |
Get the Stasis Message Bus API topic for AMI. More... | |
void | ast_manager_publish_event (const char *type, int class_type, struct ast_json *obj) |
Publish an event to AMI. More... | |
int | ast_manager_register2 (const char *action, int authority, int(*func)(struct mansession *s, const struct message *m), struct ast_module *module, const char *synopsis, const char *description) |
Register a manager command with the manager interface. More... | |
void | ast_manager_register_hook (struct manager_custom_hook *hook) |
Add a custom hook to be called when an event is fired. More... | |
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) |
Unregister a registered manager command. 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_str_append_event_header (struct ast_str **fields_string, const char *header, const char *value) |
append an event header to an ast string More... | |
int | ast_webmanager_check_enabled (void) |
Check if AMI/HTTP is enabled. More... | |
void | astman_append (struct mansession *s, const char *fmt,...) |
int | astman_datastore_add (struct mansession *s, struct ast_datastore *datastore) |
Add a datastore to a session. More... | |
struct ast_datastore * | astman_datastore_find (struct mansession *s, const struct ast_datastore_info *info, const char *uid) |
Find a datastore on a session. More... | |
int | astman_datastore_remove (struct mansession *s, struct ast_datastore *datastore) |
Remove a datastore from a session. More... | |
const char * | astman_get_header (const struct message *m, char *var) |
Get header from mananger transaction. 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... | |
int | astman_is_authed (uint32_t ident) |
Determinie if a manager session ident is authenticated. 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... | |
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... | |
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... | |
int | astman_verify_session_readpermissions (uint32_t ident, int perm) |
Verify a session's read permissions against a permission mask. More... | |
int | astman_verify_session_writepermissions (uint32_t ident, int perm) |
Verify a session's write permissions against a permission mask. More... | |
int | manager_bridging_init (void) |
Initialize support for AMI channel events. More... | |
int | manager_channels_init (void) |
Initialize support for AMI channel events. More... | |
int | manager_endpoints_init (void) |
Initialize support for AMI endpoint events. More... | |
int | manager_mwi_init (void) |
Initialize support for AMI MWI events. More... | |
int | manager_system_init (void) |
Initialize support for AMI system events. More... | |
The AMI - Asterisk Manager Interface - is a TCP protocol created to manage Asterisk with third-party software.
Manager protocol packages are text fields of the form a: b. There is always exactly one space after the colon.
For Actions replies, the first line of the reply is a "Response:" header with values "success", "error" or "follows". "Follows" implies that the response is coming as separate events with the same ActionID. If the Action request has no ActionID, it will be hard matching events to the Action request in the manager client. The first header type is the "Event" header. Other headers vary from event to event. Headers end with standard \\r\\n termination. The last line of the manager response or event is an empty line. (\\r\\n)
Definition in file manager.h.
#define AMI_SUCCESS (0) |
Definition at line 65 of file manager.h.
Referenced by change_monitor_action(), do_pause_or_unpause(), manager_mixmonitor(), manager_mute_mixmonitor(), manager_stop_mixmonitor(), start_monitor_action(), and stop_monitor_action().
#define AMI_VERSION "7.0.1" |
Definition at line 57 of file manager.h.
Referenced by action_coresettings(), and session_do().
Definition at line 250 of file manager.h.
Referenced by __ast_change_name_nolink().
#define ast_manager_event_multichan | ( | category, | |
event, | |||
nchans, | |||
chans, | |||
contents, | |||
... | |||
) | __ast_manager_event_multichan(category, event, nchans, chans, __FILE__, __LINE__, __PRETTY_FUNCTION__, contents , ## __VA_ARGS__); |
Definition at line 255 of file manager.h.
Referenced by fast_originate().
#define ast_manager_register | ( | action, | |
authority, | |||
func, | |||
synopsis | |||
) | ast_manager_register2(action, authority, func, AST_MODULE_SELF, synopsis, NULL) |
External routines may register/unregister manager callbacks this way.
#define ast_manager_register_xml | ( | action, | |
authority, | |||
func | |||
) | ast_manager_register2(action, authority, func, AST_MODULE_SELF, NULL, NULL) |
Register a manager callback using XML documentation to describe the manager.
Definition at line 186 of file manager.h.
Referenced by ast_res_pjsip_init_options_handling(), ast_res_pjsip_initialize_configuration(), ast_sip_initialize_sorcery_auth(), ast_sip_initialize_sorcery_location(), load_module(), and load_parking_manager().
#define ast_manager_register_xml_core | ( | action, | |
authority, | |||
func | |||
) | ast_manager_register2(action, authority, func, NULL, NULL, NULL) |
Register a manager callback using XML documentation to describe the manager.
Definition at line 197 of file manager.h.
Referenced by __init_manager(), ast_bridging_init(), ast_local_init(), ast_msg_init(), astdb_init(), load_module(), load_pbx(), and manager_bridging_init().
#define DEFAULT_MANAGER_PORT 5038 /* Default port for Asterisk management via TCP */ |
Definition at line 58 of file manager.h.
Referenced by __init_manager().
#define DEFAULT_MANAGER_TLS_PORT 5039 /* Default port for Asterisk management via TCP */ |
Definition at line 59 of file manager.h.
Referenced by __init_manager().
#define EVENT_FLAG_AGENT (1 << 5) /* Ability to read/set agent info */ |
Definition at line 76 of file manager.h.
Referenced by agent_login_to_ami(), agent_logoff_to_ami(), load_module(), queue_channel_to_ami(), queue_member_to_ami(), and queue_multi_channel_to_ami().
Definition at line 84 of file manager.h.
Referenced by agi_channel_to_ami(), and load_module().
#define EVENT_FLAG_AOC (1 << 16) /* Advice Of Charge events */ |
Definition at line 87 of file manager.h.
Referenced by __init_manager(), and aoc_to_ami().
Definition at line 72 of file manager.h.
Referenced by __ast_change_name_nolink(), __init_manager(), ast_local_init(), attended_transfer_to_ami(), blind_transfer_to_ami(), bridge_create(), bridge_destroy(), bridge_merge_cb(), bridge_video_update(), call_pickup_to_ami(), channel_chanspy_start_cb(), channel_chanspy_stop_cb(), channel_dial_cb(), channel_enter_cb(), channel_fax_cb(), channel_flash_cb(), channel_hangup_request_cb(), channel_hold_cb(), channel_leave_cb(), channel_mixmonitor_mute_cb(), channel_mixmonitor_start_cb(), channel_mixmonitor_stop_cb(), channel_moh_start_cb(), channel_moh_stop_cb(), channel_monitor_start_cb(), channel_monitor_stop_cb(), channel_new_accountcode(), channel_new_callerid(), channel_new_connected_line(), channel_state_change(), channel_unhold_cb(), confbridge_publish_manager_event(), dahdichannel_to_ami(), devstate_to_ami(), fast_originate(), load_module(), load_parking_manager(), load_pbx(), local_message_to_ami(), manager_log(), manager_state_cb(), meetme_stasis_cb(), mwi_app_event_cb(), mwi_update_cb(), parked_call_message_response(), presence_state_to_ami(), publish_qualify_peer_done(), session_timeout_to_ami(), talking_start_to_ami(), and talking_stop_to_ami().
#define EVENT_FLAG_CC (1 << 15) /* Call Completion events */ |
Definition at line 86 of file manager.h.
Referenced by cc_available_to_ami(), cc_callerrecalling_to_ami(), cc_callerstartmonitoring_to_ami(), cc_callerstopmonitoring_to_ami(), cc_failure_to_ami(), cc_monitorfailed_to_ami(), cc_offertimerstart_to_ami(), cc_recallcomplete_to_ami(), cc_requestacknowledged_to_ami(), and cc_requested_to_ami().
#define EVENT_FLAG_CDR (1 << 10) /* CDR events */ |
Definition at line 81 of file manager.h.
Referenced by manager_log().
Definition at line 75 of file manager.h.
Referenced by __init_manager().
#define EVENT_FLAG_CONFIG (1 << 7) /* Ability to modify configurations */ |
Definition at line 78 of file manager.h.
Referenced by __init_manager(), http_post_callback(), and load_pbx().
#define EVENT_FLAG_DIALPLAN (1 << 11) /* Dialplan events (VarSet, NewExten) */ |
Definition at line 82 of file manager.h.
Referenced by channel_hangup_handler_cb(), channel_newexten(), and varset_to_ami().
#define EVENT_FLAG_DTMF (1 << 8) /* Ability to read DTMF events */ |
Definition at line 79 of file manager.h.
Referenced by channel_dtmf_begin_cb(), and channel_dtmf_end_cb().
#define EVENT_FLAG_HOOKRESPONSE (1 << 14) /* Hook Response */ |
Definition at line 85 of file manager.h.
Referenced by send_string().
#define EVENT_FLAG_MESSAGE (1 << 30) /* MESSAGE events. */ |
Definition at line 91 of file manager.h.
Referenced by ast_msg_init().
Definition at line 83 of file manager.h.
Referenced by __init_manager().
#define EVENT_FLAG_REPORTING (1 << 9) /* Reporting events such as rtcp sent */ |
Definition at line 80 of file manager.h.
Referenced by __init_manager(), ast_res_pjsip_init_options_handling(), astdb_init(), load_module(), load_pbx(), rtcp_report_to_ami(), and test_suite_event_to_ami().
#define EVENT_FLAG_SECURITY (1 << 18) /* Security Message as AMI Event */ |
Definition at line 89 of file manager.h.
Referenced by security_event_to_ami_blob().
#define EVENT_FLAG_SYSTEM (1 << 0) /* System events such as module load/unload */ |
Definition at line 71 of file manager.h.
Referenced by __init_manager(), action_login(), action_originate(), analog_publish_channel_alarm_clear(), analog_publish_dnd_state(), ast_local_init(), ast_logger_rotate_channel(), ast_res_pjsip_init_options_handling(), ast_res_pjsip_initialize_configuration(), ast_sip_initialize_sorcery_auth(), ast_sip_initialize_sorcery_location(), astdb_init(), contactstatus_to_ami(), do_discovery(), do_monitor_headset(), do_monitor_phone(), function_capable_string_allowed_with_auths(), load_module(), logger_print_normal(), peerstatus_to_ami(), publish_channel_alarm(), publish_channel_alarm_clear(), publish_dnd_state(), publish_fully_booted(), publish_load_message_type(), publish_span_alarm(), publish_span_alarm_clear(), really_quit(), reload_logger(), and system_registry_to_ami().
#define EVENT_FLAG_TEST (1 << 17) /* Test event used to signal the Asterisk Test Suite */ |
Definition at line 88 of file manager.h.
Referenced by fake_ami().
Definition at line 77 of file manager.h.
Referenced by __init_manager(), action_userevent(), load_module(), multi_user_event_to_ami(), and xmpp_pak_presence().
#define manager_event | ( | category, | |
event, | |||
contents, | |||
... | |||
) | __ast_manager_event_multichan(category, event, 0, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__, contents , ## __VA_ARGS__) |
External routines may send asterisk manager events this way.
category | Event category, matches manager authorization |
event | Event name |
contents | Contents of event |
Definition at line 248 of file manager.h.
Referenced by action_userevent(), ast_logger_rotate_channel(), ast_manager_event_blob_create(), bridge_merge_cb(), bridge_snapshot_update(), channel_chanspy_start_cb(), channel_chanspy_stop_cb(), channel_dial_cb(), channel_dtmf_begin_cb(), channel_dtmf_end_cb(), channel_enter_cb(), channel_fax_cb(), channel_flash_cb(), channel_hangup_handler_cb(), channel_hangup_request_cb(), channel_hold_cb(), channel_leave_cb(), channel_mixmonitor_mute_cb(), channel_moh_start_cb(), channel_snapshot_update(), channel_unhold_cb(), confbridge_publish_manager_event(), do_discovery(), do_monitor_headset(), do_monitor_phone(), logger_print_normal(), manager_log(), manager_shutdown(), manager_state_cb(), meetme_stasis_cb(), mwi_app_event_cb(), mwi_update_cb(), parked_call_message_response(), publish_basic_channel_event(), reload_logger(), and xmpp_pak_presence().
#define NO_EXTRA_FIELDS "%s", "" |
GCC warns about blank or NULL format strings. So, shenanigans!
Definition at line 522 of file manager.h.
Referenced by bridge_create(), bridge_destroy(), and channel_state_change().
typedef int(* key_exclusion_cb) (const char *key) |
typedef int(* manager_hook_t) (int category, const char *event, char *body) |
enum variable_orders |
Enumerator | |
---|---|
ORDER_NATURAL | |
ORDER_REVERSE |
Definition at line 282 of file manager.h.
struct ast_str* ast_manager_build_bridge_state_string | ( | const struct ast_bridge_snapshot * | snapshot | ) |
Generate the AMI message body from a bridge snapshot.
snapshot | the bridge snapshot for which to generate an AMI message body |
NULL | on error |
ast_str* | on success (must be ast_freed by caller) |
Definition at line 267 of file manager_bridges.c.
References ast_manager_build_bridge_state_string_prefix().
Referenced by blind_transfer_to_ami(), bridge_snapshot_update(), channel_enter_cb(), channel_leave_cb(), confbridge_publish_manager_event(), manager_bridge_info(), and send_bridge_list_item_cb().
struct ast_str* ast_manager_build_bridge_state_string_prefix | ( | const struct ast_bridge_snapshot * | snapshot, |
const char * | prefix | ||
) |
Generate the AMI message body from a bridge snapshot.
snapshot | the bridge snapshot for which to generate an AMI message body |
prefix | What to prepend to the bridge fields |
NULL | on error |
ast_str* | on success (must be ast_freed by caller) |
Definition at line 223 of file manager_bridges.c.
References AST_BRIDGE_VIDEO_MODE_NONE, ast_bridge_video_mode_to_string(), ast_free, ast_str_append(), ast_str_create, ast_str_set(), ast_strlen_zero, ast_bridge_snapshot::creator, ast_bridge_snapshot::name, NULL, ast_bridge_snapshot::num_channels, out, ast_bridge_snapshot::subclass, ast_bridge_snapshot::technology, ast_bridge_snapshot::uniqueid, ast_bridge_snapshot::video_mode, and ast_bridge_snapshot::video_source_id.
Referenced by ast_manager_build_bridge_state_string(), attended_transfer_to_ami(), bridge_merge_cb(), and multi_object_blob_to_ami().
struct ast_str* ast_manager_build_channel_state_string | ( | const struct ast_channel_snapshot * | snapshot | ) |
Generate the AMI message body from a channel snapshot.
snapshot | the channel snapshot for which to generate an AMI message body |
NULL | on error |
ast_str* | on success (must be ast_freed by caller) |
Definition at line 561 of file manager_channels.c.
References ast_manager_build_channel_state_string_prefix().
Referenced by action_agents(), action_confbridgelist_item(), agent_login_to_ami(), agent_logoff_to_ami(), agi_channel_to_ami(), aoc_to_ami(), call_pickup_to_ami(), channel_dial_cb(), channel_dtmf_begin_cb(), channel_dtmf_end_cb(), channel_enter_cb(), channel_fax_cb(), channel_flash_cb(), channel_hangup_handler_cb(), channel_hangup_request_cb(), channel_hold_cb(), channel_leave_cb(), channel_mixmonitor_mute_cb(), channel_moh_start_cb(), channel_snapshot_update(), channel_unhold_cb(), confbridge_publish_manager_event(), dahdichannel_to_ami(), generate_status(), meetme_stasis_cb(), mwi_app_event_cb(), mwi_update_cb(), publish_basic_channel_event(), queue_channel_to_ami(), queue_multi_channel_to_ami(), rtcp_report_to_ami(), send_bridge_info_item_cb(), session_timeout_to_ami(), talking_start_to_ami(), talking_stop_to_ami(), and varset_to_ami().
struct ast_str* ast_manager_build_channel_state_string_prefix | ( | const struct ast_channel_snapshot * | snapshot, |
const char * | prefix | ||
) |
Generate the AMI message body from a channel snapshot.
snapshot | the channel snapshot for which to generate an AMI message body |
prefix | What to prepend to the channel fields |
NULL | on error |
ast_str* | on success (must be ast_freed by caller) |
Definition at line 487 of file manager_channels.c.
References ast_channel_snapshot_base::accountcode, AST_CHAN_TP_INTERNAL, ast_escape_c_alloc(), ast_free, AST_LIST_TRAVERSE, ast_state2str(), ast_str_append(), ast_str_create, ast_str_set(), ast_channel_snapshot::base, ast_channel_snapshot::caller, ast_channel_snapshot::connected, ast_channel_snapshot_dialplan::context, ast_channel_snapshot::dialplan, ast_var_t::entries, ast_channel_snapshot_dialplan::exten, ast_channel_snapshot_base::language, ast_channel_snapshot_peer::linkedid, ast_channel_snapshot::manager_vars, ast_var_t::name, ast_channel_snapshot_caller::name, ast_channel_snapshot_connected::name, ast_channel_snapshot_base::name, NULL, ast_channel_snapshot_caller::number, ast_channel_snapshot_connected::number, out, ast_channel_snapshot::peer, ast_channel_snapshot_dialplan::priority, S_OR, ast_channel_snapshot::state, ast_channel_snapshot_base::tech_properties, ast_channel_snapshot_base::uniqueid, ast_var_t::value, and var.
Referenced by action_coreshowchannels(), ast_manager_build_channel_state_string(), attended_transfer_to_ami(), blind_transfer_to_ami(), call_pickup_to_ami(), channel_chanspy_start_cb(), channel_chanspy_stop_cb(), channel_dial_cb(), local_message_to_ami(), manager_build_parked_call_string(), multi_object_blob_to_ami(), and queue_multi_channel_to_ami().
struct ast_manager_event_blob* ast_manager_event_blob_create | ( | int | event_flags, |
const char * | manager_event, | ||
const char * | extra_fields_fmt, | ||
... | |||
) |
Construct a ast_manager_event_blob.
event_flags | Flags the event should be raised with. |
manager_event | The event to be raised, should be a string literal. |
extra_fields_fmt | Format string for extra fields to include. Or NO_EXTRA_FIELDS for no extra fields. |
NULL
on error. Definition at line 9727 of file manager.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_ref, ast_assert, AST_MODFLAG_GLOBAL_SYMBOLS, AST_MODFLAG_LOAD_ORDER, AST_MODPRI_CORE, AST_MODULE_INFO(), AST_MODULE_SUPPORT_CORE, ast_string_field_init, ast_string_field_ptr_build_va, ASTERISK_GPL_KEY, ast_manager_event_blob::event_flags, ast_manager_event_blob::extra_fields, load_module(), manager_event, ast_manager_event_blob::manager_event, manager_event_blob_dtor(), NULL, reload(), and unload_module().
Referenced by agent_login_to_ami(), agent_logoff_to_ami(), agi_channel_to_ami(), aoc_to_ami(), attended_transfer_to_ami(), blind_transfer_to_ami(), bridge_create(), bridge_destroy(), bridge_video_update(), call_pickup_to_ami(), cc_available_to_ami(), cc_callerrecalling_to_ami(), cc_callerstartmonitoring_to_ami(), cc_callerstopmonitoring_to_ami(), cc_failure_to_ami(), cc_monitorfailed_to_ami(), cc_offertimerstart_to_ami(), cc_recallcomplete_to_ami(), cc_requestacknowledged_to_ami(), cc_requested_to_ami(), channel_new_accountcode(), channel_new_callerid(), channel_new_connected_line(), channel_newexten(), channel_state_change(), contactstatus_to_ami(), dahdichannel_to_ami(), devstate_to_ami(), fake_ami(), local_message_to_ami(), multi_user_event_to_ami(), peerstatus_to_ami(), presence_state_to_ami(), queue_channel_to_ami(), queue_member_to_ami(), queue_multi_channel_to_ami(), rtcp_report_to_ami(), security_event_to_ami_blob(), session_timeout_to_ami(), system_registry_to_ami(), talking_start_to_ami(), talking_stop_to_ami(), test_suite_event_to_ami(), and varset_to_ami().
struct stasis_message_type* ast_manager_get_generic_type | ( | void | ) |
Get the stasis_message_type for generic messages.
A | stasis_message_type for AMI messages |
Referenced by __init_manager(), ast_manager_publish_event(), load_module(), manager_shutdown(), manager_subscriptions_init(), mwi_startup_event_cb(), publish_load_message_type(), startup_event_cb(), and subscription_persistence_event_cb().
int ast_str_append_event_header | ( | struct ast_str ** | fields_string, |
const char * | header, | ||
const char * | value | ||
) |
append an event header to an ast string
fields_string | pointer to an ast_string pointer. It may be a pointer to a NULL ast_str pointer, in which case the ast_str will be initialized. |
header | The header being applied |
value | the value of the header |
0 | if successful |
non-zero | on failure |
Definition at line 9705 of file manager.c.
References ast_str_append(), and ast_str_create.
Referenced by confbridge_talking_cb(), get_bool_header(), and meetme_stasis_cb().
int astman_datastore_add | ( | struct mansession * | s, |
struct ast_datastore * | datastore | ||
) |
Add a datastore to a session.
0 | success |
non-zero | failure |
Definition at line 9666 of file manager.c.
References AST_LIST_INSERT_HEAD, mansession_session::datastores, and mansession::session.
struct ast_datastore* astman_datastore_find | ( | struct mansession * | s, |
const struct ast_datastore_info * | info, | ||
const char * | uid | ||
) |
Find a datastore on a session.
pointer | to the datastore if found |
NULL | if not found |
Definition at line 9678 of file manager.c.
References AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, mansession_session::datastores, ast_datastore::info, NULL, mansession::session, and ast_datastore::uid.
int astman_datastore_remove | ( | struct mansession * | s, |
struct ast_datastore * | datastore | ||
) |
Remove a datastore from a session.
0 | success |
non-zero | failure |
Definition at line 9673 of file manager.c.
References AST_LIST_REMOVE, mansession_session::datastores, and mansession::session.
int astman_is_authed | ( | uint32_t | ident | ) |
Determinie if a manager session ident is authenticated.
Definition at line 7551 of file manager.c.
References ao2_unlock, mansession_session::authenticated, find_session(), session, and unref_mansession().
Referenced by http_post_callback(), and static_callback().
int astman_verify_session_readpermissions | ( | uint32_t | ident, |
int | perm | ||
) |
Verify a session's read permissions against a permission mask.
ident | session identity |
perm | permission mask to verify |
1 | if the session has the permission mask capabilities |
0 | otherwise |
Definition at line 7567 of file manager.c.
References ao2_global_obj_ref, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_lock, ao2_ref, ao2_unlock, mansession_session::managerid, mansession_session::readperm, result, session, sessions, and unref_mansession().
int astman_verify_session_writepermissions | ( | uint32_t | ident, |
int | perm | ||
) |
Verify a session's write permissions against a permission mask.
ident | session identity |
perm | permission mask to verify |
1 | if the session has the permission mask capabilities, otherwise 0 |
0 | otherwise |
Definition at line 7600 of file manager.c.
References ao2_global_obj_ref, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_lock, ao2_ref, ao2_unlock, mansession_session::managerid, result, session, sessions, unref_mansession(), and mansession_session::writeperm.
Referenced by http_post_callback().
int manager_bridging_init | ( | void | ) |
Initialize support for AMI channel events.
Definition at line 681 of file manager_bridges.c.
References ast_bridge_merge_message_type(), ast_bridge_snapshot_type(), ast_bridge_topic_all(), ast_channel_entered_bridge_type(), ast_channel_left_bridge_type(), ast_manager_get_message_router(), ast_manager_get_topic(), ast_manager_register_xml_core, ast_register_cleanup(), bridge_merge_cb(), bridge_snapshot_update(), channel_enter_cb(), channel_leave_cb(), manager_bridge_destroy(), manager_bridge_info(), manager_bridge_kick(), manager_bridges_list(), manager_bridging_cleanup(), manager_topic, NULL, stasis_forward_all(), and stasis_message_router_add().
Referenced by subscribe_all().
int manager_channels_init | ( | void | ) |
Initialize support for AMI channel events.
0 | on success. |
non-zero | on error. |
Definition at line 1308 of file manager_channels.c.
References ast_channel_chanspy_start_type(), ast_channel_chanspy_stop_type(), ast_channel_dial_type(), ast_channel_dtmf_begin_type(), ast_channel_dtmf_end_type(), ast_channel_fax_type(), ast_channel_flash_type(), ast_channel_hangup_handler_type(), ast_channel_hangup_request_type(), ast_channel_hold_type(), ast_channel_mixmonitor_mute_type(), ast_channel_mixmonitor_start_type(), ast_channel_mixmonitor_stop_type(), ast_channel_moh_start_type(), ast_channel_moh_stop_type(), ast_channel_monitor_start_type(), ast_channel_monitor_stop_type(), ast_channel_snapshot_type(), ast_channel_topic_all(), ast_channel_unhold_type(), ast_manager_get_message_router(), ast_manager_get_topic(), ast_register_cleanup(), channel_chanspy_start_cb(), channel_chanspy_stop_cb(), channel_dial_cb(), channel_dtmf_begin_cb(), channel_dtmf_end_cb(), channel_fax_cb(), channel_flash_cb(), channel_hangup_handler_cb(), channel_hangup_request_cb(), channel_hold_cb(), channel_mixmonitor_mute_cb(), channel_mixmonitor_start_cb(), channel_mixmonitor_stop_cb(), channel_moh_start_cb(), channel_moh_stop_cb(), channel_monitor_start_cb(), channel_monitor_stop_cb(), channel_snapshot_update(), channel_unhold_cb(), manager_channels_shutdown(), manager_topic, NULL, stasis_forward_all(), and stasis_message_router_add().
Referenced by subscribe_all().
int manager_endpoints_init | ( | void | ) |
Initialize support for AMI endpoint events.
Definition at line 52 of file manager_endpoints.c.
References ast_endpoint_contact_state_type(), ast_endpoint_state_type(), ast_endpoint_topic_all_cached(), ast_register_cleanup(), endpoint_state_cb(), manager_endpoints_shutdown(), NULL, stasis_message_router_add(), and stasis_message_router_create.
Referenced by subscribe_all().
int manager_mwi_init | ( | void | ) |
Initialize support for AMI MWI events.
0 | on success |
non-zero | on error |
Definition at line 153 of file manager_mwi.c.
References ast_manager_get_message_router(), ast_manager_get_topic(), ast_mwi_state_type(), ast_mwi_topic_all(), ast_mwi_vm_app_type(), ast_register_cleanup(), manager_mwi_shutdown(), manager_topic, mwi_app_event_cb(), mwi_update_cb(), NULL, stasis_forward_all(), and stasis_message_router_add().
Referenced by subscribe_all().
int manager_system_init | ( | void | ) |
Initialize support for AMI system events.
0 | on success |
non-zero | on error |
Definition at line 43 of file manager_system.c.
References ast_manager_get_message_router(), ast_manager_get_topic(), ast_register_cleanup(), ast_system_topic(), manager_system_shutdown(), manager_topic, stasis_forward_all(), and system_topic.
Referenced by subscribe_all().