]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 70948 via svnmerge from
authorSteve Murphy <murf@digium.com>
Thu, 21 Jun 2007 22:34:41 +0000 (22:34 +0000)
committerSteve Murphy <murf@digium.com>
Thu, 21 Jun 2007 22:34:41 +0000 (22:34 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r70948 | murf | 2007-06-21 16:29:50 -0600 (Thu, 21 Jun 2007) | 1 line

This little fix is in response to bug 10016, but may not cure it. The code is wrong, clearly. In a situation where you set the CDR's amaflags, and then ForkCDR, and then set the new CDR's amaflags to some other value, you will see that all CDRs have had their amaflags changed. This is not good. So I fixed it.
........

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

main/cdr.c

index f5693e6c682d629c5bd6d6edd0e8a48c55a86408..54aab40a5f3ebf41605571b649e20f494b6f4c2b 100644 (file)
@@ -845,8 +845,11 @@ int ast_cdr_setamaflags(struct ast_channel *chan, const char *flag)
        struct ast_cdr *cdr;
        int newflag = ast_cdr_amaflags2int(flag);
        if (newflag) {
-               for (cdr = chan->cdr; cdr; cdr = cdr->next)
-                       cdr->amaflags = newflag;
+               for (cdr = chan->cdr; cdr; cdr = cdr->next) {
+                       if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
+                               cdr->amaflags = newflag;
+                       }
+               }
        }
 
        return 0;