[Asterisk-code-review] app stasis: Don't hang up if app is not registered (asterisk[13])

Anonymous Coward asteriskteam at digium.com
Wed Mar 16 14:15:42 CDT 2016


Anonymous Coward #1000019 has submitted this change and it was merged.

Change subject: app_stasis: Don't hang up if app is not registered
......................................................................


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
---
M apps/app_stasis.c
1 file changed, 9 insertions(+), 3 deletions(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



diff --git a/apps/app_stasis.c b/apps/app_stasis.c
index 4f53aff..1e5b567 100644
--- a/apps/app_stasis.c
+++ b/apps/app_stasis.c
@@ -110,10 +110,16 @@
 		                      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;

-- 
To view, visit https://gerrit.asterisk.org/2402
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I63216a61f30706d5362bc0906b50b6f0544aebce
Gerrit-PatchSet: 9
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Andrew Nagy <andrew.nagy at the159.com>
Gerrit-Reviewer: Andrew Nagy <andrew.nagy at the159.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-code-review mailing list