[Freeswitch-svn] [commit] r4022 - freeswitch/trunk/src/mod/event_handlers/mod_cdr

Freeswitch SVN mishehu at freeswitch.org
Mon Jan 22 17:03:57 EST 2007


Author: mishehu
Date: Mon Jan 22 17:03:56 2007
New Revision: 4022

Added:
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/curlcdr.cpp
      - copied unchanged from r4020, /freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/curlcdr.cpp
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/curlcdr.h
      - copied unchanged from r4020, /freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/curlcdr.h
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/sqlitecdr.cpp
      - copied unchanged from r4020, /freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/sqlitecdr.cpp
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/sqlitecdr.h
      - copied unchanged from r4020, /freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/sqlitecdr.h
Modified:
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/Makefile
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/README
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/basecdr.cpp
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/basecdr.h
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/csvcdr.cpp
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/mysqlcdr.cpp
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/mysqlcdr.h
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/odbccdr.cpp
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/pddcdr.cpp
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/pddcdr.h
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/schema.sql
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/xmlcdr.cpp

Log:
Merged changes in from my branch at r4020.

Modified: freeswitch/trunk/src/mod/event_handlers/mod_cdr/Makefile
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_cdr/Makefile	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_cdr/Makefile	Mon Jan 22 17:03:56 2007
@@ -1,6 +1,8 @@
 
 CFLAGS  += $(shell mysql_config --include) 
+CFLAGS  += -DSWITCH_QUEUE_ENHANCED
 LDFLAGS += $(shell mysql_config --libs)
+#LDFLAGS += -lcurl
 
 CPPCC = g++
 OBJS=cdrcontainer.o basecdr.o baseregistry.o mysqlcdr.o pddcdr.o csvcdr.o xmlcdr.o

Modified: freeswitch/trunk/src/mod/event_handlers/mod_cdr/README
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_cdr/README	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_cdr/README	Mon Jan 22 17:03:56 2007
@@ -82,6 +82,14 @@
 		<param name="chanvars_supp" value=""/> value is a comma separated list of supplemental channel variables to log.  Can be a wildcard (*) (optional)
 		<param name="chanvars_supp_repeat_fixed" value=""/> value is 0 for no, 1 for yes, and determines whether or not to repeat any of the fixed channel variables as key / value pairs in the chanvars table.
 		<param name="timezone" value=""/> value is utc for utc time, local for localtime.  If not specified or incorrectly specified, localtime is assumed.
+				
+Class:	SqliteCDR, located in sqlitecdr.h and sqlitecdr.cpp
+		This class uses the Sqlite3 library as included with FreeSWITCH's core.  Sqlite is not strict in its handling of column types, and in theory you can toss any sort of data at any sort of column.  That being said, this logger was designed to at least attempt to match the column types to the type of data being sent to it.  It will warn you if the schema does not match what chanvars_fixed types you specify, but it will not fail on them.  However, due to the use of prepared statements, it is likely that you will have unexpected results if you mismatch your chanvars_fixed logging to db schema.  The is the first SQL logger to automatically create the db schema and even update it on its own.
+Configuration: Section <sqlitecdr>
+		<param name="path" value=""/> value is the path to the database to open or create  (required)
+		<param name="chanvars_fixed" value=""/> Is a comma separated list of key=type pairs.  Types are x for decimal, s for string (varchar), d for double, i for integer, t for tiny.  If no type is provided, it defaults that column to string (varchar).  It cannot accept wildcards (*).  You must have a matching column of matching type in the main freeswitchcdr table. The logger will attempt to automatically update the schema, but it cannot if a column by that name already exists.(optional)
+		<param name="chanvars_supp" value=""/> value is a comma separated list of supplemental channel variables to log.  Can be a wildcard (*) (optional)
+		<param name="chanvars_supp_repeat_fixed" value=""/> value is 0 for no, 1 for yes, and determines whether or not to repeat any of the fixed channel variables as key / value pairs in the chanvars table.
 		
 FAQ:
 

Modified: freeswitch/trunk/src/mod/event_handlers/mod_cdr/basecdr.cpp
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_cdr/basecdr.cpp	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_cdr/basecdr.cpp	Mon Jan 22 17:03:56 2007
@@ -60,6 +60,7 @@
 	if(newchannel != 0)
 	{
 		errorstate = 0;
+		originated=1; // One-legged calls are always considered the originator
 		memset(clid,0,80);
 		memset(dialplan,0,80);
 		memset(myuuid,0,37);
@@ -132,7 +133,6 @@
 			// Or were we maybe we were the caller?
 			if(newchannel->callerprofile->originatee_caller_profile)
 			{
-				originated = 1;
 				if (newchannel->callerprofile) {
 					if(newchannel->callerprofile->caller_id_number != 0)
 						strncpy(src,newchannel->callerprofile->caller_id_number,strlen(newchannel->callerprofile->caller_id_number));
@@ -377,6 +377,35 @@
 	}
 }
 
+void BaseCDR::escape_string(std::string& src)
+{
+	std::string::size_type pos = 0;
+	
+	// find all occurences of ' and replace them with \'
+	while ( ( pos = src.find( "'", pos ) ) != std::string::npos ) 
+	{
+		src.replace( pos, 1, "\\'" );
+		pos += 2;
+	}
+}
+
+std::string BaseCDR::escape_chararray(char* src)
+{
+	std::string src_string = src;
+	
+	std::string::size_type pos = 0;
+	
+	// find all occurences of ' and replace them with \'
+	while ( ( pos = src_string.find( "'", pos ) ) != std::string::npos ) 
+	{
+		src_string.replace( pos, 1, "\\'" );
+		pos += 2;
+	}
+	
+	return src_string;
+}
+
+
 /* For Emacs:
  * Local Variables:
  * mode:c++

Modified: freeswitch/trunk/src/mod/event_handlers/mod_cdr/basecdr.h
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_cdr/basecdr.h	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_cdr/basecdr.h	Mon Jan 22 17:03:56 2007
@@ -84,6 +84,8 @@
 		void parse_channel_variables_xconfig(std::string& unparsed,std::list<std::string>& chanvarslist,std::vector<switch_mod_cdr_sql_types_t>& chanvars_fixed_types);  // Typically used for SQL types
 		void process_channel_variables(const std::list<std::string>& stringlist,const std::list<std::string>& fixedlist,switch_channel_t *channel,bool repeat = 1); //This is used for supplemental chanvars
 		void process_channel_variables(const std::list<std::string>& stringlist,switch_channel_t *channel); // This is used for fixed chanvars
+		void escape_string(std::string& src);
+		std::string escape_chararray(char* src);
 		switch_time_t callstartdate;
 		switch_time_t callanswerdate;
 		switch_time_t callenddate;

Modified: freeswitch/trunk/src/mod/event_handlers/mod_cdr/csvcdr.cpp
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_cdr/csvcdr.cpp	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_cdr/csvcdr.cpp	Mon Jan 22 17:03:56 2007
@@ -179,7 +179,7 @@
 			if(outputfile.good())
 			{
 				activated = 1;
-				switch_console_printf(SWITCH_CHANNEL_LOG,"CsvCDR activated, log rotation will occur at or after %d MB",(filesize_limit/1024/1024));
+				switch_console_printf(SWITCH_CHANNEL_LOG,"CsvCDR activated, log rotation will occur at or after %d MB\n",(filesize_limit/1024/1024));
 			}
 		}
 		else
@@ -228,7 +228,21 @@
 		switch_console_printf(SWITCH_CHANNEL_LOG,"Could not open the CSV file %s .  CsvCDR logger will not be functional until this is resolved and a reload is issued.  Failbit is set to %d.\n",filename.c_str(),outputfile.fail());
 		activated = 0;
 	}
+	else
+	{
+		outputfile << "callstartdate,formattedcallstartdate,callanswerdate,formattedcallanswerdate,calltransferdate,formattedcalltransferdate,callendate,formattedcallenddate,hangupcause_text,hangupcause,clid,originated,dialplan,myuuid,destuuid,src,dst,srcchannel,dstchannel,ani,aniii,network_address,lastapp,lastdata,billusec,disposition,amaflags";
+		if(chanvars_fixed_list.size())
+		{
+			std::list<std::string>::iterator iItr, iEnd;
+			for(iItr = chanvars_fixed_list.begin(),iEnd = chanvars_fixed_list.end(); iItr != iEnd; iItr++)
+				outputfile << "," << *iItr;
+		}
 	
+		if(logchanvars)
+			outputfile << ",chanvars_supp";
+	
+		outputfile << std::endl;
+	}
 }
 
 bool CsvCDR::process_record()
@@ -315,7 +329,7 @@
 	chanvars_fixed_list.clear();
 	chanvars_supp_list.clear();
 	connectionstate = 0;
-	switch_console_printf(SWITCH_CHANNEL_LOG,"Shutting down CsvCDR...  Done!");	
+	switch_console_printf(SWITCH_CHANNEL_LOG,"Shutting down CsvCDR...  Done!\n");	
 }
 
 AUTO_REGISTER_BASECDR(CsvCDR);

Modified: freeswitch/trunk/src/mod/event_handlers/mod_cdr/mysqlcdr.cpp
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_cdr/mysqlcdr.cpp	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_cdr/mysqlcdr.cpp	Mon Jan 22 17:03:56 2007
@@ -62,6 +62,7 @@
 		dstchannel_length = (long unsigned int)strlen(dstchannel);
 		lastapp_length = (long unsigned int)strlen(lastapp);
 		lastdata_length = (long unsigned int)strlen(lastdata);
+		network_addr_length = (long unsigned int)strlen(network_addr);
 		
 		if(chanvars_fixed_list.size() > 0)
 			process_channel_variables(chanvars_fixed_list,newchannel->channel);
@@ -195,7 +196,7 @@
 		
 		if(activated)
 		{
-			tmp_sql_query = "INSERT INTO freeswitchcdr  (callstartdate,callanswerdate,calltransferdate,callenddate,originated,clid,src,dst,ani,aniii,dialplan,myuuid,destuuid,srcchannel,dstchannel,lastapp,lastdata,billusec,disposition,hangupcause,amaflags";
+			tmp_sql_query = "INSERT INTO freeswitchcdr  (callstartdate,callanswerdate,calltransferdate,callenddate,originated,clid,src,dst,ani,aniii,dialplan,myuuid,destuuid,srcchannel,dstchannel,network_addr,lastapp,lastdata,billusec,disposition,hangupcause,amaflags";
 			
 			int items_appended = 0;
 			
@@ -213,7 +214,7 @@
 				}
 			}
 			
-			tmp_sql_query.append(") VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?");
+			tmp_sql_query.append(") VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?");
 			
 			if(chanvars_fixed_list.size() > 0 )
 			{
@@ -334,13 +335,13 @@
 	set_mysql_time(tm1,my_callstartdate);
 	set_mysql_time(tm2,my_callanswerdate);
 	set_mysql_time(tm3,my_calltransferdate);
-	set_mysql_time(tm4,my_calltransferdate);
+	set_mysql_time(tm4,my_callenddate);
 	
 	// Why is this out of order?  I don't know, it doesn't make sense.
 	add_parameter(my_callstartdate,MYSQL_TYPE_DATETIME);
 	add_parameter(my_callanswerdate,MYSQL_TYPE_DATETIME);
-	add_parameter(my_callenddate,MYSQL_TYPE_DATETIME);
 	add_parameter(my_calltransferdate,MYSQL_TYPE_DATETIME);
+	add_parameter(my_callenddate,MYSQL_TYPE_DATETIME);
 	
 	add_parameter(originated,MYSQL_TYPE_TINY);
 	add_string_parameter(clid,clid_length,MYSQL_TYPE_VAR_STRING,0);
@@ -353,6 +354,7 @@
 	add_string_parameter(destuuid,destuuid_length,MYSQL_TYPE_VAR_STRING,0);
 	add_string_parameter(srcchannel,srcchannel_length,MYSQL_TYPE_VAR_STRING,0);
 	add_string_parameter(dstchannel,dstchannel_length,MYSQL_TYPE_VAR_STRING,0);
+	add_string_parameter(network_addr,network_addr_length,MYSQL_TYPE_VAR_STRING,0);
 	add_string_parameter(lastapp,lastapp_length,MYSQL_TYPE_VAR_STRING,0);
 	add_string_parameter(lastdata,lastdata_length,MYSQL_TYPE_VAR_STRING,0);
 	add_parameter(billusec,MYSQL_TYPE_LONGLONG,0);

Modified: freeswitch/trunk/src/mod/event_handlers/mod_cdr/mysqlcdr.h
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_cdr/mysqlcdr.h	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_cdr/mysqlcdr.h	Mon Jan 22 17:03:56 2007
@@ -95,6 +95,7 @@
 		long unsigned int aniii_length;
 		long unsigned int lastapp_length;
 		long unsigned int lastdata_length;
+		long unsigned int network_addr_length;
 		// Now a couple internal methods
 		template <typename T> void add_parameter(T& param, enum_field_types type, bool *is_null=0);
 		void add_string_parameter(char* param, long unsigned int& param_length, enum_field_types type, bool* is_null=0);

Modified: freeswitch/trunk/src/mod/event_handlers/mod_cdr/odbccdr.cpp
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_cdr/odbccdr.cpp	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_cdr/odbccdr.cpp	Mon Jan 22 17:03:56 2007
@@ -222,7 +222,7 @@
 		{
 			tmp_sql_query = "INSERT INTO ";
 			tmp_sql_query.append(tablename);
-			tmp_sql_query.append(" (callstartdate,callanswerdate,calltransferdate,callenddate,originated,clid,src,dst,ani,aniii,dialplan,myuuid,destuuid,srcchannel,dstchannel,lastapp,lastdata,billusec,disposition,hangupcause,amaflags");
+			tmp_sql_query.append(" (callstartdate,callanswerdate,calltransferdate,callenddate,originated,clid,src,dst,ani,aniii,dialplan,myuuid,destuuid,srcchannel,dstchannel,network_addr,lastapp,lastdata,billusec,disposition,hangupcause,amaflags");
 			
 			int items_appended = 0;
 			
@@ -240,7 +240,7 @@
 				}
 			}
 			
-			tmp_sql_query.append(") VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?");
+			tmp_sql_query.append(") VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?");
 			
 			if(chanvars_fixed_list.size() > 0 )
 			{
@@ -422,6 +422,7 @@
 	SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, sizeof(destuuid), 0, destuuid, 0, 0);
 	SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, sizeof(srcchannel), 0, srcchannel, 0, 0);
 	SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, sizeof(dstchannel), 0, dstchannel, 0, 0);
+	SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, sizeof(network_addr), 0, network_addr, 0, 0);
 	SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, sizeof(lastapp), 0, lastapp, 0, 0);
 	SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, sizeof(lastdata), 0, lastdata, 0, 0);
 	SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_UBIGINT, SQL_BIGINT, 0, 0, &billusec, 0, 0);

Modified: freeswitch/trunk/src/mod/event_handlers/mod_cdr/pddcdr.cpp
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_cdr/pddcdr.cpp	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_cdr/pddcdr.cpp	Mon Jan 22 17:03:56 2007
@@ -172,41 +172,45 @@
 	{
 		// Format the call record and proceed from here...
 		outputfile << "$VAR1 = {" << std::endl;
-		outputfile << "\t\'callstartdate\' = \'" << callstartdate << "\'," << std::endl;
-		outputfile <<  "\t\'formattedcallstartdate\' = \'" << formattedcallstartdate << "\'," << std::endl;
-		outputfile << "\t\'callanswerdate\' = \'" << callanswerdate << "\'," << std::endl;
-		outputfile << "\t\'formattedcallanswerdate\' = \'" << formattedcallanswerdate << "\'," << std::endl;
-		outputfile << "\t\'calltransferdate\' = \'" << calltransferdate << "\'," << std::endl;
-		outputfile << "\t\'formattedcalltransferdate\' = \'" << formattedcalltransferdate << "\'," << std::endl;
-		outputfile << "\t\'callenddate\' = \'" << callenddate << "\'," << std::endl;
-		outputfile << "\t\'formatcallenddate\' = \'" << formattedcallenddate << "\'," << std::endl;
-		outputfile << "\t\'hangupcause\' = \'" << hangupcause_text << "\'," << std::endl;
-		outputfile << "\t\'hangupcausecode\' = \'" << hangupcause << "\'," << std::endl;
-		outputfile << "\t\'clid\' = \'" << clid << "\'," << std::endl;
-		outputfile << "\t\'originated\' = \'" << originated << "\'," << std::endl;
-		outputfile << "\t\'dialplan\' = \'" << dialplan << "\'," << std::endl;
-		outputfile << "\t\'myuuid\' = \'" << myuuid << "\'," << std::endl;
-		outputfile << "\t\'destuuid\' = \'" << destuuid << "\'," << std::endl;
-		outputfile << "\t\'src\' = \'" << src << "\'," << std::endl;
-		outputfile << "\t\'dst\' = \'" << dst << "\'," << std::endl;
-		outputfile << "\t\'srcchannel\' = \'" << srcchannel << "\'," << std::endl;
-		outputfile << "\t\'dstchannel\' = \'" << dstchannel << "\'," << std::endl;
-		outputfile << "\t\'ani\' = \'" << ani << "\'," << std::endl;
-		outputfile << "\t\'aniii\' = \'" << aniii << "\'," << std::endl;
-		outputfile << "\t\'network_addr\' = \'" << network_addr << "\'," << std::endl;
-		outputfile << "\t\'lastapp\' = \'" << lastapp << "\'," << std::endl;
-		outputfile << "\t\'lastdata\' = \'" << lastdata << "\'," << std::endl;
-		outputfile << "\t\'billusec\' = \'" << billusec << "\'," << std::endl;
-		outputfile << "\t\'disposition\' = \'" << disposition << "\'," << std::endl;
-		outputfile << "\t\'amaflags\' = \'" << amaflags << "\'," << std::endl;
+		outputfile << "\t\'callstartdate\' => \'" << callstartdate << "\'," << std::endl;
+		outputfile << "\t\'formattedcallstartdate\' => \'" << formattedcallstartdate << "\'," << std::endl;
+		outputfile << "\t\'callanswerdate\' => \'" << callanswerdate << "\'," << std::endl;
+		outputfile << "\t\'formattedcallanswerdate\' => \'" << formattedcallanswerdate << "\'," << std::endl;
+		outputfile << "\t\'calltransferdate\' => \'" << calltransferdate << "\'," << std::endl;
+		outputfile << "\t\'formattedcalltransferdate\' => \'" << formattedcalltransferdate << "\'," << std::endl;
+		outputfile << "\t\'callenddate\' => \'" << callenddate << "\'," << std::endl;
+		outputfile << "\t\'formattedcallenddate\' => \'" << formattedcallenddate << "\'," << std::endl;
+		outputfile << "\t\'hangupcause\' => \'" << hangupcause_text << "\'," << std::endl;
+		outputfile << "\t\'hangupcausecode\' => \'" << hangupcause << "\'," << std::endl;
+		outputfile << "\t\'clid\' => \'" << escape_chararray(clid) << "\'," << std::endl;
+		outputfile << "\t\'originated\' => \'" << originated << "\'," << std::endl;
+		outputfile << "\t\'dialplan\' => \'" << dialplan << "\'," << std::endl;
+		outputfile << "\t\'myuuid\' => \'" << myuuid << "\'," << std::endl;
+		outputfile << "\t\'destuuid\' => \'" << destuuid << "\'," << std::endl;
+		outputfile << "\t\'src\' => \'" << src << "\'," << std::endl;
+		outputfile << "\t\'dst\' => \'" << dst << "\'," << std::endl;
+		outputfile << "\t\'srcchannel\' => \'" << srcchannel << "\'," << std::endl;
+		outputfile << "\t\'dstchannel\' => \'" << dstchannel << "\'," << std::endl;
+		outputfile << "\t\'ani\' => \'" << ani << "\'," << std::endl;
+		outputfile << "\t\'aniii\' => \'" << aniii << "\'," << std::endl;
+		outputfile << "\t\'network_addr\' => \'" << network_addr << "\'," << std::endl;
+		outputfile << "\t\'lastapp\' => \'" << lastapp << "\'," << std::endl;
+		outputfile << "\t\'lastdata\' => \'" << lastdata << "\'," << std::endl;
+		outputfile << "\t\'billusec\' => \'" << billusec << "\'," << std::endl;
+		outputfile << "\t\'disposition\' => \'" << disposition << "\'," << std::endl;
+		outputfile << "\t\'amaflags\' => \'" << amaflags << "\'," << std::endl;
 		
 		// Now to process chanvars
 		outputfile << "\t\'chanvars\' => {" << std::endl;
 		if(chanvars_supp.size() > 0 )
 		{
-			std::map<std::string,std::string>::iterator iItr,iEnd;
+			std::map< std::string,std::string >::iterator iItr,iEnd;
 			for(iItr = chanvars_supp.begin(), iEnd = chanvars_supp.end() ; iItr != iEnd; iItr++)
-				outputfile << "\t\t\'" << iItr->first << "\' = \'" << iItr->second << "\'," << std::endl;
+			{
+				escape_string(iItr->second);
+				outputfile << "\t\t\'" << iItr->first;
+				outputfile << "\' => \'" << iItr->second << "\'," << std::endl;
+			}
 		}
 		outputfile << "\t}," << std::endl << "};" << std::endl << std::endl;
 		retval = 1;

Modified: freeswitch/trunk/src/mod/event_handlers/mod_cdr/pddcdr.h
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_cdr/pddcdr.h	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_cdr/pddcdr.h	Mon Jan 22 17:03:56 2007
@@ -24,6 +24,7 @@
  * Contributor(s):
  * 
  * Yossi Neiman <freeswitch AT cartissolutions.com>
+ * Bret McDanel <trixter AT 0xdecafbad.com>
  *
  * Description: This C++ header file describes the PddCDR class which handles formatting a CDR out to
  * individual text files in a Perl Data Dumper format.
@@ -54,7 +55,6 @@
 		virtual void tempdump_record();
 		virtual void reread_tempdumped_records();
 		virtual std::string get_display_name();
-
 	private:
 		static bool activated; // Is this module activated?
 		static bool connectionstate; // What is the status of the connection?

Modified: freeswitch/trunk/src/mod/event_handlers/mod_cdr/schema.sql
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_cdr/schema.sql	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_cdr/schema.sql	Mon Jan 22 17:03:56 2007
@@ -15,6 +15,7 @@
 	destuuid char(36) NOT NULL,
 	srcchannel varchar(80) NOT NULL,
 	dstchannel varchar(80) NOT NULL, /* Need to decide - this might be redundant as you can link the records via uuid */
+	network_addr varchar(40) default "",
 	lastapp varchar(80) default "",
 	lastdata varchar(255) default "",
 	billusec bigint default 0,

Modified: freeswitch/trunk/src/mod/event_handlers/mod_cdr/xmlcdr.cpp
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_cdr/xmlcdr.cpp	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_cdr/xmlcdr.cpp	Mon Jan 22 17:03:56 2007
@@ -171,7 +171,7 @@
 		switch_console_printf(SWITCH_CHANNEL_LOG, "XmlCDR::process_record():  Unable to open file  %s to commit the call record to.  Invalid path name, invalid permissions, or no space available?\n",outputfile_name.c_str());
 	else
 	{
-		switch_console_printf(SWITCH_CHANNEL_LOG, "XmlCDR::process_record():  Preping the CDR to %s.\n",outputfile_name.c_str());
+		//switch_console_printf(SWITCH_CHANNEL_LOG, "XmlCDR::process_record():  Preping the CDR to %s.\n",outputfile_name.c_str());
 		// Format the call record and proceed from here...
 		outputfile << "<?xml version=\"1.0\"?>" << std::endl;
 		outputfile << "<document type=\"freeswitch-cdr/xml\">" << std::endl;
@@ -213,7 +213,7 @@
 		}
 		outputfile << "\t</chanvars>" << std::endl << "</document>" << std::endl << std::endl;
 
-		switch_console_printf(SWITCH_CHANNEL_LOG, "XmlCDR::process_record():  Dumping the CDR to %s.\n",outputfile_name.c_str());
+		//switch_console_printf(SWITCH_CHANNEL_LOG, "XmlCDR::process_record():  Dumping the CDR to %s.\n",outputfile_name.c_str());
 		retval = 1;
 	}
 	



More information about the Freeswitch-svn mailing list