From b9fa01202ab9ef72418b19c9b05040b8bb88aeb7 Mon Sep 17 00:00:00 2001 From: mattf Date: Sat, 18 Dec 2010 02:39:53 +0000 Subject: [PATCH] Small fixes to the audio store perl script and the preprocess script git-svn-id: svn://192.168.202.10@1579 3d104415-ff17-0410-8863-d5cf3c621b8a --- agc_2-X/trunk/bin/ADMIN_audio_store_sync.pl | 11 ++++++++-- .../bin/VICIDIAL_IN_preprocess_leads_file.pl | 22 +++++++++---------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/agc_2-X/trunk/bin/ADMIN_audio_store_sync.pl b/agc_2-X/trunk/bin/ADMIN_audio_store_sync.pl index e8029fc2..f11ef47f 100644 --- a/agc_2-X/trunk/bin/ADMIN_audio_store_sync.pl +++ b/agc_2-X/trunk/bin/ADMIN_audio_store_sync.pl @@ -6,7 +6,7 @@ # syncronizes audio between audio store and this server # # -# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGELOG # 90513-0458 - First Build @@ -14,6 +14,7 @@ # 90831-1349 - Added music-on-hold sync # 100621-1018 - Added admin_web_directory variable use # 100824-0032 - Fixed issue with first MoH file being skipped when playing in non-random order +# 101217-2137 - Small fix for admin directories not directly off of the webroot # # constants @@ -174,6 +175,7 @@ if ($sthArows > 0) $sthA->finish(); ### Grab system_settings values from the database +$web_prefix=''; $stmtA = "SELECT sounds_central_control_active,sounds_web_server,sounds_web_directory,admin_web_directory FROM system_settings;"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -185,6 +187,11 @@ if ($sthArows > 0) $sounds_web_server = $aryA[1]; $sounds_web_directory = $aryA[2]; $admin_web_directory = $aryA[3]; + if ($admin_web_directory =~ /\//) + { + $web_prefix = $admin_web_directory; + $web_prefix =~ s/\/.*/\//gi; + } } $sthA->finish(); @@ -286,7 +293,7 @@ while ($i <= $#list) if ( ($found_file < 1) || ($force_download > 0) ) { - `$wgetbin -q --output-document=$PATHsounds/$filename http://$sounds_web_server/$sounds_web_directory/$filename`; + `$wgetbin -q --output-document=$PATHsounds/$filename http://$sounds_web_server/$web_prefix$sounds_web_directory/$filename`; $event_string = "DOWNLOADING: $filename $filesize"; if ($DB > 0) {print " $event_string\n";} &event_logger; diff --git a/agc_2-X/trunk/bin/VICIDIAL_IN_preprocess_leads_file.pl b/agc_2-X/trunk/bin/VICIDIAL_IN_preprocess_leads_file.pl index b836ed4a..93369605 100644 --- a/agc_2-X/trunk/bin/VICIDIAL_IN_preprocess_leads_file.pl +++ b/agc_2-X/trunk/bin/VICIDIAL_IN_preprocess_leads_file.pl @@ -505,7 +505,7 @@ foreach(@FILES) $rank = '1'; $owner = 'home'; - print Pout "$vendor_lead_code|$source_id|$list_id|$phone_code|$phone_number|$title|$first_name|$middle|$last_name|$address1|$address2|$address3|$city|$state|$province|$postal_code|$country|$gender|$date_of_birth|$alt_phone|$email|$security_phrase|$comments|$called_count|$status|$entry_date|$rank|$owner|\n"; + print Pout "$vendor_lead_code|$source_id|$list_id|$phone_code|$phone_number|$title|$first_name|$middle|$last_name|$address1|$address2|$address3|$city|$state|$province|$postal_code|$country|$gender|$date_of_birth|$alt_phone|$email|$security_phrase|$owner|$called_count|$status|$entry_date|$rank|$owner|\n"; $b++; $phone_found++; if ($DBX) {print " $b|$phone_found - $a|$phone_number|$city|$rank|$owner|$vendor_lead_code|$source_id\n";} } @@ -516,7 +516,7 @@ foreach(@FILES) $rank = '2'; $owner = 'work'; - print Pout "$vendor_lead_code|$source_id|$list_id|$phone_code|$phone_number|$title|$first_name|$middle|$last_name|$address1|$address2|$address3|$city|$state|$province|$postal_code|$country|$gender|$date_of_birth|$alt_phone|$email|$security_phrase|$comments|$called_count|$status|$entry_date|$rank|$owner|\n"; + print Pout "$vendor_lead_code|$source_id|$list_id|$phone_code|$phone_number|$title|$first_name|$middle|$last_name|$address1|$address2|$address3|$city|$state|$province|$postal_code|$country|$gender|$date_of_birth|$alt_phone|$email|$security_phrase|$owner|$called_count|$status|$entry_date|$rank|$owner|\n"; $b++; $phone_found++; if ($DBX) {print " $b|$phone_found - $a|$phone_number|$city|$rank|$owner|$vendor_lead_code|$source_id\n";} } @@ -527,7 +527,7 @@ foreach(@FILES) $rank = '3'; $owner = 'cell'; - print Pout "$vendor_lead_code|$source_id|$list_id|$phone_code|$phone_number|$title|$first_name|$middle|$last_name|$address1|$address2|$address3|$city|$state|$province|$postal_code|$country|$gender|$date_of_birth|$alt_phone|$email|$security_phrase|$comments|$called_count|$status|$entry_date|$rank|$owner|\n"; + print Pout "$vendor_lead_code|$source_id|$list_id|$phone_code|$phone_number|$title|$first_name|$middle|$last_name|$address1|$address2|$address3|$city|$state|$province|$postal_code|$country|$gender|$date_of_birth|$alt_phone|$email|$security_phrase|$owner|$called_count|$status|$entry_date|$rank|$owner|\n"; $b++; $phone_found++; if ($DBX) {print " $b|$phone_found - $a|$phone_number|$city|$rank|$owner|$vendor_lead_code|$source_id\n";} } @@ -538,7 +538,7 @@ foreach(@FILES) $rank = '4'; $owner = 'alt1'; - print Pout "$vendor_lead_code|$source_id|$list_id|$phone_code|$phone_number|$title|$first_name|$middle|$last_name|$address1|$address2|$address3|$city|$state|$province|$postal_code|$country|$gender|$date_of_birth|$alt_phone|$email|$security_phrase|$comments|$called_count|$status|$entry_date|$rank|$owner|\n"; + print Pout "$vendor_lead_code|$source_id|$list_id|$phone_code|$phone_number|$title|$first_name|$middle|$last_name|$address1|$address2|$address3|$city|$state|$province|$postal_code|$country|$gender|$date_of_birth|$alt_phone|$email|$security_phrase|$owner|$called_count|$status|$entry_date|$rank|$owner|\n"; $b++; $phone_found++; if ($DBX) {print " $b|$phone_found - $a|$phone_number|$city|$rank|$owner|$vendor_lead_code|$source_id\n";} } @@ -549,7 +549,7 @@ foreach(@FILES) $rank = '5'; $owner = 'alt2'; - print Pout "$vendor_lead_code|$source_id|$list_id|$phone_code|$phone_number|$title|$first_name|$middle|$last_name|$address1|$address2|$address3|$city|$state|$province|$postal_code|$country|$gender|$date_of_birth|$alt_phone|$email|$security_phrase|$comments|$called_count|$status|$entry_date|$rank|$owner|\n"; + print Pout "$vendor_lead_code|$source_id|$list_id|$phone_code|$phone_number|$title|$first_name|$middle|$last_name|$address1|$address2|$address3|$city|$state|$province|$postal_code|$country|$gender|$date_of_birth|$alt_phone|$email|$security_phrase|$owner|$called_count|$status|$entry_date|$rank|$owner|\n"; $b++; $phone_found++; if ($DBX) {print " $b|$phone_found - $a|$phone_number|$city|$rank|$owner|$vendor_lead_code|$source_id\n";} } @@ -560,7 +560,7 @@ foreach(@FILES) $rank = '6'; $owner = 'alt3'; - print Pout "$vendor_lead_code|$source_id|$list_id|$phone_code|$phone_number|$title|$first_name|$middle|$last_name|$address1|$address2|$address3|$city|$state|$province|$postal_code|$country|$gender|$date_of_birth|$alt_phone|$email|$security_phrase|$comments|$called_count|$status|$entry_date|$rank|$owner|\n"; + print Pout "$vendor_lead_code|$source_id|$list_id|$phone_code|$phone_number|$title|$first_name|$middle|$last_name|$address1|$address2|$address3|$city|$state|$province|$postal_code|$country|$gender|$date_of_birth|$alt_phone|$email|$security_phrase|$owner|$called_count|$status|$entry_date|$rank|$owner|\n"; $b++; $phone_found++; if ($DBX) {print " $b|$phone_found - $a|$phone_number|$city|$rank|$owner|$vendor_lead_code|$source_id\n";} } @@ -571,7 +571,7 @@ foreach(@FILES) $rank = '7'; $owner = 'trigger1'; - print Pout "$vendor_lead_code|$source_id|$list_id|$phone_code|$phone_number|$title|$first_name|$middle|$last_name|$address1|$address2|$address3|$city|$state|$province|$postal_code|$country|$gender|$date_of_birth|$alt_phone|$email|$security_phrase|$comments|$called_count|$status|$entry_date|$rank|$owner|\n"; + print Pout "$vendor_lead_code|$source_id|$list_id|$phone_code|$phone_number|$title|$first_name|$middle|$last_name|$address1|$address2|$address3|$city|$state|$province|$postal_code|$country|$gender|$date_of_birth|$alt_phone|$email|$security_phrase|$owner|$called_count|$status|$entry_date|$rank|$owner|\n"; $b++; $phone_found++; if ($DBX) {print " $b|$phone_found - $a|$phone_number|$city|$rank|$owner|$vendor_lead_code|$source_id\n";} } @@ -582,7 +582,7 @@ foreach(@FILES) $rank = '8'; $owner = 'trigger2'; - print Pout "$vendor_lead_code|$source_id|$list_id|$phone_code|$phone_number|$title|$first_name|$middle|$last_name|$address1|$address2|$address3|$city|$state|$province|$postal_code|$country|$gender|$date_of_birth|$alt_phone|$email|$security_phrase|$comments|$called_count|$status|$entry_date|$rank|$owner|\n"; + print Pout "$vendor_lead_code|$source_id|$list_id|$phone_code|$phone_number|$title|$first_name|$middle|$last_name|$address1|$address2|$address3|$city|$state|$province|$postal_code|$country|$gender|$date_of_birth|$alt_phone|$email|$security_phrase|$owner|$called_count|$status|$entry_date|$rank|$owner|\n"; $b++; $phone_found++; if ($DBX) {print " $b|$phone_found - $a|$phone_number|$city|$rank|$owner|$vendor_lead_code|$source_id\n";} } @@ -593,7 +593,7 @@ foreach(@FILES) $rank = '9'; $owner = 'skiphome'; - print Pout "$vendor_lead_code|$source_id|$list_id|$phone_code|$phone_number|$title|$first_name|$middle|$last_name|$address1|$address2|$address3|$city|$state|$province|$postal_code|$country|$gender|$date_of_birth|$alt_phone|$email|$security_phrase|$comments|$called_count|$status|$entry_date|$rank|$owner|\n"; + print Pout "$vendor_lead_code|$source_id|$list_id|$phone_code|$phone_number|$title|$first_name|$middle|$last_name|$address1|$address2|$address3|$city|$state|$province|$postal_code|$country|$gender|$date_of_birth|$alt_phone|$email|$security_phrase|$owner|$called_count|$status|$entry_date|$rank|$owner|\n"; $b++; $phone_found++; if ($DBX) {print " $b|$phone_found - $a|$phone_number|$city|$rank|$owner|$vendor_lead_code|$source_id\n";} } @@ -604,7 +604,7 @@ foreach(@FILES) $rank = '10'; $owner = 'skipwork'; - print Pout "$vendor_lead_code|$source_id|$list_id|$phone_code|$phone_number|$title|$first_name|$middle|$last_name|$address1|$address2|$address3|$city|$state|$province|$postal_code|$country|$gender|$date_of_birth|$alt_phone|$email|$security_phrase|$comments|$called_count|$status|$entry_date|$rank|$owner|\n"; + print Pout "$vendor_lead_code|$source_id|$list_id|$phone_code|$phone_number|$title|$first_name|$middle|$last_name|$address1|$address2|$address3|$city|$state|$province|$postal_code|$country|$gender|$date_of_birth|$alt_phone|$email|$security_phrase|$owner|$called_count|$status|$entry_date|$rank|$owner|\n"; $b++; $phone_found++; if ($DBX) {print " $b|$phone_found - $a|$phone_number|$city|$rank|$owner|$vendor_lead_code|$source_id\n";} } @@ -615,7 +615,7 @@ foreach(@FILES) $rank = '11'; $owner = 'skipcell'; - print Pout "$vendor_lead_code|$source_id|$list_id|$phone_code|$phone_number|$title|$first_name|$middle|$last_name|$address1|$address2|$address3|$city|$state|$province|$postal_code|$country|$gender|$date_of_birth|$alt_phone|$email|$security_phrase|$comments|$called_count|$status|$entry_date|$rank|$owner|\n"; + print Pout "$vendor_lead_code|$source_id|$list_id|$phone_code|$phone_number|$title|$first_name|$middle|$last_name|$address1|$address2|$address3|$city|$state|$province|$postal_code|$country|$gender|$date_of_birth|$alt_phone|$email|$security_phrase|$owner|$called_count|$status|$entry_date|$rank|$owner|\n"; $b++; $phone_found++; if ($DBX) {print " $b|$phone_found - $a|$phone_number|$city|$rank|$owner|$vendor_lead_code|$source_id\n";} }