summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorJonathan Rose <jrose@digium.com>2014-08-19 16:28:31 +0000
committerJonathan Rose <jrose@digium.com>2014-08-19 16:28:31 +0000
commit5c35544a2306384b5018f5e16ab15cc4fea3783d (patch)
tree1d6bf7765859654e7a5e41ae9c49fee6cf501490 /res
parent3b5127ba6966679d4ee10ca756cdd065afbdfebc (diff)
ARI: Fix a bug where /channels/{channelID}/continue doesn't execute PBX
If /channels/{channelID}/continue is called on a channel that was originated without a PBX (such as the ARI command POST channel with a stasis application argument), the channel will not start dialplan execution. This patch will now run the PBX out of the stasis execution if the channel doesn't currently have an active PBX upon continuing. ASTERISK-24043 #close Reported by: Krandon Bruse Review: https://reviewboard.asterisk.org/r/3917/ Patches: stasis-continue.diff submitted by Krandon Bruse (license 6631) ........ Merged revisions 421416 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@421423 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rw-r--r--res/res_stasis.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/res/res_stasis.c b/res/res_stasis.c
index 4bf9e4932..b03da0169 100644
--- a/res/res_stasis.c
+++ b/res/res_stasis.c
@@ -1327,6 +1327,22 @@ int stasis_app_exec(struct ast_channel *chan, const char *app_name, int argc,
*/
cleanup();
+ /* The control needs to be removed from the controls container in
+ * case a new PBX is started and ends up coming back into Stasis.
+ */
+ ao2_cleanup(app);
+ app = NULL;
+ control_unlink(control);
+ control = NULL;
+
+ if (!ast_check_hangup_locked(chan) && !ast_channel_pbx(chan)) {
+ struct ast_pbx_args pbx_args = {
+ .no_hangup_chan = 1,
+ };
+
+ res = ast_pbx_run_args(chan, &pbx_args);
+ }
+
return res;
}