[asterisk-commits] russell: trunk r53137 - in /trunk: ./ apps/app_dial.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sat Feb 3 13:46:37 MST 2007


Author: russell
Date: Sat Feb  3 14:46:36 2007
New Revision: 53137

URL: http://svn.digium.com/view/asterisk?view=rev&rev=53137
Log:
Merged revisions 53136 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r53136 | russell | 2007-02-03 14:44:20 -0600 (Sat, 03 Feb 2007) | 12 lines

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)

........

................

Modified:
    trunk/   (props changed)
    trunk/apps/app_dial.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_dial.c?view=diff&rev=53137&r1=53136&r2=53137
==============================================================================
--- trunk/apps/app_dial.c (original)
+++ trunk/apps/app_dial.c Sat Feb  3 14:46:36 2007
@@ -82,7 +82,7 @@
 "    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"
@@ -1183,6 +1183,7 @@
 	struct privacy_args pa = {
 		.sentringing = 0,
 		.privdb_val = 0,
+		.status = "INVALIDARGS",
 	};
 	int sentringing = 0, moh = 0;
 	const char *outbound_group = NULL;
@@ -1201,23 +1202,27 @@
 
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "Dial requires an argument (technology/number)\n");
+		pbx_builtin_setvar_helper(chan, "DIALSTATUS", pa.status);
 		return -1;
 	}
 
 	u = ast_module_user_add(chan);	/* XXX is this the right place ? */
 
 	parse = ast_strdupa(data);
-
+	
 	AST_STANDARD_APP_ARGS(args, parse);
 
 	memset(&config,0,sizeof(struct ast_bridge_config));
 
 	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", pa.status);
 		goto done;
+	}
 
 	if (ast_strlen_zero(args.peers)) {
 		ast_log(LOG_WARNING, "Dial requires an argument (technology/number)\n");
+		pbx_builtin_setvar_helper(chan, "DIALSTATUS", pa.status);
 		goto done;
 	}
 
@@ -1231,6 +1236,7 @@
 		calldurationlimit = atoi(opt_args[OPT_ARG_DURATION_STOP]);
 		if (!calldurationlimit) {
 			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", pa.status);
 			goto done;
 		}
 		if (option_verbose > 2)



More information about the asterisk-commits mailing list