Created the viciagi.pm library and moved the agi functions out of vicidial.pm.
Updated the vicilib-testcode.pl to test both libraries. Removed the GMT_USA_zip.txt and phone_codes_GMT.txt files as they are not downloaded from phonecodes.vicidial.com Changed ADMIN_area_code_populate.pl so that it pulls the GMT_USA_zip.txt and phone_codes_GMT.txt files rom phonecodes.vicidial.com so we can update the data after a release incase area code data changes. This means that users do not need to update to the latest vicidial code to get changes to the area code data. git-svn-id: svn://192.168.202.10@836 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -12,11 +12,14 @@
|
||||
# 60807-1003 - Changed to DBI
|
||||
# - changed to use /etc/astguiclient.conf for configs
|
||||
# 61122-1902 - Added GMT_USA_zip.txt data import for USA postal GMT data
|
||||
#
|
||||
# 80416-1017 -
|
||||
|
||||
|
||||
# default path to astguiclient configuration file:
|
||||
$PATHconf = '/etc/astguiclient.conf';
|
||||
$PATHconf = "/etc/astguiclient.conf";
|
||||
$domain = "http://phonecodes.vicidial.com";
|
||||
$URL1 = "$domain/phone_codes_GMT-latest.txt";
|
||||
$URL2 = "$domain/GMT_USA_zip-latest.txt";
|
||||
|
||||
open(conf, "$PATHconf") || die "can't open $PATHconf: $!\n";
|
||||
@conf = <conf>;
|
||||
@@ -67,9 +70,16 @@ $dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VA
|
||||
|
||||
$slash_star = '\*';
|
||||
|
||||
#### download the latest phone code table ####
|
||||
chdir("$PATHhome");
|
||||
|
||||
print STDERR "Downloading latest phone codes tables\n";
|
||||
|
||||
`wget $URL1`;
|
||||
`wget $URL2`;
|
||||
|
||||
#### BEGIN vicidial_phone_codes population from phone_codes_GMT.txt file ####
|
||||
open(codefile, "$PATHhome/phone_codes_GMT.txt") || die "can't open $PATHhome/phone_codes_GMT.txt: $!\n";
|
||||
open(codefile, "$PATHhome/phone_codes_GMT-latest.txt") || die "can't open $PATHhome/phone_codes_GMT-latest.txt: $!\n";
|
||||
@codefile = <codefile>;
|
||||
close(codefile);
|
||||
$pc=0;
|
||||
@@ -110,7 +120,7 @@ print STDERR "$pc\n";
|
||||
|
||||
|
||||
#### BEGIN vicidial_postal_codes population from GMT_USA_zip.txt file ####
|
||||
open(zipfile, "$PATHhome/GMT_USA_zip.txt") || die "can't open $PATHhome/GMT_USA_zip.txt: $!\n";
|
||||
open(zipfile, "$PATHhome/GMT_USA_zip-latest.txt") || die "can't open $PATHhome/GMT_USA_zip-latest.txt: $!\n";
|
||||
@zipfile = <zipfile>;
|
||||
close(zipfile);
|
||||
$pc=0;
|
||||
@@ -145,4 +155,4 @@ print STDERR "$pc\n";
|
||||
|
||||
$dbhA->disconnect();
|
||||
|
||||
exit;
|
||||
exit;
|
||||
|
||||
Reference in New Issue
Block a user