[asterisk-commits] trunk r21595 - /trunk/apps/app_dial.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Apr 19 11:07:21 MST 2006


Author: rizzo
Date: Wed Apr 19 13:07:19 2006
New Revision: 21595

URL: http://svn.digium.com/view/asterisk?rev=21595&view=rev
Log:
merge two nested 'if' which are really a single block.


Modified:
    trunk/apps/app_dial.c

Modified: trunk/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_dial.c?rev=21595&r1=21594&r2=21595&view=diff
==============================================================================
--- trunk/apps/app_dial.c (original)
+++ trunk/apps/app_dial.c Wed Apr 19 13:07:19 2006
@@ -1393,6 +1393,7 @@
 
 		if (ast_test_flag(&opts, OPT_CALLEE_MACRO) && !ast_strlen_zero(opt_args[OPT_ARG_CALLEE_MACRO])) {
 			struct ast_app *theapp;
+			const char *macro_result;
 
 			res = ast_autoservice_start(chan);
 			if (res) {
@@ -1417,9 +1418,7 @@
 				res = -1;
 			}
 
-			if (!res) {
-				const char *macro_result;
-				if ((macro_result = pbx_builtin_getvar_helper(peer, "MACRO_RESULT"))) {
+			if (!res && (macro_result = pbx_builtin_getvar_helper(peer, "MACRO_RESULT"))) {
 					char *macro_transfer_dest;
 
 					if (!strcasecmp(macro_result, "BUSY")) {
@@ -1431,13 +1430,11 @@
 						} else
 							ast_set_flag(peerflags, OPT_GO_ON);
 						res = -1;
-					}
-					else if (!strcasecmp(macro_result, "CONGESTION") || !strcasecmp(macro_result, "CHANUNAVAIL")) {
+					} else if (!strcasecmp(macro_result, "CONGESTION") || !strcasecmp(macro_result, "CHANUNAVAIL")) {
 						ast_copy_string(status, macro_result, sizeof(status));
 						ast_set_flag(peerflags, OPT_GO_ON);	
 						res = -1;
-					}
-					else if (!strcasecmp(macro_result, "CONTINUE")) {
+					} else if (!strcasecmp(macro_result, "CONTINUE")) {
 						/* hangup peer and keep chan alive assuming the macro has changed 
 						   the context / exten / priority or perhaps 
 						   the next priority in the current exten is desired.
@@ -1457,7 +1454,6 @@
 
 						}
 					}
-				}
 			}
 		}
 



More information about the asterisk-commits mailing list