48 if (!strcmp(key,
"Event")) {
140 AS_OR(channel_event_string,
""),
150 topic_forwarder =
NULL;
161 if (!manager_topic) {
165 if (!message_router) {
174 if (!topic_forwarder) {
static int exclude_event_cb(const char *key)
Callback function used by mwi_app_event_cb to weed out "Event" keys.
struct ast_mwi_state * mwi_state
Asterisk main include file. File version handling, generic pbx functions.
int stasis_message_router_add(struct stasis_message_router *router, struct stasis_message_type *message_type, stasis_subscription_cb callback, void *data)
Add a route to a message router.
Stasis Message Bus API. See Stasis Message Bus API for detailed documentation.
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
static void manager_mwi_shutdown(void)
struct stasis_message_type * stasis_message_type(const struct stasis_message *msg)
Get the message type for a stasis_message.
struct stasis_topic * ast_mwi_topic_all(void)
Get the Stasis Message Bus API topic for MWI messages.
static struct stasis_topic * manager_topic
A stasis_topic that all topics AMI cares about will be forwarded to.
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.
General Asterisk PBX channel definitions.
int ast_register_cleanup(void(*func)(void))
Register a function to be executed before Asterisk gracefully exits.
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
struct ast_str * ast_manager_build_channel_state_string(const struct ast_channel_snapshot *snapshot)
Generate the AMI message body from a channel snapshot.
The AMI - Asterisk Manager Interface - is a TCP protocol created to manage Asterisk with third-party ...
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
void * stasis_message_data(const struct stasis_message *msg)
Get the data contained in a message.
int manager_mwi_init(void)
Initialize support for AMI MWI events.
static void mwi_app_event_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
Generic MWI event callback used for one-off events from voicemail modules.
struct stasis_message_router * ast_manager_get_message_router(void)
Get the stasis_message_router for AMI.
struct ast_channel_snapshot * snapshot
struct stasis_forward * stasis_forward_cancel(struct stasis_forward *forward)
struct stasis_message_type * ast_mwi_state_type(void)
Get the Stasis Message Bus API message type for MWI messages.
static struct stasis_forward * topic_forwarder
The Stasis Message Bus API subscription returned by the forwarding of the MWI topic to the manager to...
Object that represents an MWI update with some additional application defined data.
struct stasis_topic * ast_manager_get_topic(void)
Get the Stasis Message Bus API topic for AMI.
int ast_app_has_voicemail(const char *mailboxes, const char *folder)
Determine if a given mailbox has any voicemail If folder is NULL, defaults to "INBOX". If folder is "INBOX", includes the number of messages in the "Urgent" folder.
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
const ast_string_field uniqueid
struct stasis_forward * sub
Abstract JSON element (object, array, string, int, ...).
struct stasis_message_router * mwi_state_router
static void mwi_update_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
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.
The structure that contains MWI state.
#define manager_event(category, event, contents,...)
External routines may send asterisk manager events this way.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
struct stasis_message_type * ast_mwi_vm_app_type(void)
Get the Stasis Message Bus API message type for voicemail application specific messages.