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

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


Author: juggie
Date: Wed Feb 27 14:43:17 2008
New Revision: 104785

URL: http://svn.digium.com/view/asterisk?view=rev&rev=104785
Log:
add status returns to cdr_custom, fix an var init in cdr_csv

Modified:
    team/group/NoLossCDR-Redux2/cdr/cdr_csv.c
    team/group/NoLossCDR-Redux2/cdr/cdr_custom.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=104785&r1=104784&r2=104785
==============================================================================
--- team/group/NoLossCDR-Redux2/cdr/cdr_csv.c (original)
+++ team/group/NoLossCDR-Redux2/cdr/cdr_csv.c Wed Feb 27 14:43:17 2008
@@ -281,7 +281,7 @@
 	/* Make sure we have a big enough buf */
 	char buf[1024];
 	char csvmaster[PATH_MAX];
-	int res;
+	int res = 0;;
 	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);

Modified: team/group/NoLossCDR-Redux2/cdr/cdr_custom.c
URL: http://svn.digium.com/view/asterisk/team/group/NoLossCDR-Redux2/cdr/cdr_custom.c?view=diff&rev=104785&r1=104784&r2=104785
==============================================================================
--- team/group/NoLossCDR-Redux2/cdr/cdr_custom.c (original)
+++ team/group/NoLossCDR-Redux2/cdr/cdr_custom.c Wed Feb 27 14:43:17 2008
@@ -107,10 +107,11 @@
 	/* Make sure we have a big enough buf */
 	char buf[2048];
 	struct ast_channel dummy;
+	int res = 0;
 
 	/* Abort if no master file is specified */
 	if (ast_strlen_zero(master))
-		return 0;
+		return AST_CDR_POST_DISABLED;
 
 	/* Quite possibly the first use of a static struct ast_channel, we need it so the var funcs will work */
 	memset(&dummy, 0, sizeof(dummy));
@@ -123,14 +124,16 @@
 	mf = fopen(master, "a");
 	if (!mf) {
 		ast_log(LOG_ERROR, "Unable to re-open master file %s : %s\n", master, strerror(errno));
+		res = AST_CDR_POST_FAILED;
 	}
 	if (mf) {
 		fputs(buf, mf);
 		fflush(mf); /* be particularly anal here */
 		fclose(mf);
 		mf = NULL;
+		res = AST_CDR_POST_OK;
 	}
-	return 0;
+	return res;
 }
 
 static int unload_module(void)




More information about the asterisk-commits mailing list