Merged revisions 53133 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r53133 | russell | 2007-02-03 14:38:13 -0600 (Sat, 03 Feb 2007) | 4 lines

set the DIALSTATUS variable to contain "INVALIDARGS" when the dial application
exits early because of invalid arguments instead of just leaving it empty.
(issue #8975)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53136 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2007-02-03 20:44:20 +00:00
parent ab3a5d6542
commit 8f04a45ee9

View File

@@ -82,7 +82,7 @@ static char *descrip =
" ANSWEREDTIME - This is the amount of time for actual call.\n" " ANSWEREDTIME - This is the amount of time for actual call.\n"
" DIALSTATUS - This is the status of the call:\n" " DIALSTATUS - This is the status of the call:\n"
" CHANUNAVAIL | CONGESTION | NOANSWER | BUSY | ANSWER | CANCEL\n" " CHANUNAVAIL | CONGESTION | NOANSWER | BUSY | ANSWER | CANCEL\n"
" DONTCALL | TORTURE\n" " DONTCALL | TORTURE | INVALIDARGS\n"
" For the Privacy and Screening Modes, the DIALSTATUS variable will be set to\n" " For the Privacy and Screening Modes, the DIALSTATUS variable will be set to\n"
"DONTCALL if the called party chooses to send the calling party to the 'Go Away'\n" "DONTCALL if the called party chooses to send the calling party to the 'Go Away'\n"
"script. The DIALSTATUS variable will be set to TORTURE if the called party\n" "script. The DIALSTATUS variable will be set to TORTURE if the called party\n"
@@ -793,7 +793,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
const char *end_sound = NULL; const char *end_sound = NULL;
const char *start_sound = NULL; const char *start_sound = NULL;
char *dtmfcalled = NULL, *dtmfcalling = NULL; char *dtmfcalled = NULL, *dtmfcalling = NULL;
char status[256]; char status[256] = "INVALIDARGS";
int play_to_caller = 0, play_to_callee = 0; int play_to_caller = 0, play_to_callee = 0;
int sentringing = 0, moh = 0; int sentringing = 0, moh = 0;
const char *outbound_group = NULL; const char *outbound_group = NULL;
@@ -814,21 +814,25 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
if (ast_strlen_zero(data)) { if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "Dial requires an argument (technology/number)\n"); ast_log(LOG_WARNING, "Dial requires an argument (technology/number)\n");
pbx_builtin_setvar_helper(chan, "DIALSTATUS", status);
return -1; return -1;
} }
u = ast_module_user_add(chan); u = ast_module_user_add(chan);
parse = ast_strdupa(data); parse = ast_strdupa(data);
AST_STANDARD_APP_ARGS(args, parse); AST_STANDARD_APP_ARGS(args, parse);
if (!ast_strlen_zero(args.options) && if (!ast_strlen_zero(args.options) &&
ast_app_parse_options(dial_exec_options, &opts, opt_args, args.options)) ast_app_parse_options(dial_exec_options, &opts, opt_args, args.options)) {
pbx_builtin_setvar_helper(chan, "DIALSTATUS", status);
goto done; goto done;
}
if (ast_strlen_zero(args.peers)) { if (ast_strlen_zero(args.peers)) {
ast_log(LOG_WARNING, "Dial requires an argument (technology/number)\n"); ast_log(LOG_WARNING, "Dial requires an argument (technology/number)\n");
pbx_builtin_setvar_helper(chan, "DIALSTATUS", status);
goto done; goto done;
} }
@@ -844,6 +848,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
calldurationlimit = atoi(opt_args[OPT_ARG_DURATION_STOP]); calldurationlimit = atoi(opt_args[OPT_ARG_DURATION_STOP]);
if (!calldurationlimit) { if (!calldurationlimit) {
ast_log(LOG_WARNING, "Dial does not accept S(%s), hanging up.\n", opt_args[OPT_ARG_DURATION_STOP]); ast_log(LOG_WARNING, "Dial does not accept S(%s), hanging up.\n", opt_args[OPT_ARG_DURATION_STOP]);
pbx_builtin_setvar_helper(chan, "DIALSTATUS", status);
goto done; goto done;
} }
if (option_verbose > 2) if (option_verbose > 2)