[asterisk-commits] branch 1.2 r29196 - /branches/1.2/res/res_features.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sun May 21 08:16:59 MST 2006


Author: bweschke
Date: Sun May 21 10:16:59 2006
New Revision: 29196

URL: http://svn.digium.com/view/asterisk?rev=29196&view=rev
Log:
 When an application that is executed via applicationmap and exits non-zero, make sure that we pass through the correct return value from the application to make sure a segfault doesn't occur by a bridge trying to continue when it should not. Also, when executing applications via applicationmap, make sure that the application is executed against the channel whose DTMF caused it to be fired off in the first place. (part 1/2 of #7090 - this is the only fix that will be applied to both 1.2 and /trunk) acunningham and blitzrage on testing...


Modified:
    branches/1.2/res/res_features.c

Modified: branches/1.2/res/res_features.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/res/res_features.c?rev=29196&r1=29195&r2=29196&view=diff
==============================================================================
--- branches/1.2/res/res_features.c (original)
+++ branches/1.2/res/res_features.c Sun May 21 10:16:59 2006
@@ -944,8 +944,12 @@
 		if (ast_test_flag(feature, AST_FEATURE_FLAG_CALLEE))
 			work = peer;
 		res = pbx_exec(work, app, feature->app_args, 1);
-		if (res < 0)
-			return res; 
+		if (res == AST_PBX_KEEPALIVE)
+			return FEATURE_RETURN_PBX_KEEPALIVE;
+		else if (res == AST_PBX_NO_HANGUP_PEER)
+			return FEATURE_RETURN_NO_HANGUP_PEER;
+		else if (res)
+			return FEATURE_RETURN_SUCCESSBREAK;
 	} else {
 		ast_log(LOG_WARNING, "Could not find application (%s)\n", feature->app);
 		return -2;
@@ -1021,7 +1025,10 @@
 				if (!strcmp(feature->exten, code)) {
 					if (option_verbose > 2)
 						ast_verbose(VERBOSE_PREFIX_3 " Feature Found: %s exten: %s\n",feature->sname, tok);
-					res = feature->operation(chan, peer, config, code, sense);
+					if (sense == FEATURE_SENSE_CHAN)
+						res = feature->operation(chan, peer, config, code, sense);
+					else
+						res = feature->operation(peer, chan, config, code, sense);
 					break;
 				} else if (!strncmp(feature->exten, code, strlen(code))) {
 					res = FEATURE_RETURN_STOREDIGITS;



More information about the asterisk-commits mailing list