From 731d85e65f29e5786cbea9674992f4ca3fc2332b Mon Sep 17 00:00:00 2001 From: mattf Date: Thu, 3 Jul 2014 04:19:21 +0000 Subject: [PATCH] Updates to NANPA filter scripts and documentation git-svn-id: svn://192.168.202.10@2145 3d104415-ff17-0410-8863-d5cf3c621b8a --- agc_2-X/trunk/bin/nanpa_type_populate.pl | 11 ++++++----- agc_2-X/trunk/bin/nanpa_type_preload.pl | 6 +++--- .../docs/CELLPHONE_USA_TCPA_FCC_COMPLIANCE.txt | 17 ++++++++--------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/agc_2-X/trunk/bin/nanpa_type_populate.pl b/agc_2-X/trunk/bin/nanpa_type_populate.pl index 0cde2c57..2abcd2ac 100644 --- a/agc_2-X/trunk/bin/nanpa_type_populate.pl +++ b/agc_2-X/trunk/bin/nanpa_type_populate.pl @@ -13,7 +13,7 @@ # CHANGES # 130915-1345 - first build # 130928-0747 - Force overwrite of unzipped files, more standard debug output -# 140702-2319 - Added additional logging to admin log --admin-log +# 140702-2319 - Added additional logging to admin log --adminlog # $PATHconf = '/etc/astguiclient.conf'; @@ -123,7 +123,7 @@ if (length($ARGV[0])>1) print " [--quiet] = supress all normal output\n"; print " [--debug] = verbose debug messages\n"; print " [--debugX] = extra verbose debug messages\n"; - print " [--admin-log] = log to vicidial_admin_log\n"; + print " [--adminlog] = log to vicidial_admin_log\n"; print "\n"; exit; } @@ -149,9 +149,10 @@ if (length($ARGV[0])>1) { $skip_download=1; } - if ($args =~ /--admin-log/i) + if ($args =~ /--adminlog/i) { $admin_log=1; + if ($DB) {print "ADMIN LOG ENABLED\n"} } } } @@ -310,9 +311,9 @@ $end_time=time(); if ($admin_log > 0) { - $stmtA="INSERT INTO vicidial_admin_log set event_date=NOW(), user='VDAD', ip_address='1.1.1.1', event_section='SERVERS', event_type='OTHER', record_id='$server_ip', event_code='NANPA populate data', event_sql='', event_notes='WIRED2WIRELESS($nanpa_wired_to_wireless_count / $affected_rowsWIREWRLS / $affected_rowsINwirewrls) WIRELESS2WIRED($nanpa_wireless_to_wired_count / $affected_rowsWRLSWIRE / $affected_rowsINwrlswire) PREFIX($nanpa_prefix_exchanges_master_count / $nanpa_prefix_exchanges_fast_count / $affected_rowsPRFXMSTR / $affected_rowsINprfxmstr / $affected_rowsPRFXFAST / $affected_rowsINprfxfast) |$args| TOTAL Elapsed time: ".($end_time-$start_time)." sec';"; + $stmtA="INSERT INTO vicidial_admin_log set event_date=NOW(), user='VDAD', ip_address='1.1.1.1', event_section='SERVERS', event_type='OTHER', record_id='$VARserver_ip', event_code='NANPA populate data', event_sql='', event_notes='WIRED2WIRELESS($nanpa_wired_to_wireless_count / $affected_rowsWIREWRLS / $affected_rowsINwirewrls) WIRELESS2WIRED($nanpa_wireless_to_wired_count / $affected_rowsWRLSWIRE / $affected_rowsINwrlswire) PREFIX($nanpa_prefix_exchanges_master_count / $nanpa_prefix_exchanges_fast_count / $affected_rowsPRFXMSTR / $affected_rowsINprfxmstr / $affected_rowsPRFXFAST / $affected_rowsINprfxfast) |$args| TOTAL Elapsed time: ".($end_time-$start_time)." sec';"; $Iaffected_rows = $dbhN->do($stmtA); - if ($DBX) {print "Admin logged: |$Iaffected_rows|$stmtA|\n";} + if ($DB) {print "Admin logged: |$Iaffected_rows|$stmtA|\n";} } if (!$Q) {print "TOTAL Elapsed time: ".($end_time-$start_time)." sec\n\n";} diff --git a/agc_2-X/trunk/bin/nanpa_type_preload.pl b/agc_2-X/trunk/bin/nanpa_type_preload.pl index fb9e45f4..146ccc7c 100644 --- a/agc_2-X/trunk/bin/nanpa_type_preload.pl +++ b/agc_2-X/trunk/bin/nanpa_type_preload.pl @@ -486,9 +486,9 @@ while ($sthArows > $rec_count) } ################################################## - if ($type='S') {$landline++;} - if ($type='C') {$cellphone++;} - if ($type='I') {$invalid++;} + if ($type=='S') {$landline++;} + if ($type=='C') {$cellphone++;} + if ($type=='I') {$invalid++;} $rec_count++; if ( ($rec_count =~ /00000$/i) && ($DB) ) {print STDERR "$rec_count / $sthArows (S:$landline | C:$cellphone | I:$invalid)\n";} } diff --git a/agc_2-X/trunk/docs/CELLPHONE_USA_TCPA_FCC_COMPLIANCE.txt b/agc_2-X/trunk/docs/CELLPHONE_USA_TCPA_FCC_COMPLIANCE.txt index 6b5af307..86dd5adb 100644 --- a/agc_2-X/trunk/docs/CELLPHONE_USA_TCPA_FCC_COMPLIANCE.txt +++ b/agc_2-X/trunk/docs/CELLPHONE_USA_TCPA_FCC_COMPLIANCE.txt @@ -1,4 +1,4 @@ -CELLPHONE FILTERING DOC Started: 2013-09-20 Updated: 2014-05-30 +CELLPHONE FILTERING DOC Started: 2013-09-20 Updated: 2014-07-03 On October 16th, 2013 the FCC issued a rule change to not allow auto-dialing cellphones in the USA unless you have "express consent" from the person you are calling. This document is a summary of what this rule change means to businesses and organizations, and goes over how they can make sure they are in compliance with the TCPA(Telephone Consumer Protection Act of 1991) depending on their interpretation of the regulatory language. @@ -43,7 +43,7 @@ The next question we usually get after explaining all of this is, "How do I filt We recently added several software components to the Vicidial codebase that allows for integration with DNC.COM's on-site cellphone filtering database service. If you subscribe to this service then you can set the system to automatically download the data files nightly and have Vicidial scrub for cellphones on the entire system and/or manually scrub inactive lists through an administrative web page. More details on these processes are included below. -Our NANPA list that is available for clients to purchase on vicidial.org also has the "Lata Type" definition for all North American phone number prefixes which will show phone prefix blocks that are land lines(S), cell phones(C), pagers(P) and mixed use(M). There is currently no filtering script included with Vicidial that uses this data, but it could be used with a custom script as a pre-filter before sending a list to an outside filtering company. It is important to mention that this IS NOT a compliance solution and IS NOT considered a best effort option to filter your number. Also, in our extensive testing, it is only 93% accurate at best in determining whether a phone number is really a cell phone. +Our NANPA list that is available for clients to purchase on vicidial.org also has the "Lata Type" definition for all North American phone number prefixes which will show phone prefix blocks that are land lines(S), cell phones(C), pagers(P) and mixed use(M). There is currently no filtering script included with Vicidial that uses this data, but it could be used with a custom script as a pre-filter before sending a list to an outside filtering company. It is important to mention that this IS NOT a compliance solution and IS NOT considered a best effort option to filter your numbers. Also, in our extensive testing, it is only 93% accurate at best in determining whether a phone number is really a cell phone. @@ -57,17 +57,17 @@ DNC.COM INTEGRATION FEATURES IN VICIDIAL Here is a list of scripts that we have added in order to integrate with DNC.COM's cellphone filtering database service. -bin/nanpa_type_populate.pl - -Requires "Net::SFTP::Foreign" and "IO::Pty" CPAN modules to run. Automatically goes to DNC.COM SFTP server and downloads the 3 required data files(Prefixes, Wired-to-wireless, Wireless-to-wired), then loads that data into database tables on the vicidial system to be used by the other scripts. This process should be set to run in the crontab every morning. + bin/nanpa_type_populate.pl - +Requires "Net::SFTP::Foreign" and "IO::Pty" CPAN modules to run. Automatically goes to DNC.COM SFTP server and downloads the 3 required data files(Prefixes, Wired-to-wireless, Wireless-to-wired), then loads that data into database tables on the vicidial system to be used by the other scripts. This process should be set to run in the crontab every morning. There is an "--adminlog" run time option you can use to log the results of this process to the admin log under the server that it is run on, these log entries are viewable in the Administration web interface. NOTE: before you can run this script, you will need to sftp into the dnc.com server first on the Linux command line, (sftp XXXX@sftp.dncscrub.com) -bin/nanpa_type_preload.pl - -This script is designed to load all of the prefixes and portability data into RAM and run against your entire database to scrub it for cellphone numbers every night after the data is refreshed. It takes several minutes to initialize, but runs very fast after that. This process should be set to run in the crontab every morning AFTER the populate script is finished running. + bin/nanpa_type_preload.pl - +This script is designed to load all of the prefixes and portability data into RAM and run against your entire database to scrub it for cellphone numbers every night after the data is refreshed. It takes several minutes to initialize, but runs very fast after that. This process should be set to run in the crontab every morning AFTER the populate script is finished running. The results of this process log to the admin log under the server that it is run on, these log entries are viewable in the Administration web interface. -bin/nanpa_type_filter.pl - + bin/nanpa_type_filter.pl - This script is designed to do one list or a few lists at a time, or the entire database on smaller systems. It works together with a PHP script to perform lookups of cellphones and updating vicidial_list records depending on settings -www/vicidial/nanpa_type.php - + www/vicidial/nanpa_type.php - PHP script designed to return S = Land line, C = Cellphone, I = Invalid for one to hundreds of numbers passed in either an HTTP GET or POST form submission to it. Also requires valid manager user credentials on the host system for it to work. NOTE: To find the command line options for the Perl scripts above, just run them with the "--help" flag @@ -92,4 +92,3 @@ PREFIX_SFTP_server => sftp.dncscrub.com PREFIX_SFTP_user => DEMOVICIDIAL PREFIX_SFTP_pass => sampLepass PREFIX_SFTP_port => 22 -