summaryrefslogtreecommitdiff
path: root/res/res_stasis.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2016-03-28 18:10:40 -0500
committerRichard Mudgett <rmudgett@digium.com>2016-03-30 16:36:20 -0500
commit53f63ad7704b1b1f2b1465a23f89900266fc8115 (patch)
tree7c8bc907541ccdf1bd39cc38f8f0b4bc3897e3be /res/res_stasis.c
parent23d2a561d55bc226414dc839544138d77b49adfa (diff)
res_stasis: Fix crash on a hanging up channel.
* Give the struct stasis_app_control ao2 object a ref to the channel held in the object. Now the channel will still be around if a thread needs to post a stasis message instead of crash because the topic was destroyed. * Moved stopping any lingering silence generator out of the struct stasis_app_control destructor and made it a part of exiting the Stasis application. Who knows which thread the destructor will be called under so it cannot affect the channel's silence generator. Not only was the channel unprotected when the silence generator was stopped, stasis may no longer even control the channel. ASTERISK-25882 Change-Id: I21728161b5fe638cef7976fa36a605043a7497e4
Diffstat (limited to 'res/res_stasis.c')
-rw-r--r--res/res_stasis.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/res/res_stasis.c b/res/res_stasis.c
index 63c565d44..dc469c8cc 100644
--- a/res/res_stasis.c
+++ b/res/res_stasis.c
@@ -1371,6 +1371,9 @@ int stasis_app_exec(struct ast_channel *chan, const char *app_name, int argc,
remove_stasis_end_published(chan);
}
+ /* Stop any lingering silence generator */
+ control_silence_stop_now(control);
+
/* There's an off chance that app is ready for cleanup. Go ahead
* and clean up, just in case
*/