diff --git a/agc_2-X/branches/agc_2.2.0/agi/agi-VDAD_ALL_outbound.agi b/agc_2-X/branches/agc_2.2.0/agi/agi-VDAD_ALL_outbound.agi
index 704cc8ed..5d95a1d3 100644
--- a/agc_2-X/branches/agc_2.2.0/agi/agi-VDAD_ALL_outbound.agi
+++ b/agc_2-X/branches/agc_2.2.0/agi/agi-VDAD_ALL_outbound.agi
@@ -72,6 +72,7 @@
# 91112-1101 - Changed ENTERQUEUE to CALLOUTBOUND in QM logging for outbound calls
# 91230-1159 - Change to callee callerID when sending the call to VMAIL
# 100205-1024 - Fixed CPD send to message
+# 100623-1320 - Added queue_priority to queue processing (backport from 2.4)
#
$script = 'agi-VDAD_ALL_outbound.agi';
@@ -192,13 +193,13 @@ $sthArows=$sthA->rows;
while ($sthArows > $rec_count)
{
@aryA = $sthA->fetchrow_array;
- $DBvoicemail_dump_exten = "$aryA[0]";
- $DBext_context = "$aryA[1]";
- $DBanswer_transfer_agent = "$aryA[2]";
- $DBSERVER_GMT = "$aryA[3]";
- $DBasterisk_version = "$aryA[4]";
- $DBmax_vicidial_trunks = "$aryA[5]";
- $DBagi_output = "$aryA[6]";
+ $DBvoicemail_dump_exten = $aryA[0];
+ $DBext_context = $aryA[1];
+ $DBanswer_transfer_agent = $aryA[2];
+ $DBSERVER_GMT = $aryA[3];
+ $DBasterisk_version = $aryA[4];
+ $DBmax_vicidial_trunks = $aryA[5];
+ $DBagi_output = $aryA[6];
if ($DBvoicemail_dump_exten) {$voicemail_dump_exten = $DBvoicemail_dump_exten;}
if ($DBext_context) {$ext_context = $DBext_context;}
if ($DBanswer_transfer_agent) {$answer_transfer_agent = $DBanswer_transfer_agent;}
@@ -321,11 +322,11 @@ $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $mysql_count='01002'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
- $rec_count=0;
+$rec_count=0;
while ($sthArows > $rec_count)
{
@aryA = $sthA->fetchrow_array;
- $Pseudo_duplicate_count = "$aryA[0]";
+ $Pseudo_duplicate_count = $aryA[0];
$rec_count++;
}
$sthA->finish();
@@ -342,11 +343,11 @@ $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $mysql_count='01003'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
- $rec_count=0;
+$rec_count=0;
while ($sthArows > $rec_count)
{
@aryA = $sthA->fetchrow_array;
- $dialplan_duplicate_count = "$aryA[0]";
+ $dialplan_duplicate_count = $aryA[0];
$rec_count++;
}
$sthA->finish();
@@ -372,7 +373,7 @@ if ($affected_rows > 0)
$dbhP=$dbhA; $mysql_count='01005'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
if ($AGILOG) {$agi_string = "-- VDAD vicidial_list PU update: |$affected_rows|$uniqueid|"; &agi_output;}
- $stmtA = "SELECT campaign_id,phone_number,phone_code,lead_id,call_time,alt_dial FROM vicidial_auto_calls where callerid='$callerid' order by call_time desc limit 1;";
+ $stmtA = "SELECT campaign_id,phone_number,phone_code,lead_id,call_time,alt_dial,queue_priority FROM vicidial_auto_calls where callerid='$callerid' order by call_time desc limit 1;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -381,18 +382,19 @@ if ($affected_rows > 0)
while ($sthArows > $rec_count)
{
@aryA = $sthA->fetchrow_array;
- $VDADcampaign = "$aryA[0]";
- $VDADphone = "$aryA[1]";
- $VDADphone_code = "$aryA[2]";
- $VDADlead_id = "$aryA[3]";
- $VDADcall_time = "$aryA[4]";
- $VDADalt_dial = "$aryA[5]";
+ $VDADcampaign = $aryA[0];
+ $VDADphone = $aryA[1];
+ $VDADphone_code = $aryA[2];
+ $VDADlead_id = $aryA[3];
+ $VDADcall_time = $aryA[4];
+ $VDADalt_dial = $aryA[5];
+ $VDADqueue_priority = $aryA[6];
$rec_count++;
}
$sthA->finish();
### Grab campaign values from the database
- $stmtA = "SELECT drop_call_seconds,drop_action,safe_harbor_exten,concurrent_transfers,next_agent_call,voicemail_ext,drop_inbound_group,use_internal_dnc,use_campaign_dnc,cpd_amd_action,am_message_exten,three_way_call_cid,campaign_cid,survey_first_audio_file,survey_opt_in_audio_file,survey_ni_audio_file,survey_third_audio_file,survey_fourth_audio_file FROM vicidial_campaigns where campaign_id = '$VDADcampaign';";
+ $stmtA = "SELECT drop_call_seconds,drop_action,safe_harbor_exten,concurrent_transfers,next_agent_call,voicemail_ext,drop_inbound_group,use_internal_dnc,use_campaign_dnc,cpd_amd_action,am_message_exten,three_way_call_cid,campaign_cid,survey_first_audio_file,survey_opt_in_audio_file,survey_ni_audio_file,survey_third_audio_file,survey_fourth_audio_file,queue_priority,closer_campaigns FROM vicidial_campaigns where campaign_id = '$VDADcampaign';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -400,27 +402,36 @@ if ($affected_rows > 0)
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
- $DBdrop_call_seconds = "$aryA[0]";
- $DBdrop_action = "$aryA[1]";
- $DBsafe_harbor_exten = "$aryA[2]";
- $DBconcurrent_transfers = "$aryA[3]";
+ $DBdrop_call_seconds = $aryA[0];
+ $DBdrop_action = $aryA[1];
+ $DBsafe_harbor_exten = $aryA[2];
+ $DBconcurrent_transfers = $aryA[3];
if ($DBdrop_call_seconds) {$DROP_TIME = $DBdrop_call_seconds;}
if ($DBdrop_action) {$drop_action = $DBdrop_action;}
if ($DBsafe_harbor_exten) {$safe_harbor_exten = $DBsafe_harbor_exten;}
- $CAMP_callorder = "$aryA[4]";
- $VDADvoicemail_ext = "$aryA[5]";
- $drop_inbound_group = "$aryA[6]";
- $use_internal_dnc = "$aryA[7]";
- $use_campaign_dnc = "$aryA[8]";
- $cpd_amd_action = "$aryA[9]";
- $am_message_exten = "$aryA[10]";
- $three_way_call_cid = "$aryA[11]";
- $campaign_cid = "$aryA[12]";
- $survey_first_audio_file = "$aryA[13]";
- $survey_opt_in_audio_file = "$aryA[14]";
- $survey_ni_audio_file = "$aryA[15]";
- $survey_third_audio_file = "$aryA[16]";
- $survey_fourth_audio_file = "$aryA[17]";
+ $CAMP_callorder = $aryA[4];
+ $VDADvoicemail_ext = $aryA[5];
+ $drop_inbound_group = $aryA[6];
+ $use_internal_dnc = $aryA[7];
+ $use_campaign_dnc = $aryA[8];
+ $cpd_amd_action = $aryA[9];
+ $am_message_exten = $aryA[10];
+ $three_way_call_cid = $aryA[11];
+ $campaign_cid = $aryA[12];
+ $survey_first_audio_file = $aryA[13];
+ $survey_opt_in_audio_file = $aryA[14];
+ $survey_ni_audio_file = $aryA[15];
+ $survey_third_audio_file = $aryA[16];
+ $survey_fourth_audio_file = $aryA[17];
+ $queue_priority = $aryA[18];
+ $closer_campaigns = $aryA[19];
+ if (length($closer_campaigns) > 2)
+ {
+ $closer_campaigns =~ s/^ | -$//gi;
+ $closer_campaigns =~ s/ /','/gi;
+ $closer_campaigns = "'$closer_campaigns'";
+ }
+ else {$closer_campaigns="''";}
}
$sthA->finish();
@@ -608,7 +619,7 @@ if ($affected_rows > 0)
if ($sthArowsLI > 0)
{
@aryA = $sthA->fetchrow_array;
- $xCLlist_id = "$aryA[0]";
+ $xCLlist_id = $aryA[0];
}
$sthA->finish();
@@ -629,15 +640,15 @@ if ($affected_rows > 0)
$rec_count=0;
while ($sthArows > $rec_count)
{
- @aryA = $sthA->fetchrow_array;
- $enable_queuemetrics_logging = "$aryA[0]";
- $queuemetrics_server_ip = "$aryA[1]";
- $queuemetrics_dbname = "$aryA[2]";
- $queuemetrics_login= "$aryA[3]";
- $queuemetrics_pass = "$aryA[4]";
- $queuemetrics_log_id = "$aryA[5]";
- $queuemetrics_eq_prepend = "$aryA[6]";
- $rec_count++;
+ @aryA = $sthA->fetchrow_array;
+ $enable_queuemetrics_logging = $aryA[0];
+ $queuemetrics_server_ip = $aryA[1];
+ $queuemetrics_dbname = $aryA[2];
+ $queuemetrics_login= $aryA[3];
+ $queuemetrics_pass = $aryA[4];
+ $queuemetrics_log_id = $aryA[5];
+ $queuemetrics_eq_prepend = $aryA[6];
+ $rec_count++;
}
$sthA->finish();
##### END QUEUEMETRICS LOGGING LOOKUP #####
@@ -653,8 +664,8 @@ if ($affected_rows > 0)
while ($sthArows > $rec_count)
{
@aryA = $sthA->fetchrow_array;
- $phone_number = "$aryA[0]";
- $data2 = "$phone_number";
+ $phone_number = $aryA[0];
+ $data2 = $phone_number;
$rec_count++;
}
$sthA->finish();
@@ -671,7 +682,7 @@ if ($affected_rows > 0)
{
$DASH='-';
@aryA = $sthA->fetchrow_array;
- $QMprepend = "$aryA[0]";
+ $QMprepend = $aryA[0];
$rec_count++;
$data2 = "$QMprepend$DASH$phone_number";
}
@@ -709,7 +720,7 @@ if ($call_handle_method =~ /REMIND/)
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
- $cpd_amd = "$aryA[0]";
+ $cpd_amd = $aryA[0];
}
$sthA->finish();
@@ -750,7 +761,7 @@ if ($call_handle_method =~ /SURVEY/)
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
- $cpd_amd = "$aryA[0]";
+ $cpd_amd = $aryA[0];
}
$sthA->finish();
@@ -777,21 +788,20 @@ if ($call_handle_method =~ /SURVEY/)
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
-
- $survey_dtmf_digits = "$aryA[0]";
- $survey_ni_digit = "$aryA[1]";
- $survey_method = "$aryA[2]";
- $survey_no_response_action = "$aryA[3]";
- $survey_ni_status = "$aryA[4]";
- $survey_response_digit_map = "$aryA[5]";
- $survey_xfer_exten = "$aryA[6]";
- $survey_camp_record_dir = "$aryA[7]";
- $survey_third_digit = "$aryA[8]";
- $survey_third_status = "$aryA[9]";
- $survey_third_exten = "$aryA[10]";
- $survey_fourth_digit = "$aryA[11]";
- $survey_fourth_status = "$aryA[12]";
- $survey_fourth_exten = "$aryA[13]";
+ $survey_dtmf_digits = $aryA[0];
+ $survey_ni_digit = $aryA[1];
+ $survey_method = $aryA[2];
+ $survey_no_response_action = $aryA[3];
+ $survey_ni_status = $aryA[4];
+ $survey_response_digit_map = $aryA[5];
+ $survey_xfer_exten = $aryA[6];
+ $survey_camp_record_dir = $aryA[7];
+ $survey_third_digit = $aryA[8];
+ $survey_third_status = $aryA[9];
+ $survey_third_exten = $aryA[10];
+ $survey_fourth_digit = $aryA[11];
+ $survey_fourth_status = $aryA[12];
+ $survey_fourth_exten = $aryA[13];
@digit_map = split(/\|/,$survey_response_digit_map);
@@ -1329,7 +1339,7 @@ while ($drop_timer <= $DROP_TIME)
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
- $cpd_amd = "$aryA[0]";
+ $cpd_amd = $aryA[0];
}
$sthA->finish();
@@ -1341,6 +1351,12 @@ while ($drop_timer <= $DROP_TIME)
############# END CPD AMD SECTION ############################
+
+
+
+ ############################################################################
+ ### BEGIN attempt to send call to agent
+ ############################################################################
$rec_countCUSTDATA=0;
$rec_countWAIT=0;
$cbc=0;
@@ -1361,7 +1377,7 @@ while ($drop_timer <= $DROP_TIME)
if ($agent_search_method =~ /^SO/)
{$agent_search_method = 'LO';}
$rec_countWAIT=0;
- $stmtA = "SELECT count(*) FROM vicidial_auto_calls where status = 'LIVE' and server_ip='$VARserver_ip' and campaign_id = '$VDADcampaign' and call_time < \"$VDADcall_time\" and lead_id != '$CIDlead_id';";
+ $stmtA = "SELECT count(*) FROM vicidial_auto_calls where status = 'LIVE' and server_ip='$VARserver_ip' and lead_id != '$CIDlead_id' and ( ( (campaign_id = '$VDADcampaign') and (call_time < \"$VDADcall_time\") ) or ( (queue_priority > '$VDADqueue_priority') and (call_type='IN') and (campaign_id IN($closer_campaigns)) ) );";
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
@@ -1371,7 +1387,7 @@ while ($drop_timer <= $DROP_TIME)
while ($sthArows > $rec_count)
{
@aryA = $sthA->fetchrow_array;
- $rec_countWAIT = "$aryA[0]";
+ $rec_countWAIT = $aryA[0];
$rec_count++;
}
$sthA->finish();
@@ -1388,7 +1404,7 @@ while ($drop_timer <= $DROP_TIME)
while ($sthArows > $rec_count)
{
@aryA = $sthA->fetchrow_array;
- $active_agents = "$aryA[0]";
+ $active_agents = $aryA[0];
$rec_count++;
}
@@ -1552,7 +1568,7 @@ while ($drop_timer <= $DROP_TIME)
##### Attempt to send call to an agent on any server #####
$cbc=0;
$rec_countWAITrem=0;
- $stmtA = "SELECT count(*) FROM vicidial_auto_calls where status = 'LIVE' and campaign_id = '$VDADcampaign' and call_time < \"$VDADcall_time\" and lead_id != '$CIDlead_id';";
+ $stmtA = "SELECT count(*) FROM vicidial_auto_calls where status = 'LIVE' and lead_id != '$CIDlead_id' and ( ( (campaign_id = '$VDADcampaign') and (call_time < \"$VDADcall_time\") ) or ( (queue_priority > '$VDADqueue_priority') and (call_type='IN') and (campaign_id IN($closer_campaigns)) ) );";
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
@@ -1562,7 +1578,7 @@ while ($drop_timer <= $DROP_TIME)
while ($sthArows > $rec_count)
{
@aryA = $sthA->fetchrow_array;
- $rec_countWAITrem = "$aryA[0]";
+ $rec_countWAITrem = $aryA[0];
$rec_count++;
}
$sthA->finish();
@@ -1579,7 +1595,7 @@ while ($drop_timer <= $DROP_TIME)
while ($sthArows > $rec_count)
{
@aryA = $sthA->fetchrow_array;
- $active_agents = "$aryA[0]";
+ $active_agents = $aryA[0];
$rec_count++;
}
@@ -1749,6 +1765,10 @@ while ($drop_timer <= $DROP_TIME)
if ($AGILOG) {$agi_string = "WWWWWWWW VDAD XFER BALANCE WAIT: |$rec_countWAIT|$VDADcampaign|$channel|$callerid|$uniqueid|"; &agi_output;}
}
}
+ ############################################################################
+ ### END attempt to send call to agent
+ ############################################################################
+
if ($drop_timer < 3)
{
@@ -1768,7 +1788,7 @@ while ($drop_timer <= $DROP_TIME)
$affected_rows = $dbhA->do($stmtA);
if ($affected_rows < 1)
{
- $stmtA = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,uniqueid,callerid,channel,phone_code,phone_number,call_time,call_type,stage) values('$VARserver_ip','$channel_group','CLOSER','$CIDlead_id','$uniqueid','$callerid','$channel','$phone_code','$phone_number','$SQLdate','IN','CLOSER-$drop_timer')";
+ $stmtA = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,uniqueid,callerid,channel,phone_code,phone_number,call_time,call_type,stage,queue_priority) values('$VARserver_ip','$channel_group','CLOSER','$CIDlead_id','$uniqueid','$callerid','$channel','$phone_code','$phone_number','$SQLdate','IN','CLOSER-$drop_timer','$queue_priority')";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='01047'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
if ($AGILOG) {$agi_string = "$affected_rows|VDAC-reinsert|$stmtA|"; &agi_output;}
@@ -1823,6 +1843,11 @@ if ($drop_timer > $DROP_TIME)
if ($drop_action =~ /MESSAGE/)
{
+ $newcallerid = "\"$callerid <$VDADphone>\"";
+ $AGI->set_callerid($newcallerid);
+ print STDERR "Setting CID \"$newcallerid\"\n";
+ checkresult($result);
+ if ($AGILOG) {$agi_string = "callerID changed: $newcallerid"; &agi_output;}
if (length($safe_harbor_exten)>0)
{$DROPexten = "$safe_harbor_exten";}
}
@@ -2067,7 +2092,7 @@ sub cpd_end_call
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
- $cpd_result = "$aryA[0]";
+ $cpd_result = $aryA[0];
}
$sthA->finish();
$CPDfound=0;
diff --git a/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi b/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi
index 0f8eb14b..faed7f96 100644
--- a/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi
+++ b/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi
@@ -75,6 +75,7 @@
# 100319-0610 - Added extension group remote agent feature
# 100414-2156 - Added extension_appended_cidname option
# 100424-1341 - Added extended logging
+# 100623-1310 - Added queue_priority to queue processing
#
$script = 'agi-VDAD_ALL_outbound.agi';
@@ -378,7 +379,7 @@ if ($affected_rows > 0)
$dbhP=$dbhA; $mysql_count='01005'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
if ($AGILOG) {$agi_string = "-- VDAD vicidial_list PU update: |$affected_rows|$uniqueid|"; &agi_output;}
- $stmtA = "SELECT campaign_id,phone_number,phone_code,lead_id,call_time,alt_dial FROM vicidial_auto_calls where callerid='$callerid' order by call_time desc limit 1;";
+ $stmtA = "SELECT campaign_id,phone_number,phone_code,lead_id,call_time,alt_dial,queue_priority FROM vicidial_auto_calls where callerid='$callerid' order by call_time desc limit 1;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -387,18 +388,19 @@ if ($affected_rows > 0)
while ($sthArows > $rec_count)
{
@aryA = $sthA->fetchrow_array;
- $VDADcampaign = $aryA[0];
- $VDADphone = $aryA[1];
- $VDADphone_code = $aryA[2];
- $VDADlead_id = $aryA[3];
- $VDADcall_time = $aryA[4];
- $VDADalt_dial = $aryA[5];
+ $VDADcampaign = $aryA[0];
+ $VDADphone = $aryA[1];
+ $VDADphone_code = $aryA[2];
+ $VDADlead_id = $aryA[3];
+ $VDADcall_time = $aryA[4];
+ $VDADalt_dial = $aryA[5];
+ $VDADqueue_priority = $aryA[6];
$rec_count++;
}
$sthA->finish();
### Grab campaign values from the database
- $stmtA = "SELECT drop_call_seconds,drop_action,safe_harbor_exten,concurrent_transfers,next_agent_call,voicemail_ext,drop_inbound_group,use_internal_dnc,use_campaign_dnc,cpd_amd_action,am_message_exten,three_way_call_cid,campaign_cid,survey_first_audio_file,survey_opt_in_audio_file,survey_ni_audio_file,survey_third_audio_file,survey_fourth_audio_file,extension_appended_cidname FROM vicidial_campaigns where campaign_id = '$VDADcampaign';";
+ $stmtA = "SELECT drop_call_seconds,drop_action,safe_harbor_exten,concurrent_transfers,next_agent_call,voicemail_ext,drop_inbound_group,use_internal_dnc,use_campaign_dnc,cpd_amd_action,am_message_exten,three_way_call_cid,campaign_cid,survey_first_audio_file,survey_opt_in_audio_file,survey_ni_audio_file,survey_third_audio_file,survey_fourth_audio_file,extension_appended_cidname,queue_priority,closer_campaigns FROM vicidial_campaigns where campaign_id = '$VDADcampaign';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -428,6 +430,15 @@ if ($affected_rows > 0)
$survey_third_audio_file = $aryA[16];
$survey_fourth_audio_file = $aryA[17];
$extension_appended_cidname = $aryA[18];
+ $queue_priority = $aryA[19];
+ $closer_campaigns = $aryA[20];
+ if (length($closer_campaigns) > 2)
+ {
+ $closer_campaigns =~ s/^ | -$//gi;
+ $closer_campaigns =~ s/ /','/gi;
+ $closer_campaigns = "'$closer_campaigns'";
+ }
+ else {$closer_campaigns="''";}
}
$sthA->finish();
@@ -1354,6 +1365,12 @@ while ($drop_timer <= $DROP_TIME)
############# END CPD AMD SECTION ############################
+
+
+
+ ############################################################################
+ ### BEGIN attempt to send call to agent
+ ############################################################################
$rec_countCUSTDATA=0;
$rec_countWAIT=0;
$cbc=0;
@@ -1374,7 +1391,7 @@ while ($drop_timer <= $DROP_TIME)
if ($agent_search_method =~ /^SO/)
{$agent_search_method = 'LO';}
$rec_countWAIT=0;
- $stmtA = "SELECT count(*) FROM vicidial_auto_calls where status = 'LIVE' and server_ip='$VARserver_ip' and campaign_id = '$VDADcampaign' and call_time < \"$VDADcall_time\" and lead_id != '$CIDlead_id';";
+ $stmtA = "SELECT count(*) FROM vicidial_auto_calls where status = 'LIVE' and server_ip='$VARserver_ip' and lead_id != '$CIDlead_id' and ( ( (campaign_id = '$VDADcampaign') and (call_time < \"$VDADcall_time\") ) or ( (queue_priority > '$VDADqueue_priority') and (call_type='IN') and (campaign_id IN($closer_campaigns)) ) );";
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
@@ -1649,7 +1666,7 @@ while ($drop_timer <= $DROP_TIME)
##### Attempt to send call to an agent on any server #####
$cbc=0;
$rec_countWAITrem=0;
- $stmtA = "SELECT count(*) FROM vicidial_auto_calls where status = 'LIVE' and campaign_id = '$VDADcampaign' and call_time < \"$VDADcall_time\" and lead_id != '$CIDlead_id';";
+ $stmtA = "SELECT count(*) FROM vicidial_auto_calls where status = 'LIVE' and lead_id != '$CIDlead_id' and ( ( (campaign_id = '$VDADcampaign') and (call_time < \"$VDADcall_time\") ) or ( (queue_priority > '$VDADqueue_priority') and (call_type='IN') and (campaign_id IN($closer_campaigns)) ) );";
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
@@ -1933,6 +1950,10 @@ while ($drop_timer <= $DROP_TIME)
if ($AGILOG) {$agi_string = "WWWWWWWW VDAD XFER BALANCE WAIT: |$rec_countWAIT|$VDADcampaign|$channel|$callerid|$uniqueid|"; &agi_output;}
}
}
+ ############################################################################
+ ### END attempt to send call to agent
+ ############################################################################
+
if ($drop_timer < 3)
{
@@ -1952,7 +1973,7 @@ while ($drop_timer <= $DROP_TIME)
$affected_rows = $dbhA->do($stmtA);
if ($affected_rows < 1)
{
- $stmtA = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,uniqueid,callerid,channel,phone_code,phone_number,call_time,call_type,stage) values('$VARserver_ip','$channel_group','CLOSER','$CIDlead_id','$uniqueid','$callerid','$channel','$phone_code','$phone_number','$SQLdate','IN','CLOSER-$drop_timer')";
+ $stmtA = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,uniqueid,callerid,channel,phone_code,phone_number,call_time,call_type,stage,queue_priority) values('$VARserver_ip','$channel_group','CLOSER','$CIDlead_id','$uniqueid','$callerid','$channel','$phone_code','$phone_number','$SQLdate','IN','CLOSER-$drop_timer','$queue_priority')";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='01047'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
if ($AGILOG) {$agi_string = "$affected_rows|VDAC-reinsert|$stmtA|"; &agi_output;}
diff --git a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt
index 45858e7b..0bd2343d 100644
--- a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt
+++ b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt
@@ -236,6 +236,7 @@ Label Alt Phone||
Label Security Phrase||
Label Email||
Label Comments||
+We do not recommend setting inbound calls to a higher priority than the outbound campaign calls because people calling in expect to wait and people being called expect for someone to be there on the phone||
AST_VICIDIAL_ingrouplist.php
diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php
index fe9c6c86..86756abc 100644
--- a/agc_2-X/trunk/www/vicidial/admin.php
+++ b/agc_2-X/trunk/www/vicidial/admin.php
@@ -3835,7 +3835,7 @@ if ($ADD==99999)
- Queue Priority - This setting is used to define the order in which the calls from this outbound campaign should be answered in relation to the inbound calls if this campaign is in blended mode.
+ Queue Priority - This setting is used to define the order in which the calls from this outbound campaign should be answered in relation to the inbound calls if this campaign is in blended mode. We do not recommend setting inbound calls to a higher priority than the outbound campaign calls because people calling in expect to wait and people being called expect for someone to be there on the phone.