[Freeswitch-branches] [commit] r2067 - freeswitch/branches/mishehu/src/mod/loggers/mod_cdr
Freeswitch SVN
mishehu at freeswitch.org
Mon Jul 24 00:13:03 EDT 2006
Author: mishehu
Date: Mon Jul 24 00:13:01 2006
New Revision: 2067
Modified:
freeswitch/branches/mishehu/src/mod/loggers/mod_cdr/Makefile
freeswitch/branches/mishehu/src/mod/loggers/mod_cdr/README
freeswitch/branches/mishehu/src/mod/loggers/mod_cdr/anthmcdr.cpp
freeswitch/branches/mishehu/src/mod/loggers/mod_cdr/anthmcdr.h
Log:
Renaming of AnthmCDR and all its related files/settings to PddCDR for Perl Data Dumper, at MikeJ's request
Modified: freeswitch/branches/mishehu/src/mod/loggers/mod_cdr/Makefile
==============================================================================
--- freeswitch/branches/mishehu/src/mod/loggers/mod_cdr/Makefile (original)
+++ freeswitch/branches/mishehu/src/mod/loggers/mod_cdr/Makefile Mon Jul 24 00:13:01 2006
@@ -1,7 +1,7 @@
LDFLAGS += -I/usr/include/mysql -L/usr/lib64/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -lssl -lcrypto
CFLAGS += -I/usr/include/mysql -L/usr/lib64/mysql
CPPCC = g++
-OBJS=cdrcontainer.o basecdr.o baseregistry.o mysqlcdr.o
+OBJS=cdrcontainer.o basecdr.o baseregistry.o mysqlcdr.o pddcdr.o
all: depends $(OBJS) $(MODNAME).$(DYNAMIC_LIB_EXTEN)
Modified: freeswitch/branches/mishehu/src/mod/loggers/mod_cdr/README
==============================================================================
--- freeswitch/branches/mishehu/src/mod/loggers/mod_cdr/README (original)
+++ freeswitch/branches/mishehu/src/mod/loggers/mod_cdr/README Mon Jul 24 00:13:01 2006
@@ -40,10 +40,10 @@
<param name="chanvars_supp" value=""/> value is a comma separated list of supplemental channel variables to log. It can be a wildcard (*). (optional)
<param name="repeat_fixed_in_supp" value=""/> value is a 0 for no, 1 for yes, and is for the case that you might want any fixed channel variables to be repeated in the supplemental list.
-Class: AnthmCDR, located in anthmcdr.h and anthmcdr.cpp
+Class: PddCDR, located in pddcdr.h and pddcdr.cpp
Description: This is the Perl Data Dumper output class. It writes each record to an individual text file
containing all the information. It does not distinguish between fixed and supplemental channel variables. If you are running freeswitch in a high volume environment, it is important to note that these individual files are small, often times between 750 and 1500 bytes. It is therefore recommended to use a partition with small cluster sizes or (on systems supporting) on reiserfs or reiser4 filesystems which are both excellent handlers of large numbers of small files.
-Configuration: Section name: <anthmcdr>
+Configuration: Section name: <pddcdr>
<param name="path" value=""/> value is the path where you want the output files (required)
<param name="chanvars" value=""/> value is a comma separated list of channel variables to log. It can accept a wildcard (*) (optional)
@@ -71,11 +71,11 @@
A: Here is an excerpt from the freeswitch XML configuration file:
<configuration name="mod_cdr.conf" description="CDR Configuration">
- <anthmcdr>
- <param name="path" value="/work/temp/anthmcdr"/>
+ <pddcdr>
+ <param name="path" value="/work/temp/pddcdr"/>
<param name="chanvars" value="username,accountcode"/>
<param name="chanvars_fixed" value="*"/>
- </anthmcdr>
+ </pddcdr>
<csvcdr>
<param name="path" value="/work/temp/csvcdr"/>
<param name="size_limit" value="25"/>
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 Mon Jul 24 00:13:01 2006
@@ -4,7 +4,7 @@
* Copyright 2006, Author: Yossi Neiman, president of Cartis Solutions, Inc.
* <freeswitch AT cartissolutions.com>
*
-* Description: This C++ source file describes the AnthmCDR class which handles formatting a CDR out to
+* Description: This C++ source file describes the PddCDR class which handles formatting a CDR out to
* individual text files in a Perl Data Dumper format. It is named in honor of Anthony Minnesale, as he
* was the initial requester of this format.
*
@@ -23,21 +23,21 @@
* The Core API is the FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application by
* Anthony Minnesale II <anthmct at yahoo.com>
*
-* anthmcdr.cpp
+* pddcdr.cpp
*
*/
#include <switch.h>
-#include "anthmcdr.h"
+#include "pddcdr.h"
-AnthmCDR::AnthmCDR() : BaseCDR()
+PddCDR::PddCDR() : BaseCDR()
{
memset(formattedcallstartdate,0,100);
memset(formattedcallanswerdate,0,100);
memset(formattedcallenddate,0,100);
}
-AnthmCDR::AnthmCDR(switch_mod_cdr_newchannel_t *newchannel) : BaseCDR(newchannel)
+PddCDR::PddCDR(switch_mod_cdr_newchannel_t *newchannel) : BaseCDR(newchannel)
{
memset(formattedcallstartdate,0,100);
memset(formattedcallanswerdate,0,100);
@@ -69,7 +69,7 @@
outputfile_name.append(callenddate_forfile); // Make sorting a bit easier, kinda like Maildir does
outputfile_name.append(".");
outputfile_name.append(myuuid); // The goal is to have a resulting filename of "/path/to/myuuid"
- outputfile_name.append(".atm"); // The extension is in honor of anthm
+ outputfile_name.append(".pdd"); // .pdd - "perl data dumper"
outputfile.open(outputfile_name.c_str());
@@ -78,25 +78,25 @@
}
}
-AnthmCDR::~AnthmCDR()
+PddCDR::~PddCDR()
{
outputfile.close();
}
-bool AnthmCDR::activated=0;
-bool AnthmCDR::logchanvars=0;
-bool AnthmCDR::connectionstate=0;
-std::string AnthmCDR::outputfile_path;
-std::list<std::string> AnthmCDR::chanvars_fixed_list;
-std::list<std::string> AnthmCDR::chanvars_supp_list;
+bool PddCDR::activated=0;
+bool PddCDR::logchanvars=0;
+bool PddCDR::connectionstate=0;
+std::string PddCDR::outputfile_path;
+std::list<std::string> PddCDR::chanvars_fixed_list;
+std::list<std::string> PddCDR::chanvars_supp_list;
-void AnthmCDR::connect(switch_xml_t& cfg, switch_xml_t& xml, switch_xml_t& settings, switch_xml_t& param)
+void PddCDR::connect(switch_xml_t& cfg, switch_xml_t& xml, switch_xml_t& settings, switch_xml_t& param)
{
- switch_console_printf(SWITCH_CHANNEL_LOG, "AnthmCDR::connect() - Loading configuration file.\n");
+ switch_console_printf(SWITCH_CHANNEL_LOG, "PddCDR::connect() - Loading configuration file.\n");
activated = 0; // Set it as inactive initially
connectionstate = 0; // Initialize it to false to show that we aren't yet connected.
- if ((settings = switch_xml_child(cfg, "anthmcdr")))
+ if ((settings = switch_xml_child(cfg, "pddcdr")))
{
int count_config_params = 0; // Need to make sure all params are set before we load
for (param = switch_xml_child(settings, "param"); param; param = param->next)
@@ -126,26 +126,26 @@
}
else if (!strcmp(var, "chanvars_fixed"))
{
- switch_console_printf(SWITCH_CHANNEL_LOG,"AnthmCDR has no need for a fixed or supplemental list of channel variables due to the nature of the format. Please use the setting parameter of \"chanvars\" instead and try again.\n");
+ switch_console_printf(SWITCH_CHANNEL_LOG,"PddCDR has no need for a fixed or supplemental list of channel variables due to the nature of the format. Please use the setting parameter of \"chanvars\" instead and try again.\n");
}
else if (!strcmp(var, "chanvars_supp"))
{
- switch_console_printf(SWITCH_CHANNEL_LOG,"AnthmCDR has no need for a fixed or supplemental list of channel variables due to the nature of the format. Please use the setting parameter of \"chanvars\" instead and try again.\n");
+ switch_console_printf(SWITCH_CHANNEL_LOG,"PddCDR has no need for a fixed or supplemental list of channel variables due to the nature of the format. Please use the setting parameter of \"chanvars\" instead and try again.\n");
}
}
if(count_config_params > 0)
activated = 1;
else
- switch_console_printf(SWITCH_CHANNEL_LOG,"AnthmCDR::connect(): You did not specify the minimum parameters for using this module. You must specify at least a path to have the records logged to.\n");
+ switch_console_printf(SWITCH_CHANNEL_LOG,"PddCDR::connect(): You did not specify the minimum parameters for using this module. You must specify at least a path to have the records logged to.\n");
}
}
-bool AnthmCDR::process_record()
+bool PddCDR::process_record()
{
bool retval = 0;
if(!outputfile)
- switch_console_printf(SWITCH_CHANNEL_LOG, "AnthmCDR::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());
+ switch_console_printf(SWITCH_CHANNEL_LOG, "PddCDR::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
{
// Format the call record and proceed from here...
@@ -188,24 +188,24 @@
return retval;
}
-bool AnthmCDR::is_activated()
+bool PddCDR::is_activated()
{
return activated;
}
-void AnthmCDR::tempdump_record()
+void PddCDR::tempdump_record()
{
}
-void AnthmCDR::reread_tempdumped_records()
+void PddCDR::reread_tempdumped_records()
{
}
-void AnthmCDR::disconnect()
+void PddCDR::disconnect()
{
- switch_console_printf(SWITCH_CHANNEL_LOG,"Shutting down AnthmCDR... Done!");
+ switch_console_printf(SWITCH_CHANNEL_LOG,"Shutting down PddCDR... Done!");
}
-AUTO_REGISTER_BASECDR(AnthmCDR);
+AUTO_REGISTER_BASECDR(PddCDR);
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 Mon Jul 24 00:13:01 2006
@@ -4,9 +4,8 @@
* Copyright 2006, Author: Yossi Neiman, president of Cartis Solutions, Inc.
* <freeswitch AT cartissolutions.com>
*
-* Description: This C++ header file describes the AnthmCDR class which handles formatting a CDR out to
-* individual text files in a Perl Data Dumper format. It is named in honor of Anthony Minnesale, as he
-* was the initial requester of this format.
+* 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.
*
*
* Version: MPL 1.1
@@ -23,7 +22,7 @@
* The Core API is the FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application by
* Anthony Minnesale II <anthmct at yahoo.com>
*
-* anthmcdr.h
+* pddcdr.h
*
*/
@@ -34,15 +33,15 @@
#include <fstream>
#include <list>
-#ifndef ANTHMCDR
-#define ANTHMCDR
+#ifndef PDDCDR
+#define PDDMCDR
-class AnthmCDR : public BaseCDR {
+class PddCDR : public BaseCDR {
public:
- AnthmCDR();
- AnthmCDR(switch_mod_cdr_newchannel_t *newchannel);
- //AnthmCDR(const AnthmCDR& copyFrom);
- virtual ~AnthmCDR();
+ PddCDR();
+ PddCDR(switch_mod_cdr_newchannel_t *newchannel);
+ //PddCDR(const PddCDR& copyFrom);
+ virtual ~PddCDR();
virtual bool process_record();
virtual void connect(switch_xml_t& cfg, switch_xml_t& xml, switch_xml_t& settings, switch_xml_t& param); // connect and disconnect need to be static because we're persisting connections until shutdown
virtual void disconnect();
More information about the Freeswitch-branches
mailing list