[asterisk-commits] murf: branch 1.4 r71063 - /branches/1.4/main/cdr.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jun 22 09:10:24 CDT 2007


Author: murf
Date: Fri Jun 22 09:10:24 2007
New Revision: 71063

URL: http://svn.digium.com/view/asterisk?view=rev&rev=71063
Log:
My conditions for merging amaflags info was naive; DOCUMENTATION is the default, although null is possible; theft of user-settable fields is not good. Just copy them, leave them alone.

Modified:
    branches/1.4/main/cdr.c

Modified: branches/1.4/main/cdr.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/cdr.c?view=diff&rev=71063&r1=71062&r2=71063
==============================================================================
--- branches/1.4/main/cdr.c (original)
+++ branches/1.4/main/cdr.c Fri Jun 22 09:10:24 2007
@@ -576,17 +576,18 @@
 		ast_copy_string(to->dst, from->dst, sizeof(to->dst));
 		from->dst[0] = 0; /* theft */
 	}
-	if (ast_test_flag(from, AST_CDR_FLAG_LOCKED) || (!to->amaflags && from->amaflags)) {
+	if (!to->amaflags)
+		to->amaflags = AST_CDR_DOCUMENTATION;
+	if (!from->amaflags)
+		from->amaflags = AST_CDR_DOCUMENTATION; /* make sure both amaflags are set to something (DOC is default) */
+	if (ast_test_flag(from, AST_CDR_FLAG_LOCKED) || (to->amaflags == AST_CDR_DOCUMENTATION && from->amaflags != AST_CDR_DOCUMENTATION)) {
 		to->amaflags = from->amaflags;
-		from->amaflags = 0; /* theft */
 	}
 	if (ast_test_flag(from, AST_CDR_FLAG_LOCKED) || (ast_strlen_zero(to->accountcode) && !ast_strlen_zero(from->accountcode))) {
 		ast_copy_string(to->accountcode, from->accountcode, sizeof(to->accountcode));
-		from->accountcode[0] = 0; /* theft */
 	}
 	if (ast_test_flag(from, AST_CDR_FLAG_LOCKED) || (ast_strlen_zero(to->userfield) && !ast_strlen_zero(from->userfield))) {
 		ast_copy_string(to->userfield, from->userfield, sizeof(to->userfield));
-		from->userfield[0] = 0; /* theft */
 	}
 	/* flags, varsead, ? */
 	cdr_merge_vars(from, to);




More information about the asterisk-commits mailing list