[asterisk-commits] mnicholson: branch 1.6.2 r287115 - in /branches/1.6.2: ./ main/cdr.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Sep 16 14:53:44 CDT 2010


Author: mnicholson
Date: Thu Sep 16 14:53:41 2010
New Revision: 287115

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

........
  r287114 | mnicholson | 2010-09-16 14:52:39 -0500 (Thu, 16 Sep 2010) | 8 lines
  
  Don't stop printing cdr variables if we encounter one with a blank name or value.
  
  (closes issue #17900)
  Reported by: under
  Patches:
        core-show-channel-cdr-fix1.diff uploaded by mnicholson (license 96)
  Tested by: mnicholson
........

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/main/cdr.c

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

Modified: branches/1.6.2/main/cdr.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/main/cdr.c?view=diff&rev=287115&r1=287114&r2=287115
==============================================================================
--- branches/1.6.2/main/cdr.c (original)
+++ branches/1.6.2/main/cdr.c Thu Sep 16 14:53:41 2010
@@ -370,7 +370,7 @@
 int ast_cdr_serialize_variables(struct ast_cdr *cdr, struct ast_str **buf, char delim, char sep, int recur) 
 {
 	struct ast_var_t *variables;
-	const char *var, *val;
+	const char *var;
 	char *tmp;
 	char workspace[256];
 	int total = 0, x = 0, i;
@@ -382,16 +382,16 @@
 			ast_str_append(buf, 0, "\n");
 
 		AST_LIST_TRAVERSE(&cdr->varshead, variables, entries) {
-			if (variables &&
-			    (var = ast_var_name(variables)) && (val = ast_var_value(variables)) &&
-			    !ast_strlen_zero(var) && !ast_strlen_zero(val)) {
-				if (ast_str_append(buf, 0, "level %d: %s%c%s%c", x, var, delim, val, sep) < 0) {
- 					ast_log(LOG_ERROR, "Data Buffer Size Exceeded!\n");
- 					break;
-				} else
-					total++;
-			} else 
+			if (!(var = ast_var_name(variables))) {
+				continue;
+			}
+
+			if (ast_str_append(buf, 0, "level %d: %s%c%s%c", x, var, delim, S_OR(ast_var_value(variables), ""), sep) < 0) {
+				ast_log(LOG_ERROR, "Data Buffer Size Exceeded!\n");
 				break;
+			}
+
+			total++;
 		}
 
 		for (i = 0; cdr_readonly_vars[i]; i++) {




More information about the asterisk-commits mailing list