mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
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/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410555 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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 = {
|
||||
|
Reference in New Issue
Block a user