summaryrefslogtreecommitdiff
path: root/res/res_mwi_external.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2014-03-14 16:01:13 +0000
committerRichard Mudgett <rmudgett@digium.com>2014-03-14 16:01:13 +0000
commit66718a06f743f7a8e1158a54239c9f9c9d877769 (patch)
tree568785f0beb298edd60c619e40bd06013790f886 /res/res_mwi_external.c
parent251868dc57b1b754efb8ec1a3f671ce785d57650 (diff)
res_mwi_external: Clear the stasis cache entry when the external MWI is deleted.
One of the things missing when external MWI support was added was the ability to clear the stasis cache entry of deleted external MWI mailboxes. Review: https://reviewboard.asterisk.org/r/3325/ ........ Merged revisions 410555 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_mwi_external.c')
-rw-r--r--res/res_mwi_external.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/res/res_mwi_external.c b/res/res_mwi_external.c
index a7531c5cb..c3fc0eaf4 100644
--- a/res/res_mwi_external.c
+++ b/res/res_mwi_external.c
@@ -123,13 +123,13 @@ static void mwi_observe_delete(const void *obj)
{
const struct ast_mwi_mailbox_object *mailbox = obj;
- if (!mailbox->msgs_new && !mailbox->msgs_old) {
- /* No need to post a count clearing event. */
- return;
+ if (mailbox->msgs_new || mailbox->msgs_old) {
+ /* Post a count clearing event. */
+ ast_publish_mwi_state(ast_sorcery_object_get_id(mailbox), NULL, 0, 0);
}
- /* Post a count clearing event. */
- ast_publish_mwi_state(ast_sorcery_object_get_id(mailbox), NULL, 0, 0);
+ /* Post a cache remove event. */
+ ast_delete_mwi_state(ast_sorcery_object_get_id(mailbox), NULL);
}
static const struct ast_sorcery_observer mwi_observers = {