[Astpp-commit] SF.net SVN: astpp:[2192] trunk/freeswitch
Brought to you by:
darrenkw
From: <dar...@us...> - 2008-09-02 05:04:52
|
Revision: 2192 http://astpp.svn.sourceforge.net/astpp/?rev=2192&view=rev Author: darrenkw Date: 2008-09-02 05:04:59 +0000 (Tue, 02 Sep 2008) Log Message: ----------- Add a contributed script and modify it to use mostly ASTPP configuration rather than inline configuration. Add partial support for time limiting FreeSwitch LCR calls. Modified Paths: -------------- trunk/freeswitch/astpp-fs-xml.pl Added Paths: ----------- trunk/freeswitch/contrib/ trunk/freeswitch/contrib/wasim/ trunk/freeswitch/contrib/wasim/README trunk/freeswitch/contrib/wasim/cdrload.pl Modified: trunk/freeswitch/astpp-fs-xml.pl =================================================================== --- trunk/freeswitch/astpp-fs-xml.pl 2008-09-02 05:02:48 UTC (rev 2191) +++ trunk/freeswitch/astpp-fs-xml.pl 2008-09-02 05:04:59 UTC (rev 2192) @@ -149,6 +149,7 @@ exit(0); } +$xml = $ASTPP->fs_dialplan_xml_timelimit( xml => $xml, max_length => $maxlength); # Set the timelimit as well as other variables which are needed in the dialplan. my $timelimit = "L(" . sprintf( "%.0f", $maxlength * 60 * 1000 ) . ":60000:30000)"; Added: trunk/freeswitch/contrib/wasim/README =================================================================== --- trunk/freeswitch/contrib/wasim/README (rev 0) +++ trunk/freeswitch/contrib/wasim/README 2008-09-02 05:04:59 UTC (rev 2192) @@ -0,0 +1,4 @@ +This script was contributed by Wasim to the Freeswitch project. It is licensed under the GPL, therefore we're including it in this project with the appropriate adjustments made to make it work seemlessly together with ASTPP. + +Darren Wiebe +d...@al... Added: trunk/freeswitch/contrib/wasim/cdrload.pl =================================================================== --- trunk/freeswitch/contrib/wasim/cdrload.pl (rev 0) +++ trunk/freeswitch/contrib/wasim/cdrload.pl 2008-09-02 05:04:59 UTC (rev 2192) @@ -0,0 +1,48 @@ +#!/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 TABLE fields enclosed by '\"' terminated by ','"; + 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. |