[asterisk-commits] mjordan: trunk r400197 - in /trunk: ./ funcs/func_cdr.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Sep 30 14:58:20 CDT 2013


Author: mjordan
Date: Mon Sep 30 14:58:19 2013
New Revision: 400197

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=400197
Log:
Parse arguments passed to the CDR_PROP function correctly

I can only blame this on a bad merge, because this in no way worked properly
the way it was written. Mea culpa. The function should now parse its arguments
correctly and function properly. (Note that the API used by the CDR_PROP
function has working unit tests... this was merely bad coding of the actual
registered function)

(closes issue ASTERISK-22613)
Reported by: Private Name
........

Merged revisions 400196 from http://svn.asterisk.org/svn/asterisk/branches/12

Modified:
    trunk/   (props changed)
    trunk/funcs/func_cdr.c

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-12-merged (original)
+++ branch-12-merged Mon Sep 30 14:58:19 2013
@@ -1,1 +1,1 @@
-/branches/12:1-398558,398560-398577,398579-399305,399307-400181,400194
+/branches/12:1-398558,398560-398577,398579-399305,399307-400181,400194,400196

Modified: trunk/funcs/func_cdr.c
URL: http://svnview.digium.com/svn/asterisk/trunk/funcs/func_cdr.c?view=diff&rev=400197&r1=400196&r2=400197
==============================================================================
--- trunk/funcs/func_cdr.c (original)
+++ trunk/funcs/func_cdr.c Mon Sep 30 14:58:19 2013
@@ -349,12 +349,23 @@
 {
 	enum ast_cdr_options option;
 
-	if (!strcasecmp("party_a", cmd)) {
+	AST_DECLARE_APP_ARGS(args,
+		AST_APP_ARG(variable);
+		AST_APP_ARG(options);
+	);
+
+	if (ast_strlen_zero(parse) || !value || !chan) {
+		return -1;
+	}
+
+	AST_STANDARD_APP_ARGS(args, parse);
+
+	if (!strcasecmp("party_a", args.variable)) {
 		option = AST_CDR_FLAG_PARTY_A;
-	} else if (!strcasecmp("disable", cmd)) {
+	} else if (!strcasecmp("disable", args.variable)) {
 		option = AST_CDR_FLAG_DISABLE_ALL;
 	} else {
-		ast_log(AST_LOG_WARNING, "Unknown option %s used with CDR_PROP\n", cmd);
+		ast_log(AST_LOG_WARNING, "Unknown option %s used with CDR_PROP\n", args.variable);
 		return 0;
 	}
 




More information about the asterisk-commits mailing list