diff --git a/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi b/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi index 80949d13..c1a02efe 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# agi-VDAD_ALL_inbound.agi version 2.0.4-1 *DBI-version* +# agi-VDAD_ALL_inbound.agi version 2.0.4 *DBI-version* # # runs when a call comes in from an inbound call. This script will # send the calls out to the closers that are logged in. @@ -50,6 +50,7 @@ # 71030-0939 - fixed issue where MoH was still playing, added ding and wait before transfer # 71103-2305 - added group rank and fewest calls options to next_agent_call # 71112-0058 - fixed multi-logging bug on CLOSER calls +# 71116-1045 - added fewest_calls_campaign agent call routing option # $script = 'agi-VDAD_ALL_inbound.agi'; @@ -645,9 +646,11 @@ if ($channel_status < 1) if ($CAMP_callorder =~ /oldest_call_start/i) {$agent_call_order = 'order by last_call_time';} if ($CAMP_callorder =~ /oldest_call_finish/i) {$agent_call_order = 'order by last_call_finish';} if ($CAMP_callorder =~ /random/i) {$agent_call_order = 'order by random_id';} + if ($CAMP_callorder =~ /campaign_rank/i) {$agent_call_order = 'order by campaign_weight desc,last_call_finish';} + if ($CAMP_callorder =~ /fewest_calls_campaign/i) {$agent_call_order = 'order by calls_today,last_call_finish';} if ($CAMP_callorder =~ /inbound_group_rank/i) {$aco_sub=1; $agent_call_order = 'order by group_weight desc';} if ($CAMP_callorder =~ /fewest_calls/i) {$aco_sub=1; $agent_call_order = 'order by calls_today';} - + ##### Attempt to send call to an agent on this server only ##### if ($agent_search_method =~ /^SO|^LO/) diff --git a/agc_2-X/trunk/agi/agi-VDAD_LB_transfer.agi b/agc_2-X/trunk/agi/agi-VDAD_LB_transfer.agi index 6c90f226..d0987ea4 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_LB_transfer.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_LB_transfer.agi @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# agi-VDAD_LB_transfer.agi version 2.0.3 *DBI-version* +# agi-VDAD_LB_transfer.agi version 2.0.4 *DBI-version* # Load Balanced - when a call comes in on this server the script looks for an agent # on any server on the network on the same campaign to send call to. # @@ -37,6 +37,7 @@ # 70215-1052 - Added QueueMetrics optional logging # 70223-1101 - Added QueueMetrics ENTERQUEUE prepend option # 70305-1251 - Fixed problems where the same call will run this script twice +# 71116-1045 - added fewest_calls and campaign_weight agent call routing options # $script = 'agi-VDAD_LB_transfer.agi'; @@ -467,6 +468,8 @@ if ($CAMP_callorder =~ /overall_user_level/i) {$agent_call_order = 'order by use if ($CAMP_callorder =~ /oldest_call_start/i) {$agent_call_order = 'order by last_call_time';} if ($CAMP_callorder =~ /oldest_call_finish/i) {$agent_call_order = 'order by last_call_finish';} if ($CAMP_callorder =~ /random/i) {$agent_call_order = 'order by random_id';} +if ($CAMP_callorder =~ /campaign_rank/i) {$agent_call_order = 'order by campaign_weight desc,last_call_finish';} +if ($CAMP_callorder =~ /fewest_calls/i) {$agent_call_order = 'order by calls_today,last_call_finish';} $rec_countWAIT=0; $stmtA = "SELECT count(*) FROM vicidial_auto_calls where status = 'LIVE' and campaign_id = '$VDADcampaign' and call_time < \"$VDADcall_time\" and lead_id != '$VDADlead_id';"; diff --git a/agc_2-X/trunk/agi/agi-VDAD_LO_transfer.agi b/agc_2-X/trunk/agi/agi-VDAD_LO_transfer.agi index 1241409a..9155f807 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_LO_transfer.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_LO_transfer.agi @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# agi-VDAD_LO_transfer.agi version 2.0.3 *DBI-version* +# agi-VDAD_LO_transfer.agi version 2.0.4 *DBI-version* # Overflow Balanced - when a call comes in on this server the script looks for an agent # on this server to send call to. If none available it looks for the next available # agent on any other server on the network on the same campaign to send call to. @@ -38,6 +38,7 @@ # 70215-1052 - Added QueueMetrics optional logging # 70223-1101 - Added QueueMetrics ENTERQUEUE prepend option # 70305-1251 - Fixed problems where the same call will run this script twice +# 71116-1045 - added fewest_calls and campaign_weight agent call routing options # $script = 'agi-VDAD_LO_transfer.agi'; @@ -467,6 +468,8 @@ if ($CAMP_callorder =~ /overall_user_level/i) {$agent_call_order = 'order by use if ($CAMP_callorder =~ /oldest_call_start/i) {$agent_call_order = 'order by last_call_time';} if ($CAMP_callorder =~ /oldest_call_finish/i) {$agent_call_order = 'order by last_call_finish';} if ($CAMP_callorder =~ /random/i) {$agent_call_order = 'order by random_id';} +if ($CAMP_callorder =~ /campaign_rank/i) {$agent_call_order = 'order by campaign_weight desc,last_call_finish';} +if ($CAMP_callorder =~ /fewest_calls/i) {$agent_call_order = 'order by calls_today,last_call_finish';} $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 != '$VDADlead_id';"; diff --git a/agc_2-X/trunk/agi/agi-VDADtransfer.agi b/agc_2-X/trunk/agi/agi-VDADtransfer.agi index 0138a5c1..73bc26ff 100644 --- a/agc_2-X/trunk/agi/agi-VDADtransfer.agi +++ b/agc_2-X/trunk/agi/agi-VDADtransfer.agi @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# agi-VDADtransfer.agi version 2.0.3 *DBI-version* +# agi-VDADtransfer.agi version 2.0.4 *DBI-version* # # runs when a call comes in from the VICIDIAL_auto_dialer. This script will # send the calls out to the reps that are logged in. @@ -29,6 +29,7 @@ # 70214-1214 - Added QueueMetrics optional logging # 70223-1046 - Added QueueMetrics ENTERQUEUE prepend option # 70305-1240 - Fixed problems where the same call will run this script twice +# 71116-1045 - added fewest_calls and campaign_weight agent call routing options # $script = 'agi-VDADtransfer.agi'; @@ -458,6 +459,8 @@ if ($CAMP_callorder =~ /overall_user_level/i) {$agent_call_order = 'order by use if ($CAMP_callorder =~ /oldest_call_start/i) {$agent_call_order = 'order by last_call_time';} if ($CAMP_callorder =~ /oldest_call_finish/i) {$agent_call_order = 'order by last_call_finish';} if ($CAMP_callorder =~ /random/i) {$agent_call_order = 'order by random_id';} +if ($CAMP_callorder =~ /campaign_rank/i) {$agent_call_order = 'order by campaign_weight desc,last_call_finish';} +if ($CAMP_callorder =~ /fewest_calls/i) {$agent_call_order = 'order by calls_today,last_call_finish';} $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 != '$VDADlead_id';"; diff --git a/agc_2-X/trunk/agi/agi-VDADtransferBROADCAST.agi b/agc_2-X/trunk/agi/agi-VDADtransferBROADCAST.agi index 5ca38b63..c7899053 100644 --- a/agc_2-X/trunk/agi/agi-VDADtransferBROADCAST.agi +++ b/agc_2-X/trunk/agi/agi-VDADtransferBROADCAST.agi @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# agi-VDADtransferBROADCAST.agi version 0.6 *DBI-version* +# agi-VDADtransferBROADCAST.agi version 2.0.4 *DBI-version* # # runs when a call comes in from the VICIDIAL_auto_dialer. This script will # send the calls out to the reps that are logged in. @@ -14,7 +14,7 @@ # exten => 8365,1,AGI(call_log.agi,${EXTEN}) # exten => 8365,2,AGI(agi-VDADtransfer.agi,${EXTEN}) # -# Copyright (C) 2006 Matt Florell LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell LICENSE: GPLv2 # # changes: # 50322-1246 - changed callerid handling to allow for custom callerid @@ -26,6 +26,7 @@ # - changed look for agent every 0.5 second for first 4 sec on hold # 60905-1047 - changed look for agent every 0.25 second for first 4 sec on hold # 61110-1625 - added change of vicidial_list, vicidial_log to PU once this script runs +# 71116-1045 - added fewest_calls and campaign_weight agent call routing options # $script = 'agi-VDADtransferBROADCAST.agi'; @@ -352,6 +353,8 @@ if ($CAMP_callorder =~ /overall_user_level/i) {$agent_call_order = 'order by use if ($CAMP_callorder =~ /oldest_call_start/i) {$agent_call_order = 'order by last_call_time';} if ($CAMP_callorder =~ /oldest_call_finish/i) {$agent_call_order = 'order by last_call_finish';} if ($CAMP_callorder =~ /random/i) {$agent_call_order = 'order by random_id';} +if ($CAMP_callorder =~ /campaign_rank/i) {$agent_call_order = 'order by campaign_weight desc,last_call_finish';} +if ($CAMP_callorder =~ /fewest_calls/i) {$agent_call_order = 'order by calls_today,last_call_finish';} $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 != '$VDADlead_id';"; diff --git a/agc_2-X/trunk/agi/agi-VDADtransferSURVEY.agi b/agc_2-X/trunk/agi/agi-VDADtransferSURVEY.agi index df5d5d5c..a217ff76 100644 --- a/agc_2-X/trunk/agi/agi-VDADtransferSURVEY.agi +++ b/agc_2-X/trunk/agi/agi-VDADtransferSURVEY.agi @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# agi-VDADtransferSURVEY.agi version 2.0.3 *DBI-version* +# agi-VDADtransferSURVEY.agi version 2.0.4 *DBI-version* # # runs when a call comes in from the VICIDIAL auto_dialer. This script will # send the calls out to the reps that are logged in if called person presses key. @@ -27,6 +27,7 @@ # 70215-1052 - Added QueueMetrics optional logging # 70223-1101 - Added QueueMetrics ENTERQUEUE prepend option # 70305-1251 - Fixed problems where the same call will run this script twice +# 71116-1045 - added fewest_calls and campaign_weight agent call routing options # $script = 'agi-VDADtransferSURVEY.agi'; @@ -494,6 +495,8 @@ if ($CAMP_callorder =~ /overall_user_level/i) {$agent_call_order = 'order by use if ($CAMP_callorder =~ /oldest_call_start/i) {$agent_call_order = 'order by last_call_time';} if ($CAMP_callorder =~ /oldest_call_finish/i) {$agent_call_order = 'order by last_call_finish';} if ($CAMP_callorder =~ /random/i) {$agent_call_order = 'order by random_id';} +if ($CAMP_callorder =~ /campaign_rank/i) {$agent_call_order = 'order by campaign_weight desc,last_call_finish';} +if ($CAMP_callorder =~ /fewest_calls/i) {$agent_call_order = 'order by calls_today,last_call_finish';} $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 != '$VDADlead_id';"; diff --git a/agc_2-X/trunk/agi/agi-VDADtransferTEST.agi b/agc_2-X/trunk/agi/agi-VDADtransferTEST.agi index 893faba4..83afbdd9 100644 --- a/agc_2-X/trunk/agi/agi-VDADtransferTEST.agi +++ b/agc_2-X/trunk/agi/agi-VDADtransferTEST.agi @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# agi-VDADtransferTEST.agi version 2.0.3 *DBI-version* +# agi-VDADtransferTEST.agi version 2.0.4 *DBI-version* # # !!! This is only to be used for performance testing setups !!! # @@ -30,6 +30,7 @@ # 70215-1052 - Added QueueMetrics optional logging # 70223-1100 - Added QueueMetrics ENTERQUEUE prepend option # 70305-1251 - Fixed problems where the same call will run this script twice +# 71116-1045 - added fewest_calls and campaign_weight agent call routing options # $script = 'agi-VDADtransfer.agi'; @@ -459,6 +460,8 @@ if ($CAMP_callorder =~ /overall_user_level/i) {$agent_call_order = 'order by use if ($CAMP_callorder =~ /oldest_call_start/i) {$agent_call_order = 'order by last_call_time';} if ($CAMP_callorder =~ /oldest_call_finish/i) {$agent_call_order = 'order by last_call_finish';} if ($CAMP_callorder =~ /random/i) {$agent_call_order = 'order by random_id';} +if ($CAMP_callorder =~ /campaign_rank/i) {$agent_call_order = 'order by campaign_weight desc,last_call_finish';} +if ($CAMP_callorder =~ /fewest_calls/i) {$agent_call_order = 'order by calls_today,last_call_finish';} $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 != '$VDADlead_id';"; diff --git a/agc_2-X/trunk/bin/AST_VDremote_agents.pl b/agc_2-X/trunk/bin/AST_VDremote_agents.pl index 0b7ac7a4..4dd21f32 100644 --- a/agc_2-X/trunk/bin/AST_VDremote_agents.pl +++ b/agc_2-X/trunk/bin/AST_VDremote_agents.pl @@ -239,8 +239,21 @@ while($one_day_interval > 0) $event_string = "| lagged call vla agent DELETED $affected_rows"; &event_logger; + ##### grab number of calls today in this campaign and increment + $stmt="SELECT calls_today FROM vicidial_live_agents WHERE extension LIKE \"R/%\";"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vla_cc_ct = mysql_num_rows($rslt); + if ($vla_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $calls_today =$row[0]; + } + else + {$calls_today ='0';} + $calls_today++; - $stmtA = "UPDATE vicidial_live_agents set status='INCALL', last_call_time='$SQLdate',comments='REMOTE' where server_ip='$server_ip' and status IN('QUEUE') and extension LIKE \"R/%\";"; + $stmtA = "UPDATE vicidial_live_agents set status='INCALL', last_call_time='$SQLdate',comments='REMOTE',calls_today='$calls_today' where server_ip='$server_ip' and status IN('QUEUE') and extension LIKE \"R/%\";"; $affected_rows = $dbhA->do($stmtA); $event_string = "| QUEUEd call listing vla UPDATEd $affected_rows"; diff --git a/agc_2-X/trunk/docs/LOAD_BALANCING.txt b/agc_2-X/trunk/docs/LOAD_BALANCING.txt index c2023783..e1ea0567 100644 --- a/agc_2-X/trunk/docs/LOAD_BALANCING.txt +++ b/agc_2-X/trunk/docs/LOAD_BALANCING.txt @@ -155,6 +155,13 @@ If you have any questions or problems please post to the astguiclient-users list - AST_VDadapt.pl - AST_VDauto_dial_FILL.pl +8. On all servers but one you should DELETE the following line from your extensions.conf: + ; prompt recording AGI script, ID is 4321 + exten => 8168,1,Answer + exten => 8168,2,AGI(agi-record_prompts.agi) + exten => 8168,3,Hangup +This should help to prevent overwriting of prompts that are copied over from the one server that is used to do prompt creation. + diff --git a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql index 2ca99866..f6e27364 100644 --- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql +++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql @@ -479,7 +479,7 @@ web_form_address VARCHAR(255), allow_closers ENUM('Y','N'), hopper_level INT(8) UNSIGNED default '1', auto_dial_level VARCHAR(6) default '0', -next_agent_call ENUM('random','oldest_call_start','oldest_call_finish','overall_user_level') default 'oldest_call_finish', +next_agent_call ENUM('random','oldest_call_start','oldest_call_finish','campaign_rank','overall_user_level','fewest_calls') default 'oldest_call_finish', local_call_time VARCHAR(10) DEFAULT '9am-9pm', voicemail_ext VARCHAR(10), dial_timeout TINYINT UNSIGNED default '60', @@ -594,7 +594,7 @@ group_color VARCHAR(7), active ENUM('Y','N'), web_form_address VARCHAR(255), voicemail_ext VARCHAR(10), -next_agent_call ENUM('random','oldest_call_start','oldest_call_finish','overall_user_level','inbound_group_rank','fewest_calls') default 'oldest_call_finish', +next_agent_call ENUM('random','oldest_call_start','oldest_call_finish','overall_user_level','inbound_group_rank','campaign_rank','fewest_calls','fewest_calls_campaign') default 'oldest_call_finish', fronter_display ENUM('Y','N') default 'Y', ingroup_script VARCHAR(10), get_call_launch ENUM('NONE','SCRIPT','WEBFORM') default 'NONE', diff --git a/agc_2-X/trunk/extras/upgrade_2.0.4.sql b/agc_2-X/trunk/extras/upgrade_2.0.4.sql index 0e5db8fd..128f9079 100644 --- a/agc_2-X/trunk/extras/upgrade_2.0.4.sql +++ b/agc_2-X/trunk/extras/upgrade_2.0.4.sql @@ -142,8 +142,9 @@ index (user) ALTER TABLE vicidial_live_agents ADD campaign_weight TINYINT(1) default '0'; ALTER TABLE vicidial_live_agents ADD calls_today SMALLINT(5) UNSIGNED default '0'; +ALTER TABLE vicidial_inbound_groups MODIFY next_agent_call ENUM('random','oldest_call_start','oldest_call_finish','overall_user_level','inbound_group_rank','campaign_rank','fewest_calls','fewest_calls_campaign') default 'oldest_call_finish'; - +ALTER TABLE vicidial_campaigns MODIFY next_agent_call ENUM('random','oldest_call_start','oldest_call_finish','campaign_rank','overall_user_level','fewest_calls') default 'oldest_call_finish'; diff --git a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.4.txt b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.4.txt index a44abb71..ca81ebee 100644 --- a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.4.txt +++ b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.4.txt @@ -124,6 +124,7 @@ New Copied User Addition|| COPY USER|| Copy In-Group|| COPY INBOUND GROUP|| +campaign_rank: orders by the rank given to the agent for the campaign. Highest to Lowest|| ############################################################ CLIENT diff --git a/agc_2-X/trunk/www/agc/vdc_db_query.php b/agc_2-X/trunk/www/agc/vdc_db_query.php index 5a0d7b93..e690cc3c 100644 --- a/agc_2-X/trunk/www/agc/vdc_db_query.php +++ b/agc_2-X/trunk/www/agc/vdc_db_query.php @@ -134,10 +134,11 @@ # 70828-1443 - Added source_id to output of SCRIPTtab-IFRAME and WEBFORM # 71029-1855 - removed campaign_id naming restrictions for CLOSER-type campaigns # 71030-2047 - added hopper priority for auto alt dial entries +# 71116-1011 - added calls_today count updating of the vicidial_live_agents upon INCALL # -$version = '2.0.4-61'; -$build = '71030-2047'; +$version = '2.0.4-62'; +$build = '71116-1011'; require("dbconnect.php"); @@ -436,6 +437,21 @@ if ($ACTION == 'manDiaLnextCaLL') } else { + + ##### grab number of calls today in this campaign and increment + $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vla_cc_ct = mysql_num_rows($rslt); + if ($vla_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $calls_today =$row[0]; + } + else + {$calls_today ='0';} + $calls_today++; + ### check if this is a callback, if it is, skip the grabbing of a new lead and mark the callback as INACTIVE if ( (strlen($callback_id)>0) and (strlen($lead_id)>0) ) { @@ -662,7 +678,12 @@ if ($ACTION == 'manDiaLnextCaLL') $rslt=mysql_query($stmt, $link); ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + ### update calls_today count in vicidial_campaign_agents + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -765,6 +786,20 @@ if ($ACTION == 'manDiaLonly') } else { + ##### grab number of calls today in this campaign and increment + $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vla_cc_ct = mysql_num_rows($rslt); + if ($vla_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $calls_today =$row[0]; + } + else + {$calls_today ='0';} + $calls_today++; + ### prepare variables to place manual call from VICIDiaL $CCID_on=0; $CCID=''; $local_DEF = 'Local/'; @@ -802,7 +837,11 @@ if ($ACTION == 'manDiaLonly') $rslt=mysql_query($stmt, $link); ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -1439,8 +1478,26 @@ if ($ACTION == 'VDADcheckINCOMING') if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; + ##### grab number of calls today in this campaign and increment + $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vla_cc_ct = mysql_num_rows($rslt); + if ($vla_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $calls_today =$row[0]; + } + else + {$calls_today ='0';} + $calls_today++; + ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',comments='AUTO' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',comments='AUTO',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); diff --git a/agc_2-X/trunk/www/agc/vicidial.php b/agc_2-X/trunk/www/agc/vicidial.php index fed7d75e..248eb31b 100644 --- a/agc_2-X/trunk/www/agc/vicidial.php +++ b/agc_2-X/trunk/www/agc/vicidial.php @@ -165,10 +165,11 @@ # 71022-1427 - Added formatting of the customer phone number in the main status bar # 71029-1848 - Changed CLOSER-type campaign to not use campaign_id restrictions # 71101-1204 - Fixed bug in callback calendar with DST +# 71116-0957 - Added campaign_weight and calls_today to the vla table insertion # -$version = '2.0.4-136'; -$build = '71101-1204'; +$version = '2.0.4-137'; +$build = '71116-0957'; require("dbconnect.php"); @@ -1087,8 +1088,32 @@ else { print "\n"; + ##### grab the campaign_weight and number of calls today on that campaign for the agent + $stmt="SELECT campaign_weight,calls_today FROM vicidial_campaign_agents where user='$VD_login' and campaign_id = '$VD_campaign';"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vca_ct = mysql_num_rows($rslt); + if ($vca_ct > 0) + { + $row=mysql_fetch_row($rslt); + $campaign_weight = $row[0]; + $calls_today = $row[1]; + $i++; + } + else + { + $campaign_weight = '0'; + $calls_today = '0'; + $stmt="INSERT INTO vicidial_campaign_agents (user,campaign_id,campaign_rank,campaign_weight,calls_today) values('$VD_login','$VD_campaign','0','0','$calls_today');"; + if ($DB) {echo "$stmt\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + } $closer_chooser_string=''; - $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level');"; + $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level,campaign_weight,calls_today) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level','$campaign_weight','$calls_today');"; if ($DB) {echo "$stmt\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index f360b82e..1d9a67fc 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -1133,12 +1133,13 @@ $list_mix_container = ereg_replace(";","",$list_mix_container); # 71113-1521 - Added campaign_rank to agent options # - Added ability to Copy a campaign's setting to a new campaign # 71113-2225 - Added ability to copy user and in-group settings to new users and in-groups -# +# 71116-0942 - Added campaign_rank and fewest_calls as methods for agent call routing +# # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time -$admin_version = '2.0.4-116'; -$build = '71113-2225'; +$admin_version = '2.0.4-117'; +$build = '71116-0942'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -2167,6 +2168,8 @@ echo "
  - oldest_call_start: orders by the last time an agent was sent a call. Results in agents receiving about the same number of calls overall.
  - oldest_call_finish: orders by the last time an agent finished a call. AKA agent waiting longest receives first call.
  - overall_user_level: orders by the user_level of the agent as defined in the vicidial_users table a higher user_level will receive more calls. +
  - campaign_rank: orders by the rank given to the agent for the campaign. Highest to Lowest. +
  - fewest_calls: orders by the number of calls received by an agent for that specific inbound group. Least calls first.
@@ -2427,7 +2430,8 @@ echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "
  - overall_user_level: orders by the user_level of the agent as defined in the vicidial_users table a higher user_level will receive more calls.
  - inbound_group_rank: orders by the rank given to the agent for the specific inbound group. Highest to Lowest.
  - fewest_calls: orders by the number of calls received by an agent for that specific inbound group. Least calls first. - +
  - campaign_rank: orders by the rank given to the agent for the campaign. Highest to Lowest. +
  - fewest_calls_campaign: orders by the number of calls received by an agent for the campaign. Least calls first.

@@ -4074,7 +4078,7 @@ if ($ADD==11) echo "
Allow Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Hopper Level: $NWB#vicidial_campaigns-hopper_level$NWE
Auto Dial Level: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Next Agent Call: $NWB#vicidial_campaigns-next_agent_call$NWE
Next Agent Call: $NWB#vicidial_campaigns-next_agent_call$NWE
Local Call Time: $NWB#vicidial_campaigns-local_call_time$NWE
Voicemail: $NWB#vicidial_campaigns-voicemail_ext$NWE
Script:
Active: $NWB#vicidial_inbound_groups-active$NWE
Web Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
Voicemail: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Next Agent Call: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Next Agent Call: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Fronter Display: $NWB#vicidial_inbound_groups-fronter_display$NWE
Script:
Auto Alt-Number Dialing: $NWB#vicidial_campaigns-auto_alt_dial$NWE
Next Agent Call: $NWB#vicidial_campaigns-next_agent_call$NWE
Next Agent Call: $NWB#vicidial_campaigns-next_agent_call$NWE
Local Call Time:
Group Color: $NWB#vicidial_inbound_groups-group_color$NWE
Active: $NWB#vicidial_inbound_groups-active$NWE
Web Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
Next Agent Call: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Next Agent Call: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Fronter Display: $NWB#vicidial_inbound_groups-fronter_display$NWE
Script: