diff --git a/UPGRADE b/UPGRADE index 18d7ed9b..b3d58ec7 100644 --- a/UPGRADE +++ b/UPGRADE @@ -226,6 +226,8 @@ OTHER CHANGES: This only works for inbound and auto-dial outbound calls for in-groups and campaigns that are set to ALLCALLS or ALLFORCE recording. +57. Added option to Inbound DID Group Filtering to filter by areacode. + diff --git a/agi/agi-DID_route.agi b/agi/agi-DID_route.agi index 7627180a..2e0d310f 100644 --- a/agi/agi-DID_route.agi +++ b/agi/agi-DID_route.agi @@ -13,7 +13,7 @@ # ;inbound DID catch-all: #exten => _X.,1,AGI(agi-DID_route.agi) # -# Copyright (C) 2015 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2016 Matt Florell LICENSE: AGPLv2 # # changes: # 81007-0324 - First Build @@ -40,6 +40,7 @@ # 150112-1426 - Added no-agent last_update_time check to match in-group queries # 150708-2252 - Added max_queue_ingroup_ DID options # 150806-1316 - Added Filter URL logging to url log, and added variables for uniqueid, channel and server_ip +# 160106-0719 - Added filter option for GROUP_AREACODE # @@ -520,7 +521,23 @@ if ( ($filter_inbound_number =~ /GROUP|URL|DNC_INTERNAL|DNC_CAMPAIGN/) && ($pre_ $filter_match_found = $aryA[0]; } $sthA->finish(); - if ($AGILOG) {$agi_string = "GROUP: |$filter_match_found|$stmtA|"; &agi_output;} + + 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 = "GROUP: |$filter_match_found|$stmtA|$stmtB|"; &agi_output;} } elsif ($filter_inbound_number =~ /DNC_INTERNAL/) { diff --git a/extras/MySQL_AST_CREATE_tables.sql b/extras/MySQL_AST_CREATE_tables.sql index 90f69f13..1585edd2 100644 --- a/extras/MySQL_AST_CREATE_tables.sql +++ b/extras/MySQL_AST_CREATE_tables.sql @@ -1911,7 +1911,7 @@ 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','DNC_INTERNAL','DNC_CAMPAIGN') default 'DISABLED', +filter_inbound_number ENUM('DISABLED','GROUP','URL','DNC_INTERNAL','DNC_CAMPAIGN','GROUP_AREACODE') default 'DISABLED', filter_phone_group_id VARCHAR(20) default '', filter_url VARCHAR(1000) default '', filter_action ENUM('EXTEN','VOICEMAIL','AGENT','PHONE','IN_GROUP','CALLMENU','VMAIL_NO_INST') default 'EXTEN', @@ -3689,4 +3689,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='1447',db_schema_update_date=NOW(),reload_timestamp=NOW(); +UPDATE system_settings SET db_schema_version='1448',db_schema_update_date=NOW(),reload_timestamp=NOW(); diff --git a/extras/upgrade_2.12.sql b/extras/upgrade_2.12.sql index 3721b9f9..a5b6768d 100644 --- a/extras/upgrade_2.12.sql +++ b/extras/upgrade_2.12.sql @@ -469,3 +469,7 @@ UPDATE system_settings SET db_schema_version='1446',db_schema_update_date=NOW() CREATE INDEX live_chat_id on vicidial_chat_log (chat_id); UPDATE system_settings SET db_schema_version='1447',db_schema_update_date=NOW() where db_schema_version < 1447; + +ALTER TABLE vicidial_inbound_dids MODIFY filter_inbound_number ENUM('DISABLED','GROUP','URL','DNC_INTERNAL','DNC_CAMPAIGN','GROUP_AREACODE') default 'DISABLED'; + +UPDATE system_settings SET db_schema_version='1448',db_schema_update_date=NOW() where db_schema_version < 1448; diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index f6cd6f34..88080315 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -3684,12 +3684,13 @@ else # 151231-0009 - Fixed admin logging in several places # 151231-0834 - Added agent_allowed_chat_groups to User Groups # 160101-0928 - Added routing_initiated_recordings to in-group and campaign settings, and updated for 2016 +# 160106-0751 - Added GROUP_AREACODE option to inbound did filters # # 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.12-531a'; -$build = '160101-0928'; +$admin_version = '2.12-532a'; +$build = '160106-0751'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -27353,7 +27354,7 @@ if ($ADD==3311) echo ""._QXZ("Pre-Filter Phone Group DID").": $NWB#inbound_dids-pre_filter_extension$NWE\n"; - echo ""._QXZ("Filter Inbound Number").": $NWB#inbound_dids-filter_inbound_number$NWE\n"; + echo ""._QXZ("Filter Inbound Number").": $NWB#inbound_dids-filter_inbound_number$NWE\n"; echo ""._QXZ("Filter Phone Group ID").": $NWB#inbound_dids-filter_phone_group_id$NWE\n"; diff --git a/www/vicidial/help.php b/www/vicidial/help.php index 8048ee1d..667b51e7 100644 --- a/www/vicidial/help.php +++ b/www/vicidial/help.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2016 Matt Florell LICENSE: AGPLv2 # # CHANGELOG: @@ -75,6 +75,7 @@ # 151229-2302 - Added campaigns-manual_dial_timeout entry # 151231-0839 - Added user_groups-agent_allowed_chat_groups entry # 160101-0933 - Added entries for routing_initiated_recordings in campaigns and in-groups +# 160106-0700 - Added AREACODE description to the inbound_dids-filter_inbound_number entry # @@ -2928,7 +2929,7 @@ if ($SSqc_features_active > 0)

- - + -