diff --git a/agi/agi-VDAD_ALL_inbound.agi b/agi/agi-VDAD_ALL_inbound.agi index d9d03cf4..c632c908 100644 --- a/agi/agi-VDAD_ALL_inbound.agi +++ b/agi/agi-VDAD_ALL_inbound.agi @@ -246,6 +246,7 @@ # 210609-0941 - Added drop_call_seconds_override option # 210804-0711 - Fix for closing time action issue #1321 # 210819-0029 - Added vicidial_inbound_caller_codes logging +# 210908-0851 - Added OWNERCUSTOMx options for call_handle_method # $script = 'agi-VDAD_ALL_inbound.agi'; @@ -526,11 +527,11 @@ if ($extension =~ /^999\d\d\*|^998\d\d\*/) ### Grab DID values from the database 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,filter_entry_list_id FROM vicidial_inbound_dids where did_id = '$did_id';"; + $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,filter_entry_list_id,custom_one,custom_two,custom_three,custom_four,custom_five 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,entry_list_id FROM vicidial_inbound_dids where did_id = '$did_id';"; + $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,entry_list_id,custom_one,custom_two,custom_three,custom_four,custom_five 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; @@ -556,6 +557,11 @@ if ($extension =~ /^999\d\d\*|^998\d\d\*/) $did_phone = $aryA[14]; $did_phone_server_ip = $aryA[15]; $entry_list_id = $aryA[16]; + $custom_one = $aryA[17]; + $custom_two = $aryA[18]; + $custom_three = $aryA[19]; + $custom_four = $aryA[20]; + $custom_five = $aryA[21]; if ($did_route =~ /AGENT/) {$channel_group = $user_route_settings_ingroup;} else @@ -1364,14 +1370,28 @@ if ($call_handle_method =~ /LOOKUP/) } } + # populate owner field match requirements, if any + $ownerSQL=''; + if ($call_handle_method =~ /OWNERCUSTOM/) + { + $temp_owner = ''; + if ($call_handle_method =~ /OWNERCUSTOM1/) {$temp_owner = $custom_one;} + if ($call_handle_method =~ /OWNERCUSTOM2/) {$temp_owner = $custom_two;} + if ($call_handle_method =~ /OWNERCUSTOM3/) {$temp_owner = $custom_three;} + if ($call_handle_method =~ /OWNERCUSTOM4/) {$temp_owner = $custom_four;} + if ($call_handle_method =~ /OWNERCUSTOM5/) {$temp_owner = $custom_five;} + if ($call_handle_method =~ /OWNERCUSTOMX/) {$temp_owner = $vid_enter_filename;} + $ownerSQL = "and owner='$temp_owner'"; + } + $cbc=0; if ($call_handle_method =~ /^VID/) { - $stmtA= "SELECT lead_id,called_count,list_id from vicidial_list where vendor_lead_code='$vendor_id' $listSQL order by last_local_call_time desc limit 1;"; + $stmtA= "SELECT lead_id,called_count,list_id from vicidial_list where vendor_lead_code='$vendor_id' $listSQL $ownerSQL order by last_local_call_time desc limit 1;"; } else { - $stmtA= "SELECT lead_id,called_count,list_id from vicidial_list where phone_number='$phone_number' $listSQL order by last_local_call_time desc limit 1;"; + $stmtA= "SELECT lead_id,called_count,list_id from vicidial_list where phone_number='$phone_number' $listSQL $ownerSQL order by last_local_call_time desc limit 1;"; } if ($AGILOG) {$agi_string = "VDAD vicidial_list search |$phone_number|$stmtA|"; &agi_output;} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; @@ -1397,7 +1417,7 @@ if ($call_handle_method =~ /LOOKUP/) $VLfound=0; if ($call_handle_method =~ /ALT/) { - $stmtA= "SELECT lead_id,called_count,list_id from vicidial_list where alt_phone='$phone_number' $listSQL order by last_local_call_time desc limit 1;"; + $stmtA= "SELECT lead_id,called_count,list_id from vicidial_list where alt_phone='$phone_number' $listSQL $ownerSQL order by last_local_call_time desc limit 1;"; if ($AGILOG) {$agi_string = "VDAD vicidial_list ALT search |$phone_number|$stmtA|"; &agi_output;} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -1416,7 +1436,7 @@ if ($call_handle_method =~ /LOOKUP/) } if ( ($call_handle_method =~ /ADDR3/) && ($VLfound < 1) ) { - $stmtA= "SELECT lead_id,called_count,list_id from vicidial_list where address3='$phone_number' $listSQL order by last_local_call_time desc limit 1;"; + $stmtA= "SELECT lead_id,called_count,list_id from vicidial_list where address3='$phone_number' $listSQL $ownerSQL order by last_local_call_time desc limit 1;"; if ($AGILOG) {$agi_string = "VDAD vicidial_list ADDR3 search |$phone_number|$stmtA|"; &agi_output;} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; diff --git a/extras/MySQL_AST_CREATE_tables.sql b/extras/MySQL_AST_CREATE_tables.sql index aeaffe8d..c9431aa8 100644 --- a/extras/MySQL_AST_CREATE_tables.sql +++ b/extras/MySQL_AST_CREATE_tables.sql @@ -2215,7 +2215,7 @@ user VARCHAR(20), user_unavailable_action ENUM('IN_GROUP','EXTEN','VOICEMAIL','PHONE','VMAIL_NO_INST') default 'VOICEMAIL', user_route_settings_ingroup VARCHAR(20) default 'AGENTDIRECT', group_id VARCHAR(20), -call_handle_method VARCHAR(20) default 'CID', +call_handle_method VARCHAR(40) default 'CID', agent_search_method ENUM('LO','LB','SO') default 'LB', list_id BIGINT(14) UNSIGNED default '999', campaign_id VARCHAR(8), @@ -2235,7 +2235,7 @@ filter_user VARCHAR(20), filter_user_unavailable_action ENUM('IN_GROUP','EXTEN','VOICEMAIL','PHONE','VMAIL_NO_INST') 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_call_handle_method VARCHAR(40) 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), @@ -5023,4 +5023,4 @@ INSERT INTO vicidial_settings_containers(container_id,container_notes,container_ UPDATE system_settings set vdc_agent_api_active='1'; -UPDATE system_settings SET db_schema_version='1643',db_schema_update_date=NOW(),reload_timestamp=NOW(); +UPDATE system_settings SET db_schema_version='1644',db_schema_update_date=NOW(),reload_timestamp=NOW(); diff --git a/extras/upgrade_2.14.sql b/extras/upgrade_2.14.sql index 3333febb..13d79e65 100644 --- a/extras/upgrade_2.14.sql +++ b/extras/upgrade_2.14.sql @@ -1813,3 +1813,8 @@ UPDATE system_settings SET db_schema_version='1642',db_schema_update_date=NOW() CREATE INDEX vavl_agent_log_id on vicidial_agent_visibility_log (agent_log_id); UPDATE system_settings SET db_schema_version='1643',db_schema_update_date=NOW() where db_schema_version < 1643; + +ALTER TABLE vicidial_inbound_dids MODIFY call_handle_method VARCHAR(40) default 'CID'; +ALTER TABLE vicidial_inbound_dids MODIFY filter_call_handle_method VARCHAR(40) default 'CID'; + +UPDATE system_settings SET db_schema_version='1644',db_schema_update_date=NOW() where db_schema_version < 1644; diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index 21ff59f2..2309e4e1 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -5708,12 +5708,13 @@ if ($SSscript_remove_js > 0) # 210812-1609 - Added 'Phone Stats' to report permissions list # 210827-0753 - Added allowed_sip_stacks system setting and PJSIP Phone and Carrier options # 210901-2051 - Fix for User Modify page issue +# 210907-1901 - Added new OWNERCUSTOMx handle methods for menu options # # 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-827a'; -$build = '210901-2051'; +$admin_version = '2.14-828a'; +$build = '210907-1901'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -32214,7 +32215,7 @@ if ($ADD==3111) echo " "; echo "   "._QXZ("Handle Method").": \n"; + echo "$IGhandle_method_list\n"; echo "
"._QXZ("Search Method").": \n"; echo "   "._QXZ("List ID").": "; @@ -32295,7 +32296,7 @@ if ($ADD==3111) echo " "; echo "   "._QXZ("Handle Method").": \n"; + echo "$IGhandle_method_list\n"; echo "
"._QXZ("Search Method").": \n"; echo "   "._QXZ("List ID").": "; @@ -35104,7 +35105,94 @@ if ($ADD==3311) echo ""._QXZ("In-Group ID").": $NWB#inbound_dids-group_id$NWE\n"; - echo ""._QXZ("In-Group Call Handle Method").": $NWB#inbound_dids-call_handle_method$NWE\n"; + echo ""._QXZ("In-Group Call Handle Method").": $NWB#inbound_dids-call_handle_method$NWE\n"; echo ""._QXZ("In-Group Agent Search Method").": $NWB#inbound_dids-agent_search_method$NWE\n"; echo ""._QXZ("In-Group List ID").": $NWB#inbound_dids-list_id$NWE\n"; @@ -35175,7 +35263,93 @@ if ($ADD==3311) echo ""._QXZ("Filter In-Group ID").": $NWB#inbound_dids-group_id$NWE\n"; - echo ""._QXZ("Filter In-Group Call Handle Method").": $NWB#inbound_dids-call_handle_method$NWE\n"; + echo ""._QXZ("Filter In-Group Call Handle Method").": $NWB#inbound_dids-call_handle_method$NWE\n"; echo ""._QXZ("Filter In-Group Agent Search Method").": $NWB#inbound_dids-agent_search_method$NWE\n"; echo ""._QXZ("Filter In-Group List ID").": $NWB#inbound_dids-list_id$NWE\n"; @@ -35678,7 +35852,7 @@ if ($ADD==3511) echo "
"._QXZ("MODIFY A CALL MENU RECORD").": $menu_id
\n"; echo "\n"; echo "\n"; - echo "
\n"; + echo "
\n"; echo "\n"; echo "\n"; echo "
"._QXZ("Menu ID").": $menu_id $NWB#call_menu-menu_id$NWE
"._QXZ("Menu Name").": $NWB#call_menu-menu_name$NWE
"._QXZ("Admin User Group").": "; echo "$ingroup_list"; echo "   "._QXZ("Handle Method").": $NWB#call_menu-ingroup_settings$NWE\n"; + echo "$IGhandle_method_list $NWB#call_menu-ingroup_settings$NWE\n"; echo "
"._QXZ("Search Method").": \n"; echo "   "._QXZ("List ID").": "; diff --git a/www/vicidial/admin_header.php b/www/vicidial/admin_header.php index c85ddd09..3739b56e 100644 --- a/www/vicidial/admin_header.php +++ b/www/vicidial/admin_header.php @@ -88,6 +88,7 @@ # 210226-1547 - Added Copy Phone link # 210306-0902 - Changes for new QC module # 210707-0730 - Added header links for timezones, phone codes and postal codes +# 210907-1904 - Added new OWNERCUSTOMx handle methods for menu options # $stmt="SELECT admin_home_url,enable_tts_integration,callcard_enabled,custom_fields_enabled,allow_emails,level_8_disable_add,allow_chats,enable_languages,admin_row_click,admin_screen_colors,user_new_lead_limit,user_territories_active,qc_features_active,agent_soundboards,enable_drop_lists,allow_ip_lists from system_settings;"; @@ -1049,7 +1050,7 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 $i++; } - $IGhandle_method_list = ''; + $IGhandle_method_list = ''; $IGsearch_method_list = ''; @@ -1124,7 +1125,7 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 new_content = new_content + ''; new_content = new_content + "   : '; + new_content = new_content + '' + '' + IGhandle_method_list + '' + "\n"; new_content = new_content + '   HELP'; new_content = new_content + "
: '; @@ -1516,7 +1517,7 @@ if ( ($ADD==2811) or ($ADD==3811) or ($ADD==3111) or ($ADD==2111) or ($ADD==2011 new_content = new_content + ''; new_content = new_content + "   : '; + new_content = new_content + '' + '' + IGhandle_method_list + '' + "\n"; new_content = new_content + "
: '; new_content = new_content + "   : '; diff --git a/www/vicidial/help_documentation.txt b/www/vicidial/help_documentation.txt index 0c9085d1..a98df070 100644 --- a/www/vicidial/help_documentation.txt +++ b/www/vicidial/help_documentation.txt @@ -1,4 +1,4 @@ -# version: 20210827075001 +# version: 20210907200601 users-user User ID This field is where you put the users ID number, can be up to 8 digits in length, Must be at least 2 characters in length. users-pass Password This field is where you put the users password. Must be at least 2 characters in length. Only letters and numbers are allowed in user passwords. A medium strength user password will be at least 10 characters in length, and a strong user password will be at least 20 characters in length and have letters as well as at least one number. It is recommended that you use a longer password if possible, stringing together several unrelated words with no spaces, and a number somewhere in the string. The maximum size of a password is 100 characters. users-force_change_password Force Change Password If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage or the agent screen. Default is N. @@ -659,7 +659,7 @@ inbound_dids-user User Agent If AGENT is selected as the DID Route, then th inbound_dids-user_unavailable_action User Unavailable Action If AGENT is selected as the DID Route, and the user is not logged in, then this is the route that the calls will take. inbound_dids-user_route_settings_ingroup User Route Settings In-Group If AGENT is selected as the DID Route, then this is the In-Group that will be used for the queue settings as the caller is waiting to be sent to the agent. Default is AGENTDIRECT. inbound_dids-group_id In-Group ID If IN_GROUP is selected as the DID Route, then this is the In-Group that calls will be sent to. -inbound_dids-call_handle_method In-Group Call Handle Method If IN_GROUP is selected as the DID Route, then this is the call handling method used for these calls. CID will add a new lead record with every call using the CallerID as the phone number, CIDLOOKUP will attempt to lookup the phone number by the CallerID in the entire system, CIDLOOKUPRL will attempt to lookup the phone number by the CallerID in only one specified list, CIDLOOKUPRC will attempt to lookup the phone number by the CallerID in all of the lists that belong to the specified campaign, CLOSER is specified for Closer calls, ANI will add a new lead record with every call using the ANI as the phone number, ANILOOKUP will attempt to lookup the phone number by the ANI in the entire system, ANILOOKUPRL will attempt to lookup the phone number by the ANI in only one specified list, XDIGITID will prompt the caller for an X digit code before the call will be put into the queue, VIDPROMPT will prompt the caller for their ID number and will create a new lead record with the CallerID as the phone number and the ID as the Vendor ID, VIDPROMPTLOOKUP will attempt to lookup the ID in the entire system, VIDPROMPTLOOKUPRL will attempt to lookup the vendor ID by the ID in only one specified list, VIDPROMPTLOOKUPRC will attempt to lookup the vendor ID by the ID in all of the lists that belong to the specified campaign. Default is CID. If a CIDLOOKUP method is used with ALT, it will search the alt_phone field for the phone number if no matches are found for the main phone number. If a CIDLOOKUP method is used with ADDR3, it will search the address3 field for the phone number if no matches are found for the main phone number and optionally the alt_phone field. +inbound_dids-call_handle_method In-Group Call Handle Method If IN_GROUP is selected as the DID Route, then this is the call handling method used for these calls. CID will add a new lead record with every call using the CallerID as the phone number, CIDLOOKUP will attempt to lookup the phone number by the CallerID in the entire system, CIDLOOKUPRL will attempt to lookup the phone number by the CallerID in only one specified list, CIDLOOKUPRC will attempt to lookup the phone number by the CallerID in all of the lists that belong to the specified campaign, CLOSER is specified for Closer calls, ANI will add a new lead record with every call using the ANI as the phone number, ANILOOKUP will attempt to lookup the phone number by the ANI in the entire system, ANILOOKUPRL will attempt to lookup the phone number by the ANI in only one specified list, XDIGITID will prompt the caller for an X digit code before the call will be put into the queue, VIDPROMPT will prompt the caller for their ID number and will create a new lead record with the CallerID as the phone number and the ID as the Vendor ID, VIDPROMPTLOOKUP will attempt to lookup the ID in the entire system, VIDPROMPTLOOKUPRL will attempt to lookup the vendor ID by the ID in only one specified list, VIDPROMPTLOOKUPRC will attempt to lookup the vendor ID by the ID in all of the lists that belong to the specified campaign. Default is CID. If a CIDLOOKUP method is used with ALT, it will search the alt_phone field for the phone number if no matches are found for the main phone number. If a CIDLOOKUP method is used with ADDR3, it will search the address3 field for the phone number if no matches are found for the main phone number and optionally the alt_phone field. If OWNERCUSTOM is used, the lead that is looked up will have to have an -owner- field value that matches the DID CUSTOM 1,2,3,4 or 5 value that is set when the lead is searched, in addition to the phone number(If used in a Call Menu, the -VID Enter- field will be used to match the -owner- lead field). inbound_dids-agent_search_method In-Group Agent Search Method If IN_GROUP is selected as the DID Route, then this is the agent search method to be used by the inbound group, LO is Load-Balanced-Overflow and will try to send the call to an agent on the local server before trying to send it to an agent on another server, LB is Load-Balanced and will try to send the call to the next agent no matter what server they are on, SO is Server-Only and will only try to send the calls to agents on the server that the call came in on. Default is LB. inbound_dids-list_id In-Group List ID If IN_GROUP is selected as the DID Route, then this is the List ID that leads may be searched through and that leads will be inserted into if necessary. inbound_dids-entry_list_id In-Group Entry List ID If IN_GROUP is selected as the DID Route, then this is the Entry List ID that a new lead will be populated with if a new lead is added. Default is 0 for disabled.