diff options
author | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-04-19 18:07:19 +0000 |
---|---|---|
committer | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-04-19 18:07:19 +0000 |
commit | 87ebbc874184dfdf78326765d70ddb8b7a405875 (patch) | |
tree | 995e4f1519503c0e4513025c28b77ac2e372b893 /apps/app_dial.c | |
parent | 666223ee12cc512da6c6a9bd8bbaafe5a5964496 (diff) |
merge two nested 'if' which are really a single block.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@21595 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_dial.c')
-rw-r--r-- | apps/app_dial.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c index 941c48399..637dbc0c8 100644 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -1393,6 +1393,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags 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 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags 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 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags } 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 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags } } - } } } |