[Freeswitch-svn] [commit] r2065 - freeswitch/branches/mishehu/src/mod/loggers/mod_cdr

Freeswitch SVN mishehu at freeswitch.org
Sun Jul 23 21:08:51 EDT 2006


Author: mishehu
Date: Sun Jul 23 21:08:50 2006
New Revision: 2065

Modified:
   freeswitch/branches/mishehu/src/mod/loggers/mod_cdr/anthmcdr.cpp
   freeswitch/branches/mishehu/src/mod/loggers/mod_cdr/anthmcdr.h

Log:
Cleaned up file generation a bit for AnthmCDR.

Modified: freeswitch/branches/mishehu/src/mod/loggers/mod_cdr/anthmcdr.cpp
==============================================================================
--- freeswitch/branches/mishehu/src/mod/loggers/mod_cdr/anthmcdr.cpp	(original)
+++ freeswitch/branches/mishehu/src/mod/loggers/mod_cdr/anthmcdr.cpp	Sun Jul 23 21:08:50 2006
@@ -54,15 +54,16 @@
 		switch_time_exp_lt(&tempcallend, callenddate);
 		
 		// Format the times
-		size_t retsizecsd, retsizecad, retsizeced, retsizeceff;  //csd == callstartdate, cad == callanswerdate, ced == callenddate, ceff == callenddate_forfile
+		size_t retsizecsd, retsizecad, retsizeced; //csd == callstartdate, cad == callanswerdate, ced == callenddate, ceff == callenddate_forfile
 		char format[] = "%F %T";
 		switch_strftime(formattedcallstartdate,&retsizecsd,sizeof(formattedcallstartdate),format,&tempcallstart);
 		switch_strftime(formattedcallanswerdate,&retsizecad,sizeof(formattedcallanswerdate),format,&tempcallanswer);
 		switch_strftime(formattedcallenddate,&retsizeced,sizeof(formattedcallenddate),format,&tempcallend);
 
-		char format_forfile[] = "%s";
-		char callenddate_forfile[25];
-		switch_strftime(callenddate_forfile,&retsizeceff,sizeof(callenddate_forfile),format_forfile,&tempcallend);
+		std::ostringstream ostring;
+		ostring << (callenddate/1000000);
+		std::string callenddate_forfile = ostring.str();
+		
 		outputfile_name = outputfile_path;
 		outputfile_name.append(SWITCH_PATH_SEPARATOR);
 		outputfile_name.append(callenddate_forfile); // Make sorting a bit easier, kinda like Maildir does

Modified: freeswitch/branches/mishehu/src/mod/loggers/mod_cdr/anthmcdr.h
==============================================================================
--- freeswitch/branches/mishehu/src/mod/loggers/mod_cdr/anthmcdr.h	(original)
+++ freeswitch/branches/mishehu/src/mod/loggers/mod_cdr/anthmcdr.h	Sun Jul 23 21:08:50 2006
@@ -30,6 +30,7 @@
 #include "baseregistry.h"
 #include <switch.h>
 #include <iostream>
+#include <sstream>
 #include <fstream>
 #include <list>
 



More information about the Freeswitch-svn mailing list