aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_dial.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-02-03 20:38:13 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-02-03 20:38:13 +0000
commita0b795f0812a231bc7a0c097931f5cc8d51333d2 (patch)
tree2f5ac9dbc27e12f1fe4c415ab79132b90a09856d /apps/app_dial.c
parent8d68ea3d42ef1bcecf2a8f23ab73e875cc529132 (diff)
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: http://svn.digium.com/svn/asterisk/branches/1.2@53133 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_dial.c')
-rw-r--r--apps/app_dial.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 522c47a3f..69b5813d3 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -80,7 +80,7 @@ static char *descrip =
" ANSWEREDTIME - This is the amount of time for actual call.\n"
" DIALSTATUS - This is the status of the call:\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"
"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"
@@ -759,7 +759,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
char *start_sound=NULL;
char *dtmfcalled=NULL, *dtmfcalling=NULL;
char *var;
- char status[256];
+ char status[256] = "INVALIDARGS";
int play_to_caller=0,play_to_callee=0;
int sentringing=0, moh=0;
char *outbound_group = NULL;
@@ -780,21 +780,19 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "Dial requires an argument (technology/number)\n");
+ pbx_builtin_setvar_helper(chan, "DIALSTATUS", status);
return -1;
}
LOCAL_USER_ADD(u);
- if (!(parse = ast_strdupa(data))) {
- ast_log(LOG_WARNING, "Memory allocation failure\n");
- LOCAL_USER_REMOVE(u);
- return -1;
- }
+ parse = ast_strdupa(data);
AST_STANDARD_APP_ARGS(args, parse);
if (!ast_strlen_zero(args.options)) {
if (ast_app_parse_options(dial_exec_options, &opts, opt_args, args.options)) {
+ pbx_builtin_setvar_helper(chan, "DIALSTATUS", status);
LOCAL_USER_REMOVE(u);
return -1;
}
@@ -802,6 +800,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
if (ast_strlen_zero(args.peers)) {
ast_log(LOG_WARNING, "Dial requires an argument (technology/number)\n");
+ pbx_builtin_setvar_helper(chan, "DIALSTATUS", status);
LOCAL_USER_REMOVE(u);
return -1;
}