diff --git a/agc_2-X/trunk/UPGRADE b/agc_2-X/trunk/UPGRADE index 60f373a0..3334b480 100644 --- a/agc_2-X/trunk/UPGRADE +++ b/agc_2-X/trunk/UPGRADE @@ -204,6 +204,10 @@ OTHER CHANGES: If you are using an older Net::Telnet version, you will need to upgrade! this should take just two commands: "cpan" and "install Net::Telnet" +50. Added DID System-wide filter option to System Settings + +51. Added DNC.COM inbound number filtering with DNCcom_inbound_filter.php + diff --git a/agc_2-X/trunk/agi/agi-DID_route.agi b/agc_2-X/trunk/agi/agi-DID_route.agi index b59714a6..c5c7bd81 100644 --- a/agc_2-X/trunk/agi/agi-DID_route.agi +++ b/agc_2-X/trunk/agi/agi-DID_route.agi @@ -43,6 +43,7 @@ # 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 +# 170923-1355 - Added system filter feature, before any other actions # @@ -144,7 +145,7 @@ $sthA->finish(); ############################################# ##### START SYSTEM SETTINGS LOOKUP ##### -$stmtA = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_eq_prepend,did_agent_log,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db FROM system_settings;"; +$stmtA = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_eq_prepend,did_agent_log,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db,did_system_filter FROM system_settings;"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -164,6 +165,7 @@ if ($sthArows > 0) $alt_log_login = $aryA[10]; $alt_log_pass = $aryA[11]; $tables_use_alt_log_db = $aryA[12]; + $SSdid_system_filter = $aryA[13]; } $sthA->finish(); ##### END SYSTEM SETTINGS LOOKUP ##### @@ -208,6 +210,455 @@ $callerid =~ s/\'|\"|\\\\|\\\|\\|\\;|\\\;|\;|;//gi; $calleridname =~ s/\'|\"|\\\\|\\\|\\|\\;|\\\;|\;|;//gi; $extension =~ s/\'|\"|\\\\|\\\|\\|\\;|\\\;|\;|;//gi; + +### BEGIN did_system_filter filter process ### +if ($SSdid_system_filter > 0) + { + if ($AGILOG) {$agi_string = "-- DID SYSTEM FILTER ENABLED: |$SSdid_system_filter|"; &agi_output;} + $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,group_id,filter_dnc_campaign,filter_url_did_redirect,no_agent_ingroup_redirect,no_agent_ingroup_id,no_agent_ingroup_extension,pre_filter_phone_group_id,pre_filter_extension,max_queue_ingroup_calls,max_queue_ingroup_id,max_queue_ingroup_extension FROM vicidial_inbound_dids where did_pattern = 'did_system_filter' and did_active='Y';"; + $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; + $did_id = $aryA[0]; + $did_pattern = $aryA[1]; + $did_description = $aryA[2]; + $did_active = $aryA[3]; + $did_route = $aryA[4]; + $did_extension = $aryA[5]; + $exten_context = $aryA[6]; + $voicemail_ext = $aryA[7]; + $phone = $aryA[8]; + $did_server_ip = $aryA[9]; + $user = $aryA[10]; + $user_unavailable_action = $aryA[11]; + $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]; + $group_id = $aryA[35]; + $filter_dnc_campaign = $aryA[36]; + $filter_url_did_redirect = $aryA[37]; + $no_agent_ingroup_redirect = $aryA[38]; + $no_agent_ingroup_id = $aryA[39]; + $no_agent_ingroup_extension = $aryA[40]; + $pre_filter_phone_group_id = $aryA[41]; + $pre_filter_extension = $aryA[42]; + $max_queue_ingroup_calls = $aryA[43]; + $max_queue_ingroup_id = $aryA[44]; + $max_queue_ingroup_extension = $aryA[45]; + } + else + { + if ($AGILOG) {$agi_string = "-- DID SYSTEM FILTER DOES NOT EXIST: |$sthArows|"; &agi_output;} + } + $sthA->finish(); + + if ($sthArows > 0) + { + if ($filter_inbound_number =~ /GROUP|URL|DNC_INTERNAL|DNC_CAMPAIGN/) + { + $original_callerid = $callerid; + ### BEGIN temp 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++;} + } + } + ### END temp clean caller id number ### + + if ($AGILOG) {$agi_string = "SYSTEM 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/) + { + $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; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $filter_match_found = $aryA[0]; + } + $sthA->finish(); + + if ( ($filter_match_found < 1) && ($filter_inbound_number =~ /AREACODE/) ) + { + $alt_areacode = substr($callerid, 0, 3); + $alt_areacode .= "XXXXXXX"; + $stmtB = "SELECT count(*) FROM vicidial_filter_phone_numbers where filter_phone_group_id='$filter_phone_group_id' and phone_number='$alt_areacode';"; + $sthA = $dbhA->prepare($stmtB) 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(); + } + if ($AGILOG) {$agi_string = "SYSTEM FILTER GROUP: |$filter_match_found|$stmtA|$stmtB|"; &agi_output;} + } + elsif ($filter_inbound_number =~ /DNC_INTERNAL/) + { + $alt_areacode = substr($callerid, 0, 3); + $alt_areacode .= "XXXXXXX"; + $stmtA = "SELECT count(*) FROM vicidial_dnc where phone_number IN('$callerid','$alt_areacode');"; + $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(); + if ($AGILOG) {$agi_string = "SYSTEM FILTER DNC_INTERNAL: |$filter_match_found|$stmtA|"; &agi_output;} + } + elsif ($filter_inbound_number =~ /DNC_CAMPAIGN/) + { + $alt_areacode = substr($callerid, 0, 3); + $alt_areacode .= "XXXXXXX"; + $stmtA = "SELECT count(*) FROM vicidial_campaign_dnc where campaign_id='$filter_dnc_campaign' and phone_number IN('$callerid','$alt_areacode');"; + $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(); + if ($AGILOG) {$agi_string = "SYSTEM FILTER DNC_CAMPAIGN: |$filter_match_found|$stmtA|"; &agi_output;} + } + 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/^VAR|^ //gi; + $filter_url =~ s/--A--phone_number--B--/$callerid/gi; + $filter_url =~ s/--A--did_pattern--B--/$did_pattern/gi; + $filter_url =~ s/--A--uniqueid--B--/$uniqueid/gi; + $filter_url =~ s/--A--channel--B--/$channel/gi; + $filter_url =~ s/--A--server_ip--B--/$VARserver_ip/gi; + $filter_url =~ s/&/\\&/gi; + $filter_url =~ s/ /+/gi; + + ### insert a new url log entry + $SQL_log = "$filter_url"; + $SQL_log =~ s/;|\||\\//gi; + $stmtA = "INSERT INTO vicidial_url_log SET uniqueid='$uniqueid',url_date=NOW(),url_type='DID_FILTER',url='$SQL_log',url_response='';"; + $affected_rows = $dbhA->do($stmtA); + $stmtB = "SELECT LAST_INSERT_ID() LIMIT 1;"; + $sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $url_id = $aryA[0]; + } + $sthA->finish(); + my $secW = time(); + + @curl_output = `$curlbin $filter_url`; + + my $secY = time(); + my $response_sec = ($secY - $secW); + + $k=0; + $full_output=''; + foreach (@curl_output) + { + $full_output_raw .= $curl_output[$k]; + $k++; + } + $full_output = $full_output_raw; + $full_output =~ s/\D//gi; + if ($full_output > 0) + { + $filter_match_found = $full_output; + if ($filter_url_did_redirect =~ /Y/) + { + $did_route='DID'; + if ($AGILOG) {$agi_string = "SYSTEM Filter URL DID Redirect found: |$filter_match_found|$filter_url_did_redirect|$did_route|"; &agi_output;} + } + } + ### update url log entry + $full_output_raw =~ s/;|\||\\//gi; + $stmtA = "UPDATE vicidial_url_log SET url_response='$full_output_raw|$full_output',response_sec='$response_sec' where url_log_id='$url_id';"; + $affected_rows = $dbhA->do($stmtA); + + if ($AGILOG) {$agi_string = "SYSTEM URL filter search response: |$filter_match_found|$full_output|$filter_url|$affected_rows|"; &agi_output;} + } + } + if ($filter_match_found > 0) + { + if ($did_route !~ /DID/) + {$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 = "SYSTEM Filter match found: |$filter_match_found|$filter_inbound_number|$filter_action|$did_route|"; &agi_output;} + + 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;} + } + + ### Log the call to vicidial_did_log + $stmtA = "INSERT INTO vicidial_did_log SET uniqueid='$uniqueid',channel='$channel',server_ip='$VARserver_ip',caller_id_number='$callerid',caller_id_name='$calleridname',extension='$extension',call_date='$SQLdate',did_id='$did_id',did_route='F_$did_route';"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $affected_rowsL = $dbhA->do($stmtA); + if ($AGILOG) {$agi_string = "-- SYSTEM FILTER DID LOG : |$affected_rowsL|$stmtA|"; &agi_output;} + + ### Log the call to call_log + $stmtA = "INSERT INTO call_log SET uniqueid='$unique_id', channel='$channel', channel_group='DID_INBOUND', server_ip='$VARserver_ip', type='$type', extension='$extension', number_dialed='$extension', caller_code='$callerid', start_time='$SQLdate', start_epoch='$now_date_epoch';"; + $affected_rowsC = $dbhA->do($stmtA); + if ($AGILOG) {$agi_string = "-- SYSTEM FILTER CALL LOG : |$affected_rowsC|$stmtA|"; &agi_output;} + + if ($AGILOG) {$did_string = "$SQLdate|$uniqueid|$channel|$extension|$callerid|$calleridname|$did_id|$did_route|"; &did_output;} + + if ($did_agent_log =~ /Y/) + { + if ($did_route !~ /IN_GROUP/) + {$group_id='';} + $stmtA = "INSERT INTO vicidial_did_agent_log SET uniqueid='$uniqueid',server_ip='$VARserver_ip',caller_id_number='$callerid',caller_id_name='$calleridname',extension='$extension',call_date='$SQLdate',did_id='$did_id',did_route='$did_route',user='VDCL',group_id='$group_id',did_description='$did_description';"; + + if ( ($tables_use_alt_log_db =~ /did_agent_log/i) && (length($alt_log_server_ip)>4) && (length($alt_log_dbname)>0) ) + { + $dbhD = DBI->connect("DBI:mysql:$alt_log_dbname:$alt_log_server_ip:3306", "$alt_log_login", "$alt_log_pass") + or die "Couldn't connect to database: " . DBI->errstr; + + if ($AGILOG) {$agi_string = "CONNECTED TO ALT-LOG DATABASE: $alt_log_server_ip|$alt_log_dbname|$uniqueid"; &agi_output;} + + $affected_rowsAL = $dbhD->do($stmtA); + + $dbhD->disconnect(); + } + else + { + $affected_rowsAL = $dbhA->do($stmtA); + } + if ($AGILOG) {$agi_string = "SYSTEM FILTER -- DID AGENT LOG : |$affected_rowsAL|$stmtA|"; &agi_output;} + } + + ### 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';"; + $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; + $dialplan_number = $aryA[0]; + $voicemail_id = $aryA[1]; + $protocol = $aryA[2]; + $ext_context = $aryA[3]; + } + $sthA->finish(); + + ### format the remote server dialstring to get the call to the overflow agent meetme room + if( $did_server_ip =~ m/(\S+)\.(\S+)\.(\S+)\.(\S+)/ ) + { + $a = leading_zero($1); + $b = leading_zero($2); + $c = leading_zero($3); + $d = leading_zero($4); + $ServerString = "$a$S$b$S$c$S$d$S"; + } + + $did_extension = "$ServerString$dialplan_number"; + $did_route = 'EXTEN'; + } + + ### Route call to a voicemail box on the system + if ($did_route =~ /VOICEMAIL|VMAIL_NO_INST/) + { + ### format the remote server dialstring to get the call to the overflow agent meetme room + if( $did_server_ip =~ m/(\S+)\.(\S+)\.(\S+)\.(\S+)/ ) + { + $a = leading_zero($1); + $b = leading_zero($2); + $c = leading_zero($3); + $d = leading_zero($4); + $ServerString = "$a$S$b$S$c$S$d$S"; + } + if ($did_route =~ /VMAIL_NO_INST/) + {$voicemail_dump_exten = $voicemail_dump_exten_no_inst;} + $did_extension = "$ServerString$voicemail_dump_exten$voicemail_ext"; + $did_route = 'EXTEN'; + } + + ### Route call to a VICIDIAL Inbound Group + if ($did_route =~ /IN_GROUP/) + { + $did_extension = "99909$S$did_id$S$S$S$route_type"; + $exten_context = $ext_context; + $did_route = 'EXTEN'; + } + + ### Route call to a logged-in VICIDIAL agent + if ($did_route =~ /AGENT/) + { + $did_extension = "99909$S$did_id$S$S$S$route_type"; + $exten_context = $ext_context; + $did_route = 'EXTEN'; + } + + ### QueueMetrics logging if enabled + if ( ($did_route =~ /EXTEN|CALLMENU/) && ($enable_queuemetrics_logging > 0) ) + { + $dbhB = DBI->connect("DBI:mysql:$queuemetrics_dbname:$queuemetrics_server_ip:3306", "$queuemetrics_login", "$queuemetrics_pass") + or die "Couldn't connect to database: " . DBI->errstr; + + if ($DBX) {print "CONNECTED TO QueueMetrics DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";} + + $stmtB = "INSERT INTO queue_log SET `partition`='P01',time_id='$now_date_epoch',call_id='$uniqueid',queue='NONE',agent='NONE',verb='INFO',data1='DID',data2='$extension',serverid='$queuemetrics_log_id';"; + $Baffected_rows = $dbhB->do($stmtB); + $dbhB->disconnect(); + } + + ### Route call to an extension on the system + if ($did_route =~ /EXTEN/) + { + $XFERexten = "$did_extension"; + if ($AGILOG) {$agi_string = "SYSTEM FILTER exiting the DID app, transferring call to $XFERexten @ $exten_context"; &agi_output;} + print "SET CONTEXT $exten_context\n"; + $result = ; + checkresult($result); + print "SET EXTENSION $XFERexten\n"; + $result = ; + checkresult($result); + print "SET PRIORITY 1\n"; + $result = ; + checkresult($result); + + exit; + } + + ### Route call to a DID in the trunkinbound context on the system + if ($did_route =~ /DID/) + { + if ($AGILOG) {$agi_string = "SYSTEM FILTER exiting the DID app, transferring call to $filter_match_found @ trunkinbound"; &agi_output;} + print "SET CONTEXT trunkinbound\n"; + $result = ; + checkresult($result); + print "SET EXTENSION $filter_match_found\n"; + $result = ; + checkresult($result); + print "SET PRIORITY 1\n"; + $result = ; + checkresult($result); + + exit; + } + + ### Route call to a call menu on the system + if ($did_route =~ /CALLMENU/) + { + if ($enable_queuemetrics_logging > 0) + { + $dbhB = DBI->connect("DBI:mysql:$queuemetrics_dbname:$queuemetrics_server_ip:3306", "$queuemetrics_login", "$queuemetrics_pass") + or die "Couldn't connect to database: " . DBI->errstr; + + if ($DBX) {print "CONNECTED TO QM DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";} + + $stmtB = "INSERT INTO queue_log SET `partition`='P01',time_id='$now_date_epoch',call_id='$uniqueid',queue='NONE',agent='NONE',verb='INFO',data1='IVRSTART',data2='$callerid',data3='$extension',serverid='$queuemetrics_log_id';"; + $Baffected_rows = $dbhB->do($stmtB); + $dbhB->disconnect(); + } + + $XFERcontext = "$menu_id"; + if ($AGILOG) {$agi_string = "SYSTEM FILTER exiting the DID app, transferring call to CALLMENU $XFERcontext"; &agi_output;} + print "SET CONTEXT $XFERcontext\n"; + $result = ; + checkresult($result); + print "SET EXTENSION s\n"; + $result = ; + checkresult($result); + print "SET PRIORITY 1\n"; + $result = ; + checkresult($result); + + exit; + } + } + $callerid = $original_callerid; + } + } + } +### END did_system_filter filter process ### + + + ### 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,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,group_id,filter_dnc_campaign,filter_url_did_redirect,no_agent_ingroup_redirect,no_agent_ingroup_id,no_agent_ingroup_extension,pre_filter_phone_group_id,pre_filter_extension,max_queue_ingroup_calls,max_queue_ingroup_id,max_queue_ingroup_extension FROM vicidial_inbound_dids where did_pattern = '$extension' and did_active='Y';"; diff --git a/agc_2-X/trunk/docs/ASTERISK_13.txt b/agc_2-X/trunk/docs/ASTERISK_13.txt index cb48ccb5..e41471a8 100644 --- a/agc_2-X/trunk/docs/ASTERISK_13.txt +++ b/agc_2-X/trunk/docs/ASTERISK_13.txt @@ -1,4 +1,4 @@ -ASTERISK 13 COMPATIBILITY START: 2017-09-16 UPDATE: 2017-09-16 +ASTERISK 13 COMPATIBILITY START: 2017-09-16 UPDATE: 2017-09-22 @@ -64,9 +64,9 @@ make make install cd ../../ -wget http://download.vicidial.com/beta-apps/asterisk-13.17.1-vici.tar.gz -tar xvfz asterisk-13.17.1-vici.tar.gz -cd asterisk-13.17.1-vici/ +wget http://download.vicidial.com/beta-apps/asterisk-13.17.2-vici.tar.gz +tar xvfz asterisk-13.17.2-vici.tar.gz +cd asterisk-13.17.2-vici/ ./configure --with-dahdi=/usr/src/asterisk/dahdi-linux-complete-2.11.1+2.11.1/ --with-gsm=internal --with-ogg=/usr/lib64/ make menuselect make @@ -101,7 +101,7 @@ cd ../../ wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gz tar xvfz asterisk-13-current.tar.gz -cd asterisk-13.17.1/ +cd asterisk-13.17.2/ wget http://download.vicidial.com/asterisk-patches/leave.h wget http://download.vicidial.com/asterisk-patches/enter.h mv -f enter.h apps/enter.h diff --git a/agc_2-X/trunk/docs/DNC-dot-COM_integration.txt b/agc_2-X/trunk/docs/DNC-dot-COM_integration.txt index 3b7381b9..34e197ec 100644 --- a/agc_2-X/trunk/docs/DNC-dot-COM_integration.txt +++ b/agc_2-X/trunk/docs/DNC-dot-COM_integration.txt @@ -1,17 +1,19 @@ -DNC.COM INTEGRATION Started: 2015-12-02 Updated: 2016-11-14 +DNC.COM INTEGRATION Started: 2015-12-02 Updated: 2017-09-25 NOTE: for DNC.COM integration of batch cellphone filtering, see this document: CELLPHONE_USA_TCPA_FCC_COMPLIANCE.txt -We have added a utility to allow for direct filtering of lists on your Vicidial system with a DNC.COM account, to allow for state, federal(FTC) and internal DNC lists as well as TCPA and Litigator Scrub direct through DNC.COM. +We have added a utility to allow for direct filtering of lists on your Vicidial system with a DNC.COM account, to allow for state, federal(FTC) and internal DNC lists as well as TCPA and Litigator Scrub direct through DNC.COM. We have also added a new inbound scrubbing option for calls coming in through DIDs on your system. DNC.COM is also offering a Free 15 day trial to VICIdial users of their Real-time Integrated TCPA and DNC Safe Harbor lead scrubbing. For more information on this free offer, contact us (http://www.vicidial.com/?page_id=7). + +########## OUTBOUND LIST FILTERING ############################################ + The script that allows for this must be run from the Linux command-line(CLI): AST_DNCcom_filter.pl - In order for this script to work, you must have a Settings Container set up within Vicidial with the ID of "DNCDOTCOM". This settings container should be customized for your specific DNC.COM account, and how you want it to function. @@ -31,7 +33,7 @@ LOGIN_ID => 1234567890QWERTYUIOP1234567890QWERTYUIOP # the Master Project PROJ_ID => -# CAMPAIGN_ID denotes the campaignId you wish to scrub-in – if you +# CAMPAIGN_ID denotes the campaignId you wish to scrub-in - if you # specify this you may omit projId; if omitted we assume Default # Campaign of projId, or if both are omitted, the Default Campaign of # your Master Project @@ -185,3 +187,32 @@ STATUS_Y => YDNCCM # documentation. The additional fields will be comma separated. # Values are YES or NO. ADD_INFO_TO_COMMENTS => NO + + + + + +########## INBOUND CALL DID FILTERING ############################################ + +There is also a script that will work with the Inbound DID configuration to filter calls coming in through DIDs: + DNCcom_inbound_filter.php + + +For this script to work, you must have the same DNCDOTCOM settings container created in the system as shown above, but you will need to add another option to specify if you want to filter out USADNC numbers and/or LITIGATOR numbers: + +# For inbound filtering, +# USADNC will block federal DNC numbers +# LITIGATOR will block the litigator list, if subscribed +# INVALID will block invalid numbers +INBOUND_FILTER => USADNC,LITIGATOR,INVALID + +Here is an example of what to put in the "Filter URL" field of the DID entry that you will be using this for. +NOTES: + - Make sure you set the "Filter Inbound Number" option to "URL" + - If you want this to be a system-wide filter, use the "did_system_filter" DID entry that you get to by clicking on the link in the Admin -> System Settings page. + - The below example assumes the local connection to your webserver from your dialers is "192.168.1.3" + +http://192.168.1.3/vicidial/DNCcom_inbound_filter.php?phone=--A--phone_number--B-- + + +IMPORTANT! We strongly recommend that if you are receiving calls from North America that you set the DID option "Clean CID Number" to "R10" so that you will always be looking up 10 digit numbers properly. diff --git a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql index 5cf4badf..f7c7b697 100644 --- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql +++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql @@ -1724,7 +1724,8 @@ agent_push_events ENUM('0','1') default '0', agent_push_url TEXT, hide_inactive_lists ENUM('0','1') default '0', allow_manage_active_lists ENUM('0','1') default '0', -expired_lists_inactive ENUM('0','1') default '0' +expired_lists_inactive ENUM('0','1') default '0', +did_system_filter ENUM('0','1') default '0' ) ENGINE=MyISAM; CREATE TABLE vicidial_campaigns_list_mix ( @@ -3795,6 +3796,17 @@ index (lead_id), index (uniqueid) ) ENGINE=MyISAM; +CREATE TABLE vicidial_dnccom_scrub_log ( +phone_number VARCHAR(18), +scrub_date DATETIME NOT NULL, +flag_invalid ENUM('','0','1') default '', +flag_dnc ENUM('','0','1') default '', +flag_litigator ENUM('','0','1') default '', +full_response VARCHAR(255) default '', +index(phone_number), +index(scrub_date) +) ENGINE=MyISAM; + ALTER TABLE vicidial_email_list MODIFY message text character set utf8; @@ -4072,4 +4084,4 @@ UPDATE vicidial_configuration set value='1766' where name='qc_database_version'; UPDATE system_settings set vdc_agent_api_active='1'; -UPDATE system_settings SET db_schema_version='1516',db_schema_update_date=NOW(),reload_timestamp=NOW(); +UPDATE system_settings SET db_schema_version='1517',db_schema_update_date=NOW(),reload_timestamp=NOW(); diff --git a/agc_2-X/trunk/extras/upgrade_2.14.sql b/agc_2-X/trunk/extras/upgrade_2.14.sql index 3dcff9c1..53754667 100644 --- a/agc_2-X/trunk/extras/upgrade_2.14.sql +++ b/agc_2-X/trunk/extras/upgrade_2.14.sql @@ -374,3 +374,18 @@ UPDATE system_settings SET db_schema_version='1515',db_schema_update_date=NOW() ALTER TABLE system_settings ADD expired_lists_inactive ENUM('0','1') default '0'; UPDATE system_settings SET db_schema_version='1516',db_schema_update_date=NOW() where db_schema_version < 1516; + +ALTER TABLE system_settings ADD did_system_filter ENUM('0','1') default '0'; + +CREATE TABLE vicidial_dnccom_scrub_log ( +phone_number VARCHAR(18), +scrub_date DATETIME NOT NULL, +flag_invalid ENUM('','0','1') default '', +flag_dnc ENUM('','0','1') default '', +flag_litigator ENUM('','0','1') default '', +full_response VARCHAR(255) default '', +index(phone_number), +index(scrub_date) +) ENGINE=MyISAM; + +UPDATE system_settings SET db_schema_version='1517',db_schema_update_date=NOW() where db_schema_version < 1517; diff --git a/agc_2-X/trunk/www/agc/vicidial.php b/agc_2-X/trunk/www/agc/vicidial.php index 1c6e43e7..cf6e9f2c 100644 --- a/agc_2-X/trunk/www/agc/vicidial.php +++ b/agc_2-X/trunk/www/agc/vicidial.php @@ -565,10 +565,11 @@ # 170912-1619 - Fix for no-hopper dnc dialing issue # 170913-1747 - Small change for two agent events # 170914-0708 - Fix for script tab issue +# 170923-1336 - Small change to hangup customer process # -$version = '2.14-535c'; -$build = '170914-0708'; +$version = '2.14-536c'; +$build = '170923-1336'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=87; $one_mysql_log=0; @@ -12223,13 +12224,13 @@ function set_length(SLnumber,SLlength_goal,SLdirection) // { // alert(xmlhttp.responseText); // } - + VD_live_customer_call = 0; agent_events('agent_hangup', '', aec); aec++; } } - process_post_hangup=1; delete xmlhttp; } + process_post_hangup=1; } else {process_post_hangup=1;} diff --git a/agc_2-X/trunk/www/vicidial/AST_url_log_report.php b/agc_2-X/trunk/www/vicidial/AST_url_log_report.php index 997be202..ee6c5fe1 100644 --- a/agc_2-X/trunk/www/vicidial/AST_url_log_report.php +++ b/agc_2-X/trunk/www/vicidial/AST_url_log_report.php @@ -220,7 +220,7 @@ while($i < $url_type_ct) $i++; } -$LISTurltypes=array("add_lead", "custom", "dispo", "na_callurl", "non-agent", "other", "qm_socket", "start", "start_ra","nva_phone","DID_FILTER","park_ivr_c","webform"); +$LISTurltypes=array("add_lead", "custom", "dispo", "na_callurl", "non-agent", "other", "qm_socket", "start", "start_ra","nva_phone","DID_FILTER","DNCcom","park_ivr_c","webform"); $url_types_to_print=count($LISTurltypes); $i=0; diff --git a/agc_2-X/trunk/www/vicidial/DNCcom_inbound_filter.php b/agc_2-X/trunk/www/vicidial/DNCcom_inbound_filter.php new file mode 100644 index 00000000..44d86a86 --- /dev/null +++ b/agc_2-X/trunk/www/vicidial/DNCcom_inbound_filter.php @@ -0,0 +1,184 @@ + LICENSE: AGPLv2 +# +# This script searches DNC.COM's scrub service for incoming DID phone numbers +# and returns a blocking match of '1' that will send the call to the Filter route +# DID Filter URL feature in the URL search type with the following URL: +# VARhttp://server/vicidial/DNCcom_inbound_filter.php?phone=--A--phone_number--B-- +# +# This script REQUIRES a Settings Container in the system with ID of: DNCDOTCOM +# For inbound filtering, use the below variable in the settings container: +# USADNC will block federal DNC numbers +# LITIGATOR will block the litigator list, if subscribed +# INVALID will block invalid numbers +# +#INBOUND_FILTER => USADNC,LITIGATOR,INVALID +# +# This code is tested against DNC.COM scrub utility version 2.12 +# +# CHANGES +# 170923-1905 - First Build +# + +header ("Content-type: text/html; charset=utf-8"); + +require("dbconnect_mysqli.php"); +require("functions.php"); + +if (isset($_GET["phone"])) {$phone=$_GET["phone"];} + elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable FROM system_settings;"; +$rslt=mysql_to_mysqli($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysqli_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $non_latin = $row[0]; + $webroot_writable = $row[1]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) + { + $phone=preg_replace('/[^-_0-9a-zA-Z]/','',$phone); + } +else + { + $phone = preg_replace("/'|\"|\\\\|;/","",$phone); + } +$filter_count=0; +$ENTRYdate = date("mdHis"); + +$stmt = "SELECT count(*) FROM vicidial_settings_containers where container_id='DNCDOTCOM';"; +$rslt=mysql_to_mysqli($stmt, $link); +if ($DB) {echo "$stmt\n";} +$sc_ct = mysqli_num_rows($rslt); +if ($sc_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $SC_count = $row[0]; + } + +if ($SC_count > 0) + { + $stmt = "SELECT container_entry FROM vicidial_settings_containers where container_id='DNCDOTCOM';"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($DB) {echo "$stmt\n";} + $sc_ct = mysqli_num_rows($rslt); + if ($sc_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $container_entry = $row[0]; + $container_ARY = explode("\n",$container_entry); + $p=0; + $scrub_url=''; + $flag_invalid=0; + $flag_dnc=0; + $flag_litigator=0; + $container_ct = count($container_ARY); + while ($p <= $container_ct) + { + $line = $container_ARY[$p]; + $line = preg_replace("/\n|\r|\t|\#.*|;.*/",'',$line); + if (preg_match("/^DNC_DOT_COM_URL/",$line)) + {$scrub_url = $line; $scrub_url = trim(preg_replace("/.*=>/",'',$scrub_url));} + if (preg_match("/^LOGIN_ID/",$line)) + {$login_id = $line; $login_id = trim(preg_replace("/.*=>/",'',$login_id));} + if (preg_match("/^PROJ_ID/",$line)) + {$project_id = $line; $project_id = trim(preg_replace("/.*=>/",'',$project_id));} + if (preg_match("/^CAMPAIGN_ID/",$line)) + {$campaign_id = $line; $campaign_id = trim(preg_replace("/.*=>/",'',$campaign_id));} + if (preg_match("/^INBOUND_FILTER/",$line)) + {$in_filter = $line; $in_filter = trim(preg_replace("/.*=>/",'',$in_filter));} + + $p++; + } + + $scrub_url .= "?version=2&loginId=" . $login_id . "&phoneList=" . $phone; + if (strlen($project_id)>0) {$scrub_url .= "&projId=" . $project_id;} + if (strlen($campaign_id)>0) {$scrub_url .= "&campaignId=" . $campaign_id;} + + ### insert a new url log entry + $uniqueid = $ENTRYdate . '.' . $phone; + $SQL_log = "$scrub_url"; + $SQL_log = preg_replace('/;|\n/','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt = "INSERT INTO vicidial_url_log SET uniqueid='$uniqueid',url_date=NOW(),url_type='DNCcom',url='$SQL_log',url_response='';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + $affected_rows = mysqli_affected_rows($link); + $url_id = mysqli_insert_id($link); + + $URLstart_sec = date("U"); + + if ($DB > 0) {echo "$scrub_url
\n";} + $SCUfile = file("$scrub_url"); + if ( !($SCUfile) ) + { + $error_array = error_get_last(); + $error_type = $error_array["type"]; + $error_message = $error_array["message"]; + $error_line = $error_array["line"]; + $error_file = $error_array["file"]; + } + + if ($DB > 0) {echo "$SCUfile[0]
\n";} + + ### update url log entry + $URLend_sec = date("U"); + $URLdiff_sec = ($URLend_sec - $URLstart_sec); + if ($SCUfile) + { + $SCUfile_contents = implode("", $SCUfile); + $SCUfile_contents = preg_replace("/;|\n/",'',$SCUfile_contents); + $SCUfile_contents = addslashes($SCUfile_contents); + } + else + { + $SCUfile_contents = "PHP ERROR: Type=$error_type - Message=$error_message - Line=$error_line - File=$error_file"; + } + $stmt = "UPDATE vicidial_url_log SET response_sec='$URLdiff_sec',url_response='$SCUfile_contents' where url_log_id='$url_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + $affected_rows = mysqli_affected_rows($link); + + $result_details = explode(',',$SCUfile_contents); + if ($result_details[1] == 'D') + { + if ( (preg_match("/National \(USA\)/",$SCUfile_contents)) and (preg_match("/USADNC/",$in_filter)) ) + { + $flag_dnc++; + $filter_count++; + } + if ( (preg_match("/Litigator/",$SCUfile_contents)) and (preg_match("/LITIGATOR/",$in_filter)) ) + { + $flag_litigator++; + $filter_count++; + } + } + if ( ($result_details[1] == 'I') or ( (preg_match("/not a valid number/",$SCUfile_contents)) and (preg_match("/INVALID/",$in_filter)) ) ) + { + $flag_invalid++; + $filter_count++; + } + + $stmt = "INSERT INTO vicidial_dnccom_scrub_log SET phone_number='$phone',scrub_date=NOW(),flag_invalid='$flag_invalid',flag_dnc='$flag_dnc',flag_litigator='$flag_litigator',full_response='$SCUfile_contents';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + $affected_rows = mysqli_affected_rows($link); + if ($DB) {echo "$affected_rows|$stmt\n";} + } + } + +echo "$filter_count\n"; + +?> diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index 311c797f..eb80ffa1 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -2267,6 +2267,8 @@ if (isset($_GET["filename_override"])) {$filename_override=$_GET["filename_ove elseif (isset($_POST["filename_override"])) {$filename_override=$_POST["filename_override"];} if (isset($_GET["expired_lists_inactive"])) {$expired_lists_inactive=$_GET["expired_lists_inactive"];} elseif (isset($_POST["expired_lists_inactive"])) {$expired_lists_inactive=$_POST["expired_lists_inactive"];} +if (isset($_GET["did_system_filter"])) {$did_system_filter=$_GET["did_system_filter"];} + elseif (isset($_POST["did_system_filter"])) {$did_system_filter=$_POST["did_system_filter"];} if (isset($script_id)) {$script_id= strtoupper($script_id);} @@ -2281,7 +2283,7 @@ if (strlen($dial_status) > 0) ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,enable_queuemetrics_logging,enable_vtiger_integration,qc_features_active,outbound_autodial_active,sounds_central_control_active,enable_second_webform,user_territories_active,custom_fields_enabled,admin_web_directory,webphone_url,first_login_trigger,hosted_settings,default_phone_registration_password,default_phone_login_password,default_server_password,test_campaign_calls,active_voicemail_server,voicemail_timezones,default_voicemail_timezone,default_local_gmt,campaign_cid_areacodes_enabled,pllb_grouping_limit,did_ra_extensions_enabled,expanded_list_stats,contacts_enabled,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db,call_menu_qualify_enabled,admin_list_counts,allow_voicemail_greeting,svn_revision,allow_emails,level_8_disable_add,pass_key,pass_hash_enabled,disable_auto_dial,country_code_list_stats,frozen_server_call_clear,active_modules,allow_chats,enable_languages,language_method,meetme_enter_login_filename,meetme_enter_leave3way_filename,enable_did_entry_list_id,enable_third_webform,default_language,user_hide_realtime_enabled,log_recording_access,alt_ivr_logging,admin_row_click,admin_screen_colors,ofcom_uk_drop_calc,agent_screen_colors,script_remove_js,manual_auto_next,user_new_lead_limit,agent_xfer_park_3way,agent_soundboards,web_loader_phone_length,agent_script,enable_auto_reports,enable_pause_code_limits,enable_drop_lists,allow_ip_lists,system_ip_blacklist,hide_inactive_lists,allow_manage_active_lists,expired_lists_inactive FROM system_settings;"; +$stmt = "SELECT use_non_latin,enable_queuemetrics_logging,enable_vtiger_integration,qc_features_active,outbound_autodial_active,sounds_central_control_active,enable_second_webform,user_territories_active,custom_fields_enabled,admin_web_directory,webphone_url,first_login_trigger,hosted_settings,default_phone_registration_password,default_phone_login_password,default_server_password,test_campaign_calls,active_voicemail_server,voicemail_timezones,default_voicemail_timezone,default_local_gmt,campaign_cid_areacodes_enabled,pllb_grouping_limit,did_ra_extensions_enabled,expanded_list_stats,contacts_enabled,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db,call_menu_qualify_enabled,admin_list_counts,allow_voicemail_greeting,svn_revision,allow_emails,level_8_disable_add,pass_key,pass_hash_enabled,disable_auto_dial,country_code_list_stats,frozen_server_call_clear,active_modules,allow_chats,enable_languages,language_method,meetme_enter_login_filename,meetme_enter_leave3way_filename,enable_did_entry_list_id,enable_third_webform,default_language,user_hide_realtime_enabled,log_recording_access,alt_ivr_logging,admin_row_click,admin_screen_colors,ofcom_uk_drop_calc,agent_screen_colors,script_remove_js,manual_auto_next,user_new_lead_limit,agent_xfer_park_3way,agent_soundboards,web_loader_phone_length,agent_script,enable_auto_reports,enable_pause_code_limits,enable_drop_lists,allow_ip_lists,system_ip_blacklist,hide_inactive_lists,allow_manage_active_lists,expired_lists_inactive,did_system_filter FROM system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysqli_num_rows($rslt); @@ -2361,6 +2363,7 @@ if ($qm_conf_ct > 0) $SShide_inactive_lists = $row[70]; $SSallow_manage_active_lists = $row[71]; $SSexpired_lists_inactive = $row[72]; + $SSdid_system_filter = $row[73]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -2517,7 +2520,6 @@ if ($non_latin < 1) $vdc_agent_api_active = preg_replace('/[^0-9]/','',$vdc_agent_api_active); $hold_time_option_seconds = preg_replace('/[^0-9]/','',$hold_time_option_seconds); $hold_time_option_callback_list_id = preg_replace('/[^0-9]/','',$hold_time_option_callback_list_id); - $did_id = preg_replace('/[^0-9]/','',$did_id); $source_did = preg_replace('/[^0-9]/','',$source_did); $modify_inbound_dids = preg_replace('/[^0-9]/','',$modify_inbound_dids); $delete_inbound_dids = preg_replace('/[^0-9]/','',$delete_inbound_dids); @@ -2685,6 +2687,7 @@ if ($non_latin < 1) $inbound_survey_accept_digit = preg_replace('/[^0-9]/','',$inbound_survey_accept_digit); $allow_manage_active_lists = preg_replace('/[^0-9]/','',$allow_manage_active_lists); $expired_lists_inactive = preg_replace('/[^0-9]/','',$expired_lists_inactive); + $did_system_filter = preg_replace('/[^0-9]/','',$did_system_filter); $user_new_lead_limit = preg_replace('/[^-0-9]/','',$user_new_lead_limit); $drop_call_seconds = preg_replace('/[^-0-9]/','',$drop_call_seconds); @@ -3189,6 +3192,7 @@ if ($non_latin < 1) $ip_list_id = preg_replace('/[^-_0-9a-zA-Z]/','',$ip_list_id); $inbound_survey_callmenu = preg_replace('/[^-_0-9a-zA-Z]/','',$inbound_survey_callmenu); $filename_override = preg_replace('/[^-_0-9a-zA-Z]/','',$filename_override); + $did_id = preg_replace('/[^-_0-9a-zA-Z]/','',$did_id); ### ALPHA-NUMERIC and underscore and dash and slash and dot $menu_timeout_prompt = preg_replace('/[^-\/\|\._0-9a-zA-Z]/','',$menu_timeout_prompt); @@ -4176,12 +4180,13 @@ else # 170828-2105 - Added Inbound DID Summary Report # 170913-0908 - Added Agent Inbound Status Summary Report # 170920-2153 - Added expired_lists_inactive system setting and functions +# 170923-1425 - Added did_system_filter system setting and functions # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 9 to access this page the first time -$admin_version = '2.14-629a'; -$build = '170920-2153'; +$admin_version = '2.14-630a'; +$build = '170923-1425'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -7489,7 +7494,7 @@ if ($ADD==1411) echo ""._QXZ("Source DID").": $NWB#server_carriers-registration_string$NWE\n"; echo ""._QXZ("Template ID").": \n"; - $stmt="SELECT carrier_id,carrier_name,server_ip from vicidial_server_carriers $LOGadmin_viewable_groupsSQL order by carrier_id;"; + $stmt="SELECT carrier_id,carrier_name,server_ip from vicidial_server_carriers $whereLOGadmin_viewable_groupsSQL order by carrier_id;"; $rslt=mysql_to_mysqli($stmt, $link); $menus_to_print = mysqli_num_rows($rslt); $menus_list=''; @@ -16868,7 +16873,7 @@ if ($ADD==411111111111111) } } - $stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='$queuemetrics_url',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='$admin_home_url',enable_agc_xfer_log='$enable_agc_xfer_log',timeclock_end_of_day='$timeclock_end_of_day',vdc_header_date_format='$vdc_header_date_format',vdc_customer_date_format='$vdc_customer_date_format',vdc_header_phone_format='$vdc_header_phone_format',vdc_agent_api_active='$vdc_agent_api_active',enable_vtiger_integration='$enable_vtiger_integration',vtiger_server_ip='$vtiger_server_ip',vtiger_dbname='$vtiger_dbname',vtiger_login='$vtiger_login',vtiger_pass='$vtiger_pass',vtiger_url='$vtiger_url',qc_features_active='$qc_features_active',outbound_autodial_active='$outbound_autodial_active',outbound_calls_per_second='$outbound_calls_per_second',enable_tts_integration='$enable_tts_integration',agentonly_callback_campaign_lock='$agentonly_callback_campaign_lock',sounds_central_control_active='$sounds_central_control_active',sounds_web_server='$sounds_web_server',sounds_web_directory='$sounds_web_directory',active_voicemail_server='$active_voicemail_server',auto_dial_limit='$auto_dial_limit',user_territories_active='$user_territories_active',allow_custom_dialplan='$allow_custom_dialplan',enable_second_webform='$enable_second_webform',default_webphone='$default_webphone',default_external_server_ip='$default_external_server_ip',webphone_url='" . mysqli_real_escape_string($link, $webphone_url) . "',enable_agc_dispo_log='$enable_agc_dispo_log',queuemetrics_loginout='$queuemetrics_loginout',callcard_enabled='$callcard_enabled',queuemetrics_callstatus='$queuemetrics_callstatus',default_codecs='$default_codecs',admin_web_directory='$admin_web_directory',label_title='$label_title',label_first_name='$label_first_name',label_middle_initial='$label_middle_initial',label_last_name='$label_last_name',label_address1='$label_address1',label_address2='$label_address2',label_address3='$label_address3',label_city='$label_city',label_state='$label_state',label_province='$label_province',label_postal_code='$label_postal_code',label_vendor_lead_code='$label_vendor_lead_code',label_gender='$label_gender',label_phone_number='$label_phone_number',label_phone_code='$label_phone_code',label_alt_phone='$label_alt_phone',label_security_phrase='$label_security_phrase',label_email='$label_email',label_comments='$label_comments',custom_fields_enabled='$custom_fields_enabled',slave_db_server='$slave_db_server',reports_use_slave_db='$reports_use_slave_db'$custom_reports_slave_SQL,webphone_systemkey='$webphone_systemkey',first_login_trigger='$first_login_trigger',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password',admin_modify_refresh='$admin_modify_refresh',nocache_admin='$nocache_admin',generate_cross_server_exten='$generate_cross_server_exten',queuemetrics_addmember_enabled='$queuemetrics_addmember_enabled',queuemetrics_dispo_pause='$queuemetrics_dispo_pause',label_hide_field_logs='$label_hide_field_logs',queuemetrics_pe_phone_append='$queuemetrics_pe_phone_append',test_campaign_calls='$test_campaign_calls',agents_calls_reset='$agents_calls_reset',default_voicemail_timezone='$default_voicemail_timezone',default_local_gmt='$default_local_gmt',noanswer_log='$noanswer_log',alt_log_server_ip='$alt_log_server_ip',alt_log_dbname='$alt_log_dbname',alt_log_login='$alt_log_login',alt_log_pass='$alt_log_pass',tables_use_alt_log_db='$tables_use_alt_log_db',did_agent_log='$did_agent_log',campaign_cid_areacodes_enabled='$campaign_cid_areacodes_enabled',pllb_grouping_limit='$pllb_grouping_limit',did_ra_extensions_enabled='$did_ra_extensions_enabled',expanded_list_stats='$expanded_list_stats',contacts_enabled='$contacts_enabled',call_menu_qualify_enabled='$call_menu_qualify_enabled',admin_list_counts='$admin_list_counts',allow_voicemail_greeting='$allow_voicemail_greeting',queuemetrics_socket='$queuemetrics_socket',queuemetrics_socket_url='$queuemetrics_socket_url',enhanced_disconnect_logging='$enhanced_disconnect_logging',allow_emails='$allow_emails',level_8_disable_add='$level_8_disable_add',queuemetrics_record_hold='$queuemetrics_record_hold',country_code_list_stats='$country_code_list_stats',queuemetrics_pause_type='$queuemetrics_pause_type',frozen_server_call_clear='$frozen_server_call_clear',callback_time_24hour='$callback_time_24hour',enable_languages='$enable_languages',language_method='$language_method',meetme_enter_login_filename='$meetme_enter_login_filename',meetme_enter_leave3way_filename='$meetme_enter_leave3way_filename',enable_did_entry_list_id='$enable_did_entry_list_id',enable_third_webform='$enable_third_webform',allow_chats='$allow_chats',chat_url='$chat_url',chat_timeout='$chat_timeout',agent_debug_logging='$agent_debug_logging',default_language='$default_language',agent_whisper_enabled='$agent_whisper_enabled',user_hide_realtime_enabled='$user_hide_realtime_enabled',usacan_phone_dialcode_fix='$usacan_phone_dialcode_fix',cache_carrier_stats_realtime='$cache_carrier_stats_realtime',log_recording_access='$log_recording_access',report_default_format='$report_default_format',alt_ivr_logging='$alt_ivr_logging',default_phone_code='$default_phone_code',admin_row_click='$admin_row_click',admin_screen_colors='$admin_screen_colors',ofcom_uk_drop_calc='$ofcom_uk_drop_calc',agent_screen_colors='$agent_screen_colors',script_remove_js='$script_remove_js',manual_auto_next='$manual_auto_next',user_new_lead_limit='$user_new_lead_limit',agent_xfer_park_3way='$agent_xfer_park_3way',agent_soundboards='$agent_soundboards',web_loader_phone_length='$web_loader_phone_length',agent_script='$agent_script',agent_chat_screen_colors='$agent_chat_screen_colors',enable_auto_reports='$enable_auto_reports',enable_pause_code_limits='$enable_pause_code_limits',enable_drop_lists='$enable_drop_lists',allow_ip_lists='$allow_ip_lists',system_ip_blacklist='$system_ip_blacklist',agent_push_events='$agent_push_events',agent_push_url='$agent_push_url',hide_inactive_lists='$hide_inactive_lists',allow_manage_active_lists='$allow_manage_active_lists',expired_lists_inactive='$expired_lists_inactive'$custom_dialplanSQL;"; + $stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='$queuemetrics_url',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='$admin_home_url',enable_agc_xfer_log='$enable_agc_xfer_log',timeclock_end_of_day='$timeclock_end_of_day',vdc_header_date_format='$vdc_header_date_format',vdc_customer_date_format='$vdc_customer_date_format',vdc_header_phone_format='$vdc_header_phone_format',vdc_agent_api_active='$vdc_agent_api_active',enable_vtiger_integration='$enable_vtiger_integration',vtiger_server_ip='$vtiger_server_ip',vtiger_dbname='$vtiger_dbname',vtiger_login='$vtiger_login',vtiger_pass='$vtiger_pass',vtiger_url='$vtiger_url',qc_features_active='$qc_features_active',outbound_autodial_active='$outbound_autodial_active',outbound_calls_per_second='$outbound_calls_per_second',enable_tts_integration='$enable_tts_integration',agentonly_callback_campaign_lock='$agentonly_callback_campaign_lock',sounds_central_control_active='$sounds_central_control_active',sounds_web_server='$sounds_web_server',sounds_web_directory='$sounds_web_directory',active_voicemail_server='$active_voicemail_server',auto_dial_limit='$auto_dial_limit',user_territories_active='$user_territories_active',allow_custom_dialplan='$allow_custom_dialplan',enable_second_webform='$enable_second_webform',default_webphone='$default_webphone',default_external_server_ip='$default_external_server_ip',webphone_url='" . mysqli_real_escape_string($link, $webphone_url) . "',enable_agc_dispo_log='$enable_agc_dispo_log',queuemetrics_loginout='$queuemetrics_loginout',callcard_enabled='$callcard_enabled',queuemetrics_callstatus='$queuemetrics_callstatus',default_codecs='$default_codecs',admin_web_directory='$admin_web_directory',label_title='$label_title',label_first_name='$label_first_name',label_middle_initial='$label_middle_initial',label_last_name='$label_last_name',label_address1='$label_address1',label_address2='$label_address2',label_address3='$label_address3',label_city='$label_city',label_state='$label_state',label_province='$label_province',label_postal_code='$label_postal_code',label_vendor_lead_code='$label_vendor_lead_code',label_gender='$label_gender',label_phone_number='$label_phone_number',label_phone_code='$label_phone_code',label_alt_phone='$label_alt_phone',label_security_phrase='$label_security_phrase',label_email='$label_email',label_comments='$label_comments',custom_fields_enabled='$custom_fields_enabled',slave_db_server='$slave_db_server',reports_use_slave_db='$reports_use_slave_db'$custom_reports_slave_SQL,webphone_systemkey='$webphone_systemkey',first_login_trigger='$first_login_trigger',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password',admin_modify_refresh='$admin_modify_refresh',nocache_admin='$nocache_admin',generate_cross_server_exten='$generate_cross_server_exten',queuemetrics_addmember_enabled='$queuemetrics_addmember_enabled',queuemetrics_dispo_pause='$queuemetrics_dispo_pause',label_hide_field_logs='$label_hide_field_logs',queuemetrics_pe_phone_append='$queuemetrics_pe_phone_append',test_campaign_calls='$test_campaign_calls',agents_calls_reset='$agents_calls_reset',default_voicemail_timezone='$default_voicemail_timezone',default_local_gmt='$default_local_gmt',noanswer_log='$noanswer_log',alt_log_server_ip='$alt_log_server_ip',alt_log_dbname='$alt_log_dbname',alt_log_login='$alt_log_login',alt_log_pass='$alt_log_pass',tables_use_alt_log_db='$tables_use_alt_log_db',did_agent_log='$did_agent_log',campaign_cid_areacodes_enabled='$campaign_cid_areacodes_enabled',pllb_grouping_limit='$pllb_grouping_limit',did_ra_extensions_enabled='$did_ra_extensions_enabled',expanded_list_stats='$expanded_list_stats',contacts_enabled='$contacts_enabled',call_menu_qualify_enabled='$call_menu_qualify_enabled',admin_list_counts='$admin_list_counts',allow_voicemail_greeting='$allow_voicemail_greeting',queuemetrics_socket='$queuemetrics_socket',queuemetrics_socket_url='$queuemetrics_socket_url',enhanced_disconnect_logging='$enhanced_disconnect_logging',allow_emails='$allow_emails',level_8_disable_add='$level_8_disable_add',queuemetrics_record_hold='$queuemetrics_record_hold',country_code_list_stats='$country_code_list_stats',queuemetrics_pause_type='$queuemetrics_pause_type',frozen_server_call_clear='$frozen_server_call_clear',callback_time_24hour='$callback_time_24hour',enable_languages='$enable_languages',language_method='$language_method',meetme_enter_login_filename='$meetme_enter_login_filename',meetme_enter_leave3way_filename='$meetme_enter_leave3way_filename',enable_did_entry_list_id='$enable_did_entry_list_id',enable_third_webform='$enable_third_webform',allow_chats='$allow_chats',chat_url='$chat_url',chat_timeout='$chat_timeout',agent_debug_logging='$agent_debug_logging',default_language='$default_language',agent_whisper_enabled='$agent_whisper_enabled',user_hide_realtime_enabled='$user_hide_realtime_enabled',usacan_phone_dialcode_fix='$usacan_phone_dialcode_fix',cache_carrier_stats_realtime='$cache_carrier_stats_realtime',log_recording_access='$log_recording_access',report_default_format='$report_default_format',alt_ivr_logging='$alt_ivr_logging',default_phone_code='$default_phone_code',admin_row_click='$admin_row_click',admin_screen_colors='$admin_screen_colors',ofcom_uk_drop_calc='$ofcom_uk_drop_calc',agent_screen_colors='$agent_screen_colors',script_remove_js='$script_remove_js',manual_auto_next='$manual_auto_next',user_new_lead_limit='$user_new_lead_limit',agent_xfer_park_3way='$agent_xfer_park_3way',agent_soundboards='$agent_soundboards',web_loader_phone_length='$web_loader_phone_length',agent_script='$agent_script',agent_chat_screen_colors='$agent_chat_screen_colors',enable_auto_reports='$enable_auto_reports',enable_pause_code_limits='$enable_pause_code_limits',enable_drop_lists='$enable_drop_lists',allow_ip_lists='$allow_ip_lists',system_ip_blacklist='$system_ip_blacklist',agent_push_events='$agent_push_events',agent_push_url='$agent_push_url',hide_inactive_lists='$hide_inactive_lists',allow_manage_active_lists='$allow_manage_active_lists',expired_lists_inactive='$expired_lists_inactive',did_system_filter='$did_system_filter'$custom_dialplanSQL;"; $rslt=mysql_to_mysqli($stmt, $link); if ( ($meetme_enter_login_filename != $SSmeetme_enter_login_filename) or ($meetme_enter_leave3way_filename != $SSmeetme_enter_leave3way_filename) ) @@ -29386,6 +29391,30 @@ if ($ADD==3311) { if ($LOGmodify_dids==1) { + ### check for system DID filter, create if does not exist + if ($did_id == 'did_system_filter') + { + $did_pattern = 'did_system_filter'; + $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='did_system_filter';"; + $rslt=mysql_to_mysqli($stmt, $link); + $rows_to_print = mysqli_num_rows($rslt); + if ($rows_to_print > 0) + { + $row=mysqli_fetch_row($rslt); + $did_id = $row[0]; + } + else + { + $stmtA="INSERT INTO vicidial_inbound_dids (did_pattern,did_description,user_group) values('did_system_filter','DID System Filter','---ALL---');"; + $rslt=mysql_to_mysqli($stmtA, $link); + + $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='did_system_filter';"; + $rslt=mysql_to_mysqli($stmt, $link); + $row=mysqli_fetch_row($rslt); + $did_id = $row[0]; + } + } + if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) ) { $modify_url = "$PHP_SELF?ADD=3311&did_id=$did_id"; @@ -29575,31 +29604,17 @@ if ($ADD==3311) else {$MQIgroups_menu .= "\n";} - - echo "
"._QXZ("MODIFY A DID RECORD").": $row[0]
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - # echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + $stmt="SELECT filter_phone_group_id,filter_phone_group_name from vicidial_filter_phone_groups $whereLOGadmin_viewable_groupsSQL order by filter_phone_group_id;"; + $rslt=mysql_to_mysqli($stmt, $link); + $Fgroups_to_print = mysqli_num_rows($rslt); + $Fgroups_list=''; + $i=0; + while ($i < $Fgroups_to_print) + { + $row=mysqli_fetch_row($rslt); + $Fgroups_list .= ""; + $i++; + } $stmt="SELECT menu_id,menu_name,menu_prompt from vicidial_call_menu $whereLOGadmin_viewable_groupsSQL order by menu_id;"; $rslt=mysql_to_mysqli($stmt, $link); @@ -29613,68 +29628,121 @@ if ($ADD==3311) $i++; } - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - if ($SSenable_did_entry_list_id > 0) + echo "
"._QXZ("MODIFY A DID RECORD").": $row[0]\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
DID Extension: $NWB#inbound_dids-did_pattern$NWE
"._QXZ("DID Extension").": $did_pattern $NWB#inbound_dids-did_pattern$NWE
"._QXZ("DID Description").": $NWB#inbound_dids-did_description$NWE
"._QXZ("DID Carrier Description").": $NWB#inbound_dids-did_carrier_description$NWE
"._QXZ("Active").": $NWB#inbound_dids-did_active$NWE
"._QXZ("Admin User Group").": $NWB#inbound_dids-user_group$NWE
"._QXZ("DID Route").": $NWB#inbound_dids-did_route$NWE
"._QXZ("Record Call").": $NWB#inbound_dids-record_call$NWE
"._QXZ("Extension").": $NWB#inbound_dids-extension$NWE
"._QXZ("Extension Context").": $NWB#inbound_dids-exten_context$NWE
"._QXZ("Voicemail Box").": "._QXZ("voicemail chooser")."$NWB#inbound_dids-voicemail_ext$NWE
"._QXZ("Phone Extension").": $NWB#inbound_dids-phone$NWE
"._QXZ("Server IP").": $NWB#inbound_dids-server_ip$NWE
"._QXZ("Call Menu").": $NWB#inbound_dids-menu_id$NWE
"._QXZ("User Agent").": $NWB#inbound_dids-user$NWE
"._QXZ("User Unavailable Action").": $NWB#inbound_dids-user_unavailable_action$NWE
"._QXZ("User Route Settings In-Group").": $NWB#inbound_dids-user_route_settings_ingroup$NWE
"._QXZ("In-Group ID").": $NWB#inbound_dids-group_id$NWE
"._QXZ("In-Group Call Handle Method").": $NWB#inbound_dids-call_handle_method$NWE
"._QXZ("In-Group Agent Search Method").": $NWB#inbound_dids-agent_search_method$NWE
"._QXZ("In-Group List ID").": $NWB#inbound_dids-list_id$NWE
\n"; + # echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + if ($did_pattern == 'did_system_filter') { - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; } - - echo "\n"; - echo "\n"; - - - echo "\n"; - - - $stmt="SELECT filter_phone_group_id,filter_phone_group_name from vicidial_filter_phone_groups $whereLOGadmin_viewable_groupsSQL order by filter_phone_group_id;"; - $rslt=mysql_to_mysqli($stmt, $link); - $Fgroups_to_print = mysqli_num_rows($rslt); - $Fgroups_list=''; - $i=0; - while ($i < $Fgroups_to_print) + else { - $row=mysqli_fetch_row($rslt); - $Fgroups_list .= ""; - $i++; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + if ($SSenable_did_entry_list_id > 0) + { + echo "\n"; + } + + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; } - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - echo "\n"; echo "\n"; @@ -34815,7 +34883,7 @@ if ($ADD==311111111111111) $ALLagent_count = $rowx[2]; } - $stmt="SELECT version,install_date,use_non_latin,webroot_writable,enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_url,queuemetrics_log_id,queuemetrics_eq_prepend,vicidial_agent_disable,allow_sipsak_messages,admin_home_url,enable_agc_xfer_log,db_schema_version,auto_user_add_value,timeclock_end_of_day,timeclock_last_reset_date,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,vdc_agent_api_active,qc_last_pull_time,enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url,qc_features_active,outbound_autodial_active,outbound_calls_per_second,enable_tts_integration,agentonly_callback_campaign_lock,sounds_central_control_active,sounds_web_server,sounds_web_directory,active_voicemail_server,auto_dial_limit,user_territories_active,allow_custom_dialplan,db_schema_update_date,enable_second_webform,default_webphone,default_external_server_ip,webphone_url,enable_agc_dispo_log,custom_dialplan_entry,queuemetrics_loginout,callcard_enabled,queuemetrics_callstatus,default_codecs,admin_web_directory,label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments,custom_fields_enabled,slave_db_server,reports_use_slave_db,webphone_systemkey,first_login_trigger,default_phone_registration_password,default_phone_login_password,default_server_password,admin_modify_refresh,nocache_admin,generate_cross_server_exten,queuemetrics_addmember_enabled,queuemetrics_dispo_pause,label_hide_field_logs,queuemetrics_pe_phone_append,test_campaign_calls,agents_calls_reset,default_voicemail_timezone,default_local_gmt,noanswer_log,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db,did_agent_log,campaign_cid_areacodes_enabled,pllb_grouping_limit,did_ra_extensions_enabled,expanded_list_stats,contacts_enabled,call_menu_qualify_enabled,admin_list_counts,allow_voicemail_greeting,svn_revision,queuemetrics_socket,queuemetrics_socket_url,enhanced_disconnect_logging,allow_emails,level_8_disable_add,pass_hash_enabled,pass_key,pass_cost,disable_auto_dial,queuemetrics_record_hold,country_code_list_stats,reload_timestamp,queuemetrics_pause_type,frozen_server_call_clear,callback_time_24hour,allow_chats,chat_url,chat_timeout,enable_languages,language_method,meetme_enter_login_filename,meetme_enter_leave3way_filename,enable_did_entry_list_id,enable_third_webform,agent_debug_logging,default_language,agent_whisper_enabled,user_hide_realtime_enabled,usacan_phone_dialcode_fix,cache_carrier_stats_realtime,oldest_logs_date,log_recording_access,report_default_format,alt_ivr_logging,default_phone_code,admin_row_click,admin_screen_colors,ofcom_uk_drop_calc,agent_screen_colors,script_remove_js,manual_auto_next,user_new_lead_limit,agent_xfer_park_3way,rec_prompt_count,agent_soundboards,web_loader_phone_length,agent_script,agent_chat_screen_colors,enable_auto_reports,enable_pause_code_limits,enable_drop_lists,allow_ip_lists,system_ip_blacklist,agent_push_events,agent_push_url,hide_inactive_lists,allow_manage_active_lists,expired_lists_inactive from system_settings;"; + $stmt="SELECT version,install_date,use_non_latin,webroot_writable,enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_url,queuemetrics_log_id,queuemetrics_eq_prepend,vicidial_agent_disable,allow_sipsak_messages,admin_home_url,enable_agc_xfer_log,db_schema_version,auto_user_add_value,timeclock_end_of_day,timeclock_last_reset_date,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,vdc_agent_api_active,qc_last_pull_time,enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url,qc_features_active,outbound_autodial_active,outbound_calls_per_second,enable_tts_integration,agentonly_callback_campaign_lock,sounds_central_control_active,sounds_web_server,sounds_web_directory,active_voicemail_server,auto_dial_limit,user_territories_active,allow_custom_dialplan,db_schema_update_date,enable_second_webform,default_webphone,default_external_server_ip,webphone_url,enable_agc_dispo_log,custom_dialplan_entry,queuemetrics_loginout,callcard_enabled,queuemetrics_callstatus,default_codecs,admin_web_directory,label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments,custom_fields_enabled,slave_db_server,reports_use_slave_db,webphone_systemkey,first_login_trigger,default_phone_registration_password,default_phone_login_password,default_server_password,admin_modify_refresh,nocache_admin,generate_cross_server_exten,queuemetrics_addmember_enabled,queuemetrics_dispo_pause,label_hide_field_logs,queuemetrics_pe_phone_append,test_campaign_calls,agents_calls_reset,default_voicemail_timezone,default_local_gmt,noanswer_log,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db,did_agent_log,campaign_cid_areacodes_enabled,pllb_grouping_limit,did_ra_extensions_enabled,expanded_list_stats,contacts_enabled,call_menu_qualify_enabled,admin_list_counts,allow_voicemail_greeting,svn_revision,queuemetrics_socket,queuemetrics_socket_url,enhanced_disconnect_logging,allow_emails,level_8_disable_add,pass_hash_enabled,pass_key,pass_cost,disable_auto_dial,queuemetrics_record_hold,country_code_list_stats,reload_timestamp,queuemetrics_pause_type,frozen_server_call_clear,callback_time_24hour,allow_chats,chat_url,chat_timeout,enable_languages,language_method,meetme_enter_login_filename,meetme_enter_leave3way_filename,enable_did_entry_list_id,enable_third_webform,agent_debug_logging,default_language,agent_whisper_enabled,user_hide_realtime_enabled,usacan_phone_dialcode_fix,cache_carrier_stats_realtime,oldest_logs_date,log_recording_access,report_default_format,alt_ivr_logging,default_phone_code,admin_row_click,admin_screen_colors,ofcom_uk_drop_calc,agent_screen_colors,script_remove_js,manual_auto_next,user_new_lead_limit,agent_xfer_park_3way,rec_prompt_count,agent_soundboards,web_loader_phone_length,agent_script,agent_chat_screen_colors,enable_auto_reports,enable_pause_code_limits,enable_drop_lists,allow_ip_lists,system_ip_blacklist,agent_push_events,agent_push_url,hide_inactive_lists,allow_manage_active_lists,expired_lists_inactive,did_system_filter from system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $version = $row[0]; @@ -34985,6 +35053,7 @@ if ($ADD==311111111111111) $hide_inactive_lists = $row[164]; $allow_manage_active_lists = $row[165]; $expired_lists_inactive = $row[166]; + $did_system_filter = $row[167]; if ($pass_hash_enabled > 0) {$pass_hash_enabled = 'ENABLED';} else {$pass_hash_enabled = 'DISABLED';} @@ -35231,6 +35300,8 @@ if ($ADD==311111111111111) echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; @@ -36815,7 +36886,7 @@ if ($ADD==1300) if (preg_match("/RECUP/i",$stage)) {$SQLorder='order by record_call asc'; $REClink='stage=RECDOWN';} if (preg_match("/RECDOWN/i",$stage)) {$SQLorder='order by record_call desc'; $REClink='stage=RECUP';} - $stmt="SELECT did_id,did_pattern,did_description,did_carrier_description,did_active,did_route,record_call,user_group from vicidial_inbound_dids $whereLOGadmin_viewable_groupsSQL $SQLorder;"; + $stmt="SELECT did_id,did_pattern,did_description,did_carrier_description,did_active,did_route,record_call,user_group from vicidial_inbound_dids where did_pattern!='did_system_filter' $LOGadmin_viewable_groupsSQL $SQLorder;"; $rslt=mysql_to_mysqli($stmt, $link); $dids_to_print = mysqli_num_rows($rslt); diff --git a/agc_2-X/trunk/www/vicidial/help.php b/agc_2-X/trunk/www/vicidial/help.php index 0d178e6c..435afdfa 100644 --- a/agc_2-X/trunk/www/vicidial/help.php +++ b/agc_2-X/trunk/www/vicidial/help.php @@ -134,6 +134,7 @@ # 170819-0951 - Added allow_manage_active_lists entry # 170825-1129 - Added auto_reports-filename_override entry # 170920-2156 - Added expired_lists_inactive entry +# 170923-1458 - Added settings-did_system_filter entry # @@ -5346,6 +5347,11 @@ FR_SPAC 00 00 00 00 00 - - +
+ +
+ - +

DID Extension: $NWB#inbound_dids-did_pattern$NWE
"._QXZ("DID Extension").": $did_pattern $NWB#inbound_dids-did_pattern$NWE
"._QXZ("DID Description").": $NWB#inbound_dids-did_description$NWE
"._QXZ("DID Carrier Description").": $NWB#inbound_dids-did_carrier_description$NWE
"._QXZ("In-Group Entry List ID").": $NWB#inbound_dids-entry_list_id$NWE
"._QXZ("Admin User Group").": $NWB#inbound_dids-user_group$NWE
"._QXZ("Active").": Y
"._QXZ("Clean CID Number").": $NWB#inbound_dids-filter_clean_cid_number$NWE
"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
"._QXZ("In-Group Campaign ID").": $NWB#inbound_dids-campaign_id$NWE
"._QXZ("In-Group Phone Code").": $NWB#inbound_dids-phone_code$NWE
"._QXZ("Clean CID Number").": $NWB#inbound_dids-filter_clean_cid_number$NWE
"._QXZ("Active").": $NWB#inbound_dids-did_active$NWE
"._QXZ("Admin User Group").": $NWB#inbound_dids-user_group$NWE
"._QXZ("DID Route").": $NWB#inbound_dids-did_route$NWE
"._QXZ("Record Call").": $NWB#inbound_dids-record_call$NWE
"._QXZ("Extension").": $NWB#inbound_dids-extension$NWE
"._QXZ("Extension Context").": $NWB#inbound_dids-exten_context$NWE
"._QXZ("Voicemail Box").": "._QXZ("voicemail chooser")."$NWB#inbound_dids-voicemail_ext$NWE
"._QXZ("Phone Extension").": $NWB#inbound_dids-phone$NWE
"._QXZ("Server IP").": $NWB#inbound_dids-server_ip$NWE
"._QXZ("Call Menu").": $NWB#inbound_dids-menu_id$NWE
"._QXZ("User Agent").": $NWB#inbound_dids-user$NWE
"._QXZ("User Unavailable Action").": $NWB#inbound_dids-user_unavailable_action$NWE
"._QXZ("User Route Settings In-Group").": $NWB#inbound_dids-user_route_settings_ingroup$NWE
"._QXZ("In-Group ID").": $NWB#inbound_dids-group_id$NWE
"._QXZ("In-Group Call Handle Method").": $NWB#inbound_dids-call_handle_method$NWE
"._QXZ("In-Group Agent Search Method").": $NWB#inbound_dids-agent_search_method$NWE
"._QXZ("In-Group List ID").": $NWB#inbound_dids-list_id$NWE
"._QXZ("In-Group Entry List ID").": $NWB#inbound_dids-entry_list_id$NWE
"._QXZ("In-Group Campaign ID").": $NWB#inbound_dids-campaign_id$NWE
"._QXZ("In-Group Phone Code").": $NWB#inbound_dids-phone_code$NWE
"._QXZ("Clean CID Number").": $NWB#inbound_dids-filter_clean_cid_number$NWE
"._QXZ("No-Agent In-Group Redirect").": $NWB#inbound_dids-no_agent_ingroup_redirect$NWE
"._QXZ("No-Agent In-Group ID").": $NWB#inbound_dids-no_agent_ingroup_id$NWE
"._QXZ("No-Agent In-Group Extension").": $NWB#inbound_dids-no_agent_ingroup_extension$NWE
"._QXZ("Max Queue In-Group Calls").": $NWB#inbound_dids-max_queue_ingroup_calls$NWE
"._QXZ("Max Queue In-Group ID").": $NWB#inbound_dids-max_queue_ingroup_id$NWE
"._QXZ("Max Queue In-Group Extension").": $NWB#inbound_dids-max_queue_ingroup_extension$NWE
"._QXZ("Pre-Filter Phone Group ID").": $NWB#inbound_dids-pre_filter_phone_group_id$NWE
"._QXZ("Pre-Filter Phone Group DID").": $NWB#inbound_dids-pre_filter_extension$NWE
"._QXZ("No-Agent In-Group Redirect").": $NWB#inbound_dids-no_agent_ingroup_redirect$NWE
"._QXZ("No-Agent In-Group ID").": $NWB#inbound_dids-no_agent_ingroup_id$NWE
"._QXZ("No-Agent In-Group Extension").": $NWB#inbound_dids-no_agent_ingroup_extension$NWE
"._QXZ("Max Queue In-Group Calls").": $NWB#inbound_dids-max_queue_ingroup_calls$NWE
"._QXZ("Max Queue In-Group ID").": $NWB#inbound_dids-max_queue_ingroup_id$NWE
"._QXZ("Max Queue In-Group Extension").": $NWB#inbound_dids-max_queue_ingroup_extension$NWE
"._QXZ("Pre-Filter Phone Group ID").": $NWB#inbound_dids-pre_filter_phone_group_id$NWE
"._QXZ("Pre-Filter Phone Group DID").": $NWB#inbound_dids-pre_filter_extension$NWE
"._QXZ("Filter Inbound Number").": $NWB#inbound_dids-filter_inbound_number$NWE
"._QXZ("Filter Phone Group ID").": $NWB#inbound_dids-filter_phone_group_id$NWE
"._QXZ("Enable Campaign Test Calls").": $NWB#settings-test_campaign_calls$NWE
"._QXZ("DID System Filter").": $NWB#settings-did_system_filter$NWE
"._QXZ("New Leads Per List Limit").": $NWB#settings-user_new_lead_limit$NWE
"._QXZ("Enable Custom List Fields").": $NWB#settings-custom_fields_enabled$NWE