From e67b043977c741475c3d29c7b4fb43d2a613f7ca Mon Sep 17 00:00:00 2001 From: mattf Date: Fri, 8 Nov 2019 18:42:08 +0000 Subject: [PATCH] Added Campaign option for Dial Timeout Lead overrides, allowing you to set up a Settings Container with values for manual-dial and/or auto-dial lead fields and associated values that will tie to different Dial Timeouts. git-svn-id: svn://192.168.202.10@3160 3d104415-ff17-0410-8863-d5cf3c621b8a --- agc_2-X/trunk/UPGRADE | 5 + agc_2-X/trunk/bin/AST_VDauto_dial.pl | 139 +++++++++- agc_2-X/trunk/bin/AST_VDauto_dial_FILL.pl | 136 +++++++++- .../trunk/extras/MySQL_AST_CREATE_tables.sql | 5 +- agc_2-X/trunk/extras/upgrade_2.14.sql | 4 + agc_2-X/trunk/www/agc/vdc_db_query.php | 239 ++++++++++++++++-- agc_2-X/trunk/www/vicidial/admin.php | 78 +++++- .../trunk/www/vicidial/help_documentation.txt | 3 +- 8 files changed, 575 insertions(+), 34 deletions(-) diff --git a/agc_2-X/trunk/UPGRADE b/agc_2-X/trunk/UPGRADE index 0b1c1531..5e153aad 100644 --- a/agc_2-X/trunk/UPGRADE +++ b/agc_2-X/trunk/UPGRADE @@ -441,6 +441,11 @@ OTHER CHANGES: 122. Added a Campaign option to not send an agent immediately to the disposition screen after transferring a customer call to a VoiceMail Message. +123. Added Campaign option for Dial Timeout Lead overrides, allowing you to set + up a Settings Container with values for manual-dial and/or auto-dial + lead fields and associated values that will tie to different + Dial Timeouts. + diff --git a/agc_2-X/trunk/bin/AST_VDauto_dial.pl b/agc_2-X/trunk/bin/AST_VDauto_dial.pl index 69e9016d..78f0b1df 100644 --- a/agc_2-X/trunk/bin/AST_VDauto_dial.pl +++ b/agc_2-X/trunk/bin/AST_VDauto_dial.pl @@ -130,6 +130,7 @@ # 180301-1338 - Small changes for Inbound Queue No Dial # 180812-1026 - Added code for scheduled_callbacks_auto_reschedule campaign feature # 190709-2239 - Added Call Quota logging +# 191108-0922 - Added Dial Timeout Lead override function # ### begin parsing run-time options ### @@ -645,7 +646,7 @@ while($one_day_interval > 0) ### grab the dial_level and multiply by active agents to get your goalcalls $DBIPadlevel[$user_CIPct]=0; - $stmtA = "SELECT auto_dial_level,local_call_time,dial_timeout,dial_prefix,campaign_cid,active,campaign_vdad_exten,closer_campaigns,omit_phone_code,available_only_ratio_tally,auto_alt_dial,campaign_allow_inbound,queue_priority,dial_method,use_custom_cid,inbound_queue_no_dial,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents,adaptive_dl_diff_target,dl_diff_target_method,inbound_no_agents_no_dial_container,inbound_no_agents_no_dial_threshold,cid_group_id,scheduled_callbacks_auto_reschedule,call_quota_lead_ranking FROM vicidial_campaigns where campaign_id='$DBIPcampaign[$user_CIPct]'"; + $stmtA = "SELECT auto_dial_level,local_call_time,dial_timeout,dial_prefix,campaign_cid,active,campaign_vdad_exten,closer_campaigns,omit_phone_code,available_only_ratio_tally,auto_alt_dial,campaign_allow_inbound,queue_priority,dial_method,use_custom_cid,inbound_queue_no_dial,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents,adaptive_dl_diff_target,dl_diff_target_method,inbound_no_agents_no_dial_container,inbound_no_agents_no_dial_threshold,cid_group_id,scheduled_callbacks_auto_reschedule,call_quota_lead_ranking,dial_timeout_lead_container FROM vicidial_campaigns where campaign_id='$DBIPcampaign[$user_CIPct]'"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -683,6 +684,25 @@ while($one_day_interval > 0) $DBIPcid_group_id[$user_CIPct] = $aryA[24]; $DBIPscheduled_callbacks_auto_reschedule[$user_CIPct] = $aryA[25]; $DBIPcall_quota_lead_ranking[$user_CIPct] = $aryA[26]; + $DBIPdial_timeout_lead_container[$user_CIPct] = $aryA[27]; + $DBIPdial_timeout_lead_container_entry[$user_CIPct]=''; + + # check for Dial Timeout Lead override + if ( (length($DBIPdial_timeout_lead_container[$user_CIPct]) > 1) && ($DBIPdial_timeout_lead_container[$user_CIPct] !~ /^DISABLED$/i) ) + { + # Gather settings container for Call Quota Lead Ranking + $stmtA = "SELECT container_entry FROM vicidial_settings_containers where container_id='$DBIPdial_timeout_lead_container[$user_CIPct]';"; + $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; + $DBIPdial_timeout_lead_container_entry[$user_CIPct] = $aryA[0]; + $DBIPdial_timeout_lead_container_entry[$user_CIPct] =~ s/\r|\t|\'|\"|\\//gi; + } + $sthA->finish(); + } if ($DBIPdl_diff_target_method[$user_CIPct] =~ /ADAPT_CALC_ONLY/) { @@ -1232,7 +1252,7 @@ while($one_day_interval > 0) print "hopper row updated to INCALL: |$UQaffected_rows|$lead_id|\n"; ### Gather lead data - $stmtA = "SELECT list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,address3,alt_phone,called_count,security_phrase,state FROM vicidial_list where lead_id='$lead_id';"; + $stmtA = "SELECT list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,address3,alt_phone,called_count,security_phrase,state,vendor_lead_code,source_id,title,first_name,middle_initial,last_name,address1,address2,city,province,postal_code,country_code,date_of_birth,email,comments,rank,owner FROM vicidial_list where lead_id='$lead_id';"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -1251,6 +1271,23 @@ while($one_day_interval > 0) $called_count = $aryA[7]; $security_phrase = $aryA[8]; $state = $aryA[9]; + $vendor_id = $aryA[10]; + $source_id = $aryA[11]; + $title = $aryA[12]; + $first_name = $aryA[13]; + $middle_initial = $aryA[14]; + $last_name = $aryA[15]; + $address1 = $aryA[16]; + $address2 = $aryA[17]; + $city = $aryA[18]; + $province = $aryA[19]; + $postal_code = $aryA[20]; + $country_code = $aryA[21]; + $date_of_birth = $aryA[22]; + $email = $aryA[23]; + $comments = $aryA[24]; + $rank = $aryA[25]; + $owner = $aryA[26]; $rec_countCUSTDATA++; $rec_count++; @@ -1371,6 +1408,103 @@ while($one_day_interval > 0) } } + ### BEGIN check for Dial Timeout Lead override for this lead ### + $DTL_override=0; + if ( (length($DBIPdial_timeout_lead_container[$user_CIPct]) > 1) && ($DBIPdial_timeout_lead_container[$user_CIPct] !~ /^DISABLED$/i) ) + { + $AD_field=''; + $skip_line=0; $DTLOset=0; + $temp_DTL = $DBIPdial_timeout_lead_container_entry[$user_CIPct]; + if (length($temp_DTL) > 5) + { + @container_lines = split(/\n/,$temp_DTL); + $c=0; + foreach(@container_lines) + { + $container_lines[$c] =~ s/;.*|\r|\t//gi; + $container_lines[$c] =~ s/ => |=> | =>/=>/gi; + if (length($container_lines[$c]) > 3) + { + # define core settings + if ($container_lines[$c] =~ /^auto_dial_field/i) + { + $container_lines[$c] =~ s/auto_dial_field=>//gi; + $AD_field = $container_lines[$c]; + } + else + { + if ($container_lines[$c] =~ /^manual_dial_field|^;/i) + {$skip_line++;} + else + { + # define dial timeouts + @temp_key_value = split(/=>/,$container_lines[$c]); + if ( ($AD_field eq 'vendor_lead_code') and ($vendor_id eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'source_id') and ($source_id eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'list_id') and ($list_id eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'gmt_offset_now') and ($gmt_offset_now eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'phone_code') and ($phone_code eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'title') and ($title eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'first_name') and ($first_name eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'middle_initial') and ($middle_initial eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'last_name') and ($last_name eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'address1') and ($address1 eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'address2') and ($address2 eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'address3') and ($address3 eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'city') and ($city eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'state') and ($state eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'province') and ($province eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'postal_code') and ($postal_code eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'country_code') and ($country_code eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'date_of_birth') and ($date_of_birth eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'alt_phone') and ($alt_phone eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'email') and ($email eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'security_phrase') and ($security_phrase eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'comments') and ($comments eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'called_count') and ($called_count eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'rank') and ($rank eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'owner') and ($owner eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + + # $event_string = "| Dial Timeout Lead DEBUG: $c|$DTLOset|$AD_field|$lead_id|$temp_key_value[0]|$temp_key_value[1]|$DTL_override|$skip_line|$source_id|"; + # &event_logger; + + } + } + } + $c++; + } + # Dial Timeout Lead debug logging + $event_string = "| Dial Timeout Lead override: $DTLOset|$AD_field|$lead_id|$temp_key_value[0]|$temp_key_value[1]|$DTL_override|$skip_line|$c|"; + &event_logger; + } + } + ### END check for Dial Timeout Lead override for this lead ### + $stmtA = "DELETE FROM vicidial_hopper where lead_id='$lead_id'"; $affected_rows = $dbhA->do($stmtA); @@ -1380,6 +1514,7 @@ while($one_day_interval > 0) $Local_out_prefix = '9'; $Local_dial_timeout = '60'; if ($DBIPdialtimeout[$user_CIPct] > 4) {$Local_dial_timeout = $DBIPdialtimeout[$user_CIPct];} + if ($DTL_override > 4) {$Local_dial_timeout = $DTL_override;} $Local_dial_timeout = ($Local_dial_timeout * 1000); if (length($DBIPdialprefix[$user_CIPct]) > 0) {$Local_out_prefix = "$DBIPdialprefix[$user_CIPct]";} if (length($DBIPvdadexten[$user_CIPct]) > 0) {$VDAD_dial_exten = "$DBIPvdadexten[$user_CIPct]";} diff --git a/agc_2-X/trunk/bin/AST_VDauto_dial_FILL.pl b/agc_2-X/trunk/bin/AST_VDauto_dial_FILL.pl index e3f6d689..1f2e99df 100644 --- a/agc_2-X/trunk/bin/AST_VDauto_dial_FILL.pl +++ b/agc_2-X/trunk/bin/AST_VDauto_dial_FILL.pl @@ -12,7 +12,7 @@ # # Should only be run on one server in a multi-server Asterisk/VICIDIAL cluster # -# Copyright (C) 2018 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2019 Matt Florell LICENSE: AGPLv2 # # CHANGELOG: # 61115-1246 - First build, framework setup, non-functional @@ -43,6 +43,7 @@ # 180214-1558 - Added CID Group functionality # 180812-1025 - Added code for scheduled_callbacks_auto_reschedule campaign feature # 180910-1759 - Small fix for data validation +# 191108-1023 - Added Dial Timeout Lead override function # ### begin parsing run-time options ### @@ -343,7 +344,7 @@ while($one_day_interval > 0) ### grab the dial_level and multiply by active agents to get your goalcalls $DBIPadlevel[$camp_CIPct]=0; - $stmtA = "SELECT dial_timeout,dial_prefix,campaign_cid,active,campaign_vdad_exten,omit_phone_code,auto_alt_dial,queue_priority,use_custom_cid,cid_group_id,scheduled_callbacks_auto_reschedule FROM vicidial_campaigns where campaign_id='$DBfill_campaign[$camp_CIPct]';"; + $stmtA = "SELECT dial_timeout,dial_prefix,campaign_cid,active,campaign_vdad_exten,omit_phone_code,auto_alt_dial,queue_priority,use_custom_cid,cid_group_id,scheduled_callbacks_auto_reschedule,dial_timeout_lead_container FROM vicidial_campaigns where campaign_id='$DBfill_campaign[$camp_CIPct]';"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -363,6 +364,7 @@ while($one_day_interval > 0) $DBIPuse_custom_cid[$camp_CIPct] = $aryA[8]; $DBIPcid_group_id[$camp_CIPct] = $aryA[9]; $DBIPscheduled_callbacks_auto_reschedule[$camp_CIPct] = $aryA[10]; + $DBIPdial_timeout_lead_container[$camp_CIPct] = $aryA[11]; if ($omit_phone_code =~ /Y/) {$DBIPomitcode[$camp_CIPct] = 1;} else {$DBIPomitcode[$camp_CIPct] = 0;} @@ -652,7 +654,7 @@ while($one_day_interval > 0) $UQaffected_rows = $dbhA->do($stmtA); # print "hopper row updated to INCALL: |$UQaffected_rows|$lead_id|\n"; - $stmtA = "SELECT list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,address3,alt_phone,called_count,security_phrase,state FROM vicidial_list where lead_id='$lead_id';"; + $stmtA = "SELECT list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,address3,alt_phone,called_count,security_phrase,state,vendor_lead_code,source_id,title,first_name,middle_initial,last_name,address1,address2,city,province,postal_code,country_code,date_of_birth,email,comments,rank,owner FROM vicidial_list where lead_id='$lead_id';"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -670,6 +672,23 @@ while($one_day_interval > 0) $called_count = $aryA[7]; $security_phrase = $aryA[8]; $state = $aryA[9]; + $vendor_id = $aryA[10]; + $source_id = $aryA[11]; + $title = $aryA[12]; + $first_name = $aryA[13]; + $middle_initial = $aryA[14]; + $last_name = $aryA[15]; + $address1 = $aryA[16]; + $address2 = $aryA[17]; + $city = $aryA[18]; + $province = $aryA[19]; + $postal_code = $aryA[20]; + $country_code = $aryA[21]; + $date_of_birth = $aryA[22]; + $email = $aryA[23]; + $comments = $aryA[24]; + $rank = $aryA[25]; + $owner = $aryA[26]; $rec_countCUSTDATA++; } @@ -677,6 +696,116 @@ while($one_day_interval > 0) if ($rec_countCUSTDATA) { + ### BEGIN check for Dial Timeout Lead override for this lead ### + $DTL_override=0; + if ( (length($DBIPdial_timeout_lead_container[$camp_CIPct]) > 1) && ($DBIPdial_timeout_lead_container[$camp_CIPct] !~ /^DISABLED$/i) ) + { + # Gather settings container for Call Quota Lead Ranking + $stmtA = "SELECT container_entry FROM vicidial_settings_containers where container_id='$DBIPdial_timeout_lead_container[$user_CIPct]';"; + $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; + $DBIPdial_timeout_lead_container_entry[$camp_CIPct] = $aryA[0]; + $DBIPdial_timeout_lead_container_entry[$camp_CIPct] =~ s/\r|\t|\'|\"|\\//gi; + } + $sthA->finish(); + + $AD_field=''; + $skip_line=0; $DTLOset=0; + $temp_DTL = $DBIPdial_timeout_lead_container_entry[$camp_CIPct]; + if (length($temp_DTL) > 5) + { + @container_lines = split(/\n/,$temp_DTL); + $c=0; + foreach(@container_lines) + { + $container_lines[$c] =~ s/;.*|\r|\t//gi; + $container_lines[$c] =~ s/ => |=> | =>/=>/gi; + if (length($container_lines[$c]) > 3) + { + # define core settings + if ($container_lines[$c] =~ /^auto_dial_field/i) + { + $container_lines[$c] =~ s/auto_dial_field=>//gi; + $AD_field = $container_lines[$c]; + } + else + { + if ($container_lines[$c] =~ /^manual_dial_field|^;/i) + {$skip_line++;} + else + { + # define dial timeouts + @temp_key_value = split(/=>/,$container_lines[$c]); + if ( ($AD_field eq 'vendor_lead_code') and ($vendor_id eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'source_id') and ($source_id eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'list_id') and ($list_id eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'gmt_offset_now') and ($gmt_offset_now eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'phone_code') and ($phone_code eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'title') and ($title eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'first_name') and ($first_name eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'middle_initial') and ($middle_initial eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'last_name') and ($last_name eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'address1') and ($address1 eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'address2') and ($address2 eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'address3') and ($address3 eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'city') and ($city eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'state') and ($state eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'province') and ($province eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'postal_code') and ($postal_code eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'country_code') and ($country_code eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'date_of_birth') and ($date_of_birth eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'alt_phone') and ($alt_phone eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'email') and ($email eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'security_phrase') and ($security_phrase eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'comments') and ($comments eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'called_count') and ($called_count eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'rank') and ($rank eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($AD_field eq 'owner') and ($owner eq $temp_key_value[0]) ) + {$DTL_override = $temp_key_value[1]; $DTLOset++;} + + # $event_string = "| Dial Timeout Lead DEBUG: $c|$DTLOset|$AD_field|$lead_id|$temp_key_value[0]|$temp_key_value[1]|$DTL_override|$skip_line|$source_id|"; + # &event_logger; + + } + } + } + $c++; + } + # Dial Timeout Lead debug logging + $event_string = "| Dial Timeout Lead override: $DTLOset|$AD_field|$lead_id|$temp_key_value[0]|$temp_key_value[1]|$DTL_override|$skip_line|$c|"; + &event_logger; + } + } + ### END check for Dial Timeout Lead override for this lead ### + $campaign_cid_override=''; ### gather list_id overrides $stmtA = "SELECT campaign_cid_override FROM vicidial_lists where list_id='$list_id';"; @@ -805,6 +934,7 @@ while($one_day_interval > 0) $Local_out_prefix = '9'; $Local_dial_timeout = '60'; if ($DBIPdialtimeout[$camp_CIPct] > 4) {$Local_dial_timeout = $DBIPdialtimeout[$camp_CIPct];} + if ($DTL_override > 4) {$Local_dial_timeout = $DTL_override;} $Local_dial_timeout = ($Local_dial_timeout * 1000); if (length($DBIPdialprefix[$camp_CIPct]) > 0) {$Local_out_prefix = "$DBIPdialprefix[$camp_CIPct]";} if (length($DBIPvdadexten[$camp_CIPct]) > 0) {$VDAD_dial_exten = "$DBIPvdadexten[$camp_CIPct]";} 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 aac8ae2d..0655e2aa 100644 --- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql +++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql @@ -1033,7 +1033,8 @@ call_quota_last_run_date DATETIME, sip_event_logging VARCHAR(40) default 'DISABLED', campaign_script_two VARCHAR(20) default '', leave_vm_no_dispo ENUM('ENABLED','DISABLED') default 'DISABLED', -leave_vm_message_group_id VARCHAR(40) default '---NONE---' +leave_vm_message_group_id VARCHAR(40) default '---NONE---', +dial_timeout_lead_container VARCHAR(40) default 'DISABLED' ) ENGINE=MyISAM; CREATE TABLE vicidial_lists ( @@ -4565,4 +4566,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='1578',db_schema_update_date=NOW(),reload_timestamp=NOW(); +UPDATE system_settings SET db_schema_version='1579',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 e60dc5e3..961338b9 100644 --- a/agc_2-X/trunk/extras/upgrade_2.14.sql +++ b/agc_2-X/trunk/extras/upgrade_2.14.sql @@ -1108,3 +1108,7 @@ index (lead_id) ) ENGINE=MyISAM; UPDATE system_settings SET db_schema_version='1578',db_schema_update_date=NOW() where db_schema_version < 1578; + +ALTER TABLE vicidial_campaigns ADD dial_timeout_lead_container VARCHAR(40) default 'DISABLED'; + +UPDATE system_settings SET db_schema_version='1579',db_schema_update_date=NOW() where db_schema_version < 1579; diff --git a/agc_2-X/trunk/www/agc/vdc_db_query.php b/agc_2-X/trunk/www/agc/vdc_db_query.php index d201091d..b34d93c6 100644 --- a/agc_2-X/trunk/www/agc/vdc_db_query.php +++ b/agc_2-X/trunk/www/agc/vdc_db_query.php @@ -484,10 +484,11 @@ # 191030-1536 - Added code to gather VM Message Group entries # 191104-1800 - Fixes for translations # 191107-1010 - Fix for issue #1180, hide phone number in callback info +# 191108-0920 - Added Dial Timeout Lead override function # -$version = '2.14-377'; -$build = '191107-1010'; +$version = '2.14-378'; +$build = '191108-0920'; $php_script = 'vdc_db_query.php'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=824; @@ -4209,20 +4210,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### BEGIN if NOT preview dialing, do send the call ##### if ( (strlen($preview)<1) or ($preview == 'NO') or (strlen($dial_ingroup) > 1) ) { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = ''; # $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - ### check for custom cid use - $use_custom_cid=0; - $stmt = "SELECT use_custom_cid,manual_dial_hopper_check,start_call_url,manual_dial_filter,use_internal_dnc,use_campaign_dnc,use_other_campaign_dnc,cid_group_id,scheduled_callbacks_auto_reschedule FROM vicidial_campaigns where campaign_id='$campaign';"; + $stmt = "SELECT use_custom_cid,manual_dial_hopper_check,start_call_url,manual_dial_filter,use_internal_dnc,use_campaign_dnc,use_other_campaign_dnc,cid_group_id,scheduled_callbacks_auto_reschedule,dial_timeout_lead_container FROM vicidial_campaigns where campaign_id='$campaign';"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00313',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -4239,8 +4227,104 @@ if ($ACTION == 'manDiaLnextCaLL') $use_other_campaign_dnc = $row[6]; $cid_group_id = $row[7]; $scheduled_callbacks_auto_reschedule = $row[8]; + $dial_timeout_lead_container = $row[9]; } + ### BEGIN check for Dial Timeout Lead Override ### + if ( (strlen($dial_timeout_lead_container) > 1) and ($dial_timeout_lead_container != 'DISABLED') ) + { + $MD_field=''; + $DTL_override=''; + $DTLOset=0; $skip_line=0; + # Gather details on Dial Timeout Lead settings container + $stmt = "SELECT container_entry FROM vicidial_settings_containers where container_id='$dial_timeout_lead_container';"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $SCinfo_ct = mysqli_num_rows($rslt); + if ($SCinfo_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $DTcontainer_entry = $row[0]; + $DTcontainer_entry = preg_replace("/\r|\t|\'|\"/",'',$DTcontainer_entry); + $DTcontainer_entry = preg_replace("/ => |=> | =>/",'=>',$DTcontainer_entry); + $dial_timeout_lead_settings = explode("\n",$DTcontainer_entry); + $dial_timeout_lead_settings_ct = count($dial_timeout_lead_settings); + $dtl=0; + while ( ($dial_timeout_lead_settings_ct >= $dtl) and ($DTLOset < 1) ) + { + if (preg_match("/^manual_dial_field=>/",$dial_timeout_lead_settings[$dtl])) + { + $dial_timeout_lead_settings[$dtl] = preg_replace("/^manual_dial_field=>/",'',$dial_timeout_lead_settings[$dtl]); + $MD_field = $dial_timeout_lead_settings[$dtl]; + } + elseif ( (preg_match("/auto_dial_field=>|^;/",$dial_timeout_lead_settings[$dtl])) or (strlen($dial_timeout_lead_settings[$dtl]) < 4) ) + {$skip_line++;} + else + { + $temp_key_value = explode('=>',$dial_timeout_lead_settings[$dtl]); + if ( ($MD_field == 'vendor_lead_code') and ($vendor_id == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'source_id') and ($source_id == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'list_id') and ($list_id == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'gmt_offset_now') and ($gmt_offset_now == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'phone_code') and ($phone_code == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'title') and ($title == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'first_name') and ($first_name == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'middle_initial') and ($middle_initial == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'last_name') and ($last_name == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'address1') and ($address1 == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'address2') and ($address2 == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'address3') and ($address3 == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'city') and ($city == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'state') and ($state == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'province') and ($province == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'postal_code') and ($postal_code == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'country_code') and ($country_code == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'date_of_birth') and ($date_of_birth == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'alt_phone') and ($alt_phone == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'email') and ($email == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'security_phrase') and ($security_phrase == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'comments') and ($comments == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'called_count') and ($called_count == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'rank') and ($rank == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'owner') and ($owner == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + + if ($DTLOset > 0) + { + # Dial Timeout Lead debug logging + # $fp = fopen ("./DTLdebug_log.txt", "a"); + # fwrite ($fp, "$NOW_TIME DTL-Debug 1: $DTLOset|$MD_field|$lead_id|$temp_key_value[0]|$temp_key_value[1]|$DTL_override|\n"); + # fclose($fp); + } + } + $dtl++; + } + if ($DTLOset < 1) + { + # Dial Timeout Lead debug logging + # $fp = fopen ("./DTLdebug_log.txt", "a"); + # fwrite ($fp, "$NOW_TIME DTL-Debug 2: $DTLOset|$MD_field|$lead_id|$skip_line|$dtl|\n"); + # fclose($fp); + } + } + } + ### END check for Dial Timeout Lead Override ### + + ### prepare variables to place manual call from VICIDiaL + $CCID_on=0; $CCID=''; + $local_DEF = 'Local/'; + $local_AMP = '@'; + $Local_out_prefix = '9'; + $Local_dial_timeout = '60'; + $Local_persist = ''; # $Local_persist = '/n'; + if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} + if ($DTL_override > 4) {$Local_dial_timeout = $DTL_override;} + $Local_dial_timeout = ($Local_dial_timeout * 1000); + if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} + if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} + ### check for custom cid use + $use_custom_cid=0; + if ($no_hopper_dialing_used > 0) { ### BEGIN check phone filtering for DNC or camplists if enabled ### @@ -5003,7 +5087,7 @@ if ($ACTION == 'manDiaLnextCaLL') if ($SCUfile) { $SCUfile_contents = implode("", $SCUfile); - $SCUfile_contents = ereg_replace(';','',$SCUfile_contents); + $SCUfile_contents = preg_replace('/;/','',$SCUfile_contents); $SCUfile_contents = addslashes($SCUfile_contents); } else @@ -5522,7 +5606,7 @@ if ($ACTION == 'manDiaLonly') ### check for manual dial filter and extension append settings in campaign $use_eac=0; $use_custom_cid=0; - $stmt = "SELECT manual_dial_filter,use_internal_dnc,use_campaign_dnc,use_other_campaign_dnc,extension_appended_cidname,start_call_url,scheduled_callbacks_auto_reschedule FROM vicidial_campaigns where campaign_id='$campaign';"; + $stmt = "SELECT manual_dial_filter,use_internal_dnc,use_campaign_dnc,use_other_campaign_dnc,extension_appended_cidname,start_call_url,scheduled_callbacks_auto_reschedule,dial_timeout_lead_container FROM vicidial_campaigns where campaign_id='$campaign';"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00325',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -5537,6 +5621,7 @@ if ($ACTION == 'manDiaLonly') $extension_appended_cidname = $row[4]; $start_call_url = $row[5]; $scheduled_callbacks_auto_reschedule = $row[6]; + $dial_timeout_lead_container = $row[7]; if ($extension_appended_cidname == 'Y') {$use_eac++;} } @@ -5644,6 +5729,123 @@ if ($ACTION == 'manDiaLonly') } ### END check phone filtering for DNC or camplists if enabled ### + ### BEGIN check for Dial Timeout Lead Override ### + if ( (strlen($dial_timeout_lead_container) > 1) and ($dial_timeout_lead_container != 'DISABLED') ) + { + $MD_field=''; + $DTL_override=''; + $DTLOset=0; $skip_line=0; + # Gather details on Dial Timeout Lead settings container + $stmt = "SELECT container_entry FROM vicidial_settings_containers where container_id='$dial_timeout_lead_container';"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $SCinfo_ct = mysqli_num_rows($rslt); + if ($SCinfo_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $DTcontainer_entry = $row[0]; + $DTcontainer_entry = preg_replace("/\r|\t|\'|\"/",'',$DTcontainer_entry); + $DTcontainer_entry = preg_replace("/ => |=> | =>/",'=>',$DTcontainer_entry); + $dial_timeout_lead_settings = explode("\n",$DTcontainer_entry); + $dial_timeout_lead_settings_ct = count($dial_timeout_lead_settings); + + ### BEGIN load lead information to be used by Dial Timeout Lead Override ### + $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $list_lead_ct = mysqli_num_rows($rslt); + if ($list_lead_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $vendor_id = trim("$row[5]"); + $source_id = trim("$row[6]"); + $list_id = trim("$row[7]"); + $gmt_offset_now = trim("$row[8]"); + $phone_code = trim("$row[10]"); + $title = trim("$row[12]"); + $first_name = trim("$row[13]"); + $middle_initial = trim("$row[14]"); + $last_name = trim("$row[15]"); + $address1 = trim("$row[16]"); + $address2 = trim("$row[17]"); + $address3 = trim("$row[18]"); + $city = trim("$row[19]"); + $state = trim("$row[20]"); + $province = trim("$row[21]"); + $postal_code = trim("$row[22]"); + $country_code = trim("$row[23]"); + $date_of_birth = trim("$row[25]"); + $alt_phone = trim("$row[26]"); + $email = trim("$row[27]"); + $security_phrase = trim("$row[28]"); + $comments = stripslashes(trim("$row[29]")); + $called_count = trim("$row[30]"); + $rank = trim("$row[32]"); + $owner = trim("$row[33]"); + } + ### END load lead information to be used by Dial Timeout Lead Override ### + + $dtl=0; + while ( ($dial_timeout_lead_settings_ct >= $dtl) and ($DTLOset < 1) ) + { + if (preg_match("/^manual_dial_field=>/",$dial_timeout_lead_settings[$dtl])) + { + $dial_timeout_lead_settings[$dtl] = preg_replace("/^manual_dial_field=>/",'',$dial_timeout_lead_settings[$dtl]); + $MD_field = $dial_timeout_lead_settings[$dtl]; + } + elseif ( (preg_match("/auto_dial_field=>|^;/",$dial_timeout_lead_settings[$dtl])) or (strlen($dial_timeout_lead_settings[$dtl]) < 4) ) + {$skip_line++;} + else + { + $temp_key_value = explode('=>',$dial_timeout_lead_settings[$dtl]); + if ( ($MD_field == 'vendor_lead_code') and ($vendor_id == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'source_id') and ($source_id == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'list_id') and ($list_id == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'gmt_offset_now') and ($gmt_offset_now == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'phone_code') and ($phone_code == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'title') and ($title == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'first_name') and ($first_name == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'middle_initial') and ($middle_initial == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'last_name') and ($last_name == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'address1') and ($address1 == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'address2') and ($address2 == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'address3') and ($address3 == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'city') and ($city == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'state') and ($state == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'province') and ($province == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'postal_code') and ($postal_code == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'country_code') and ($country_code == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'date_of_birth') and ($date_of_birth == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'alt_phone') and ($alt_phone == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'email') and ($email == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'security_phrase') and ($security_phrase == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'comments') and ($comments == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'called_count') and ($called_count == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'rank') and ($rank == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + if ( ($MD_field == 'owner') and ($owner == $temp_key_value[0]) ) {$DTL_override = $temp_key_value[1]; $DTLOset++;} + + if ($DTLOset > 0) + { + # Dial Timeout Lead debug logging + # $fp = fopen ("./DTLdebug_log.txt", "a"); + # fwrite ($fp, "$NOW_TIME DTL-Debug 3: $DTLOset|$MD_field|$lead_id|$temp_key_value[0]|$temp_key_value[1]|$DTL_override|\n"); + # fclose($fp); + } + } + $dtl++; + } + if ($DTLOset < 1) + { + # Dial Timeout Lead debug logging + # $fp = fopen ("./DTLdebug_log.txt", "a"); + # fwrite ($fp, "$NOW_TIME DTL-Debug 4: $DTLOset|$MD_field|$lead_id|$skip_line|$dtl|\n"); + # fclose($fp); + } + } + } + ### END check for Dial Timeout Lead Override ### ### prepare variables to place manual call from VICIDiaL $CCID_on=0; $CCID=''; @@ -5656,6 +5858,7 @@ if ($ACTION == 'manDiaLonly') $Local_dial_timeout = '60'; $Local_persist = '/n'; if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} + if ($DTL_override > 4) {$Local_dial_timeout = $DTL_override;} $Local_dial_timeout = ($Local_dial_timeout * 1000); if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index 516812e8..ad08e5ed 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -2469,6 +2469,8 @@ if (isset($_GET["leave_vm_no_dispo"])) {$leave_vm_no_dispo=$_GET["leave_vm_no_ elseif (isset($_POST["leave_vm_no_dispo"])) {$leave_vm_no_dispo=$_POST["leave_vm_no_dispo"];} if (isset($_GET["leave_vm_message_group_id"])) {$leave_vm_message_group_id=$_GET["leave_vm_message_group_id"];} elseif (isset($_POST["leave_vm_message_group_id"])) {$leave_vm_message_group_id=$_POST["leave_vm_message_group_id"];} +if (isset($_GET["dial_timeout_lead_container"])) {$dial_timeout_lead_container=$_GET["dial_timeout_lead_container"];} + elseif (isset($_POST["dial_timeout_lead_container"])) {$dial_timeout_lead_container=$_POST["dial_timeout_lead_container"];} if (isset($script_id)) {$script_id= strtoupper($script_id);} @@ -3463,6 +3465,7 @@ if ($non_latin < 1) $campaign_script = preg_replace('/[^-_0-9a-zA-Z]/','',$campaign_script); $campaign_script_two = preg_replace('/[^-_0-9a-zA-Z]/','',$campaign_script_two); $leave_vm_message_group_id = preg_replace('/[^-_0-9a-zA-Z]/','',$leave_vm_message_group_id); + $dial_timeout_lead_container = preg_replace('/[^-_0-9a-zA-Z]/','',$dial_timeout_lead_container); ### ALPHA-NUMERIC and underscore and dash and slash and dot $menu_timeout_prompt = preg_replace('/[^-\/\|\._0-9a-zA-Z]/','',$menu_timeout_prompt); @@ -4576,12 +4579,13 @@ else # 191101-1149 - Added 2nd script tab, voicemail message groups and fixed translation issues # 191106-0934 - Added several multi-campaign options to the add/delete DNC number page # 191107-1150 - Added list_info as API function option +# 191107-2356 - Added Dial Timeout Lead Container functionality # # 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-724a'; -$build = '191107-1150'; +$admin_version = '2.14-725a'; +$build = '191107-2356'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -9327,7 +9331,20 @@ if ($ADD==192111111111) echo ""._QXZ("Container ID").": $NWB#settings_containers-container_id$NWE\n"; echo ""._QXZ("Container Notes").": $NWB#settings_containers-container_notes$NWE\n"; - echo ""._QXZ("Container Type").": $NWB#settings_containers-container_type$NWE\n"; + echo ""._QXZ("Container Type").": $NWB#settings_containers-container_type$NWE\n"; echo ""._QXZ("Admin User Group").": in seconds$NWB#campaigns-dial_timeout$NWE\n"; } + + ##### get container listings for dynamic dial timeout lead container pulldown menu + $stmt="SELECT container_id,container_notes from vicidial_settings_containers where container_type='DIAL_TIMEOUTS' $LOGadmin_viewable_groupsSQL order by container_id;"; + $rslt=mysql_to_mysqli($stmt, $link); + $dtlc_to_print = mysqli_num_rows($rslt); + $dial_timeout_lead_container_menu=''; + $dtlc_selected=0; + $o=0; + while ($dtlc_to_print > $o) + { + $rowx=mysqli_fetch_row($rslt); + if (strlen($rowx[1])>40) + {$rowx[1] = substr($rowx[1],0,40) . '...';} + $dial_timeout_lead_container_menu .= "\n"; + $o++; + } + + echo ""; + if ($dtlc_selected > 0) + {echo ""._QXZ("Dial Timeout Lead Container")."";} + else + {echo _QXZ("Dial Timeout Lead Container");} + echo ": $NWB#campaigns-dial_timeout_lead_container$NWE\n"; + echo ""._QXZ("Dial Prefix").": "._QXZ("for")." 91NXXNXXXXXX "._QXZ("value would be 9, for no dial prefix use X")."$NWB#campaigns-dial_prefix$NWE\n"; echo ""._QXZ("Manual Dial Prefix").": $NWB#campaigns-manual_dial_prefix$NWE\n"; @@ -24448,7 +24496,7 @@ if ($ADD==31) echo ""._QXZ("Manual Dial CID").": $NWB#campaigns-manual_dial_cid$NWE\n"; - echo ""._QXZ("Manual Dial Timeout").": ">_QXZ("in seconds")." $NWB#campaigns-manual_dial_timeout$NWE\n"; + echo ""._QXZ("Manual Dial Timeout").": "._QXZ("in seconds")." $NWB#campaigns-manual_dial_timeout$NWE\n"; echo ""._QXZ("Phone Post Time Difference Alert").": $NWB#campaigns-post_phone_time_diff_alert$NWE\n"; @@ -36713,7 +36761,21 @@ if ($ADD==392111111111) echo ""._QXZ("Container Notes").": $NWB#settings_containers-container_notes$NWE\n"; - echo ""._QXZ("Container Type").": $NWB#settings_containers-container_type$NWE\n"; + echo ""._QXZ("Container Type").": $NWB#settings_containers-container_type$NWE\n"; echo ""._QXZ("Admin User Group").":