Added max_inbound_auto_reenable system setting and function to re-enable agent in-group selections after max_inbound_calls has been raised

git-svn-id: svn://192.168.202.10@3975 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2026-04-10 00:40:17 +00:00
parent 11b535beba
commit a49abdc873
9 changed files with 489 additions and 118 deletions
+84 -75
View File
@@ -269,6 +269,7 @@
# 250924-2147 - Added code for deprecation of "Monitor" application after Asterisk 20
# 251001-1836 - Fix for rare Stereo recording filename issue
# 251020-0836 - Added code for recording_dtmf_muting, fix for stereo call recording
# 260403-2249 - Added vicidial_max_inbound_cache logging
#
$script = 'agi-VDAD_ALL_inbound.agi';
@@ -280,7 +281,7 @@ $wait_prompt_runs=0;
$at='@';
$S='*';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=275;
$mysql_log_count=341;
$one_mysql_log=0;
$dial_ingroup_flag=0;
$called_count=1;
@@ -3468,7 +3469,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
{if ($SSrecording_dtmf_muting > 1) {$recording_dtmf_muting = $SSrecording_dtmf_muting;} }
$stmtD = "INSERT INTO recording_live (recording_id,recording_type,server_ip,start_time,channel,filename,lead_id,user,dtmf_muting_end_time,recording_status,dtmf_muting_seconds) values('$recording_id','MONO_LEGACY_RIR','$VDADserver_ip','$now_date','$channelrec','$campaign_rec_filename','$insert_lead_id','$VDADuser','2020-12-31 23:59:59','STARTED','$recording_dtmf_muting');";
$rLIVEaffected_rows = $dbhA->do($stmtD);
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$rLIVEaffected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='01276'; $MEL_aff_rows=$rLIVEaffected_rows; &mysql_error_logging;
if ($AGILOG) {$agi_string = "-- ROUTING INITIATED RECORDING STARTED : |$affected_rows|$recording_id|$campaign_rec_filename|$stmtA| |$affected_rowsB|$stmtB| |$affected_rowsC|$stmtC| |$rLIVEaffected_rows|$stmtD|"; &agi_output;}
}
@@ -3498,12 +3499,12 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
### insert record into recording_log_parallel table ###
$stmtA = "INSERT INTO recording_log_parallel (channel,server_ip,extension,start_time,length_in_sec,filename,lead_id,user,vicidial_id,recording_status) values('$channel','$VARserver_ip','','$now_date','0','PL$stereo_rec_filename','$insert_lead_id','$VDADuser','$insert_close_id','START');";
$SRaffected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$SRaffected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='01277'; $MEL_aff_rows=$SRaffected_rows; &mysql_error_logging;
$stmtB = "SELECT LAST_INSERT_ID() LIMIT 1;";
$sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $stmtA=$stmtB; $mysql_count='02XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
$dbhP=$dbhA; $stmtA=$stmtB; $mysql_count='02278'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
@@ -3538,12 +3539,12 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
### insert a record into the recording_log table
$stmtA = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user,vicidial_id) values('$channel','$VARserver_ip','SPCO','$now_date','$now_date_epoch','$temp_parallel_rec_co_filename','$insert_lead_id','$VDADuser','$insert_close_id')";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='02279'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$stmtB = "SELECT LAST_INSERT_ID() LIMIT 1;";
$sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $stmtA=$stmtB; $mysql_count='02XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
$dbhP=$dbhA; $stmtA=$stmtB; $mysql_count='02280'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
@@ -3557,19 +3558,19 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
$stmtA = "UPDATE recording_log SET filename='$temp_parallel_rec_co_filename' where recording_id='$recording_id';";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='02281'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
}
### insert record into recording_log_stereo table ###
$stmtA = "INSERT INTO recording_log_stereo (recording_id,server_ip,start_time,length_in_sec,filename,lead_id,options,processing_log,parallel_recording_id,recording_status) values('$recording_id','$VARserver_ip','$now_date','0','$temp_parallel_rec_co_filename','$insert_lead_id','$channel_group STEREO_PARALLEL CUSTOMER-ONLY $stereo_recording','start: $now_date|vicidial_id: $insert_close_id|user: $VDADuser|channel: $channel|','$parallel_recording_id','PARALLEL START');";
$SRaffected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$SRaffected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='01282'; $MEL_aff_rows=$SRaffected_rows; &mysql_error_logging;
if ( ($SSrecording_dtmf_detection > 0) && ($SSrecording_dtmf_muting > 0) )
{if ($SSrecording_dtmf_muting > 1) {$recording_dtmf_muting = $SSrecording_dtmf_muting;} }
$stmtD = "INSERT INTO recording_live (recording_id,recording_type,server_ip,start_time,channel,filename,lead_id,user,dtmf_muting_end_time,recording_status,dtmf_muting_seconds) values('$recording_id','STEREO_PARALLEL CUSTOMER-ONLY','$VARserver_ip','$now_date','$channel','$temp_parallel_rec_co_filename','$insert_lead_id','$VDADuser','2020-12-31 23:59:59','STARTED','$recording_dtmf_muting');";
$rLIVEaffected_rows = $dbhA->do($stmtD);
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$rLIVEaffected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='01283'; $MEL_aff_rows=$rLIVEaffected_rows; &mysql_error_logging;
if ($AGILOG) {$agi_string = "-- PARALLEL CO STEREO RECORDING LOG INSERT : |$SRaffected_rows|$recording_id|$parallel_recording_id|$rLIVEaffected_rows|$stmtA|"; &agi_output;}
}
@@ -3595,12 +3596,12 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
### insert a record into the recording_log table
$stmtA = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user,vicidial_id) values('$channel','$VARserver_ip','SPCM','$now_date','$now_date_epoch','$temp_parallel_rec_cm_filename','$insert_lead_id','$VDADuser','$insert_close_id')";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='02284'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$stmtB = "SELECT LAST_INSERT_ID() LIMIT 1;";
$sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $stmtA=$stmtB; $mysql_count='02XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
$dbhP=$dbhA; $stmtA=$stmtB; $mysql_count='02285'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
@@ -3614,19 +3615,19 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
$stmtA = "UPDATE recording_log SET filename='$temp_parallel_rec_cm_filename' where recording_id='$recording_id';";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='02286'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
}
### insert record into recording_log_stereo table ###
$stmtA = "INSERT INTO recording_log_stereo (recording_id,server_ip,start_time,length_in_sec,filename,lead_id,options,processing_log,parallel_recording_id,recording_status) values('$recording_id','$VARserver_ip','$now_date','0','$temp_parallel_rec_cm_filename','$insert_lead_id','$channel_group STEREO_PARALLEL CUSTOMER-MUTED $stereo_recording','start: $now_date|vicidial_id: $insert_close_id|user: $VDADuser|channel: $channel|','$parallel_recording_id','PARALLEL START');";
$SRaffected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$SRaffected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='01287'; $MEL_aff_rows=$SRaffected_rows; &mysql_error_logging;
if ( ($SSrecording_dtmf_detection > 0) && ($SSrecording_dtmf_muting > 0) )
{if ($SSrecording_dtmf_muting > 1) {$recording_dtmf_muting = $SSrecording_dtmf_muting;} }
$stmtD = "INSERT INTO recording_live (recording_id,recording_type,server_ip,start_time,channel,filename,lead_id,user,dtmf_muting_end_time,recording_status,dtmf_muting_seconds) values('$recording_id','STEREO_PARALLEL CUSTOMER-MUTED','$VARserver_ip','$now_date','$channel','$temp_parallel_rec_cm_filename','$insert_lead_id','$VDADuser','2020-12-31 23:59:59','STARTED','$recording_dtmf_muting');";
$rLIVEaffected_rows = $dbhA->do($stmtD);
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$rLIVEaffected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='01288'; $MEL_aff_rows=$rLIVEaffected_rows; &mysql_error_logging;
if ($AGILOG) {$agi_string = "-- PARALLEL CM STEREO RECORDING LOG INSERT : |$SRaffected_rows|$recording_id|$parallel_recording_id|$rLIVEaffected_rows|$stmtA|"; &agi_output;}
}
@@ -3652,12 +3653,12 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
### insert a record into the recording_log table
$stmtA = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user,vicidial_id) values('$channel','$VARserver_ip','SPFR','$now_date','$now_date_epoch','$temp_parallel_rec_fr_filename','$insert_lead_id','$VDADuser','$insert_close_id')";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='02289'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$stmtB = "SELECT LAST_INSERT_ID() LIMIT 1;";
$sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $stmtA=$stmtB; $mysql_count='02XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
$dbhP=$dbhA; $stmtA=$stmtB; $mysql_count='02290'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
@@ -3671,19 +3672,19 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
$stmtA = "UPDATE recording_log SET filename='$temp_parallel_rec_fr_filename' where recording_id='$recording_id';";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='02291'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
}
### insert record into recording_log_stereo table ###
$stmtA = "INSERT INTO recording_log_stereo (recording_id,server_ip,start_time,length_in_sec,filename,lead_id,options,processing_log,parallel_recording_id,recording_status) values('$recording_id','$VARserver_ip','$now_date','0','$temp_parallel_rec_fr_filename','$insert_lead_id','$channel_group STEREO_PARALLEL FULL-RECORDING $stereo_recording','start: $now_date|vicidial_id: $insert_close_id|user: $VDADuser|channel: $channel|','$parallel_recording_id','PARALLEL START');";
$SRaffected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$SRaffected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='01292'; $MEL_aff_rows=$SRaffected_rows; &mysql_error_logging;
if ( ($SSrecording_dtmf_detection > 0) && ($SSrecording_dtmf_muting > 0) )
{if ($SSrecording_dtmf_muting > 1) {$recording_dtmf_muting = $SSrecording_dtmf_muting;} }
$stmtD = "INSERT INTO recording_live (recording_id,recording_type,server_ip,start_time,channel,filename,lead_id,user,dtmf_muting_end_time,recording_status,dtmf_muting_seconds) values('$recording_id','STEREO_PARALLEL FULL-RECORDING','$VARserver_ip','$now_date','$channel','$temp_parallel_rec_fr_filename','$insert_lead_id','$VDADuser','2020-12-31 23:59:59','STARTED','$recording_dtmf_muting');";
$rLIVEaffected_rows = $dbhA->do($stmtD);
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$rLIVEaffected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='01293'; $MEL_aff_rows=$rLIVEaffected_rows; &mysql_error_logging;
if ($AGILOG) {$agi_string = "-- PARALLEL FR STEREO RECORDING LOG INSERT : |$SRaffected_rows|$recording_id|$parallel_recording_id|$rLIVEaffected_rows|$stmtA|"; &agi_output;}
}
@@ -3695,12 +3696,12 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
### insert a record into the recording_log table
$stmtA = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user,vicidial_id) values('$channel','$VARserver_ip','SPACI','$now_date','$now_date_epoch','$temp_parallel_rec_ag_filename','$insert_lead_id','$VDADuser','$insert_close_id')";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='02294'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$stmtB = "SELECT LAST_INSERT_ID() LIMIT 1;";
$sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $stmtA=$stmtB; $mysql_count='02XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
$dbhP=$dbhA; $stmtA=$stmtB; $mysql_count='02295'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
@@ -3714,23 +3715,23 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
$stmtA = "UPDATE recording_log SET filename='$temp_parallel_rec_ag_filename' where recording_id='$recording_id';";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='02296'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
}
### insert record into recording_log_stereo table ###
$stmtA = "INSERT INTO recording_log_stereo (recording_id,server_ip,start_time,length_in_sec,filename,lead_id,options,processing_log,parallel_recording_id,recording_status) values('$recording_id','$VARserver_ip','$now_date','0','$temp_parallel_rec_ag_filename','$insert_lead_id','$channel_group STEREO_PARALLEL AGENT-CONTROLLED RIR $stereo_recording $stereo_recording_agent','start: $now_date|vicidial_id: $insert_close_id|user: $VDADuser|channel: $channel|','$parallel_recording_id','PARALLEL START');";
$SRaffected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$SRaffected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='01297'; $MEL_aff_rows=$SRaffected_rows; &mysql_error_logging;
$stmtB = "INSERT INTO routing_initiated_recordings (recording_id,filename,launch_time,lead_id,vicidial_id,user,processed,rir_type) values('$recording_id','$temp_parallel_rec_ag_filename','$now_date','$insert_lead_id','$insert_close_id','$VDADuser','0','S')";
$affected_rowsB = $dbhA->do($stmtB);
$dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$affected_rowsB; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='02298'; $MEL_aff_rows=$affected_rowsB; &mysql_error_logging;
if ( ($SSrecording_dtmf_detection > 0) && ($SSrecording_dtmf_muting > 0) )
{if ($SSrecording_dtmf_muting > 1) {$recording_dtmf_muting = $SSrecording_dtmf_muting;} }
$stmtD = "INSERT INTO recording_live (recording_id,recording_type,server_ip,start_time,channel,filename,lead_id,user,dtmf_muting_end_time,recording_status,dtmf_muting_seconds) values('$recording_id','STEREO_PARALLEL AGENT-CONTROLLED RIR','$VARserver_ip','$now_date','$channel','$temp_parallel_rec_ag_filename','$insert_lead_id','$VDADuser','2020-12-31 23:59:59','STARTED','$recording_dtmf_muting');";
$rLIVEaffected_rows = $dbhA->do($stmtD);
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$rLIVEaffected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='01299'; $MEL_aff_rows=$rLIVEaffected_rows; &mysql_error_logging;
if ($AGILOG) {$agi_string = "-- PARALLEL AG STEREO RECORDING LOG INSERT : |$SRaffected_rows|$recording_id|$parallel_recording_id|$affected_rowsB|$rLIVEaffected_rows|$stmtA|"; &agi_output;}
}
@@ -3749,12 +3750,12 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
# insert a record into the recording_log table
$stmtA = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user,vicidial_id) values('$channel','$VARserver_ip','$rl_exten','$now_date','$now_date_epoch','$stereo_rec_filename','$insert_lead_id','$VDADuser','$insert_close_id')";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='02300'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$stmtB = "SELECT LAST_INSERT_ID() LIMIT 1;";
$sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $stmtA=$stmtB; $mysql_count='02XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
$dbhP=$dbhA; $stmtA=$stmtB; $mysql_count='02301'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
@@ -3768,7 +3769,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
$stmtA = "UPDATE recording_log SET filename='$stereo_rec_filename' where recording_id='$recording_id';";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='02302'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
}
$retval_stop = $AGI->exec("StopMixMonitor","");
@@ -3777,17 +3778,17 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
### insert record into recording_log_stereo table ###
$stmtA = "INSERT INTO recording_log_stereo (recording_id,server_ip,start_time,length_in_sec,filename,lead_id,options,processing_log,recording_status) values('$recording_id','$VARserver_ip','$now_date','0','$stereo_rec_filename','$insert_lead_id','$channel_group STEREO AGENT-CONTROLLED $stereo_recording $stereo_recording_agent','start: $now_date|vicidial_id: $insert_close_id|user: $VDADuser|channel: $channel|','STEREO START');";
$SRaffected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$SRaffected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='01303'; $MEL_aff_rows=$SRaffected_rows; &mysql_error_logging;
$stmtB = "INSERT INTO routing_initiated_recordings (recording_id,filename,launch_time,lead_id,vicidial_id,user,processed,rir_type) values('$recording_id','$stereo_rec_filename','$now_date','$insert_lead_id','$insert_close_id','$VDADuser','0','S')";
$affected_rowsB = $dbhA->do($stmtB);
$dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$affected_rowsB; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='02304'; $MEL_aff_rows=$affected_rowsB; &mysql_error_logging;
if ( ($SSrecording_dtmf_detection > 0) && ($SSrecording_dtmf_muting > 0) )
{if ($SSrecording_dtmf_muting > 1) {$recording_dtmf_muting = $SSrecording_dtmf_muting;} }
$stmtD = "INSERT INTO recording_live (recording_id,recording_type,server_ip,start_time,channel,filename,lead_id,user,dtmf_muting_end_time,recording_status,dtmf_muting_seconds) values('$recording_id','STEREO AGENT-CONTROLLED RIR $rl_exten','$VARserver_ip','$now_date','$channel','$stereo_rec_filename','$insert_lead_id','$VDADuser','2020-12-31 23:59:59','STARTED','$recording_dtmf_muting');";
$rLIVEaffected_rows = $dbhA->do($stmtD);
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$rLIVEaffected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='01305'; $MEL_aff_rows=$rLIVEaffected_rows; &mysql_error_logging;
$mLIVEaffected_rows=0;
if ($stereo_recording =~ /CUSTOMER_ONLY/i)
@@ -3795,14 +3796,14 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
$vmgr_callerid = substr($stereo_rec_filename, 0, 16) . 'M...';
$stmtE="INSERT INTO vicidial_manager values('','','$now_date','NEW','N','$VARserver_ip','','MixMonitorMute','$vmgr_callerid','ActionID: $vmgr_callerid','Channel: $channel','Direction: write','State: 1','','','','','','');";
$mLIVEaffected_rows = $dbhA->do($stmtE);
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$mLIVEaffected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='01306'; $MEL_aff_rows=$mLIVEaffected_rows; &mysql_error_logging;
}
if ($stereo_recording =~ /CUSTOMER_MUTE/i)
{
$vmgr_callerid = substr($stereo_rec_filename, 0, 16) . 'M...';
$stmtE="INSERT INTO vicidial_manager values('','','$now_date','NEW','N','$VARserver_ip','','MixMonitorMute','$vmgr_callerid','ActionID: $vmgr_callerid','Channel: $channel','Direction: read','State: 1','','','','','','');";
$mLIVEaffected_rows = $dbhA->do($stmtE);
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$mLIVEaffected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='01307'; $MEL_aff_rows=$mLIVEaffected_rows; &mysql_error_logging;
}
if ($AGILOG) {$agi_string = "-- AGENT STEREO RECORDING STARTED : |$retval|$retval_stop|$SRaffected_rows|$recording_id|$affected_rowsB|$rLIVEaffected_rows|$mLIVEaffected_rows|$stmtA|"; &agi_output;}
@@ -4664,7 +4665,9 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
{
$max_inbound_triggered++;
$outbound_autodial='0';
$stmtA = "SELECT outbound_autodial,closer_campaigns FROM vicidial_live_agents where user='$VDADuser';";
$RAWcloser_campaigns='';
$RAWcampaign_id='';
$stmtA = "SELECT outbound_autodial,closer_campaigns,campaign_id FROM vicidial_live_agents where user='$VDADuser';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArowsVLA=$sthA->rows;
@@ -4674,10 +4677,12 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
@aryA = $sthA->fetchrow_array;
if ($aryA[0] =~ /Y/)
{$outbound_autodial = '1';}
$closer_campaigns = $aryA[1];
$closer_campaigns = $aryA[1];
$RAWcloser_campaigns = $aryA[1];
$RAWcampaign_id = $aryA[2];
}
$stmtA = "UPDATE vicidial_live_agents set external_ingroups=' -',external_blended='$outbound_autodial',external_igb_set_user='VDIC',manager_ingroup_set='SET' where user='$VDADuser'";
$stmtA = "UPDATE vicidial_live_agents set external_ingroups=' -',external_blended='$outbound_autodial',external_igb_set_user='VDIC',manager_ingroup_set='SET' where user='$VDADuser';";
$stmtB = "DELETE FROM vicidial_live_inbound_agents where user='$VDADuser';";
if ($max_inbound_calls_outcome =~ /ALLOW_AGENTDIRECT/)
@@ -4698,17 +4703,21 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
else
{$ADcloser_campaigns = " -";}
$stmtA = "UPDATE vicidial_live_agents set external_ingroups='$ADcloser_campaigns',external_blended='$outbound_autodial',external_igb_set_user='VDIC',manager_ingroup_set='SET' where user='$VDADuser'";
$stmtA = "UPDATE vicidial_live_agents set external_ingroups='$ADcloser_campaigns',external_blended='$outbound_autodial',external_igb_set_user='VDIC',manager_ingroup_set='SET' where user='$VDADuser';";
$stmtB = "DELETE FROM vicidial_live_inbound_agents where user='$VDADuser' and group_id NOT LIKE\"%AGENTDIRECT%\";";
}
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02202'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$affected_rowsA = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02202'; $MEL_aff_rows=$affected_rowsA; &mysql_error_logging;
$affected_rows = $dbhA->do($stmtB);
$dbhP=$dbhA; $mysql_count='02203'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$affected_rowsB = $dbhA->do($stmtB);
$dbhP=$dbhA; $mysql_count='02203'; $MEL_aff_rows=$affected_rowsB; &mysql_error_logging;
$SQL_log = "$stmtA|$stmtB";
$stmtC = "INSERT INTO vicidial_max_inbound_cache SET user='$VDADuser', campaign_id='$RAWcampaign_id', event_date=NOW(), blended='$outbound_autodial', closer_campaigns='$RAWcloser_campaigns', max_inbound_count='$max_inbound_calls', call_count_today='$max_inbound_count', status='NEW', notes='AIA';";
$affected_rowsC = $dbhA->do($stmtC);
$dbhP=$dbhA; $mysql_count='02308'; $MEL_aff_rows=$affected_rowsC; &mysql_error_logging;
$SQL_log = "$stmtA|$stmtB|$stmtC";
$SQL_log =~ s/'|%//gi;
$stmtC = "INSERT INTO vicidial_admin_log set event_date=NOW(), user='$VDADuser', ip_address='$VARserver_ip', event_section='USERS', event_type='MODIFY', record_id='$VDADuser', event_code='MAX IN CALLS MODIFY USER', event_sql='$SQL_log', event_notes='|$max_inbound_count|$max_inbound_calls|$VDADuser|$callerid|IC|$max_inbound_calls_outcome|$closer_campaigns|$ADcloser_campaignsARYct|';";
$affected_rows = $dbhA->do($stmtC);
@@ -4784,7 +4793,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArowsVLA=$sthA->rows;
$dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='02309'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
if ($sthArowsVLA > 0)
{
@aryA = $sthA->fetchrow_array;
@@ -4813,10 +4822,10 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
$stmtB = "DELETE FROM vicidial_live_inbound_agents where user='$VDADuser' and group_id='$channel_group';";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='02310'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$affected_rows = $dbhA->do($stmtB);
$dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='02311'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$SQL_log = "$stmtA|$stmtB";
$SQL_log =~ s/'|%//gi;
@@ -5080,7 +5089,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
{if ($SSrecording_dtmf_muting > 1) {$recording_dtmf_muting = $SSrecording_dtmf_muting;} }
$stmtD = "INSERT INTO recording_live (recording_id,recording_type,server_ip,start_time,channel,filename,lead_id,user,dtmf_muting_end_time,recording_status,dtmf_muting_seconds) values('$recording_id','MONO_LEGACY_REMOTE','$VARserver_ip','$now_date','$channel','$campaign_rec_filename','$insert_lead_id','$VDADuser','2020-12-31 23:59:59','STARTED','$recording_dtmf_muting');";
$rLIVEaffected_rows = $dbhA->do($stmtD);
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$rLIVEaffected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='01312'; $MEL_aff_rows=$rLIVEaffected_rows; &mysql_error_logging;
if ($AGILOG) {$agi_string = "-- REMOTE RECORDING STARTED : |$retval|$RLRAaffected_rows|$campaign_rec_filename|$recording_id|$rLIVEaffected_rows|$stmtA|"; &agi_output;}
}
@@ -5109,12 +5118,12 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
### insert record into recording_log_parallel table ###
$stmtA = "INSERT INTO recording_log_parallel (channel,server_ip,extension,start_time,length_in_sec,filename,lead_id,user,vicidial_id,recording_status) values('$channel','$VARserver_ip','','$now_date','0','PL$stereo_rec_filename','$insert_lead_id','$VDADuser','$insert_close_id','START');";
$SRaffected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$SRaffected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='01313'; $MEL_aff_rows=$SRaffected_rows; &mysql_error_logging;
$stmtB = "SELECT LAST_INSERT_ID() LIMIT 1;";
$sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $stmtA=$stmtB; $mysql_count='02XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
$dbhP=$dbhA; $stmtA=$stmtB; $mysql_count='02314'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
@@ -5149,12 +5158,12 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
### insert a record into the recording_log table
$stmtA = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user,vicidial_id) values('$channel','$VARserver_ip','SPCOR','$now_date','$now_date_epoch','$temp_parallel_rec_co_filename','$insert_lead_id','$VDADuser','$insert_close_id')";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='02315'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$stmtB = "SELECT LAST_INSERT_ID() LIMIT 1;";
$sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $stmtA=$stmtB; $mysql_count='02XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
$dbhP=$dbhA; $stmtA=$stmtB; $mysql_count='02316'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
@@ -5168,19 +5177,19 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
$stmtA = "UPDATE recording_log SET filename='$temp_parallel_rec_co_filename' where recording_id='$recording_id';";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='02317'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
}
### insert record into recording_log_stereo table ###
$stmtA = "INSERT INTO recording_log_stereo (recording_id,server_ip,start_time,length_in_sec,filename,lead_id,options,processing_log,parallel_recording_id,recording_status) values('$recording_id','$VARserver_ip','$now_date','0','$temp_parallel_rec_co_filename','$insert_lead_id','$channel_group STEREO_PARALLEL CUSTOMER-ONLY REMOTE $stereo_recording','start: $now_date|vicidial_id: $insert_close_id|user: $VDADuser|channel: $channel|','$parallel_recording_id','PARALLEL START');";
$SRaffected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$SRaffected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='01318'; $MEL_aff_rows=$SRaffected_rows; &mysql_error_logging;
if ( ($SSrecording_dtmf_detection > 0) && ($SSrecording_dtmf_muting > 0) )
{if ($SSrecording_dtmf_muting > 1) {$recording_dtmf_muting = $SSrecording_dtmf_muting;} }
$stmtD = "INSERT INTO recording_live (recording_id,recording_type,server_ip,start_time,channel,filename,lead_id,user,dtmf_muting_end_time,recording_status,dtmf_muting_seconds) values('$recording_id','STEREO_PARALLEL CUSTOMER-ONLY REMOTE','$VARserver_ip','$now_date','$channel','$temp_parallel_rec_co_filename','$insert_lead_id','$VDADuser','2020-12-31 23:59:59','STARTED','$recording_dtmf_muting');";
$rLIVEaffected_rows = $dbhA->do($stmtD);
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$rLIVEaffected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='01319'; $MEL_aff_rows=$rLIVEaffected_rows; &mysql_error_logging;
if ($AGILOG) {$agi_string = "-- REMOTE PARALLEL CO STEREO RECORDING LOG INSERT : |$SRaffected_rows|$recording_id|$parallel_recording_id|$rLIVEaffected_rows|$stmtA|"; &agi_output;}
}
@@ -5206,12 +5215,12 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
### insert a record into the recording_log table
$stmtA = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user,vicidial_id) values('$channel','$VARserver_ip','SPCMR','$now_date','$now_date_epoch','$temp_parallel_rec_cm_filename','$insert_lead_id','$VDADuser','$insert_close_id')";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='02320'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$stmtB = "SELECT LAST_INSERT_ID() LIMIT 1;";
$sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $stmtA=$stmtB; $mysql_count='02XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
$dbhP=$dbhA; $stmtA=$stmtB; $mysql_count='02321'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
@@ -5225,19 +5234,19 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
$stmtA = "UPDATE recording_log SET filename='$temp_parallel_rec_cm_filename' where recording_id='$recording_id';";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='02322'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
}
### insert record into recording_log_stereo table ###
$stmtA = "INSERT INTO recording_log_stereo (recording_id,server_ip,start_time,length_in_sec,filename,lead_id,options,processing_log,parallel_recording_id,recording_status) values('$recording_id','$VARserver_ip','$now_date','0','$temp_parallel_rec_cm_filename','$insert_lead_id','$channel_group STEREO_PARALLEL CUSTOMER-MUTED REMOTE $stereo_recording','start: $now_date|vicidial_id: $insert_close_id|user: $VDADuser|channel: $channel|','$parallel_recording_id','PARALLEL START');";
$SRaffected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$SRaffected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='01323'; $MEL_aff_rows=$SRaffected_rows; &mysql_error_logging;
if ( ($SSrecording_dtmf_detection > 0) && ($SSrecording_dtmf_muting > 0) )
{if ($SSrecording_dtmf_muting > 1) {$recording_dtmf_muting = $SSrecording_dtmf_muting;} }
$stmtD = "INSERT INTO recording_live (recording_id,recording_type,server_ip,start_time,channel,filename,lead_id,user,dtmf_muting_end_time,recording_status,dtmf_muting_seconds) values('$recording_id','STEREO_PARALLEL CUSTOMER-MUTED REMOTE','$VARserver_ip','$now_date','$channel','$temp_parallel_rec_cm_filename','$insert_lead_id','$VDADuser','2020-12-31 23:59:59','STARTED','$recording_dtmf_muting');";
$rLIVEaffected_rows = $dbhA->do($stmtD);
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$rLIVEaffected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='01324'; $MEL_aff_rows=$rLIVEaffected_rows; &mysql_error_logging;
if ($AGILOG) {$agi_string = "-- REMOTE PARALLEL CM STEREO RECORDING LOG INSERT : |$SRaffected_rows|$recording_id|$parallel_recording_id|$rLIVEaffected_rows|$stmtA|"; &agi_output;}
}
@@ -5263,12 +5272,12 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
### insert a record into the recording_log table
$stmtA = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user,vicidial_id) values('$channel','$VARserver_ip','SPFRR','$now_date','$now_date_epoch','$temp_parallel_rec_fr_filename','$insert_lead_id','$VDADuser','$insert_close_id')";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='02325'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$stmtB = "SELECT LAST_INSERT_ID() LIMIT 1;";
$sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $stmtA=$stmtB; $mysql_count='02XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
$dbhP=$dbhA; $stmtA=$stmtB; $mysql_count='02326'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
@@ -5282,19 +5291,19 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
$stmtA = "UPDATE recording_log SET filename='$temp_parallel_rec_fr_filename' where recording_id='$recording_id';";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='02327'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
}
### insert record into recording_log_stereo table ###
$stmtA = "INSERT INTO recording_log_stereo (recording_id,server_ip,start_time,length_in_sec,filename,lead_id,options,processing_log,parallel_recording_id,recording_status) values('$recording_id','$VARserver_ip','$now_date','0','$temp_parallel_rec_fr_filename','$insert_lead_id','$channel_group STEREO_PARALLEL FULL-RECORDING REMOTE $stereo_recording','start: $now_date|vicidial_id: $insert_close_id|user: $VDADuser|channel: $channel|','$parallel_recording_id','PARALLEL START');";
$SRaffected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$SRaffected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='01328'; $MEL_aff_rows=$SRaffected_rows; &mysql_error_logging;
if ( ($SSrecording_dtmf_detection > 0) && ($SSrecording_dtmf_muting > 0) )
{if ($SSrecording_dtmf_muting > 1) {$recording_dtmf_muting = $SSrecording_dtmf_muting;} }
$stmtD = "INSERT INTO recording_live (recording_id,recording_type,server_ip,start_time,channel,filename,lead_id,user,dtmf_muting_end_time,recording_status,dtmf_muting_seconds) values('$recording_id','STEREO_PARALLEL FULL-RECORDING REMOTE','$VARserver_ip','$now_date','$channel','$temp_parallel_rec_fr_filename','$insert_lead_id','$VDADuser','2020-12-31 23:59:59','STARTED','$recording_dtmf_muting');";
$rLIVEaffected_rows = $dbhA->do($stmtD);
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$rLIVEaffected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='01329'; $MEL_aff_rows=$rLIVEaffected_rows; &mysql_error_logging;
if ($AGILOG) {$agi_string = "-- REMOTE PARALLEL FR STEREO RECORDING LOG INSERT : |$SRaffected_rows|$recording_id|$parallel_recording_id|$rLIVEaffected_rows|$stmtA|"; &agi_output;}
}
@@ -5306,12 +5315,12 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
### insert a record into the recording_log table
$stmtA = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user,vicidial_id) values('$channel','$VARserver_ip','SPACR','$now_date','$now_date_epoch','$temp_parallel_rec_ag_filename','$insert_lead_id','$VDADuser','$insert_close_id')";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='02330'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$stmtB = "SELECT LAST_INSERT_ID() LIMIT 1;";
$sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $stmtA=$stmtB; $mysql_count='02XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
$dbhP=$dbhA; $stmtA=$stmtB; $mysql_count='02331'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
@@ -5325,19 +5334,19 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
$stmtA = "UPDATE recording_log SET filename='$temp_parallel_rec_ag_filename' where recording_id='$recording_id';";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='02332'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
}
### insert record into recording_log_stereo table ###
$stmtA = "INSERT INTO recording_log_stereo (recording_id,server_ip,start_time,length_in_sec,filename,lead_id,options,processing_log,parallel_recording_id,recording_status) values('$recording_id','$VARserver_ip','$now_date','0','$temp_parallel_rec_ag_filename','$insert_lead_id','$channel_group STEREO_PARALLEL AGENT-CONTROLLED REMOTE $stereo_recording $stereo_recording_agent','start: $now_date|vicidial_id: $insert_close_id|user: $VDADuser|channel: $channel|','$parallel_recording_id','PARALLEL START');";
$SRaffected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$SRaffected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='01333'; $MEL_aff_rows=$SRaffected_rows; &mysql_error_logging;
if ( ($SSrecording_dtmf_detection > 0) && ($SSrecording_dtmf_muting > 0) )
{if ($SSrecording_dtmf_muting > 1) {$recording_dtmf_muting = $SSrecording_dtmf_muting;} }
$stmtD = "INSERT INTO recording_live (recording_id,recording_type,server_ip,start_time,channel,filename,lead_id,user,dtmf_muting_end_time,recording_status,dtmf_muting_seconds) values('$recording_id','STEREO_PARALLEL AGENT-CONTROLLED REMOTE','$VARserver_ip','$now_date','$channel','$temp_parallel_rec_ag_filename','$insert_lead_id','$VDADuser','2020-12-31 23:59:59','STARTED','$recording_dtmf_muting');";
$rLIVEaffected_rows = $dbhA->do($stmtD);
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$rLIVEaffected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='01334'; $MEL_aff_rows=$rLIVEaffected_rows; &mysql_error_logging;
if ($AGILOG) {$agi_string = "-- REMOTE PARALLEL AG STEREO RECORDING LOG INSERT : |$SRaffected_rows|$recording_id|$parallel_recording_id|$affected_rowsB|$rLIVEaffected_rows|$stmtA|"; &agi_output;}
}
@@ -5356,12 +5365,12 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
# insert a record into the recording_log table
$stmtA = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user,vicidial_id) values('$channel','$VARserver_ip','$rl_exten','$now_date','$now_date_epoch','$stereo_rec_filename','$insert_lead_id','$VDADuser','$insert_close_id')";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='02335'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$stmtB = "SELECT LAST_INSERT_ID() LIMIT 1;";
$sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $stmtA=$stmtB; $mysql_count='02XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
$dbhP=$dbhA; $stmtA=$stmtB; $mysql_count='02336'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
@@ -5375,7 +5384,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
$stmtA = "UPDATE recording_log SET filename='$stereo_rec_filename' where recording_id='$recording_id';";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='02337'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
}
$retval_stop = $AGI->exec("StopMixMonitor","");
@@ -5384,13 +5393,13 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
### insert record into recording_log_stereo table ###
$stmtA = "INSERT INTO recording_log_stereo (recording_id,server_ip,start_time,length_in_sec,filename,lead_id,options,processing_log,recording_status) values('$recording_id','$VARserver_ip','$now_date','0','$stereo_rec_filename','$insert_lead_id','$channel_group STEREO AGENT-CONTROLLED REMOTE RIR $stereo_recording $stereo_recording_agent','start: $now_date|vicidial_id: $insert_close_id|user: $VDADuser|channel: $channel|','STEREO START');";
$SRaffected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$SRaffected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='01338'; $MEL_aff_rows=$SRaffected_rows; &mysql_error_logging;
if ( ($SSrecording_dtmf_detection > 0) && ($SSrecording_dtmf_muting > 0) )
{if ($SSrecording_dtmf_muting > 1) {$recording_dtmf_muting = $SSrecording_dtmf_muting;} }
$stmtD = "INSERT INTO recording_live (recording_id,recording_type,server_ip,start_time,channel,filename,lead_id,user,dtmf_muting_end_time,recording_status,dtmf_muting_seconds) values('$recording_id','STEREO AGENT-CONTROLLED REMOTE $rl_exten','$VARserver_ip','$now_date','$channel','$stereo_rec_filename','$insert_lead_id','$VDADuser','2020-12-31 23:59:59','STARTED','$recording_dtmf_muting');";
$rLIVEaffected_rows = $dbhA->do($stmtD);
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$rLIVEaffected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='01339'; $MEL_aff_rows=$rLIVEaffected_rows; &mysql_error_logging;
$mLIVEaffected_rows=0;
if ($stereo_recording =~ /CUSTOMER_ONLY/i)
@@ -5398,14 +5407,14 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
$vmgr_callerid = substr($stereo_rec_filename, 0, 16) . 'M...';
$stmtE="INSERT INTO vicidial_manager values('','','$now_date','NEW','N','$VARserver_ip','','MixMonitorMute','$vmgr_callerid','ActionID: $vmgr_callerid','Channel: $channel','Direction: write','State: 1','','','','','','');";
$mLIVEaffected_rows = $dbhA->do($stmtE);
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$mLIVEaffected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='01340'; $MEL_aff_rows=$mLIVEaffected_rows; &mysql_error_logging;
}
if ($stereo_recording =~ /CUSTOMER_MUTE/i)
{
$vmgr_callerid = substr($stereo_rec_filename, 0, 16) . 'M...';
$stmtE="INSERT INTO vicidial_manager values('','','$now_date','NEW','N','$VARserver_ip','','MixMonitorMute','$vmgr_callerid','ActionID: $vmgr_callerid','Channel: $channel','Direction: read','State: 1','','','','','','');";
$mLIVEaffected_rows = $dbhA->do($stmtE);
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$mLIVEaffected_rows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='01341'; $MEL_aff_rows=$mLIVEaffected_rows; &mysql_error_logging;
}
if ($AGILOG) {$agi_string = "-- REMOTE AGENT STEREO RECORDING STARTED : |$retval|$retval_stop|$SRaffected_rows|$recording_id|$affected_rowsB|$rLIVEaffected_rows|$mLIVEaffected_rows|$stmtA|"; &agi_output;}
+28 -2
View File
@@ -180,9 +180,10 @@
# 251024-2222 - Added crashed table detection
# 260126-1334 - Added check of reserved_extensions against dialplan numbers when building conf files
# 260327-0846 - Added check of empty phone dialplan extensions when building conf files
# 260402-1440 - Added reset of vicidial_max_inbound_cache table entries
#
$build = '260327-0846';
$build = '260402-1440';
$DB=0; # Debug flag
$teodDB=0; # flag to log Timeclock End of Day processes to log file
@@ -509,7 +510,7 @@ $dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VA
##### Get the settings from system_settings #####
$stmtA = "SELECT sounds_central_control_active,active_voicemail_server,custom_dialplan_entry,default_codecs,generate_cross_server_exten,voicemail_timezones,default_voicemail_timezone,call_menu_qualify_enabled,allow_voicemail_greeting,reload_timestamp,meetme_enter_login_filename,meetme_enter_leave3way_filename,allow_chats,enable_auto_reports,enable_drop_lists,expired_lists_inactive,sip_event_logging,call_quota_lead_ranking,inbound_answer_config,log_latency_gaps,demographic_quotas,weekday_resets,highest_lead_id,hopper_hold_inserts,stereo_recording,stereo_parallel_recording,recording_dtmf_muting,db_crashed_tables_check FROM system_settings;";
$stmtA = "SELECT sounds_central_control_active,active_voicemail_server,custom_dialplan_entry,default_codecs,generate_cross_server_exten,voicemail_timezones,default_voicemail_timezone,call_menu_qualify_enabled,allow_voicemail_greeting,reload_timestamp,meetme_enter_login_filename,meetme_enter_leave3way_filename,allow_chats,enable_auto_reports,enable_drop_lists,expired_lists_inactive,sip_event_logging,call_quota_lead_ranking,inbound_answer_config,log_latency_gaps,demographic_quotas,weekday_resets,highest_lead_id,hopper_hold_inserts,stereo_recording,stereo_parallel_recording,recording_dtmf_muting,db_crashed_tables_check,max_inbound_auto_reenable FROM system_settings;";
# print "$stmtA\n";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
@@ -545,6 +546,7 @@ if ($sthArows > 0)
$SSstereo_parallel_recording = $aryA[25];
$SSrecording_dtmf_muting = $aryA[26];
$SSdb_crashed_tables_check = $aryA[27];
$SSmax_inbound_auto_reenable = $aryA[28];
}
$sthA->finish();
if ($DBXXX > 0) {print "SYSTEM SETTINGS: $sounds_central_control_active|$active_voicemail_server|$SScustom_dialplan_entry|$SSdefault_codecs\n";}
@@ -1541,6 +1543,30 @@ if ($timeclock_end_of_day_NOW > 0)
if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
if ($SSmax_inbound_auto_reenable >= 2)
{
$stmtA = "UPDATE vicidial_max_inbound_cache SET status='OLD',notes=CONCAT(notes,'|TCEOD') WHERE status='NEW' and event_date >= \"$RMSQLdate\" and event_date < \"$FMSQLdate\";";
if($DBX){print STDERR "\n|$stmtA|\n";}
$affected_rows = $dbhA->do($stmtA);
if($DB){print STDERR "\n|$affected_rows vicidial_max_inbound_cache records archived|\n";}
if ($teodDB) {$event_string = "vicidial_max_inbound_cache records archived: $affected_rows"; &teod_logger;}
}
$stmtA = "delete from vicidial_max_inbound_cache where event_date < \"$RMSQLdate\";";
if($DBX){print STDERR "\n|$stmtA|\n";}
$affected_rows = $dbhA->do($stmtA);
if($DB){print STDERR "\n|$affected_rows vicidial_max_inbound_cache records deleted|\n";}
if ($teodDB) {$event_string = "vicidial_max_inbound_cache records deleted: $affected_rows"; &teod_logger;}
$stmtA = "optimize table vicidial_max_inbound_cache;";
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();
$stmtA = "optimize table crashed_tables;";
if($DBX){print STDERR "\n|$stmtA|\n";}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
+17 -2
View File
@@ -11,7 +11,7 @@
# agents that should appear to be logged in so that the calls can be transferred
# out to them properly.
#
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGELOG:
# 50215-0954 - First version of script
@@ -58,9 +58,10 @@
# 240219-1518 - Added daily_limit inbound option
# 240420-2246 - Added ConfBridge code
# 240516-2149 - Allow for ALT start_call_url, added --version flag
# 260403-2253 - Added vicidial_max_inbound_cache logging
#
$build = '240516-2149';
$build = '260403-2253';
### begin parsing run-time options ###
if (length($ARGV[0])>1)
@@ -471,6 +472,17 @@ while($one_day_interval > 0)
}
if ($max_inbound_count >= $max_inbound_calls)
{
$RAWcloser_campaigns='';
$stmtJ = "SELECT closer_campaigns FROM vicidial_remote_agents where user_start='$QHuser[$w]';";
$sthA = $dbhA->prepare($stmtJ) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtJ ", $dbhA->errstr;
$sthArowsVRA=$sthA->rows;
if ($sthArowsVRA > 0)
{
@aryA = $sthA->fetchrow_array;
$RAWcloser_campaigns = $aryA[0];
}
$max_inbound_triggered++;
$stmtJ = "UPDATE vicidial_live_agents set closer_campaigns='' where user='$QHuser[$w]';";
$affected_rows = $dbhA->do($stmtJ);
@@ -481,6 +493,9 @@ while($one_day_interval > 0)
$stmtJ = "UPDATE vicidial_remote_agents set closer_campaigns='' where user_start='$QHuser[$w]';";
$affected_rows = $dbhA->do($stmtJ);
$stmtJ = "INSERT INTO vicidial_max_inbound_cache SET user='$QHuser[$w]', campaign_id='$QHcampaign_id[$w]', event_date=NOW(), blended='1', closer_campaigns='$RAWcloser_campaigns', max_inbound_count='$max_inbound_calls', call_count_today='$max_inbound_count', status='NEW', notes='VRA';";
$affected_rows = $dbhA->do($stmtJ);
$stmtJ = "INSERT INTO vicidial_admin_log set event_date=NOW(), user='$QHuser[$w]', ip_address='$VARserver_ip', event_section='USERS', event_type='MODIFY', record_id='$QHuser[$w]', event_code='MAX IN CALLS MODIFY REMOTE AGENT', event_sql='DELETE FROM vicidial_live_inbound_agents where user=$QHuser[$w]', event_notes='|$max_inbound_count|$max_inbound_calls|$QHuser[$w]|$QHcall_id[$w]|RA|';";
$affected_rows = $dbhA->do($stmtJ);
@@ -2080,7 +2080,8 @@ recording_dtmf_detection TINYINT(3) UNSIGNED default '0',
recording_dtmf_muting TINYINT(3) UNSIGNED default '0',
stereo_parallel_recording ENUM('0','1','2','3','4','5','6') default '0',
db_crashed_tables_check ENUM('0','1','2','3','4','5','6') default '1',
xfer_min_container VARCHAR(40) default ''
xfer_min_container VARCHAR(40) default '',
max_inbound_auto_reenable ENUM('0','1','2','3','4','5','6') default '1'
) ENGINE=MyISAM;
CREATE TABLE vicidial_campaigns_list_mix (
@@ -5462,6 +5463,21 @@ crashed_datetime DATETIME,
last_check_datetime DATETIME
) ENGINE=MyISAM;
CREATE TABLE vicidial_max_inbound_cache (
user VARCHAR(20),
campaign_id VARCHAR(20),
event_date DATETIME,
blended ENUM('1','0') default '0',
closer_campaigns TEXT,
max_inbound_count MEDIUMINT(7) default '0',
call_count_today MEDIUMINT(7) default '0',
status VARCHAR(20) default '',
notes VARCHAR(100) default '',
index (user),
index (event_date),
index (status)
) ENGINE=MyISAM;
ALTER TABLE vicidial_email_list MODIFY message text character set utf8;
@@ -5881,4 +5897,4 @@ INSERT INTO `wallboard_reports` VALUES ('AGENTS_AND_QUEUES','Agents and Queues',
UPDATE system_settings set vdc_agent_api_active='1';
UPDATE system_settings SET db_schema_version='1738',db_schema_update_date=NOW(),reload_timestamp=NOW();
UPDATE system_settings SET db_schema_version='1739',db_schema_update_date=NOW(),reload_timestamp=NOW();
+19
View File
@@ -3065,3 +3065,22 @@ UPDATE system_settings SET db_schema_version='1737',db_schema_update_date=NOW()
ALTER TABLE vicidial_campaigns ADD hangup_again_link ENUM('DISABLED','ENABLED') default 'ENABLED';
UPDATE system_settings SET db_schema_version='1738',db_schema_update_date=NOW() where db_schema_version < 1738;
CREATE TABLE vicidial_max_inbound_cache (
user VARCHAR(20),
campaign_id VARCHAR(20),
event_date DATETIME,
blended ENUM('1','0') default '0',
closer_campaigns TEXT,
max_inbound_count MEDIUMINT(7) default '0',
call_count_today MEDIUMINT(7) default '0',
status VARCHAR(20) default '',
notes VARCHAR(100) default '',
index (user),
index (event_date),
index (status)
) ENGINE=MyISAM;
ALTER TABLE system_settings ADD max_inbound_auto_reenable ENUM('0','1','2','3','4','5','6') default '1';
UPDATE system_settings SET db_schema_version='1739',db_schema_update_date=NOW() where db_schema_version < 1739;
+51 -18
View File
@@ -566,13 +566,14 @@
# 251005-0931 - Added code for recording_dtmf_muting
# 251124-0935 - Added lead status display for callbacks list output
# 260302-1057 - Code updates for PHP8 compatibility
# 260403-2155 - Added vicidial_max_inbound_cache logging
#
$version = '2.14-459';
$build = '260302-1057';
$version = '2.14-460';
$build = '260403-2155';
$php_script = 'vdc_db_query.php';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=995;
$mysql_log_count=10001;
$one_mysql_log=0;
$DB=0;
$VD_login=0;
@@ -1895,7 +1896,7 @@ if ($ACTION == 'LogiNCamPaigns')
if ($ACTION == 'regCLOSER')
{
$row=''; $rowx='';
$channel_live=1;
$channel_live=1; $max_inbound_AG_trigger=0;
if ( (strlen($closer_choice)<1) || (strlen($user)<1) )
{
$channel_live=0;
@@ -2004,7 +2005,10 @@ if ($ACTION == 'regCLOSER')
while ($ADc < $ADcloser_campaignsARYct)
{
if (preg_match("/AGENTDIRECT/i",$ADcloser_campaignsARY[$ADc]))
{$ADcloser_campaigns .= "$ADcloser_campaignsARY[$ADc] ";}
{
$ADcloser_campaigns .= "$ADcloser_campaignsARY[$ADc] ";
$max_inbound_AG_trigger++;
}
$ADc++;
}
if (strlen($ADcloser_campaigns) > 3)
@@ -2072,6 +2076,18 @@ if ($ACTION == 'regCLOSER')
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00010',$user,$server_ip,$session_name,$one_mysql_log);}
}
if ( ($max_inbound_AG_trigger > 0) or ( ($SSmax_inbound_auto_reenable >= 2) and (strlen($closer_choice) < 3) ) )
{
# do nothing
}
else
{
$stmt="UPDATE vicidial_max_inbound_cache set status='OLD',notes=CONCAT(notes,'|regCLOSER') where user='$user' and status='NEW';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00996',$user,$server_ip,$session_name,$one_mysql_log);}
}
$stmt="INSERT INTO vicidial_user_closer_log set user='$user',campaign_id='$campaign',event_date='$NOW_TIME',blended='$closer_blended',closer_campaigns='$closer_choice';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_to_mysqli($stmt, $link);
@@ -5615,7 +5631,7 @@ if ($ACTION == 'manDiaLnextCaLL')
$stmt = "INSERT INTO recording_live (recording_id,recording_type,server_ip,start_time,channel,filename,lead_id,user,dtmf_muting_end_time,recording_status,dtmf_muting_seconds) values('$recording_id','MONO_LEGACY_RIR','$server_ip','$NOW_TIME','$channel','$recording_filename','$lead_id','$user','2020-12-31 23:59:59','STARTED','$recording_dtmf_muting');";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$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,'00997',$user,$server_ip,$session_name,$one_mysql_log);}
##### update vla record with recording_id
$stmt = "UPDATE vicidial_live_agents SET external_recording='$recording_id' where user='$user';";
@@ -7674,7 +7690,7 @@ if ($ACTION == 'manDiaLonly')
$stmt = "INSERT INTO recording_live (recording_id,recording_type,server_ip,start_time,channel,filename,lead_id,user,dtmf_muting_end_time,recording_status,dtmf_muting_seconds) values('$recording_id','MONO_LEGACY_RIR','$server_ip','$NOW_TIME','$channel','$recording_filename','$lead_id','$user','2020-12-31 23:59:59','STARTED','$recording_dtmf_muting');";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$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,'00998',$user,$server_ip,$session_name,$one_mysql_log);}
##### update vla record with recording_id
$stmt = "UPDATE vicidial_live_agents SET external_recording='$recording_id' where user='$user';";
@@ -10573,7 +10589,7 @@ if ($stage == "end")
$stmt = "INSERT INTO recording_live (recording_id,recording_type,server_ip,start_time,channel,filename,lead_id,user,dtmf_muting_end_time,recording_status,dtmf_muting_seconds) values('$recording_id','MONO_LEGACY_3WAY','$server_ip','$NOW_TIME','$channel','$leave_3way_start_recording_filename','$lead_id','$user','2020-12-31 23:59:59','STARTED','$recording_dtmf_muting');";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$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,'00999',$user,$server_ip,$session_name,$one_mysql_log);}
}
##### END leave_3way_start_recording if triggered #####
@@ -15085,7 +15101,7 @@ if ($ACTION == 'updateDISPO')
$VU_inbound_credits = $row[6];
}
$stmt = "SELECT dispo_call_url,queuemetrics_callstatus_override,comments_dispo_screen,comments_callback_screen,vc.campaign_id,vc.custom_one,vc.custom_two,vc.custom_three,vc.custom_four,vc.custom_five from vicidial_campaigns vc,vicidial_live_agents vla where vla.campaign_id=vc.campaign_id and vla.user='$user';";
$stmt = "SELECT dispo_call_url,queuemetrics_callstatus_override,comments_dispo_screen,comments_callback_screen,vc.campaign_id,vc.custom_one,vc.custom_two,vc.custom_three,vc.custom_four,vc.custom_five,vc.campaign_id from vicidial_campaigns vc,vicidial_live_agents vla where vla.campaign_id=vc.campaign_id and vla.user='$user';";
if ($non_latin > 0) {$rslt=mysql_to_mysqli("SET NAMES 'UTF8'", $link);}
if ($DB) {echo "$stmt\n";}
$rslt=mysql_to_mysqli($stmt, $link);
@@ -15104,6 +15120,7 @@ if ($ACTION == 'updateDISPO')
$camp_custom_three = $row[7];
$camp_custom_four = $row[8];
$camp_custom_five = $row[9];
$campaign_id = $row[10];
$DUentry_type = 'campaign';
}
@@ -15238,7 +15255,7 @@ if ($ACTION == 'updateDISPO')
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00811',$user,$server_ip,$session_name,$one_mysql_log);}
$stmt="SELECT max_inbound_calls,max_inbound_calls_outcome FROM vicidial_campaigns where campaign_id='$campaign';";
$stmt="SELECT max_inbound_calls,max_inbound_calls_outcome FROM vicidial_campaigns where campaign_id='$campaign_id';";
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00812',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -15277,11 +15294,13 @@ if ($ACTION == 'updateDISPO')
# fwrite ($fp, "$NOW_TIME|DISPO_CALL3|$user|$max_inbound_count - $row[0] - $row[1]|\n");
# fclose($fp);
$max_inbound_triggered=0;
$max_inbound_triggered=0; $max_inbound_AG_trigger=0;
if ($max_inbound_count >= $max_inbound_calls)
{
$max_inbound_triggered++;
$outbound_autodial='0';
$RAWcloser_campaigns='';
$ADcloser_campaigns='';
$stmt="SELECT outbound_autodial,closer_campaigns FROM vicidial_live_agents where user='$user';";
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00814',$user,$server_ip,$session_name,$one_mysql_log);}
@@ -15293,22 +15312,26 @@ if ($ACTION == 'updateDISPO')
if (preg_match("/Y/",$row[0]))
{$outbound_autodial = '1';}
$closer_campaigns = $row[1];
$RAWcloser_campaigns = $row[1];
}
$stmtA = "UPDATE vicidial_live_agents set external_ingroups=' -',external_blended='$outbound_autodial',external_igb_set_user='VDIC',manager_ingroup_set='SET' where user='$user'";
$stmtA = "UPDATE vicidial_live_agents SET external_ingroups=' -',external_blended='$outbound_autodial',external_igb_set_user='VDIC',manager_ingroup_set='SET' where user='$user';";
$stmtB = "DELETE FROM vicidial_live_inbound_agents where user='$user';";
if (preg_match("/ALLOW_AGENTDIRECT/",$max_inbound_calls_outcome) )
{
$closer_campaigns = preg_replace("/^ | -$//gi",'',$closer_campaigns);
$ADcloser_campaignsARY = explode(" ",$closer_campaigns);
$ADcloser_campaigns = preg_replace("/^ | -$/",'',$closer_campaigns);
$ADcloser_campaignsARY = explode(" ",$ADcloser_campaigns);
$ADcloser_campaignsARYct = count($ADcloser_campaignsARY);
$ADc=0;
$ADcloser_campaigns='';
while ($ADc < $ADcloser_campaignsARYct)
{
if (preg_match("/AGENTDIRECT/i",$ADcloser_campaignsARY[$ADc]))
{$ADcloser_campaigns .= "$ADcloser_campaignsARY[$ADc] ";}
{
$ADcloser_campaigns .= "$ADcloser_campaignsARY[$ADc] ";
$max_inbound_AG_trigger++;
}
$ADc++;
}
if (strlen($ADcloser_campaigns) > 3)
@@ -15316,7 +15339,7 @@ if ($ACTION == 'updateDISPO')
else
{$ADcloser_campaigns = " -";}
$stmtA = "UPDATE vicidial_live_agents set external_ingroups='$ADcloser_campaigns',external_blended='$outbound_autodial',external_igb_set_user='VDIC',manager_ingroup_set='SET' where user='$user'";
$stmtA = "UPDATE vicidial_live_agents SET external_ingroups='$ADcloser_campaigns',external_blended='$outbound_autodial',external_igb_set_user='VDIC',manager_ingroup_set='SET' where user='$user';";
$stmtB = "DELETE FROM vicidial_live_inbound_agents where user='$user' and group_id NOT LIKE\"%AGENTDIRECT%\";";
}
@@ -15330,9 +15353,19 @@ if ($ACTION == 'updateDISPO')
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtB,'00816',$user,$server_ip,$session_name,$one_mysql_log);}
$affected_rowsB = mysqli_affected_rows($link);
$SQL_log = "$stmtA|$stmtB";
$stmtC=''; $affected_rowsC=0;
if (strlen($RAWcloser_campaigns) > 2)
{
$stmtC = "INSERT INTO vicidial_max_inbound_cache SET user='$user', campaign_id='$campaign_id', event_date=NOW(), blended='$outbound_autodial', closer_campaigns='$RAWcloser_campaigns', max_inbound_count='$max_inbound_calls', call_count_today='$max_inbound_count', status='NEW', notes='VAS';";
if ($DB) {echo "$stmtC\n";}
$rslt=mysql_to_mysqli($stmtC, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtC,'10001',$user,$server_ip,$session_name,$one_mysql_log);}
$affected_rowsC = mysqli_affected_rows($link);
}
$SQL_log = "$stmtA|$stmtB|$stmtC";
$SQL_log = preg_replace("/'|%/",'',$SQL_log);
$stmtC = "INSERT INTO vicidial_admin_log set event_date=NOW(), user='$user', ip_address='$VARserver_ip', event_section='USERS', event_type='MODIFY', record_id='$user', event_code='MAX IN CALLS MODIFY USER', event_sql='$SQL_log', event_notes='|$dispo_choice|$customer_sec|$max_inbound_count|$max_inbound_calls|$user|IC|$max_inbound_calls_outcome|$closer_campaigns|$affected_rowsA|$affected_rowsB|';";
$stmtC = "INSERT INTO vicidial_admin_log set event_date=NOW(), user='$user', ip_address='$VARserver_ip', event_section='USERS', event_type='MODIFY', record_id='$user', event_code='MAX IN CALLS MODIFY USER', event_sql='$SQL_log', event_notes='|$dispo_choice|$customer_sec|$max_inbound_count|$max_inbound_calls|$user|IC|$max_inbound_calls_outcome|$closer_campaigns|$affected_rowsA|$affected_rowsB|$affected_rowsC|';";
$rslt=mysql_to_mysqli($stmtC, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtC,'00817',$user,$server_ip,$session_name,$one_mysql_log);}
$affected_rowsC = mysqli_affected_rows($link);
+17 -4
View File
@@ -757,13 +757,14 @@
# 260301-0850 - Added xfer_talk_minimum features for In-Group transfers
# 260302-0935 - Code updates for PHP8 compatibility
# 260324-0857 - Added hangup_again_link campaign option
# 260408-1850 - Added max_inbound_auto_reenable option
#
$version = '2.14-723c';
$build = '260324-0857';
$version = '2.14-724c';
$build = '260408-1850';
$php_script = 'vicidial.php';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=109;
$mysql_log_count=110;
$one_mysql_log=0;
$DB=0;
$conf_table = "vicidial_conferences";
@@ -901,7 +902,7 @@ $random = (rand(1000000, 9999999) + 10000000);
#############################################
##### START SYSTEM_SETTINGS AND USER LANGUAGE LOOKUP #####
$stmt = "SELECT use_non_latin,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,webroot_writable,timeclock_end_of_day,vtiger_url,enable_vtiger_integration,outbound_autodial_active,enable_second_webform,user_territories_active,static_agent_url,custom_fields_enabled,pllb_grouping_limit,qc_features_active,allow_emails,callback_time_24hour,enable_languages,language_method,meetme_enter_login_filename,meetme_enter_leave3way_filename,enable_third_webform,default_language,active_modules,allow_chats,chat_url,default_phone_code,agent_screen_colors,manual_auto_next,agent_xfer_park_3way,admin_web_directory,agent_script,agent_push_events,agent_push_url,agent_logout_link,agentonly_callback_campaign_lock,manual_dial_validation,mute_recordings,enable_second_script,enable_first_webform,recording_buttons,outbound_cid_any,browser_call_alerts,manual_dial_phone_strip,require_password_length,pass_hash_enabled,agent_hidden_sound_seconds,agent_hidden_sound,agent_hidden_sound_volume,agent_screen_timer,agent_hide_hangup,allow_web_debug,max_logged_in_agents,login_kickall,agent_notifications,inbound_credits,two_factor_auth_agent_hours,two_factor_container,sip_event_logging,stereo_recording,agent_hide_dial_fail,agent_man_dial_filter,agent_3way_dial_filter,recording_dtmf_detection,recording_dtmf_muting,xfer_min_container FROM system_settings;";
$stmt = "SELECT use_non_latin,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,webroot_writable,timeclock_end_of_day,vtiger_url,enable_vtiger_integration,outbound_autodial_active,enable_second_webform,user_territories_active,static_agent_url,custom_fields_enabled,pllb_grouping_limit,qc_features_active,allow_emails,callback_time_24hour,enable_languages,language_method,meetme_enter_login_filename,meetme_enter_leave3way_filename,enable_third_webform,default_language,active_modules,allow_chats,chat_url,default_phone_code,agent_screen_colors,manual_auto_next,agent_xfer_park_3way,admin_web_directory,agent_script,agent_push_events,agent_push_url,agent_logout_link,agentonly_callback_campaign_lock,manual_dial_validation,mute_recordings,enable_second_script,enable_first_webform,recording_buttons,outbound_cid_any,browser_call_alerts,manual_dial_phone_strip,require_password_length,pass_hash_enabled,agent_hidden_sound_seconds,agent_hidden_sound,agent_hidden_sound_volume,agent_screen_timer,agent_hide_hangup,allow_web_debug,max_logged_in_agents,login_kickall,agent_notifications,inbound_credits,two_factor_auth_agent_hours,two_factor_container,sip_event_logging,stereo_recording,agent_hide_dial_fail,agent_man_dial_filter,agent_3way_dial_filter,recording_dtmf_detection,recording_dtmf_muting,xfer_min_container,max_inbound_auto_reenable FROM system_settings;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01001',$VD_login,$server_ip,$session_name,$one_mysql_log);}
#if ($DB) {echo "$stmt\n";}
@@ -975,6 +976,7 @@ if ($qm_conf_ct > 0)
$SSrecording_dtmf_detection = $row[63];
$SSrecording_dtmf_muting = $row[64];
$SSxfer_min_container = $row[65];
$SSmax_inbound_auto_reenable = $row[66];
if ( ($SSagent_hidden_sound == '---NONE---') or ($SSagent_hidden_sound == '') ) {$SSagent_hidden_sound_seconds=0;}
}
else
@@ -4989,6 +4991,17 @@ else
$RIRaffected_rows = mysqli_affected_rows($link);
echo "<!-- routing_initiated_recordings invalidated: |$RIRaffected_rows| -->\n";
$SSmax_inbound_auto_reenable = intval($SSmax_inbound_auto_reenable);
if ($SSmax_inbound_auto_reenable != 2)
{
$stmt="UPDATE vicidial_max_inbound_cache set status='OLD',notes=CONCAT(notes,'|LOGIN') where user='$VD_login' and status='NEW';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01110',$VD_login,$server_ip,$session_name,$one_mysql_log);}
$MICaffected_rows = mysqli_affected_rows($link);
echo "<!-- vicidial_max_inbound_cache archived: |$MICaffected_rows| -->\n";
}
$VULhostname = php_uname('n');
$VULservername = $_SERVER['SERVER_NAME'];
if (strlen($VULhostname)<1) {$VULhostname='X';}
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
# version: 20260324085301
# version: 20260408083901
users-user User ID <QXZ>This field is where you put the users ID number, can be up to 20 digits in length, Must be at least 2 characters in length. We strongly recommend not reusing user accounts for different users, for reporting accuracy. To disable a user account, set the Active option to -N-.</QXZ>
users-pass Password <QXZ>This field is where you put the users password. Must be at least 2 characters in length, unless the User Password Minimum Length system setting is enabled, which will require a longer password. Only letters and numbers are allowed in user passwords. A medium strength user password will be at least 10 characters in length, and a strong user password will be at least 20 characters in length and have letters as well as at least one number. It is recommended that you use a longer password if possible, stringing together several unrelated words with no spaces, and a number somewhere in the string. The maximum size of a password is 100 characters.</QXZ>
users-force_change_password Force Change Password <QXZ>If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage or the agent screen. Default is N.</QXZ>
@@ -1206,6 +1206,7 @@ settings-test_campaign_calls Enable Campaign Test Calls <QXZ>This setting enable
settings-did_system_filter DID System Filter <QXZ>This setting enables the special did_system_filter DID entry. The filter settings in this DID entry will be applied to all incoming calls to the system, prior to any other actions on the call. This feature is commonly used for system-wide inbound blacklists, or filtering of do-not-contact phone numbers. Default is 0 for disabled.</QXZ>
settings-inbound_answer_config Inbound Answer Configuration <QXZ>If enabled, this allows you to override the default behavior with inbound calls automatically being answered when they are routed. After this is enabled, you will see options to define if an Answer signal is sent at the individual DID, In-Group or Call Menu level. Default is 0 for disabled.</QXZ>
settings-inbound_credits Inbound Calls Credits <QXZ>If this setting is enabled, it will allow you to set a number of Inbound Calls Credits in the User Modify screen for each user. Default is 0 for disabled.</QXZ>
settings-max_inbound_auto_reenable Inbound Max Calls Auto Re-Enable <QXZ>If enabled, when a User or Campaign has had its Max Inbound Calls setting raised, then the system will automatically re-select the agent selected inbound groups in current agent screen sessions without the agent having to log out and back in again so that they can immmediately take inbound calls again. If this option is set to -2-, the feature will be enabled and also selected in-groups will be re-selected when a User or Campaign has had its Max Inbound Calls setting raised, even if the agent logs out and back in after triggering the max inbound calls before the setting change. Also for option -2- the previous selected in-groups will be reset at the Timeclock End of Day each day. Default is 1 for enabled.</QXZ>
settings-abandon_check_queue Enable Abandon Check Queue <QXZ>If enabled, this allows you to use the Abandon Check Queue to call back customers that called in to your system but did not talk to an agent. See the details for this feature at the bottom of the INBOUND_CALLBACK_QUEUE.txt document. Default is 0 for disabled.</QXZ>
settings-enable_international_dncs Enable Interational DNCs <QXZ>If enabled, this allows you to create DNC lists for individual countries and provides the option to scrub against these lists when loading lead files.</QXZ>
settings-user_new_lead_limit New Leads Per List Limit <QXZ>This setting enables the new lead limits per list to be set on the list modify page and the user list new lead limit page. This feature will only work properly if the campaign is set to either the MANUAL or INBOUND_MAN Dial Method and No Hopper dialing is enabled. Default is 0 for disabled.</QXZ>