| Asterisk - The Open Source Telephony Project GIT-master-27fb039
    | 
#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. | |
| 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 | 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 = ASTERISK_GPL_KEY , .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 | 
| 
 | 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, name, 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_to_json(), name, 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 | 
| 0 | if successful | 
| -1 | on internal error. | 
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 name.
Referenced by ast_ari_mailboxes_update().
| struct ast_json * stasis_app_mailboxes_to_json | ( | void | ) | 
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_to_json(), mailboxes, and NULL.
Referenced by ast_ari_mailboxes_list().
| 
 | static | 
Definition at line 149 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.