[Asterisk-code-review] ASTERISK-25846 return 0 when/if the app fails (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Tue Mar 15 14:06:24 CDT 2016


Richard Mudgett has posted comments on this change.

Change subject: ASTERISK-25846 return 0 when/if the app fails
......................................................................


Patch Set 1: Code-Review-1

(2 comments)

https://gerrit.asterisk.org/#/c/2402/1//COMMIT_MSG
Commit Message:

Line 7: ASTERISK-25846 return 0 when/if the app fails
Need to look at the link for how to do a commit message.
https://wiki.asterisk.org/wiki/display/AST/Commit+Messages


https://gerrit.asterisk.org/#/c/2402/1/apps/app_stasis.c
File apps/app_stasis.c:

Line 113: 	if (ret == -1) {
        : 			/* set ret to 0 so pbx_core doesnt hangup the channel */		
        : 	    ret = 0; 
        : 			pbx_builtin_setvar_helper(chan, "STASISSTATUS", "FAILED");
Silly stasis_app_exec can return other non-zero values than -1 because of error.  Looking at what it can return (-2, -1, 0, 1) it should be documented as nonzero for error.

* That being said, the if test needs to be if (ret) {}.

* You need to check if chan really has hungup and return -1.  (use ast_check_hangup())

* You have red blobs and inconsistent indention.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I63216a61f30706d5362bc0906b50b6f0544aebce
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Andrew Nagy <andrew.nagy at the159.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list