[asterisk-commits] file: trunk r82248 - /trunk/main/cdr.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 11 10:34:41 CDT 2007


Author: file
Date: Tue Sep 11 10:34:40 2007
New Revision: 82248

URL: http://svn.digium.com/view/asterisk?view=rev&rev=82248
Log:
(closes issue #10666)
Reported by: arkadia
Patches:
      cdr_lockorder.patch uploaded by arkadia (license 233)
Optimize CDR stuff a bit.

Modified:
    trunk/main/cdr.c

Modified: trunk/main/cdr.c
URL: http://svn.digium.com/view/asterisk/trunk/main/cdr.c?view=diff&rev=82248&r1=82247&r2=82248
==============================================================================
--- trunk/main/cdr.c (original)
+++ trunk/main/cdr.c Tue Sep 11 10:34:40 2007
@@ -714,8 +714,8 @@
 void ast_cdr_failed(struct ast_cdr *cdr)
 {
 	for (; cdr; cdr = cdr->next) {
-		check_post(cdr);
 		if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
+			check_post(cdr);
 			if (cdr->disposition < AST_CDR_FAILED)
 				cdr->disposition = AST_CDR_FAILED;
 		}
@@ -727,10 +727,10 @@
 	char *chan; 
 
 	while (cdr) {
-		chan = !ast_strlen_zero(cdr->channel) ? cdr->channel : "<unknown>";
-		if (ast_test_flag(cdr, AST_CDR_FLAG_POSTED))
-			ast_log(LOG_WARNING, "CDR on channel '%s' already posted\n", chan);
 		if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
+			chan = !ast_strlen_zero(cdr->channel) ? cdr->channel : "<unknown>";
+			if (ast_test_flag(cdr, AST_CDR_FLAG_POSTED))
+				ast_log(LOG_WARNING, "CDR on channel '%s' already posted\n", chan);
 			if (cdr->disposition < AST_CDR_NOANSWER)
 				cdr->disposition = AST_CDR_NOANSWER;
 		}
@@ -763,9 +763,10 @@
 void ast_cdr_setdestchan(struct ast_cdr *cdr, const char *chann)
 {
 	for (; cdr; cdr = cdr->next) {
-		check_post(cdr);
-		if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED))
+		if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
+			check_post(cdr);
 			ast_copy_string(cdr->dstchannel, chann, sizeof(cdr->dstchannel));
+		}
 	}
 }
 




More information about the asterisk-commits mailing list