summaryrefslogtreecommitdiff
path: root/res/res_stasis.c
diff options
context:
space:
mode:
authorJonathan Rose <jrose@digium.com>2014-08-22 16:52:51 +0000
committerJonathan Rose <jrose@digium.com>2014-08-22 16:52:51 +0000
commit33835e17a08641f3b54a9293a13a08ca30b43fd6 (patch)
tree484add3c1ec136e31d2fb1e0f2afcda4b005efe3 /res/res_stasis.c
parent1498ae0830d946a9b8185131d510b1b864fd3d11 (diff)
ARI: Fix a crash caused by hanging during playback to a channel in a bridge
ASTERISK-24147 #close Reported by: Edvin Vidmar Review: https://reviewboard.asterisk.org/r/3908/ ........ Merged revisions 421879 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 421880 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421881 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_stasis.c')
-rw-r--r--res/res_stasis.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/res/res_stasis.c b/res/res_stasis.c
index 7e7904cae..f2abaf770 100644
--- a/res/res_stasis.c
+++ b/res/res_stasis.c
@@ -1190,6 +1190,7 @@ int stasis_app_exec(struct ast_channel *chan, const char *app_name, int argc,
RAII_VAR(struct stasis_app_control *, control, NULL, control_unlink);
struct ast_bridge *bridge = NULL;
int res = 0;
+ int needs_depart;
ast_assert(chan != NULL);
@@ -1305,6 +1306,13 @@ int stasis_app_exec(struct ast_channel *chan, const char *app_name, int argc,
}
}
+ ast_channel_lock(chan);
+ needs_depart = ast_channel_is_bridged(chan);
+ ast_channel_unlock(chan);
+ if (needs_depart) {
+ ast_bridge_depart(chan);
+ }
+
app_unsubscribe_bridge(app, stasis_app_get_bridge(control));
ao2_cleanup(bridge);