]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
app_stasis: Don't hang up if app is not registered 17/2417/6
authorAndrew Nagy <andrew.nagy@the159.com>
Tue, 15 Mar 2016 18:31:19 +0000 (11:31 -0700)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 16 Mar 2016 16:18:28 +0000 (11:18 -0500)
This prevents pbx_core from hanging up the channel if the app isn't
registered.

ASTERISK-25846 #close

Change-Id: I63216a61f30706d5362bc0906b50b6f0544aebce

apps/app_stasis.c

index aa77a0d3c38070cf5a83a02d002aed058fda1e39..ffe4727794a74d4e5a97a3f382b8ed2e37ffc486 100644 (file)
@@ -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;