Added ability to use a special filter phone group entry "BLANK" for a blank CIDnumber

git-svn-id: svn://192.168.202.10@2711 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2017-03-22 21:31:33 +00:00
parent f2d20b15b1
commit 00754f4d26
3 changed files with 19 additions and 5 deletions
+9 -4
View File
@@ -1,6 +1,6 @@
#!/usr/bin/perl
#
# agi-DID_route.agi version 2.12
# agi-DID_route.agi version 2.14
#
# runs when a call comes into an inbound context on a trunk. This script will
# send the calls to various places depending on the settings for each DID.
@@ -13,7 +13,7 @@
# ;inbound DID catch-all:
#exten => _X.,1,AGI(agi-DID_route.agi)
#
# Copyright (C) 2016 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2017 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# changes:
# 81007-0324 - First Build
@@ -42,6 +42,7 @@
# 150806-1316 - Added Filter URL logging to url log, and added variables for uniqueid, channel and server_ip
# 160106-0719 - Added filter option for GROUP_AREACODE
# 161102-1035 - Fixed QM partition problem
# 170322-1708 - Added filter phone group entry BLANK for a blank CIDnumber
#
@@ -476,7 +477,9 @@ if ( (length($pre_filter_phone_group_id)>0) && (length($pre_filter_extension)>0)
{
if ($AGILOG) {$agi_string = "pre-filtering active: |$extension|$pre_filter_phone_group_id|$pre_filter_extension|$filter_clean_cid_number|$callerid"; &agi_output;}
$stmtA = "SELECT count(*) FROM vicidial_filter_phone_numbers where filter_phone_group_id='$pre_filter_phone_group_id' and phone_number='$callerid';";
$temp_cid_test = $callerid;
if (length($callerid)<1) {$temp_cid_test = 'BLANK';}
$stmtA = "SELECT count(*) FROM vicidial_filter_phone_numbers where filter_phone_group_id='$pre_filter_phone_group_id' and phone_number='$temp_cid_test';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -512,7 +515,9 @@ if ( ($filter_inbound_number =~ /GROUP|URL|DNC_INTERNAL|DNC_CAMPAIGN/) && ($pre_
if ($AGILOG) {$agi_string = "filtering active: |$extension|$filter_inbound_number|$filter_phone_group_id|$filter_url|$filter_action|$filter_clean_cid_number|"; &agi_output;}
if ($filter_inbound_number =~ /GROUP/)
{
$stmtA = "SELECT count(*) FROM vicidial_filter_phone_numbers where filter_phone_group_id='$filter_phone_group_id' and phone_number='$callerid';";
$temp_cid_test = $callerid;
if (length($callerid)<1) {$temp_cid_test = 'BLANK';}
$stmtA = "SELECT count(*) FROM vicidial_filter_phone_numbers where filter_phone_group_id='$filter_phone_group_id' and phone_number='$temp_cid_test';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
+1 -1
View File
@@ -6653,7 +6653,7 @@ if ($ADD==171)
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Filter Phone Group").": </td><td align=left><select size=1 name=filter_phone_group_id>\n";
echo "$vfpg_list";
echo "</select></td></tr>\n";
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Phone Numbers").": <BR><BR> ("._QXZ("one phone number per line only").")<BR>$NWB#internal_list-dnc$NWE</td><td align=left><TEXTAREA name=phone_numbers ROWS=20 COLS=20></TEXTAREA></td></tr>\n";
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Phone Numbers").": <BR><BR> ("._QXZ("one phone number per line only").")<BR>$NWB#filter-phone-list$NWE</td><td align=left><TEXTAREA name=phone_numbers ROWS=20 COLS=20></TEXTAREA></td></tr>\n";
if ($LOGdelete_from_dnc > 0)
{
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Add or Delete").": </td><td align=left><select size=1 name=stage><option SELECTED value='add'>"._QXZ("add")."</option><option value='delete'>"._QXZ("delete")."</option></select></td></tr>\n";
+9
View File
@@ -116,6 +116,7 @@
# 170313-2012 - Added CHAT option to inbound_queue_no_dial entry
# 170320-1346 - Added phones conf_qualify entry
# 170321-1130 - Added pause code limits entries
# 170322-1720 - Added filter-phone-list entry
#
@@ -2158,12 +2159,20 @@ if ($SSqc_features_active > 0)
<BR>
<B><?php echo _QXZ("Time Zone Setting"); ?> -</B><?php echo _QXZ("This option allows you to set the method of maintaining the current time zone lookup for the leads within this list. This process is only done at night so any changes you make will not be immediate. COUNTRY_AND_AREA_CODE is the default, and will use the country code and area code of the phone number to determine the time zone of the lead. POSTAL_CODE will use the postal code if available to determine the time zone of the lead. NANPA_PREFIX works only in the USA and will use the area code and prefix of the phone number to determine the time zone of the lead, but this is not enabled by default in the system, so please be sure you have the NANPA prefix data loaded onto your system before selecting this option. OWNER_TIME_ZONE_CODE will use the standard time zone abbreviation loaded into the owner field of the lead to determine the time zone, in the USA examples are AST, EST, CST, MST, PST, AKST, HST. This feature must be enabled by your system administrator to go into effect."); ?>
<BR>
<BR>
<A NAME="internal_list-dnc">
<BR>
<B><?php echo _QXZ("Internal DNC List"); ?> -</B><?php echo _QXZ("This Do Not Call list contains every lead that has been set to a status of DNC in the system. Through the LISTS - ADD NUMBER TO DNC page you are able to manually add numbers to this list so that they will not be called by campaigns that use the internal DNC list. There is also the option to add leads to the campaign-specific DNC lists for those campaigns that have them. If you have the active DNC option set to AREACODE then you can also use area code wildcard entries like this 201XXXXXXX to block all calls to the 201 areacode when enabled."); ?>
<BR>
<BR>
<A NAME="filter-phone-list">
<BR>
<B><?php echo _QXZ("Filter Phone Group List"); ?> -</B><?php echo _QXZ("Through the Add-Delete FPG Number page you are able to manually add numbers to this list so that they will be filtered when they enter a DID that is using this list. If you have the Filter Phone Group option set to include AREACODE then you can also use area code wildcard entries like this 201XXXXXXX to filter all calls from the 201 areacode when enabled. There is also a special entry that you can add to your Filter Phone Group, BLANK, this will filter calls that arrive with an empty caller ID number."); ?>