Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
Core external MWI support. More...
Go to the source code of this file.
Macros | |
#define | ast_mwi_mailbox_unref(mailbox) ao2_ref((struct ast_mwi_mailbox_object *) mailbox, -1) |
Convenience unref function for mailbox object. More... | |
Functions | |
struct ast_mwi_mailbox_object * | ast_mwi_mailbox_alloc (const char *mailbox_id) |
Allocate an external MWI object. More... | |
struct ast_mwi_mailbox_object * | ast_mwi_mailbox_copy (const struct ast_mwi_mailbox_object *mailbox) |
Copy the external MWI counts object. More... | |
int | ast_mwi_mailbox_delete (const char *mailbox_id) |
Delete matching external MWI object. More... | |
int | ast_mwi_mailbox_delete_all (void) |
Delete all external MWI objects. More... | |
int | ast_mwi_mailbox_delete_by_regex (const char *regex) |
Delete all external MWI objects selected by the regular expression. More... | |
const struct ast_mwi_mailbox_object * | ast_mwi_mailbox_get (const char *mailbox_id) |
Get matching external MWI object. More... | |
struct ao2_container * | ast_mwi_mailbox_get_all (void) |
Get all external MWI objects. More... | |
struct ao2_container * | ast_mwi_mailbox_get_by_regex (const char *regex) |
Get all external MWI objects selected by the regular expression. More... | |
const char * | ast_mwi_mailbox_get_id (const struct ast_mwi_mailbox_object *mailbox) |
Get mailbox id. More... | |
unsigned int | ast_mwi_mailbox_get_msgs_new (const struct ast_mwi_mailbox_object *mailbox) |
Get the number of new messages. More... | |
unsigned int | ast_mwi_mailbox_get_msgs_old (const struct ast_mwi_mailbox_object *mailbox) |
Get the number of old messages. More... | |
void | ast_mwi_mailbox_set_msgs_new (struct ast_mwi_mailbox_object *mailbox, unsigned int num_msgs) |
Set the number of new messages. More... | |
void | ast_mwi_mailbox_set_msgs_old (struct ast_mwi_mailbox_object *mailbox, unsigned int num_msgs) |
Set the number of old messages. More... | |
int | ast_mwi_mailbox_update (struct ast_mwi_mailbox_object *mailbox) |
Update the external MWI counts with the given object. More... | |
#define ast_mwi_mailbox_unref | ( | mailbox | ) | ao2_ref((struct ast_mwi_mailbox_object *) mailbox, -1) |
Convenience unref function for mailbox object.
Definition at line 42 of file res_mwi_external.h.
struct ast_mwi_mailbox_object * ast_mwi_mailbox_alloc | ( | const char * | mailbox_id | ) |
Allocate an external MWI object.
mailbox_id | Name of mailbox. |
NULL | on error. |
Definition at line 192 of file res_mwi_external.c.
References ast_sorcery_alloc(), ast_strlen_zero(), MWI_MAILBOX_TYPE, mwi_sorcery, and NULL.
Referenced by mwi_mailbox_update(), and stasis_app_mailbox_update().
struct ast_mwi_mailbox_object * ast_mwi_mailbox_copy | ( | const struct ast_mwi_mailbox_object * | mailbox | ) |
Copy the external MWI counts object.
mailbox | What to copy. |
NULL | on error. |
Definition at line 201 of file res_mwi_external.c.
References ast_sorcery_copy(), voicemailpwcheck::mailbox, and mwi_sorcery.
int ast_mwi_mailbox_delete | ( | const char * | mailbox_id | ) |
Delete matching external MWI object.
mailbox_id | Name of mailbox to delete. |
0 | on success. |
-1 | on error. |
Definition at line 302 of file res_mwi_external.c.
References ast_mwi_mailbox_get(), ast_mwi_mailbox_unref, ast_strlen_zero(), voicemailpwcheck::mailbox, and mwi_mailbox_delete().
Referenced by mwi_mailbox_delete(), and stasis_app_mailbox_delete().
int ast_mwi_mailbox_delete_all | ( | void | ) |
Delete all external MWI objects.
0 | on success. |
-1 | on error. |
Definition at line 278 of file res_mwi_external.c.
References ao2_ref, ast_mwi_mailbox_get_all(), mailboxes, and mwi_mailbox_delete_all().
int ast_mwi_mailbox_delete_by_regex | ( | const char * | regex | ) |
Delete all external MWI objects selected by the regular expression.
regex | Regular expression in extended syntax. (NULL is same as "") |
0 | on success. |
-1 | on error. |
Definition at line 290 of file res_mwi_external.c.
References ao2_ref, ast_mwi_mailbox_get_by_regex(), mailboxes, mwi_mailbox_delete_all(), and regex().
Referenced by mwi_mailbox_delete().
const struct ast_mwi_mailbox_object * ast_mwi_mailbox_get | ( | const char * | mailbox_id | ) |
Get matching external MWI object.
mailbox_id | Name of mailbox to retrieve. |
NULL | on error or no mailbox. |
Definition at line 183 of file res_mwi_external.c.
References ast_sorcery_retrieve_by_id(), ast_strlen_zero(), MWI_MAILBOX_TYPE, mwi_sorcery, and NULL.
Referenced by ast_mwi_mailbox_delete(), mwi_has_voicemail(), mwi_inboxcount(), mwi_mailbox_get(), mwi_messagecount(), stasis_app_mailbox_delete(), and stasis_app_mailbox_to_json().
struct ao2_container * ast_mwi_mailbox_get_all | ( | void | ) |
Get all external MWI objects.
NULL | on error. |
Definition at line 172 of file res_mwi_external.c.
References AST_RETRIEVE_FLAG_ALL, AST_RETRIEVE_FLAG_MULTIPLE, ast_sorcery_retrieve_by_fields(), MWI_MAILBOX_TYPE, mwi_sorcery, and NULL.
Referenced by ast_mwi_mailbox_delete_all(), mwi_initial_events(), and stasis_app_mailboxes_to_json().
struct ao2_container * ast_mwi_mailbox_get_by_regex | ( | const char * | regex | ) |
Get all external MWI objects selected by the regular expression.
regex | Regular expression in extended syntax. (NULL is same as "") |
NULL | on error. |
Definition at line 178 of file res_mwi_external.c.
References ast_sorcery_retrieve_by_regex(), MWI_MAILBOX_TYPE, mwi_sorcery, and regex().
Referenced by ast_mwi_mailbox_delete_by_regex(), and mwi_mailbox_get().
const char * ast_mwi_mailbox_get_id | ( | const struct ast_mwi_mailbox_object * | mailbox | ) |
Get mailbox id.
mailbox | Object to get id. |
Definition at line 206 of file res_mwi_external.c.
References ast_sorcery_object_get_id(), and voicemailpwcheck::mailbox.
Referenced by mailbox_to_json(), and mwi_mailbox_get().
unsigned int ast_mwi_mailbox_get_msgs_new | ( | const struct ast_mwi_mailbox_object * | mailbox | ) |
Get the number of new messages.
mailbox | Object to get number of new messages. |
Definition at line 211 of file res_mwi_external.c.
References voicemailpwcheck::mailbox.
Referenced by mailbox_to_json(), and mwi_mailbox_get().
unsigned int ast_mwi_mailbox_get_msgs_old | ( | const struct ast_mwi_mailbox_object * | mailbox | ) |
Get the number of old messages.
mailbox | Object to get number of old messages. |
Definition at line 216 of file res_mwi_external.c.
References voicemailpwcheck::mailbox.
Referenced by mailbox_to_json(), and mwi_mailbox_get().
void ast_mwi_mailbox_set_msgs_new | ( | struct ast_mwi_mailbox_object * | mailbox, |
unsigned int | num_msgs | ||
) |
Set the number of new messages.
mailbox | Object to set number of new messages. |
num_msgs | Number of messages to set. |
Definition at line 221 of file res_mwi_external.c.
References voicemailpwcheck::mailbox.
Referenced by mwi_mailbox_update(), and stasis_app_mailbox_update().
void ast_mwi_mailbox_set_msgs_old | ( | struct ast_mwi_mailbox_object * | mailbox, |
unsigned int | num_msgs | ||
) |
Set the number of old messages.
mailbox | Object to set number of old messages. |
num_msgs | Number of messages to set. |
Definition at line 226 of file res_mwi_external.c.
References voicemailpwcheck::mailbox.
Referenced by mwi_mailbox_update(), and stasis_app_mailbox_update().
int ast_mwi_mailbox_update | ( | struct ast_mwi_mailbox_object * | mailbox | ) |
Update the external MWI counts with the given object.
mailbox | What to update. |
0 | on success. |
-1 | on error. |
Definition at line 231 of file res_mwi_external.c.
References ast_mwi_mailbox_unref, ast_sorcery_create(), ast_sorcery_object_get_id(), ast_sorcery_retrieve_by_id(), ast_sorcery_update(), exists(), voicemailpwcheck::mailbox, MWI_MAILBOX_TYPE, and mwi_sorcery.
Referenced by mwi_mailbox_update(), and stasis_app_mailbox_update().