app.c: Remove deletion of pool topic on mwi state delete
authorGeorge Joseph <gjoseph@digium.com>
Fri, 8 Mar 2019 15:40:38 +0000 (08:40 -0700)
committerSean Bright <sean.bright@gmail.com>
Thu, 14 Mar 2019 14:31:32 +0000 (08:31 -0600)
commit63d90c38ebe3e0774f372d745598d768490667ea
tree8dd91a0f56b9c95b46ce439d3838aaa86f4f2534
parenta145f83d30d03b1e55ceb0b31f396b4d9f13d697
app.c:  Remove deletion of pool topic on mwi state delete

As part of an earlier voicemail refactor, ast_delete_mwi_state_full
was modified to remove the pool topic for a mailbox when the state
was deleted.  This was an attempt to prevent stale topics from
accumulating when app_voicemail was reloaded and a mailbox went
away.  Unfortunately because of the fact that when app_voicemail
reloads, ALL mailboxes are deleted then only current ones recreated,
topics were being removed from the pool that still had subscribers
on them, then recreated as new topics of the same name.  So now
modules like res_pjsip_mwi are listening on a topic that will
never receive any messages because app_voicemail is publishing on
a different topic that happens to have the same name.  The solutiuon
to this is not easy and given that accumulating topics for
deleted mailboxes is less evil that not sending NOTIFYs...

* Removed the call to stasis_topic_pool_delete_topic in
  ast_delete_mwi_state_full.

Also:

* Fixed a topic reference leak in res_pjsip_mwi
  mwi_stasis_subscription_alloc.

* Added some debugging to mwi_stasis_subscription_alloc,
  stasis_topic_create, and topic_dtor.

* Fixed a topic reference leak in an error path in
  internal_stasis_subscribe.

ASTERISK-28306
Reported-by: Jared Hull

Change-Id: Id7da0990b3ac4be4b58491536b35f41291247b27
main/app.c
main/stasis.c
res/res_pjsip_mwi.c