Merged revisions 73980 via svnmerge from
authorJoshua Colp <jcolp@digium.com>
Mon, 9 Jul 2007 03:14:34 +0000 (03:14 +0000)
committerJoshua Colp <jcolp@digium.com>
Mon, 9 Jul 2007 03:14:34 +0000 (03:14 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r73980 | file | 2007-07-09 00:13:19 -0300 (Mon, 09 Jul 2007) | 2 lines

Give Agent channel names priority when doing CDR merging. (issue #10011 reported by krtorio)

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@73983 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/cdr.c

index 90e2da6..e5c96db 100644 (file)
@@ -622,7 +622,7 @@ void ast_cdr_merge(struct ast_cdr *to, struct ast_cdr *from)
                ast_copy_string(to->dstchannel, from->dstchannel, sizeof(to->dstchannel));
                from->dstchannel[0] = 0; /* theft */
        }
-       if (ast_strlen_zero(to->channel) && !ast_strlen_zero(from->channel)) {
+       if (!ast_strlen_zero(from->channel) && (ast_strlen_zero(to->channel) || !strncasecmp(from->channel, "Agent/", 6))) {
                ast_copy_string(to->channel, from->channel, sizeof(to->channel));
                from->channel[0] = 0; /* theft */
        }