From 1a25d910442f379d2d12f5604b3ea70e5c0ed7d3 Mon Sep 17 00:00:00 2001 From: Yossi Neiman Date: Mon, 22 Jan 2007 23:33:35 +0000 Subject: [PATCH] Merged changes from my branch r4024. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4025 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/event_handlers/mod_cdr/Makefile | 6 +++--- src/mod/event_handlers/mod_cdr/basecdr.cpp | 2 +- src/mod/event_handlers/mod_cdr/csvcdr.cpp | 7 +++++-- src/mod/event_handlers/mod_cdr/curlcdr.cpp | 7 +++++-- src/mod/event_handlers/mod_cdr/pddcdr.cpp | 5 +++-- src/mod/event_handlers/mod_cdr/xmlcdr.cpp | 6 ++++-- 6 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/mod/event_handlers/mod_cdr/Makefile b/src/mod/event_handlers/mod_cdr/Makefile index 6f72c21bf0..bc86663d24 100644 --- a/src/mod/event_handlers/mod_cdr/Makefile +++ b/src/mod/event_handlers/mod_cdr/Makefile @@ -1,11 +1,11 @@ -CFLAGS += $(shell mysql_config --include) +#CFLAGS += $(shell mysql_config --include) #CFLAGS += -DSWITCH_QUEUE_ENHANCED -LDFLAGS += $(shell mysql_config --libs) +#LDFLAGS += $(shell mysql_config --libs) #LDFLAGS += -lcurl CPPCC = g++ -OBJS=cdrcontainer.o basecdr.o baseregistry.o mysqlcdr.o pddcdr.o csvcdr.o xmlcdr.o +OBJS=cdrcontainer.o basecdr.o baseregistry.o mysqlcdr.o pddcdr.o csvcdr.o xmlcdr.o sqlitecdr.o all: depends $(OBJS) $(MODNAME).$(DYNAMIC_LIB_EXTEN) diff --git a/src/mod/event_handlers/mod_cdr/basecdr.cpp b/src/mod/event_handlers/mod_cdr/basecdr.cpp index 4c3415cb1b..05bd3d3110 100644 --- a/src/mod/event_handlers/mod_cdr/basecdr.cpp +++ b/src/mod/event_handlers/mod_cdr/basecdr.cpp @@ -324,7 +324,7 @@ void BaseCDR::process_channel_variables(const std::list& stringlist temppair.second = tempvariable; chanvars_fixed.push_back(temppair); - } + } } // This one is for processing of supplemental chanvars diff --git a/src/mod/event_handlers/mod_cdr/csvcdr.cpp b/src/mod/event_handlers/mod_cdr/csvcdr.cpp index 9f636c30b7..982b9259c1 100644 --- a/src/mod/event_handlers/mod_cdr/csvcdr.cpp +++ b/src/mod/event_handlers/mod_cdr/csvcdr.cpp @@ -74,8 +74,11 @@ CsvCDR::CsvCDR(switch_mod_cdr_newchannel_t *newchannel) : BaseCDR(newchannel) switch_strftime(formattedcalltransferdate,&retsizectd,sizeof(formattedcalltransferdate),format,&tempcalltransfer); switch_strftime(formattedcallenddate,&retsizeced,sizeof(formattedcallenddate),format,&tempcallend); - process_channel_variables(chanvars_fixed_list,newchannel->channel); - process_channel_variables(chanvars_supp_list,chanvars_fixed_list,newchannel->channel,repeat_fixed_in_supp); + if(chanvars_fixed_list.size() > 0) + process_channel_variables(chanvars_fixed_list,newchannel->channel); + + if(chanvars_supp_list.size() > 0) + process_channel_variables(chanvars_supp_list,chanvars_fixed_list,newchannel->channel,repeat_fixed_in_supp); } } diff --git a/src/mod/event_handlers/mod_cdr/curlcdr.cpp b/src/mod/event_handlers/mod_cdr/curlcdr.cpp index 50dde5865c..bfc55736f9 100644 --- a/src/mod/event_handlers/mod_cdr/curlcdr.cpp +++ b/src/mod/event_handlers/mod_cdr/curlcdr.cpp @@ -79,8 +79,11 @@ CurlCDR::CurlCDR(switch_mod_cdr_newchannel_t *newchannel) : BaseCDR(newchannel) switch_strftime(formattedcalltransferdate,&retsizectd,sizeof(formattedcalltransferdate),format,&tempcalltransfer); switch_strftime(formattedcallenddate,&retsizeced,sizeof(formattedcallenddate),format,&tempcallend); - process_channel_variables(chanvars_fixed_list,newchannel->channel); - process_channel_variables(chanvars_supp_list,chanvars_fixed_list,newchannel->channel,0); + if(chanvars_fixed_list.size() > 0) + process_channel_variables(chanvars_fixed_list,newchannel->channel); + + if(chanvars_supp_list.size() > 0) + process_channel_variables(chanvars_supp_list,chanvars_fixed_list,newchannel->channel,0); } } diff --git a/src/mod/event_handlers/mod_cdr/pddcdr.cpp b/src/mod/event_handlers/mod_cdr/pddcdr.cpp index 5ed5723bfa..ea84a16e92 100644 --- a/src/mod/event_handlers/mod_cdr/pddcdr.cpp +++ b/src/mod/event_handlers/mod_cdr/pddcdr.cpp @@ -79,8 +79,9 @@ PddCDR::PddCDR(switch_mod_cdr_newchannel_t *newchannel) : BaseCDR(newchannel) outputfile_name.append("."); outputfile_name.append(myuuid); // The goal is to have a resulting filename of "/path/to/myuuid" outputfile_name.append(".pdd"); // .pdd - "perl data dumper" - bool repeat = 1; - process_channel_variables(chanvars_supp_list,chanvars_fixed_list,newchannel->channel,repeat); + bool repeat_fixed_in_supp = 1; + if(chanvars_supp_list.size() > 0) + process_channel_variables(chanvars_supp_list,chanvars_fixed_list,newchannel->channel,repeat_fixed_in_supp); } } diff --git a/src/mod/event_handlers/mod_cdr/xmlcdr.cpp b/src/mod/event_handlers/mod_cdr/xmlcdr.cpp index 6429591f0f..31726f262a 100644 --- a/src/mod/event_handlers/mod_cdr/xmlcdr.cpp +++ b/src/mod/event_handlers/mod_cdr/xmlcdr.cpp @@ -80,8 +80,10 @@ XmlCDR::XmlCDR(switch_mod_cdr_newchannel_t *newchannel) : BaseCDR(newchannel) outputfile_name.append(myuuid); // The goal is to have a resulting filename of "/path/to/myuuid" outputfile_name.append(".xml"); // .xml - "XML Data Dumper" - bool repeat = 1; - process_channel_variables(chanvars_supp_list,chanvars_fixed_list,newchannel->channel,repeat); + bool repeat_fixed_in_supp = 1; + + if(chanvars_supp_list.size() > 0) + process_channel_variables(chanvars_supp_list,chanvars_fixed_list,newchannel->channel,repeat_fixed_in_supp); } }