128 if (!manager_topic) {
132 if (!topic_forwarder) {
Struct containing info for an AMI event to send out.
void astman_append(struct mansession *s, const char *fmt,...)
Asterisk main include file. File version handling, generic pbx functions.
const ast_string_field extra_fields
void astman_send_list_complete_start(struct mansession *s, const struct message *m, const char *event_name, int count)
Start the list complete event.
Stasis Message Bus API. See Stasis Message Bus API for detailed documentation.
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.
static struct stasis_topic * manager_topic
A stasis_topic that all topics AMI cares about will be forwarded to.
const char * astman_get_header(const struct message *m, char *var)
Get header from mananger transaction.
#define ast_strlen_zero(foo)
const char * manager_event
struct ast_manager_event_blob * stasis_message_to_ami(struct stasis_message *msg)
Build the AMI representation of the message.
struct stasis_message_type * ast_device_state_message_type(void)
Get the Stasis message type for device state messages.
void astman_send_list_complete_end(struct mansession *s)
End the list complete event.
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
#define ao2_ref(o, delta)
In case you didn't read that giant block of text above the mansession_session struct, the struct mansession is named this solely to keep the API the same in Asterisk. This structure really represents data that is different from Manager action to Manager action. The mansession_session pointer contained within points to session-specific data.
static int load_module(void)
struct ao2_container * stasis_cache_dump_by_eid(struct stasis_cache *cache, struct stasis_message_type *type, const struct ast_eid *eid)
Dump cached items to a subscription for a specific entity.
int ast_manager_unregister(const char *action)
Unregister a registered manager command.
The AMI - Asterisk Manager Interface - is a TCP protocol created to manage Asterisk with third-party ...
struct stasis_cache * ast_device_state_cache(void)
Backend cache for ast_device_state_topic_cached()
#define ao2_iterator_next(iter)
struct stasis_topic * ast_device_state_topic_all(void)
Get the Stasis topic for device state messages.
struct stasis_forward * stasis_forward_cancel(struct stasis_forward *forward)
Module has failed to load, may be in an inconsistent state.
struct stasis_topic * ast_manager_get_topic(void)
Get the Stasis Message Bus API topic for AMI.
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS|AST_MODFLAG_LOAD_ORDER, "HTTP Phone Provisioning",.support_level=AST_MODULE_SUPPORT_EXTENDED,.load=load_module,.unload=unload_module,.reload=reload,.load_pri=AST_MODPRI_CHANNEL_DEPEND,.requires="http",)
#define EVENT_FLAG_REPORTING
static int action_devicestatelist(struct mansession *s, const struct message *m)
When we need to walk through a container, we use an ao2_iterator to keep track of the current positio...
struct stasis_forward * stasis_forward_all(struct stasis_topic *from_topic, struct stasis_topic *to_topic)
Create a subscription which forwards all messages from one topic to another.
#define ast_manager_register_xml(action, authority, func)
Register a manager callback using XML documentation to describe the manager.
#define ASTERISK_GPL_KEY
The text the key() function should return.
void astman_send_error(struct mansession *s, const struct message *m, char *error)
Send error in manager transaction.
Asterisk module definitions.
struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags) attribute_warn_unused_result
Create an iterator for a container.
static struct stasis_forward * topic_forwarder
void astman_send_listack(struct mansession *s, const struct message *m, char *msg, char *listflag)
Send ack in manager transaction to begin a list.
static int unload_module(void)