Index: apps/app_dial.c =================================================================== --- apps/app_dial.c (revision 242606) +++ apps/app_dial.c (working copy) @@ -2090,17 +2090,16 @@ struct ast_app *theapp; const char *gosub_result; char *gosub_args, *gosub_argstart; - int res9 = -1; - res9 = ast_autoservice_start(chan); - if (res9) { + res = ast_autoservice_start(chan); + if (res) { ast_log(LOG_ERROR, "Unable to start autoservice on calling channel\n"); - res9 = -1; + res = -1; } theapp = pbx_findapp("Gosub"); - if (theapp && !res9) { + if (theapp && !res) { replace_macro_delimiter(opt_args[OPT_ARG_CALLEE_GOSUB]); /* Set where we came from */ @@ -2124,8 +2123,8 @@ } if (gosub_args) { - res9 = pbx_exec(peer, theapp, gosub_args); - if (!res9) { + res = pbx_exec(peer, theapp, gosub_args); + if (!res) { struct ast_pbx_args args; /* A struct initializer fails to compile for this case ... */ memset(&args, 0, sizeof(args)); @@ -2133,46 +2132,46 @@ ast_pbx_run_args(peer, &args); } ast_free(gosub_args); - ast_debug(1, "Gosub exited with status %d\n", res9); + ast_debug(1, "Gosub exited with status %d\n", res); } else { ast_log(LOG_ERROR, "Could not Allocate string for Gosub arguments -- Gosub Call Aborted!\n"); } - } else if (!res9) { + } else if (!res) { ast_log(LOG_ERROR, "Could not find application Gosub\n"); - res9 = -1; + res = -1; } if (ast_autoservice_stop(chan) < 0) { ast_log(LOG_ERROR, "Could not stop autoservice on calling channel\n"); - res9 = -1; + res = -1; } ast_channel_lock(peer); - if (!res9 && (gosub_result = pbx_builtin_getvar_helper(peer, "GOSUB_RESULT"))) { + if (!res && (gosub_result = pbx_builtin_getvar_helper(peer, "GOSUB_RESULT"))) { char *gosub_transfer_dest; if (!strcasecmp(gosub_result, "BUSY")) { ast_copy_string(pa.status, gosub_result, sizeof(pa.status)); ast_set_flag64(peerflags, OPT_GO_ON); - res9 = -1; + res = -1; } else if (!strcasecmp(gosub_result, "CONGESTION") || !strcasecmp(gosub_result, "CHANUNAVAIL")) { ast_copy_string(pa.status, gosub_result, sizeof(pa.status)); ast_set_flag64(peerflags, OPT_GO_ON); - res9 = -1; + res = -1; } else if (!strcasecmp(gosub_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. */ ast_set_flag64(peerflags, OPT_GO_ON); - res9 = -1; + res = -1; } else if (!strcasecmp(gosub_result, "ABORT")) { /* Hangup both ends unless the caller has the g flag */ - res9 = -1; + res = -1; } else if (!strncasecmp(gosub_result, "GOTO:", 5) && (gosub_transfer_dest = ast_strdupa(gosub_result + 5))) { - res9 = -1; + res = -1; /* perform a transfer to a new extension */ if (strchr(gosub_transfer_dest, '^')) { /* context^exten^priority*/ replace_macro_delimiter(gosub_transfer_dest);