From f573640ef9db1630f2d6770e5fa37e6edaa5fcad Mon Sep 17 00:00:00 2001 From: mattf Date: Tue, 10 Oct 2006 20:43:46 +0000 Subject: [PATCH] updated TESTfastagi script updated SCRATCH_INSTALL asterisk SVN instructions git-svn-id: svn://192.168.202.10@345 3d104415-ff17-0410-8863-d5cf3c621b8a --- bin/TEST_VDfastAGI.pl | 63 ++++++++++++++++++++++++++++++++++++---- docs/SCRATCH_INSTALL.txt | 6 +++- 2 files changed, 63 insertions(+), 6 deletions(-) diff --git a/bin/TEST_VDfastAGI.pl b/bin/TEST_VDfastAGI.pl index 6439ba38..8a0891e0 100644 --- a/bin/TEST_VDfastAGI.pl +++ b/bin/TEST_VDfastAGI.pl @@ -53,6 +53,8 @@ foreach(@conf) { $line = $conf[$i]; $line =~ s/ |>|\n|\r|\t|\#.*|;.*//gi; + if ( ($line =~ /^PATHlogs/) && ($CLIlogs < 1) ) + {$PATHlogs = $line; $PATHlogs =~ s/.*=//gi;} if ( ($line =~ /^VARfastagi_log_min_servers/) && ($CLIVARfastagi_log_min_servers < 1) ) {$VARfastagi_log_min_servers = $line; $VARfastagi_log_min_servers =~ s/.*=//gi;} if ( ($line =~ /^VARfastagi_log_max_servers/) && ($CLIVARfastagi_log_max_servers < 1) ) @@ -67,13 +69,63 @@ foreach(@conf) {$VARfastagi_log_checkfordead = $line; $VARfastagi_log_checkfordead =~ s/.*=//gi;} if ( ($line =~ /^VARfastagi_log_checkforwait/) && ($CLIVARfastagi_log_checkforwait < 1) ) {$VARfastagi_log_checkforwait = $line; $VARfastagi_log_checkforwait =~ s/.*=//gi;} + if ( ($line =~ /^VARserver_ip/) && ($CLIserver_ip < 1) ) + {$VARserver_ip = $line; $VARserver_ip =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_server/) && ($CLIDB_server < 1) ) + {$VARDB_server = $line; $VARDB_server =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_database/) && ($CLIDB_database < 1) ) + {$VARDB_database = $line; $VARDB_database =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_user/) && ($CLIDB_user < 1) ) + {$VARDB_user = $line; $VARDB_user =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_pass/) && ($CLIDB_pass < 1) ) + {$VARDB_pass = $line; $VARDB_pass =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_port/) && ($CLIDB_port < 1) ) + {$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;} $i++; } +($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); +$year = ($year + 1900); +$mon++; +if ($mon < 10) {$mon = "0$mon";} +if ($mday < 10) {$mday = "0$mday";} +if ($hour < 10) {$Fhour = "0$hour";} +if ($min < 10) {$min = "0$min";} +if ($sec < 10) {$sec = "0$sec";} + +if (!$VARDB_port) {$VARDB_port='3306';} + +$SERVERLOG = 'N'; +$log_level = '0'; + +use DBI; +$dbhB = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass") + or die "Couldn't connect to database: " . DBI->errstr; + +### Grab Server values from the database +$stmtB = "SELECT vd_server_logs FROM servers where server_ip = '$VARserver_ip';"; +$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr; +$sthB->execute or die "executing: $stmtB ", $dbhB->errstr; +$sthBrows=$sthB->rows; +$rec_count=0; +while ($sthBrows > $rec_count) + { + @aryB = $sthB->fetchrow_array; + $SERVERLOG = "$aryB[0]"; + $rec_count++; + } +$sthB->finish(); +$dbhB->disconnect(); + +if ($SERVERLOG =~ /Y/) + { + $childLOGfile = "$PATHlogs/FastAGIchildLOG.$year-$mon-$mday"; + $log_level = "4"; + print "SERVER LOGGING ON: LEVEL-$log_level FILE-$childLOGfile\n"; + } package TEST_VDfastAGI; -use DBI; use Net::Server; use Asterisk::AGI; use vars qw(@ISA); @@ -163,6 +215,8 @@ sub process_request { $sthA->finish(); + + if ($AGILOG) { $agi_string = "+++++++++++++++++ FastAGI Start ++++++++++++++++++++++++++++++++++++++++"; @@ -651,14 +705,15 @@ TEST_VDfastAGI->run( port=>4577, user=>'root', group=>'root', - background=>1, min_servers=>$VARfastagi_log_min_servers, max_servers=>$VARfastagi_log_max_servers, min_spare_servers=>$VARfastagi_log_min_spare_servers, max_spare_servers=>$VARfastagi_log_max_spare_servers, max_requests=>$VARfastagi_log_max_requests, check_for_dead=>$VARfastagi_log_checkfordead, - check_for_waiting=>$VARfastagi_log_checkforwait + check_for_waiting=>$VARfastagi_log_checkforwait, + log_file=>$childLOGfile, + log_level=>$log_level ); exit; @@ -666,8 +721,6 @@ exit; - - sub agi_output { if ($AGILOG >=2) diff --git a/docs/SCRATCH_INSTALL.txt b/docs/SCRATCH_INSTALL.txt index 4e951ac8..44b0d20d 100644 --- a/docs/SCRATCH_INSTALL.txt +++ b/docs/SCRATCH_INSTALL.txt @@ -759,7 +759,11 @@ with the following patch: - tar xvf zaptel-1.2.9.1.tar - gunzip libpri-1.2.3.tar.gz - tar xvf libpri-1.2.3.tar - B. if you want latest SVN_DEV version (sometimes unstable) [1.3 tree] + B. if you want latest SVN_1.2 version (release tree with new patches) + - svn checkout http://svn.digium.com/svn/asterisk/branches/1.2 asterisk-1.2 + - svn checkout http://svn.digium.com/svn/asterisk/branches/1.2 asterisk-1.2 + - svn checkout http://svn.digium.com/svn/asterisk/branches/1.2 asterisk-1.2 + C. if you want latest SVN_DEV version (not recommended) [1.5 tree] - svn checkout http://svn.digium.com/svn/asterisk/trunk asterisk - svn checkout http://svn.digium.com/svn/zaptel/trunk zaptel - svn checkout http://svn.digium.com/svn/libpri/trunk libpri