[Freeswitch-svn] [commit] r4320 - freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr

Freeswitch SVN mishehu at freeswitch.org
Sun Feb 18 22:01:34 EST 2007


Author: mishehu
Date: Sun Feb 18 22:01:34 2007
New Revision: 4320

Modified:
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/Makefile
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/basecdr.cpp
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/basecdr.h
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/baseregistry.cpp
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/baseregistry.h
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/cdrcontainer.cpp
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/cdrcontainer.h
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/csvcdr.cpp
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/csvcdr.h
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/mod_cdr.cpp
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/mysqlcdr.cpp
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/mysqlcdr.h
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/pddcdr.cpp
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/pddcdr.h
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/xmlcdr.cpp
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/xmlcdr.h

Log:
Merged in changes from trunk, thanks to MikeJ for any changes he made so far.

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/Makefile
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/Makefile	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/Makefile	Sun Feb 18 22:01:34 2007
@@ -1,11 +1,13 @@
-
-#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 sqlitecdr.o
+OBJS=cdrcontainer.o basecdr.o baseregistry.o pddcdr.o csvcdr.o xmlcdr.o sqlitecdr.o
+
+ifneq ($(shell which mysql_config),)
+  CFLAGS  += $(shell mysql_config --include)
+  LDFLAGS += $(shell mysql_config --libs)
+  OBJS    += mysqlcdr.o
+endif
 
 all:	depends $(OBJS) $(MODNAME).$(DYNAMIC_LIB_EXTEN)
 

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/basecdr.cpp
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/basecdr.cpp	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/basecdr.cpp	Sun Feb 18 22:01:34 2007
@@ -150,15 +150,19 @@
 		if(switch_channel_test_flag(newchannel->channel,CF_ANSWERED))
 		{
 			disposition=1;
-			if(callstartdate)
-				billusec = callenddate - callanswerdate;
-			else
-				billusec = callenddate - calltransferdate;
+			if(callstartdate && callanswerdate)
+			{
+				if(callenddate)
+					billusec = callenddate - callanswerdate;
+				else if(calltransferdate)
+					billusec = calltransferdate - callanswerdate;
+			}
 		}
 		else if(switch_channel_test_flag(newchannel->channel,CF_TRANSFER))
 		{
 			disposition=1;
-			billusec = callenddate - calltransferdate;
+			if(callanswerdate && calltransferdate)
+				billusec = calltransferdate - callanswerdate;
 		}
 		else
 		{
@@ -409,7 +413,7 @@
 /* For Emacs:
  * Local Variables:
  * mode:c++
- * indent-tabs-mode:nil
+ * indent-tabs-mode:t
  * tab-width:4
  * c-basic-offset:4
  * End:

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/basecdr.h
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/basecdr.h	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/basecdr.h	Sun Feb 18 22:01:34 2007
@@ -121,7 +121,7 @@
 /* For Emacs:
  * Local Variables:
  * mode:c++
- * indent-tabs-mode:nil
+ * indent-tabs-mode:t
  * tab-width:4
  * c-basic-offset:4
  * End:

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/baseregistry.cpp
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/baseregistry.cpp	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/baseregistry.cpp	Sun Feb 18 22:01:34 2007
@@ -83,7 +83,7 @@
 /* For Emacs:
  * Local Variables:
  * mode:c++
- * indent-tabs-mode:nil
+ * indent-tabs-mode:t
  * tab-width:4
  * c-basic-offset:4
  * End:

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/baseregistry.h
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/baseregistry.h	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/baseregistry.h	Sun Feb 18 22:01:34 2007
@@ -80,7 +80,7 @@
 /* For Emacs:
  * Local Variables:
  * mode:c++
- * indent-tabs-mode:nil
+ * indent-tabs-mode:t
  * tab-width:4
  * c-basic-offset:4
  * End:

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/cdrcontainer.cpp
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/cdrcontainer.cpp	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/cdrcontainer.cpp	Sun Feb 18 22:01:34 2007
@@ -111,12 +111,12 @@
 	switch_xml_t xml_root;
 	
 	if ((xml_root = switch_xml_open_root(1, &err))) {
-		switch_console_printf(SWITCH_CHANNEL_LOG,"Reloading the XML file...\n");
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Reloading the XML file...\n");
 		switch_xml_free(xml_root);
 	}
 	
 	if (!(xml = switch_xml_open_cfg(configfile, &cfg, NULL))) 
-		switch_console_printf(SWITCH_CHANNEL_LOG,"open of %s failed\n", configfile);
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "open of %s failed\n", configfile);
 	else
 	{
 		BaseRegistry& registry(BaseRegistry::get());
@@ -144,7 +144,7 @@
 	
 	switch_xml_free(xml);
 	switch_queue_unblockpop(cdrqueue);
-	switch_console_printf(SWITCH_CHANNEL_LOG,"mod_cdr configuration reloaded.");
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "mod_cdr configuration reloaded.");
 }
 
 void CDRContainer::queue_pause(switch_stream_handle_t *stream)
@@ -250,7 +250,7 @@
 /* For Emacs:
  * Local Variables:
  * mode:c++
- * indent-tabs-mode:nil
+ * indent-tabs-mode:t
  * tab-width:4
  * c-basic-offset:4
  * End:

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/cdrcontainer.h
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/cdrcontainer.h	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/cdrcontainer.h	Sun Feb 18 22:01:34 2007
@@ -83,7 +83,7 @@
 /* For Emacs:
  * Local Variables:
  * mode:c++
- * indent-tabs-mode:nil
+ * indent-tabs-mode:t
  * tab-width:4
  * c-basic-offset:4
  * End:

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/csvcdr.cpp
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/csvcdr.cpp	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/csvcdr.cpp	Sun Feb 18 22:01:34 2007
@@ -182,7 +182,7 @@
 			if(outputfile.good())
 			{
 				activated = 1;
-				switch_console_printf(SWITCH_CHANNEL_LOG,"CsvCDR activated, log rotation will occur at or after %d MB\n",(filesize_limit/1024/1024));
+				switch_console_printf(SWITCH_CHANNEL_LOG,"CsvCDR activated, log rotation will occur at or after %d MB\n",(int)(filesize_limit >> 20));
 			}
 		}
 		else
@@ -340,7 +340,7 @@
 /* For Emacs:
  * Local Variables:
  * mode:c++
- * indent-tabs-mode:nil
+ * indent-tabs-mode:t
  * tab-width:4
  * c-basic-offset:4
  * End:

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/csvcdr.h
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/csvcdr.h	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/csvcdr.h	Sun Feb 18 22:01:34 2007
@@ -83,7 +83,7 @@
 /* For Emacs:
  * Local Variables:
  * mode:c++
- * indent-tabs-mode:nil
+ * indent-tabs-mode:t
  * tab-width:4
  * c-basic-offset:4
  * End:

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/mod_cdr.cpp
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/mod_cdr.cpp	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/mod_cdr.cpp	Sun Feb 18 22:01:34 2007
@@ -205,7 +205,7 @@
 /* For Emacs:
  * Local Variables:
  * mode:c++
- * indent-tabs-mode:nil
+ * indent-tabs-mode:t
  * tab-width:4
  * c-basic-offset:4
  * End:

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/mysqlcdr.cpp
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/mysqlcdr.cpp	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/mysqlcdr.cpp	Sun Feb 18 22:01:34 2007
@@ -659,7 +659,7 @@
 /* For Emacs:
  * Local Variables:
  * mode:c++
- * indent-tabs-mode:nil
+ * indent-tabs-mode:t
  * tab-width:4
  * c-basic-offset:4
  * End:

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/mysqlcdr.h
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/mysqlcdr.h	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/mysqlcdr.h	Sun Feb 18 22:01:34 2007
@@ -108,7 +108,7 @@
 /* For Emacs:
  * Local Variables:
  * mode:c++
- * indent-tabs-mode:nil
+ * indent-tabs-mode:t
  * tab-width:4
  * c-basic-offset:4
  * End:

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/pddcdr.cpp
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/pddcdr.cpp	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/pddcdr.cpp	Sun Feb 18 22:01:34 2007
@@ -255,7 +255,7 @@
 /* For Emacs:
  * Local Variables:
  * mode:c++
- * indent-tabs-mode:nil
+ * indent-tabs-mode:t
  * tab-width:4
  * c-basic-offset:4
  * End:

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/pddcdr.h
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/pddcdr.h	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/pddcdr.h	Sun Feb 18 22:01:34 2007
@@ -77,7 +77,7 @@
 /* For Emacs:
  * Local Variables:
  * mode:c++
- * indent-tabs-mode:nil
+ * indent-tabs-mode:t
  * tab-width:4
  * c-basic-offset:4
  * End:

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/xmlcdr.cpp
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/xmlcdr.cpp	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/xmlcdr.cpp	Sun Feb 18 22:01:34 2007
@@ -257,7 +257,7 @@
 /* For Emacs:
  * Local Variables:
  * mode:c++
- * indent-tabs-mode:nil
+ * indent-tabs-mode:t
  * tab-width:4
  * c-basic-offset:4
  * End:

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/xmlcdr.h
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/xmlcdr.h	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/xmlcdr.h	Sun Feb 18 22:01:34 2007
@@ -78,7 +78,7 @@
 /* For Emacs:
  * Local Variables:
  * mode:c++
- * indent-tabs-mode:nil
+ * indent-tabs-mode:t
  * tab-width:4
  * c-basic-offset:4
  * End:



More information about the Freeswitch-svn mailing list