Added Agent Search Method override options for campaigns and in-groups.

git-svn-id: svn://192.168.202.10@3341 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2021-01-07 20:40:57 +00:00
parent 035d114755
commit 4babb9e0ba
7 changed files with 125 additions and 46 deletions
+12 -5
View File
@@ -18,7 +18,7 @@
# ; - SURVEYCAMPCEP - Survery question, campaign settings, cepstral name
# ; - REMINDER - Reminder campaign
# ; - REMINDX - Reminder with transfer to agent
# ; 2. the method of searching for an available agent:
# ; 2. the method of searching for an available agent: (agent_search_method)
# ; - LB - <default> Load Balance total system
# ; - LO - Load Balance Overflow only (priority to home server)
# ; - SO - Home server only
@@ -244,7 +244,7 @@ $dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VA
#############################################
##### Gather system_settings #####
$stmtA = "SELECT sip_event_logging,call_quota_lead_ranking FROM system_settings;";
$stmtA = "SELECT sip_event_logging,call_quota_lead_ranking,agent_search_method FROM system_settings;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -253,6 +253,7 @@ if ($sthArows > 0)
@aryA = $sthA->fetchrow_array;
$SSsip_event_logging = $aryA[0];
$SScall_quota_lead_ranking = $aryA[1];
$SSagent_search_method = $aryA[2];
}
$sthA->finish();
###########################################
@@ -785,7 +786,7 @@ if ($VDACaffected_rows > 0)
##### END - Max call stats
### 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,queue_priority,closer_campaigns,queuemetrics_phone_environment,campaign_recording,campaign_rec_filename,safe_harbor_audio,safe_harbor_menu_id,survey_recording,safe_harbor_audio_field,use_other_campaign_dnc,cpd_unknown_action,routing_initiated_recordings,campaign_rec_exten,call_quota_lead_ranking,sip_event_logging,amd_type 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,queuemetrics_phone_environment,campaign_recording,campaign_rec_filename,safe_harbor_audio,safe_harbor_menu_id,survey_recording,safe_harbor_audio_field,use_other_campaign_dnc,cpd_unknown_action,routing_initiated_recordings,campaign_rec_exten,call_quota_lead_ranking,sip_event_logging,amd_type,agent_search_method 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;
@@ -831,6 +832,7 @@ if ($VDACaffected_rows > 0)
$VD_call_quota_lead_ranking = $aryA[32];
$CAMPsip_event_logging = $aryA[33];
$amd_type = $aryA[34];
$agent_search_method_OVERRIDE = $aryA[35];
if (length($closer_campaigns) > 2)
{
$closer_campaigns =~ s/^ | -$//gi;
@@ -2488,10 +2490,15 @@ while ($drop_timer <= $DROP_TIME)
##### Attempt to send call to an agent on this server only #####
if ($agent_search_method =~ /^SO|^LO/)
if ( ($agent_search_method =~ /^SO|^LO/) || ( ( ($SSagent_search_method == 1) || ($SSagent_search_method == 3) ) && ($agent_search_method_OVERRIDE =~ /^SO|^LO/) ) )
{
if ($agent_search_method =~ /^SO/)
{$agent_search_method = 'LO';}
if ( ( ($SSagent_search_method == 1) || ($SSagent_search_method == 3) ) && ($agent_search_method_OVERRIDE =~ /^SO/) )
{
if ($AGILOG) {$agi_string = "|Agent Search Method Campaign Override: $agent_search_method_OVERRIDE ($SSagent_search_method)$agent_search_method|"; &agi_output;}
$agent_search_method = 'SO';
}
if ($DBconcurrent_transfers =~ /AUTO/)
{
@@ -3755,7 +3762,7 @@ while ($drop_timer <= $DROP_TIME)
### END routing-initiated agent call recording for ALLCALLS/ALLFORCE ###
}
if ($extension_appended_cidname =~ /Y/)
if ($extension_appended_cidname =~ /Y|USER/)
{
$eac_extension='';
$stmtA = "SELECT extension,campaign_id FROM vicidial_live_agents where user='$VDADuser' order by last_call_time limit 1;";