Fix for LIVE call issue in top_panel

Fix for short CIDnumber issue in inbound calltime check AGI
Fix for AGENTDIRECT issue in ALL inbound AGI

git-svn-id: svn://192.168.202.10@3307 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2020-10-27 03:37:01 +00:00
parent 88eb1b32f1
commit f6be23ab11
3 changed files with 57 additions and 22 deletions
+33 -3
View File
@@ -238,6 +238,7 @@
# 200624-0011 - Added options for Answer signal settings
# 200708-1126 - Added some list override settings
# 200816-0910 - Fixed issue with cid_cb_confirmed_filename multi-prompt not playing last file
# 201026-2333 - Fix for AGENTDIRECT issue
#
$script = 'agi-VDAD_ALL_inbound.agi';
@@ -2893,6 +2894,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
if ( ( ($rec_countWAITrem < 1) && ($rec_countWAITqueue < 1) ) || ($AGENTgrab > 0) )
{
$qp_countWAIT=0;
### Get count of number of waiting calls in higher priority groups than this call or the same priority with longer wait time
$stmtA = "SELECT count(*) FROM vicidial_auto_calls where status = 'LIVE' and lead_id != '$insert_lead_id' $ADfindSQL and ( (queue_priority > '$queue_priority') or (queue_priority = '$queue_priority' and call_time < \"$SQLdateBEGIN\") );";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
@@ -2907,6 +2909,34 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
$sthA->finish();
if ($AGILOG) {$agi_string = "$qp_countWAIT|$stmtA|"; &agi_output;}
$AGENTDIRECT_higher_count=0;
$AGENTDIRECT_higher_users='';
$AGENTDIRECT_higherSQL='';
if ($channel_group !~ /AGENTDIRECT/)
{
### Get count of number of waiting calls in higher priority AGENTDIRECT groups than this call or the same priority with longer wait time
$stmtA = "SELECT agent_only FROM vicidial_auto_calls where status = 'LIVE' and campaign_id LIKE \"%AGENTDIRECT%\" and ( (queue_priority > '$queue_priority') or (queue_priority = '$queue_priority' and call_time < \"$SQLdateBEGIN\") );";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$AGENTDIRECT_higher_count=$sthA->rows;
$dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$AGENTDIRECT_higher_count; &mysql_error_logging;
$ad_ct=0;
while ($AGENTDIRECT_higher_count > $ad_ct)
{
@aryA = $sthA->fetchrow_array;
if ($ad_ct > 0)
{$AGENTDIRECT_higher_users .= ",";}
$AGENTDIRECT_higher_users .= "'$aryA[0]'";
$ad_ct++;
}
$sthA->finish();
if ($AGENTDIRECT_higher_count > 0)
{
$AGENTDIRECT_higherSQL = "and vicidial_live_agents.user NOT IN($AGENTDIRECT_higher_users)";
}
if ($AGILOG) {$agi_string = "AGENTDIRECT calls check: $AGENTDIRECT_higher_count|$AGENTDIRECT_higher_users|$AGENTDIRECT_higherSQL|$stmtA|"; &agi_output;}
}
$qp_countWAITqueue=0;
### Get count of number of waiting calls in higher priority groups than this call or the same priority with longer wait time
$stmtA = "SELECT count(*) FROM vicidial_inbound_callback_queue where icbq_status IN('LIVE','SENDING') and lead_id != '$insert_lead_id' and ( (queue_priority > '$queue_priority') or (queue_priority = '$queue_priority' and call_date < \"$SQLdateBEGIN\") );";
@@ -3027,7 +3057,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
@GRADEuser=@MT;
@GRADEgrade=@MT;
@userGRADEarray=@MT;
$stmtA = "SELECT vicidial_live_agents.user,vicidial_live_inbound_agents.group_grade,vicidial_live_agents.campaign_grade from vicidial_live_agents, vicidial_live_inbound_agents WHERE vicidial_live_agents.user=vicidial_live_inbound_agents.user and status IN('CLOSER','READY') and lead_id<1 $ADUfindSQL and vicidial_live_inbound_agents.group_id='$channel_group' and last_update_time > '$BDtsSQLdate' and vicidial_live_agents.user NOT IN($ring_no_answer_agents$vlia_users) and ring_callerid='' $qp_groupWAIT_camp_SQL limit 1000;";
$stmtA = "SELECT vicidial_live_agents.user,vicidial_live_inbound_agents.group_grade,vicidial_live_agents.campaign_grade from vicidial_live_agents, vicidial_live_inbound_agents WHERE vicidial_live_agents.user=vicidial_live_inbound_agents.user and status IN('CLOSER','READY') and lead_id<1 $ADUfindSQL and vicidial_live_inbound_agents.group_id='$channel_group' and last_update_time > '$BDtsSQLdate' and vicidial_live_agents.user NOT IN($ring_no_answer_agents$vlia_users) and ring_callerid='' $qp_groupWAIT_camp_SQL $AGENTDIRECT_higherSQL limit 1000;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -3091,7 +3121,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
### END grade random next-agent-call routing ###
else
{
$stmtA = "SELECT vicidial_live_agents.conf_exten,vicidial_live_agents.user,vicidial_live_agents.extension,vicidial_live_agents.server_ip,vicidial_live_inbound_agents.group_weight,ra_user,vicidial_live_agents.campaign_id,on_hook_agent,on_hook_ring_time,vicidial_live_inbound_agents.group_grade,vicidial_live_agents.campaign_grade from vicidial_live_agents, vicidial_live_inbound_agents WHERE vicidial_live_agents.user=vicidial_live_inbound_agents.user and status IN('CLOSER','READY') and lead_id<1 $ADUfindSQL and vicidial_live_inbound_agents.group_id='$channel_group' and last_update_time > '$BDtsSQLdate' and vicidial_live_agents.user NOT IN($ring_no_answer_agents$vlia_users) and ring_callerid='' $qp_groupWAIT_camp_SQL $agent_call_order limit 1;";
$stmtA = "SELECT vicidial_live_agents.conf_exten,vicidial_live_agents.user,vicidial_live_agents.extension,vicidial_live_agents.server_ip,vicidial_live_inbound_agents.group_weight,ra_user,vicidial_live_agents.campaign_id,on_hook_agent,on_hook_ring_time,vicidial_live_inbound_agents.group_grade,vicidial_live_agents.campaign_grade from vicidial_live_agents, vicidial_live_inbound_agents WHERE vicidial_live_agents.user=vicidial_live_inbound_agents.user and status IN('CLOSER','READY') and lead_id<1 $ADUfindSQL and vicidial_live_inbound_agents.group_id='$channel_group' and last_update_time > '$BDtsSQLdate' and vicidial_live_agents.user NOT IN($ring_no_answer_agents$vlia_users) and ring_callerid='' $qp_groupWAIT_camp_SQL $AGENTDIRECT_higherSQL $agent_call_order limit 1;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -3130,7 +3160,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
else
{
$SQL_group_id=$channel_group; $SQL_group_id =~ s/_/\\_/gi;
$stmtA = "SELECT conf_exten,user,extension,server_ip,last_call_time,ra_user,campaign_id,on_hook_agent,on_hook_ring_time FROM vicidial_live_agents where status IN('CLOSER','READY') and lead_id<1 $ADUfindSQL and campaign_id IN($INBOUNDcampsSQL) and closer_campaigns LIKE \"% $SQL_group_id %\" and last_update_time > '$BDtsSQLdate' and vicidial_live_agents.user NOT IN($ring_no_answer_agents'') $qp_groupWAIT_SQL $qp_groupWAIT_camp_SQL $agent_call_order limit 1;";
$stmtA = "SELECT conf_exten,user,extension,server_ip,last_call_time,ra_user,campaign_id,on_hook_agent,on_hook_ring_time FROM vicidial_live_agents where status IN('CLOSER','READY') and lead_id<1 $ADUfindSQL and campaign_id IN($INBOUNDcampsSQL) and closer_campaigns LIKE \"% $SQL_group_id %\" and last_update_time > '$BDtsSQLdate' and vicidial_live_agents.user NOT IN($ring_no_answer_agents'') $qp_groupWAIT_SQL $qp_groupWAIT_camp_SQL $AGENTDIRECT_higherSQL $agent_call_order limit 1;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
+2 -1
View File
@@ -56,6 +56,7 @@
# 161102-1038 - Fixed QM partition problem
# 180213-0935 - Fixed issues with VMAIL_NO_INST timecheck route
# 200624-2302 - Added play sip-silence audio option
# 201026-1501 - Fix for overwriting short CIDnum
#
$script = 'agi-VDAD_inbound_calltime_check.agi';
@@ -302,7 +303,7 @@ else
else {$VLcomments = '';}
}
if (length($callerid)<8) {$callerid = $parked_by;}
if ( (length($callerid)<8) && (length($parked_by) > 6) ) {$callerid = $parked_by;}
if (length($pin)>0) {$callerid = $pin;}
if ($sip_silence_playback !~ /YES|NO/i) {$sip_silence_playback='YES';}