[asterisk-commits] juggie: branch group/NoLossCDR-Redux2 r104706 - /team/group/NoLossCDR-Redux2/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Feb 27 12:26:14 CST 2008


Author: juggie
Date: Wed Feb 27 12:26:14 2008
New Revision: 104706

URL: http://svn.digium.com/view/asterisk?view=rev&rev=104706
Log:
update csv engine to return CDR state

Modified:
    team/group/NoLossCDR-Redux2/cdr/cdr_csv.c

Modified: team/group/NoLossCDR-Redux2/cdr/cdr_csv.c
URL: http://svn.digium.com/view/asterisk/team/group/NoLossCDR-Redux2/cdr/cdr_csv.c?view=diff&rev=104706&r1=104705&r2=104706
==============================================================================
--- team/group/NoLossCDR-Redux2/cdr/cdr_csv.c (original)
+++ team/group/NoLossCDR-Redux2/cdr/cdr_csv.c Wed Feb 27 12:26:14 2008
@@ -281,6 +281,7 @@
 	/* Make sure we have a big enough buf */
 	char buf[1024];
 	char csvmaster[PATH_MAX];
+	int res;
 	snprintf(csvmaster, sizeof(csvmaster),"%s/%s/%s", ast_config_AST_LOG_DIR, CSV_LOG_DIR, CSV_MASTER);
 #if 0
 	printf("[CDR] %s ('%s' -> '%s') Dur: %ds Bill: %ds Disp: %s Flags: %s Account: [%s]\n", cdr->channel, cdr->src, cdr->dst, cdr->duration, cdr->billsec, ast_cdr_disp2str(cdr->disposition), ast_cdr_flags2str(cdr->amaflags), cdr->accountcode);
@@ -300,9 +301,11 @@
 		fclose(mf);
 		mf = NULL;
 		ast_mutex_unlock(&mf_lock);
+		res = AST_CDR_POST_OK;
 	} else {
 		ast_mutex_unlock(&mf_lock);
 		ast_log(LOG_ERROR, "Unable to re-open master file %s : %s\n", csvmaster, strerror(errno));
+		res = AST_CDR_POST_FAILED;
 	}
 	
 	if (!ast_strlen_zero(cdr->accountcode)) {
@@ -310,7 +313,7 @@
 			ast_log(LOG_WARNING, "Unable to write CSV record to account file '%s' : %s\n", cdr->accountcode, strerror(errno));
 	}
 
-	return 0;
+	return res;
 }
 
 static int unload_module(void)




More information about the asterisk-commits mailing list