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