[asterisk-commits] juggie: branch juggie/NoLossCDR r84013 - /team/juggie/NoLossCDR/main/cdr.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Sep 26 22:18:32 CDT 2007


Author: juggie
Date: Wed Sep 26 22:18:32 2007
New Revision: 84013

URL: http://svn.digium.com/view/asterisk?view=rev&rev=84013
Log:
fix some really dumb code i wrote which didnt work, and then josh told me why.. 

Modified:
    team/juggie/NoLossCDR/main/cdr.c

Modified: team/juggie/NoLossCDR/main/cdr.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/main/cdr.c?view=diff&rev=84013&r1=84012&r2=84013
==============================================================================
--- team/juggie/NoLossCDR/main/cdr.c (original)
+++ team/juggie/NoLossCDR/main/cdr.c Wed Sep 26 22:18:32 2007
@@ -78,6 +78,7 @@
 	AST_RWLIST_ENTRY(ast_cdr_beitem) list;
 };
 
+AST_MUTEX_DEFINE_STATIC(retry_poll_lock);
 static AST_RWLIST_HEAD_STATIC(be_list, ast_cdr_beitem);
 
 #define SAFE_SHUTDOWN_DEFAULT 1
@@ -842,9 +843,11 @@
 					tv = ast_tvadd(ast_tvnow(), ast_samp2tv(retrydelay * 1000, 1000));
 					ts.tv_sec = tv.tv_sec;
 					ts.tv_nsec = tv.tv_usec * 1000;
-					ast_cond_timedwait(&i->cdr_retry_cond, &i->cdr_queue.lock, &ts);
+					ast_mutex_lock(&retry_poll_lock);
+					ast_cond_timedwait(&i->cdr_retry_cond, &retry_poll_lock, &ts);
+					ast_mutex_unlock(&retry_poll_lock);
 				} else if (be_res == AST_CDR_POST_FATAL){
-					ast_log(LOG_ERROR, "cdr insert failed in: %s, record lost\n",i->name);
+					ast_log(LOG_ERROR, "cdr insert *PERMENANTLY* failed in: %s, record lost\n",i->name);
 					break;
 				} else if (be_res == AST_CDR_POST_DISABLED) {
 					ast_debug(1, "cdr backend %s is registered, but disabled\n", i->name);




More information about the asterisk-commits mailing list