finished adding campaign_rank and fewest calls agent call routing

git-svn-id: svn://192.168.202.10@720 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2007-11-16 19:33:45 +00:00
parent 068bf215de
commit b40852078c
15 changed files with 158 additions and 29 deletions
+5 -2
View File
@@ -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/)
+4 -1
View File
@@ -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';";
+4 -1
View File
@@ -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';";
+4 -1
View File
@@ -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';";
@@ -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 <vicidial@gmail.com> LICENSE: GPLv2
# Copyright (C) 2007 Matt Florell <vicidial@gmail.com> 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';";
+4 -1
View File
@@ -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';";
+4 -1
View File
@@ -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';";
+14 -1
View File
@@ -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";
+7
View File
@@ -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.
@@ -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',
+2 -1
View File
@@ -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';
@@ -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
+62 -5
View File
@@ -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);
+28 -3
View File
@@ -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 "<!-- campaign is set to auto_dial_level: $auto_dial_level -->\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 "<!-- new vicidial_campaign_agents record inserted: |$affected_rows| -->\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);
+12 -8
View File
@@ -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 "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN
<BR> &nbsp; - 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.
<BR> &nbsp; - oldest_call_finish: orders by the last time an agent finished a call. AKA agent waiting longest receives first call.
<BR> &nbsp; - 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.
<BR> &nbsp; - campaign_rank: orders by the rank given to the agent for the campaign. Highest to Lowest.
<BR> &nbsp; - fewest_calls: orders by the number of calls received by an agent for that specific inbound group. Least calls first.
<BR>
<A NAME="vicidial_campaigns-local_call_time">
@@ -2427,7 +2430,8 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN
<BR> &nbsp; - 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.
<BR> &nbsp; - inbound_group_rank: orders by the rank given to the agent for the specific inbound group. Highest to Lowest.
<BR> &nbsp; - fewest_calls: orders by the number of calls received by an agent for that specific inbound group. Least calls first.
<BR> &nbsp; - campaign_rank: orders by the rank given to the agent for the campaign. Highest to Lowest.
<BR> &nbsp; - fewest_calls_campaign: orders by the number of calls received by an agent for the campaign. Least calls first.
<BR>
<A NAME="vicidial_inbound_groups-fronter_display">
<BR>
@@ -4074,7 +4078,7 @@ if ($ADD==11)
echo "<tr bgcolor=#B6D3FC><td align=right>Allow Closers: </td><td align=left><select size=1 name=allow_closers><option>Y</option><option>N</option></select>$NWB#vicidial_campaigns-allow_closers$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Hopper Level: </td><td align=left><select size=1 name=hopper_level><option>1</option><option>5</option><option>10</option><option>20</option><option>50</option><option>100</option><option>200</option><option>500</option><option>1000</option><option>2000</option></select>$NWB#vicidial_campaigns-hopper_level$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Auto Dial Level: </td><td align=left><select size=1 name=auto_dial_level><option selected>0</option><option>1</option><option>1.1</option><option>1.2</option><option>1.3</option><option>1.4</option><option>1.5</option><option>1.6</option><option>1.7</option><option>1.8</option><option>1.9</option><option>2.0</option><option>2.2</option><option>2.5</option><option>2.7</option><option>3.0</option><option>3.5</option><option>4.0</option></select>(0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Next Agent Call: </td><td align=left><select size=1 name=next_agent_call><option >random</option><option>oldest_call_start</option><option>oldest_call_finish</option><option>overall_user_level</option></select>$NWB#vicidial_campaigns-next_agent_call$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Next Agent Call: </td><td align=left><select size=1 name=next_agent_call><option >random</option><option>oldest_call_start</option><option>oldest_call_finish</option><option>overall_user_level</option><option>campaign_rank</option><option>fewest_calls</option></select>$NWB#vicidial_campaigns-next_agent_call$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Local Call Time: </td><td align=left><select size=1 name=local_call_time><option>24hours</option><option>9am-9pm</option><option>9am-5pm</option><option>12pm-5pm</option><option>12pm-9pm</option><option>5pm-9pm</option></select>$NWB#vicidial_campaigns-local_call_time$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Voicemail: </td><td align=left><input type=text name=voicemail_ext size=10 maxlength=10 value=\"$voicemail_ext\">$NWB#vicidial_campaigns-voicemail_ext$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Script: </td><td align=left><select size=1 name=script_id>\n";
@@ -4244,7 +4248,7 @@ if ($ADD==1111)
echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=active><option SELECTED>Y</option><option>N</option></select>$NWB#vicidial_inbound_groups-active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Web Form: </td><td align=left><input type=text name=web_form_address size=50 maxlength=255 value=\"$web_form_address\">$NWB#vicidial_inbound_groups-web_form_address$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Voicemail: </td><td align=left><input type=text name=voicemail_ext size=10 maxlength=10 value=\"$voicemail_ext\">$NWB#vicidial_inbound_groups-voicemail_ext$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Next Agent Call: </td><td align=left><select size=1 name=next_agent_call><option >random</option><option>oldest_call_start</option><option>oldest_call_finish</option><option>overall_user_level</option><option>inbound_group_rank</option><option>fewest_calls</option></select>$NWB#vicidial_inbound_groups-next_agent_call$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Next Agent Call: </td><td align=left><select size=1 name=next_agent_call><option >random</option><option>oldest_call_start</option><option>oldest_call_finish</option><option>overall_user_level</option><option>inbound_group_rank</option><option>campaign_rank</option><option>fewest_calls</option><option>fewest_calls_campaign</option></select>$NWB#vicidial_inbound_groups-next_agent_call$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Fronter Display: </td><td align=left><select size=1 name=fronter_display><option SELECTED>Y</option><option>N</option></select>$NWB#vicidial_inbound_groups-fronter_display$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Script: </td><td align=left><select size=1 name=script_id>\n";
echo "$scripts_list";
@@ -9027,7 +9031,7 @@ if ($ADD==31)
echo "<tr bgcolor=#B6D3FC><td align=right>Auto Alt-Number Dialing: </td><td align=left><select size=1 name=auto_alt_dial><option >NONE</option><option>ALT_ONLY</option><option>ADDR3_ONLY</option><option>ALT_AND_ADDR3<option SELECTED>$auto_alt_dial</option></select>$NWB#vicidial_campaigns-auto_alt_dial$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Next Agent Call: </td><td align=left><select size=1 name=next_agent_call><option >random</option><option>oldest_call_start</option><option>oldest_call_finish</option><option>overall_user_level</option><option SELECTED>$next_agent_call</option></select>$NWB#vicidial_campaigns-next_agent_call$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Next Agent Call: </td><td align=left><select size=1 name=next_agent_call><option >random</option><option>oldest_call_start</option><option>oldest_call_finish</option><option>overall_user_level</option><option>campaign_rank</option><option>fewest_calls</option><option SELECTED>$next_agent_call</option></select>$NWB#vicidial_campaigns-next_agent_call$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"$PHP_SELF?ADD=311111111&call_time_id=$local_call_time\">Local Call Time: </a></td><td align=left><select size=1 name=local_call_time>\n";
echo "$call_times_list";
@@ -10811,7 +10815,7 @@ if ($ADD==3111)
echo "<tr bgcolor=#B6D3FC><td align=right>Group Color: </td><td align=left bgcolor=\"$row[2]\"><input type=text name=group_color size=7 maxlength=7 value=\"$row[2]\">$NWB#vicidial_inbound_groups-group_color$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=active><option>Y</option><option>N</option><option SELECTED>$active</option></select>$NWB#vicidial_inbound_groups-active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Web Form: </td><td align=left><input type=text name=web_form_address size=50 maxlength=255 value=\"$web_form_address\">$NWB#vicidial_inbound_groups-web_form_address$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Next Agent Call: </td><td align=left><select size=1 name=next_agent_call><option >random</option><option>oldest_call_start</option><option>oldest_call_finish</option><option>overall_user_level</option><option>inbound_group_rank</option><option>fewest_calls</option><option SELECTED>$next_agent_call</option></select>$NWB#vicidial_inbound_groups-next_agent_call$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Next Agent Call: </td><td align=left><select size=1 name=next_agent_call><option >random</option><option>oldest_call_start</option><option>oldest_call_finish</option><option>overall_user_level</option><option>inbound_group_rank</option><option>campaign_rank</option><option>fewest_calls</option><option>fewest_calls_campaign</option><option SELECTED>$next_agent_call</option></select>$NWB#vicidial_inbound_groups-next_agent_call$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Fronter Display: </td><td align=left><select size=1 name=fronter_display><option>Y</option><option>N</option><option SELECTED>$fronter_display</option></select>$NWB#vicidial_inbound_groups-fronter_display$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"$PHP_SELF?ADD=3111111&script_id=$script_id\">Script</a>: </td><td align=left><select size=1 name=script_id>\n";