diff --git a/agc_2-X/trunk/UPGRADE b/agc_2-X/trunk/UPGRADE index b28d4fdc..a1436fd0 100644 --- a/agc_2-X/trunk/UPGRADE +++ b/agc_2-X/trunk/UPGRADE @@ -667,6 +667,11 @@ OTHER CHANGES: 185. Added display of the Phone Codes and Postal Codes that are loaded into the system. Linked from the System Settings page. +186. Added 24-Hour Called Count Limit campaign feature, allows you to limit the + number of calls to be placed to a phone number or lead in a 24-hour time + period. Also allows for state-based override settings. For more + information, read the CALL_COUNT_LIMITS.txt doc. + diff --git a/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl b/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl index f6550aa8..f5692e9c 100644 --- a/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl +++ b/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl @@ -150,9 +150,10 @@ # 210429-1644 - Added mohsuggest config for SIP and IAX phones # 210605-1407 - Added purging of vicidial_tiltx_shaken_log log entries # 210630-1630 - Remove commas from mailbox name before writing to conf file, use "Full Name" for a phone's mailbox name, if set +# 210712-2312 - Added purging of vicidial_lead_24hour_calls table # -$build = '210630-1630'; +$build = '210712-2312'; $DB=0; # Debug flag $teodDB=0; # flag to log Timeclock End of Day processes to log file @@ -1991,6 +1992,21 @@ if ($timeclock_end_of_day_NOW > 0) ##### END vicidial_lead_messages end of day process removing records older than 1 day ##### + ##### BEGIN vicidial_lead_24hour_calls end of day process removing records older than 1 day ##### + $stmtA = "DELETE FROM vicidial_lead_24hour_calls WHERE call_date < \"$RMSQLdate\";"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows = $sthA->rows; + $event_string = "$sthArows rows deleted from vicidial_lead_24hour_calls table"; + if (!$Q) {print "$event_string \n";} + if ($teodDB) {&teod_logger;} + + $stmtA = "optimize table vicidial_lead_24hour_calls;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + ##### END vicidial_lead_24hour_calls end of day process removing records older than 1 day ##### + + ##### BEGIN usacan_phone_dialcode_fix funciton ##### if ($usacan_phone_dialcode_fix > 0) { diff --git a/agc_2-X/trunk/bin/AST_VDauto_dial.pl b/agc_2-X/trunk/bin/AST_VDauto_dial.pl index daf61c16..2bc2f0ff 100644 --- a/agc_2-X/trunk/bin/AST_VDauto_dial.pl +++ b/agc_2-X/trunk/bin/AST_VDauto_dial.pl @@ -139,9 +139,10 @@ # 210207-0952 - Added more logging, debug code and fixes for SHARED agent campaigns # 210423-2241 - Fix for campaign ID underscore issue #1265 # 210606-1006 - Added TILTX features for pre-carrier call filtering +# 210713-1322 - Added call_limit_24hour feature support # -$build='210606-1006'; +$build='210713-1322'; ### begin parsing run-time options ### if (length($ARGV[0])>1) { @@ -313,7 +314,7 @@ $event_string='LOGGED INTO MYSQL SERVER ON 1 CONNECTION|'; ############################################# ##### START QUEUEMETRICS LOGGING LOOKUP ##### -$stmtA = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,outbound_autodial_active,queuemetrics_loginout,queuemetrics_addmember_enabled,queuemetrics_pause_type,enable_drop_lists,call_quota_lead_ranking,timeclock_end_of_day,allow_shared_dial FROM system_settings;"; +$stmtA = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,outbound_autodial_active,queuemetrics_loginout,queuemetrics_addmember_enabled,queuemetrics_pause_type,enable_drop_lists,call_quota_lead_ranking,timeclock_end_of_day,allow_shared_dial,call_limit_24hour FROM system_settings;"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -334,6 +335,7 @@ if ($sthArows > 0) $SScall_quota_lead_ranking = $aryA[11]; $timeclock_end_of_day = $aryA[12]; $allow_shared_dial = $aryA[13]; + $SScall_limit_24hour = $aryA[14]; } $sthA->finish(); ##### END QUEUEMETRICS LOGGING LOOKUP ##### @@ -2084,6 +2086,23 @@ while($one_day_interval > 0) if (length($alt_dial)<1) {$alt_dial='MAIN';} + $TFhourSTATE=''; + if ($SScall_limit_24hour > 0) + { + $TFH_areacode = substr($phone_number, 0, 3); + $stmtY = "SELECT state,country FROM vicidial_phone_codes where country_code='$phone_code' and areacode='$TFH_areacode';"; + $sthY = $dbhA->prepare($stmtY) or die "preparing: ",$dbhA->errstr; + $sthY->execute or die "executing: $stmtY", $dbhA->errstr; + $sthYrows=$sthY->rows; + if ($sthYrows > 0) + { + @aryY = $sthY->fetchrow_array; + $TFhourSTATE = $aryY[0]; + $TFhourCOUNTRY = $aryY[1]; + } + $sthA->finish(); + } + ### whether to omit phone_code or not if ($DBIPomitcode[$user_CIPct] > 0) {$Ndialstring = "$Local_out_prefix$phone_number";} @@ -2107,7 +2126,11 @@ while($one_day_interval > 0) $stmtC = "INSERT INTO vicidial_dial_log SET caller_code='$VqueryCID',lead_id='$lead_id',server_ip='$DBIPaddress[$user_CIPct]',call_date='$SQLdate',extension='$VDAD_dial_exten',channel='$local_DEF$Ndialstring$local_AMP$ext_context',timeout='$Local_dial_timeout',outbound_cid='$CIDstring',context='$ext_context';"; $affected_rowsC = $dbhA->do($stmtC); - $event_string = "| number call dialed|$DBIPcampaign[$user_CIPct]|$VqueryCID|$affected_rowsA|$stmtA|$gmt_offset_now|$alt_dial|$affected_rowsB|$affected_rowsC|"; + ### insert log record into vicidial_lead_24hour_calls table + $stmtD = "INSERT INTO vicidial_lead_24hour_calls SET lead_id='$lead_id',list_id='$list_id',call_date=NOW(),phone_number='$phone_number',phone_code='$phone_code',state='$TFhourSTATE',call_type='AUTO';"; + $affected_rowsD = $dbhA->do($stmtD); + + $event_string = "| number call dialed|$DBIPcampaign[$user_CIPct]|$VqueryCID|$affected_rowsA|$stmtA|$gmt_offset_now|$alt_dial|$affected_rowsB|$affected_rowsC|$affected_rowsD|"; &event_logger; ### sleep for a five hundredths of a second to not flood the server with new calls 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 17d77090..3bb17af2 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) 2020 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2021 Matt Florell LICENSE: AGPLv2 # # CHANGELOG: # 61115-1246 - First build, framework setup, non-functional @@ -48,6 +48,7 @@ # 200122-1850 - Added code for CID Group auto-rotate feature # 201122-0932 - Added code for dialy call count limits # 201220-1034 - Changes for shared agent campaigns +# 210715-1335 - Added call_limit_24hour feature support, also fix for variable issue # ### begin parsing run-time options ### @@ -213,7 +214,7 @@ $event_string='LOGGED INTO MYSQL SERVER ON 1 CONNECTION|'; &event_logger; ### Grab system_settings values from the database -$stmtA = "SELECT use_non_latin FROM system_settings;"; +$stmtA = "SELECT use_non_latin,call_limit_24hour FROM system_settings;"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -221,6 +222,7 @@ if ($sthArows > 0) { @aryA = $sthA->fetchrow_array; $non_latin = $aryA[0]; + $SScall_limit_24hour = $aryA[1]; } $sthA->finish(); @@ -725,7 +727,7 @@ while($one_day_interval > 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]';"; + $stmtA = "SELECT container_entry FROM vicidial_settings_containers where container_id='$DBIPdial_timeout_lead_container[$camp_CIPct]';"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -869,19 +871,19 @@ while($one_day_interval > 0) if ($Lsec < 10) {$Lsec = "0$Lsec";} $LLCT_DATE = "$Lyear-$Lmon-$Lmday $Lhour:$Lmin:$Lsec"; - if ( ($alt_dial =~ /ALT|ADDR3|X/) && ($DBIPautoaltdial[$user_CIPct] =~ /ALT|ADDR|X/) ) + if ( ($alt_dial =~ /ALT|ADDR3|X/) && ($DBIPautoaltdial[$camp_CIPct] =~ /ALT|ADDR|X/) ) { - if ( ($alt_dial =~ /ALT/) && ($DBIPautoaltdial[$user_CIPct] =~ /ALT/) ) + if ( ($alt_dial =~ /ALT/) && ($DBIPautoaltdial[$camp_CIPct] =~ /ALT/) ) { $alt_phone =~ s/\D//gi; $phone_number = $alt_phone; } - if ( ($alt_dial =~ /ADDR3/) && ($DBIPautoaltdial[$user_CIPct] =~ /ADDR3/) ) + if ( ($alt_dial =~ /ADDR3/) && ($DBIPautoaltdial[$camp_CIPct] =~ /ADDR3/) ) { $address3 =~ s/\D//gi; $phone_number = $address3; } - if ( ($alt_dial =~ /^X/) && ($DBIPautoaltdial[$user_CIPct] =~ /^X/) ) + if ( ($alt_dial =~ /^X/) && ($DBIPautoaltdial[$camp_CIPct] =~ /^X/) ) { if ($alt_dial =~ /LAST/) { @@ -1100,6 +1102,23 @@ while($one_day_interval > 0) else {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} + $TFhourSTATE=''; + if ($SScall_limit_24hour > 0) + { + $TFH_areacode = substr($phone_number, 0, 3); + $stmtY = "SELECT state,country FROM vicidial_phone_codes where country_code='$phone_code' and areacode='$TFH_areacode';"; + $sthY = $dbhA->prepare($stmtY) or die "preparing: ",$dbhA->errstr; + $sthY->execute or die "executing: $stmtY", $dbhA->errstr; + $sthYrows=$sthY->rows; + if ($sthYrows > 0) + { + @aryY = $sthY->fetchrow_array; + $TFhourSTATE = $aryY[0]; + $TFhourCOUNTRY = $aryY[1]; + } + $sthA->finish(); + } + if (length($ext_context) < 1) {$ext_context='default';} ### use manager middleware-app to connect the next call to the meetme room if ($CCID_on) {$CIDstring = "\"$VqueryCID\" <$CCID>";} @@ -1130,6 +1149,10 @@ while($one_day_interval > 0) ### insert log record into vicidial_dial_log table $stmtA = "INSERT INTO vicidial_dial_log SET caller_code='$VqueryCID',lead_id='$lead_id',server_ip='$DB_camp_server_server_ip[$server_CIPct]',call_date='$SQLdate',extension='$VDAD_dial_exten',channel='$local_DEF$Ndialstring$local_AMP$ext_context',timeout='$Local_dial_timeout',outbound_cid='$CIDstring',context='$ext_context';"; $affected_rows = $dbhA->do($stmtA); + + ### insert log record into vicidial_lead_24hour_calls table + $stmtD = "INSERT INTO vicidial_lead_24hour_calls SET lead_id='$lead_id',list_id='$list_id',call_date=NOW(),phone_number='$phone_number',phone_code='$phone_code',state='$TFhourSTATE',call_type='AUTO';"; + $affected_rowsD = $dbhA->do($stmtD); } else { @@ -1142,6 +1165,8 @@ while($one_day_interval > 0) $vddl_inserts[$staggered_ct] = "INSERT INTO vicidial_dial_log SET caller_code='$VqueryCID',lead_id='$lead_id',server_ip='XXXXXXXXXXXXXXX',call_date='$SQLdate',extension='$VDAD_dial_exten',channel='$local_DEF$Ndialstring$local_AMP$ext_context',timeout='$Local_dial_timeout',outbound_cid='$CIDstring',context='$ext_context';"; + $vltfh_inserts[$staggered_ct] = "INSERT INTO vicidial_lead_24hour_calls SET lead_id='$lead_id',list_id='$list_id',call_date=NOW(),phone_number='$phone_number',phone_code='$phone_code',state='$TFhourSTATE',call_type='AUTO';"; + $DB_camp_servers_calls_placed++; $calls_placed++; $staggered_ct++; @@ -1240,6 +1265,7 @@ while($one_day_interval > 0) $TEMP_vl_update = ''; $TEMP_st_logged = ''; $TEMP_vddl_inserts = ''; + $TEMP_vltfh_inserts = ''; $TEMP_vm_insert = ''; $TEMP_vac_insert = ''; $TEMP_vddl_inserts = ''; @@ -1256,6 +1282,7 @@ while($one_day_interval > 0) $TEMP_vdc_update = $vdc_updates[$staggered_fill]; $TEMP_st_logged = $st_logged[$staggered_fill]; $TEMP_vddl_inserts = $vddl_inserts[$staggered_fill]; + $TEMP_vltfh_inserts = $vltfh_inserts[$staggered_fill]; $TEMP_vm_insert =~ s/XXXXXXXXXXXXXXX/$TEMP_server_ip/gi; $TEMP_vac_insert =~ s/XXXXXXXXXXXXXXX/$TEMP_server_ip/gi; @@ -1273,12 +1300,14 @@ while($one_day_interval > 0) $affected_rows_vm = $dbhA->do($TEMP_vm_insert); $affected_rows_vac = $dbhA->do($TEMP_vac_insert); $affected_rows_vddl = $dbhA->do($TEMP_vddl_inserts); + $affected_rows_vltfh = $dbhA->do($TEMP_vltfh_inserts); if ($DB) {print "LEAD UPDATE: $affected_rows_vl|$TEMP_vl_update|\n";} if ($DB) {print "LEAD CALL COUNT UPDATE: $affected_rows_vdc|$TEMP_vdc_update|\n";} if ($DB) {print "VICIDIAL_MANAGER INSERT: $affected_rows_vm|$TEMP_vm_insert|\n";} if ($DB) {print "VICIDIAL_AUTO_CALLS INSERT: $affected_rows_vac|$TEMP_vac_insert|\n";} if ($DB) {print "VICIDIAL_DIAL_LOG INSERT: $affected_rows_vddl|$TEMP_vddl_inserts|\n";} + if ($DB) {print "VICIDIAL_LEAD_24HOUR_CALLS INSERT: $affected_rows_vltfh|$TEMP_vltfh_inserts|\n";} } $event_string = "| number call stagger dialed|$TEMP_vm_insert|$TEMP_server_ip|$staggered_fill|$staggered_ct|$affected_rows_vm|$affected_rows_vac|$affected_rows_vl|$affected_rows_vddl $TEMP_st_logged"; diff --git a/agc_2-X/trunk/bin/AST_VDhopper.pl b/agc_2-X/trunk/bin/AST_VDhopper.pl index e26e23db..0420dc80 100644 --- a/agc_2-X/trunk/bin/AST_VDhopper.pl +++ b/agc_2-X/trunk/bin/AST_VDhopper.pl @@ -96,16 +96,17 @@ # 190213-1207 - Added additional $VLforce_index flags, for high-volume dialing systems # 190524-1228 - Fix for lead filters with 'NONE' in the filter ID # 190703-1650 - Allow for single-quotes in state field -# 200814-2132 - Added support for Internation DNC scrubbing +# 200814-2132 - Added support for International DNC scrubbing # 201111-1359 - Added support for hopper_drop_run_trigger # 201122-1039 - Added support for daily call count limits # 201220-1032 - Changes for shared agent campaigns # 210405-1008 - Added hopper_drop_run_trigger=A option # 210407-1704 - Modified the Hopper Drop-Run process to modify the priority and source of DROPs already in the hopper +# 210713-1317 - Added call_limit_24hour feature support # # constants -$build = '210407-1704'; +$build = '210713-1317'; $DB=0; # Debug flag, set to 0 for no debug messages. Can be overriden with CLI --debug flag $US='__'; $MT[0]=''; @@ -333,7 +334,7 @@ $dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VA ### Grab system_settings values from the database $anyone_callback_inactive_lists='default'; -$stmtA = "SELECT anyone_callback_inactive_lists,enable_international_dncs,daily_call_count_limit,use_non_latin FROM system_settings;"; +$stmtA = "SELECT anyone_callback_inactive_lists,enable_international_dncs,daily_call_count_limit,use_non_latin,call_limit_24hour,UNIX_TIMESTAMP(call_limit_24hour_reset),UNIX_TIMESTAMP(NOW()) FROM system_settings;"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -344,6 +345,9 @@ if ($sthArows > 0) $enable_international_dncs = $aryA[1]; $SSdaily_call_count_limit = $aryA[2]; $non_latin = $aryA[3]; + $SScall_limit_24hour = $aryA[4]; + $SScall_limit_24hour_reset = $aryA[5]; + $SScall_limit_24hour_now = $aryA[6]; } $sthA->finish(); @@ -1101,17 +1105,42 @@ if ($hopper_dnc_count > 0) ##### END Auto-Alt-Dial DNC check and update or delete +### BEGIN reset 24-Hour Call Count Limit skipped leads(skipped over 1 hour ago) +if ($SScall_limit_24hour > 0) + { + $TEMPtime_since_reset = ($SScall_limit_24hour_now - $SScall_limit_24hour_reset); + if ($DBX) + { + $event_string = "Checking for 24-Hour Call Limit skipped leads reset: |$TEMPtime_since_reset = ($SScall_limit_24hour_now - $SScall_limit_24hour_reset)|"; + print "$event_string\n"; + &event_logger; + } + + if ($TEMPtime_since_reset > 3600) + { + $stmtA = "UPDATE vicidial_list SET called_since_last_reset='N' where called_since_last_reset='D' and (modify_date <= (NOW() - INTERVAL 1 HOUR));"; + $affected_rows = $dbhA->do($stmtA); + + $stmtB = "UPDATE system_settings SET call_limit_24hour_reset=NOW();"; + $affected_rowsB = $dbhA->do($stmtB); + + if ($DB) {$event_string = "24-Hour Call Limit skipped leads reset: |$affected_rows|$affected_rowsB| |$stmtA|$stmtB|"; print "$event_string\n"; &event_logger;} + } + } +### END reset 24-Hour Call Count Limit skipped leads(skipped over 1 hour ago) + + ##### BEGIN check for active campaigns that need the hopper run for them @campaign_id=@MT; $ANY_hopper_vlc_dup_check='N'; if (length($CLIcampaign)>1) { - $stmtA = "SELECT campaign_id,lead_order,hopper_level,auto_dial_level,local_call_time,lead_filter_id,use_internal_dnc,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,dial_statuses,list_order_mix,use_campaign_dnc,drop_lockout_time,no_hopper_dialing,auto_alt_dial_statuses,dial_timeout,auto_hopper_multi,use_auto_hopper,auto_trim_hopper,lead_order_randomize,lead_order_secondary,call_count_limit,hopper_vlc_dup_check,use_other_campaign_dnc,callback_dnc,hopper_drop_run_trigger,daily_call_count_limit,daily_limit_manual from vicidial_campaigns where campaign_id IN('$CLIcampaign');"; + $stmtA = "SELECT campaign_id,lead_order,hopper_level,auto_dial_level,local_call_time,lead_filter_id,use_internal_dnc,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,dial_statuses,list_order_mix,use_campaign_dnc,drop_lockout_time,no_hopper_dialing,auto_alt_dial_statuses,dial_timeout,auto_hopper_multi,use_auto_hopper,auto_trim_hopper,lead_order_randomize,lead_order_secondary,call_count_limit,hopper_vlc_dup_check,use_other_campaign_dnc,callback_dnc,hopper_drop_run_trigger,daily_call_count_limit,daily_limit_manual,call_limit_24hour_method,call_limit_24hour_scope,call_limit_24hour,call_limit_24hour_override from vicidial_campaigns where campaign_id IN('$CLIcampaign');"; } else { - $stmtA = "SELECT campaign_id,lead_order,hopper_level,auto_dial_level,local_call_time,lead_filter_id,use_internal_dnc,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,dial_statuses,list_order_mix,use_campaign_dnc,drop_lockout_time,no_hopper_dialing,auto_alt_dial_statuses,dial_timeout,auto_hopper_multi,use_auto_hopper,auto_trim_hopper,lead_order_randomize,lead_order_secondary,call_count_limit,hopper_vlc_dup_check,use_other_campaign_dnc,callback_dnc,hopper_drop_run_trigger,daily_call_count_limit,daily_limit_manual from vicidial_campaigns where active='Y';"; + $stmtA = "SELECT campaign_id,lead_order,hopper_level,auto_dial_level,local_call_time,lead_filter_id,use_internal_dnc,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,dial_statuses,list_order_mix,use_campaign_dnc,drop_lockout_time,no_hopper_dialing,auto_alt_dial_statuses,dial_timeout,auto_hopper_multi,use_auto_hopper,auto_trim_hopper,lead_order_randomize,lead_order_secondary,call_count_limit,hopper_vlc_dup_check,use_other_campaign_dnc,callback_dnc,hopper_drop_run_trigger,daily_call_count_limit,daily_limit_manual,call_limit_24hour_method,call_limit_24hour_scope,call_limit_24hour,call_limit_24hour_override from vicidial_campaigns where active='Y';"; } $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -1153,6 +1182,11 @@ while ($sthArows > $rec_count) $hopper_drop_run_trigger[$rec_count] = $aryA[27]; $daily_call_count_limit[$rec_count] = $aryA[28]; $daily_limit_manual[$rec_count] = $aryA[29]; + $call_limit_24hour_method[$rec_count] = $aryA[30]; + $call_limit_24hour_scope[$rec_count] = $aryA[31]; + $call_limit_24hour[$rec_count] = $aryA[32]; + $call_limit_24hour_override[$rec_count] = $aryA[33]; + if ($hopper_vlc_dup_check[$rec_count] =~ /Y/) {$ANY_hopper_vlc_dup_check = 'Y';} @@ -1315,6 +1349,7 @@ foreach(@campaign_id) { $DNCskip=0; $DCCLskip=0; + $TFHCCLskip=0; $hopper_begin_output=''; $insert_end_outputSQL=''; if ($no_hopper_dialing[$i] =~ /Y/) @@ -2905,6 +2940,7 @@ foreach(@campaign_id) @REC_leads_to_hopper=@MT; @REC_lists_to_hopper=@MT; @REC_phone_to_hopper=@MT; + @REC_phone_code_to_hopper=@MT; @REC_gmt_to_hopper=@MT; @REC_state_to_hopper=@MT; @REC_status_to_hopper=@MT; @@ -2919,7 +2955,7 @@ foreach(@campaign_id) if ($hopper_vlc_dup_check[$i] =~ /Y/) {$vlc_dup_check_SQL = "and vendor_lead_code NOT IN($live_vlc$vlc_lists)";} - $stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state,status,modify_date,user,vendor_lead_code FROM vicidial_list $VLforce_index where $recycle_SQL[$i] and ($list_id_sql[$i]) and lead_id NOT IN($lead_id_lists) $vlc_dup_check_SQL and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $CCLsql[$i] $DLTsql[$i] $dnc_blocked_lists_SQL $order_stmt limit $hopper_level[$i];"; + $stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state,status,modify_date,user,vendor_lead_code,phone_code FROM vicidial_list $VLforce_index where $recycle_SQL[$i] and ($list_id_sql[$i]) and lead_id NOT IN($lead_id_lists) $vlc_dup_check_SQL and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $CCLsql[$i] $DLTsql[$i] $dnc_blocked_lists_SQL $order_stmt limit $hopper_level[$i];"; if ($DBX) {print " |$stmtA|\n";} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -2938,6 +2974,7 @@ foreach(@campaign_id) $REC_modify_to_hopper[$REC_rec_countLEADS] = $aryA[6]; $REC_user_to_hopper[$REC_rec_countLEADS] = $aryA[7]; $REC_vlc_to_hopper[$REC_rec_countLEADS] = $aryA[8]; + $REC_phone_code_to_hopper[$REC_rec_countLEADS] =$aryA[9]; $REC_source_to_hopper[$REC_rec_countLEADS] = 'R'; if ($DB_show_offset) {print "LEAD_ADD: $aryA[2] $aryA[3] $aryA[4]\n";} $REC_rec_countLEADS++; @@ -2960,6 +2997,7 @@ foreach(@campaign_id) @NEW_leads_to_hopper=@MT; @NEW_lists_to_hopper=@MT; @NEW_phone_to_hopper=@MT; + @NEW_phone_code_to_hopper=@MT; @NEW_gmt_to_hopper=@MT; @NEW_state_to_hopper=@MT; @NEW_status_to_hopper=@MT; @@ -2976,7 +3014,7 @@ foreach(@campaign_id) if ($hopper_vlc_dup_check[$i] =~ /Y/) {$vlc_dup_check_SQL = "and vendor_lead_code NOT IN($live_vlc$vlc_lists)";} - $stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state,status,modify_date,user,vendor_lead_code FROM vicidial_list $VLforce_index where $cslrSQL status IN('NEW') and ($list_id_sql[$i]) and lead_id NOT IN($lead_id_lists) $vlc_dup_check_SQL and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $CCLsql[$i] $DLTsql[$i] $dnc_blocked_lists_SQL $order_stmt limit $NEW_level;"; + $stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state,status,modify_date,user,vendor_lead_code,phone_code FROM vicidial_list $VLforce_index where $cslrSQL status IN('NEW') and ($list_id_sql[$i]) and lead_id NOT IN($lead_id_lists) $vlc_dup_check_SQL and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $CCLsql[$i] $DLTsql[$i] $dnc_blocked_lists_SQL $order_stmt limit $NEW_level;"; if ($DBX) {print " |$stmtA|\n";} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -2993,6 +3031,7 @@ foreach(@campaign_id) $NEW_modify_to_hopper[$NEW_rec_countLEADS] = $aryA[6]; $NEW_user_to_hopper[$NEW_rec_countLEADS] = $aryA[7]; $NEW_vlc_to_hopper[$NEW_rec_countLEADS] = $aryA[8]; + $NEW_phone_code_to_hopper[$NEW_rec_countLEADS] =$aryA[9]; $NEW_source_to_hopper[$NEW_rec_countLEADS] = 'N'; if ($DB_show_offset) {print "LEAD_ADD: $aryA[2] $aryA[3] $aryA[4]\n";} $NEW_rec_countLEADS++; @@ -3017,6 +3056,7 @@ foreach(@campaign_id) @gmt_to_hopper=@MT; @state_to_hopper=@MT; @phone_to_hopper=@MT; + @phone_code_to_hopper=@MT; @status_to_hopper=@MT; @modify_to_hopper=@MT; @user_to_hopper=@MT; @@ -3031,7 +3071,7 @@ foreach(@campaign_id) if ($list_order_mix[$i] =~ /DISABLED/) { - $stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state,status,modify_date,user,vendor_lead_code FROM vicidial_list $VLforce_index where $cslrSQL status IN($STATUSsql[$i]) and ($list_id_sql[$i]) and lead_id NOT IN($lead_id_lists) $vlc_dup_check_SQL and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $CCLsql[$i] $DLTsql[$i] $dnc_blocked_lists_SQL $order_stmt limit $OTHER_level;"; + $stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state,status,modify_date,user,vendor_lead_code,phone_code FROM vicidial_list $VLforce_index where $cslrSQL status IN($STATUSsql[$i]) and ($list_id_sql[$i]) and lead_id NOT IN($lead_id_lists) $vlc_dup_check_SQL and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $CCLsql[$i] $DLTsql[$i] $dnc_blocked_lists_SQL $order_stmt limit $OTHER_level;"; if ($DBX) {print " |$stmtA|\n";} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -3053,6 +3093,7 @@ foreach(@campaign_id) $gmt_to_hopper[$rec_countLEADS] = $NEW_gmt_to_hopper[$NEW_in]; $state_to_hopper[$rec_countLEADS] = $NEW_state_to_hopper[$NEW_in]; $phone_to_hopper[$rec_countLEADS] = $NEW_phone_to_hopper[$NEW_in]; + $phone_code_to_hopper[$rec_countLEADS] =$NEW_phone_code_to_hopper[$NEW_in]; $status_to_hopper[$rec_countLEADS] = $NEW_status_to_hopper[$NEW_in]; $modify_to_hopper[$rec_countLEADS] = $NEW_modify_to_hopper[$NEW_in]; $user_to_hopper[$rec_countLEADS] = $NEW_user_to_hopper[$NEW_in]; @@ -3071,6 +3112,7 @@ foreach(@campaign_id) $gmt_to_hopper[$rec_countLEADS] = $REC_gmt_to_hopper[$REC_insert_count]; $state_to_hopper[$rec_countLEADS] = $REC_state_to_hopper[$REC_insert_count]; $phone_to_hopper[$rec_countLEADS] = $REC_phone_to_hopper[$REC_insert_count]; + $phone_code_to_hopper[$rec_countLEADS] =$REC_phone_code_to_hopper[$REC_insert_count]; $status_to_hopper[$rec_countLEADS] = $REC_status_to_hopper[$REC_insert_count]; $modify_to_hopper[$rec_countLEADS] = $REC_modify_to_hopper[$REC_insert_count]; $user_to_hopper[$rec_countLEADS] = $REC_user_to_hopper[$REC_insert_count]; @@ -3088,6 +3130,7 @@ foreach(@campaign_id) $modify_to_hopper[$rec_countLEADS] = $aryA[6]; $user_to_hopper[$rec_countLEADS] = $aryA[7]; $vlc_to_hopper[$rec_countLEADS] = $aryA[8]; + $phone_code_to_hopper[$rec_countLEADS] =$aryA[9]; $source_to_hopper[$rec_countLEADS] = $hopperSOURCE; if ($DB_show_offset) {print "LEAD_ADD: $aryA[2] $aryA[3] $aryA[4]\n";} $rec_countLEADS++; @@ -3134,7 +3177,7 @@ foreach(@campaign_id) if ($hopper_vlc_dup_check[$i] =~ /Y/) {$vlc_dup_check_SQL = "and vendor_lead_code NOT IN($live_vlc$vlc_lists)";} - $stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state,status,modify_date,user,vendor_lead_code FROM vicidial_list $VLforce_index where $cslrSQL ($list_mix_dialableSQL) and lead_id NOT IN($lead_id_lists) $vlc_dup_check_SQL and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $CCLsql[$i] $DLTsql[$i] $dnc_blocked_lists_SQL $order_stmt limit $LM_step_goal[$x];"; + $stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state,status,modify_date,user,vendor_lead_code,phone_code FROM vicidial_list $VLforce_index where $cslrSQL ($list_mix_dialableSQL) and lead_id NOT IN($lead_id_lists) $vlc_dup_check_SQL and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $CCLsql[$i] $DLTsql[$i] $dnc_blocked_lists_SQL $order_stmt limit $LM_step_goal[$x];"; if ($DBX) {print " |$stmtA|\n";} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -3157,7 +3200,7 @@ foreach(@campaign_id) $order = ( ($x * 1000000) + $rec_count); } } - $LM_results[$z] = "$order$USX$aryA[0]$USX$aryA[1]$USX$aryA[2]$USX$aryA[3]$USX$aryA[4]$USX$aryA[5]$USX$aryA[6]$USX$aryA[7]$USX$aryA[8]"; + $LM_results[$z] = "$order$USX$aryA[0]$USX$aryA[1]$USX$aryA[2]$USX$aryA[3]$USX$aryA[4]$USX$aryA[5]$USX$aryA[6]$USX$aryA[7]$USX$aryA[8]$USX$aryA[9]"; # if ($DBX) {print " $z|$LM_results[$z]\n";} $rec_count++; @@ -3181,6 +3224,7 @@ foreach(@campaign_id) $gmt_to_hopper[$rec_countLEADS] = $REC_gmt_to_hopper[$REC_insert_count]; $state_to_hopper[$rec_countLEADS] = $REC_state_to_hopper[$REC_insert_count]; $phone_to_hopper[$rec_countLEADS] = $REC_phone_to_hopper[$REC_insert_count]; + $phone_code_to_hopper[$rec_countLEADS] =$REC_phone_code_to_hopper[$REC_insert_count]; $status_to_hopper[$rec_countLEADS] = $REC_status_to_hopper[$REC_insert_count]; $modify_to_hopper[$rec_countLEADS] = $REC_modify_to_hopper[$REC_insert_count]; $user_to_hopper[$rec_countLEADS] = $REC_user_to_hopper[$REC_insert_count]; @@ -3198,6 +3242,7 @@ foreach(@campaign_id) $modify_to_hopper[$rec_countLEADS] = $aryA[7]; $user_to_hopper[$rec_countLEADS] = $aryA[8]; $vlc_to_hopper[$rec_countLEADS] = $aryA[9]; + $phone_code_to_hopper[$rec_countLEADS] =$aryA[10]; $source_to_hopper[$rec_countLEADS] = $hopperSOURCE; if ($DB_show_offset) {print "LEAD_ADD: $aryA[3] $aryA[4] $aryA[5]\n";} if ($DBX) {print " $w|$LM_results[$w]\n";} @@ -3217,6 +3262,7 @@ foreach(@campaign_id) $gmt_to_hopper[$rec_countLEADS] = $REC_gmt_to_hopper[$REC_insert_count]; $state_to_hopper[$rec_countLEADS] = $REC_state_to_hopper[$REC_insert_count]; $phone_to_hopper[$rec_countLEADS] = $REC_phone_to_hopper[$REC_insert_count]; + $phone_code_to_hopper[$rec_countLEADS] =$REC_phone_code_to_hopper[$REC_insert_count]; $status_to_hopper[$rec_countLEADS] = $REC_status_to_hopper[$REC_insert_count]; $modify_to_hopper[$rec_countLEADS] = $REC_modify_to_hopper[$REC_insert_count]; $user_to_hopper[$rec_countLEADS] = $REC_user_to_hopper[$REC_insert_count]; @@ -3242,6 +3288,8 @@ foreach(@campaign_id) $DNCC=0; $DNCL=0; $DCCL=0; + $TFHCCLlead=0; + $TFHCCL=0; ## Check for system DNC for this lead if ( ($use_internal_dnc[$i] =~ /Y/) || ($use_internal_dnc[$i] =~ /AREACODE/) ) { @@ -3334,6 +3382,139 @@ foreach(@campaign_id) } } + + ## BEGIN Check for 24-Hour call count limit for this lead/phone_number + if ( ($SScall_limit_24hour > 0) && ( ($call_limit_24hour_method[$i] =~ /PHONE_NUMBER/) || ($call_limit_24hour_method[$i] =~ /LEAD/) ) ) + { + $limit_scopeSQL=''; + if ($call_limit_24hour_scope[$i] =~ /CAMPAIGN_LISTS/) + { + $limit_scopeCAMP=''; + $stmtY = "SELECT list_id FROM vicidial_lists where campaign_id='$campaign_id[$i]';"; + $sthY = $dbhA->prepare($stmtY) or die "preparing: ",$dbhA->errstr; + $sthY->execute or die "executing: $stmtY", $dbhA->errstr; + $sthYrows=$sthY->rows; + $rec_campLISTS=0; + while ($sthYrows > $rec_campLISTS) + { + @aryY = $sthY->fetchrow_array; + $limit_scopeCAMP .= "'$aryY[0]',"; + $rec_campLISTS++; + } + if (length($limit_scopeCAMP) < 2) {$limit_scopeCAMP="'1'";} + else {chop($limit_scopeCAMP);} + $limit_scopeSQL = "and list_id IN($limit_scopeCAMP)"; + } + if ($call_limit_24hour_method[$i] =~ /PHONE_NUMBER/) + { + $stmtA="SELECT count(*) FROM vicidial_lead_24hour_calls where phone_number='$phone_to_hopper[$h]' and phone_code='$phone_code_to_hopper[$h]' and (call_date >= NOW() - INTERVAL 1 DAY) $limit_scopeSQL;"; + } + else + { + $stmtA="SELECT count(*) FROM vicidial_lead_24hour_calls where lead_id='$leads_to_hopper[$h]' and (call_date >= NOW() - INTERVAL 1 DAY) $limit_scopeSQL;"; + } + if ($DB) {print " Doing 24-Hour Call Count Check: $leads_to_hopper[$h]|$phone_code_to_hopper[$h]|$phone_to_hopper[$h] - $call_limit_24hour_method[$i]|$call_limit_24hour_scope[$i]\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $TFhourCOUNT=0; + $TFhourSTATE=''; + $TFhourCOUNTRY=''; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $TFhourCOUNT = ($TFhourCOUNT + $aryA[0]); + } + $sthA->finish(); + $TEMPcall_limit_24hour = $call_limit_24hour[$i]; + if ($DBX) {print " 24-Hour Call Limit Count DEBUG: $TFhourCOUNT|$stmtA|\n";} + + if ( ($call_limit_24hour_override[$i] !~ /^DISABLED$/) && (length($call_limit_24hour_override[$i]) > 0) ) + { + $TFH_areacode = substr($phone_to_hopper[$h], 0, 3); + $stmtY = "SELECT state,country FROM vicidial_phone_codes where country_code='$phone_code_to_hopper[$h]' and areacode='$TFH_areacode';"; + $sthY = $dbhA->prepare($stmtY) or die "preparing: ",$dbhA->errstr; + $sthY->execute or die "executing: $stmtY", $dbhA->errstr; + $sthYrows=$sthY->rows; + if ($sthYrows > 0) + { + @aryY = $sthY->fetchrow_array; + $TFhourSTATE = $aryY[0]; + $TFhourCOUNTRY = $aryY[1]; + } + $sthA->finish(); + + $TEMP_TFhour_OR_entry=''; + $TFH_OR_method='state_areacode'; + $stmtA = "SELECT container_entry FROM vicidial_settings_containers where container_id='$call_limit_24hour_override[$i]';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($DBX) {print "$sthArows|$stmtA\n";} + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $TEMP_TFhour_OR_entry = $aryA[0]; + } + $sthA->finish(); + + if (length($TEMP_TFhour_OR_entry) > 2) + { + @container_lines = split(/\n/,$TEMP_TFhour_OR_entry); + $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] =~ /^method/i) + { + $container_lines[$c] =~ s/method=>//gi; + $TFH_OR_method = $container_lines[$c]; + } + else + { + if ($container_lines[$c] =~ /^state/i) + { + $container_lines[$c] =~ s/state=>//gi; # USA,GA,4 + @TEMP_state_ARY = split(/,/,$container_lines[$c]); + + if ($TFhourCOUNTRY eq $TEMP_state_ARY[0]) + { + $TEMP_state_ARY[2] =~ s/\D//gi; + if ( ($TFhourSTATE eq $TEMP_state_ARY[1]) && (length($TEMP_state_ARY[2]) > 0) ) + { + if ($DB) {print " 24-Hour Call Count State Override Triggered: $TEMPcall_limit_24hour|$container_lines[$c]\n";} + $TEMPcall_limit_24hour = $TEMP_state_ARY[2]; + } + } + } + } + } + if ($DBX) {print " 24-Hour Call Count State Override DEBUG: |$container_lines[$c]|\n";} + $c++; + } + } + } + + if ( ($TFhourCOUNT > 0) && ($TFhourCOUNT >= $TEMPcall_limit_24hour) ) + { + $TFHCCLlead=1; + $TFHCCL++; + $stmtA = "UPDATE vicidial_list SET called_since_last_reset='D' where lead_id='$leads_to_hopper[$h]';"; + $affected_rows = $dbhA->do($stmtA); + if ($DBX) {print "Flagging 24-Hour Call Limit lead: $affected_rows $leads_to_hopper[$h] ($TFhourCOUNT >= $TEMPcall_limit_24hour)\n";} + } + else + { + if ($DBX) {print " 24-Hour Call Limit check passed: $leads_to_hopper[$h] ($TFhourCOUNT < $TEMPcall_limit_24hour)\n";} + } + } + ## END Check for 24-Hour call count limit for this lead/phone_number + + $VAC_exist=0; $stmtA="SELECT count(*) FROM vicidial_auto_calls where lead_id='$leads_to_hopper[$h]';"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; @@ -3375,14 +3556,14 @@ foreach(@campaign_id) if ( ($VAC_exist > 0) || ($VLA_exist > 0) ) { - $detail_string = "LIVE CALL SKIPPING |$VAC_exist|$VLA_exist| |$campaign_id[$i]|$leads_to_hopper[$h]|$phone_to_hopper[$h]|$state_to_hopper[$h]|$gmt_to_hopper[$h]|$status_to_hopper[$h]|$modify_to_hopper[$h]|$user_to_hopper[$h]|$vlc_to_hopper[$h]|"; + $detail_string = "LIVE CALL SKIPPING |$VAC_exist|$VLA_exist| |$campaign_id[$i]|$leads_to_hopper[$h]|$phone_to_hopper[$h]|$state_to_hopper[$h]|$gmt_to_hopper[$h]|$status_to_hopper[$h]|$modify_to_hopper[$h]|$user_to_hopper[$h]|$vlc_to_hopper[$h]|$phone_code_to_hopper[$h]|"; &detail_logger; } else { if ( ($VLC_exist > 0) && ($hopper_vlc_dup_check[$i] =~ /Y/) ) { - $detail_string = "VLC CALL SKIPPING |$VLC_exist|$hopper_vlc_dup_check[$i]| |$campaign_id[$i]|$leads_to_hopper[$h]|$phone_to_hopper[$h]|$state_to_hopper[$h]|$gmt_to_hopper[$h]|$status_to_hopper[$h]|$modify_to_hopper[$h]|$user_to_hopper[$h]|$vlc_to_hopper[$h]|"; + $detail_string = "VLC CALL SKIPPING |$VLC_exist|$hopper_vlc_dup_check[$i]| |$campaign_id[$i]|$leads_to_hopper[$h]|$phone_to_hopper[$h]|$state_to_hopper[$h]|$gmt_to_hopper[$h]|$status_to_hopper[$h]|$modify_to_hopper[$h]|$user_to_hopper[$h]|$vlc_to_hopper[$h]|$phone_code_to_hopper[$h]|"; &detail_logger; $vlc_dup_check_SKIP_COUNT++; } @@ -3390,7 +3571,7 @@ foreach(@campaign_id) { if ($DNClead == '0') { - if ($DCCLlead == '0') + if ( ($DCCLlead == '0') && ($TFHCCLlead == '0') ) { $stmtA = "INSERT INTO $vicidial_hopper (lead_id,campaign_id,status,user,list_id,gmt_offset_now,state,priority,source,vendor_lead_code) values('$leads_to_hopper[$h]','$campaign_id[$i]','READY','','$lists_to_hopper[$h]','$gmt_to_hopper[$h]',\"$state_to_hopper[$h]\",'$hopperPRIORITY','$source_to_hopper[$h]',\"$vlc_to_hopper[$h]\");"; $affected_rows = $dbhA->do($stmtA); @@ -3398,13 +3579,16 @@ foreach(@campaign_id) if ($DBX) {print "LEAD INSERTED: $affected_rows|$leads_to_hopper[$h]|\n";} if ($DB_detail) { - $detail_string = "|$campaign_id[$i]|$leads_to_hopper[$h]|$phone_to_hopper[$h]|$state_to_hopper[$h]|$gmt_to_hopper[$h]|$status_to_hopper[$h]|$modify_to_hopper[$h]|$user_to_hopper[$h]|$vlc_to_hopper[$h]|$source_to_hopper[$h]|"; + $detail_string = "|$campaign_id[$i]|$leads_to_hopper[$h]|$phone_to_hopper[$h]|$state_to_hopper[$h]|$gmt_to_hopper[$h]|$status_to_hopper[$h]|$modify_to_hopper[$h]|$user_to_hopper[$h]|$vlc_to_hopper[$h]|$source_to_hopper[$h]|$phone_code_to_hopper[$h]|"; &detail_logger; } } else { - $DCCLskip++; + if ($DCCLlead > 0) {$DCCLskip++;} + if ($TFHCCLlead > 0) {$TFHCCLskip++;} + $detail_string = "DAILY/24-HOUR CALL COUNT LIMIT SKIPPING |$DCCLlead|$TFHCCLlead|($TFhourCOUNT >= $TEMPcall_limit_24hour)| |$campaign_id[$i]|$leads_to_hopper[$h]|$phone_to_hopper[$h]|$state_to_hopper[$h]|$gmt_to_hopper[$h]|$status_to_hopper[$h]|$modify_to_hopper[$h]|$user_to_hopper[$h]|$vlc_to_hopper[$h]|$source_to_hopper[$h]|$phone_code_to_hopper[$h]|"; + &detail_logger; } } else @@ -3418,7 +3602,7 @@ foreach(@campaign_id) if ($DBX) {print "LEAD INSERTED AS DNC: $affected_rows|$leads_to_hopper[$h]|\n";} if ($DB_detail) { - $detail_string = "|$campaign_id[$i]|$leads_to_hopper[$h]|$phone_to_hopper[$h]|$state_to_hopper[$h]|$gmt_to_hopper[$h]|$status_to_hopper[$h]|$modify_to_hopper[$h]|$user_to_hopper[$h]|$vlc_to_hopper[$h]|$source_to_hopper[$h]|"; + $detail_string = "|$campaign_id[$i]|$leads_to_hopper[$h]|$phone_to_hopper[$h]|$state_to_hopper[$h]|$gmt_to_hopper[$h]|$status_to_hopper[$h]|$modify_to_hopper[$h]|$user_to_hopper[$h]|$vlc_to_hopper[$h]|$source_to_hopper[$h]|$phone_code_to_hopper[$h]|"; &detail_logger; } } @@ -3441,6 +3625,7 @@ foreach(@campaign_id) $insert_end_output .= " VLC Dup Check Rejected: $vlc_dup_check_SKIP_COUNT \n"; $insert_end_output .= " DNC lead skipped: $DNCskip \n"; $insert_end_output .= " Daily call count limit lead skipped: $DCCLskip \n"; + $insert_end_output .= " 24-Hour call count limit lead skipped: $TFHCCLskip \n"; if ($DB) {print "$insert_end_output";} $insert_end_outputSQL = ",adapt_output=\"$hopper_begin_output\n$insert_end_output\""; } diff --git a/agc_2-X/trunk/docs/CALL_COUNT_LIMITS.txt b/agc_2-X/trunk/docs/CALL_COUNT_LIMITS.txt new file mode 100644 index 00000000..a8642678 --- /dev/null +++ b/agc_2-X/trunk/docs/CALL_COUNT_LIMITS.txt @@ -0,0 +1,131 @@ +CALL COUNT LIMITS Started: 2020-11-22 Updated: 2021-07-14 + + + +This document will go over the various "Call Count Limit" features available within VICIdial, including: +- Lifetime Lead Call Count Limits +- Daily Call Count Limits +- 24-Hour Call Count Limits + + + +What are "Call Count Limits" exactly? + +Call Count Limits are restrictions placed on the number of times a lead(or phone number in some cases) can be called by the system. They are configurable on a per-Campaign basis. There are currently three types of Call Count Limits offered as options within VICIdial: Lifetime Lead Call Count Limits, Daily Call Count Limits, 24-Hour Call Count Limits. Below is more detail on how each of these are configured and how they work. + + + + +LIFETIME LEAD CALL COUNT LIMITS + +Lifetime Lead Call Count Limits are a default feature within VICIdial, meaning you do not have to enable anything in "Admin -> System Settings" to be able to use it. You can find the setting to enable this feature on the "Modify Campaign -> Detail" page listed as "Call Count Limit", and if this setting is set to '0', there will be no limit on the number of times a lead can be called in this campaign. + +NOTE: A lead may go over this limit slightly if Lead Recycling or Auto-Alt-Dialing is enabled. + + + + +DAILY CALL COUNT LIMITS + +Daily Call Count Limits must be enabled on the "Admin -> System Settings" page(Enable Daily Called Count Limits) before you can configure them on a "Modify Campaign -> Detail" page. This setting will limit the number of calls that can be placed to a lead on a per-day basis, with each "day" beginning at midnight server-time, and if this setting is set to '0', there will be no limit on the number of times a lead can be called each day within this campaign. Once a lead has reached this set limit, if the lead is selected to be dialed again, the called-since-last-reset flag on the lead will be changed to 'Y' and the call will not be dialed. If you want to raise this daily limit during the day, you might need to reset your lists to be able to dial the leads that hit the previous limit earlier in the day. + +There is also another setting on the campaign detail page related to this Daily Call Count Limit feature: Daily Call Limit Manual. If the Daily Call Count Limit is enabled, this setting will determine if manual dial calls will be counted and or restricted in the daily call count limit. The DISABLED option will not count manual dial calls or restrict them as part of the daily call count limits, only auto-dial calls would be counted restricted. If one of the COUNT options is used, then manual dial calls would be included in the daily call counts. If one of the RESTRICT options is used, then manual dial calls would be restricted as part of the daily call count limit. Default of this setting is DISABLED. + +NOTE: This feature may conflict with Auto-Alt-Dial features if they are enabled on a campaign. + + + + +24-HOUR CALL COUNT LIMITS + +24-Hour Call Count Limits must be enabled on the "Admin -> System Settings" page(Enable 24-Hour Called Count Limits) before you can configure them on a "Modify Campaign -> Detail" page. This setting will limit the number of calls that can be placed to a lead or a phone number within the last 24 hour, with the time being based on the database server-time. + +This setting is enabled by setting the "24-Hour Called Count Limit Method" option to either PHONE_NUMBER or LEAD. If set to PHONE_NUMBER, then before each call is placed, the system will look to see if the count of call attempts to that specific phone number is at or above the set maximum number of attempts, regardless of what lead the phone number is tied to. If set to LEAD, the system will only check to see if the lead is at or above the set maximum number of attempts. + +The next setting on the campaign detail page related to this 24-Hour Call Count Limits is "24-Hour Called Count Limit Scope", which can be set to either SYSTEM_WIDE or CAMPAIGN_LISTS. If set to SYSTEM_WIDE, then before each call is placed, the system will look to at all calls placed in the whole system to gather its count of the number of call attempts in the last 24 hours. If set to CAMPAIGN_LISTS, the system will only gather the number of attempts made within the leads tied to the lists set to this specific campaign. + +Another setting on the campaign detail page related to this 24-Hour Call Count Limits is "24-Hour Called Count Limit", which can be set to any number 0 or higher. This setting determines the number of calls that can be placed within 24 hours. For example, if this option is set to '1' and a call is placed to a lead at 11:01, then the next time that lead could be called is after 11:01 the next day. The default for this setting is '0'. + +The last setting on the campaign detail page related to this 24-Hour Call Count Limits is "24-Hour Called Count Limit Override", where you can create a Settings Container of the "CALL_LIMITS_OVERRIDE" container type that will allow you to override the 24-Hour Called Count Limit for calls to specific states, based upon the area-code of the phone number being dialed. The area-code-to-state relationship is defined in the internal database which you can access by going to "Admin => System Settings => Phone Codes => Phone Codes". Default for this setting is DISABLED. + +Here is an example CALL_LIMITS_OVERRIDE Container Entry that will work with this setting: +; The only allowed method currently is state_areacode +method => state_areacode +; One line per state, with fields separated by commas: the country abbreviation, state abbreviation and the 24-hour call limit for that state +state => USA,FL,3 +state => USA,GA,4 + + +NOTE: There is no manual dial override for this feature, it will affect all normal customer calls placed within this campaign. +NOTE: If you use this feature with Lead Recycling enabled and the 24-Hour call limit is reached for a recycled lead, the recycling count for that lead will reset to 0 after the 24-Hour call count limit time expires. + + +Why was the "24-Hour Call Count Limits" feature created? + +The short answer is "because of Florida". The long answer is, that in its 2021 legislative session, the Florida Legislature unanimously approved an extension of the existing Telemarketing Regulation law to include several new provisions: +- Reducing call times from 8am-9pm to 8am-8pm +- Limiting the number of call attempts to three(3) per 24-hours +- Requiring "Express Consent" of the people being called by auto-dialers or using recorded messages +- Increased penalties for violations +- Some other small changes + +NOTE: There are dozens of exemptions for some of the above changes. For more information, consult a lawyer that specializes in telecom law. +You can read the actual text of the law at the following link: +https://flsenate.gov/Session/Bill/2021/1120/BillText/er/HTML + +In summary, as of July 1, 2021, anyone calling consumers within Florida on Native Florida Areacode Phone-Numbers(more about that part later) will now need to follow the restrictions of placing no more than three(3) calls to any single phone number for the same issue within any 24-hour period. In our research into this new restriction, we could not find any other governmental body who used the "24-hour" wording for a call attempt limit. The UK has a 72-hour ban on dropped auto-dialed calls for being re-attempted, but that is not an overall attempt limit, and was rather simple to program. But since the "24-hour" wording was used, we could not simply have affected clients use the existing "Daily Call Count Limit" features, since there would be the possibility of running over the three(3) calls per-24-hours limit. So we had to create a whole new set of features to handle this(detailed above). + +Now what about that "Native Florida Areacode Phone-Numbers" part? The law uses the wording "any area code in this state"('this state' meaning Florida) which at the time we're writing this document means the 21 area-codes assigned to the state of Florida by NANPA. Based upon our analysis, this actually leaves out the roughly 15% of Florida citizens who have phone numbers originating in other area-codes. But, this does make the determination of whether you are calling someone affected by this law to be much simpler, since we can just use the existing areacode database within VICIdial(mentioned above) to look up what state the areacode of the phone numbers you are calling belongs to. + +The conclusion of all of this is: If you place sales calls, and you call people at Florida phone numbers, you should set up your system to use the new 24-Hour Call Count Limit feature. At the very least, you should set up a "24-Hour Called Count Limit Override" with one of the "state" entries being "state => USA,FL,3" so that you are not calling any of those phone numbers more than three(3) times in a 24-hour time period. + + + + + + + + + +-------------- FOR DOCUMENTATION PURPOSES ONLY, DO NOT EXECUTE!!! -------------- + +Database changes: + +ALTER TABLE system_settings ADD daily_call_count_limit ENUM('0','1') default '0'; + +ALTER TABLE vicidial_campaigns ADD daily_call_count_limit TINYINT(3) UNSIGNED default '0'; +ALTER TABLE vicidial_campaigns ADD daily_limit_manual VARCHAR(20) default 'DISABLED'; + +CREATE TABLE vicidial_lead_call_daily_counts ( +lead_id INT(9) UNSIGNED NOT NULL, +list_id BIGINT(14) UNSIGNED DEFAULT '0', +called_count_total TINYINT(3) UNSIGNED default '0', +called_count_auto TINYINT(3) UNSIGNED default '0', +called_count_manual TINYINT(3) UNSIGNED default '0', +modify_date DATETIME, +unique index vlcdc_lead (lead_id), +index(list_id) +) ENGINE=MyISAM; + +ALTER TABLE vicidial_list MODIFY called_since_last_reset ENUM('Y','N','Y1','Y2','Y3','Y4','Y5','Y6','Y7','Y8','Y9','Y10','D') default 'N'; + +CREATE TABLE vicidial_lead_24hour_calls ( +lead_id INT(9) UNSIGNED NOT NULL, +list_id BIGINT(14) UNSIGNED DEFAULT '0', +call_date DATETIME, +phone_number VARCHAR(18), +state VARCHAR(2), +call_type ENUM('MANUAL','AUTO','') default '', +index(lead_id), +index(call_date), +index(phone_number) +) ENGINE=MyISAM; + +ALTER TABLE vicidial_campaigns ADD call_limit_24hour_method ENUM('DISABLED','PHONE_NUMBER','LEAD') default 'DISABLED'; +ALTER TABLE vicidial_campaigns ADD call_limit_24hour_scope ENUM('SYSTEM_WIDE','CAMPAIGN_LISTS') default 'SYSTEM_WIDE'; +ALTER TABLE vicidial_campaigns ADD call_limit_24hour TINYINT(3) UNSIGNED default '0'; +ALTER TABLE vicidial_campaigns ADD call_limit_24hour_override VARCHAR(40) default 'DISABLED'; + +ALTER TABLE system_settings ADD call_limit_24hour ENUM('0','1') default '0'; +ALTER TABLE system_settings ADD call_limit_24hour_reset DATETIME default '2000-01-01 00:00:01'; + 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 bdafdf1d..c99faf02 100644 --- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql +++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql @@ -334,7 +334,7 @@ vendor_lead_code VARCHAR(20), source_id VARCHAR(50), list_id BIGINT(14) UNSIGNED NOT NULL DEFAULT '0', gmt_offset_now DECIMAL(4,2) DEFAULT '0.00', -called_since_last_reset ENUM('Y','N','Y1','Y2','Y3','Y4','Y5','Y6','Y7','Y8','Y9','Y10') default 'N', +called_since_last_reset ENUM('Y','N','Y1','Y2','Y3','Y4','Y5','Y6','Y7','Y8','Y9','Y10','D') default 'N', phone_code VARCHAR(10), phone_number VARCHAR(18) NOT NULL, title VARCHAR(4), @@ -1072,7 +1072,11 @@ calls_inqueue_count_one VARCHAR(40) default 'DISABLED', calls_inqueue_count_two VARCHAR(40) default 'DISABLED', in_man_dial_next_ready_seconds SMALLINT(5) UNSIGNED default '0', in_man_dial_next_ready_seconds_override VARCHAR(40) default 'DISABLED', -transfer_no_dispo ENUM('DISABLED','EXTERNAL_ONLY','LOCAL_ONLY','LEAVE3WAY_ONLY','LOCAL_AND_EXTERNAL','LOCAL_AND_LEAVE3WAY','LEAVE3WAY_AND_EXTERNAL','LOCAL_AND_EXTERNAL_AND_LEAVE3WAY') default 'DISABLED' +transfer_no_dispo ENUM('DISABLED','EXTERNAL_ONLY','LOCAL_ONLY','LEAVE3WAY_ONLY','LOCAL_AND_EXTERNAL','LOCAL_AND_LEAVE3WAY','LEAVE3WAY_AND_EXTERNAL','LOCAL_AND_EXTERNAL_AND_LEAVE3WAY') default 'DISABLED', +call_limit_24hour_method ENUM('DISABLED','PHONE_NUMBER','LEAD') default 'DISABLED', +call_limit_24hour_scope ENUM('SYSTEM_WIDE','CAMPAIGN_LISTS') default 'SYSTEM_WIDE', +call_limit_24hour TINYINT(3) UNSIGNED default '0', +call_limit_24hour_override VARCHAR(40) default 'DISABLED' ) ENGINE=MyISAM; CREATE TABLE vicidial_lists ( @@ -1933,7 +1937,9 @@ label_last_local_call_time VARCHAR(60) default '', label_called_count VARCHAR(60) default '', label_rank VARCHAR(60) default '', label_owner VARCHAR(60) default '', -label_entry_list_id VARCHAR(60) default '' +label_entry_list_id VARCHAR(60) default '', +call_limit_24hour ENUM('0','1') default '0', +call_limit_24hour_reset DATETIME default '2000-01-01 00:00:01' ) ENGINE=MyISAM; CREATE TABLE vicidial_campaigns_list_mix ( @@ -4613,6 +4619,51 @@ CAID VARCHAR(50), index (db_time) ) ENGINE=MyISAM; +CREATE TABLE vicidial_lead_24hour_calls ( +lead_id INT(9) UNSIGNED NOT NULL, +list_id BIGINT(14) UNSIGNED DEFAULT '0', +call_date DATETIME, +phone_number VARCHAR(18), +phone_code VARCHAR(10), +state VARCHAR(2), +call_type ENUM('MANUAL','AUTO','') default '', +index(lead_id), +index(call_date), +index(phone_number) +) ENGINE=MyISAM; + +CREATE TABLE `vicidial_khomp_log` ( +`khomp_log_id` int(9) unsigned NOT NULL AUTO_INCREMENT, +`caller_code` varchar(30) COLLATE utf8_unicode_ci NOT NULL, +`lead_id` int(10) unsigned DEFAULT 0, +`server_ip` varchar(15) COLLATE utf8_unicode_ci NOT NULL, +`khomp_header` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, +`khomp_id` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL, +`khomp_id_format` enum('CALLERCODE','CALLERCODE_EXTERNIP','CALLERCODE_CAMP_EXTERNIP') COLLATE utf8_unicode_ci DEFAULT NULL, +`sip_call_id` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL, +`start_date` datetime(6) DEFAULT NULL, +`audio_date` datetime(6) DEFAULT NULL, +`answer_date` datetime(6) DEFAULT NULL, +`end_date` datetime(6) DEFAULT NULL, +`analyzer_date` datetime(6) DEFAULT NULL, +`conclusion` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, +`pattern` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL, +`action` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, +`hangup_origin` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, +`hangup_cause_recv` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, +`hangup_cause_sent` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, +`hangup_auth_time` varchar(20) COLLATE utf8_unicode_ci DEFAULT '0', +`hangup_query_time` varchar(20) COLLATE utf8_unicode_ci DEFAULT '0', +`route_auth_time` varchar(20) COLLATE utf8_unicode_ci DEFAULT '0', +`route_query_time` varchar(20) COLLATE utf8_unicode_ci DEFAULT '0', +`vici_action` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, +`vici_status` varchar(6) COLLATE utf8_unicode_ci DEFAULT NULL, +PRIMARY KEY (`khomp_log_id`), +KEY `caller_code` (`caller_code`), +KEY `start_date` (`start_date`), +KEY `khomp_id` (`khomp_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + ALTER TABLE vicidial_email_list MODIFY message text character set utf8; @@ -4954,4 +5005,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='1638',db_schema_update_date=NOW(),reload_timestamp=NOW(); +UPDATE system_settings SET db_schema_version='1639',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 ca35aeb7..4fcff5f9 100644 --- a/agc_2-X/trunk/extras/upgrade_2.14.sql +++ b/agc_2-X/trunk/extras/upgrade_2.14.sql @@ -1721,3 +1721,60 @@ UPDATE system_settings SET db_schema_version='1637',db_schema_update_date=NOW() ALTER TABLE vicidial_users ADD manual_dial_filter VARCHAR(50) default 'DISABLED'; UPDATE system_settings SET db_schema_version='1638',db_schema_update_date=NOW() where db_schema_version < 1638; + +ALTER TABLE vicidial_list MODIFY called_since_last_reset ENUM('Y','N','Y1','Y2','Y3','Y4','Y5','Y6','Y7','Y8','Y9','Y10','D') default 'N'; + +CREATE TABLE `vicidial_khomp_log` ( +`khomp_log_id` int(9) unsigned NOT NULL AUTO_INCREMENT, +`caller_code` varchar(30) COLLATE utf8_unicode_ci NOT NULL, +`lead_id` int(10) unsigned DEFAULT 0, +`server_ip` varchar(15) COLLATE utf8_unicode_ci NOT NULL, +`khomp_header` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, +`khomp_id` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL, +`khomp_id_format` enum('CALLERCODE','CALLERCODE_EXTERNIP','CALLERCODE_CAMP_EXTERNIP') COLLATE utf8_unicode_ci DEFAULT NULL, +`sip_call_id` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL, +`start_date` datetime(6) DEFAULT NULL, +`audio_date` datetime(6) DEFAULT NULL, +`answer_date` datetime(6) DEFAULT NULL, +`end_date` datetime(6) DEFAULT NULL, +`analyzer_date` datetime(6) DEFAULT NULL, +`conclusion` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, +`pattern` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL, +`action` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, +`hangup_origin` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, +`hangup_cause_recv` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, +`hangup_cause_sent` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, +`hangup_auth_time` varchar(20) COLLATE utf8_unicode_ci DEFAULT '0', +`hangup_query_time` varchar(20) COLLATE utf8_unicode_ci DEFAULT '0', +`route_auth_time` varchar(20) COLLATE utf8_unicode_ci DEFAULT '0', +`route_query_time` varchar(20) COLLATE utf8_unicode_ci DEFAULT '0', +`vici_action` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, +`vici_status` varchar(6) COLLATE utf8_unicode_ci DEFAULT NULL, +PRIMARY KEY (`khomp_log_id`), +KEY `caller_code` (`caller_code`), +KEY `start_date` (`start_date`), +KEY `khomp_id` (`khomp_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +CREATE TABLE vicidial_lead_24hour_calls ( +lead_id INT(9) UNSIGNED NOT NULL, +list_id BIGINT(14) UNSIGNED DEFAULT '0', +call_date DATETIME, +phone_number VARCHAR(18), +phone_code VARCHAR(10), +state VARCHAR(2), +call_type ENUM('MANUAL','AUTO','') default '', +index(lead_id), +index(call_date), +index(phone_number) +) ENGINE=MyISAM; + +ALTER TABLE vicidial_campaigns ADD call_limit_24hour_method ENUM('DISABLED','PHONE_NUMBER','LEAD') default 'DISABLED'; +ALTER TABLE vicidial_campaigns ADD call_limit_24hour_scope ENUM('SYSTEM_WIDE','CAMPAIGN_LISTS') default 'SYSTEM_WIDE'; +ALTER TABLE vicidial_campaigns ADD call_limit_24hour TINYINT(3) UNSIGNED default '0'; +ALTER TABLE vicidial_campaigns ADD call_limit_24hour_override VARCHAR(40) default 'DISABLED'; + +ALTER TABLE system_settings ADD call_limit_24hour ENUM('0','1') default '0'; +ALTER TABLE system_settings ADD call_limit_24hour_reset DATETIME default '2000-01-01 00:00:01'; + +UPDATE system_settings SET db_schema_version='1639',db_schema_update_date=NOW() where db_schema_version < 1639; 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 79c8b03c..a29880f0 100644 --- a/agc_2-X/trunk/www/agc/vdc_db_query.php +++ b/agc_2-X/trunk/www/agc/vdc_db_query.php @@ -512,13 +512,14 @@ # 210616-1906 - Added optional CORS support, see options.php for details # 210625-1351 - Added term_reason as a dispo_call_url variable # 210705-1046 - Added User override for campaign manual_dial_filter setting +# 210713-1344 - Added call_limit_24hour feature support # -$version = '2.14-405'; -$build = '210705-1046'; +$version = '2.14-406'; +$build = '210713-1344'; $php_script = 'vdc_db_query.php'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=850; +$mysql_log_count=863; $one_mysql_log=0; $DB=0; $VD_login=0; @@ -1018,7 +1019,7 @@ $sip_hangup_cause_dictionary = array( ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db,qc_features_active,allow_emails,callback_time_24hour,enable_languages,language_method,agent_debug_logging,default_language,active_modules,allow_chats,default_phone_code,user_new_lead_limit,sip_event_logging,call_quota_lead_ranking,daily_call_count_limit FROM system_settings;"; +$stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db,qc_features_active,allow_emails,callback_time_24hour,enable_languages,language_method,agent_debug_logging,default_language,active_modules,allow_chats,default_phone_code,user_new_lead_limit,sip_event_logging,call_quota_lead_ranking,daily_call_count_limit,call_limit_24hour FROM system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -1048,6 +1049,7 @@ if ($qm_conf_ct > 0) $SSsip_event_logging = $row[19]; $SScall_quota_lead_ranking = $row[20]; $SSdaily_call_count_limit = $row[21]; + $SScall_limit_24hour = $row[22]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -2493,6 +2495,7 @@ if ($ACTION == 'manDiaLnextCaLL') $VLAEDaffected_rows = mysqli_affected_rows($link); echo "OUTSIDE OF LOCAL CALL TIME $VMDQaffected_rows|$VLAEDaffected_rows\n"; + $stage .= "|NOTINCALLTIME|$phone_number|$lead_id|"; if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);} exit; } @@ -2571,6 +2574,7 @@ if ($ACTION == 'manDiaLnextCaLL') $VLAEDaffected_rows = mysqli_affected_rows($link); echo "NUMBER NOT IN CAMPLISTS\n"; + $stage .= "|NOTINCAMPLISTS|$phone_number|$lead_id|"; if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);} exit; } @@ -2621,6 +2625,7 @@ if ($ACTION == 'manDiaLnextCaLL') $VLAEDaffected_rows = mysqli_affected_rows($link); echo "NUMBER NOT IN SYSTEM\n"; + $stage .= "|NOTINSYSTEM|$phone_number|$lead_id|"; if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);} exit; } @@ -2650,6 +2655,7 @@ if ($ACTION == 'manDiaLnextCaLL') $VLAEDaffected_rows = mysqli_affected_rows($link); echo "NUMBER NOT A CALLBACK\n"; + $stage .= "|NOCALLBACK|$phone_number|$lead_id|"; if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);} exit; } @@ -4106,7 +4112,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### BEGIN check for postal_code and phone time zones if alert enabled $post_phone_time_diff_alert_message=''; - $stmt="SELECT post_phone_time_diff_alert,local_call_time,owner_populate,default_xfer_group,daily_call_count_limit,daily_limit_manual FROM vicidial_campaigns where campaign_id='$campaign';"; + $stmt="SELECT post_phone_time_diff_alert,local_call_time,owner_populate,default_xfer_group,daily_call_count_limit,daily_limit_manual,call_limit_24hour_method,call_limit_24hour_scope,call_limit_24hour,call_limit_24hour_override FROM vicidial_campaigns where campaign_id='$campaign';"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00414',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -4120,6 +4126,10 @@ if ($ACTION == 'manDiaLnextCaLL') $default_xfer_group = $row[3]; $daily_call_count_limit = $row[4]; $daily_limit_manual = $row[5]; + $call_limit_24hour_method = $row[6]; + $call_limit_24hour_scope = $row[7]; + $call_limit_24hour = $row[8]; + $call_limit_24hour_override = $row[9]; } if ( ($post_phone_time_diff_alert == 'ENABLED') or (preg_match("/OUTSIDE_CALLTIME/",$post_phone_time_diff_alert)) ) { @@ -4208,6 +4218,29 @@ if ($ACTION == 'manDiaLnextCaLL') ### Daily call count limit check ### manual_dccl_check($lead_id, $no_hopper_dialing_used, 0); + #### BEGIN check for 24-hour call count limit #### + $TFhourSTATE=''; + $TFhourCOUNTRY=''; + if ($SScall_limit_24hour > 0) + { + $TFH_areacode = substr("$agent_dialed_number", 0, 3); + $stmt = "SELECT state,country FROM vicidial_phone_codes where country_code='$phone_code' and areacode='$TFH_areacode';"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00851',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vpc_ct = mysqli_num_rows($rslt); + if ($vpc_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $TFhourSTATE = $row[0]; + $TFhourCOUNTRY = $row[1]; + } + + ### 24-Hour call count limit check ### + manual_tfhccl_check($lead_id, $agent_dialed_number, $phone_code); + } + #### END check for 24-hour call count limit #### + ##### if lead is a callback, grab the callback comments $CBentry_time = ''; $CBcallback_time = ''; @@ -4370,7 +4403,7 @@ if ($ACTION == 'manDiaLnextCaLL') if ( (strlen($preview)<1) or ($preview == 'NO') or (strlen($dial_ingroup) > 1) ) { $use_custom_cid='N'; - $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,manual_dial_cid,daily_call_count_limit,daily_limit_manual 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,manual_dial_cid,daily_call_count_limit,daily_limit_manual,call_limit_24hour_method,call_limit_24hour_scope,call_limit_24hour,call_limit_24hour_override 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";} @@ -4391,6 +4424,10 @@ if ($ACTION == 'manDiaLnextCaLL') $manual_dial_cid = $row[10]; $daily_call_count_limit = $row[11]; $daily_limit_manual = $row[12]; + $call_limit_24hour_method = $row[13]; + $call_limit_24hour_scope = $row[14]; + $call_limit_24hour = $row[15]; + $call_limit_24hour_override = $row[16]; } ### BEGIN check for Dial Timeout Lead Override ### @@ -4794,7 +4831,6 @@ if ($ACTION == 'manDiaLnextCaLL') } #### END check for API forced CID override #### - if ($CCID_on) {$CIDstring = "\"$MqueryCID$EAC\" <$CCID>";} else {$CIDstring = "$MqueryCID$EAC";} @@ -4811,6 +4847,12 @@ if ($ACTION == 'manDiaLnextCaLL') $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00442',$user,$server_ip,$session_name,$one_mysql_log);} + ### log outbound call in the vicidial_lead_24hour_calls log + $stmt = "INSERT INTO vicidial_lead_24hour_calls SET lead_id='$lead_id',list_id='$list_id',call_date=NOW(),phone_number='$agent_dialed_number',phone_code='$phone_code',state='$TFhourSTATE',call_type='MANUAL';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00852',$user,$server_ip,$session_name,$one_mysql_log);} + $calls_todaySQL = ",calls_today='$calls_today'"; ### Skip logging and list overrides if dial in-group is used if (strlen($dial_ingroup) < 1) @@ -5823,7 +5865,7 @@ if ($ACTION == 'manDiaLonly') ### check for manual dial filter and extension append settings in campaign $use_eac=0; $use_custom_cid='N'; - $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,daily_call_count_limit,daily_limit_manual 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,daily_call_count_limit,daily_limit_manual,call_limit_24hour_method,call_limit_24hour_scope,call_limit_24hour,call_limit_24hour_override 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";} @@ -5841,6 +5883,10 @@ if ($ACTION == 'manDiaLonly') $dial_timeout_lead_container = $row[7]; $daily_call_count_limit = $row[8]; $daily_limit_manual = $row[9]; + $call_limit_24hour_method = $row[10]; + $call_limit_24hour_scope = $row[11]; + $call_limit_24hour = $row[12]; + $call_limit_24hour_override = $row[13]; if ($extension_appended_cidname == 'Y') {$use_eac++;} } @@ -5849,7 +5895,7 @@ if ($ACTION == 'manDiaLonly') $VU_manual_dial_filter=''; $stmt = "SELECT manual_dial_filter FROM vicidial_users where user='$user';"; $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 ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00853',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vcstgs_ct = mysqli_num_rows($rslt); if ($vcstgs_ct > 0) @@ -5863,6 +5909,29 @@ if ($ACTION == 'manDiaLonly') ### Daily call count limit check ### manual_dccl_check($lead_id, 0, 1); + #### BEGIN check for 24-hour call count limit #### + $TFhourSTATE=''; + $TFhourCOUNTRY=''; + if ($SScall_limit_24hour > 0) + { + $TFH_areacode = substr("$phone_number", 0, 3); + $stmt = "SELECT state,country FROM vicidial_phone_codes where country_code='$phone_code' and areacode='$TFH_areacode';"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00854',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vpc_ct = mysqli_num_rows($rslt); + if ($vpc_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $TFhourSTATE = $row[0]; + $TFhourCOUNTRY = $row[1]; + } + + ### 24-Hour call count limit check ### + manual_tfhccl_check($lead_id, $phone_number, $phone_code); + } + #### END check for 24-hour call count limit #### + ### BEGIN check phone filtering for DNC or camplists if enabled ### manual_dnc_check($phone_number, 0, 1); @@ -6427,6 +6496,12 @@ if ($ACTION == 'manDiaLonly') $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00045',$user,$server_ip,$session_name,$one_mysql_log);} + ### log outbound call in the vicidial_lead_24hour_calls log + $stmt = "INSERT INTO vicidial_lead_24hour_calls SET lead_id='$lead_id',list_id='$list_id',call_date=NOW(),phone_number='$phone_number',phone_code='$phone_code',state='$TFhourSTATE',call_type='MANUAL';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00855',$user,$server_ip,$session_name,$one_mysql_log);} + ### update the agent status to INCALL in vicidial_live_agents $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today',external_hangup=0,external_status='',external_pause='',external_dial='',last_state_change='$NOW_TIME',pause_code='',preview_lead_id='0' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} @@ -8761,7 +8836,7 @@ if ($stage == "end") $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user,vicidial_id,length_in_sec) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$leave_3way_start_recording_filename','$lead_id','$user','$uniqueid','0')"; if ($format=='debug') {echo "\n";} $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 ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00856',$user,$server_ip,$session_name,$one_mysql_log);} $RLaffected_rows = mysqli_affected_rows($link); if ($RLaffected_rows > 0) { @@ -8773,13 +8848,13 @@ if ($stage == "end") $stmt = "UPDATE recording_log SET filename='$leave_3way_start_recording_filename' where recording_id='$recording_id';"; if ($format=='debug') {echo "\n";} $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 ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00857',$user,$server_ip,$session_name,$one_mysql_log);} $vmgr_callerid = substr($leave_3way_start_recording_filename, 0, 17) . '...'; $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$vmgr_callerid','Channel: $channelrec','Context: $ext_context','Exten: $exten','Priority: 1','Callerid: $leave_3way_start_recording_filename','','','','','');"; if ($format=='debug') {echo "\n";} $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 ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00858',$user,$server_ip,$session_name,$one_mysql_log);} } else { @@ -8787,12 +8862,12 @@ if ($stage == "end") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$vmgr_callerid','Channel: $channelrec','Context: $ext_context','Exten: $exten','Priority: 1','Callerid: $leave_3way_start_recording_filename','','','','','');"; if ($format=='debug') {echo "\n";} $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 ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00859',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user,vicidial_id,length_in_sec) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$leave_3way_start_recording_filename','$lead_id','$user','$uniqueid','0')"; if ($format=='debug') {echo "\n";} $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 ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00860',$user,$server_ip,$session_name,$one_mysql_log);} $RLaffected_rows = mysqli_affected_rows($link); if ($RLaffected_rows > 0) { @@ -20272,4 +20347,133 @@ function manual_dccl_check($temp_lead_id, $temp_no_hopper, $temp_dial_only) } ### END Daily call count limit filtering ### } + + +##### 24-Hour call count limit check ##### +function manual_tfhccl_check($temp_lead_id, $temp_phone_number, $temp_phone_code) + { + global $SScall_limit_24hour, $call_limit_24hour_method, $call_limit_24hour_scope, $call_limit_24hour, $call_limit_24hour_override, $campaign, $user, $link, $NOW_TIME, $mel, $server_ip, $session_name, $one_mysql_log, $SSagent_debug_logging, $startMS, $ACTION, $php_script, $stage, $lead_id, $TFhourSTATE, $TFhourCOUNTRY; + + #$fp = fopen ("./TFHCCLdebug_log.txt", "a"); + #fwrite ($fp, "$NOW_TIME|1 |$temp_lead_id|$temp_phone_number|$temp_phone_code|$TFhourSTATE|$TFhourCOUNTRY|$SScall_limit_24hour|$call_limit_24hour_method|$call_limit_24hour_scope|$call_limit_24hour|$call_limit_24hour_override|\n"); + #fclose($fp); + + #### BEGIN check for 24-hour call count limit #### + + # check if call should be dialed + if ( ($SScall_limit_24hour > 0) && ( (preg_match("/PHONE_NUMBER/",$call_limit_24hour_method)) || (preg_match("/LEAD/",$call_limit_24hour_method)) ) ) + { + $limit_scopeSQL=''; + if (preg_match("/CAMPAIGN_LISTS/",$call_limit_24hour_scope)) + { + $limit_scopeCAMP=''; + $stmt = "SELECT list_id FROM vicidial_lists where campaign_id='$campaign';"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00861',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vlcamp_ct = mysqli_num_rows($rslt); + $rec_campLISTS=0; + while ($vlcamp_ct > $rec_campLISTS) + { + $row=mysqli_fetch_row($rslt); + $limit_scopeCAMP .= "'$row[0]',"; + $rec_campLISTS++; + } + if (strlen($limit_scopeCAMP) < 2) {$limit_scopeCAMP="'1'";} + else {$limit_scopeCAMP = preg_replace("/,$/",'',$limit_scopeCAMP);} + $limit_scopeSQL = "and list_id IN($limit_scopeCAMP)"; + } + if (preg_match("/PHONE_NUMBER/",$call_limit_24hour_method)) + { + $stmt="SELECT count(*) FROM vicidial_lead_24hour_calls where phone_number='$temp_phone_number' and phone_code='$temp_phone_code' and (call_date >= NOW() - INTERVAL 1 DAY) $limit_scopeSQL;"; + } + else + { + $stmt="SELECT count(*) FROM vicidial_lead_24hour_calls where lead_id='$temp_lead_id' and (call_date >= NOW() - INTERVAL 1 DAY) $limit_scopeSQL;"; + } + if ($DB) {echo " Doing 24-Hour Call Count Check: $temp_lead_id|$agent_dialed_number - $call_limit_24hour_method |$stmt|\n";} + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00862',$user,$server_ip,$session_name,$one_mysql_log);} + $vlcamp_ct = mysqli_num_rows($rslt); + $TFhourCOUNT=0; + if ($vlcamp_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $TFhourCOUNT = $row[0]; + } + $TEMPcall_limit_24hour = $call_limit_24hour; + + if ( (!preg_match("/^DISABLED$/",$call_limit_24hour_override)) && (strlen($call_limit_24hour_override) > 0) ) + { + $TEMP_TFhour_OR_entry=''; + $TFH_OR_method='state_areacode'; + $stmt = "SELECT container_entry FROM vicidial_settings_containers where container_id='$call_limit_24hour_override';"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00863',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vpc_ct = mysqli_num_rows($rslt); + if ($vpc_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $TEMP_TFhour_OR_entry = $row[0]; + } + + if ( (strlen($TEMP_TFhour_OR_entry) > 2) and (preg_match("/\n/",$TEMP_TFhour_OR_entry)) ) + { + $container_lines = explode("\n",$TEMP_TFhour_OR_entry); + $container_lines_ct = count($container_lines); + $c=0; + while($container_lines_ct > $c) + { + $container_lines[$c] = preg_replace("/;.*|\r|\t/i",'',$container_lines[$c]); + $container_lines[$c] = preg_replace("/ => |=> | =>/i",'=>',$container_lines[$c]); + if (strlen($container_lines[$c]) > 3) + { + # define core settings + if (preg_match("/^method/i",$container_lines[$c])) + { + $container_lines[$c] = preg_replace("/method=>/i;",'',$container_lines[$c]); + $TFH_OR_method = $container_lines[$c]; + } + else + { + if (preg_match("/^state/i",$container_lines[$c])) + { + $container_lines[$c] = preg_replace("/state=>/i",'',$container_lines[$c]); # USA,GA,4 + $TEMP_state_ARY = explode(",",$container_lines[$c]); + + if ($TFhourCOUNTRY == $TEMP_state_ARY[0]) + { + $TEMP_state_ARY[2] = preg_replace("/\D/",'',$TEMP_state_ARY[2]); + if ( ($TFhourSTATE == $TEMP_state_ARY[1]) && (strlen($TEMP_state_ARY[2]) > 0) ) + { + if ($DB) {echo " 24-Hour Call Count State Override Triggered: $TEMPcall_limit_24hour|$container_lines[$c]\n";} + $TEMPcall_limit_24hour = $TEMP_state_ARY[2]; + } + } + } + } + } + if ($DBX) {echo " 24-Hour Call Count State Override DEBUG: |$container_lines[$c]|\n";} + $c++; + } + } + } + + if ( ($TFhourCOUNT > 0) && ($TFhourCOUNT >= $TEMPcall_limit_24hour) ) + { + $stmt = "UPDATE vicidial_list SET called_since_last_reset='D' where lead_id='$temp_lead_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00847',$user,$server_ip,$session_name,$one_mysql_log);} + $VLAEDaffected_rows = mysqli_affected_rows($link); + + echo "NUMBER OVER 24-HOUR CALL LIMIT, TRY AGAIN\n"; + $stage .= "|24HRLIMIT|$agent_dialed_number|$temp_lead_id|$TFhourCOUNT|$TEMPcall_limit_24hour|"; + if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$temp_lead_id,$session_name,$stmt);} + exit; + } + } + #### END check for 24-hour call count limit #### + } ?> diff --git a/agc_2-X/trunk/www/agc/vicidial.php b/agc_2-X/trunk/www/agc/vicidial.php index 72a67601..6f20b664 100644 --- a/agc_2-X/trunk/www/agc/vicidial.php +++ b/agc_2-X/trunk/www/agc/vicidial.php @@ -677,10 +677,11 @@ # 210705-1038 - Added User override for campaign manual_dial_filter setting # 210705-1626 - Added user_pass_webform and phone_login_webform options.php settings # 210706-0114 - Added display of Call Time Holidays to the Scheduled Callbacks calendar +# 210715-1215 - Added 24-Hour Call Count Limit features # -$version = '2.14-645c'; -$build = '210706-0114'; +$version = '2.14-646c'; +$build = '210715-1215'; $php_script = 'vicidial.php'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=98; @@ -10652,7 +10653,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection) var regMDFvarSYS = new RegExp("SYSTEM","ig"); var regMDFvarCB = new RegExp("CALLBACK","ig"); var regMDFvarTIME = new RegExp("OUTSIDE","ig"); - if ( (MDnextCID.match(regMNCvar)) || (MDnextCID.match(regMDFvarDNC)) || (MDnextCID.match(regMDFvarDCCL)) || (MDnextCID.match(regMDFvarCAMP)) || (MDnextCID.match(regMDFvarSYS)) ||(MDnextCID.match(regMDFvarCB)) || (MDnextCID.match(regMDFvarTIME)) ) + var regMDFvarTFH = new RegExp("24-HOUR CALL LIMIT","ig"); + if ( (MDnextCID.match(regMNCvar)) || (MDnextCID.match(regMDFvarDNC)) || (MDnextCID.match(regMDFvarDCCL)) || (MDnextCID.match(regMDFvarCAMP)) || (MDnextCID.match(regMDFvarSYS)) ||(MDnextCID.match(regMDFvarCB)) || (MDnextCID.match(regMDFvarTIME)) || (MDnextCID.match(regMDFvarTFH)) ) { button_click_log = button_click_log + "" + SQLdate + "-----DialNextFailed---" + MDnextCID + " " + "|"; @@ -10667,27 +10669,65 @@ function set_length(SLnumber,SLlength_goal,SLdirection) if (MDnextCID.match(regMNCvar)) { - alert_box("\n" + campaign); + alert_box("\n" + campaign); alert_displayed=1; in_lead_preview_state=0; // JCJ - This needs to be reset here otherwise the variable stays at 1 and thus manual dials can't be made even if the agent is paused. } if (MDnextCID.match(regMDFvarDNC)) - {alert_box("\n" + mdnPhonENumbeR); alert_displayed=1;} + { + alert_box("\n" + mdnPhonENumbeR); + alert_displayed=1; + in_lead_preview_state=0; + } if (MDnextCID.match(regMDFvarDCCL)) - {alert_box("\n" + mdnPhonENumbeR); alert_displayed=1;} + { + alert_box("\n" + mdnPhonENumbeR); + alert_displayed=1; + in_lead_preview_state=0; + } if (MDnextCID.match(regMDFvarCAMP)) - {alert_box("\n" + mdnPhonENumbeR); alert_displayed=1;} + { + alert_box("\n" + mdnPhonENumbeR); + alert_displayed=1; + in_lead_preview_state=0; + } if (MDnextCID.match(regMDFvarSYS)) - {alert_box("\n" + mdnPhonENumbeR); alert_displayed=1;} + { + alert_box("\n" + mdnPhonENumbeR); + alert_displayed=1; + in_lead_preview_state=0; + } if (MDnextCID.match(regMDFvarCB)) - {alert_box("\n" + mdnPhonENumbeR); alert_displayed=1;} + { + alert_box("\n" + mdnPhonENumbeR); + alert_displayed=1; + in_lead_preview_state=0; + } if (MDnextCID.match(regMDFvarTIME)) - {alert_box("\n" + mdnPhonENumbeR); alert_displayed=1;} + { + alert_box("\n" + mdnPhonENumbeR); + alert_displayed=1; + in_lead_preview_state=0; + } + if (MDnextCID.match(regMDFvarTFH)) + { + alert_box("\n" + mdnPhonENumbeR); + alert_displayed=1; + in_lead_preview_state=0; + } if (MDnextCID.match(regMNHDNCvar)) - {alert_box("\n" + mdnPhonENumbeR); alert_displayed=1;} + { + alert_box("\n" + mdnPhonENumbeR); + alert_displayed=1; + in_lead_preview_state=0; + } if (MDnextCID.match(regMNHDCCLvar)) - {alert_box("\n" + mdnPhonENumbeR); alert_displayed=1;} + { + alert_box("\n" + mdnPhonENumbeR); + alert_displayed=1; + in_lead_preview_state=0; + } if (alert_displayed==0) {alert_box("\n" + mdnPhonENumbeR + "|" + MDnextCID); alert_displayed=1;} diff --git a/agc_2-X/trunk/www/vicidial/AST_agent_status_detail.php b/agc_2-X/trunk/www/vicidial/AST_agent_status_detail.php index e82e34c4..e4e437b5 100644 --- a/agc_2-X/trunk/www/vicidial/AST_agent_status_detail.php +++ b/agc_2-X/trunk/www/vicidial/AST_agent_status_detail.php @@ -376,10 +376,11 @@ if ( (preg_match('/\-\-ALL\-\-/',$user_group_string) ) or ($user_group_ct < 1) ) $user_groupQS .= "&user_group[]=$allowed_user_groups[$i]"; $i++; } - $user_group_SQL = preg_replace('/,$/i', '',$user_group_SQL); - $user_group_SQL = "and ".$agent_log_table.".user_group IN($user_group_SQL)"; } +$user_group_SQL = preg_replace('/,$/i', '',$user_group_SQL); +$user_group_SQL = "and ".$agent_log_table.".user_group IN($user_group_SQL)"; + if ($DB) {echo "$user_group_string|$user_group_ct|$user_groupQS|$i
";} # |5| | 1 | &user_group[]=5 | 1 $stmt="SELECT vsc_id,vsc_name from vicidial_status_categories;"; diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index 3ed64566..b8f81dab 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -2658,6 +2658,14 @@ if (isset($_GET["in_man_dial_next_ready_seconds_override"])) {$in_man_dial_nex elseif (isset($_POST["in_man_dial_next_ready_seconds_override"])) {$in_man_dial_next_ready_seconds_override=$_POST["in_man_dial_next_ready_seconds_override"];} if (isset($_GET["transfer_no_dispo"])) {$transfer_no_dispo=$_GET["transfer_no_dispo"];} elseif (isset($_POST["transfer_no_dispo"])) {$transfer_no_dispo=$_POST["transfer_no_dispo"];} +if (isset($_GET["call_limit_24hour_method"])) {$call_limit_24hour_method=$_GET["call_limit_24hour_method"];} + elseif (isset($_POST["call_limit_24hour_method"])) {$call_limit_24hour_method=$_POST["call_limit_24hour_method"];} +if (isset($_GET["call_limit_24hour_scope"])) {$call_limit_24hour_scope=$_GET["call_limit_24hour_scope"];} + elseif (isset($_POST["call_limit_24hour_scope"])) {$call_limit_24hour_scope=$_POST["call_limit_24hour_scope"];} +if (isset($_GET["call_limit_24hour"])) {$call_limit_24hour=$_GET["call_limit_24hour"];} + elseif (isset($_POST["call_limit_24hour"])) {$call_limit_24hour=$_POST["call_limit_24hour"];} +if (isset($_GET["call_limit_24hour_override"])) {$call_limit_24hour_override=$_GET["call_limit_24hour_override"];} + elseif (isset($_POST["call_limit_24hour_override"])) {$call_limit_24hour_override=$_POST["call_limit_24hour_override"];} if (isset($script_id)) {$script_id= mb_strtoupper($script_id,'utf-8');} @@ -2672,7 +2680,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,did_system_filter,enable_gdpr_download_deletion,mute_recordings,user_admin_redirect,list_status_modification_confirmation,sip_event_logging,call_quota_lead_ranking,enable_second_script,enable_first_webform,recording_buttons,opensips_cid_name,require_password_length,user_account_emails,outbound_cid_any,entries_per_page,browser_call_alerts,inbound_answer_config,enable_international_dncs,daily_call_count_limit,allow_shared_dial,agent_search_method,admin_home_url,qc_claim_limit,qc_expire_days,two_factor_auth_hours,two_factor_container 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,enable_gdpr_download_deletion,mute_recordings,user_admin_redirect,list_status_modification_confirmation,sip_event_logging,call_quota_lead_ranking,enable_second_script,enable_first_webform,recording_buttons,opensips_cid_name,require_password_length,user_account_emails,outbound_cid_any,entries_per_page,browser_call_alerts,inbound_answer_config,enable_international_dncs,daily_call_count_limit,allow_shared_dial,agent_search_method,admin_home_url,qc_claim_limit,qc_expire_days,two_factor_auth_hours,two_factor_container,call_limit_24hour FROM system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysqli_num_rows($rslt); @@ -2778,6 +2786,7 @@ if ($qm_conf_ct > 0) $SSqc_expire_days = $row[96]; $SStwo_factor_auth_hours = $row[97]; $SStwo_factor_container = $row[98]; + $SScall_limit_24hour = $row[99]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -3140,6 +3149,7 @@ $auth_entry = preg_replace('/[^0-9]/','',$auth_entry); $agent_hidden_sound_volume = preg_replace('/[^0-9]/','',$agent_hidden_sound_volume); $agent_hidden_sound_seconds = preg_replace('/[^0-9]/','',$agent_hidden_sound_seconds); $in_man_dial_next_ready_seconds = preg_replace('/[^0-9]/','',$in_man_dial_next_ready_seconds); +$call_limit_24hour = preg_replace('/[^0-9]/','',$call_limit_24hour); $user_new_lead_limit = preg_replace('/[^-0-9]/','',$user_new_lead_limit); $drop_call_seconds = preg_replace('/[^-0-9]/','',$drop_call_seconds); @@ -3741,6 +3751,9 @@ if ($non_latin < 1) $calls_inqueue_count_two = preg_replace('/[^-_0-9a-zA-Z]/','',$calls_inqueue_count_two); $drop_call_seconds_override = preg_replace('/[^-_0-9a-zA-Z]/','',$drop_call_seconds_override); $in_man_dial_next_ready_seconds_override = preg_replace('/[^-_0-9a-zA-Z]/','',$in_man_dial_next_ready_seconds_override); + $call_limit_24hour_method = preg_replace('/[^-_0-9a-zA-Z]/','',$call_limit_24hour_method); + $call_limit_24hour_scope = preg_replace('/[^-_0-9a-zA-Z]/','',$call_limit_24hour_scope); + $call_limit_24hour_override = preg_replace('/[^-_0-9a-zA-Z]/','',$call_limit_24hour_override); ### ALPHA-NUMERIC and underscore $qc_statuses_id = preg_replace('/[^_0-9a-zA-Z]/','',$qc_statuses_id); @@ -4448,6 +4461,9 @@ else $calls_inqueue_count_two = preg_replace('/[^-_0-9\p{L}]/u','',$calls_inqueue_count_two); $drop_call_seconds_override = preg_replace('/[^-_0-9\p{L}]/u','',$drop_call_seconds_override); $in_man_dial_next_ready_seconds_override = preg_replace('/[^-_0-9\p{L}]/u','',$in_man_dial_next_ready_seconds_override); + $call_limit_24hour_method = preg_replace('/[^-_0-9\p{L}]/u','',$call_limit_24hour_method); + $call_limit_24hour_scope = preg_replace('/[^-_0-9\p{L}]/u','',$call_limit_24hour_scope); + $call_limit_24hour_override = preg_replace('/[^-_0-9\p{L}]/u','',$call_limit_24hour_override); ### ALPHA-NUMERIC and underscore and dash and slash and dot $menu_timeout_prompt = preg_replace('/[^-\/\|\._0-9\p{L}]/u','',$menu_timeout_prompt); @@ -5678,12 +5694,13 @@ if ($SSscript_remove_js > 0) # 210706-0128 - Added display of Call Time Holidays to the agent screen Scheduled Callbacks calendar # 210707-0731 - Added display of phone codes and postal codes, linked from System Settings page # 210712-1733 - Allow brackets and spaces in Filter Phone Group numbers([ ]) +# 210715-1248 - Added call_limit_24hour campaign settings # # 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-821a'; -$build = '210712-1733'; +$admin_version = '2.14-822a'; +$build = '210715-1248'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -10784,6 +10801,7 @@ if ($ADD==192111111111) + @@ -11867,7 +11885,7 @@ if ($ADD==20) $rslt=mysql_to_mysqli($stmtX, $link); } - $stmt="INSERT INTO vicidial_campaigns (campaign_name,campaign_id,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_resume_precall,auto_pause_precall_code,manual_dial_cid,post_phone_time_diff_alert,custom_3way_button_transfer,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents,safe_harbor_audio,safe_harbor_menu_id,survey_menu_id,callback_days_limit,dl_diff_target_method,disable_dispo_screen,disable_dispo_status,screen_labels,status_display_fields,na_call_url,survey_recording,pllb_grouping,pllb_grouping_limit,call_count_limit,call_count_target,callback_hours_block,callback_list_calltime,user_group,hopper_vlc_dup_check,safe_harbor_audio_field,pause_after_next_call,owner_populate,use_other_campaign_dnc,allow_emails,allow_chats,amd_inbound_group,amd_callmenu,survey_wait_sec,manual_dial_lead_id,dead_max,dispo_max,pause_max,dead_max_dispo,dispo_max_dispo,max_inbound_calls,manual_dial_search_checkbox,hide_call_log_info,timer_alt_seconds,wrapup_bypass,wrapup_after_hotkey,callback_active_limit,callback_active_limit_override,comments_all_tabs,comments_dispo_screen,comments_callback_screen,qc_comment_history,show_previous_callback,clear_script,cpd_unknown_action,manual_dial_search_filter,web_form_address_three,manual_dial_override_field,status_display_ingroup,customer_gone_seconds,agent_display_fields,am_message_wildcards,manual_dial_timeout,routing_initiated_recordings,manual_dial_hopper_check,callback_useronly_move_minutes,ofcom_uk_drop_calc,manual_auto_next,manual_auto_show,allow_required_fields,dead_to_dispo,agent_xfer_validation,ready_max_logout,callback_display_days,three_way_record_stop,hangup_xfer_record_start,scheduled_callbacks_email_alert,max_inbound_calls_outcome,manual_auto_next_options,agent_screen_time_display,next_dial_my_callbacks,inbound_no_agents_no_dial_container,inbound_no_agents_no_dial_threshold,cid_group_id,pause_max_dispo,script_top_dispo,dead_trigger_seconds,dead_trigger_action,dead_trigger_repeat,dead_trigger_filename,dead_trigger_url,scheduled_callbacks_force_dial,scheduled_callbacks_auto_reschedule,scheduled_callbacks_timezones_container,three_way_volume_buttons,callback_dnc,manual_dial_validation,mute_recordings,auto_active_list_new,call_quota_lead_ranking,sip_event_logging,campaign_script_two,leave_vm_no_dispo,leave_vm_message_group_id,dial_timeout_lead_container,amd_type,vmm_daily_limit,opensips_cid_name,amd_agent_route_options,browser_alert_sound,browser_alert_volume,three_way_record_stop_exception,in_group_dial,pause_max_exceptions,hopper_drop_run_trigger,daily_call_count_limit,daily_limit_manual,transfer_button_launch,shared_dial_rank,agent_search_method,qc_scorecard_id,qc_statuses_id,clear_form,leave_3way_start_recording,leave_3way_start_recording_exception,calls_waiting_vl_one,calls_waiting_vl_two,calls_inqueue_count_one,calls_inqueue_count_two,in_man_dial_next_ready_seconds,in_man_dial_next_ready_seconds_override,transfer_no_dispo) SELECT \"$campaign_name\",\"$campaign_id\",\"N\",dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,\"DISABLED\",campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_resume_precall,auto_pause_precall_code,manual_dial_cid,post_phone_time_diff_alert,custom_3way_button_transfer,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents,safe_harbor_audio,safe_harbor_menu_id,survey_menu_id,callback_days_limit,dl_diff_target_method,disable_dispo_screen,disable_dispo_status,screen_labels,status_display_fields,na_call_url,survey_recording,pllb_grouping,pllb_grouping_limit,call_count_limit,call_count_target,callback_hours_block,callback_list_calltime,user_group,hopper_vlc_dup_check,safe_harbor_audio_field,pause_after_next_call,owner_populate,use_other_campaign_dnc,allow_emails,allow_chats,amd_inbound_group,amd_callmenu,survey_wait_sec,manual_dial_lead_id,dead_max,dispo_max,pause_max,dead_max_dispo,dispo_max_dispo,max_inbound_calls,manual_dial_search_checkbox,hide_call_log_info,timer_alt_seconds,wrapup_bypass,wrapup_after_hotkey,callback_active_limit,callback_active_limit_override,comments_all_tabs,comments_dispo_screen,comments_callback_screen,qc_comment_history,show_previous_callback,clear_script,cpd_unknown_action,manual_dial_search_filter,web_form_address_three,manual_dial_override_field,status_display_ingroup,customer_gone_seconds,agent_display_fields,am_message_wildcards,manual_dial_timeout,routing_initiated_recordings,manual_dial_hopper_check,callback_useronly_move_minutes,ofcom_uk_drop_calc,manual_auto_next,manual_auto_show,allow_required_fields,dead_to_dispo,agent_xfer_validation,ready_max_logout,callback_display_days,three_way_record_stop,hangup_xfer_record_start,scheduled_callbacks_email_alert,max_inbound_calls_outcome,manual_auto_next_options,agent_screen_time_display,next_dial_my_callbacks,inbound_no_agents_no_dial_container,inbound_no_agents_no_dial_threshold,cid_group_id,pause_max_dispo,script_top_dispo,dead_trigger_seconds,dead_trigger_action,dead_trigger_repeat,dead_trigger_filename,dead_trigger_url,scheduled_callbacks_force_dial,scheduled_callbacks_auto_reschedule,scheduled_callbacks_timezones_container,three_way_volume_buttons,callback_dnc,manual_dial_validation,mute_recordings,auto_active_list_new,call_quota_lead_ranking,sip_event_logging,campaign_script_two,leave_vm_no_dispo,leave_vm_message_group_id,dial_timeout_lead_container,amd_type,vmm_daily_limit,opensips_cid_name,amd_agent_route_options,browser_alert_sound,browser_alert_volume,three_way_record_stop_exception,in_group_dial,pause_max_exceptions,hopper_drop_run_trigger,daily_call_count_limit,daily_limit_manual,transfer_button_launch,shared_dial_rank,agent_search_method,qc_scorecard_id,qc_statuses_id,clear_form,leave_3way_start_recording,leave_3way_start_recording_exception,calls_waiting_vl_one,calls_waiting_vl_two,calls_inqueue_count_one,calls_inqueue_count_two,in_man_dial_next_ready_seconds,in_man_dial_next_ready_seconds_override,transfer_no_dispo from vicidial_campaigns where campaign_id='$source_campaign_id';"; + $stmt="INSERT INTO vicidial_campaigns (campaign_name,campaign_id,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_resume_precall,auto_pause_precall_code,manual_dial_cid,post_phone_time_diff_alert,custom_3way_button_transfer,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents,safe_harbor_audio,safe_harbor_menu_id,survey_menu_id,callback_days_limit,dl_diff_target_method,disable_dispo_screen,disable_dispo_status,screen_labels,status_display_fields,na_call_url,survey_recording,pllb_grouping,pllb_grouping_limit,call_count_limit,call_count_target,callback_hours_block,callback_list_calltime,user_group,hopper_vlc_dup_check,safe_harbor_audio_field,pause_after_next_call,owner_populate,use_other_campaign_dnc,allow_emails,allow_chats,amd_inbound_group,amd_callmenu,survey_wait_sec,manual_dial_lead_id,dead_max,dispo_max,pause_max,dead_max_dispo,dispo_max_dispo,max_inbound_calls,manual_dial_search_checkbox,hide_call_log_info,timer_alt_seconds,wrapup_bypass,wrapup_after_hotkey,callback_active_limit,callback_active_limit_override,comments_all_tabs,comments_dispo_screen,comments_callback_screen,qc_comment_history,show_previous_callback,clear_script,cpd_unknown_action,manual_dial_search_filter,web_form_address_three,manual_dial_override_field,status_display_ingroup,customer_gone_seconds,agent_display_fields,am_message_wildcards,manual_dial_timeout,routing_initiated_recordings,manual_dial_hopper_check,callback_useronly_move_minutes,ofcom_uk_drop_calc,manual_auto_next,manual_auto_show,allow_required_fields,dead_to_dispo,agent_xfer_validation,ready_max_logout,callback_display_days,three_way_record_stop,hangup_xfer_record_start,scheduled_callbacks_email_alert,max_inbound_calls_outcome,manual_auto_next_options,agent_screen_time_display,next_dial_my_callbacks,inbound_no_agents_no_dial_container,inbound_no_agents_no_dial_threshold,cid_group_id,pause_max_dispo,script_top_dispo,dead_trigger_seconds,dead_trigger_action,dead_trigger_repeat,dead_trigger_filename,dead_trigger_url,scheduled_callbacks_force_dial,scheduled_callbacks_auto_reschedule,scheduled_callbacks_timezones_container,three_way_volume_buttons,callback_dnc,manual_dial_validation,mute_recordings,auto_active_list_new,call_quota_lead_ranking,sip_event_logging,campaign_script_two,leave_vm_no_dispo,leave_vm_message_group_id,dial_timeout_lead_container,amd_type,vmm_daily_limit,opensips_cid_name,amd_agent_route_options,browser_alert_sound,browser_alert_volume,three_way_record_stop_exception,in_group_dial,pause_max_exceptions,hopper_drop_run_trigger,daily_call_count_limit,daily_limit_manual,transfer_button_launch,shared_dial_rank,agent_search_method,qc_scorecard_id,qc_statuses_id,clear_form,leave_3way_start_recording,leave_3way_start_recording_exception,calls_waiting_vl_one,calls_waiting_vl_two,calls_inqueue_count_one,calls_inqueue_count_two,in_man_dial_next_ready_seconds,in_man_dial_next_ready_seconds_override,transfer_no_dispo,call_limit_24hour_method,call_limit_24hour_scope,call_limit_24hour,call_limit_24hour_override) SELECT \"$campaign_name\",\"$campaign_id\",\"N\",dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,\"DISABLED\",campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_resume_precall,auto_pause_precall_code,manual_dial_cid,post_phone_time_diff_alert,custom_3way_button_transfer,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents,safe_harbor_audio,safe_harbor_menu_id,survey_menu_id,callback_days_limit,dl_diff_target_method,disable_dispo_screen,disable_dispo_status,screen_labels,status_display_fields,na_call_url,survey_recording,pllb_grouping,pllb_grouping_limit,call_count_limit,call_count_target,callback_hours_block,callback_list_calltime,user_group,hopper_vlc_dup_check,safe_harbor_audio_field,pause_after_next_call,owner_populate,use_other_campaign_dnc,allow_emails,allow_chats,amd_inbound_group,amd_callmenu,survey_wait_sec,manual_dial_lead_id,dead_max,dispo_max,pause_max,dead_max_dispo,dispo_max_dispo,max_inbound_calls,manual_dial_search_checkbox,hide_call_log_info,timer_alt_seconds,wrapup_bypass,wrapup_after_hotkey,callback_active_limit,callback_active_limit_override,comments_all_tabs,comments_dispo_screen,comments_callback_screen,qc_comment_history,show_previous_callback,clear_script,cpd_unknown_action,manual_dial_search_filter,web_form_address_three,manual_dial_override_field,status_display_ingroup,customer_gone_seconds,agent_display_fields,am_message_wildcards,manual_dial_timeout,routing_initiated_recordings,manual_dial_hopper_check,callback_useronly_move_minutes,ofcom_uk_drop_calc,manual_auto_next,manual_auto_show,allow_required_fields,dead_to_dispo,agent_xfer_validation,ready_max_logout,callback_display_days,three_way_record_stop,hangup_xfer_record_start,scheduled_callbacks_email_alert,max_inbound_calls_outcome,manual_auto_next_options,agent_screen_time_display,next_dial_my_callbacks,inbound_no_agents_no_dial_container,inbound_no_agents_no_dial_threshold,cid_group_id,pause_max_dispo,script_top_dispo,dead_trigger_seconds,dead_trigger_action,dead_trigger_repeat,dead_trigger_filename,dead_trigger_url,scheduled_callbacks_force_dial,scheduled_callbacks_auto_reschedule,scheduled_callbacks_timezones_container,three_way_volume_buttons,callback_dnc,manual_dial_validation,mute_recordings,auto_active_list_new,call_quota_lead_ranking,sip_event_logging,campaign_script_two,leave_vm_no_dispo,leave_vm_message_group_id,dial_timeout_lead_container,amd_type,vmm_daily_limit,opensips_cid_name,amd_agent_route_options,browser_alert_sound,browser_alert_volume,three_way_record_stop_exception,in_group_dial,pause_max_exceptions,hopper_drop_run_trigger,daily_call_count_limit,daily_limit_manual,transfer_button_launch,shared_dial_rank,agent_search_method,qc_scorecard_id,qc_statuses_id,clear_form,leave_3way_start_recording,leave_3way_start_recording_exception,calls_waiting_vl_one,calls_waiting_vl_two,calls_inqueue_count_one,calls_inqueue_count_two,in_man_dial_next_ready_seconds,in_man_dial_next_ready_seconds_override,transfer_no_dispo,call_limit_24hour_method,call_limit_24hour_scope,call_limit_24hour,call_limit_24hour_override from vicidial_campaigns where campaign_id='$source_campaign_id';"; $rslt=mysql_to_mysqli($stmt, $link); $affected_rows = mysqli_affected_rows($link); @@ -16448,7 +16466,7 @@ if ($ADD==41) $hdrtMESSAGE='Hopper All-Drops-Run Triggered'; } - $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', auto_trim_hopper='$auto_trim_hopper', use_auto_hopper='$use_auto_hopper', auto_hopper_multi='$auto_hopper_multi', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysqli_real_escape_string($link, $web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns=$closer_campaignsSQL,use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_refresh='$campaign_stats_refresh',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial',use_campaign_dnc='$use_campaign_dnc',three_way_call_cid='$three_way_call_cid',three_way_dial_prefix='$three_way_dial_prefix',web_form_target='$web_form_target',vtiger_search_category='$vtiger_search_category',vtiger_create_call_record='$vtiger_create_call_record',vtiger_create_lead_record='$vtiger_create_lead_record',vtiger_screen_login='$vtiger_screen_login',cpd_amd_action='$cpd_amd_action',agent_allow_group_alias='$agent_allow_group_alias',default_group_alias='$default_group_alias',vtiger_search_dead='$vtiger_search_dead',vtiger_status_call='$vtiger_status_call',drop_lockout_time='$drop_lockout_time',quick_transfer_button='$quick_transfer_button',prepopulate_transfer_preset='$prepopulate_transfer_preset',drop_rate_group='$drop_rate_group',view_calls_in_queue='$view_calls_in_queue',view_calls_in_queue_launch='$view_calls_in_queue_launch',grab_calls_in_queue='$grab_calls_in_queue',call_requeue_button='$call_requeue_button',pause_after_each_call='$pause_after_each_call',no_hopper_dialing='$no_hopper_dialing',agent_dial_owner_only='$agent_dial_owner_only',agent_display_dialable_leads='$agent_display_dialable_leads',web_form_address_two='" . mysqli_real_escape_string($link, $web_form_address_two) . "',waitforsilence_options='$waitforsilence_options',agent_select_territories='$agent_select_territories',crm_popup_login='$crm_popup_login',crm_login_address='" . mysqli_real_escape_string($link, $crm_login_address) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysqli_real_escape_string($link, $start_call_url) . "',dispo_call_url='" . mysqli_real_escape_string($link, $dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',use_custom_cid='$use_custom_cid',scheduled_callbacks_alert='$scheduled_callbacks_alert',queuemetrics_callstatus_override='$queuemetrics_callstatus',extension_appended_cidname='$extension_appended_cidname',scheduled_callbacks_count='$scheduled_callbacks_count',manual_dial_override='$manual_dial_override',blind_monitor_warning='$blind_monitor_warning',blind_monitor_message='" . mysqli_real_escape_string($link, $blind_monitor_message) . "',blind_monitor_filename='$blind_monitor_filename',inbound_queue_no_dial='$inbound_queue_no_dial',timer_action_destination='$timer_action_destination',enable_xfer_presets='$enable_xfer_presets',hide_xfer_number_to_dial='$hide_xfer_number_to_dial',manual_dial_prefix='$manual_dial_prefix',customer_3way_hangup_logging='$customer_3way_hangup_logging',customer_3way_hangup_seconds='$customer_3way_hangup_seconds',customer_3way_hangup_action='$customer_3way_hangup_action',ivr_park_call='$ivr_park_call',ivr_park_call_agi='$ivr_park_call_agi',manual_preview_dial='$manual_preview_dial',realtime_agent_time_stats='$realtime_agent_time_stats',api_manual_dial='$api_manual_dial',manual_dial_call_time_check='$manual_dial_call_time_check',lead_order_randomize='$lead_order_randomize',lead_order_secondary='$lead_order_secondary',per_call_notes='$per_call_notes',my_callback_option='$my_callback_option',agent_lead_search='$agent_lead_search',agent_lead_search_method='$agent_lead_search_method',queuemetrics_phone_environment='$queuemetrics_phone_environment',auto_pause_precall='$auto_pause_precall',auto_resume_precall='$auto_resume_precall',auto_pause_precall_code='$auto_pause_precall_code',manual_dial_cid='$manual_dial_cid',post_phone_time_diff_alert='$post_phone_time_diff_alert',custom_3way_button_transfer='$custom_3way_button_transfer',available_only_tally_threshold='$available_only_tally_threshold',available_only_tally_threshold_agents='$available_only_tally_threshold_agents',dial_level_threshold='$dial_level_threshold',dial_level_threshold_agents='$dial_level_threshold_agents',safe_harbor_audio='$safe_harbor_audio',safe_harbor_menu_id='$safe_harbor_menu_id',callback_days_limit='$callback_days_limit',dl_diff_target_method='$dl_diff_target_method',disable_dispo_screen='$disable_dispo_screen',disable_dispo_status='$disable_dispo_status',screen_labels='$screen_labels',status_display_fields='$status_display_fields',na_call_url='" . mysqli_real_escape_string($link, $na_call_url) . "',pllb_grouping='$pllb_grouping',pllb_grouping_limit='$pllb_grouping_limit',call_count_limit='$call_count_limit',call_count_target='$call_count_target',callback_hours_block='$callback_hours_block',callback_list_calltime='$callback_list_calltime',user_group='$user_group',hopper_vlc_dup_check='$hopper_vlc_dup_check',in_group_dial='$in_group_dial',in_group_dial_select='$in_group_dial_select',safe_harbor_audio_field='$safe_harbor_audio_field',pause_after_next_call='$pause_after_next_call',owner_populate='$owner_populate',use_other_campaign_dnc='$use_other_campaign_dnc',allow_emails='$allow_emails',allow_chats='$allow_chats',amd_inbound_group='$amd_inbound_group',amd_callmenu='$amd_callmenu',manual_dial_lead_id='$manual_dial_lead_id',dead_max='$dead_max',dispo_max='$dispo_max',pause_max='$pause_max',dead_max_dispo='$dead_max_dispo',dispo_max_dispo='$dispo_max_dispo',max_inbound_calls='$max_inbound_calls',manual_dial_search_checkbox='$manual_dial_search_checkbox',hide_call_log_info='$hide_call_log_info',timer_alt_seconds='$timer_alt_seconds',wrapup_bypass='$wrapup_bypass',wrapup_after_hotkey='$wrapup_after_hotkey',callback_active_limit='$callback_active_limit',callback_active_limit_override='$callback_active_limit_override',comments_all_tabs='$comments_all_tabs',comments_dispo_screen='$comments_dispo_screen',comments_callback_screen='$comments_callback_screen',qc_comment_history='$qc_comment_history',show_previous_callback='$show_previous_callback',clear_script='$clear_script',cpd_unknown_action='$cpd_unknown_action',manual_dial_search_filter='$manual_dial_search_filter',web_form_address_three='" . mysqli_real_escape_string($link, $web_form_address_three) . "',manual_dial_override_field='$manual_dial_override_field',status_display_ingroup='$status_display_ingroup',customer_gone_seconds='$customer_gone_seconds',agent_display_fields='$agent_display_fields',am_message_wildcards='$am_message_wildcards',manual_dial_timeout='$manual_dial_timeout',routing_initiated_recordings='$routing_initiated_recordings',manual_dial_hopper_check='$manual_dial_hopper_check',callback_useronly_move_minutes='$callback_useronly_move_minutes',ofcom_uk_drop_calc='$ofcom_uk_drop_calc',manual_auto_next='$manual_auto_next',manual_auto_show='$manual_auto_show',allow_required_fields='$allow_required_fields',dead_to_dispo='$dead_to_dispo',agent_xfer_validation='$agent_xfer_validation',ready_max_logout='$ready_max_logout',callback_display_days='$callback_display_days',three_way_record_stop='$three_way_record_stop',hangup_xfer_record_start='$hangup_xfer_record_start',scheduled_callbacks_email_alert='$scheduled_callbacks_email_alert',max_inbound_calls_outcome='$max_inbound_calls_outcome',manual_auto_next_options='$manual_auto_next_options',agent_screen_time_display='$agent_screen_time_display',next_dial_my_callbacks='$next_dial_my_callbacks',inbound_no_agents_no_dial_container='$inbound_no_agents_no_dial_container',inbound_no_agents_no_dial_threshold='$inbound_no_agents_no_dial_threshold',cid_group_id='$cid_group_id',pause_max_dispo='$pause_max_dispo',script_top_dispo='$script_top_dispo',dead_trigger_seconds='$dead_trigger_seconds',dead_trigger_action='$dead_trigger_action',dead_trigger_repeat='$dead_trigger_repeat',dead_trigger_filename='$dead_trigger_filename',dead_trigger_url='" . mysqli_real_escape_string($link, $dead_trigger_url) . "',scheduled_callbacks_force_dial='$scheduled_callbacks_force_dial',scheduled_callbacks_auto_reschedule='$scheduled_callbacks_auto_reschedule',scheduled_callbacks_timezones_container='$scheduled_callbacks_timezones_container',three_way_volume_buttons='$three_way_volume_buttons',callback_dnc='$callback_dnc',manual_dial_validation='$manual_dial_validation',mute_recordings='$mute_recordings',auto_active_list_new='$auto_active_list_new',call_quota_lead_ranking='$call_quota_lead_ranking',sip_event_logging='$sip_event_logging',campaign_script_two='$campaign_script_two',leave_vm_no_dispo='$leave_vm_no_dispo',leave_vm_message_group_id='$leave_vm_message_group_id',dial_timeout_lead_container='$dial_timeout_lead_container',amd_type='$amd_type',vmm_daily_limit='$vmm_daily_limit',opensips_cid_name='$opensips_cid_name',amd_agent_route_options='$amd_agent_route_options',browser_alert_sound='$browser_alert_sound',browser_alert_volume='$browser_alert_volume',three_way_record_stop_exception='$three_way_record_stop_exception',pause_max_exceptions='$pause_max_exceptions',daily_call_count_limit='$daily_call_count_limit',daily_limit_manual='$daily_limit_manual',transfer_button_launch='$transfer_button_launch',shared_dial_rank='$shared_dial_rank',agent_search_method='$agent_search_method',clear_form='$clear_form',leave_3way_start_recording='$leave_3way_start_recording',leave_3way_start_recording_exception='$leave_3way_start_recording_exception',calls_waiting_vl_one='$calls_waiting_vl_one',calls_waiting_vl_two='$calls_waiting_vl_two',calls_inqueue_count_one='$calls_inqueue_count_one',calls_inqueue_count_two='$calls_inqueue_count_two',in_man_dial_next_ready_seconds='$in_man_dial_next_ready_seconds',in_man_dial_next_ready_seconds_override='$in_man_dial_next_ready_seconds_override',transfer_no_dispo='$transfer_no_dispo'$hdrtSQL where campaign_id='$campaign_id';"; + $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', auto_trim_hopper='$auto_trim_hopper', use_auto_hopper='$use_auto_hopper', auto_hopper_multi='$auto_hopper_multi', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysqli_real_escape_string($link, $web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns=$closer_campaignsSQL,use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_refresh='$campaign_stats_refresh',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial',use_campaign_dnc='$use_campaign_dnc',three_way_call_cid='$three_way_call_cid',three_way_dial_prefix='$three_way_dial_prefix',web_form_target='$web_form_target',vtiger_search_category='$vtiger_search_category',vtiger_create_call_record='$vtiger_create_call_record',vtiger_create_lead_record='$vtiger_create_lead_record',vtiger_screen_login='$vtiger_screen_login',cpd_amd_action='$cpd_amd_action',agent_allow_group_alias='$agent_allow_group_alias',default_group_alias='$default_group_alias',vtiger_search_dead='$vtiger_search_dead',vtiger_status_call='$vtiger_status_call',drop_lockout_time='$drop_lockout_time',quick_transfer_button='$quick_transfer_button',prepopulate_transfer_preset='$prepopulate_transfer_preset',drop_rate_group='$drop_rate_group',view_calls_in_queue='$view_calls_in_queue',view_calls_in_queue_launch='$view_calls_in_queue_launch',grab_calls_in_queue='$grab_calls_in_queue',call_requeue_button='$call_requeue_button',pause_after_each_call='$pause_after_each_call',no_hopper_dialing='$no_hopper_dialing',agent_dial_owner_only='$agent_dial_owner_only',agent_display_dialable_leads='$agent_display_dialable_leads',web_form_address_two='" . mysqli_real_escape_string($link, $web_form_address_two) . "',waitforsilence_options='$waitforsilence_options',agent_select_territories='$agent_select_territories',crm_popup_login='$crm_popup_login',crm_login_address='" . mysqli_real_escape_string($link, $crm_login_address) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysqli_real_escape_string($link, $start_call_url) . "',dispo_call_url='" . mysqli_real_escape_string($link, $dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',use_custom_cid='$use_custom_cid',scheduled_callbacks_alert='$scheduled_callbacks_alert',queuemetrics_callstatus_override='$queuemetrics_callstatus',extension_appended_cidname='$extension_appended_cidname',scheduled_callbacks_count='$scheduled_callbacks_count',manual_dial_override='$manual_dial_override',blind_monitor_warning='$blind_monitor_warning',blind_monitor_message='" . mysqli_real_escape_string($link, $blind_monitor_message) . "',blind_monitor_filename='$blind_monitor_filename',inbound_queue_no_dial='$inbound_queue_no_dial',timer_action_destination='$timer_action_destination',enable_xfer_presets='$enable_xfer_presets',hide_xfer_number_to_dial='$hide_xfer_number_to_dial',manual_dial_prefix='$manual_dial_prefix',customer_3way_hangup_logging='$customer_3way_hangup_logging',customer_3way_hangup_seconds='$customer_3way_hangup_seconds',customer_3way_hangup_action='$customer_3way_hangup_action',ivr_park_call='$ivr_park_call',ivr_park_call_agi='$ivr_park_call_agi',manual_preview_dial='$manual_preview_dial',realtime_agent_time_stats='$realtime_agent_time_stats',api_manual_dial='$api_manual_dial',manual_dial_call_time_check='$manual_dial_call_time_check',lead_order_randomize='$lead_order_randomize',lead_order_secondary='$lead_order_secondary',per_call_notes='$per_call_notes',my_callback_option='$my_callback_option',agent_lead_search='$agent_lead_search',agent_lead_search_method='$agent_lead_search_method',queuemetrics_phone_environment='$queuemetrics_phone_environment',auto_pause_precall='$auto_pause_precall',auto_resume_precall='$auto_resume_precall',auto_pause_precall_code='$auto_pause_precall_code',manual_dial_cid='$manual_dial_cid',post_phone_time_diff_alert='$post_phone_time_diff_alert',custom_3way_button_transfer='$custom_3way_button_transfer',available_only_tally_threshold='$available_only_tally_threshold',available_only_tally_threshold_agents='$available_only_tally_threshold_agents',dial_level_threshold='$dial_level_threshold',dial_level_threshold_agents='$dial_level_threshold_agents',safe_harbor_audio='$safe_harbor_audio',safe_harbor_menu_id='$safe_harbor_menu_id',callback_days_limit='$callback_days_limit',dl_diff_target_method='$dl_diff_target_method',disable_dispo_screen='$disable_dispo_screen',disable_dispo_status='$disable_dispo_status',screen_labels='$screen_labels',status_display_fields='$status_display_fields',na_call_url='" . mysqli_real_escape_string($link, $na_call_url) . "',pllb_grouping='$pllb_grouping',pllb_grouping_limit='$pllb_grouping_limit',call_count_limit='$call_count_limit',call_count_target='$call_count_target',callback_hours_block='$callback_hours_block',callback_list_calltime='$callback_list_calltime',user_group='$user_group',hopper_vlc_dup_check='$hopper_vlc_dup_check',in_group_dial='$in_group_dial',in_group_dial_select='$in_group_dial_select',safe_harbor_audio_field='$safe_harbor_audio_field',pause_after_next_call='$pause_after_next_call',owner_populate='$owner_populate',use_other_campaign_dnc='$use_other_campaign_dnc',allow_emails='$allow_emails',allow_chats='$allow_chats',amd_inbound_group='$amd_inbound_group',amd_callmenu='$amd_callmenu',manual_dial_lead_id='$manual_dial_lead_id',dead_max='$dead_max',dispo_max='$dispo_max',pause_max='$pause_max',dead_max_dispo='$dead_max_dispo',dispo_max_dispo='$dispo_max_dispo',max_inbound_calls='$max_inbound_calls',manual_dial_search_checkbox='$manual_dial_search_checkbox',hide_call_log_info='$hide_call_log_info',timer_alt_seconds='$timer_alt_seconds',wrapup_bypass='$wrapup_bypass',wrapup_after_hotkey='$wrapup_after_hotkey',callback_active_limit='$callback_active_limit',callback_active_limit_override='$callback_active_limit_override',comments_all_tabs='$comments_all_tabs',comments_dispo_screen='$comments_dispo_screen',comments_callback_screen='$comments_callback_screen',qc_comment_history='$qc_comment_history',show_previous_callback='$show_previous_callback',clear_script='$clear_script',cpd_unknown_action='$cpd_unknown_action',manual_dial_search_filter='$manual_dial_search_filter',web_form_address_three='" . mysqli_real_escape_string($link, $web_form_address_three) . "',manual_dial_override_field='$manual_dial_override_field',status_display_ingroup='$status_display_ingroup',customer_gone_seconds='$customer_gone_seconds',agent_display_fields='$agent_display_fields',am_message_wildcards='$am_message_wildcards',manual_dial_timeout='$manual_dial_timeout',routing_initiated_recordings='$routing_initiated_recordings',manual_dial_hopper_check='$manual_dial_hopper_check',callback_useronly_move_minutes='$callback_useronly_move_minutes',ofcom_uk_drop_calc='$ofcom_uk_drop_calc',manual_auto_next='$manual_auto_next',manual_auto_show='$manual_auto_show',allow_required_fields='$allow_required_fields',dead_to_dispo='$dead_to_dispo',agent_xfer_validation='$agent_xfer_validation',ready_max_logout='$ready_max_logout',callback_display_days='$callback_display_days',three_way_record_stop='$three_way_record_stop',hangup_xfer_record_start='$hangup_xfer_record_start',scheduled_callbacks_email_alert='$scheduled_callbacks_email_alert',max_inbound_calls_outcome='$max_inbound_calls_outcome',manual_auto_next_options='$manual_auto_next_options',agent_screen_time_display='$agent_screen_time_display',next_dial_my_callbacks='$next_dial_my_callbacks',inbound_no_agents_no_dial_container='$inbound_no_agents_no_dial_container',inbound_no_agents_no_dial_threshold='$inbound_no_agents_no_dial_threshold',cid_group_id='$cid_group_id',pause_max_dispo='$pause_max_dispo',script_top_dispo='$script_top_dispo',dead_trigger_seconds='$dead_trigger_seconds',dead_trigger_action='$dead_trigger_action',dead_trigger_repeat='$dead_trigger_repeat',dead_trigger_filename='$dead_trigger_filename',dead_trigger_url='" . mysqli_real_escape_string($link, $dead_trigger_url) . "',scheduled_callbacks_force_dial='$scheduled_callbacks_force_dial',scheduled_callbacks_auto_reschedule='$scheduled_callbacks_auto_reschedule',scheduled_callbacks_timezones_container='$scheduled_callbacks_timezones_container',three_way_volume_buttons='$three_way_volume_buttons',callback_dnc='$callback_dnc',manual_dial_validation='$manual_dial_validation',mute_recordings='$mute_recordings',auto_active_list_new='$auto_active_list_new',call_quota_lead_ranking='$call_quota_lead_ranking',sip_event_logging='$sip_event_logging',campaign_script_two='$campaign_script_two',leave_vm_no_dispo='$leave_vm_no_dispo',leave_vm_message_group_id='$leave_vm_message_group_id',dial_timeout_lead_container='$dial_timeout_lead_container',amd_type='$amd_type',vmm_daily_limit='$vmm_daily_limit',opensips_cid_name='$opensips_cid_name',amd_agent_route_options='$amd_agent_route_options',browser_alert_sound='$browser_alert_sound',browser_alert_volume='$browser_alert_volume',three_way_record_stop_exception='$three_way_record_stop_exception',pause_max_exceptions='$pause_max_exceptions',daily_call_count_limit='$daily_call_count_limit',daily_limit_manual='$daily_limit_manual',transfer_button_launch='$transfer_button_launch',shared_dial_rank='$shared_dial_rank',agent_search_method='$agent_search_method',clear_form='$clear_form',leave_3way_start_recording='$leave_3way_start_recording',leave_3way_start_recording_exception='$leave_3way_start_recording_exception',calls_waiting_vl_one='$calls_waiting_vl_one',calls_waiting_vl_two='$calls_waiting_vl_two',calls_inqueue_count_one='$calls_inqueue_count_one',calls_inqueue_count_two='$calls_inqueue_count_two',in_man_dial_next_ready_seconds='$in_man_dial_next_ready_seconds',in_man_dial_next_ready_seconds_override='$in_man_dial_next_ready_seconds_override',transfer_no_dispo='$transfer_no_dispo',call_limit_24hour_method='$call_limit_24hour_method',call_limit_24hour_scope='$call_limit_24hour_scope',call_limit_24hour='$call_limit_24hour',call_limit_24hour_override='$call_limit_24hour_override'$hdrtSQL where campaign_id='$campaign_id';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmtA, $link); @@ -20004,7 +20022,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',label_lead_id='$label_lead_id',label_list_id='$label_list_id',label_entry_date='$label_entry_date',label_gmt_offset_now='$label_gmt_offset_now',label_source_id='$label_source_id',label_called_since_last_reset='$label_called_since_last_reset',label_status='$label_status',label_user='$label_user',label_date_of_birth='$label_date_of_birth',label_country_code='$label_country_code',label_last_local_call_time='$label_last_local_call_time',label_called_count='$label_called_count',label_rank='$label_rank',label_owner='$label_owner',label_entry_list_id='$label_entry_list_id',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',anyone_callback_inactive_lists='$anyone_callback_inactive_lists',enable_gdpr_download_deletion='$enable_gdpr_download_deletion',source_id_display='$source_id_display',agent_logout_link='$agent_logout_link',manual_dial_validation='$manual_dial_validation',mute_recordings='$mute_recordings',user_admin_redirect='$user_admin_redirect',list_status_modification_confirmation='$list_status_modification_confirmation',sip_event_logging='$sip_event_logging',call_quota_lead_ranking='$call_quota_lead_ranking',enable_second_script='$enable_second_script',enable_first_webform='$enable_first_webform',recording_buttons='$recording_buttons',opensips_cid_name='$opensips_cid_name',require_password_length='$require_password_length',user_account_emails='$user_account_emails',outbound_cid_any='$outbound_cid_any',entries_per_page='$entries_per_page',browser_call_alerts='$browser_call_alerts',queuemetrics_pausereason='$queuemetrics_pausereason',inbound_answer_config='$inbound_answer_config',enable_international_dncs='$enable_international_dncs',web_loader_phone_strip='$web_loader_phone_strip',manual_dial_phone_strip='$manual_dial_phone_strip',daily_call_count_limit='$daily_call_count_limit',allow_shared_dial='$allow_shared_dial',agent_search_method='$agent_search_method',phone_defaults_container='$phone_defaults_container',qc_claim_limit='$qc_claim_limit',qc_expire_days='$qc_expire_days',two_factor_auth_hours='$two_factor_auth_hours',two_factor_container='$two_factor_container',agent_hidden_sound='$agent_hidden_sound',agent_hidden_sound_volume='$agent_hidden_sound_volume',agent_hidden_sound_seconds='$agent_hidden_sound_seconds',agent_screen_timer='$agent_screen_timer'$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',label_lead_id='$label_lead_id',label_list_id='$label_list_id',label_entry_date='$label_entry_date',label_gmt_offset_now='$label_gmt_offset_now',label_source_id='$label_source_id',label_called_since_last_reset='$label_called_since_last_reset',label_status='$label_status',label_user='$label_user',label_date_of_birth='$label_date_of_birth',label_country_code='$label_country_code',label_last_local_call_time='$label_last_local_call_time',label_called_count='$label_called_count',label_rank='$label_rank',label_owner='$label_owner',label_entry_list_id='$label_entry_list_id',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',anyone_callback_inactive_lists='$anyone_callback_inactive_lists',enable_gdpr_download_deletion='$enable_gdpr_download_deletion',source_id_display='$source_id_display',agent_logout_link='$agent_logout_link',manual_dial_validation='$manual_dial_validation',mute_recordings='$mute_recordings',user_admin_redirect='$user_admin_redirect',list_status_modification_confirmation='$list_status_modification_confirmation',sip_event_logging='$sip_event_logging',call_quota_lead_ranking='$call_quota_lead_ranking',enable_second_script='$enable_second_script',enable_first_webform='$enable_first_webform',recording_buttons='$recording_buttons',opensips_cid_name='$opensips_cid_name',require_password_length='$require_password_length',user_account_emails='$user_account_emails',outbound_cid_any='$outbound_cid_any',entries_per_page='$entries_per_page',browser_call_alerts='$browser_call_alerts',queuemetrics_pausereason='$queuemetrics_pausereason',inbound_answer_config='$inbound_answer_config',enable_international_dncs='$enable_international_dncs',web_loader_phone_strip='$web_loader_phone_strip',manual_dial_phone_strip='$manual_dial_phone_strip',daily_call_count_limit='$daily_call_count_limit',allow_shared_dial='$allow_shared_dial',agent_search_method='$agent_search_method',phone_defaults_container='$phone_defaults_container',qc_claim_limit='$qc_claim_limit',qc_expire_days='$qc_expire_days',two_factor_auth_hours='$two_factor_auth_hours',two_factor_container='$two_factor_container',agent_hidden_sound='$agent_hidden_sound',agent_hidden_sound_volume='$agent_hidden_sound_volume',agent_hidden_sound_seconds='$agent_hidden_sound_seconds',agent_screen_timer='$agent_screen_timer',call_limit_24hour='$call_limit_24hour'$custom_dialplanSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $update_main_rows=mysqli_affected_rows($link); if ($DB) {echo "$update_main_rows|$stmt|\n";} @@ -24684,7 +24702,7 @@ if ($ADD==31) $enable_vtiger_integration_LU = $row[0]; $vtiger_url_LU = $row[1]; - $stmt="SELECT campaign_id,campaign_name,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_third_audio_file,survey_third_status,survey_third_exten,survey_fourth_digit,survey_fourth_audio_file,survey_fourth_status,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,campaign_calldate,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_resume_precall,auto_pause_precall_code,manual_dial_cid,post_phone_time_diff_alert,custom_3way_button_transfer,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents,safe_harbor_audio,safe_harbor_menu_id,survey_menu_id,callback_days_limit,dl_diff_target_method,disable_dispo_screen,disable_dispo_status,screen_labels,status_display_fields,na_call_url,survey_recording,pllb_grouping,pllb_grouping_limit,call_count_limit,call_count_target,callback_hours_block,callback_list_calltime,user_group,hopper_vlc_dup_check,in_group_dial,in_group_dial_select,safe_harbor_audio_field,pause_after_next_call,owner_populate,use_other_campaign_dnc,allow_emails,amd_inbound_group,amd_callmenu,survey_wait_sec,manual_dial_lead_id,dead_max,dispo_max,pause_max,dead_max_dispo,dispo_max_dispo,max_inbound_calls,manual_dial_search_checkbox,hide_call_log_info,timer_alt_seconds,wrapup_bypass,wrapup_after_hotkey,callback_active_limit,callback_active_limit_override,allow_chats,comments_all_tabs,comments_dispo_screen,comments_callback_screen,qc_comment_history,show_previous_callback,clear_script,cpd_unknown_action,manual_dial_search_filter,web_form_address_three,manual_dial_override_field,status_display_ingroup,customer_gone_seconds,agent_display_fields,am_message_wildcards,manual_dial_timeout,routing_initiated_recordings,manual_dial_hopper_check,callback_useronly_move_minutes,ofcom_uk_drop_calc,manual_auto_next,manual_auto_show,allow_required_fields,dead_to_dispo,agent_xfer_validation,ready_max_logout,callback_display_days,three_way_record_stop,hangup_xfer_record_start,scheduled_callbacks_email_alert,max_inbound_calls_outcome,manual_auto_next_options,agent_screen_time_display,next_dial_my_callbacks,inbound_no_agents_no_dial_container,inbound_no_agents_no_dial_threshold,cid_group_id,pause_max_dispo,script_top_dispo,dead_trigger_seconds,dead_trigger_action,dead_trigger_repeat,dead_trigger_filename,dead_trigger_url,scheduled_callbacks_force_dial,scheduled_callbacks_auto_reschedule,scheduled_callbacks_timezones_container,three_way_volume_buttons,callback_dnc,manual_dial_validation,mute_recordings,auto_active_list_new,call_quota_lead_ranking,call_quota_process_running,sip_event_logging,campaign_script_two,leave_vm_no_dispo,leave_vm_message_group_id,dial_timeout_lead_container,amd_type,vmm_daily_limit,opensips_cid_name,amd_agent_route_options,browser_alert_sound,browser_alert_volume,three_way_record_stop_exception,pause_max_exceptions,hopper_drop_run_trigger,daily_call_count_limit,daily_limit_manual,transfer_button_launch,shared_dial_rank,agent_search_method,qc_scorecard_id,qc_statuses_id,clear_form,leave_3way_start_recording,leave_3way_start_recording_exception,calls_waiting_vl_one,calls_waiting_vl_two,calls_inqueue_count_one,calls_inqueue_count_two,in_man_dial_next_ready_seconds,in_man_dial_next_ready_seconds_override,transfer_no_dispo from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; + $stmt="SELECT campaign_id,campaign_name,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_third_audio_file,survey_third_status,survey_third_exten,survey_fourth_digit,survey_fourth_audio_file,survey_fourth_status,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,campaign_calldate,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_resume_precall,auto_pause_precall_code,manual_dial_cid,post_phone_time_diff_alert,custom_3way_button_transfer,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents,safe_harbor_audio,safe_harbor_menu_id,survey_menu_id,callback_days_limit,dl_diff_target_method,disable_dispo_screen,disable_dispo_status,screen_labels,status_display_fields,na_call_url,survey_recording,pllb_grouping,pllb_grouping_limit,call_count_limit,call_count_target,callback_hours_block,callback_list_calltime,user_group,hopper_vlc_dup_check,in_group_dial,in_group_dial_select,safe_harbor_audio_field,pause_after_next_call,owner_populate,use_other_campaign_dnc,allow_emails,amd_inbound_group,amd_callmenu,survey_wait_sec,manual_dial_lead_id,dead_max,dispo_max,pause_max,dead_max_dispo,dispo_max_dispo,max_inbound_calls,manual_dial_search_checkbox,hide_call_log_info,timer_alt_seconds,wrapup_bypass,wrapup_after_hotkey,callback_active_limit,callback_active_limit_override,allow_chats,comments_all_tabs,comments_dispo_screen,comments_callback_screen,qc_comment_history,show_previous_callback,clear_script,cpd_unknown_action,manual_dial_search_filter,web_form_address_three,manual_dial_override_field,status_display_ingroup,customer_gone_seconds,agent_display_fields,am_message_wildcards,manual_dial_timeout,routing_initiated_recordings,manual_dial_hopper_check,callback_useronly_move_minutes,ofcom_uk_drop_calc,manual_auto_next,manual_auto_show,allow_required_fields,dead_to_dispo,agent_xfer_validation,ready_max_logout,callback_display_days,three_way_record_stop,hangup_xfer_record_start,scheduled_callbacks_email_alert,max_inbound_calls_outcome,manual_auto_next_options,agent_screen_time_display,next_dial_my_callbacks,inbound_no_agents_no_dial_container,inbound_no_agents_no_dial_threshold,cid_group_id,pause_max_dispo,script_top_dispo,dead_trigger_seconds,dead_trigger_action,dead_trigger_repeat,dead_trigger_filename,dead_trigger_url,scheduled_callbacks_force_dial,scheduled_callbacks_auto_reschedule,scheduled_callbacks_timezones_container,three_way_volume_buttons,callback_dnc,manual_dial_validation,mute_recordings,auto_active_list_new,call_quota_lead_ranking,call_quota_process_running,sip_event_logging,campaign_script_two,leave_vm_no_dispo,leave_vm_message_group_id,dial_timeout_lead_container,amd_type,vmm_daily_limit,opensips_cid_name,amd_agent_route_options,browser_alert_sound,browser_alert_volume,three_way_record_stop_exception,pause_max_exceptions,hopper_drop_run_trigger,daily_call_count_limit,daily_limit_manual,transfer_button_launch,shared_dial_rank,agent_search_method,qc_scorecard_id,qc_statuses_id,clear_form,leave_3way_start_recording,leave_3way_start_recording_exception,calls_waiting_vl_one,calls_waiting_vl_two,calls_inqueue_count_one,calls_inqueue_count_two,in_man_dial_next_ready_seconds,in_man_dial_next_ready_seconds_override,transfer_no_dispo,call_limit_24hour_method,call_limit_24hour_scope,call_limit_24hour,call_limit_24hour_override from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $campaign_name = $row[1]; @@ -25000,6 +25018,10 @@ if ($ADD==31) $in_man_dial_next_ready_seconds=$row[311]; $in_man_dial_next_ready_seconds_override=$row[312]; $transfer_no_dispo=$row[313]; + $call_limit_24hour_method=$row[314]; + $call_limit_24hour_scope=$row[315]; + $call_limit_24hour=$row[316]; + $call_limit_24hour_override=$row[317]; if (preg_match('/DISABLED/', $list_order_mix)) {$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;} @@ -25678,9 +25700,9 @@ if ($ADD==31) if ($SSdaily_call_count_limit > 0) { - echo ""._QXZ("Daily Call Count Limit").": $NWB#campaigns-daily_call_count_limit$NWE\n"; + echo ""._QXZ("Daily Call Count Limit").": $NWB#campaigns-daily_call_count_limit$NWE\n"; - echo ""._QXZ("Daily Call Limit Manual").": "; echo ""; echo ""; echo ""; @@ -25692,6 +25714,58 @@ if ($ADD==31) echo "\n"; } + if ($SScall_limit_24hour > 0) + { + echo ""._QXZ("24-Hour Called Count Limit Method").": $NWB#campaigns-call_limit_24hour_method$NWE\n"; + + echo ""._QXZ("24-Hour Called Count Limit Scope").": $NWB#campaigns-call_limit_24hour_scope$NWE\n"; + + echo ""._QXZ("24-Hour Called Count Limit").": $NWB#campaigns-call_limit_24hour$NWE\n"; + + ##### get container listings for 24-hour call limit override pulldown menu + $stmt="SELECT container_id,container_notes from vicidial_settings_containers where container_type='CALL_LIMITS_OVERRIDE' $LOGadmin_viewable_groupsSQL order by container_id;"; + $rslt=mysql_to_mysqli($stmt, $link); + $clo_to_print = mysqli_num_rows($rslt); + $call_limit_24hour_override_container_menu=''; + $clo_selected=0; + $o=0; + while ($clo_to_print > $o) + { + $rowx=mysqli_fetch_row($rslt); + if (mb_strlen($rowx[1],'utf-8')>40) + {$rowx[1] = mb_substr($rowx[1],0,40,'utf-8') . '...';} + $call_limit_24hour_override_container_menu .= "\n"; + $o++; + } + + echo ""; + if ($clo_selected > 0) + {echo ""._QXZ("24-Hour Called Count Limit Override")."";} + else + {echo _QXZ("24-Hour Called Count Limit Override");} + echo ": $NWB#campaigns-call_limit_24hour_override$NWE\n"; + } + else + { + echo "\n"; + } + echo ""._QXZ("Minimum Hopper Level").": $NWB#campaigns-hopper_level$NWE\n"; echo ""._QXZ("Automatic Hopper Level").": $NWB#campaigns-use_auto_hopper$NWE\n"; @@ -30935,7 +31009,42 @@ if ($ADD==311) $o++; } - echo "     $leads_in_list\n"; + echo "   "._QXZ("TOTAL")." $leads_in_list\n"; + + echo "
\n"; + } + + if ($SScall_limit_24hour > 0) + { + $temp_zero_called = $leads_in_list; + $temp_24hour_output=''; + echo "
\n"; + echo "
"._QXZ("24-HOUR CALLED COUNTS FOR LEADS WITHIN THIS LIST").":
\n"; + echo "\n"; + echo "\n"; + + $stmt="SELECT count(tally) as lead_tally,tally FROM(select count(*) as tally,t.lead_id from vicidial_lead_24hour_calls t where list_id='$list_id' and (call_date >= NOW() - INTERVAL 1 DAY) group by t.lead_id) t group by tally order by tally;"; + $rslt=mysql_to_mysqli($stmt, $link); + $counts_to_print = mysqli_num_rows($rslt); + $o=0; + while ($counts_to_print > $o) + { + if (preg_match('/1$|3$|5$|7$|9$/i', $o)) + {$bgcolor='bgcolor="#'. $SSstd_row1_background .'"';} + else + {$bgcolor='bgcolor="#'. $SSstd_row2_background .'"';} + + $rowx=mysqli_fetch_row($rslt); + $counts[$o] = $rowx[1]; + $tallies[$o] = $rowx[0]; + $temp_zero_called = ($temp_zero_called - $rowx[0]); + $temp_24hour_output .= "\n"; + + $o++; + } + echo "\n"; + echo $temp_24hour_output; + echo "\n"; echo "
"._QXZ("24-HOUR CALLED COUNT").""._QXZ("LEADS")."
$counts[$o] $tallies[$o]
0 $temp_zero_called
"._QXZ("TOTAL")." $leads_in_list

\n"; } @@ -39611,6 +39720,7 @@ if ($ADD==392111111111) + @@ -40677,7 +40787,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,did_system_filter,anyone_callback_inactive_lists,enable_gdpr_download_deletion,source_id_display,agent_logout_link,manual_dial_validation,mute_recordings,user_admin_redirect,list_status_modification_confirmation,sip_event_logging,call_quota_lead_ranking,enable_second_script,enable_first_webform,recording_buttons,opensips_cid_name,require_password_length,user_account_emails,outbound_cid_any,entries_per_page,browser_call_alerts,queuemetrics_pausereason,inbound_answer_config,enable_international_dncs,web_loader_phone_strip,manual_dial_phone_strip,daily_call_count_limit,allow_shared_dial,agent_search_method,phone_defaults_container,qc_claim_limit,qc_expire_days,two_factor_auth_hours,two_factor_container,agent_hidden_sound,agent_hidden_sound_volume,agent_hidden_sound_seconds,agent_screen_timer,label_lead_id,label_list_id,label_entry_date,label_gmt_offset_now,label_source_id,label_called_since_last_reset,label_status,label_user,label_date_of_birth,label_country_code,label_last_local_call_time,label_called_count,label_rank,label_owner,label_entry_list_id 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,anyone_callback_inactive_lists,enable_gdpr_download_deletion,source_id_display,agent_logout_link,manual_dial_validation,mute_recordings,user_admin_redirect,list_status_modification_confirmation,sip_event_logging,call_quota_lead_ranking,enable_second_script,enable_first_webform,recording_buttons,opensips_cid_name,require_password_length,user_account_emails,outbound_cid_any,entries_per_page,browser_call_alerts,queuemetrics_pausereason,inbound_answer_config,enable_international_dncs,web_loader_phone_strip,manual_dial_phone_strip,daily_call_count_limit,allow_shared_dial,agent_search_method,phone_defaults_container,qc_claim_limit,qc_expire_days,two_factor_auth_hours,two_factor_container,agent_hidden_sound,agent_hidden_sound_volume,agent_hidden_sound_seconds,agent_screen_timer,label_lead_id,label_list_id,label_entry_date,label_gmt_offset_now,label_source_id,label_called_since_last_reset,label_status,label_user,label_date_of_birth,label_country_code,label_last_local_call_time,label_called_count,label_rank,label_owner,label_entry_list_id,call_limit_24hour from system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $version = $row[0]; @@ -40899,6 +41009,7 @@ if ($ADD==311111111111111) $label_rank = $row[216]; $label_owner = $row[217]; $label_entry_list_id = $row[218]; + $call_limit_24hour = $row[219]; if ($pass_hash_enabled > 0) {$pass_hash_enabled = 'ENABLED';} else {$pass_hash_enabled = 'DISABLED';} @@ -41231,6 +41342,8 @@ if ($ADD==311111111111111) echo ""._QXZ("Enable Daily Called Count Limits").": $NWB#settings-daily_call_count_limit$NWE\n"; + echo ""._QXZ("Enable 24-Hour Called Count Limits").": $NWB#settings-call_limit_24hour$NWE\n"; + echo ""._QXZ("Call Quota Lead Ranking").": $NWB#settings-call_quota_lead_ranking$NWE\n"; echo ""._QXZ("Enable Custom List Fields").": $NWB#settings-custom_fields_enabled$NWE\n"; diff --git a/agc_2-X/trunk/www/vicidial/help_documentation.txt b/agc_2-X/trunk/www/vicidial/help_documentation.txt index 66eeeb96..4abb88a9 100644 --- a/agc_2-X/trunk/www/vicidial/help_documentation.txt +++ b/agc_2-X/trunk/www/vicidial/help_documentation.txt @@ -1,4 +1,4 @@ -# version: 20210706003201 +# version: 20210712215601 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. @@ -147,6 +147,10 @@ campaigns-call_count_limit Call Count Limit This enforces a limit on the nu campaigns-call_count_target Call Count Target This option is only used for reporting purposes and has no effect on leads dialed. Default is 3. campaigns-daily_call_count_limit Daily Call Count Limit This feature, if enabled, will limit the number of times a lead can be called in a single day. Once a lead has reached this set limit, if the lead is selected to be dialed again, the called-since-last-reset flag on the lead will be changed to -Y- and the call will not be dialed. If you want to raise this daily limit during the day, you might need to reset your lists to be able to dial the leads that hit the previous limit earlier in the day. This feature may conflict with Auto-Alt-Dial features if they are enabled on a campaign. Default is 0 for disabled. settings-daily_limit_manual Daily Call Limit Manual If the Daily Call Count Limit is enabled, this setting will determine if manual dial calls will be counted and or restricted in the daily call count limit. The DISABLED option will not count manual dial calls or restrict them as part of the daily call count limits, only auto-dial calls would be counted restricted. If one of the COUNT options is used, then manual dial calls would be included in the daily call counts. If one of the RESTRICT options is used, then manual dial calls would be restricted as part of the daily call count limit. Default is DISABLED. +campaigns-call_limit_24hour_method 24-Hour Called Count Limit Method This feature will limit the number of calls that can be placed to a lead or phone number over a consecutive 24 hour time period. This setting will determine if the called count limit is based upon a lead or a phone number. Default is DISABLED. +campaigns-call_limit_24hour 24-Hour Called Count Limit If the 24-Hour Called Count Limit Method setting is not disabled, this setting determines the number of calls that can be placed within 24 hours. For example, if this option is set to -1- and a call is placed to a lead at 11:01, then the next time that lead could be called is after 11:01 the next day. There is no manual dial override for this feature, it will affect all normal customer calls placed within this campaign. If you use this feature with Lead Recycling enabled and the 24-Hour call limit is reached for a recycled lead, the recycling count for that lead will reset to 0 after the 24-Hour call count limit time expires. Default is 0. +campaigns-call_limit_24hour_scope 24-Hour Called Count Limit Scope If the 24-Hour Called Count Limit feature is enabled, this setting will determine if the called count limit is counted using system-wide call counts or only the called counts within the lists for this campaign. Default is SYSTEM_WIDE. +campaigns-call_limit_24hour_override 24-Hour Called Count Limit Override If the 24-Hour Called Count Limit feature is enabled, you can create a Settings Container of the CALL_LIMITS_OVERRIDE container type that will allow you to override the 24-Hour Called Count Limit for calls to specific states, based upon the area-code of the phone number being dialed. The area-code to state relationship is defined in the internal database which you can access by going to Admin, System Settings, Phone Codes. Default is DISABLED.
Example CALL_LIMITS_OVERRIDE Container Entry:
; The only allowed method currently is state_areacode
method => state_areacode
; One line per state, with fields separated by commas: the country abbreviation, state abbreviation and the 24-hour call limit for that state
state => USA,FL,3
state => USA,GA,4
campaigns-hopper_drop_run_trigger Hopper Drop-Run Trigger This setting, if activated, will ignore all hopper loading criteria for a single hopper run for this campaign and it will only load the DROP status leads from the active lists for the campaign into the hopper at the highest hopper priority, and once this single hopper run has happened, this setting will reset to N for this campaign and the hopper loading will go back to normal for the next minute when it runs. This process will also update any DROPs already in the hopper to the highest hopper priority if they are not already there. If the -All Drops- checkbox is checked, then any status with -DROP- in the status or status name will be selected, including all system statuses and campaign statuses whether they are for outbound or inbound calls. WARNING, when this runs it will not check to see if the lists have been reset, so you may be calling back DROP leads that were recently called. However, if the Drop Lockout Time has been enabled, that setting will be honored. Default is N, unselected, for inactive. campaigns-drop_lockout_time Drop Lockout Time This is a number of hours that DROP abandon calls will be prevented from being dialed, to disable set to 0. This setting is very useful in countries like the UK where there are regulations preventing the attempted calling of customers within 72 hours of an Abandon, or DROP. Default is 0. campaigns-force_reset_hopper Force Reset of Hopper This allows you to wipe out the hopper contents upon form submission. It should be filled again when the VDhopper script runs. @@ -1090,6 +1094,7 @@ settings-inbound_answer_config Inbound Answer Configuration If enabled, thi settings-enable_international_dncs Enable Interational DNCs If enabled, this allows you to create DNC lists for individual countries and provides the option to scrub against these lists when loading lead files. settings-user_new_lead_limit New Leads Per List Limit This setting enables the new lead limits per list to be set on the list modify page and the user list new lead limit page. This feature will only work properly if the campaign is set to either the MANUAL or INBOUND_MAN Dial Method and No Hopper dialing is enabled. Default is 0 for disabled. settings-daily_call_count_limit Enable Daily Called Count Limits Enabling this setting will allow you to define a daily called count limit on a per campaign basis. Default is 0 for disabled. +settings-call_limit_24hour Enable 24-Hour Called Count Limits Enabling this setting will allow you to define a 24-hour called count limit on a per campaign basis. Default is 0 for disabled. settings-call_quota_lead_ranking Call Quota Lead Ranking This setting allows you to use the campaign setting for Call Quota Lead Ranking, which allows for a complex set of recycle dialing priorities for non-contact calls. Default is 0 for disabled. settings-custom_fields_enabled Enable Custom List Fields This setting enables the custom list fields feature that allows for custom data fields to be defined in the administration web interface on a per-list basis and then have those fields available in a FORM tab to the agent in the agent web interface. Default is 0 for disabled. settings-expanded_list_stats Enable Expanded List Stats This setting enables two additional columns to be displayed on most of the List status breakdown tables on the list modification and campaign modification pages. Penetration is defined as the percent of leads that are at or above the campaign Call Count Limit and-or the status is marked as Completed. Default is 1 for enabled.