From: Andrew Nagy Date: Tue, 15 Mar 2016 18:31:19 +0000 (-0700) Subject: app_stasis: Don't hang up if app is not registered X-Git-Tag: 14.0.0-beta1~345^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7964e260d364dd0bf57677e418de67b46fae1700;p=thirdparty%2Fasterisk.git app_stasis: Don't hang up if app is not registered This prevents pbx_core from hanging up the channel if the app isn't registered. ASTERISK-25846 #close Change-Id: I63216a61f30706d5362bc0906b50b6f0544aebce --- diff --git a/apps/app_stasis.c b/apps/app_stasis.c index aa77a0d3c3..ffe4727794 100644 --- a/apps/app_stasis.c +++ b/apps/app_stasis.c @@ -110,10 +110,16 @@ static int app_exec(struct ast_channel *chan, const char *data) args.app_argv); } - if (ret == -1) { - pbx_builtin_setvar_helper(chan, "STASISSTATUS", "FAILED"); + if (ret) { + /* set ret to 0 so pbx_core doesnt hangup the channel */ + if (!ast_check_hangup(chan)) { + ret = 0; + } else { + ret = -1; + } + pbx_builtin_setvar_helper(chan, "STASISSTATUS", "FAILED"); } else { - pbx_builtin_setvar_helper(chan, "STASISSTATUS", "SUCCESS"); + pbx_builtin_setvar_helper(chan, "STASISSTATUS", "SUCCESS"); } return ret;