summaryrefslogtreecommitdiff
path: root/apps/app_stasis.c
diff options
context:
space:
mode:
authorAndrew Nagy <andrew.nagy@the159.com>2016-03-15 11:31:19 -0700
committerRichard Mudgett <rmudgett@digium.com>2016-03-16 11:18:28 -0500
commit7964e260d364dd0bf57677e418de67b46fae1700 (patch)
tree942eac138f6e74731ee1f1251c2cdb994526df32 /apps/app_stasis.c
parentb56718140235b4dd6ddba9bcac707a1209f6433c (diff)
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
Diffstat (limited to 'apps/app_stasis.c')
-rw-r--r--apps/app_stasis.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/apps/app_stasis.c b/apps/app_stasis.c
index aa77a0d3c..ffe472779 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;