diff --git a/UPGRADE b/UPGRADE
index 962c4e88..9c19a1b0 100644
--- a/UPGRADE
+++ b/UPGRADE
@@ -241,6 +241,23 @@ OTHER CHANGES:
listing of Phones, also forced level 7 users to the reports links page
if they try going anywhere in admin.php
+53. Renamed "In-Groups" header in admin.php to "Inbound" to reflect that it is
+ not just for In-groups, but includes DIDs and Call Menus as well
+
+54. Added Filter Phone Groups to allow calls coming into DIDs to be filtered
+ and sent to a different route if the caller ID number matches one in
+ the selected Filter Phone Group, or the search can be done by a web GET
+ to a URL that you define.
+
+55. Added method to clean caller ID number when calls come into DIDs, either by
+ stripping specific digits from the front of a number if they are there
+ or taking only the right X numbers, i.e. R10 will take only the 10
+ digits on the right of a number, and L1 will remove only a 1 from the
+ left side of the number.
+
+56. Added ability to download DNC numbers from the internal and campaign-
+ specific DNC lists, as well as the Filter Phone Groups
+
diff --git a/agi/agi-DID_route.agi b/agi/agi-DID_route.agi
index 4d988355..8aa03418 100644
--- a/agi/agi-DID_route.agi
+++ b/agi/agi-DID_route.agi
@@ -25,6 +25,7 @@
# 91122-0743 - Added QueueMetrics logging as DID INFO entries
# 100116-0631 - Logging bug fixes
# 100123-1423 - Added record call DID option
+# 100805-0943 - Added Filter Phone Group alternate routing feature and CID number cleanup
#
$script = 'agi-DID_route.agi';
@@ -32,7 +33,7 @@ $dtmf_silent_prefix = '7';
$at='@';
$S='*';
$US='_';
-
+$route_type='DID';
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$year = ($year + 1900);
@@ -181,7 +182,7 @@ if ( (!$callerid) or ($callerid =~ /unknown/) )
### Grab DID values from the database
$DIDs_in_system=0;
-$stmtA = "SELECT did_id,did_pattern,did_description,did_active,did_route,extension,exten_context,voicemail_ext,phone,server_ip,user,user_unavailable_action,user_route_settings_ingroup,menu_id,record_call FROM vicidial_inbound_dids where did_pattern = '$extension' and did_active='Y';";
+$stmtA = "SELECT did_id,did_pattern,did_description,did_active,did_route,extension,exten_context,voicemail_ext,phone,server_ip,user,user_unavailable_action,user_route_settings_ingroup,menu_id,record_call,filter_inbound_number,filter_phone_group_id,filter_url,filter_action,filter_extension,filter_exten_context,filter_voicemail_ext,filter_phone,filter_server_ip,filter_user,filter_user_unavailable_action,filter_user_route_settings_ingroup,filter_group_id,filter_call_handle_method,filter_agent_search_method,filter_list_id,filter_campaign_id,filter_phone_code,filter_menu_id,filter_clean_cid_number FROM vicidial_inbound_dids where did_pattern = '$extension' and did_active='Y';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -203,6 +204,26 @@ if ($sthArows > 0)
$user_route_settings_ingroup = $aryA[12];
$menu_id = $aryA[13];
$record_call = $aryA[14];
+ $filter_inbound_number = $aryA[15];
+ $filter_phone_group_id = $aryA[16];
+ $filter_url = $aryA[17];
+ $filter_action = $aryA[18];
+ $filter_extension = $aryA[19];
+ $filter_exten_context = $aryA[20];
+ $filter_voicemail_ext = $aryA[21];
+ $filter_phone = $aryA[22];
+ $filter_server_ip = $aryA[23];
+ $filter_user = $aryA[24];
+ $filter_user_unavailable_action = $aryA[25];
+ $filter_user_route_settings_ingroup = $aryA[26];
+ $filter_group_id = $aryA[27];
+ $filter_call_handle_method = $aryA[28];
+ $filter_agent_search_method = $aryA[29];
+ $filter_list_id = $aryA[30];
+ $filter_campaign_id = $aryA[31];
+ $filter_phone_code = $aryA[32];
+ $filter_menu_id = $aryA[33];
+ $filter_clean_cid_number = $aryA[34];
$DIDs_in_system++;
}
@@ -211,7 +232,7 @@ $sthA->finish();
if ($sthArows < 1)
{
### Grab DID values from the database for a default DID pattern if there is one
- $stmtA = "SELECT did_id,did_pattern,did_description,did_active,did_route,extension,exten_context,voicemail_ext,phone,server_ip,user,user_unavailable_action,user_route_settings_ingroup,menu_id,record_call FROM vicidial_inbound_dids where did_pattern = 'default' and did_active='Y';";
+ $stmtA = "SELECT did_id,did_pattern,did_description,did_active,did_route,extension,exten_context,voicemail_ext,phone,server_ip,user,user_unavailable_action,user_route_settings_ingroup,menu_id,record_call,filter_inbound_number,filter_phone_group_id,filter_url,filter_action,filter_extension,filter_exten_context,filter_voicemail_ext,filter_phone,filter_server_ip,filter_user,filter_user_unavailable_action,filter_user_route_settings_ingroup,filter_group_id,filter_call_handle_method,filter_agent_search_method,filter_list_id,filter_campaign_id,filter_phone_code,filter_menu_id,filter_clean_cid_number FROM vicidial_inbound_dids where did_pattern = 'default' and did_active='Y';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$DIDs_in_system=$sthA->rows;
@@ -233,6 +254,26 @@ if ($sthArows < 1)
$user_route_settings_ingroup = $aryA[12];
$menu_id = $aryA[13];
$record_call = $aryA[14];
+ $filter_inbound_number = $aryA[15];
+ $filter_phone_group_id = $aryA[16];
+ $filter_url = $aryA[17];
+ $filter_action = $aryA[18];
+ $filter_extension = $aryA[19];
+ $filter_exten_context = $aryA[20];
+ $filter_voicemail_ext = $aryA[21];
+ $filter_phone = $aryA[22];
+ $filter_server_ip = $aryA[23];
+ $filter_user = $aryA[24];
+ $filter_user_unavailable_action = $aryA[25];
+ $filter_user_route_settings_ingroup = $aryA[26];
+ $filter_group_id = $aryA[27];
+ $filter_call_handle_method = $aryA[28];
+ $filter_agent_search_method = $aryA[29];
+ $filter_list_id = $aryA[30];
+ $filter_campaign_id = $aryA[31];
+ $filter_phone_code = $aryA[32];
+ $filter_menu_id = $aryA[33];
+ $filter_clean_cid_number = $aryA[34];
}
$sthA->finish();
}
@@ -313,13 +354,124 @@ while ($sthArows > $cbc)
$sthA->finish();
+### BEGIN clean caller id number ###
+if (length($filter_clean_cid_number) > 1)
+ {
+ $original_callerid = $callerid;
+ $filter_number_altered=0;
+ if ($filter_clean_cid_number =~ /^R\d/)
+ {
+ @filter_rule = split(/R/,$filter_clean_cid_number);
+ $filter_rule[1] =~ s/ .*//gi;
+ while (length($callerid) > $filter_rule[1])
+ {$callerid =~ s/^.//gi;}
+ if (length($callerid) != length($original_callerid))
+ {$filter_number_altered++;}
+ }
+ if ($filter_clean_cid_number =~ /^L\d/)
+ {
+ @filter_rule = split(/L/,$filter_clean_cid_number);
+ $filter_rule[1] =~ s/ .*//gi;
+ $filter_rule_reg = $filter_rule[1];
+ $callerid =~ s/^$filter_rule_reg//gi;
+ if (length($callerid) != length($original_callerid))
+ {$filter_number_altered++;}
+ }
+ if ($filter_number_altered > 0)
+ {
+ $newcallerid = "\"$calleridname <$callerid>\"";
+ $AGI->set_callerid($newcallerid);
+ if ($AGILOG) {$agi_string = "filter clean callerid, setting new CID: |$callerid|$calleridname|$newcallerid|$filter_clean_cid_number| Old: |$original_callerid|"; &agi_output;}
+ }
+ }
+### END clean caller id number ###
+
+
+##### BEGIN filtering process #####
+if ($filter_inbound_number =~ /GROUP|URL/)
+ {
+ $filter_match_found=0;
+ 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';";
+ $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
+ $sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
+ $sthArows=$sthA->rows;
+ if ($sthArows > 0)
+ {
+ @aryA = $sthA->fetchrow_array;
+ $filter_match_found = $aryA[0];
+ }
+ $sthA->finish();
+ }
+ else
+ {
+ ### first, find curl binary
+ $curlbin = '';
+ if ( -e ('/bin/curl')) {$curlbin = '/bin/curl';}
+ else
+ {
+ if ( -e ('/usr/bin/curl')) {$curlbin = '/usr/bin/curl';}
+ else
+ {
+ if ( -e ('/usr/local/bin/curl')) {$curlbin = '/usr/local/bin/curl';}
+ else
+ {
+ if ($AGILOG) {$agi_string = "ERROR: cannot filter by URL, curl binary not found"; &agi_output;}
+ }
+ }
+ }
+ if ( (length($curlbin) > 4) && ($filter_url =~ /http/i) && (length($filter_url) > 8) )
+ {
+ $filter_url =~ s/--A--phone_number--B--/$callerid/gi;
+ $filter_url =~ s/--A--did_pattern--B--/$callerid/gi;
+ $filter_url =~ s/&/\\&/gi;
+ $filter_url =~ s/ /+/gi;
+
+ @curl_output = `$curlbin $filter_url`;
+
+ $k=0;
+ $full_output='';
+ foreach (@curl_output)
+ {
+ $full_output .= $curl_output[$k];
+ $k++;
+ }
+ $full_output =~ s/\D//gi;
+ if ($full_output > 0)
+ {
+ $filter_match_found = $full_output;
+ }
+ if ($AGILOG) {$agi_string = "URL filter search response: |$filter_match_found|$full_output|$filter_url|"; &agi_output;}
+ }
+ }
+ if ($filter_match_found > 0)
+ {
+ $did_route = $filter_action;
+ $did_extension = $filter_extension;
+ $exten_context = $filter_exten_context;
+ $voicemail_ext = $filter_voicemail_ext;
+ $phone = $filter_phone;
+ $did_server_ip = $filter_server_ip;
+ $user = $filter_user;
+ $user_unavailable_action = $filter_user_unavailable_action;
+ $user_route_settings_ingroup = $filter_user_route_settings_ingroup;
+ $menu_id = $filter_menu_id;
+ $route_type = 'FILTER';
+
+ if ($AGILOG) {$agi_string = "Filter match found: |$filter_match_found|$filter_action|$did_route|"; &agi_output;}
+ }
+ }
+##### END filtering process #####
+
### Route call to a VICIDIAL-defined phone
if ($did_route =~ /PHONE/)
{
- $stmtA = "SELECT dialplan_number,voicemail_id,protocol,ext_context FROM phones where server_ip = '$did_server_ip' and extension='$phone';";
+ $stmtA = "SELECT dialplan_number,voicemail_id,protocol,ext_context FROM phones where server_ip='$did_server_ip' and extension='$phone';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -368,7 +520,7 @@ if ($did_route =~ /VOICEMAIL/)
### Route call to a VICIDIAL Inbound Group
if ($did_route =~ /IN_GROUP/)
{
- $did_extension = "99909$S$did_id$S";
+ $did_extension = "99909$S$did_id$S$S$S$route_type";
$exten_context = $ext_context;
$did_route = 'EXTEN';
}
@@ -377,7 +529,7 @@ if ($did_route =~ /IN_GROUP/)
### Route call to a logged-in VICIDIAL agent
if ($did_route =~ /AGENT/)
{
- $did_extension = "99909$S$did_id$S";
+ $did_extension = "99909$S$did_id$S$S$S$route_type";
$exten_context = $ext_context;
$did_route = 'EXTEN';
}
diff --git a/agi/agi-VDAD_ALL_inbound.agi b/agi/agi-VDAD_ALL_inbound.agi
index 79b7c55a..f8a9053c 100644
--- a/agi/agi-VDAD_ALL_inbound.agi
+++ b/agi/agi-VDAD_ALL_inbound.agi
@@ -137,6 +137,7 @@
# 100527-0111 - Added on-hold and hold-time-option no-block options and message seconds, NA CID cleaning
# 100616-1600 - Added VID filename and digit validation options
# 100718-1822 - Added second hold time option and wait time options
+# 100805-1530 - Added FILTER from-did-route feature, changed active=n to go to after hours action
#
$script = 'agi-VDAD_ALL_inbound.agi';
@@ -341,7 +342,7 @@ if ($sthArows > 0)
$sthA->finish();
$user_unavailable_action='';
-##### special processing for DID forwarded calls "99909*1*"
+##### special processing for DID forwarded calls "99909*1***DID"
if ($extension =~ /^999\d\d\*/)
{
@EXT_vars = split(/\*/, $extension);
@@ -350,9 +351,17 @@ if ($extension =~ /^999\d\d\*/)
$did_id = $EXT_vars[1]; # the DID ID to grab settings from
$in_group_override = $EXT_vars[2]; # the in-group override, if set
$agentdirect_override = $EXT_vars[3]; # the agentdirect override, if set
+ $route_type = $EXT_vars[4]; # DID or FILTER from the did, if set
### Grab DID values from the database
- $stmtA = "SELECT call_handle_method,agent_search_method,group_id,did_pattern,list_id,phone_code,campaign_id,user,user_unavailable_action,user_route_settings_ingroup,did_route,voicemail_ext,extension,exten_context,phone,server_ip FROM vicidial_inbound_dids where did_id = '$did_id';";
+ if ($route_type =~ /FILTER/)
+ {
+ $stmtA = "SELECT filter_call_handle_method,filter_agent_search_method,filter_group_id,did_pattern,filter_list_id,filter_phone_code,filter_campaign_id,filter_user,filter_user_unavailable_action,filter_user_route_settings_ingroup,filter_action,filter_voicemail_ext,filter_extension,filter_exten_context,filter_phone,filter_server_ip FROM vicidial_inbound_dids where did_id = '$did_id';";
+ }
+ else
+ {
+ $stmtA = "SELECT call_handle_method,agent_search_method,group_id,did_pattern,list_id,phone_code,campaign_id,user,user_unavailable_action,user_route_settings_ingroup,did_route,voicemail_ext,extension,exten_context,phone,server_ip FROM vicidial_inbound_dids where did_id = '$did_id';";
+ }
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -568,7 +577,7 @@ $sthA->finish();
### Grab inbound groups values from the database
$cbc=0;
-$stmtA = "SELECT call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,drop_call_seconds,drop_action,drop_exten,next_agent_call,voicemail_ext,queue_priority,drop_inbound_group,afterhours_xfer_group,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message,no_agent_no_queue,no_agent_action,no_agent_action_value,extension_appended_cidname,uniqueid_status_display,uniqueid_status_prefix,hold_time_option_minimum,hold_time_option_press_filename,hold_time_option_callmenu,onhold_prompt_no_block,onhold_prompt_seconds,hold_time_option_no_block,hold_time_option_prompt_seconds,hold_time_second_option,hold_time_third_option,wait_hold_option_priority,wait_time_option,wait_time_second_option,wait_time_third_option,wait_time_option_seconds,wait_time_option_exten,wait_time_option_voicemail,wait_time_option_xfer_group,wait_time_option_callmenu,wait_time_option_callback_filename,wait_time_option_callback_list_id,wait_time_option_press_filename,wait_time_option_no_block,wait_time_option_prompt_seconds FROM vicidial_inbound_groups where group_id = '$channel_group';";
+$stmtA = "SELECT call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,drop_call_seconds,drop_action,drop_exten,next_agent_call,voicemail_ext,queue_priority,drop_inbound_group,afterhours_xfer_group,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message,no_agent_no_queue,no_agent_action,no_agent_action_value,extension_appended_cidname,uniqueid_status_display,uniqueid_status_prefix,hold_time_option_minimum,hold_time_option_press_filename,hold_time_option_callmenu,onhold_prompt_no_block,onhold_prompt_seconds,hold_time_option_no_block,hold_time_option_prompt_seconds,hold_time_second_option,hold_time_third_option,wait_hold_option_priority,wait_time_option,wait_time_second_option,wait_time_third_option,wait_time_option_seconds,wait_time_option_exten,wait_time_option_voicemail,wait_time_option_xfer_group,wait_time_option_callmenu,wait_time_option_callback_filename,wait_time_option_callback_list_id,wait_time_option_press_filename,wait_time_option_no_block,wait_time_option_prompt_seconds,active FROM vicidial_inbound_groups where group_id = '$channel_group';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -643,6 +652,7 @@ while ($sthArows > $cbc)
$wait_time_option_press_filename = $aryA[57];
$wait_time_option_no_block = $aryA[58];
$wait_time_option_prompt_seconds = $aryA[59];
+ $ingroup_active = $aryA[60];
$custom_call_id='';
if ($uniqueid_status_display =~ /ENABLED/)
@@ -687,6 +697,14 @@ if ( (length($deafult_afterhours_filename_override) > 0) && ($deafult_afterhours
if ( (length($day_afterhours_filename_override) > 0) && ($day_afterhours_filename_override !~ /---NONE---/) )
{$after_hours_message_filename = $day_afterhours_filename_override;}
+# send call to after hours action if in-group is set to inactive
+if ($ingroup_active !~ /Y/)
+ {
+ $ct_default_start = 2400;
+ $ct_default_stop = 2400;
+ if ($AGILOG) {$agi_string = "IN-GROUP INACTIVE! Sending to After Hours Action: |$after_hours_action|$ingroup_active|"; &agi_output;}
+ }
+
$AGI->stream_file('sip-silence');
$AGI->stream_file('sip-silence');
diff --git a/extras/MySQL_AST_CREATE_tables.sql b/extras/MySQL_AST_CREATE_tables.sql
index aa9139de..ef9e1316 100644
--- a/extras/MySQL_AST_CREATE_tables.sql
+++ b/extras/MySQL_AST_CREATE_tables.sql
@@ -1577,6 +1577,26 @@ campaign_id VARCHAR(8),
phone_code VARCHAR(10) default '1',
menu_id VARCHAR(50) default '',
record_call ENUM('Y','N','Y_QUEUESTOP') default 'N',
+filter_inbound_number ENUM('DISABLED','GROUP','URL') default 'DISABLED',
+filter_phone_group_id VARCHAR(20) default '',
+filter_url VARCHAR(1000) default '',
+filter_action ENUM('EXTEN','VOICEMAIL','AGENT','PHONE','IN_GROUP','CALLMENU') default 'EXTEN',
+filter_extension VARCHAR(50) default '9998811112',
+filter_exten_context VARCHAR(50) default 'default',
+filter_voicemail_ext VARCHAR(10),
+filter_phone VARCHAR(100),
+filter_server_ip VARCHAR(15),
+filter_user VARCHAR(20),
+filter_user_unavailable_action ENUM('IN_GROUP','EXTEN','VOICEMAIL','PHONE') default 'VOICEMAIL',
+filter_user_route_settings_ingroup VARCHAR(20) default 'AGENTDIRECT',
+filter_group_id VARCHAR(20),
+filter_call_handle_method VARCHAR(20) default 'CID',
+filter_agent_search_method ENUM('LO','LB','SO') default 'LB',
+filter_list_id BIGINT(14) UNSIGNED default '999',
+filter_campaign_id VARCHAR(8),
+filter_phone_code VARCHAR(10) default '1',
+filter_menu_id VARCHAR(50) default '',
+filter_clean_cid_number VARCHAR(20) default '',
unique index (did_pattern),
index (group_id)
);
@@ -2153,6 +2173,19 @@ field_order SMALLINT(5) default '1'
CREATE UNIQUE INDEX listfield on vicidial_lists_fields (list_id, field_label);
+CREATE TABLE vicidial_filter_phone_groups (
+filter_phone_group_id VARCHAR(20) NOT NULL,
+filter_phone_group_name VARCHAR(40) NOT NULL,
+filter_phone_group_description VARCHAR(100),
+index (filter_phone_group_id)
+);
+
+CREATE TABLE vicidial_filter_phone_numbers (
+phone_number VARCHAR(18) NOT NULL,
+filter_phone_group_id VARCHAR(20) NOT NULL,
+index (phone_number),
+unique index phonefilter (phone_number, filter_phone_group_id)
+);
ALTER TABLE vicidial_campaign_server_stats ENGINE=MEMORY;
@@ -2296,7 +2329,7 @@ ALTER TABLE vicidial_agent_log_archive MODIFY agent_log_id INT(9) UNSIGNED NOT N
CREATE TABLE vicidial_carrier_log_archive LIKE vicidial_carrier_log;
-UPDATE system_settings SET db_schema_version='1238',db_schema_update_date=NOW();
+UPDATE system_settings SET db_schema_version='1239',db_schema_update_date=NOW();
GRANT RELOAD ON *.* TO cron@'%';
GRANT RELOAD ON *.* TO cron@localhost;
diff --git a/extras/upgrade_2.4.sql b/extras/upgrade_2.4.sql
index 242dd9c2..8b5091ce 100644
--- a/extras/upgrade_2.4.sql
+++ b/extras/upgrade_2.4.sql
@@ -451,3 +451,40 @@ UPDATE system_settings SET db_schema_version='1237',db_schema_update_date=NOW();
ALTER TABLE vicidial_user_groups ADD allowed_reports VARCHAR(2000) default 'ALL REPORTS';
UPDATE system_settings SET db_schema_version='1238',db_schema_update_date=NOW();
+
+CREATE TABLE vicidial_filter_phone_groups (
+filter_phone_group_id VARCHAR(20) NOT NULL,
+filter_phone_group_name VARCHAR(40) NOT NULL,
+filter_phone_group_description VARCHAR(100),
+index (filter_phone_group_id)
+);
+
+CREATE TABLE vicidial_filter_phone_numbers (
+phone_number VARCHAR(18) NOT NULL,
+filter_phone_group_id VARCHAR(20) NOT NULL,
+index (phone_number),
+unique index phonefilter (phone_number, filter_phone_group_id)
+);
+
+ALTER TABLE vicidial_inbound_dids ADD filter_inbound_number ENUM('DISABLED','GROUP','URL') default 'DISABLED';
+ALTER TABLE vicidial_inbound_dids ADD filter_phone_group_id VARCHAR(20) default '';
+ALTER TABLE vicidial_inbound_dids ADD filter_url VARCHAR(1000) default '';
+ALTER TABLE vicidial_inbound_dids ADD filter_action ENUM('EXTEN','VOICEMAIL','AGENT','PHONE','IN_GROUP','CALLMENU') default 'EXTEN';
+ALTER TABLE vicidial_inbound_dids ADD filter_extension VARCHAR(50) default '9998811112';
+ALTER TABLE vicidial_inbound_dids ADD filter_exten_context VARCHAR(50) default 'default';
+ALTER TABLE vicidial_inbound_dids ADD filter_voicemail_ext VARCHAR(10);
+ALTER TABLE vicidial_inbound_dids ADD filter_phone VARCHAR(100);
+ALTER TABLE vicidial_inbound_dids ADD filter_server_ip VARCHAR(15);
+ALTER TABLE vicidial_inbound_dids ADD filter_user VARCHAR(20);
+ALTER TABLE vicidial_inbound_dids ADD filter_user_unavailable_action ENUM('IN_GROUP','EXTEN','VOICEMAIL','PHONE') default 'VOICEMAIL';
+ALTER TABLE vicidial_inbound_dids ADD filter_user_route_settings_ingroup VARCHAR(20) default 'AGENTDIRECT';
+ALTER TABLE vicidial_inbound_dids ADD filter_group_id VARCHAR(20);
+ALTER TABLE vicidial_inbound_dids ADD filter_call_handle_method VARCHAR(20) default 'CID';
+ALTER TABLE vicidial_inbound_dids ADD filter_agent_search_method ENUM('LO','LB','SO') default 'LB';
+ALTER TABLE vicidial_inbound_dids ADD filter_list_id BIGINT(14) UNSIGNED default '999';
+ALTER TABLE vicidial_inbound_dids ADD filter_campaign_id VARCHAR(8);
+ALTER TABLE vicidial_inbound_dids ADD filter_phone_code VARCHAR(10) default '1';
+ALTER TABLE vicidial_inbound_dids ADD filter_menu_id VARCHAR(50) default '';
+ALTER TABLE vicidial_inbound_dids ADD filter_clean_cid_number VARCHAR(20) default '';
+
+UPDATE system_settings SET db_schema_version='1239',db_schema_update_date=NOW();
diff --git a/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt b/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt
index 1eac213e..608cf856 100644
--- a/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt
+++ b/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt
@@ -296,6 +296,57 @@ Allowed Reports||
If a user in this group is set to user level 7 or higher, then this feature can be used to restrict the reports that the users can view. Default is ALL. If you want to select more than one report then press the Ctrl key on your keyboard as you select the reports||
You are not allowed to view this report||
CAMPLISTS_ALL - will include inactive lists in the search for the number||
+Add-Delete DNC Number||
+Add DNC Number||
+Copy Custom Fields||
+Add Filter Phone Group||
+New Filter Phone Group||
+Modify Filter Phone Group||
+Delete Phone Filter Group||
+Filter Phone Groups||
+Filter Phone Group ID||
+Filter Phone Group Name||
+Filter Phone Group Description||
+PHONE FILTER GROUP NOT ADDED||
+there is already a PHONE FILTER GROUP in the system with this ID||
+Phone Filter Group ID must be between 2 and 20 characters in length and contain no||
+PHONE FILTER GROUP ADDED||
+Add Filter Phone Group||
+Add-Delete FPG Number||
+Add FPG Number||
+FILTER PHONE GROUP NOT MODIFIED||
+FILTER PHONE GROUP MODIFIED||
+FILTER PHONE GROUP NOT DELETED||
+Click here to delete FILTER PHONE GROUP||
+FILTER PHONE GROUP DELETION CONFIRMATION||
+FILTER PHONE GROUP DELETION COMPLETED||
+Click here to see Admin chages to this filter phone group||
+DELETE THIS FILTER PHONE GROUP||
+FILTER PHONE GROUP LISTINGS||
+Filter Phone Group Numbers||
+This phone number is not in the Filter Phone Group List||
+This phone number is already in the Filter Phone Group List||
+FILTER PHONE GROUP NUMBER NOT DELETED||
+FILTER PHONE GROUP NUMBER DELETED||
+FILTER PHONE GROUP NUMBER NOT ADDED||
+FILTER PHONE GROUP NUMBER ADDED||
+Numbers in this Filter Phone Group||
+There are no phone numbers in list||
+There are no leads in Campaign DNC list||
+There are no leads in this filter phone group||
+Click here to download the numbers in this filter phone group||
+Filter Inbound Number||
+This option if enabled allows you to filter calls coming into this DID and send them to an alternative action if they match a phone number that is in the filter phone group or a URL response if you have configured one. Default is DISABLED. GROUP will search in a Filter Phone Group. URL will send a URL and will match if a 1 is sent back||
+If the Filter Inbound Number field is set to GROUP then this is the ID of the Filter Phone Group that will have its numbers searched looking for a match to the caller ID number of the incoming call||
+Filter URL||
+If the Filter Inbound Number field is set to URL then this is the web address of a script that will search a remote system and return a 1 for a match and a 0 for no match. Only two variables are available in the address if you use the VAR prefix like with webform addresses in campaigns, --A--phone_number--B-- and --A--did_pattern--B-- can be used in the URL to indicate the caller ID of the caller and the DID that the customer caclled in on||
+Filter Action||
+If Filter Inbound Number is activated and a match is found then this is the action that is to be taken. This is the same as the Route that you select for a DID, and the settings below function just like they do for a standard routing||
+This is the ID of the Filter Phone Group that is the container for a group of phone numbers that you can have automatically searched through when a call comes into a DID and send to an alternate route if there is a match. This field should be between 2 and 20 characters and have no punctuation except for underscore||
+Filter Phone Group Description||
+This is the description of the Filter Phone Group, it is purely for notation purposes only and is not a required field||
+Clean CID Number||
+This field allows you to specify a number of digits to restrict the incoming caller ID number to by putting an R in front of the number of digits, for example to restrict to the right 10 digits you would enter in R10. You can also use this feature to remove only a leading digit or digits by putting an L in front of the specific digits that you want to remove, for example to remove a 1 as the first digit you would enter in L1. Default is empty. If more than one rule is specified make sure you separate them with a space and the R will run before the L||
AST_VICIDIAL_ingrouplist.php
diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php
index 900e3310..2dc4b37f 100644
--- a/www/vicidial/admin.php
+++ b/www/vicidial/admin.php
@@ -1373,6 +1373,50 @@ if (isset($_GET["timer_action_destination"])) {$timer_action_destination=$_GET
elseif (isset($_POST["timer_action_destination"])) {$timer_action_destination=$_POST["timer_action_destination"];}
if (isset($_GET["allowed_reports"])) {$allowed_reports=$_GET["allowed_reports"];}
elseif (isset($_POST["allowed_reports"])) {$allowed_reports=$_POST["allowed_reports"];}
+if (isset($_GET["filter_phone_group_id"])) {$filter_phone_group_id=$_GET["filter_phone_group_id"];}
+ elseif (isset($_POST["filter_phone_group_id"])) {$filter_phone_group_id=$_POST["filter_phone_group_id"];}
+if (isset($_GET["filter_phone_group_name"])) {$filter_phone_group_name=$_GET["filter_phone_group_name"];}
+ elseif (isset($_POST["filter_phone_group_name"])) {$filter_phone_group_name=$_POST["filter_phone_group_name"];}
+if (isset($_GET["filter_phone_group_description"])) {$filter_phone_group_description=$_GET["filter_phone_group_description"];}
+ elseif (isset($_POST["filter_phone_group_description"])) {$filter_phone_group_description=$_POST["filter_phone_group_description"];}
+if (isset($_GET["filter_inbound_number"])) {$filter_inbound_number=$_GET["filter_inbound_number"];}
+ elseif (isset($_POST["filter_inbound_number"])) {$filter_inbound_number=$_POST["filter_inbound_number"];}
+if (isset($_GET["filter_url"])) {$filter_url=$_GET["filter_url"];}
+ elseif (isset($_POST["filter_url"])) {$filter_url=$_POST["filter_url"];}
+if (isset($_GET["filter_action"])) {$filter_action=$_GET["filter_action"];}
+ elseif (isset($_POST["filter_action"])) {$filter_action=$_POST["filter_action"];}
+if (isset($_GET["filter_extension"])) {$filter_extension=$_GET["filter_extension"];}
+ elseif (isset($_POST["filter_extension"])) {$filter_extension=$_POST["filter_extension"];}
+if (isset($_GET["filter_exten_context"])) {$filter_exten_context=$_GET["filter_exten_context"];}
+ elseif (isset($_POST["filter_exten_context"])) {$filter_exten_context=$_POST["filter_exten_context"];}
+if (isset($_GET["filter_voicemail_ext"])) {$filter_voicemail_ext=$_GET["filter_voicemail_ext"];}
+ elseif (isset($_POST["filter_voicemail_ext"])) {$filter_voicemail_ext=$_POST["filter_voicemail_ext"];}
+if (isset($_GET["filter_phone"])) {$filter_phone=$_GET["filter_phone"];}
+ elseif (isset($_POST["filter_phone"])) {$filter_phone=$_POST["filter_phone"];}
+if (isset($_GET["filter_server_ip"])) {$filter_server_ip=$_GET["filter_server_ip"];}
+ elseif (isset($_POST["filter_server_ip"])) {$filter_server_ip=$_POST["filter_server_ip"];}
+if (isset($_GET["filter_user"])) {$filter_user=$_GET["filter_user"];}
+ elseif (isset($_POST["filter_user"])) {$filter_user=$_POST["filter_user"];}
+if (isset($_GET["filter_user_unavailable_action"])) {$filter_user_unavailable_action=$_GET["filter_user_unavailable_action"];}
+ elseif (isset($_POST["filter_user_unavailable_action"])) {$filter_user_unavailable_action=$_POST["filter_user_unavailable_action"];}
+if (isset($_GET["filter_user_route_settings_ingroup"])) {$filter_user_route_settings_ingroup=$_GET["filter_user_route_settings_ingroup"];}
+ elseif (isset($_POST["filter_user_route_settings_ingroup"])) {$filter_user_route_settings_ingroup=$_POST["filter_user_route_settings_ingroup"];}
+if (isset($_GET["filter_group_id"])) {$filter_group_id=$_GET["filter_group_id"];}
+ elseif (isset($_POST["filter_group_id"])) {$filter_group_id=$_POST["filter_group_id"];}
+if (isset($_GET["filter_call_handle_method"])) {$filter_call_handle_method=$_GET["filter_call_handle_method"];}
+ elseif (isset($_POST["filter_call_handle_method"])) {$filter_call_handle_method=$_POST["filter_call_handle_method"];}
+if (isset($_GET["filter_agent_search_method"])) {$filter_agent_search_method=$_GET["filter_agent_search_method"];}
+ elseif (isset($_POST["filter_agent_search_method"])) {$filter_agent_search_method=$_POST["filter_agent_search_method"];}
+if (isset($_GET["filter_list_id"])) {$filter_list_id=$_GET["filter_list_id"];}
+ elseif (isset($_POST["filter_list_id"])) {$filter_list_id=$_POST["filter_list_id"];}
+if (isset($_GET["filter_campaign_id"])) {$filter_campaign_id=$_GET["filter_campaign_id"];}
+ elseif (isset($_POST["filter_campaign_id"])) {$filter_campaign_id=$_POST["filter_campaign_id"];}
+if (isset($_GET["filter_phone_code"])) {$filter_phone_code=$_GET["filter_phone_code"];}
+ elseif (isset($_POST["filter_phone_code"])) {$filter_phone_code=$_POST["filter_phone_code"];}
+if (isset($_GET["filter_menu_id"])) {$filter_menu_id=$_GET["filter_menu_id"];}
+ elseif (isset($_POST["filter_menu_id"])) {$filter_menu_id=$_POST["filter_menu_id"];}
+if (isset($_GET["filter_clean_cid_number"])) {$filter_clean_cid_number=$_GET["filter_clean_cid_number"];}
+ elseif (isset($_POST["filter_clean_cid_number"])) {$filter_clean_cid_number=$_POST["filter_clean_cid_number"];}
if (isset($script_id)) {$script_id= strtoupper($script_id);}
@@ -1592,6 +1636,7 @@ if ($non_latin < 1)
$wait_time_option_seconds = ereg_replace("[^0-9]","",$wait_time_option_seconds);
$wait_time_option_callback_list_id = ereg_replace("[^0-9]","",$wait_time_option_callback_list_id);
$wait_time_option_prompt_seconds = ereg_replace("[^0-9]","",$wait_time_option_prompt_seconds);
+ $filter_list_id = ereg_replace("[^0-9]","",$filter_list_id);
$drop_call_seconds = ereg_replace("[^-0-9]","",$drop_call_seconds);
@@ -1725,6 +1770,7 @@ if ($non_latin < 1)
$agent_call_log_view_override = ereg_replace("[^0-9a-zA-Z]","",$agent_call_log_view_override);
$queuemetrics_loginout = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_loginout);
$queuemetrics_callstatus = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_callstatus);
+ $filter_inbound_number = ereg_replace("[^0-9a-zA-Z]","",$filter_inbound_number);
### DIGITS and Dots
$server_ip = ereg_replace("[^\.0-9]","",$server_ip);
@@ -1739,6 +1785,7 @@ if ($non_latin < 1)
$auto_dial_limit = ereg_replace("[^\.0-9]","",$auto_dial_limit);
$adaptive_dropped_percentage = ereg_replace("[^\.0-9]","",$adaptive_dropped_percentage);
$drop_lockout_time = ereg_replace("[^\.0-9]","",$drop_lockout_time);
+ $filter_server_ip = ereg_replace("[^\.0-9]","",$filter_server_ip);
### ALPHA-NUMERIC and spaces and hash and star and comma
$xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_a_dtmf);
@@ -1897,6 +1944,17 @@ if ($non_latin < 1)
$wait_time_option_xfer_group = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_option_xfer_group);
$wait_time_option_callmenu = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_option_callmenu);
$wait_time_option_voicemail = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_option_voicemail);
+ $filter_phone_group_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_phone_group_id);
+ $filter_action = ereg_replace("[^-_0-9a-zA-Z]","",$filter_action);
+ $filter_user_unavailable_action = ereg_replace("[^-_0-9a-zA-Z]","",$filter_user_unavailable_action);
+ $filter_user_route_settings_ingroup = ereg_replace("[^-_0-9a-zA-Z]","",$filter_user_route_settings_ingroup);
+ $filter_agent_search_method = ereg_replace("[^-_0-9a-zA-Z]","",$filter_agent_search_method);
+ $filter_campaign_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_campaign_id);
+ $filter_group_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_group_id);
+ $filter_menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_menu_id);
+ $filter_call_handle_method = ereg_replace("[^-_0-9a-zA-Z]","",$filter_call_handle_method);
+ $filter_user = ereg_replace("[^-_0-9a-zA-Z]","",$filter_user);
+ $filter_exten_context = ereg_replace("[^-_0-9a-zA-Z]","",$filter_exten_context);
### ALPHA-NUMERIC and underscore and dash and slash and dot
$menu_prompt = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$menu_prompt);
@@ -1944,6 +2002,9 @@ if ($non_latin < 1)
$phone = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$phone);
$phone_code = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$phone_code);
$wait_time_option_exten = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$wait_time_option_exten);
+ $filter_voicemail_ext = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$filter_voicemail_ext);
+ $filter_phone_code = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$filter_phone_code);
+ $filter_phone = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$filter_phone);
### ALPHA-NUMERIC and spaces dots, commas, dashes, underscores
$adaptive_dl_diff_target = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$adaptive_dl_diff_target);
@@ -2014,6 +2075,9 @@ if ($non_latin < 1)
$label_email = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_email);
$label_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_comments);
$slave_db_server = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$slave_db_server);
+ $filter_phone_group_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$filter_phone_group_name);
+ $filter_phone_group_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$filter_phone_group_description);
+ $filter_clean_cid_number = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$filter_clean_cid_number);
### ALPHA-NUMERIC and underscore and dash and slash and at and dot
$call_out_number_group = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$call_out_number_group);
@@ -2040,6 +2104,7 @@ if ($non_latin < 1)
### ALPHA-NUMERIC and underscore and dash and slash and at and dot and pound and star
$extension = ereg_replace("[^-\*\#\.\:\/\@\_0-9a-zA-Z]","",$extension);
$timer_action_destination = ereg_replace("[^-\*\#\.\:\/\@\_0-9a-zA-Z]","",$timer_action_destination);
+ $filter_extension = ereg_replace("[^-\*\#\.\:\/\@\_0-9a-zA-Z]","",$filter_extension);
### NUMERIC and comma and pipe
$waitforsilence_options = ereg_replace("[^\|\,0-9]","",$waitforsilence_options);
@@ -2095,6 +2160,7 @@ if ($non_latin < 1)
# $start_call_url
# $dispo_call_url
# $webphone_url
+ # $filter_url
### VARIABLES not filtered at all ###
# $script_text
@@ -2393,11 +2459,13 @@ else
# 100802-2130 - Changed Admin links to point to links page instead of Phones listings, changed Remote Agents to allow 9-digit IDs
# 100803-1412 - Added allowed_reports option to User Groups, added CAMPLISTS_ALL for manual_dial_filter(issue #369)
# - Added allowed_campaigns enforcement for Campaign listings
+# 100804-2313 - Added filter phone groups section for inbound call filtering by incoming phone number when it comes into a DID
+# 100805-1539 - Added option to clean up cid numbers when calls come into DIDs
#
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time
-$admin_version = '2.4-268';
-$build = '100803-1412';
+$admin_version = '2.4-270';
+$build = '100805-1539';
$STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s");
@@ -2591,12 +2659,14 @@ if ($ADD==11) {$hh='campaigns'; $sh='basic'; echo "Add New Campaign";}
if ($ADD==12) {$hh='campaigns'; $sh='basic'; echo "Copy Campaign";}
if ($ADD==111) {$hh='lists'; echo "Add New List";}
if ($ADD==121) {$hh='lists'; echo "Add New DNC";}
+if ($ADD==171) {$hh='ingroups'; echo "Filter Phone Group Numbers";}
if ($ADD==1111) {$hh='ingroups'; echo "Add New In-Group";}
if ($ADD==1211) {$hh='ingroups'; echo "Copy In-Group";}
if ($ADD==1311) {$hh='ingroups'; echo "Add New DID";}
if ($ADD==1411) {$hh='ingroups'; echo "Copy DID";}
if ($ADD==1511) {$hh='ingroups'; echo "Add Call Menu";}
if ($ADD==1611) {$hh='ingroups'; echo "Copy Call Menu";}
+if ($ADD==1711) {$hh='ingroups'; echo "Add Filter Phone Group";}
if ($ADD==11111) {$hh='remoteagent'; echo "Add New Remote Agents";}
if ($ADD==12111) {$hh='remoteagent'; echo "Add Extension Group";}
if ($ADD==111111) {$hh='usergroups'; echo "Add New Users Group";}
@@ -2635,6 +2705,7 @@ if ($ADD==2311) {$hh='ingroups'; echo "New DID Addition";}
if ($ADD==2411) {$hh='ingroups'; echo "New Copied DID Addition";}
if ($ADD==2511) {$hh='ingroups'; echo "New Call Menu";}
if ($ADD==2611) {$hh='ingroups'; echo "New Call Menu";}
+if ($ADD==2711) {$hh='ingroups'; echo "New Filter Phone Group";}
if ($ADD==21111) {$hh='remoteagent'; echo "New Remote Agents Addition";}
if ($ADD==22111) {$hh='remoteagent'; echo "New Group Extension Addition";}
if ($ADD==211111) {$hh='usergroups'; echo "New Users Group Addition";}
@@ -2696,6 +2767,7 @@ if ($ADD==311) {$hh='lists'; echo "Modify List";}
if ($ADD==3111) {$hh='ingroups'; echo "Modify In-Group";}
if ($ADD==3311) {$hh='ingroups'; echo "Modify DID";}
if ($ADD==3511) {$hh='ingroups'; echo "Modify Call Menu";}
+if ($ADD==3711) {$hh='ingroups'; echo "Modify Filter Phone Group";}
if ($ADD==31111) {$hh='remoteagent'; echo "Modify Remote Agents";}
if ($ADD==32111) {$hh='remoteagent'; echo "Modify Extension Group";}
if ($ADD==311111) {$hh='usergroups'; echo "Modify Users Groups";}
@@ -2736,6 +2808,7 @@ if ($ADD==411) {$hh='lists'; echo "Modify List";}
if ($ADD==4111) {$hh='ingroups'; echo "Modify In-Group";}
if ($ADD==4311) {$hh='ingroups'; echo "Modify DID";}
if ($ADD==4511) {$hh='ingroups'; echo "Modify Call Menu";}
+if ($ADD==4711) {$hh='ingroups'; echo "Modify Filter Phone Group";}
if ($ADD==41111) {$hh='remoteagent'; echo "Modify Remote Agents";}
if ($ADD==42111) {$hh='remoteagent'; echo "Modify Extension Group";}
if ($ADD==411111) {$hh='usergroups'; echo "Modify Users Groups";}
@@ -2768,6 +2841,7 @@ if ($ADD==511) {$hh='lists'; echo "Delete List";}
if ($ADD==5111) {$hh='ingroups'; echo "Delete In-Group";}
if ($ADD==5311) {$hh='ingroups'; echo "Delete DID";}
if ($ADD==5511) {$hh='ingroups'; echo "Delete Call Menu";}
+if ($ADD==5711) {$hh='ingroups'; echo "Delete Phone Filter Group";}
if ($ADD==51111) {$hh='remoteagent'; echo "Delete Remote Agents";}
if ($ADD==52111) {$hh='remoteagent'; echo "Delete Extension Group";}
if ($ADD==511111) {$hh='usergroups'; echo "Delete Users Group";}
@@ -2800,6 +2874,7 @@ if ($ADD==611) {$hh='lists'; echo "Delete List";}
if ($ADD==6111) {$hh='ingroups'; echo "Delete In-Group";}
if ($ADD==6311) {$hh='ingroups'; echo "Delete DID";}
if ($ADD==6511) {$hh='ingroups'; echo "Delete Call Menu";}
+if ($ADD==6711) {$hh='ingroups'; echo "Delete Phone Filter Group";}
if ($ADD==61111) {$hh='remoteagent'; echo "Delete Remote Agents";}
if ($ADD==62111) {$hh='remoteagent'; echo "Delete Extension Group";}
if ($ADD==611111) {$hh='usergroups'; echo "Delete Users Group";}
@@ -2836,6 +2911,7 @@ if ($ADD==100) {$hh='lists'; echo "Lists";}
if ($ADD==1000) {$hh='ingroups'; echo "In-Groups";}
if ($ADD==1300) {$hh='ingroups'; echo "DIDs";}
if ($ADD==1500) {$hh='ingroups'; echo "Call Menus";}
+if ($ADD==1700) {$hh='ingroups'; echo "Filter Phone Groups";}
if ($ADD==10000) {$hh='remoteagent'; echo "Remote Agents";}
if ($ADD==12000) {$hh='remoteagent'; echo "Extension Groups";}
if ($ADD==100000) {$hh='usergroups'; echo "User Groups";}
@@ -5145,6 +5221,32 @@ if ($ADD==99999)
In-Group Phone Code - If IN_GROUP is selected as the DID Route, then this is the Phone Code used if a new lead is created.
+
+
+
+ Clean CID Number - This field allows you to specify a number of digits to restrict the incoming caller ID number to by putting an R in front of the number of digits, for example to restrict to the right 10 digits you would enter in R10. You can also use this feature to remove only a leading digit or digits by putting an L in front of the specific digits that you want to remove, for example to remove a 1 as the first digit you would enter in L1. Default is empty. If more than one rule is specified make sure you separate them with a space and the R will run before the L.
+
+
+
+
+ Filter Inbound Number - This option if enabled allows you to filter calls coming into this DID and send them to an alternative action if they match a phone number that is in the filter phone group or a URL response if you have configured one. Default is DISABLED. GROUP will search in a Filter Phone Group. URL will send a URL and will match if a 1 is sent back.
+
+
+
+
+ Filter Phone Group ID - If the Filter Inbound Number field is set to GROUP then this is the ID of the Filter Phone Group that will have its numbers searched looking for a match to the caller ID number of the incoming call.
+
+
+
+
+ Filter URL - If the Filter Inbound Number field is set to URL then this is the web address of a script that will search a remote system and return a 1 for a match and a 0 for no match. Only two variables are available in the address if you use the VAR prefix like with webform addresses in campaigns, --A--phone_number--B-- and --A--did_pattern--B-- can be used in the URL to indicate the caller ID of the caller and the DID that the customer caclled in on.
+
+
+
+
+ Filter Action - If Filter Inbound Number is activated and a match is found then this is the action that is to be taken. This is the same as the Route that you select for a DID, and the settings below function just like they do for a standard routing.
+
+
@@ -5244,6 +5346,26 @@ if ($ADD==99999)
+
+
+
+
+
+ Filter Phone Group ID - This is the ID of the Filter Phone Group that is the container for a group of phone numbers that you can have automatically searched through when a call comes into a DID and send to an alternate route if there is a match. This field should be between 2 and 20 characters and have no punctuation except for underscore.
+
+
+
+
+ Filter Phone Group Name - This is the name of the Filter Phone Group and is displayed with the ID in select lists where this feature is used. This field should be between 2 and 40 characters.
+
+
+
+
+ Filter Phone Group Description - This is the description of the Filter Phone Group, it is purely for notation purposes only and is not a required field.
+
+
+
+
VICIDIAL_REMOTE_AGENTS TABLE
@@ -7687,7 +7809,123 @@ if ($ADD==121)
echo " \n";
}
echo "Add or Delete: \n";
- echo "\n";
+ echo "\n";
+
+ if ($LOGuser_level >= 9)
+ {
+ echo "
Download numbers in this list to a file: \n";
+ }
+ }
+
+
+######################
+# ADD=171 display the ADD NUMBER TO Filter Phone Group FORM SCREEN and add a new number
+######################
+
+if ($ADD==171)
+ {
+ echo "
| \n";
+ echo "";
+
+ $stmt="SELECT filter_phone_group_id,filter_phone_group_name from vicidial_filter_phone_groups order by filter_phone_group_id";
+ $rslt=mysql_query($stmt, $link);
+ $vfpg_to_print = mysql_num_rows($rslt);
+
+ $o=0;
+ while ($vfpg_to_print > $o)
+ {
+ $rowx=mysql_fetch_row($rslt);
+ $vfpg_list .= "\n";
+ $o++;
+ }
+
+ if (strlen($phone_numbers) > 2)
+ {
+ $PN = explode("\n",$phone_numbers);
+ $PNct = count($PN);
+ $p=0;
+ while ($p < $PNct)
+ {
+ if ( (ereg('delete',$stage)) and ($LOGdelete_from_dnc > 0) )
+ {
+ $stmt="SELECT count(*) from vicidial_filter_phone_numbers where phone_number='$PN[$p]' and filter_phone_group_id='$filter_phone_group_id';";
+ $rslt=mysql_query($stmt, $link);
+ $row=mysql_fetch_row($rslt);
+ if ($row[0] < 1)
+ {echo " FILTER PHONE GROUP NUMBER NOT DELETED - This phone number is not in the Filter Phone Group List: $PN[$p] $filter_phone_group_id\n";} + else + { + $stmt="DELETE FROM vicidial_filter_phone_numbers where phone_number='$PN[$p]' and filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + + echo " FILTER PHONE GROUP NUMBER DELETED: $PN[$p] $filter_phone_group_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='FILTERPHONEGROUPS', event_type='DELETE', record_id='$PN[$p]', event_code='ADMIN DELETE NUMBER FROM FILTER PHONE GROUP $filter_phone_group_id', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + $stmt="SELECT count(*) from vicidial_filter_phone_numbers where phone_number='$PN[$p]' and filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo " FILTER PHONE GROUP NUMBER NOT ADDED - This phone number is already in the Filter Phone Group List: $PN[$p] $filter_phone_group_id\n";} + else + { + $stmt="INSERT INTO vicidial_filter_phone_numbers (phone_number,filter_phone_group_id) values('$PN[$p]','$filter_phone_group_id');"; + $rslt=mysql_query($stmt, $link); + + echo " FILTER PHONE GROUP NUMBER ADDED: $PN[$p] $filter_phone_group_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='FILTERPHONEGROUPS', event_type='ADD', record_id='$PN[$p]', event_code='ADMIN ADD NUMBER TO FILTER PHONE GROUP $filter_phone_group_id', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $p++; + } + } + + if ($LOGdelete_from_dnc > 0) + {echo " ADD OR DELETE NUMBERS FROM THE FILTER PHONE GROUP LIST\n"; + } + } @@ -7994,6 +8232,34 @@ if ($ADD==1611) } +###################### +# ADD=1711 display the ADD NEW FILTER PHONE GROUP SCREEN +###################### + +if ($ADD==1711) + { + if ($LOGmodify_dids==1) + { + echo "
\n"; @@ -21744,6 +22248,58 @@ if ($ADD==31111) } +###################### +# ADD=3711 modify filter phone group info in the system +###################### + +if ($ADD==3711) + { + if ($LOGmodify_dids==1) + { + echo "
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||