1.1.10 release

git-svn-id: svn://192.168.202.10@1 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
root
2006-07-07 14:57:59 +00:00
commit 9c9de75826
706 changed files with 235239 additions and 0 deletions
+57
View File
@@ -0,0 +1,57 @@
#!/usr/bin/perl
# ADMIN_area_code_populate.pl version 1.1 for Perl
#
# Copyright (C) 2006 Joe Johnson,Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
#
# Description:
# server application that allows load areacodes into to asterisk list database
#
use lib ".\\",".\\libs", './', './libs', '../libs', '/usr/local/perl_TK/libs', 'C:\\AST_VICI\\libs';
use Time::HiRes ('gettimeofday','usleep','sleep'); # needed to have perl sleep in increments of less than one second
use Net::MySQL;
### Make sure this file is in a libs path or put the absolute path to it
require("/home/cron/AST_SERVER_conf.pl"); # local configuration file
if (!$DB_port) {$DB_port='3306';}
$dbh = Net::MySQL->new(hostname => "$DB_server", database => "$DB_database", user => "$DB_user", password => "$DB_pass", port => "$DB_port")
or die "Couldn't connect to database: $DB_server - $DB_database\n";
$slash_star = '\*';
open(codefile, "/home/cron/phone_codes_GMT.txt") || die "can't open /home/cron/phone_codes_GMT.txt: $!\n";
@codefile = <codefile>;
close(codefile);
$pc=0;
$ins_stmt="insert into vicidial_phone_codes VALUES ";
foreach (@codefile) {
@row=split(/\t/, $codefile[$pc]);
$row[7] =~ s/\r|\n|\t| $//gi;
$row[6] =~ s/\r|\n|\t| $//gi;
$row[5] =~ s/\r|\n|\t| $//gi;
$row[4] =~ s/\r|\n|\t| $//gi;
$row[3] =~ s/\r|\n|\t| $//gi;
$row[2] =~ s/\r|\n|\t| $//gi;
$row[1] =~ s/\r|\n|\t| $//gi;
$row[0] =~ s/\r|\n|\t| $//gi;
$pc++;
$ins_stmt.="('$row[0]', '$row[1]', '$row[2]', '$row[3]', '$row[4]', '$row[5]', '$row[6]', '$row[7]'), ";
if ($pc =~ /00$/) {
chop($ins_stmt);
chop($ins_stmt);
$dbh->query($ins_stmt) || die "can't execute query: |$ins_stmt| $!\n";
$ins_stmt="insert into vicidial_phone_codes VALUES ";
print STDERR "$pc\n";
}
}
chop($ins_stmt);
chop($ins_stmt);
$dbh->query($ins_stmt);
$ins_stmt="insert into vicidial_phone_codes VALUES ";
print STDERR "$pc\n";
exit;