Asterisk - The Open Source Telephony Project
18.5.0
|
#include "asterisk.h"
#include "asterisk/astdb.h"
#include "asterisk/astobj2.h"
#include "asterisk/module.h"
#include "asterisk/stasis_app_impl.h"
#include "asterisk/stasis_app_mailbox.h"
#include "asterisk/res_mwi_external.h"
Go to the source code of this file.
Macros | |
#define | MAILBOX_BUCKETS 37 |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static int | load_module (void) |
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. More... | |
enum stasis_mailbox_result | stasis_app_mailbox_to_json (const char *name, struct ast_json **json) |
Convert mailbox to JSON. More... | |
int | stasis_app_mailbox_update (const char *name, int old_messages, int new_messages) |
Changes the state of a mailbox. More... | |
struct ast_json * | stasis_app_mailboxes_to_json () |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_GLOBAL_SYMBOLS , .description = "Stasis application mailbox support" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .requires = "res_stasis,res_mwi_external" } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
#define MAILBOX_BUCKETS 37 |
Number of hash buckets for mailboxes
Definition at line 35 of file res_stasis_mailbox.c.
|
static |
Definition at line 159 of file res_stasis_mailbox.c.
|
static |
Definition at line 159 of file res_stasis_mailbox.c.
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 159 of file res_stasis_mailbox.c.
|
static |
Definition at line 144 of file res_stasis_mailbox.c.
References AST_MODULE_LOAD_SUCCESS.
Referenced by unload_module().
|
static |
Definition at line 37 of file res_stasis_mailbox.c.
References ast_json_pack(), ast_mwi_mailbox_get_id(), ast_mwi_mailbox_get_msgs_new(), and ast_mwi_mailbox_get_msgs_old().
Referenced by stasis_app_mailbox_to_json(), and stasis_app_mailboxes_to_json().
enum stasis_mailbox_result stasis_app_mailbox_delete | ( | const char * | name | ) |
Delete a mailbox controlled by ARI.
name | the name of the ARI controlled mailbox |
Definition at line 122 of file res_stasis_mailbox.c.
References ast_mwi_mailbox_delete(), ast_mwi_mailbox_get(), ast_mwi_mailbox_unref, mailbox, NULL, STASIS_MAILBOX_ERROR, STASIS_MAILBOX_MISSING, and STASIS_MAILBOX_OK.
Referenced by ast_ari_mailboxes_delete().
enum stasis_mailbox_result stasis_app_mailbox_to_json | ( | const char * | name, |
struct ast_json ** | json | ||
) |
Convert mailbox to JSON.
name | the name of the mailbox |
json | If the query is successful, this pointer at this address will be set to the JSON representation of the mailbox |
NULL
on error. Definition at line 46 of file res_stasis_mailbox.c.
References ast_mwi_mailbox_get(), ast_mwi_mailbox_unref, mailbox, mailbox_to_json(), STASIS_MAILBOX_ERROR, STASIS_MAILBOX_MISSING, and STASIS_MAILBOX_OK.
Referenced by ast_ari_mailboxes_get().
int stasis_app_mailbox_update | ( | const char * | name, |
int | old_messages, | ||
int | new_messages | ||
) |
Changes the state of a mailbox.
name | The name of the ARI controlled mailbox |
old_messages | count of old (read) messages in the mailbox |
new_messages | count of new (unread) messages in the mailbox |
Definition at line 101 of file res_stasis_mailbox.c.
References ast_mwi_mailbox_alloc(), ast_mwi_mailbox_set_msgs_new(), ast_mwi_mailbox_set_msgs_old(), ast_mwi_mailbox_unref, ast_mwi_mailbox_update(), and mailbox.
Referenced by ast_ari_mailboxes_update().
struct ast_json* stasis_app_mailboxes_to_json | ( | void | ) |
brief Convert mailboxes to json array
NULL
on error. Definition at line 68 of file res_stasis_mailbox.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, array(), ast_json_array_append(), ast_json_array_create(), ast_json_unref(), ast_mwi_mailbox_get_all(), ast_mwi_mailbox_unref, mailbox, mailbox_to_json(), mailboxes, and NULL.
Referenced by ast_ari_mailboxes_list().
|
static |
Definition at line 149 of file res_stasis_mailbox.c.
References AST_MODFLAG_GLOBAL_SYMBOLS, AST_MODULE_INFO(), AST_MODULE_SUPPORT_CORE, ASTERISK_GPL_KEY, and load_module().
|
static |
Definition at line 159 of file res_stasis_mailbox.c.
|
static |
Definition at line 159 of file res_stasis_mailbox.c.