mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 20:04:50 +00:00
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.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71063 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -576,17 +576,18 @@ void ast_cdr_merge(struct ast_cdr *to, struct ast_cdr *from)
|
||||
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);
|
||||
|
Reference in New Issue
Block a user