Merged revisions 70949 via svnmerge from
[asterisk/asterisk.git] / main / cdr.c
index d19f6a8..11dbc56 100644 (file)
@@ -848,8 +848,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;