Thread: [Astpp-commit] SF.net SVN: astpp:[2225] trunk/freeswitch/contrib/wasim/cdrload.pl
Brought to you by:
darrenkw
From: <dar...@us...> - 2009-01-31 19:58:09
|
Revision: 2225 http://astpp.svn.sourceforge.net/astpp/?rev=2225&view=rev Author: darrenkw Date: 2009-01-31 19:57:58 +0000 (Sat, 31 Jan 2009) Log Message: ----------- Corrected which table the data is getting placed into. Modified Paths: -------------- trunk/freeswitch/contrib/wasim/cdrload.pl Modified: trunk/freeswitch/contrib/wasim/cdrload.pl =================================================================== --- trunk/freeswitch/contrib/wasim/cdrload.pl 2009-01-31 18:53:47 UTC (rev 2224) +++ trunk/freeswitch/contrib/wasim/cdrload.pl 2009-01-31 19:57:58 UTC (rev 2225) @@ -36,7 +36,8 @@ foreach my $line (@LS) { chop($line); $ASTPP->debug($line); - my $stm = "load data local infile '$line' into table TABLE fields enclosed by '\"' terminated by ','"; + my $stm = "load data local infile '$line' into table $config->{freeswitch_cdr_table} fields enclosed by '\"' terminated by ','"; + print STDERR $stm if $config->{debug} == 1; my $ul = $cdr_db->prepare($stm) or die "$0: Couldn't prepare statement $stm: " . $cdr_db->errstr;; $ul->execute(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dar...@us...> - 2009-09-23 04:30:05
|
Revision: 2258 http://astpp.svn.sourceforge.net/astpp/?rev=2258&view=rev Author: darrenkw Date: 2009-09-23 04:29:52 +0000 (Wed, 23 Sep 2009) Log Message: ----------- Convert program from DOS to UNIX. Modified Paths: -------------- trunk/freeswitch/contrib/wasim/cdrload.pl Modified: trunk/freeswitch/contrib/wasim/cdrload.pl =================================================================== --- trunk/freeswitch/contrib/wasim/cdrload.pl 2009-09-22 23:10:07 UTC (rev 2257) +++ trunk/freeswitch/contrib/wasim/cdrload.pl 2009-09-23 04:29:52 UTC (rev 2258) @@ -1,49 +1,49 @@ -#!/usr/bin/perl -w - -# Convergence FreeSwitch Tools Version 7.0 : AGI -# (c) MMII Convergence. All rights reserved. -# <in...@co...> http://www.convergence.pk -# <da...@al...> http://www.aleph-com.net - -# This program is free software, distributed under the terms of -# the GNU General Public License.http://www.gnu.org/licenses.html - -use strict; -use DBI(); -use ASTPP; -use lib './lib', '../lib'; -require "/usr/local/astpp/astpp-common.pl"; - -use vars qw($config $astpp_db $osc_db $agile_db $cdr_db - @output @cardlist $config $params $ASTPP); - -sub initialize() { - $config = &load_config(); - $astpp_db = &connect_db( $config, @output ); - $config = &load_config_db($astpp_db,$config) if $astpp_db; - $cdr_db = &cdr_connect_db( $config, @output ); -} - -$ASTPP = ASTPP->new; -$ASTPP->set_verbosity(4); #Tell ASTPP debugging how verbose we want to be. -&initialize; - -my @cc = ("killall", "-HUP", "freeswitch"); -system(@cc) == 0 - or die "$0: system @cc failed: $?"; - -my @LS = `ls -1t /usr/local/freeswitch/log/cdr-csv/Master.csv.*`; -foreach my $line (@LS) { - chop($line); - $ASTPP->debug($line); - my $stm = "load data local infile '$line' into table $config->{freeswitch_cdr_table} fields enclosed by '\"' terminated by ','"; +#!/usr/bin/perl -w + +# Convergence FreeSwitch Tools Version 7.0 : AGI +# (c) MMII Convergence. All rights reserved. +# <in...@co...> http://www.convergence.pk +# <da...@al...> http://www.aleph-com.net + +# This program is free software, distributed under the terms of +# the GNU General Public License.http://www.gnu.org/licenses.html + +use strict; +use DBI(); +use ASTPP; +use lib './lib', '../lib'; +require "/usr/local/astpp/astpp-common.pl"; + +use vars qw($config $astpp_db $osc_db $agile_db $cdr_db + @output @cardlist $config $params $ASTPP); + +sub initialize() { + $config = &load_config(); + $astpp_db = &connect_db( $config, @output ); + $config = &load_config_db($astpp_db,$config) if $astpp_db; + $cdr_db = &cdr_connect_db( $config, @output ); +} + +$ASTPP = ASTPP->new; +$ASTPP->set_verbosity(4); #Tell ASTPP debugging how verbose we want to be. +&initialize; + +my @cc = ("killall", "-HUP", "freeswitch"); +system(@cc) == 0 + or die "$0: system @cc failed: $?"; + +my @LS = `ls -1t /usr/local/freeswitch/log/cdr-csv/Master.csv.*`; +foreach my $line (@LS) { + chop($line); + $ASTPP->debug($line); + my $stm = "load data local infile '$line' into table $config->{freeswitch_cdr_table} fields enclosed by '\"' terminated by ','"; print STDERR $stm if $config->{debug} == 1; - my $ul = $cdr_db->prepare($stm) - or die "$0: Couldn't prepare statement $stm: " . $cdr_db->errstr;; - $ul->execute(); - $ul->finish; - system("cat $line >> /usr/local/freeswitch/log/cdr-csv/FULL_Master.csv"); - unlink $line; -} - -exit; + my $ul = $cdr_db->prepare($stm) + or die "$0: Couldn't prepare statement $stm: " . $cdr_db->errstr;; + $ul->execute(); + $ul->finish; + system("cat $line >> /usr/local/freeswitch/log/cdr-csv/FULL_Master.csv"); + unlink $line; +} + +exit; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dar...@us...> - 2009-09-23 04:31:40
|
Revision: 2259 http://astpp.svn.sourceforge.net/astpp/?rev=2259&view=rev Author: darrenkw Date: 2009-09-23 04:31:30 +0000 (Wed, 23 Sep 2009) Log Message: ----------- Corrected the usage of ASTPP->debug object. Modified Paths: -------------- trunk/freeswitch/contrib/wasim/cdrload.pl Modified: trunk/freeswitch/contrib/wasim/cdrload.pl =================================================================== --- trunk/freeswitch/contrib/wasim/cdrload.pl 2009-09-23 04:29:52 UTC (rev 2258) +++ trunk/freeswitch/contrib/wasim/cdrload.pl 2009-09-23 04:31:30 UTC (rev 2259) @@ -35,9 +35,9 @@ my @LS = `ls -1t /usr/local/freeswitch/log/cdr-csv/Master.csv.*`; foreach my $line (@LS) { chop($line); - $ASTPP->debug($line); + $ASTPP->debug( debug => $line); my $stm = "load data local infile '$line' into table $config->{freeswitch_cdr_table} fields enclosed by '\"' terminated by ','"; - print STDERR $stm if $config->{debug} == 1; + $ASTPP->debug( debug => $stm); my $ul = $cdr_db->prepare($stm) or die "$0: Couldn't prepare statement $stm: " . $cdr_db->errstr;; $ul->execute(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |