summaryrefslogtreecommitdiff
path: root/main/cdr.c
diff options
context:
space:
mode:
authorMatthew Nicholson <mnicholson@digium.com>2010-09-16 19:55:21 +0000
committerMatthew Nicholson <mnicholson@digium.com>2010-09-16 19:55:21 +0000
commit74e65b7ead1feabbec9fdb48fdda27e74a2983f3 (patch)
tree6bee1327d6d164d227f82ed916daffe3bdd5313d /main/cdr.c
parent7c77cebd4e0b42fe9c200059d0a236f5a2d991d4 (diff)
Merged revisions 287116 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r287116 | mnicholson | 2010-09-16 14:54:48 -0500 (Thu, 16 Sep 2010) | 22 lines Merged revisions 287115 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r287115 | mnicholson | 2010-09-16 14:53:41 -0500 (Thu, 16 Sep 2010) | 15 lines 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 ........ ................ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@287117 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/cdr.c')
-rw-r--r--main/cdr.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/main/cdr.c b/main/cdr.c
index c9b58238b..f2ade2192 100644
--- a/main/cdr.c
+++ b/main/cdr.c
@@ -402,7 +402,7 @@ int ast_cdr_copy_vars(struct ast_cdr *to_cdr, struct ast_cdr *from_cdr)
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;
@@ -414,16 +414,16 @@ int ast_cdr_serialize_variables(struct ast_cdr *cdr, struct ast_str **buf, char
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++) {