diff --git a/UPGRADE b/UPGRADE index 23cdc7e1..6379b98b 100644 --- a/UPGRADE +++ b/UPGRADE @@ -337,6 +337,12 @@ OTHER CHANGES: 92. Added "Agent Screen Logout Link Credentials" System Setting to change the agent screen logout page login link to not include user credentials. +93. Added new campaign feature to force agents to call back their triggered + USERONLY Scheduled Callbacks. + +94. Added new campaign feature to automatically reschedule ANYONE callbacks when + they are dispositioned as a non-Human-Answered status flag status. + diff --git a/bin/ADMIN_keepalive_ALL.pl b/bin/ADMIN_keepalive_ALL.pl index 7af2ff4e..0c6e00ff 100644 --- a/bin/ADMIN_keepalive_ALL.pl +++ b/bin/ADMIN_keepalive_ALL.pl @@ -129,9 +129,10 @@ # 180204-0931 - Added rolling of vicidial_inbound_callback_queue records # 180301-1257 - Added more teodDB logging # 180512-2214 - Added reset of hopper_calls_today +# 180818-2229 - Added rolling of vicidial_recent_ascb_calls records # -$build = '180512-2214'; +$build = '180818-2229'; $DB=0; # Debug flag $teodDB=0; # flag to log Timeclock End of Day processes to log file @@ -1409,6 +1410,32 @@ if ($timeclock_end_of_day_NOW > 0) $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; } + # roll of SENT/EXPIRED vicidial_recent_ascb_calls records + if (!$Q) {print "\nProcessing vicidial_recent_ascb_calls table...\n";} + $stmtA = "INSERT IGNORE INTO vicidial_recent_ascb_calls_archive SELECT * from vicidial_recent_ascb_calls where call_date < \"$TDSQLdate\";"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows = $sthA->rows; + $event_string = "$sthArows rows inserted into vicidial_recent_ascb_calls_archive table"; + if (!$Q) {print "$event_string \n";} + if ($teodDB) {&teod_logger;} + + $rv = $sthA->err(); + if (!$rv) + { + $stmtA = "DELETE FROM vicidial_recent_ascb_calls WHERE call_date < \"$TDSQLdate\";"; + $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_recent_ascb_calls table"; + if (!$Q) {print "$event_string \n";} + if ($teodDB) {&teod_logger;} + + $stmtA = "optimize table vicidial_recent_ascb_calls;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + } + # reset in-group closing_time_now_trigger trigger flag $stmtA = "UPDATE vicidial_inbound_groups SET closing_time_now_trigger='N' WHERE closing_time_now_trigger='Y';"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; @@ -1629,6 +1656,24 @@ if ($timeclock_end_of_day_NOW > 0) ##### END vicidial_vdad_log end of day process removing records older than 7 days ##### + ##### BEGIN vicidial_recent_ascb_calls_archive end of day process removing records older than 7 days ##### + $stmtA = "DELETE from vicidial_recent_ascb_calls_archive where call_date < \"$SDSQLdate\";"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $affected_rows = $dbhA->do($stmtA); + if($DB){print STDERR "\n|$affected_rows vicidial_recent_ascb_calls_archive records older than 7 days purged|\n";} + if ($teodDB) {$event_string = "vicidial_recent_ascb_calls_archive records older than 7 days purged: |$stmtA|$affected_rows|"; &teod_logger;} + + $stmtA = "optimize table vicidial_recent_ascb_calls_archive;"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + @aryA = $sthA->fetchrow_array; + if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";} + $sthA->finish(); + ##### END vicidial_recent_ascb_calls_archive end of day process removing records older than 7 days ##### + + ##### BEGIN usacan_phone_dialcode_fix funciton ##### if ($usacan_phone_dialcode_fix > 0) { diff --git a/bin/AST_VDauto_dial.pl b/bin/AST_VDauto_dial.pl index 0f426924..512c9c06 100644 --- a/bin/AST_VDauto_dial.pl +++ b/bin/AST_VDauto_dial.pl @@ -128,6 +128,7 @@ # 180130-1346 - Added inbound_no_agents_no_dial campaign options # 180214-1559 - Added CID Group functionality # 180301-1338 - Small changes for Inbound Queue No Dial +# 180812-1026 - Added code for scheduled_callbacks_auto_reschedule campaign feature # ### begin parsing run-time options ### @@ -245,6 +246,7 @@ if (!$VDADLOGfile) {$VDADLOGfile = "$PATHlogs/vdautodial.$year-$mon-$mday";} if (!$JAMdebugFILE) {$JAMdebugFILE = "$PATHlogs/vdad-JAM.$year-$mon-$mday";} use Time::HiRes ('gettimeofday','usleep','sleep'); # necessary to have perl sleep command of less than one second +use Time::Local; use DBI; ### connect to MySQL database defined in the conf file @@ -283,7 +285,7 @@ if ($sthArows > 0) if ($DBASTmgrUSERNAMEsend) {$ASTmgrUSERNAMEsend = $DBASTmgrUSERNAMEsend;} $max_vicidial_trunks = $DBmax_vicidial_trunks; if ($DBanswer_transfer_agent) {$answer_transfer_agent = $DBanswer_transfer_agent;} - if ($DBSERVER_GMT) {$SERVER_GMT = $DBSERVER_GMT;} + if (length($DBSERVER_GMT) > 0) {$SERVER_GMT = $DBSERVER_GMT;} if ($DBext_context) {$ext_context = $DBext_context;} if ($DBvd_server_logs =~ /Y/) {$SYSLOG = '1';} else {$SYSLOG = '0';} @@ -640,7 +642,7 @@ while($one_day_interval > 0) ### grab the dial_level and multiply by active agents to get your goalcalls $DBIPadlevel[$user_CIPct]=0; - $stmtA = "SELECT auto_dial_level,local_call_time,dial_timeout,dial_prefix,campaign_cid,active,campaign_vdad_exten,closer_campaigns,omit_phone_code,available_only_ratio_tally,auto_alt_dial,campaign_allow_inbound,queue_priority,dial_method,use_custom_cid,inbound_queue_no_dial,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents,adaptive_dl_diff_target,dl_diff_target_method,inbound_no_agents_no_dial_container,inbound_no_agents_no_dial_threshold,cid_group_id FROM vicidial_campaigns where campaign_id='$DBIPcampaign[$user_CIPct]'"; + $stmtA = "SELECT auto_dial_level,local_call_time,dial_timeout,dial_prefix,campaign_cid,active,campaign_vdad_exten,closer_campaigns,omit_phone_code,available_only_ratio_tally,auto_alt_dial,campaign_allow_inbound,queue_priority,dial_method,use_custom_cid,inbound_queue_no_dial,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents,adaptive_dl_diff_target,dl_diff_target_method,inbound_no_agents_no_dial_container,inbound_no_agents_no_dial_threshold,cid_group_id,scheduled_callbacks_auto_reschedule FROM vicidial_campaigns where campaign_id='$DBIPcampaign[$user_CIPct]'"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -676,6 +678,7 @@ while($one_day_interval > 0) $DBIPinbound_no_agents_no_dial[$user_CIPct] = $aryA[22]; $DBIPinbound_no_agents_no_dial_threshold[$user_CIPct] = $aryA[23]; $DBIPcid_group_id[$user_CIPct] = $aryA[24]; + $DBIPscheduled_callbacks_auto_reschedule[$user_CIPct] = $aryA[25]; if ($DBIPdl_diff_target_method[$user_CIPct] =~ /ADAPT_CALC_ONLY/) { @@ -1189,7 +1192,7 @@ while($one_day_interval > 0) $lead_id=''; $phone_code=''; $phone_number=''; $called_count=''; while ($call_CMPIPct < $UDaffected_rows) { - $stmtA = "SELECT lead_id,alt_dial FROM vicidial_hopper where campaign_id='$DBIPcampaign[$user_CIPct]' and status='QUEUE' and user='VDAD_$server_ip' order by priority desc,hopper_id LIMIT 1"; + $stmtA = "SELECT lead_id,alt_dial,source FROM vicidial_hopper where campaign_id='$DBIPcampaign[$user_CIPct]' and status='QUEUE' and user='VDAD_$server_ip' order by priority desc,hopper_id LIMIT 1"; print "|$stmtA|\n"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -1199,201 +1202,265 @@ while($one_day_interval > 0) while ($sthArows > $rec_count) { @aryA = $sthA->fetchrow_array; - $lead_id = $aryA[0]; - $alt_dial = $aryA[1]; + $lead_id = $aryA[0]; + $alt_dial = $aryA[1]; + $hopper_source = $aryA[2]; $rec_count++; } $sthA->finish(); - if ($lead_id_call_list =~ /\|$lead_id\|/) - { - print "!!!!!!!!!!!!!!!!duplicate lead_id for this run: |$lead_id| $lead_id_call_list\n"; - if ($SYSLOG) + if ($lead_id_call_list =~ /\|$lead_id\|/) { - open(DUPout, ">>$PATHlogs/VDAD_DUPLICATE.$file_date") - || die "Can't open $PATHlogs/VDAD_DUPLICATE.$file_date: $!\n"; - print DUPout "$now_date-----$lead_id_call_list-----$lead_id\n"; - close(DUPout); + print "!!!!!!!!!!!!!!!!duplicate lead_id for this run: |$lead_id| $lead_id_call_list\n"; + if ($SYSLOG) + { + open(DUPout, ">>$PATHlogs/VDAD_DUPLICATE.$file_date") + || die "Can't open $PATHlogs/VDAD_DUPLICATE.$file_date: $!\n"; + print DUPout "$now_date-----$lead_id_call_list-----$lead_id\n"; + close(DUPout); + } } - } - else - { - $stmtA = "UPDATE vicidial_hopper set status='INCALL' where lead_id='$lead_id'"; - print "|$stmtA|\n"; - $UQaffected_rows = $dbhA->do($stmtA); - print "hopper row updated to INCALL: |$UQaffected_rows|$lead_id|\n"; - - ### Gather lead data - $stmtA = "SELECT list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,address3,alt_phone,called_count,security_phrase,state FROM vicidial_list where lead_id='$lead_id';"; - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $rec_count=0; - $rec_countCUSTDATA=0; - if ($sthArows > 0) + else { - @aryA = $sthA->fetchrow_array; - $list_id = $aryA[0]; - $gmt_offset_now = $aryA[1]; - $called_since_last_reset = $aryA[2]; - $phone_code = $aryA[3]; - $phone_number = $aryA[4]; - $address3 = $aryA[5]; - $alt_phone = $aryA[6]; - $called_count = $aryA[7]; - $security_phrase = $aryA[8]; - $state = $aryA[9]; + $stmtA = "UPDATE vicidial_hopper set status='INCALL' where lead_id='$lead_id'"; + print "|$stmtA|\n"; + $UQaffected_rows = $dbhA->do($stmtA); + print "hopper row updated to INCALL: |$UQaffected_rows|$lead_id|\n"; - $rec_countCUSTDATA++; - $rec_count++; - } - $sthA->finish(); - - if ($rec_countCUSTDATA) - { - $campaign_cid_override=''; - ### gather list_id overrides - $stmtA = "SELECT campaign_cid_override FROM vicidial_lists where list_id='$list_id';"; + ### Gather lead data + $stmtA = "SELECT list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,address3,alt_phone,called_count,security_phrase,state FROM vicidial_list where lead_id='$lead_id';"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArowsL=$sthA->rows; - if ($sthArowsL > 0) + $sthArows=$sthA->rows; + $rec_count=0; + $rec_countCUSTDATA=0; + if ($sthArows > 0) { @aryA = $sthA->fetchrow_array; - $campaign_cid_override = $aryA[0]; + $list_id = $aryA[0]; + $gmt_offset_now = $aryA[1]; + $called_since_last_reset = $aryA[2]; + $phone_code = $aryA[3]; + $phone_number = $aryA[4]; + $address3 = $aryA[5]; + $alt_phone = $aryA[6]; + $called_count = $aryA[7]; + $security_phrase = $aryA[8]; + $state = $aryA[9]; + + $rec_countCUSTDATA++; + $rec_count++; } $sthA->finish(); - ### update called_count - $called_count++; - if ($called_since_last_reset =~ /^Y/) + if ($rec_countCUSTDATA) { - if ($called_since_last_reset =~ /^Y$/) {$CSLR = 'Y1';} - else + $campaign_cid_override=''; + ### gather list_id overrides + $stmtA = "SELECT campaign_cid_override FROM vicidial_lists where list_id='$list_id';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArowsL=$sthA->rows; + if ($sthArowsL > 0) { - $called_since_last_reset =~ s/^Y//gi; - $called_since_last_reset++; - $CSLR = "Y$called_since_last_reset"; + @aryA = $sthA->fetchrow_array; + $campaign_cid_override = $aryA[0]; } - } - else {$CSLR = 'Y';} - - $LLCT_DATE_offset = ($LOCAL_GMT_OFF - $gmt_offset_now); - $LLCT_DATE_offset_epoch = ( $secX - ($LLCT_DATE_offset * 3600) ); - ($Lsec,$Lmin,$Lhour,$Lmday,$Lmon,$Lyear,$Lwday,$Lyday,$Lisdst) = localtime($LLCT_DATE_offset_epoch); - $Lyear = ($Lyear + 1900); - $Lmon++; - if ($Lmon < 10) {$Lmon = "0$Lmon";} - if ($Lmday < 10) {$Lmday = "0$Lmday";} - if ($Lhour < 10) {$Lhour = "0$Lhour";} - if ($Lmin < 10) {$Lmin = "0$Lmin";} - if ($Lsec < 10) {$Lsec = "0$Lsec";} - $LLCT_DATE = "$Lyear-$Lmon-$Lmday $Lhour:$Lmin:$Lsec"; + $sthA->finish(); - if ( ($alt_dial =~ /ALT|ADDR3|X/) && ($DBIPautoaltdial[$user_CIPct] =~ /ALT|ADDR|X/) ) - { - if ( ($alt_dial =~ /ALT/) && ($DBIPautoaltdial[$user_CIPct] =~ /ALT/) ) + ### update called_count + $called_count++; + if ($called_since_last_reset =~ /^Y/) { - $alt_phone =~ s/\D//gi; - $phone_number = $alt_phone; - } - if ( ($alt_dial =~ /ADDR3/) && ($DBIPautoaltdial[$user_CIPct] =~ /ADDR3/) ) - { - $address3 =~ s/\D//gi; - $phone_number = $address3; - } - if ( ($alt_dial =~ /X/) && ($DBIPautoaltdial[$user_CIPct] =~ /X/) ) - { - if ($alt_dial =~ /LAST/) - { - $stmtA = "SELECT phone_code,phone_number FROM vicidial_list_alt_phones where lead_id='$lead_id' order by alt_phone_count desc limit 1;"; - } + if ($called_since_last_reset =~ /^Y$/) {$CSLR = 'Y1';} else { - $Talt_dial = $alt_dial; - $Talt_dial =~ s/\D//gi; - $stmtA = "SELECT phone_code,phone_number FROM vicidial_list_alt_phones where lead_id='$lead_id' and alt_phone_count='$Talt_dial';"; + $called_since_last_reset =~ s/^Y//gi; + $called_since_last_reset++; + $CSLR = "Y$called_since_last_reset"; } + } + else {$CSLR = 'Y';} + + $LLCT_DATE_offset = ($LOCAL_GMT_OFF - $gmt_offset_now); + $LLCT_DATE_offset_epoch = ( $secX - ($LLCT_DATE_offset * 3600) ); + ($Lsec,$Lmin,$Lhour,$Lmday,$Lmon,$Lyear,$Lwday,$Lyday,$Lisdst) = localtime($LLCT_DATE_offset_epoch); + $Lyear = ($Lyear + 1900); + $Lmon++; + if ($Lmon < 10) {$Lmon = "0$Lmon";} + if ($Lmday < 10) {$Lmday = "0$Lmday";} + if ($Lhour < 10) {$Lhour = "0$Lhour";} + if ($Lmin < 10) {$Lmin = "0$Lmin";} + 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/) && ($DBIPautoaltdial[$user_CIPct] =~ /ALT/) ) + { + $alt_phone =~ s/\D//gi; + $phone_number = $alt_phone; + } + if ( ($alt_dial =~ /ADDR3/) && ($DBIPautoaltdial[$user_CIPct] =~ /ADDR3/) ) + { + $address3 =~ s/\D//gi; + $phone_number = $address3; + } + if ( ($alt_dial =~ /X/) && ($DBIPautoaltdial[$user_CIPct] =~ /X/) ) + { + if ($alt_dial =~ /LAST/) + { + $stmtA = "SELECT phone_code,phone_number FROM vicidial_list_alt_phones where lead_id='$lead_id' order by alt_phone_count desc limit 1;"; + } + else + { + $Talt_dial = $alt_dial; + $Talt_dial =~ s/\D//gi; + $stmtA = "SELECT phone_code,phone_number FROM vicidial_list_alt_phones where lead_id='$lead_id' and alt_phone_count='$Talt_dial';"; + } + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $phone_code = $aryA[0]; + $phone_number = $aryA[1]; + $phone_number =~ s/\D//gi; + } + $sthA->finish(); + } + + $stmtA = "UPDATE vicidial_list set called_since_last_reset='$CSLR',called_count='$called_count',user='VDAD',last_local_call_time='$LLCT_DATE' where lead_id='$lead_id'"; + } + else + { + $stmtA = "UPDATE vicidial_list set called_since_last_reset='$CSLR', called_count='$called_count',user='VDAD',last_local_call_time='$LLCT_DATE' where lead_id='$lead_id'"; + } + $affected_rows = $dbhA->do($stmtA); + + $PADlead_id = sprintf("%010s", $lead_id); while (length($PADlead_id) > 10) {chop($PADlead_id);} + # VmddhhmmssLLLLLLLLLL Set the callerIDname to a unique call_id string + $VqueryCID = "V$CIDdate$PADlead_id"; + + if ( ( ($DBIPscheduled_callbacks_auto_reschedule[$user_CIPct] !~ /DISABLED/) && (length($DBIPscheduled_callbacks_auto_reschedule[$user_CIPct]) > 0) ) || ($hopper_source eq 'C') ) + { + ### gather vicidial_callbacks information for this lead, if any + $stmtA = "SELECT callback_id,callback_time,lead_status,list_id FROM vicidial_callbacks where lead_id='$lead_id' and status='LIVE' and recipient='ANYONE' order by callback_id limit 1;"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - if ($sthArows > 0) + $sthArowsPSCB=$sthA->rows; + if ($sthArowsPSCB > 0) { @aryA = $sthA->fetchrow_array; - $phone_code = $aryA[0]; - $phone_number = $aryA[1]; - $phone_number =~ s/\D//gi; + $PSCBcallback_id = $aryA[0]; + $PSCBcallback_time = $aryA[1]; + $PSCBlead_status = $aryA[2]; + $PSCBlist_id = $aryA[3]; } $sthA->finish(); - } - - $stmtA = "UPDATE vicidial_list set called_since_last_reset='$CSLR',called_count='$called_count',user='VDAD',last_local_call_time='$LLCT_DATE' where lead_id='$lead_id'"; - } - else - { - $stmtA = "UPDATE vicidial_list set called_since_last_reset='$CSLR', called_count='$called_count',user='VDAD',last_local_call_time='$LLCT_DATE' where lead_id='$lead_id'"; - } - $affected_rows = $dbhA->do($stmtA); - - $stmtA = "DELETE FROM vicidial_hopper where lead_id='$lead_id'"; - $affected_rows = $dbhA->do($stmtA); - - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - if ($DBIPdialtimeout[$user_CIPct] > 4) {$Local_dial_timeout = $DBIPdialtimeout[$user_CIPct];} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (length($DBIPdialprefix[$user_CIPct]) > 0) {$Local_out_prefix = "$DBIPdialprefix[$user_CIPct]";} - if (length($DBIPvdadexten[$user_CIPct]) > 0) {$VDAD_dial_exten = "$DBIPvdadexten[$user_CIPct]";} - else {$VDAD_dial_exten = "$answer_transfer_agent";} - - # add the routing prefix if using Asterisk 13 - if (( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} > 11)) - { - $VDAD_dial_exten = $routing_prefix . $VDAD_dial_exten; - } - - if (length($campaign_cid_override) > 6) {$CCID = "$campaign_cid_override"; $CCID_on++;} - else - { - if (length($DBIPcampaigncid[$user_CIPct]) > 6) {$CCID = "$DBIPcampaigncid[$user_CIPct]"; $CCID_on++;} - if ($DBIPuse_custom_cid[$user_CIPct] =~ /Y/) - { - $temp_CID = $security_phrase; - $temp_CID =~ s/\D//gi; - if (length($temp_CID) > 6) - {$CCID = "$temp_CID"; $CCID_on++;} - } - $CIDG_set=0; - if ($DBIPcid_group_id[$user_CIPct] !~ /\-\-\-DISABLED\-\-\-/) - { - $stmtA = "SELECT cid_group_type FROM vicidial_cid_groups where cid_group_id='$DBIPcid_group_id[$user_CIPct]';"; - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - if ($sthArows > 0) + ### insert record in recent callbacks table + if ($sthArowsPSCB > 0) + { + $stmtA = "INSERT INTO vicidial_recent_ascb_calls SET call_date='$SQLdate',callback_date='$PSCBcallback_time',callback_id='$PSCBcallback_id',caller_code='$VqueryCID',lead_id='$lead_id',server_ip='$DBIPaddress[$user_CIPct]',orig_status='$PSCBlead_status',reschedule='$DBIPscheduled_callbacks_auto_reschedule[$user_CIPct]',list_id='$PSCBlist_id',rescheduled='U';"; + $affected_rows = $dbhA->do($stmtA); + } + } + + $stmtA = "DELETE FROM vicidial_hopper where lead_id='$lead_id'"; + $affected_rows = $dbhA->do($stmtA); + + $CCID_on=0; $CCID=''; + $local_DEF = 'Local/'; + $local_AMP = '@'; + $Local_out_prefix = '9'; + $Local_dial_timeout = '60'; + if ($DBIPdialtimeout[$user_CIPct] > 4) {$Local_dial_timeout = $DBIPdialtimeout[$user_CIPct];} + $Local_dial_timeout = ($Local_dial_timeout * 1000); + if (length($DBIPdialprefix[$user_CIPct]) > 0) {$Local_out_prefix = "$DBIPdialprefix[$user_CIPct]";} + if (length($DBIPvdadexten[$user_CIPct]) > 0) {$VDAD_dial_exten = "$DBIPvdadexten[$user_CIPct]";} + else {$VDAD_dial_exten = "$answer_transfer_agent";} + + # add the routing prefix if using Asterisk 13 + if (( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} > 11)) + { + $VDAD_dial_exten = $routing_prefix . $VDAD_dial_exten; + } + + if (length($campaign_cid_override) > 6) {$CCID = "$campaign_cid_override"; $CCID_on++;} + else + { + if (length($DBIPcampaigncid[$user_CIPct]) > 6) {$CCID = "$DBIPcampaigncid[$user_CIPct]"; $CCID_on++;} + if ($DBIPuse_custom_cid[$user_CIPct] =~ /Y/) + { + $temp_CID = $security_phrase; + $temp_CID =~ s/\D//gi; + if (length($temp_CID) > 6) + {$CCID = "$temp_CID"; $CCID_on++;} + } + $CIDG_set=0; + if ($DBIPcid_group_id[$user_CIPct] !~ /\-\-\-DISABLED\-\-\-/) + { + $stmtA = "SELECT cid_group_type FROM vicidial_cid_groups where cid_group_id='$DBIPcid_group_id[$user_CIPct]';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $cid_group_type = $aryA[0]; + $temp_CID=''; + $temp_vcca=''; + $temp_ac=''; + + if ($cid_group_type =~ /AREACODE/) + { + $temp_ac_two = substr("$phone_number", 0, 2); + $temp_ac_three = substr("$phone_number", 0, 3); + $temp_ac_four = substr("$phone_number", 0, 4); + $temp_ac_five = substr("$phone_number", 0, 5); + $stmtA = "SELECT outbound_cid,areacode FROM vicidial_campaign_cid_areacodes where campaign_id='$DBIPcid_group_id[$user_CIPct]' and areacode IN('$temp_ac_two','$temp_ac_three','$temp_ac_four','$temp_ac_five') and active='Y' order by CAST(areacode as SIGNED INTEGER) asc, call_count_today desc limit 100000;"; + } + if ($cid_group_type =~ /STATE/) + { + $temp_state = $state; + $stmtA = "SELECT outbound_cid,areacode FROM vicidial_campaign_cid_areacodes where campaign_id='$DBIPcid_group_id[$user_CIPct]' and areacode IN('$temp_state') and active='Y' order by call_count_today desc limit 100000;"; + } $temp_CID=''; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $act=0; + while ($sthArows > $act) + { + @aryA = $sthA->fetchrow_array; + $temp_vcca = $aryA[0]; + $temp_ac = $aryA[1]; + $act++; + } + if ($act > 0) + { + $sthA->finish(); + $stmtA="UPDATE vicidial_campaign_cid_areacodes set call_count_today=(call_count_today + 1) where campaign_id='$DBIPcid_group_id[$user_CIPct]' and areacode='$temp_ac' and outbound_cid='$temp_vcca';"; + $affected_rows = $dbhA->do($stmtA); + } + else + {$sthA->finish();} + $temp_CID = $temp_vcca; + $temp_CID =~ s/\D//gi; + if (length($temp_CID) > 6) + {$CCID = "$temp_CID"; $CCID_on++; $CIDG_set++;} + } + } + if ( ($DBIPuse_custom_cid[$user_CIPct] =~ /AREACODE/) && ($CIDG_set < 1) ) { - @aryA = $sthA->fetchrow_array; - $cid_group_type = $aryA[0]; $temp_CID=''; $temp_vcca=''; $temp_ac=''; - - if ($cid_group_type =~ /AREACODE/) - { - $temp_ac_two = substr("$phone_number", 0, 2); - $temp_ac_three = substr("$phone_number", 0, 3); - $temp_ac_four = substr("$phone_number", 0, 4); - $temp_ac_five = substr("$phone_number", 0, 5); - $stmtA = "SELECT outbound_cid,areacode FROM vicidial_campaign_cid_areacodes where campaign_id='$DBIPcid_group_id[$user_CIPct]' and areacode IN('$temp_ac_two','$temp_ac_three','$temp_ac_four','$temp_ac_five') and active='Y' order by CAST(areacode as SIGNED INTEGER) asc, call_count_today desc limit 100000;"; - } - if ($cid_group_type =~ /STATE/) - { - $temp_state = $state; - $stmtA = "SELECT outbound_cid,areacode FROM vicidial_campaign_cid_areacodes where campaign_id='$DBIPcid_group_id[$user_CIPct]' and areacode IN('$temp_state') and active='Y' order by call_count_today desc limit 100000;"; - } $temp_CID=''; + $temp_ac_two = substr("$phone_number", 0, 2); + $temp_ac_three = substr("$phone_number", 0, 3); + $temp_ac_four = substr("$phone_number", 0, 4); + $temp_ac_five = substr("$phone_number", 0, 5); + $stmtA = "SELECT outbound_cid,areacode FROM vicidial_campaign_cid_areacodes where campaign_id='$DBIPcampaign[$user_CIPct]' and areacode IN('$temp_ac_two','$temp_ac_three','$temp_ac_four','$temp_ac_five') and active='Y' order by CAST(areacode as SIGNED INTEGER) asc, call_count_today desc limit 100000;"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -1408,7 +1475,7 @@ while($one_day_interval > 0) if ($act > 0) { $sthA->finish(); - $stmtA="UPDATE vicidial_campaign_cid_areacodes set call_count_today=(call_count_today + 1) where campaign_id='$DBIPcid_group_id[$user_CIPct]' and areacode='$temp_ac' and outbound_cid='$temp_vcca';"; + $stmtA="UPDATE vicidial_campaign_cid_areacodes set call_count_today=(call_count_today + 1) where campaign_id='$DBIPcampaign[$user_CIPct]' and areacode='$temp_ac' and outbound_cid='$temp_vcca';"; $affected_rows = $dbhA->do($stmtA); } else @@ -1416,72 +1483,35 @@ while($one_day_interval > 0) $temp_CID = $temp_vcca; $temp_CID =~ s/\D//gi; if (length($temp_CID) > 6) - {$CCID = "$temp_CID"; $CCID_on++; $CIDG_set++;} + {$CCID = "$temp_CID"; $CCID_on++;} } } - if ( ($DBIPuse_custom_cid[$user_CIPct] =~ /AREACODE/) && ($CIDG_set < 1) ) + + if ($DBIPdialprefix[$user_CIPct] =~ /x/i) {$Local_out_prefix = '';} + + if ($RECcount) { - $temp_CID=''; - $temp_vcca=''; - $temp_ac=''; - $temp_ac_two = substr("$phone_number", 0, 2); - $temp_ac_three = substr("$phone_number", 0, 3); - $temp_ac_four = substr("$phone_number", 0, 4); - $temp_ac_five = substr("$phone_number", 0, 5); - $stmtA = "SELECT outbound_cid,areacode FROM vicidial_campaign_cid_areacodes where campaign_id='$DBIPcampaign[$user_CIPct]' and areacode IN('$temp_ac_two','$temp_ac_three','$temp_ac_four','$temp_ac_five') and active='Y' order by CAST(areacode as SIGNED INTEGER) asc, call_count_today desc limit 100000;"; - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $act=0; - while ($sthArows > $act) - { - @aryA = $sthA->fetchrow_array; - $temp_vcca = $aryA[0]; - $temp_ac = $aryA[1]; - $act++; - } - if ($act > 0) - { - $sthA->finish(); - $stmtA="UPDATE vicidial_campaign_cid_areacodes set call_count_today=(call_count_today + 1) where campaign_id='$DBIPcampaign[$user_CIPct]' and areacode='$temp_ac' and outbound_cid='$temp_vcca';"; - $affected_rows = $dbhA->do($stmtA); - } - else - {$sthA->finish();} - $temp_CID = $temp_vcca; - $temp_CID =~ s/\D//gi; - if (length($temp_CID) > 6) - {$CCID = "$temp_CID"; $CCID_on++;} + if ( (length($RECprefix)>0) && ($called_count < $RECcount) ) + {$Local_out_prefix .= "$RECprefix";} } - } - if ($DBIPdialprefix[$user_CIPct] =~ /x/i) {$Local_out_prefix = '';} + if ($lists_update !~ /'$list_id'/) {$lists_update .= "'$list_id',"; $LUcount++;} - if ($RECcount) - { - if ( (length($RECprefix)>0) && ($called_count < $RECcount) ) - {$Local_out_prefix .= "$RECprefix";} - } - $PADlead_id = sprintf("%010s", $lead_id); while (length($PADlead_id) > 10) {chop($PADlead_id);} + $lead_id_call_list .= "$lead_id|"; - if ($lists_update !~ /'$list_id'/) {$lists_update .= "'$list_id',"; $LUcount++;} + if (length($alt_dial)<1) {$alt_dial='MAIN';} - $lead_id_call_list .= "$lead_id|"; + ### whether to omit phone_code or not + if ($DBIPomitcode[$user_CIPct] > 0) + {$Ndialstring = "$Local_out_prefix$phone_number";} + else + {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} - if (length($alt_dial)<1) {$alt_dial='MAIN';} - - ### whether to omit phone_code or not - if ($DBIPomitcode[$user_CIPct] > 0) - {$Ndialstring = "$Local_out_prefix$phone_number";} - else - {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} - - if (length($ext_context) < 1) {$ext_context='default';} - ### use manager middleware-app to connect the next call to the meetme room - # VmddhhmmssLLLLLLLLLL - $VqueryCID = "V$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$VqueryCID\" <$CCID>";} - else {$CIDstring = "$VqueryCID";} + if (length($ext_context) < 1) {$ext_context='default';} + ### use manager middleware-agi to connect the next call to the meetme room of an agent after call is answered + if ($CCID_on) {$CIDstring = "\"$VqueryCID\" <$CCID>";} + else {$CIDstring = "$VqueryCID";} + ### insert a NEW record to the vicidial_manager table to be processed $stmtA = "INSERT INTO vicidial_manager values('','','$SQLdate','NEW','N','$DBIPaddress[$user_CIPct]','','Originate','$VqueryCID','Exten: $VDAD_dial_exten','Context: $ext_context','Channel: $local_DEF$Ndialstring$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','VDACnote: $DBIPcampaign[$user_CIPct]|$lead_id|$phone_code|$phone_number|OUT|$alt_dial|$DBIPqueue_priority[$user_CIPct]')"; $affected_rows = $dbhA->do($stmtA); @@ -3425,6 +3455,345 @@ while($one_day_interval > 0) } + ############################################################################### + ###### seventh we will check to see if any campaign has scheduled callbacks + ###### auto reschedule enabled. if yes, then go through the unprocessed + ###### vicidial_recent_ascb_calls entries for this server_ip and process them. + ############################################################################### + + $SCARincall='|INCALL|QUEUE|DISPO|'; + $scheduled_callbacks_auto_reschedule_count=0; + $stmtA = "SELECT count(*) FROM vicidial_campaigns where scheduled_callbacks_auto_reschedule!='DISABLED' and campaign_calldate > \"$MCDSQLdate\";"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $scheduled_callbacks_auto_reschedule_count = $aryA[0]; + } + $sthA->finish(); + + if ($scheduled_callbacks_auto_reschedule_count > 0) + { + @SCARcamp_id = @MT; + @SCARcall_time = @MT; + @SCARcamp_reschedule = @MT; + @SCARstatuses = @MT; + @SCARlists = @MT; + @SCARstatus_groups = @MT; + + $SCARcampaigns='|'; + $stmtA = "SELECT campaign_id,local_call_time,scheduled_callbacks_auto_reschedule FROM vicidial_campaigns where scheduled_callbacks_auto_reschedule!='DISABLED' and campaign_calldate > \"$MCDSQLdate\";"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $SCARcamp_count=0; + while ($sthArows > $SCARcamp_count) + { + @aryA = $sthA->fetchrow_array; + $SCARcampaigns .= "$aryA[0]|"; + $SCARcamp_id[$SCARcamp_count] = $aryA[0]; + $SCARcall_time[$SCARcamp_count] = $aryA[1]; + $SCARcamp_reschedule[$SCARcamp_count] = $aryA[2]; + $SCARcamp_count++; + } + $sthA->finish(); + + $SCARcamp_count=0; + foreach(@SCARcamp_id) + { + $SCARlists[$SCARcamp_count]=''; + $stmtA = "SELECT list_id FROM vicidial_lists where campaign_id='$SCARcamp_id[$SCARcamp_count]';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $SCARlist_count=0; + while ($sthArows > $SCARlist_count) + { + @aryA = $sthA->fetchrow_array; + $SCARlists[$SCARcamp_count] .= "'$aryA[0]',"; + $SCARlist_count++; + } + $sthA->finish(); + $SCARlists[$SCARcamp_count] =~ s/,$//gi; + if (length($SCARlists[$SCARcamp_count]) < 2) + {$SCARlists[$SCARcamp_count]="''";} + + $SCARstatus_groups[$SCARcamp_count]=''; + if ($SCARlist_count > 0) + { + $stmtA = "SELECT distinct status_group_id FROM vicidial_lists where list_id IN($SCARlists[$SCARcamp_count]);"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $SCARstatus_groups_count=0; + while ($sthArows > $SCARstatus_groups_count) + { + @aryA = $sthA->fetchrow_array; + $SCARstatus_groups[$SCARcamp_count] .= "'$aryA[0]',"; + $SCARstatus_groups_count++; + } + $sthA->finish(); + $SCARstatus_groups[$SCARcamp_count] =~ s/,$//gi; + } + if (length($SCARstatus_groups[$SCARcamp_count]) < 2) + {$SCARstatus_groups[$SCARcamp_count]="''";} + + $SCARstatuses[$SCARcamp_count]=' '; + $stmtA = "SELECT distinct status from vicidial_statuses where human_answered='Y' UNION select distinct status from vicidial_campaign_statuses where campaign_id='$SCARcamp_id[$SCARcamp_count]' and human_answered='Y' UNION select distinct status from vicidial_campaign_statuses where campaign_id IN($SCARstatus_groups[$SCARcamp_count]) and human_answered='Y';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $SCARstatuses_count=0; + while ($sthArows > $SCARstatuses_count) + { + @aryA = $sthA->fetchrow_array; + $SCARstatuses[$SCARcamp_count] .= "$aryA[0] "; + $SCARstatuses_count++; + } + $sthA->finish(); + + $SCARcamp_count++; + } + + $event_string = " Scheduled Callbacks Auto Reschedule check: $scheduled_callbacks_auto_reschedule_count active($MCDSQLdate), checking unprocessed calls..."; + &event_logger; + + @SCARleadid = @MT; + @SCARcalldate = @MT; + @SCARcalldateFIVE = @MT; + @SCARcallback_date = @MT; + @SCARcallerid = @MT; + @SCARorig_status = @MT; + @SCARreschedule = @MT; + @SCARlist_id = @MT; + @SCARcallback_id = @MT; + @SCARflag = @MT; + @SCARcampaign = @MT; + @SCARstatus = @MT; + + $stmtA = "SELECT lead_id,call_date,caller_code,orig_status,reschedule,list_id,callback_id,(call_date + INTERVAL 5 MINUTE),callback_date FROM vicidial_recent_ascb_calls where server_ip='$server_ip' and call_date > \"$MCDSQLdate\" and rescheduled='U' order by call_date,lead_id limit 100000;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $vrac_count=0; + $vrac_auto_count=0; + while ($sthArows > $vrac_count) + { + $SCARflag[$vrac_count] = 0; + @aryA = $sthA->fetchrow_array; + if ($aryA[2] =~ /^V|^M/) + { + $vrac_auto_count++; + $SCARflag[$vrac_count] = 1; + } + $SCARleadid[$vrac_count] = $aryA[0]; + $SCARcalldate[$vrac_count] = $aryA[1]; + $SCARcallerid[$vrac_count] = $aryA[2]; + $SCARorig_status[$vrac_count] = $aryA[3]; + $SCARreschedule[$vrac_count] = $aryA[4]; + $SCARlist_id[$vrac_count] = $aryA[5]; + $SCARcallback_id[$vrac_count] = $aryA[6]; + $SCARcalldateFIVE[$vrac_count] = $aryA[7]; + $SCARcallback_date[$vrac_count] = $aryA[8]; + $vrac_count++; + } + $sthA->finish(); + + $event_string = " Scheduled Callbacks Auto Reschedule records count: $vrac_count|$vrac_auto_count"; + &event_logger; + + $vle_count=0; + foreach(@SCARcallerid) + { + if ($SCARflag[$vle_count] > 0) + { + $vac_count=0; + $stmtA = "SELECT count(*) FROM vicidial_auto_calls where callerid='$SCARcallerid[$vle_count]' and lead_id='$SCARleadid[$vle_count]';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $vac_count = $aryA[0]; + } + $sthA->finish(); + + if ($vac_count < 1) + { + $stmtA = "SELECT campaign_id,status FROM vicidial_log where lead_id='$SCARleadid[$vle_count]' and call_date>=\"$SCARcalldate[$vle_count]\" and call_date < \"$SCARcalldateFIVE[$vle_count]\" order by call_date limit 1;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $SCARcampaign[$vle_count] = $aryA[0]; + $SCARstatus[$vle_count] = $aryA[1]; + $sthA->finish(); + + if ($SCARcampaigns =~ /\|$SCARcampaign[$vle_count]\|/i) + { + if ($SCARincall !~ /\|$SCARstatus[$vle_count]\|/i) + { + $SCARaads_value=''; + $SCARlists_value="''"; + $SCARcall_time_value=''; + $SCARreschedule_value=''; + $SCARcamp_match=0; + $SCARcamp_loop=0; + while ( ($SCARcamp_match < 1) && ($SCARcamp_loop <= $SCARcamp_count) ) + { + if ( ($SCARcampaign[$vle_count] =~ /$SCARcamp_id[$SCARcamp_loop]/i) && (length($SCARcampaign[$vle_count]) == length($SCARcamp_id[$SCARcamp_loop])) ) + { + $SCARcamp_match++; + $SCARaads_value = $SCARstatuses[$SCARcamp_loop]; + $SCARlists_value = $SCARlists[$SCARcamp_loop]; + $SCARcall_time_value = $SCARcall_time[$SCARcamp_loop]; + $SCARreschedule_value = $SCARcamp_reschedule[$SCARcamp_loop]; + } + $SCARcamp_loop++; + } + if ($SCARaads_value !~ / $SCARstatus[$vle_count] /i) + { + $event_string = " SCAR human-answered status no-match, starting auto-reschedule: $SCARcallerid[$vle_count]|$SCARstatus[$vle_count]|$SCARcallback_date[$vle_count]|$SCARreschedule_value|"; + &event_logger; + + @temp_dateARY = split(" ",$SCARcallback_date[$vle_count]); + @temp_orig_date = split("-",$temp_dateARY[0]); + @temp_orig_time = split(":",$temp_dateARY[1]); + $temp_orig_date[1] = ($temp_orig_date[1] - 1); + $temp_time = timelocal($temp_orig_time[2],$temp_orig_time[1],$temp_orig_time[0],$temp_orig_date[2],$temp_orig_date[1],$temp_orig_date[0]); + + $recheduled_first_date_calculated=0; + @SCARreschedule_valueARY = split('_',$SCARreschedule_value); + if ($SCARreschedule_valueARY[0] eq 'DAY') + {$temp_time_next = ($temp_time + (86400 * $SCARreschedule_valueARY[1]) ); $recheduled_first_date_calculated++;} + if ($SCARreschedule_valueARY[0] eq 'WEEK') + {$temp_time_next = ($temp_time + (604800 * $SCARreschedule_valueARY[1]) ); $recheduled_first_date_calculated++;} + if ($SCARreschedule_valueARY[0] eq 'MONTH') + {$temp_time_next = ($temp_time + (2419200 * $SCARreschedule_valueARY[1]) ); $recheduled_first_date_calculated++;} + if ($recheduled_first_date_calculated < 1) + {$temp_time_next = ($temp_time + 86400);} + + while ($now_date_epoch > $temp_time_next) + {$temp_time_next = ($temp_time_next + 86400);} + + $temp_SCAR_lead_id=''; $temp_SCAR_gmt_offset=''; $temp_SCAR_state=''; $temp_SCAR_list_id=''; + $stmtA = "SELECT gmt_offset_now,state,list_id,status FROM vicidial_list where lead_id='$SCARleadid[$vle_count]';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $temp_SCAR_lead_id = $SCARleadid[$vle_count]; + $temp_SCAR_gmt_offset = $aryA[0]; + $temp_SCAR_state = $aryA[1]; + $temp_SCAR_list_id = $aryA[2]; + $temp_SCAR_status = $aryA[3]; + } + $sthA->finish(); + + $stmtA = "SELECT local_call_time FROM vicidial_lists where list_id='$temp_SCAR_list_id';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $temp_list_call_time_override = $aryA[0]; + if ($temp_list_call_time_override ne 'campaign') + {$SCARcall_time_value = $temp_list_call_time_override;} + } + $sthA->finish(); + + $temp_time_dialable=0; $temp_count=0; $SCARcalldateNEW[$vle_count]=''; $SCARcalldateNEWlocal[$vle_count]=''; + while ( ($temp_time_dialable < 1) && ($temp_count < 58) ) + { + &temp_time_dialable_check; + if ($temp_time_dialable < 1) + { + if ($DBX > 0) {print " SCAR next time debug: $temp_count|$temp_time_next|$SCARcalldateNEW[$vle_count]|$SCARcalldateNEWlocal[$vle_count]|\n";} + # add 6 hours to temp_time_next for the next loop + $temp_time_next = ($temp_time_next + 21600); + } + $temp_count++; + } + if ($temp_time_dialable < 1) + { + $event_string = " SCAR auto-reschedule time failed: $SCARcallerid[$vle_count]|$SCARcallback_id[$vle_count]|$SCARcalldate[$vle_count]|$temp_orig_time|$temp_time_dialable|$temp_time_next|"; + &event_logger; + } + else + { + $event_string = " SCAR auto-reschedule time calculated: $SCARcallerid[$vle_count]|$SCARcallback_id[$vle_count]|$SCARcalldate[$vle_count]|$temp_orig_time|$SCARcalldateNEW[$vle_count]|"; + &event_logger; + + ### update existing vicidial_callbacks record with auto-reschedule time (,lead_status='$temp_SCAR_status') + $stmtA="UPDATE vicidial_callbacks SET status='ACTIVE',callback_time='$SCARcalldateNEW[$vle_count]' where callback_id='$SCARcallback_id[$vle_count]' and lead_id='$SCARleadid[$vle_count]';"; + $affected_rowsA = $dbhA->do($stmtA); + + ### set vicidial_recent_ascb_calls status non-match, set record to Y for processed, auto-reschedule updated + $stmtB = "UPDATE vicidial_recent_ascb_calls SET rescheduled='Y' where caller_code='$SCARcallerid[$vle_count]';"; + $affected_rowsB = $dbhA->do($stmtB); + + ### update existing vicidial_list record with CBHOLD status + $stmtC="UPDATE vicidial_list SET status='CBHOLD' where lead_id='$SCARleadid[$vle_count]';"; + $affected_rowsC = $dbhA->do($stmtC); + + $event_string = " SCAR auto-reschedule updated: $SCARcallerid[$vle_count]|$affected_rowsA|$affected_rowsB|$affected_rowsC|$stmtA|"; + &event_logger; + } + } + else + { + ### set vicidial_recent_ascb_calls record to P for processed as a human-answered call, not-auto-rescheduled + $stmtA = "UPDATE vicidial_recent_ascb_calls SET rescheduled='P' where caller_code='$SCARcallerid[$vle_count]';"; + $affected_rows = $dbhA->do($stmtA); + + $event_string = " SCAR match, log processed: $SCARcallerid[$vle_count]|$affected_rows"; + &event_logger; + } + } + else + { + $event_string = " SCAR status in-call, do nothing: $SCARcallerid[$vle_count]|$SCARuniqueid[$vle_count]|$SCARstatus[$vle_count]"; + &event_logger; + } + } + else + { + ### set vicidial_recent_ascb_calls record to N for no-auto-reschedule + $stmtA = "UPDATE vicidial_recent_ascb_calls SET rescheduled='N' where caller_code='$SCARcallerid[$vle_count]';"; + $affected_rows = $dbhA->do($stmtA); + } + } + else + { + $sthA->finish(); + $event_string = " SCAR no log entry, do nothing: $SCARcallerid[$vle_count]|$SCARcalldate[$vle_count]"; + &event_logger; + } + } + else + { + $event_string = " SCAR active call, do nothing: $SCARcallerid[$vle_count]"; + &event_logger; + } + } + else + { + ### set vicidial_recent_ascb_calls record to N for no-auto-reschedule because call was not outbound + $stmtA = "UPDATE vicidial_recent_ascb_calls SET rescheduled='N' where caller_code='$SCARcallerid[$vle_count]';"; + $affected_rows = $dbhA->do($stmtA); + } + $vle_count++; + } + } + ############################################################################### ###### last, wait for a little bit and repeat the loop @@ -3522,7 +3891,7 @@ while($one_day_interval > 0) $DBext_context = $aryA[3]; $max_vicidial_trunks = $DBmax_vicidial_trunks; if ($DBanswer_transfer_agent) {$answer_transfer_agent = $DBanswer_transfer_agent;} - if ($DBSERVER_GMT) {$SERVER_GMT = $DBSERVER_GMT;} + if (length($DBSERVER_GMT) > 0) {$SERVER_GMT = $DBSERVER_GMT;} if ($DBext_context) {$ext_context = $DBext_context;} } $sthA->finish(); @@ -3703,6 +4072,232 @@ sub get_time_now #get the current date and time and epoch for logging call lengt +sub temp_time_dialable_check + { + $SERVER_GMT_OFF=0; + $SERVERsec_diff=0; + $SERVERtemp_time_next = $temp_time_next; + $SERVERtempGMT_now = $SERVERtemp_time_next; + ($SXsec,$SXmin,$SXhour,$SXmday,$SXmon,$SXyear,$SXwday,$SXyday,$SXisdst) = localtime($SERVERtemp_time_next); + if ($SXisdst) {$SERVER_GMT_OFF++;} + if ( ($SXisdst > 0) && ($isdst < 1) ) + {$SERVERtempGMT_now = ($SERVERtemp_time_next - 3600); $SERVERsec_diff = -3600;} + if ( ($SXisdst < 1) && ($isdst > 0) ) + {$SERVERtempGMT_now = ($SERVERtemp_time_next + 3600); $SERVERsec_diff = 3600;} + ($SYsec,$SYmin,$SYhour,$SYmday,$SYmon,$SYyear,$SYwday,$SYyday,$SYisdst) = localtime($SERVERtempGMT_now); + $SYyear = ($SYyear + 1900); + $SYmon++; + if ($SYmon < 10) {$SYmon = "0$SYmon";} + if ($SYmday < 10) {$SYmday = "0$SYmday";} + if ($SYsec < 10) {$SYsec = "0$SYsec";} + if ($SYmin < 10) {$SYmin = "0$SYmin";} + if ($SYhour < 10) {$SYhour = "0$SYhour";} + $SCARcalldateNEW[$vle_count] = "$SYyear-$SYmon-$SYmday $SYhour:$SYmin:$SYsec"; + if ($DBX > 0) {print " SCAR debug Server time: |$SERVERtempGMT_now|$SXisdst|$isdst|$SERVERsec_diff|\n";} + + $SCARzone_diff = (($SERVER_GMT + $SERVER_GMT_OFF) - $temp_SCAR_gmt_offset); + $SCARzone=0; + if ($SCARzone_diff != 0) + {$SCARzone = (3600 * $SCARzone_diff);} + $LOCALnow_date_epoch = ($now_date_epoch + $SCARzone); + if ($DBX > 0) {print " SCAR debug Local time: |$SCARzone_diff (($SERVER_GMT + $SERVER_GMT_OFF) - $temp_SCAR_gmt_offset)|$LOCALnow_date_epoch ($now_date_epoch + $SCARzone)|\n";} + ($TNsec,$TNmin,$TNhour,$TNmday,$TNmon,$TNyear,$TNwday,$TNyday,$TNisdst) = localtime($LOCALnow_date_epoch); + $LOCALsec_diff=0; + $LOCALtemp_time_next = ($temp_time_next + $SCARzone); + ($TXsec,$TXmin,$TXhour,$TXmday,$TXmon,$TXyear,$TXwday,$TXyday,$TXisdst) = localtime($LOCALtemp_time_next); + if ( ($TXisdst > 0) && ($TNisdst < 1) ) + {$LOCALtempGMT_now = ($LOCALtemp_time_next - 3600); $LOCALsec_diff = -3600;} + if ( ($TXisdst < 1) && ($TNisdst > 0) ) + {$LOCALtempGMT_now = ($LOCALtemp_time_next + 3600); $LOCALsec_diff = 3600;} + $tempGMT_now = ($LOCALtemp_time_next + $LOCALsec_diff); + if ($DBX > 0) {print " SCAR debug time: |$TXisdst|$TNisdst|$LOCALtemp_time_next|$LOCALsec_diff|$tempGMT_now|\n";} + ($TYsec,$TYmin,$TYhour,$TYmday,$TYmon,$TYyear,$TYwday,$TYyday,$TYisdst) = localtime($tempGMT_now); + $TYyear = ($TYyear + 1900); + $TYmon++; + if ($TYmon < 10) {$TYmon = "0$TYmon";} + if ($TYmday < 10) {$TYmday = "0$TYmday";} + if ($TYsec < 10) {$TYsec = "0$TYsec";} + if ($TYmin < 10) {$TYmin = "0$TYmin";} + $SCARhour = "$TYhour$TYmin"; $SCARhour = ($SCARhour + 0); + if ($TYhour < 10) {$TYhour = "0$TYhour";} + $SCARcalldateNEWlocal[$vle_count] = "$TYyear-$TYmon-$TYmday $TYhour:$TYmin:$TYsec"; + $SCARdate = "$TYyear-$TYmon-$TYmday"; + + $ct_default_start='2400'; + $ct_default_stop='2400'; + $ct_state_call_times=''; + $ct_holidays=''; + $ct_day_start='2400'; + $ct_day_stop='2400'; + + $TY_timeSQL=',2400,2400'; + if ($TYwday eq '0') {$TY_timeSQL = ',ct_sunday_start,ct_sunday_stop';} + if ($TYwday eq '1') {$TY_timeSQL = ',ct_monday_start,ct_monday_stop';} + if ($TYwday eq '2') {$TY_timeSQL = ',ct_tuesday_start,ct_tuesday_stop';} + if ($TYwday eq '3') {$TY_timeSQL = ',ct_wednesday_start,ct_wednesday_stop';} + if ($TYwday eq '4') {$TY_timeSQL = ',ct_thursday_start,ct_thursday_stop';} + if ($TYwday eq '5') {$TY_timeSQL = ',ct_friday_start,ct_friday_stop';} + if ($TYwday eq '6') {$TY_timeSQL = ',ct_saturday_start,ct_saturday_stop';} + + ### Grab Call Time values from the database + $stmtA="SELECT ct_default_start,ct_default_stop,ct_state_call_times,ct_holidays $TY_timeSQL FROM vicidial_call_times where call_time_id='$SCARcall_time_value';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $ct_default_start = $aryA[0]; + $ct_default_stop = $aryA[1]; + $ct_state_call_times = $aryA[2]; + $ct_holidays = $aryA[3]; + $ct_day_start = $aryA[4]; + $ct_day_stop = $aryA[5]; + } + $sthA->finish(); + if ($DBX > 0) {print " SCAR call time debug: $sthArows|$stmtA|$SCARcall_time_value|$ct_default_start|$ct_default_stop|$ct_state_call_times|$ct_holidays|$ct_day_start|$ct_day_stop($TYwday)|\n";} + + ### Check for outbound holidays ### + $holiday_id = ''; $holidy_applied=0; + if (length($ct_holidays) > 2) + { + $ct_holidaysSQL = $ct_holidays; + $ct_holidaysSQL =~ s/\|/','/gi; + $ct_holidaysSQL = "'".$ct_holidaysSQL."'"; + + $stmtA="SELECT holiday_id,holiday_date,holiday_name,ct_default_start,ct_default_stop from vicidial_call_time_holidays where holiday_id IN($ct_holidaysSQL) and holiday_status='ACTIVE' and holiday_date='$SCARdate' order by holiday_id;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $holiday_id = $aryA[0]; + $holiday_date = $aryA[1]; + $holiday_name = $aryA[2]; + if ( ($ct_default_start < $aryA[3]) && ($ct_default_stop > 0) ) {$ct_default_start = $aryA[3]; $holidy_applied++;} + if ( ($ct_default_stop > $aryA[4]) && ($ct_default_stop > 0) ) {$ct_default_stop = $aryA[4]; $holidy_applied++;} + if ( ($ct_day_start < $aryA[3]) && ($ct_day_start > 0) ) {$ct_day_start = $aryA[3]; $holidy_applied++;} + if ( ($ct_day_stop > $aryA[4]) && ($ct_day_stop > 0) ) {$ct_day_stop = $aryA[4]; $holidy_applied++;} + } + $sthA->finish(); + if ($DBX > 0) {print " SCAR call time holiday debug: $sthArows|$stmtA|$ct_default_start|$ct_default_stop|$ct_state_call_times|$ct_day_start|$ct_day_stop|\n";} + } + ### BEGIN gather state call times, if configured + if ( (length($ct_state_call_times) > 2) && (length($temp_SCAR_state) > 0) ) + { + $state_ct_match=0; + $b=0; + @temp_state_rules = split( /\|/,$ct_state_call_times); + + if ($DBX > 0) {print " SCAR state call time count debug: -$ct_state_call_times-|$temp_SCAR_state|\n";} + + foreach(@temp_state_rules) + { + if (length($temp_state_rules[$b]) > 1) + { + $sct_default_start='2400'; + $sct_default_stop='2400'; + $sct_state_call_times=''; + $sct_holidays=''; + $sct_day_start='2400'; + $sct_day_stop='2400'; + $TY_StimeSQL=',2400,2400'; + if ($TYwday eq '0') {$TY_StimeSQL = ',sct_sunday_start,sct_sunday_stop';} + if ($TYwday eq '1') {$TY_StimeSQL = ',sct_monday_start,sct_monday_stop';} + if ($TYwday eq '2') {$TY_StimeSQL = ',sct_tuesday_start,sct_tuesday_stop';} + if ($TYwday eq '3') {$TY_StimeSQL = ',sct_wednesday_start,sct_wednesday_stop';} + if ($TYwday eq '4') {$TY_StimeSQL = ',sct_thursday_start,sct_thursday_stop';} + if ($TYwday eq '5') {$TY_StimeSQL = ',sct_friday_start,sct_friday_stop';} + if ($TYwday eq '6') {$TY_StimeSQL = ',sct_saturday_start,sct_saturday_stop';} + $stmtA="SELECT sct_default_start,sct_default_stop,ct_holidays $TY_StimeSQL from vicidial_state_call_times where state_call_time_id='$temp_state_rules[$b]' and state_call_time_state='$temp_SCAR_state';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $sct_default_start = $aryA[0]; + $sct_default_stop = $aryA[1]; + $sct_holidays = $aryA[2]; + $sct_day_start = $aryA[3]; + $sct_day_stop = $aryA[4]; + $state_ct_match++; + } + $sthA->finish(); + if ($DBX > 0) {print " SCAR state call time debug: $sthArows|$stmtA|$state_ct_match|$temp_state_rules[$b]|$temp_SCAR_state|$sct_default_start|$sct_default_stop|$sct_holidays|$sct_day_start|$sct_day_stop|\n";} + + if (length($sct_holidays) > 2) + { + $sholidy_applied=0; + $sct_holidaysSQL = $sct_holidays; + $sct_holidaysSQL =~ s/\|/','/gi; + $sct_holidaysSQL = "'".$sct_holidaysSQL."'"; + + $stmtA="SELECT holiday_id,holiday_date,holiday_name,ct_default_start,ct_default_stop from vicidial_call_time_holidays where holiday_id IN($sct_holidaysSQL) and holiday_status='ACTIVE' and holiday_date='$SCARdate' order by holiday_id;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $holiday_id = $aryA[0]; + $holiday_date = $aryA[1]; + $holiday_name = $aryA[2]; + if ( ($sct_default_start < $aryA[3]) && ($sct_default_stop > 0) ) {$sct_default_start = $aryA[3]; $sholidy_applied++;} + if ( ($sct_default_stop > $aryA[4]) && ($sct_default_stop > 0) ) {$sct_default_stop = $aryA[4]; $sholidy_applied++;} + if ( ($sct_day_start < $aryA[3]) && ($sct_day_start > 0) ) {$sct_day_start = $aryA[3]; $sholidy_applied++;} + if ( ($sct_day_stop > $aryA[4]) && ($sct_day_stop > 0) ) {$sct_day_stop = $aryA[4]; $sholidy_applied++;} + } + $sthA->finish(); + if ($DBX > 0) {print " SCAR state call time holiday debug: $sthArows|$stmtA|$sct_default_start|$sct_default_stop|$sct_state_call_times|$sct_day_start|$sct_day_stop|\n";} + } + if ( ($sholidy_applied < 1) && ($holidy_applied > 0) ) + { + if ( ($sct_default_start < $ct_default_start) && ($sct_default_stop > 0) ) {$sct_default_start = $ct_default_start;} + if ( ($sct_default_stop > $ct_default_stop) && ($sct_default_stop > 0) ) {$sct_default_stop = $ct_default_stop;} + if ( ($sct_day_start < $ct_default_start) && ($sct_day_start > 0) ) {$sct_day_start = $ct_default_start;} + if ( ($sct_day_stop > $ct_default_stop) && ($sct_day_stop > 0) ) {$sct_day_stop = $ct_default_stop;} + } + } + $b++; + } + } + ### END gather state call times, if configured + + if ($state_ct_match > 0) + { + # STATE RULES + if (($sct_day_start == 0) && ($sct_day_stop == 0)) + { + if ( ($SCARhour >= $sct_default_start) && ($SCARhour < $sct_default_stop) ) + {$temp_time_dialable=1;} + } + else + { + if ( ($SCARhour >= $sct_day_start) && ($SCARhour < $sct_day_stop) ) + {$temp_time_dialable=1;} + } + } + else + { + #NO STATE RULES + if ( ($ct_day_start == 0) and ($ct_day_stop == 0) ) + { + if ( ($SCARhour >= $ct_default_start) and ($SCARhour < $ct_default_stop) ) + {$temp_time_dialable=1;} + } + else + { + if ( ($SCARhour >= $ct_day_start) and ($SCARhour < $ct_day_stop) ) + {$temp_time_dialable=1;} + } + } + + if ($DBX > 0) {print " SCAR dialable debug: $temp_time_dialable|$state_ct_match|$SCARhour|$sct_default_start|$sct_default_stop|$sct_day_start|$sct_day_stop|$ct_default_start|$ct_default_stop|$ct_day_start|$ct_day_stop|$SCARcalldateNEWlocal[$vle_count]|$SCARdate\n";} + } + + sub event_logger { if ($DB) {print "$now_date|$event_string|\n";} diff --git a/bin/AST_VDauto_dial_FILL.pl b/bin/AST_VDauto_dial_FILL.pl index f24572f4..c3d29969 100644 --- a/bin/AST_VDauto_dial_FILL.pl +++ b/bin/AST_VDauto_dial_FILL.pl @@ -41,6 +41,7 @@ # 170915-1915 - Added support for per server routing prefix needed for Asterisk 13+ # 171205-2022 - Fix for double-dialing issue on high-volume systems # 180214-1558 - Added CID Group functionality +# 180812-1025 - Added code for scheduled_callbacks_auto_reschedule campaign feature # ### begin parsing run-time options ### @@ -341,7 +342,7 @@ while($one_day_interval > 0) ### grab the dial_level and multiply by active agents to get your goalcalls $DBIPadlevel[$camp_CIPct]=0; - $stmtA = "SELECT dial_timeout,dial_prefix,campaign_cid,active,campaign_vdad_exten,omit_phone_code,auto_alt_dial,queue_priority,use_custom_cid,cid_group_id FROM vicidial_campaigns where campaign_id='$DBfill_campaign[$camp_CIPct]';"; + $stmtA = "SELECT dial_timeout,dial_prefix,campaign_cid,active,campaign_vdad_exten,omit_phone_code,auto_alt_dial,queue_priority,use_custom_cid,cid_group_id,scheduled_callbacks_auto_reschedule FROM vicidial_campaigns where campaign_id='$DBfill_campaign[$camp_CIPct]';"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -360,6 +361,7 @@ while($one_day_interval > 0) $DBIPqueue_priority[$camp_CIPct] = $aryA[7]; $DBIPuse_custom_cid[$camp_CIPct] = $aryA[8]; $DBIPcid_group_id[$camp_CIPct] = $aryA[9]; + $DBIPscheduled_callbacks_auto_reschedule[$camp_CIPct] = $aryA[10]; if ($omit_phone_code =~ /Y/) {$DBIPomitcode[$camp_CIPct] = 1;} else {$DBIPomitcode[$camp_CIPct] = 0;} @@ -607,7 +609,7 @@ while($one_day_interval > 0) $lead_id=''; $phone_code=''; $phone_number=''; $called_count=''; while ($call_CMPIPct < $UDaffected_rows) { - $stmtA = "SELECT lead_id,alt_dial FROM vicidial_hopper where campaign_id='$DBfill_campaign[$camp_CIPct]' and status='QUEUE' and user='VDFC_$DB_camp_server_server_ip[$server_CIPct]' order by priority desc,hopper_id LIMIT 1;"; + $stmtA = "SELECT lead_id,alt_dial,source FROM vicidial_hopper where campaign_id='$DBfill_campaign[$camp_CIPct]' and status='QUEUE' and user='VDFC_$DB_camp_server_server_ip[$server_CIPct]' order by priority desc,hopper_id LIMIT 1;"; print "|$stmtA|\n"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -616,8 +618,9 @@ while($one_day_interval > 0) if ($sthArows > 0) { @aryA = $sthA->fetchrow_array; - $lead_id = $aryA[0]; - $alt_dial = $aryA[1]; + $lead_id = $aryA[0]; + $alt_dial = $aryA[1]; + $hopper_source = $aryA[2]; } $sthA->finish(); @@ -755,6 +758,34 @@ while($one_day_interval > 0) $vl_updates[$staggered_ct] = $stmtA; } + $PADlead_id = sprintf("%010s", $lead_id); while (length($PADlead_id) > 10) {chop($PADlead_id);} + # VmddhhmmssLLLLLLLLLL Set the callerIDname to a unique call_id string + $VqueryCID = "V$CIDdate$PADlead_id"; + + if ( ( ($DBIPscheduled_callbacks_auto_reschedule[$camp_CIPct] !~ /DISABLED/) && (length($DBIPscheduled_callbacks_auto_reschedule[$camp_CIPct]) > 0) ) || ($hopper_source eq 'C') ) + { + ### gather vicidial_callbacks information for this lead, if any + $stmtA = "SELECT callback_id,callback_time,lead_status,list_id FROM vicidial_callbacks where lead_id='$lead_id' and status='LIVE' and recipient='ANYONE' order by callback_id limit 1;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArowsPSCB=$sthA->rows; + if ($sthArowsPSCB > 0) + { + @aryA = $sthA->fetchrow_array; + $PSCBcallback_id = $aryA[0]; + $PSCBcallback_time = $aryA[1]; + $PSCBlead_status = $aryA[2]; + $PSCBlist_id = $aryA[3]; + } + $sthA->finish(); + ### insert record in recent callbacks table + if ($sthArowsPSCB > 0) + { + $stmtA = "INSERT INTO vicidial_recent_ascb_calls SET call_date=NOW(),callback_date='$PSCBcallback_time',callback_id='$PSCBcallback_id',caller_code='$VqueryCID',lead_id='$lead_id',server_ip='$DB_camp_server_server_ip[$server_CIPct]',orig_status='$PSCBlead_status',reschedule='$DBIPscheduled_callbacks_auto_reschedule[$camp_CIPct]',list_id='$PSCBlist_id',rescheduled='U';"; + $affected_rows = $dbhA->do($stmtA); + } + } + $stmtA = "DELETE FROM vicidial_hopper where lead_id='$lead_id';"; $affected_rows = $dbhA->do($stmtA); @@ -876,7 +907,6 @@ while($one_day_interval > 0) if ( (length($RECprefix)>0) && ($called_count < $RECcount) ) {$Local_out_prefix .= "$RECprefix";} } - $PADlead_id = sprintf("%010s", $lead_id); while (length($PADlead_id) > 10) {chop($PADlead_id);} if ($lists_update !~ /'$list_id'/) {$lists_update .= "'$list_id',"; $LUcount++;} @@ -892,8 +922,6 @@ while($one_day_interval > 0) if (length($ext_context) < 1) {$ext_context='default';} ### use manager middleware-app to connect the next call to the meetme room - # VmmddhhmmssLLLLLLLLL - $VqueryCID = "V$CIDdate$PADlead_id"; if ($CCID_on) {$CIDstring = "\"$VqueryCID\" <$CCID>";} else {$CIDstring = "$VqueryCID";} diff --git a/docs/ASTERISK_13.txt b/docs/ASTERISK_13.txt index ce1270af..db7659d2 100644 --- a/docs/ASTERISK_13.txt +++ b/docs/ASTERISK_13.txt @@ -67,7 +67,7 @@ cd ../../ wget http://download.vicidial.com/beta-apps/asterisk-13.21.0-vici.tar.gz tar xvfz asterisk-13.21.0-vici.tar.gz cd asterisk-13.21.0-vici/ -./configure --with-dahdi=/usr/src/asterisk/dahdi-linux-complete-2.11.1+2.11.1/ --with-gsm=internal --with-opus=/usr/lib64/ --with-speex=/usr/lib64/ --with-srtp=/usr/lib64/ --with-ogg=/usr/lib64/ --with-ssl --enable-asteriskssl --with-pjproject-bundled +./configure --with-dahdi=/usr/src/asterisk/dahdi-linux-complete-2.11.1+2.11.1/ --with-gsm=internal --with-opus=/usr/lib64/ --with-speex=/usr/lib64/ --with-srtp=/usr/lib64/ --with-ogg=/usr/lib64/ --with-ssl --enable-asteriskssl --with-pjproject-bundled --with-sqlite3=/usr/lib64/ make menuselect make make install diff --git a/extras/MySQL_AST_CREATE_tables.sql b/extras/MySQL_AST_CREATE_tables.sql index b21238f5..1040596c 100644 --- a/extras/MySQL_AST_CREATE_tables.sql +++ b/extras/MySQL_AST_CREATE_tables.sql @@ -1008,7 +1008,8 @@ dead_trigger_action ENUM('DISABLED','AUDIO','URL','AUDIO_AND_URL') default 'DISA dead_trigger_repeat ENUM('NO','REPEAT_ALL','REPEAT_AUDIO','REPEAT_URL') default 'NO', dead_trigger_filename TEXT, dead_trigger_url TEXT, -scheduled_callbacks_force_dial ENUM('N','Y') default 'N' +scheduled_callbacks_force_dial ENUM('N','Y') default 'N', +scheduled_callbacks_auto_reschedule VARCHAR(10) default 'DISABLED' ) ENGINE=MyISAM; CREATE TABLE vicidial_lists ( @@ -3977,6 +3978,22 @@ index (local_call_id), index (lead_id) ) ENGINE=MyISAM; +CREATE TABLE vicidial_recent_ascb_calls ( +call_date DATETIME, +callback_date DATETIME, +callback_id INT(9) UNSIGNED default '0', +caller_code VARCHAR(30) default '', +lead_id INT(9) UNSIGNED, +server_ip VARCHAR(60) NOT NULL, +orig_status VARCHAR(6) default 'CALLBK', +reschedule VARCHAR(10) default '', +list_id BIGINT(14) UNSIGNED, +rescheduled ENUM('U','P','Y','N') default 'U', +unique index (caller_code), +index (call_date), +index (lead_id) +) ENGINE=MyISAM; + ALTER TABLE vicidial_email_list MODIFY message text character set utf8; @@ -4191,6 +4208,8 @@ ALTER TABLE vicidial_agent_function_log_archive MODIFY agent_function_log_id INT CREATE TABLE vicidial_did_log_archive LIKE vicidial_did_log; CREATE UNIQUE INDEX vdidla_key on vicidial_did_log_archive(uniqueid, call_date, server_ip); +CREATE TABLE vicidial_recent_ascb_calls_archive LIKE vicidial_recent_ascb_calls; + GRANT RELOAD ON *.* TO cron@'%'; GRANT RELOAD ON *.* TO cron@localhost; @@ -4267,4 +4286,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='1552',db_schema_update_date=NOW(),reload_timestamp=NOW(); +UPDATE system_settings SET db_schema_version='1553',db_schema_update_date=NOW(),reload_timestamp=NOW(); diff --git a/extras/upgrade_2.14.sql b/extras/upgrade_2.14.sql index 0beb1333..417f61ec 100644 --- a/extras/upgrade_2.14.sql +++ b/extras/upgrade_2.14.sql @@ -703,3 +703,25 @@ UPDATE system_settings SET db_schema_version='1551',db_schema_update_date=NOW() ALTER TABLE vicidial_campaigns ADD scheduled_callbacks_force_dial ENUM('N','Y') default 'N'; UPDATE system_settings SET db_schema_version='1552',db_schema_update_date=NOW() where db_schema_version < 1552; + +ALTER TABLE vicidial_campaigns ADD scheduled_callbacks_auto_reschedule VARCHAR(10) default 'DISABLED'; + +CREATE TABLE vicidial_recent_ascb_calls ( +call_date DATETIME, +callback_date DATETIME, +callback_id INT(9) UNSIGNED default '0', +caller_code VARCHAR(30) default '', +lead_id INT(9) UNSIGNED, +server_ip VARCHAR(60) NOT NULL, +orig_status VARCHAR(6) default 'CALLBK', +reschedule VARCHAR(10) default '', +list_id BIGINT(14) UNSIGNED, +rescheduled ENUM('U','P','Y','N') default 'U', +unique index (caller_code), +index (call_date), +index (lead_id) +) ENGINE=MyISAM; + +CREATE TABLE vicidial_recent_ascb_calls_archive LIKE vicidial_recent_ascb_calls; + +UPDATE system_settings SET db_schema_version='1553',db_schema_update_date=NOW() where db_schema_version < 1553; diff --git a/www/agc/vdc_db_query.php b/www/agc/vdc_db_query.php index ab00bd98..4049d1f9 100644 --- a/www/agc/vdc_db_query.php +++ b/www/agc/vdc_db_query.php @@ -458,13 +458,14 @@ # 180520-1031 - Added use of screen labels in search results, Issue #1104 # 180522-1920 - Added Routing Initiated Recording ability for manual dial calls # 180610-2308 - Added code for Dead Call Trigger features +# 180818-2147 - Added code for scheduled_callbacks_auto_reschedule # -$version = '2.14-352'; -$build = '180610-2308'; +$version = '2.14-353'; +$build = '180818-2147'; $php_script = 'vdc_db_query.php'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=756; +$mysql_log_count=762; $one_mysql_log=0; $DB=0; $VD_login=0; @@ -4253,7 +4254,7 @@ if ($ACTION == 'manDiaLnextCaLL') if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} ### check for custom cid use $use_custom_cid=0; - $stmt = "SELECT use_custom_cid,manual_dial_hopper_check,start_call_url,manual_dial_filter,use_internal_dnc,use_campaign_dnc,use_other_campaign_dnc,cid_group_id 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 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";} @@ -4261,14 +4262,15 @@ if ($ACTION == 'manDiaLnextCaLL') if ($uccid_ct > 0) { $row=mysqli_fetch_row($rslt); - $use_custom_cid = $row[0]; - $manual_dial_hopper_check = $row[1]; - $OUT_start_call_url = $row[2]; - $manual_dial_filter = $row[3]; - $use_internal_dnc = $row[4]; - $use_campaign_dnc = $row[5]; - $use_other_campaign_dnc = $row[6]; - $cid_group_id = $row[7]; + $use_custom_cid = $row[0]; + $manual_dial_hopper_check = $row[1]; + $OUT_start_call_url = $row[2]; + $manual_dial_filter = $row[3]; + $use_internal_dnc = $row[4]; + $use_campaign_dnc = $row[5]; + $use_other_campaign_dnc = $row[6]; + $cid_group_id = $row[7]; + $scheduled_callbacks_auto_reschedule = $row[8]; } if ($no_hopper_dialing_used > 0) @@ -4585,6 +4587,33 @@ if ($ACTION == 'manDiaLnextCaLL') $Ndialstring = "$loop_ingroup_dial_prefix$dial_wait_seconds$dial_ingroup_dialstring"; } + if ( ($scheduled_callbacks_auto_reschedule != 'DISABLED') and (strlen($scheduled_callbacks_auto_reschedule) > 0) ) + { + ### gather vicidial_callbacks information for this lead, if any + $stmt = "SELECT callback_id,callback_time,lead_status,list_id FROM vicidial_callbacks where lead_id='$lead_id' and status='LIVE' and recipient='ANYONE' order by callback_id limit 1;"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00757',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vcb_ct = mysqli_num_rows($rslt); + if ($vcb_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $PSCBcallback_id = $row[0]; + $PSCBcallback_time = $row[1]; + $PSCBlead_status = $row[2]; + $PSCBlist_id = $row[3]; + } + + ### insert record in recent callbacks table + if ($vcb_ct > 0) + { + $stmt = "INSERT INTO vicidial_recent_ascb_calls SET call_date=NOW(),callback_date='$PSCBcallback_time',callback_id='$PSCBcallback_id',caller_code='$MqueryCID',lead_id='$lead_id',server_ip='$server_ip',orig_status='$PSCBlead_status',reschedule='$scheduled_callbacks_auto_reschedule',list_id='$PSCBlist_id',rescheduled='U';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00758',$user,$server_ip,$session_name,$one_mysql_log);} + } + } + if ($CCID_on) {$CIDstring = "\"$MqueryCID$EAC\" <$CCID>";} else {$CIDstring = "$MqueryCID$EAC";} @@ -5577,7 +5606,7 @@ if ($ACTION == 'manDiaLonly') ### check for manual dial filter and extension append settings in campaign $use_eac=0; $use_custom_cid=0; - $stmt = "SELECT manual_dial_filter,use_internal_dnc,use_campaign_dnc,use_other_campaign_dnc,extension_appended_cidname,start_call_url 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 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";} @@ -5585,12 +5614,13 @@ if ($ACTION == 'manDiaLonly') if ($vcstgs_ct > 0) { $row=mysqli_fetch_row($rslt); - $manual_dial_filter = $row[0]; - $use_internal_dnc = $row[1]; - $use_campaign_dnc = $row[2]; - $use_other_campaign_dnc = $row[3]; - $extension_appended_cidname = $row[4]; - $start_call_url = $row[5]; + $manual_dial_filter = $row[0]; + $use_internal_dnc = $row[1]; + $use_campaign_dnc = $row[2]; + $use_other_campaign_dnc = $row[3]; + $extension_appended_cidname = $row[4]; + $start_call_url = $row[5]; + $scheduled_callbacks_auto_reschedule = $row[6]; if ($extension_appended_cidname == 'Y') {$use_eac++;} } @@ -5944,6 +5974,32 @@ if ($ACTION == 'manDiaLonly') else {$account=''; $variable='';} + if ( ($scheduled_callbacks_auto_reschedule != 'DISABLED') and (strlen($scheduled_callbacks_auto_reschedule) > 0) ) + { + ### gather vicidial_callbacks information for this lead, if any + $stmt = "SELECT callback_id,callback_time,lead_status,list_id FROM vicidial_callbacks where lead_id='$lead_id' and status='LIVE' and recipient='ANYONE' order by callback_id limit 1;"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00759',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vcb_ct = mysqli_num_rows($rslt); + if ($vcb_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $PSCBcallback_id = $row[0]; + $PSCBcallback_time = $row[1]; + $PSCBlead_status = $row[2]; + $PSCBlist_id = $row[3]; + } + + ### insert record in recent callbacks table + if ($vcb_ct > 0) + { + $stmt = "INSERT INTO vicidial_recent_ascb_calls SET call_date=NOW(),callback_date='$PSCBcallback_time',callback_id='$PSCBcallback_id',caller_code='$MqueryCID',lead_id='$lead_id',server_ip='$server_ip',orig_status='$PSCBlead_status',reschedule='$scheduled_callbacks_auto_reschedule',list_id='$PSCBlist_id',rescheduled='U';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00760',$user,$server_ip,$session_name,$one_mysql_log);} + } + } ### whether to omit phone_code or not if (preg_match('/Y/i',$omit_phone_code)) {$Ndialstring = "$Local_out_prefix$phone_number";} @@ -16402,7 +16458,7 @@ if ($ACTION == 'LEADINFOview') $campaignCBdisplaydaysSQL = ''; $stmt = "SELECT callback_hours_block,callback_list_calltime,local_call_time,callback_display_days from vicidial_campaigns where campaign_id='$campaign';"; $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,'00761',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$camp_count = mysqli_num_rows($rslt);} if ($camp_count > 0) { @@ -16429,7 +16485,7 @@ if ($ACTION == 'LEADINFOview') $stmt = "SELECT callback_id,lead_id from vicidial_callbacks where recipient='USERONLY' and user='$user' $campaignCBsql $campaignCBhoursSQL $campaignCBdisplaydaysSQL and status IN('LIVE') order by callback_time limit 1;"; if ($DB) {echo "$stmt\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,'00762',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$callbacks_count = mysqli_num_rows($rslt);} if ($callbacks_count > 0) { diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index 615acb00..3cc513ec 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -2403,6 +2403,8 @@ if (isset($_GET["agent_logout_link"])) {$agent_logout_link=$_GET["agent_logout elseif (isset($_POST["agent_logout_link"])) {$agent_logout_link=$_POST["agent_logout_link"];} if (isset($_GET["scheduled_callbacks_force_dial"])) {$scheduled_callbacks_force_dial=$_GET["scheduled_callbacks_force_dial"];} elseif (isset($_POST["scheduled_callbacks_force_dial"])) {$scheduled_callbacks_force_dial=$_POST["scheduled_callbacks_force_dial"];} +if (isset($_GET["scheduled_callbacks_auto_reschedule"])) {$scheduled_callbacks_auto_reschedule=$_GET["scheduled_callbacks_auto_reschedule"];} + elseif (isset($_POST["scheduled_callbacks_auto_reschedule"])) {$scheduled_callbacks_auto_reschedule=$_POST["scheduled_callbacks_auto_reschedule"];} if (isset($script_id)) {$script_id= strtoupper($script_id);} @@ -3367,6 +3369,7 @@ if ($non_latin < 1) $dead_trigger_repeat = preg_replace('/[^-_0-9a-zA-Z]/','',$dead_trigger_repeat); $cid_cb_confirm_number = preg_replace('/[^-_0-9a-zA-Z]/','',$cid_cb_confirm_number); $cid_cb_invalid_filter_phone_group = preg_replace('/[^-_0-9a-zA-Z]/','',$cid_cb_invalid_filter_phone_group); + $scheduled_callbacks_auto_reschedule = preg_replace('/[^-_0-9a-zA-Z]/','',$scheduled_callbacks_auto_reschedule); ### ALPHA-NUMERIC and underscore and dash and slash and dot $menu_timeout_prompt = preg_replace('/[^-\/\|\._0-9a-zA-Z]/','',$menu_timeout_prompt); @@ -4432,12 +4435,13 @@ else # 180807-0958 - Added change for admin change log for Admin Modify Lead to better show lead changes # 180807-1653 - Added agent_logout_link credentials setting to System Settings # 180809-1547 - Added scheduled_callbacks_force_dial campaign setting +# 180812-0902 - Added scheduled_callbacks_auto_reschedule campaign setting # # 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-683a'; -$build = '180809-1547'; +$admin_version = '2.14-684a'; +$build = '180812-0902'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -10013,7 +10017,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) 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 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) 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 from vicidial_campaigns where campaign_id='$source_campaign_id';"; $rslt=mysql_to_mysqli($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; @@ -14288,7 +14292,7 @@ if ($ADD==41) if ( ($agent_select_territories != 'Y') and ($agent_select_territories != 'N') ) {$agent_select_territories='N';} if (strlen($max_inbound_calls_outcome) < 1) {$max_inbound_calls_outcome='DEFAULT';} - $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' 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' where campaign_id='$campaign_id';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmtA, $link); @@ -21787,7 +21791,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 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 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]; @@ -22063,6 +22067,7 @@ if ($ADD==31) $dead_trigger_filename=$row[271]; $dead_trigger_url=$row[272]; $scheduled_callbacks_force_dial=$row[273]; + $scheduled_callbacks_auto_reschedule=$row[274]; if (preg_match('/DISABLED/', $list_order_mix)) {$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;} @@ -23185,6 +23190,8 @@ if ($ADD==31) echo ""._QXZ("Scheduled Callbacks Force Dial").": $NWB#campaigns-scheduled_callbacks_force_dial$NWE\n"; + echo ""._QXZ("Scheduled Callbacks Auto Reschedule").": $NWB#campaigns-scheduled_callbacks_auto_reschedule$NWE\n"; + if ($SSoutbound_autodial_active > 0) { echo ""._QXZ("Drop Call Seconds").": $NWB#campaigns-drop_call_seconds$NWE\n"; diff --git a/www/vicidial/help_documentation.txt b/www/vicidial/help_documentation.txt index 19287192..77778d14 100644 --- a/www/vicidial/help_documentation.txt +++ b/www/vicidial/help_documentation.txt @@ -1,4 +1,4 @@ -# version: 201808091644 +# version: 201808120907 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. 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. Default is N. @@ -260,6 +260,7 @@ campaigns-show_previous_callback Show Previous Callback This option if enab campaigns-callback_useronly_move_minutes Scheduled Callbacks Useronly Move Minutes This option if set to a number greater than 0, will change all USERONLY Scheduled Callbacks that are X minutes after their callback time to ANYONE callbacks. This process runs every minute. Default is 0 for disabled. campaigns-next_dial_my_callbacks Next-Dial My Callbacks This option only works for MANUAL and INBOUND_MAN dial methods, and also only if No Hopper Dialing is enabled. This feature will look for Scheduled Callbacks that have triggered for the agent and dial them next when the agent clicks on the Dial Next Number button on their agent screen. Default is DISABLED. campaigns-scheduled_callbacks_force_dial Scheduled Callbacks Force Dial This feature will force an agent to a paused state and block out their screen with the next triggered USERONLY scheduled callback to be called. The agent's only option will be to dial this callback, although they are able to look at lead info before they do that. If there are multiple triggered scheduled callbacks for the agent, they all must be called before the agent can move on to handling other items. This feature will not pay attention to the Call Time that is set for the campaign, so these calls may be dialed outside of the set call time. The agent must be able to place manual dial calls for this feature to work. Default is N for disabled. +campaigns-scheduled_callbacks_auto_reschedule Scheduled Callbacks Auto Reschedule This feature only affects ANYONE scheduled callbacks. If DAY_1 is used, it will automatically reschedule lead lead to be called back on the next calling day at thee same time they were called if the resulting disposition of the call was not a Human Answer -Y- status. The next calling day is determined by the Call Time that is set for the campaign. In the case of DAY_1, if tomorrow is not an allowed calling day, the system will look at the next day and then the next day until it finds the next allowable calling day to set the ANYONE scheduled callback for. There are up to 6 DAY options, then there are up to 3 WEEK options, then there are up to 6 MONTH options. Default is DISABLED. campaigns-wrapup_seconds Wrap Up Seconds The number of seconds to force an agent to wait before allowing them to receive or dial another call. The timer begins as soon as an agent hangs up on their customer - or in the case of alternate number dialing when the agent finishes the lead - Default is 0 seconds. If the timer runs out before the agent has dispositioned the call, the agent still will NOT move on to the next call until they select a disposition. campaigns-wrapup_message Wrap Up Message This is a campaign-specific message to be displayed on the wrap up screen if wrap up seconds is set. You can use a Script in the system if you use the script id with WUSCRIPT in front of it, so if you wanted to use a script called agent_script, then you would put WUSCRIPTagent_script in this field. campaigns-wrapup_bypass Wrap Up Bypass If set to ENABLED then the agent will be able to click a link to stop the Wrap Up timer before the time is completed. Default is ENABLED.