35#define MAILBOX_BUCKETS 37
102 const char *
name,
int old_messages,
int new_messages)
158 .
requires =
"res_stasis,res_mwi_external"
Persistent data storage (akin to *doze registry)
Asterisk main include file. File version handling, generic pbx functions.
#define ao2_iterator_next(iter)
struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags) attribute_warn_unused_result
Create an iterator for a container.
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.
static int array(struct ast_channel *chan, const char *cmd, char *var, const char *value)
void ast_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
int ast_json_array_append(struct ast_json *array, struct ast_json *value)
Append to an array.
struct ast_json * ast_json_pack(char const *format,...)
Helper for creating complex JSON values.
struct ast_json * ast_json_array_create(void)
Create a empty JSON array.
Asterisk module definitions.
@ AST_MODFLAG_GLOBAL_SYMBOLS
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
@ AST_MODULE_SUPPORT_CORE
#define ASTERISK_GPL_KEY
The text the key() function should return.
@ AST_MODULE_LOAD_SUCCESS
static struct stasis_rest_handlers mailboxes
REST handler for /api-docs/mailboxes.json.
Core external MWI support.
int ast_mwi_mailbox_update(struct ast_mwi_mailbox_object *mailbox)
Update the external MWI counts with the given object.
struct ast_mwi_mailbox_object * ast_mwi_mailbox_alloc(const char *mailbox_id)
Allocate an external MWI object.
int ast_mwi_mailbox_delete(const char *mailbox_id)
Delete matching external MWI object.
const struct ast_mwi_mailbox_object * ast_mwi_mailbox_get(const char *mailbox_id)
Get matching external MWI object.
const char * ast_mwi_mailbox_get_id(const struct ast_mwi_mailbox_object *mailbox)
Get mailbox id.
unsigned int ast_mwi_mailbox_get_msgs_old(const struct ast_mwi_mailbox_object *mailbox)
Get the number of old messages.
void ast_mwi_mailbox_set_msgs_new(struct ast_mwi_mailbox_object *mailbox, unsigned int num_msgs)
Set the number of new messages.
struct ao2_container * ast_mwi_mailbox_get_all(void)
Get all external MWI objects.
unsigned int ast_mwi_mailbox_get_msgs_new(const struct ast_mwi_mailbox_object *mailbox)
Get the number of new messages.
#define ast_mwi_mailbox_unref(mailbox)
Convenience unref function for mailbox object.
void ast_mwi_mailbox_set_msgs_old(struct ast_mwi_mailbox_object *mailbox, unsigned int num_msgs)
Set the number of old messages.
static struct ast_json * mailbox_to_json(const struct ast_mwi_mailbox_object *mailbox)
enum stasis_mailbox_result stasis_app_mailbox_delete(const char *name)
Delete a mailbox controlled by ARI.
enum stasis_mailbox_result stasis_app_mailbox_to_json(const char *name, struct ast_json **json)
Convert mailbox to JSON.
int stasis_app_mailbox_update(const char *name, int old_messages, int new_messages)
Changes the state of a mailbox.
struct ast_json * stasis_app_mailboxes_to_json()
Convert mailboxes to json array.
static int load_module(void)
static int unload_module(void)
Backend API for implementing components of res_stasis.
Stasis Application Mailbox API. See StasisApplication API" for detailed documentation.
When we need to walk through a container, we use an ao2_iterator to keep track of the current positio...
Abstract JSON element (object, array, string, int, ...).