Added List Order randomize feature
Added two new QM options in System Settings git-svn-id: svn://192.168.202.10@1585 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -430,6 +430,10 @@ OTHER CHANGES:
|
|||||||
|
|
||||||
100. Added capability for agent interface to have webphone as a thin top bar
|
100. Added capability for agent interface to have webphone as a thin top bar
|
||||||
|
|
||||||
|
101. Added hopper loader randomization option in Campaign Detail screen, which
|
||||||
|
allows for the results to be randomized inside of the sorted results as
|
||||||
|
sorted by the List Order option
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+43
-19
@@ -25,7 +25,7 @@
|
|||||||
# It is good practice to keep this program running by placing the associated
|
# It is good practice to keep this program running by placing the associated
|
||||||
# KEEPALIVE script running every minute to ensure this program is always running
|
# KEEPALIVE script running every minute to ensure this program is always running
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGELOG:
|
# CHANGELOG:
|
||||||
# 50125-1201 - Changed dial timeout to 120 seconds from 180 seconds
|
# 50125-1201 - Changed dial timeout to 120 seconds from 180 seconds
|
||||||
@@ -94,6 +94,7 @@
|
|||||||
# 101111-1556 - Added source to vicidial_hopper inserts
|
# 101111-1556 - Added source to vicidial_hopper inserts
|
||||||
# 101117-1656 - Added accounting for DEAD agent calls when in available-only-tally dialing
|
# 101117-1656 - Added accounting for DEAD agent calls when in available-only-tally dialing
|
||||||
# 101207-0713 - Added more info to Originate for rare VDAC issue
|
# 101207-0713 - Added more info to Originate for rare VDAC issue
|
||||||
|
# 110103-1227 - Added queuemetrics_loginout NONE option
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
@@ -1916,7 +1917,7 @@ while($one_day_interval > 0)
|
|||||||
{
|
{
|
||||||
@VALOuser=@MT; @VALOcampaign=@MT; @VALOtimelog=@MT; @VALOextension=@MT;
|
@VALOuser=@MT; @VALOcampaign=@MT; @VALOtimelog=@MT; @VALOextension=@MT;
|
||||||
$logcount=0;
|
$logcount=0;
|
||||||
$stmtA = "SELECT user,campaign_id,last_update_time,extension FROM vicidial_live_agents where server_ip='$server_ip' and status = 'PAUSED' and random_id='10' order by last_update_time desc limit $affected_rows";
|
$stmtA = "SELECT user,campaign_id,last_update_time,extension FROM vicidial_live_agents where server_ip='$server_ip' and status='PAUSED' and random_id='10' order by last_update_time desc limit $affected_rows";
|
||||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||||
$sthArows=$sthA->rows;
|
$sthArows=$sthA->rows;
|
||||||
@@ -1966,28 +1967,51 @@ while($one_day_interval > 0)
|
|||||||
|
|
||||||
$agents='@agents';
|
$agents='@agents';
|
||||||
$time_logged_in='';
|
$time_logged_in='';
|
||||||
$stmtB = "SELECT time_id,data1 FROM queue_log where agent='Agent/$VALOuser[$logrun]' and verb IN('AGENTLOGIN','AGENTCALLBACKLOGIN') order by time_id desc limit 1;";
|
$RAWtime_logged_in=$TDtarget;
|
||||||
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
if ($queuemetrics_loginout !~ /NONE/)
|
||||||
$sthB->execute or die "executing: $stmtA ", $dbhB->errstr;
|
|
||||||
$sthBrows=$sthB->rows;
|
|
||||||
if ($sthBrows > 0)
|
|
||||||
{
|
{
|
||||||
@aryB = $sthB->fetchrow_array;
|
$stmtB = "SELECT time_id,data1 FROM queue_log where agent='Agent/$VALOuser[$logrun]' and verb IN('AGENTLOGIN','AGENTCALLBACKLOGIN') order by time_id desc limit 1;";
|
||||||
$time_logged_in = $aryB[0];
|
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
||||||
$RAWtime_logged_in = $aryB[0];
|
$sthB->execute or die "executing: $stmtA ", $dbhB->errstr;
|
||||||
$phone_logged_in = $aryB[1];
|
$sthBrows=$sthB->rows;
|
||||||
|
if ($sthBrows > 0)
|
||||||
|
{
|
||||||
|
@aryB = $sthB->fetchrow_array;
|
||||||
|
$time_logged_in = $aryB[0];
|
||||||
|
$RAWtime_logged_in = $aryB[0];
|
||||||
|
$phone_logged_in = $aryB[1];
|
||||||
|
}
|
||||||
|
$sthB->finish();
|
||||||
|
|
||||||
|
$time_logged_in = ($secX - $logintime);
|
||||||
|
if ($time_logged_in > 1000000) {$time_logged_in=1;}
|
||||||
|
$LOGOFFtime = ($secX + 1);
|
||||||
|
|
||||||
|
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$LOGOFFtime',call_id='NONE',queue='NONE',agent='Agent/$VALOuser[$logrun]',verb='$QM_LOGOFF',serverid='$queuemetrics_log_id',data1='$phone_logged_in',data2='$time_logged_in';";
|
||||||
|
$Baffected_rows = $dbhB->do($stmtB);
|
||||||
}
|
}
|
||||||
$sthB->finish();
|
|
||||||
|
|
||||||
$time_logged_in = ($secX - $logintime);
|
|
||||||
if ($time_logged_in > 1000000) {$time_logged_in=1;}
|
|
||||||
$LOGOFFtime = ($secX + 1);
|
|
||||||
|
|
||||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$LOGOFFtime',call_id='NONE',queue='NONE',agent='Agent/$VALOuser[$logrun]',verb='$QM_LOGOFF',serverid='$queuemetrics_log_id',data1='$phone_logged_in',data2='$time_logged_in';";
|
|
||||||
$Baffected_rows = $dbhB->do($stmtB);
|
|
||||||
|
|
||||||
if ($queuemetrics_addmember_enabled > 0)
|
if ($queuemetrics_addmember_enabled > 0)
|
||||||
{
|
{
|
||||||
|
if ( (length($time_logged_in) < 1) || ($queuemetrics_loginout =~ /NONE/) )
|
||||||
|
{
|
||||||
|
$stmtB = "SELECT time_id,data3 FROM queue_log where agent='Agent/$VALOuser[$logrun]' and verb='PAUSEREASON' and data1='LOGIN' order by time_id desc limit 1;";
|
||||||
|
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
||||||
|
$sthB->execute or die "executing: $stmtA ", $dbhB->errstr;
|
||||||
|
$sthBrows=$sthB->rows;
|
||||||
|
if ($sthBrows > 0)
|
||||||
|
{
|
||||||
|
@aryB = $sthB->fetchrow_array;
|
||||||
|
$time_logged_in = $aryB[0];
|
||||||
|
$RAWtime_logged_in = $aryB[0];
|
||||||
|
$phone_logged_in = $aryB[1];
|
||||||
|
}
|
||||||
|
$sthB->finish();
|
||||||
|
|
||||||
|
$time_logged_in = ($secX - $logintime);
|
||||||
|
if ($time_logged_in > 1000000) {$time_logged_in=1;}
|
||||||
|
$LOGOFFtime = ($secX + 1);
|
||||||
|
}
|
||||||
$stmtB = "SELECT distinct queue FROM queue_log where time_id >= $RAWtime_logged_in and agent='Agent/$VALOuser[$logrun]' and verb IN('ADDMEMBER','ADDMEMBER2') order by time_id desc;";
|
$stmtB = "SELECT distinct queue FROM queue_log where time_id >= $RAWtime_logged_in and agent='Agent/$VALOuser[$logrun]' and verb IN('ADDMEMBER','ADDMEMBER2') order by time_id desc;";
|
||||||
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
||||||
$sthB->execute or die "executing: $stmtB ", $dbhB->errstr;
|
$sthB->execute or die "executing: $stmtB ", $dbhB->errstr;
|
||||||
|
|||||||
+29
-22
@@ -21,7 +21,7 @@
|
|||||||
# - R = Recycled leads
|
# - R = Recycled leads
|
||||||
# - S = Standard hopper load
|
# - S = Standard hopper load
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
# 50810-1613 - Added database server variable definitions lookup
|
# 50810-1613 - Added database server variable definitions lookup
|
||||||
@@ -64,6 +64,7 @@
|
|||||||
# 100529-0843 - Changed dialable leads to calculate every run for active campaigns
|
# 100529-0843 - Changed dialable leads to calculate every run for active campaigns
|
||||||
# 100706-2332 - Added ability to purge only one campaign's leads in the hopper
|
# 100706-2332 - Added ability to purge only one campaign's leads in the hopper
|
||||||
# 101108-1451 - Added ability for the hopper level to be set automatically and remove excess leads from the hopper (MikeC)
|
# 101108-1451 - Added ability for the hopper level to be set automatically and remove excess leads from the hopper (MikeC)
|
||||||
|
# 110103-1118 - Added lead_order_randomize option
|
||||||
#
|
#
|
||||||
|
|
||||||
# constants
|
# constants
|
||||||
@@ -797,11 +798,11 @@ if ($hopper_dnc_count > 0)
|
|||||||
|
|
||||||
if ($CLIcampaign)
|
if ($CLIcampaign)
|
||||||
{
|
{
|
||||||
$stmtA = "SELECT campaign_id,lead_order,hopper_level,auto_dial_level,local_call_time,lead_filter_id,use_internal_dnc,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,dial_statuses,list_order_mix,use_campaign_dnc,drop_lockout_time,no_hopper_dialing,auto_alt_dial_statuses,dial_timeout,auto_hopper_multi,use_auto_hopper,auto_trim_hopper from vicidial_campaigns where campaign_id='$CLIcampaign';";
|
$stmtA = "SELECT campaign_id,lead_order,hopper_level,auto_dial_level,local_call_time,lead_filter_id,use_internal_dnc,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,dial_statuses,list_order_mix,use_campaign_dnc,drop_lockout_time,no_hopper_dialing,auto_alt_dial_statuses,dial_timeout,auto_hopper_multi,use_auto_hopper,auto_trim_hopper,lead_order_randomize from vicidial_campaigns where campaign_id='$CLIcampaign';";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$stmtA = "SELECT campaign_id,lead_order,hopper_level,auto_dial_level,local_call_time,lead_filter_id,use_internal_dnc,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,dial_statuses,list_order_mix,use_campaign_dnc,drop_lockout_time,no_hopper_dialing,auto_alt_dial_statuses,dial_timeout,auto_hopper_multi,use_auto_hopper,auto_trim_hopper from vicidial_campaigns where active='Y';";
|
$stmtA = "SELECT campaign_id,lead_order,hopper_level,auto_dial_level,local_call_time,lead_filter_id,use_internal_dnc,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,dial_statuses,list_order_mix,use_campaign_dnc,drop_lockout_time,no_hopper_dialing,auto_alt_dial_statuses,dial_timeout,auto_hopper_multi,use_auto_hopper,auto_trim_hopper,lead_order_randomize from vicidial_campaigns where active='Y';";
|
||||||
}
|
}
|
||||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||||
@@ -834,6 +835,7 @@ while ($sthArows > $rec_count)
|
|||||||
$auto_hopper_multi[$rec_count] = $aryA[18];
|
$auto_hopper_multi[$rec_count] = $aryA[18];
|
||||||
$use_auto_hopper[$rec_count] = $aryA[19];
|
$use_auto_hopper[$rec_count] = $aryA[19];
|
||||||
$auto_trim_hopper[$rec_count] = $aryA[20];
|
$auto_trim_hopper[$rec_count] = $aryA[20];
|
||||||
|
$lead_order_randomize[$rec_count] = $aryA[21];
|
||||||
|
|
||||||
### Auto Hopper Level
|
### Auto Hopper Level
|
||||||
if ( $use_auto_hopper[$rec_count] =~ /Y/)
|
if ( $use_auto_hopper[$rec_count] =~ /Y/)
|
||||||
@@ -1591,7 +1593,7 @@ foreach(@campaign_id)
|
|||||||
}
|
}
|
||||||
##### END lead recycling parsing and prep ###
|
##### END lead recycling parsing and prep ###
|
||||||
|
|
||||||
if ($DB) {print "Starting hopper run for $campaign_id[$i] campaign- GMT: $local_call_time[$i] HOPPER: $hopper_level[$i] ORDER: $lead_order[$i]\n";}
|
if ($DB) {print "Starting hopper run for $campaign_id[$i] campaign- GMT: $local_call_time[$i] HOPPER: $hopper_level[$i] ORDER: $lead_order[$i]|$lead_order_randomize[$i]\n";}
|
||||||
|
|
||||||
### Delete the DONE leads if there are any
|
### Delete the DONE leads if there are any
|
||||||
$stmtA = "DELETE from $vicidial_hopper where campaign_id='$campaign_id[$i]' and status IN('DONE');";
|
$stmtA = "DELETE from $vicidial_hopper where campaign_id='$campaign_id[$i]' and status IN('DONE');";
|
||||||
@@ -1829,30 +1831,35 @@ foreach(@campaign_id)
|
|||||||
$order_stmt='';
|
$order_stmt='';
|
||||||
$NEW_count = 0;
|
$NEW_count = 0;
|
||||||
$NEW_level = 0;
|
$NEW_level = 0;
|
||||||
$OTHER_level = $hopper_level[$i];
|
$OTHER_level = $hopper_level[$i];
|
||||||
if ($lead_order[$i] =~ /^DOWN/) {$order_stmt = 'order by lead_id asc';}
|
|
||||||
if ($lead_order[$i] =~ /^UP/) {$order_stmt = 'order by lead_id desc';}
|
if ($lead_order_randomize[$i] =~ /Y/) {$last_order = "RAND()";}
|
||||||
if ($lead_order[$i] =~ /^UP LAST NAME/) {$order_stmt = 'order by last_name desc, lead_id asc';}
|
else {$last_order = "lead_id asc";}
|
||||||
if ($lead_order[$i] =~ /^DOWN LAST NAME/) {$order_stmt = 'order by last_name, lead_id asc';}
|
|
||||||
if ($lead_order[$i] =~ /^UP PHONE/) {$order_stmt = 'order by phone_number desc, lead_id asc';}
|
if ($lead_order[$i] =~ /^DOWN/) {$order_stmt = "order by lead_id asc";}
|
||||||
if ($lead_order[$i] =~ /^DOWN PHONE/) {$order_stmt = 'order by phone_number, lead_id asc';}
|
if ($lead_order[$i] =~ /^UP/) {$order_stmt = "order by lead_id desc";}
|
||||||
if ($lead_order[$i] =~ /^UP COUNT/) {$order_stmt = 'order by called_count desc, lead_id asc';}
|
if ($lead_order[$i] =~ /^UP LAST NAME/) {$order_stmt = "order by last_name desc, $last_order";}
|
||||||
if ($lead_order[$i] =~ /^DOWN COUNT/) {$order_stmt = 'order by called_count, lead_id asc';}
|
if ($lead_order[$i] =~ /^DOWN LAST NAME/) {$order_stmt = "order by last_name, $last_order";}
|
||||||
if ($lead_order[$i] =~ /^UP LAST CALL TIME/) {$order_stmt = 'order by last_local_call_time desc, lead_id asc';}
|
if ($lead_order[$i] =~ /^UP PHONE/) {$order_stmt = "order by phone_number desc, $last_order";}
|
||||||
if ($lead_order[$i] =~ /^DOWN LAST CALL TIME/) {$order_stmt = 'order by last_local_call_time, lead_id asc';}
|
if ($lead_order[$i] =~ /^DOWN PHONE/) {$order_stmt = "order by phone_number, $last_order";}
|
||||||
if ($lead_order[$i] =~ /^RANDOM/) {$order_stmt = 'order by RAND()';}
|
if ($lead_order[$i] =~ /^UP COUNT/) {$order_stmt = "order by called_count desc, $last_order";}
|
||||||
if ($lead_order[$i] =~ /^UP RANK/) {$order_stmt = 'order by rank desc, lead_id asc';}
|
if ($lead_order[$i] =~ /^DOWN COUNT/) {$order_stmt = "order by called_count, $last_order";}
|
||||||
if ($lead_order[$i] =~ /^DOWN RANK/) {$order_stmt = 'order by rank, lead_id asc';}
|
if ($lead_order[$i] =~ /^UP LAST CALL TIME/) {$order_stmt = "order by last_local_call_time desc, $last_order";}
|
||||||
if ($lead_order[$i] =~ /^UP OWNER/) {$order_stmt = 'order by owner desc, lead_id asc';}
|
if ($lead_order[$i] =~ /^DOWN LAST CALL TIME/) {$order_stmt = "order by last_local_call_time, $last_order";}
|
||||||
if ($lead_order[$i] =~ /^DOWN OWNER/) {$order_stmt = 'order by owner, lead_id asc';}
|
if ($lead_order[$i] =~ /^RANDOM/) {$order_stmt = "order by RAND()";}
|
||||||
if ($lead_order[$i] =~ /^UP TIMEZONE/) {$order_stmt = 'order by gmt_offset_now desc, lead_id asc';}
|
if ($lead_order[$i] =~ /^UP RANK/) {$order_stmt = "order by rank desc, $last_order";}
|
||||||
if ($lead_order[$i] =~ /^DOWN TIMEZONE/) {$order_stmt = 'order by gmt_offset_now, lead_id asc';}
|
if ($lead_order[$i] =~ /^DOWN RANK/) {$order_stmt = "order by rank, $last_order";}
|
||||||
|
if ($lead_order[$i] =~ /^UP OWNER/) {$order_stmt = "order by owner desc, $last_order";}
|
||||||
|
if ($lead_order[$i] =~ /^DOWN OWNER/) {$order_stmt = "order by owner, $last_order";}
|
||||||
|
if ($lead_order[$i] =~ /^UP TIMEZONE/) {$order_stmt = "order by gmt_offset_now desc, $last_order";}
|
||||||
|
if ($lead_order[$i] =~ /^DOWN TIMEZONE/) {$order_stmt = "order by gmt_offset_now, $last_order";}
|
||||||
if ($lead_order[$i] =~ / 2nd NEW$/) {$NEW_count = 2;}
|
if ($lead_order[$i] =~ / 2nd NEW$/) {$NEW_count = 2;}
|
||||||
if ($lead_order[$i] =~ / 3rd NEW$/) {$NEW_count = 3;}
|
if ($lead_order[$i] =~ / 3rd NEW$/) {$NEW_count = 3;}
|
||||||
if ($lead_order[$i] =~ / 4th NEW$/) {$NEW_count = 4;}
|
if ($lead_order[$i] =~ / 4th NEW$/) {$NEW_count = 4;}
|
||||||
if ($lead_order[$i] =~ / 5th NEW$/) {$NEW_count = 5;}
|
if ($lead_order[$i] =~ / 5th NEW$/) {$NEW_count = 5;}
|
||||||
if ($lead_order[$i] =~ / 6th NEW$/) {$NEW_count = 6;}
|
if ($lead_order[$i] =~ / 6th NEW$/) {$NEW_count = 6;}
|
||||||
|
|
||||||
|
|
||||||
### BEGIN recycle grab leads ###
|
### BEGIN recycle grab leads ###
|
||||||
$REC_rec_countLEADS=0;
|
$REC_rec_countLEADS=0;
|
||||||
@REC_leads_to_hopper=@MT;
|
@REC_leads_to_hopper=@MT;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
# agents that should appear to be logged in so that the calls can be transferred
|
# agents that should appear to be logged in so that the calls can be transferred
|
||||||
# out to them properly.
|
# out to them properly.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGELOG:
|
# CHANGELOG:
|
||||||
# 50215-0954 - First version of script
|
# 50215-0954 - First version of script
|
||||||
@@ -36,6 +36,7 @@
|
|||||||
# 100524-1542 - Fixed live call detection bug on multi-server systems
|
# 100524-1542 - Fixed live call detection bug on multi-server systems
|
||||||
# 100622-0917 - Added start_call_url function for remote agents, this launches a separate child script
|
# 100622-0917 - Added start_call_url function for remote agents, this launches a separate child script
|
||||||
# 101108-0032 - Added ADDMEMBER queue_log code
|
# 101108-0032 - Added ADDMEMBER queue_log code
|
||||||
|
# 110103-1230 - Added queuemetrics_loginout NONE option
|
||||||
#
|
#
|
||||||
|
|
||||||
### begin parsing run-time options ###
|
### begin parsing run-time options ###
|
||||||
@@ -629,8 +630,11 @@ while($one_day_interval > 0)
|
|||||||
|
|
||||||
if ($DBX) {print "CONNECTED TO DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";}
|
if ($DBX) {print "CONNECTED TO DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";}
|
||||||
|
|
||||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$secX',call_id='NONE',queue='$DBremote_campaign[$h]',agent='Agent/$DBremote_user[$h]',verb='$QM_LOGIN',data1='$DBremote_user[$h]$agents',serverid='$queuemetrics_log_id';";
|
if ($queuemetrics_loginout !~ /NONE/)
|
||||||
$Baffected_rows = $dbhB->do($stmtB);
|
{
|
||||||
|
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$secX',call_id='NONE',queue='$DBremote_campaign[$h]',agent='Agent/$DBremote_user[$h]',verb='$QM_LOGIN',data1='$DBremote_user[$h]$agents',serverid='$queuemetrics_log_id';";
|
||||||
|
$Baffected_rows = $dbhB->do($stmtB);
|
||||||
|
}
|
||||||
|
|
||||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$secX',call_id='NONE',queue='$DBremote_campaign[$h]',agent='Agent/$DBremote_user[$h]',verb='UNPAUSE',serverid='$queuemetrics_log_id';";
|
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$secX',call_id='NONE',queue='$DBremote_campaign[$h]',agent='Agent/$DBremote_user[$h]',verb='UNPAUSE',serverid='$queuemetrics_log_id';";
|
||||||
$Baffected_rows = $dbhB->do($stmtB);
|
$Baffected_rows = $dbhB->do($stmtB);
|
||||||
@@ -780,6 +784,7 @@ while($one_day_interval > 0)
|
|||||||
{
|
{
|
||||||
if ($enable_queuemetrics_logging > 0)
|
if ($enable_queuemetrics_logging > 0)
|
||||||
{
|
{
|
||||||
|
$logintime=0;
|
||||||
$QM_LOGOFF = 'AGENTLOGOFF';
|
$QM_LOGOFF = 'AGENTLOGOFF';
|
||||||
if ($queuemetrics_loginout =~ /CALLBACK/)
|
if ($queuemetrics_loginout =~ /CALLBACK/)
|
||||||
{$QM_LOGOFF = 'AGENTCALLBACKLOGOFF';}
|
{$QM_LOGOFF = 'AGENTCALLBACKLOGOFF';}
|
||||||
@@ -812,6 +817,20 @@ while($one_day_interval > 0)
|
|||||||
|
|
||||||
if ($queuemetrics_addmember_enabled > 0)
|
if ($queuemetrics_addmember_enabled > 0)
|
||||||
{
|
{
|
||||||
|
if ( (length($logintime) < 1) || ($queuemetrics_loginout =~ /NONE/) )
|
||||||
|
{
|
||||||
|
$stmtB = "SELECT time_id,data3 FROM queue_log where agent='Agent/$VD_user[$z]' and verb='PAUSEREASON' and data1='LOGIN' order by time_id desc limit 1;";
|
||||||
|
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
||||||
|
$sthB->execute or die "executing: $stmtA ", $dbhB->errstr;
|
||||||
|
$sthBrows=$sthB->rows;
|
||||||
|
if ($sthBrows > 0)
|
||||||
|
{
|
||||||
|
@aryB = $sthB->fetchrow_array;
|
||||||
|
$logintime = $aryB[0];
|
||||||
|
$phone_logged_in = $aryB[1];
|
||||||
|
}
|
||||||
|
$sthB->finish();
|
||||||
|
}
|
||||||
$stmtB = "SELECT distinct queue FROM queue_log where time_id >= $logintime and agent='Agent/$VD_user[$z]' and verb IN('ADDMEMBER','ADDMEMBER2') order by time_id desc;";
|
$stmtB = "SELECT distinct queue FROM queue_log where time_id >= $logintime and agent='Agent/$VD_user[$z]' and verb IN('ADDMEMBER','ADDMEMBER2') order by time_id desc;";
|
||||||
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
||||||
$sthB->execute or die "executing: $stmtB ", $dbhB->errstr;
|
$sthB->execute or die "executing: $stmtB ", $dbhB->errstr;
|
||||||
@@ -834,8 +853,11 @@ while($one_day_interval > 0)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$secX',call_id='NONE',queue='$VD_campaign_id[$z]',agent='Agent/$VD_user[$z]',verb='$QM_LOGOFF',data1='$phone_logged_in',data2='$time_logged_in',serverid='$queuemetrics_log_id';";
|
if ($queuemetrics_loginout !~ /NONE/)
|
||||||
$Baffected_rows = $dbhB->do($stmtB);
|
{
|
||||||
|
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$secX',call_id='NONE',queue='$VD_campaign_id[$z]',agent='Agent/$VD_user[$z]',verb='$QM_LOGOFF',data1='$phone_logged_in',data2='$time_logged_in',serverid='$queuemetrics_log_id';";
|
||||||
|
$Baffected_rows = $dbhB->do($stmtB);
|
||||||
|
}
|
||||||
|
|
||||||
$dbhB->disconnect();
|
$dbhB->disconnect();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ ASTmgrSECRET VARCHAR(20) NOT NULL default '1234',
|
|||||||
ASTmgrUSERNAMEupdate VARCHAR(20) NOT NULL default 'updatecron',
|
ASTmgrUSERNAMEupdate VARCHAR(20) NOT NULL default 'updatecron',
|
||||||
ASTmgrUSERNAMElisten VARCHAR(20) NOT NULL default 'listencron',
|
ASTmgrUSERNAMElisten VARCHAR(20) NOT NULL default 'listencron',
|
||||||
ASTmgrUSERNAMEsend VARCHAR(20) NOT NULL default 'sendcron',
|
ASTmgrUSERNAMEsend VARCHAR(20) NOT NULL default 'sendcron',
|
||||||
local_gmt VARCHAR(6) default '-5',
|
local_gmt VARCHAR(6) default '-5.00',
|
||||||
voicemail_dump_exten VARCHAR(20) NOT NULL default '85026666666666',
|
voicemail_dump_exten VARCHAR(20) NOT NULL default '85026666666666',
|
||||||
answer_transfer_agent VARCHAR(20) NOT NULL default '8365',
|
answer_transfer_agent VARCHAR(20) NOT NULL default '8365',
|
||||||
ext_context VARCHAR(20) NOT NULL default 'default',
|
ext_context VARCHAR(20) NOT NULL default 'default',
|
||||||
@@ -781,7 +781,8 @@ auto_hopper_level MEDIUMINT(8) UNSIGNED default '0',
|
|||||||
auto_trim_hopper ENUM('Y','N') default 'Y',
|
auto_trim_hopper ENUM('Y','N') default 'Y',
|
||||||
api_manual_dial ENUM('STANDARD','QUEUE','QUEUE_AND_AUTOCALL') default 'STANDARD',
|
api_manual_dial ENUM('STANDARD','QUEUE','QUEUE_AND_AUTOCALL') default 'STANDARD',
|
||||||
manual_dial_call_time_check ENUM('DISABLED','ENABLED') default 'DISABLED',
|
manual_dial_call_time_check ENUM('DISABLED','ENABLED') default 'DISABLED',
|
||||||
display_leads_count ENUM('Y','N') default 'N'
|
display_leads_count ENUM('Y','N') default 'N',
|
||||||
|
lead_order_randomize ENUM('Y','N') default 'N'
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE vicidial_lists (
|
CREATE TABLE vicidial_lists (
|
||||||
@@ -1327,7 +1328,7 @@ static_agent_url VARCHAR(255) default '',
|
|||||||
default_phone_code VARCHAR(8) default '1',
|
default_phone_code VARCHAR(8) default '1',
|
||||||
enable_agc_dispo_log ENUM('0','1') default '0',
|
enable_agc_dispo_log ENUM('0','1') default '0',
|
||||||
custom_dialplan_entry TEXT,
|
custom_dialplan_entry TEXT,
|
||||||
queuemetrics_loginout ENUM('STANDARD','CALLBACK') default 'STANDARD',
|
queuemetrics_loginout ENUM('STANDARD','CALLBACK','NONE') default 'STANDARD',
|
||||||
callcard_enabled ENUM('1','0') default '0',
|
callcard_enabled ENUM('1','0') default '0',
|
||||||
queuemetrics_callstatus ENUM('0','1') default '1',
|
queuemetrics_callstatus ENUM('0','1') default '1',
|
||||||
default_codecs VARCHAR(100) default '',
|
default_codecs VARCHAR(100) default '',
|
||||||
@@ -1363,7 +1364,8 @@ default_server_password VARCHAR(20) default 'test',
|
|||||||
admin_modify_refresh SMALLINT(5) UNSIGNED default '0',
|
admin_modify_refresh SMALLINT(5) UNSIGNED default '0',
|
||||||
nocache_admin ENUM('0','1') default '1',
|
nocache_admin ENUM('0','1') default '1',
|
||||||
generate_cross_server_exten ENUM('0','1') default '0',
|
generate_cross_server_exten ENUM('0','1') default '0',
|
||||||
queuemetrics_addmember_enabled ENUM('0','1') default '0'
|
queuemetrics_addmember_enabled ENUM('0','1') default '0',
|
||||||
|
queuemetrics_dispo_pause VARCHAR(6) default ''
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE vicidial_campaigns_list_mix (
|
CREATE TABLE vicidial_campaigns_list_mix (
|
||||||
@@ -2411,7 +2413,7 @@ ALTER TABLE vicidial_agent_log_archive MODIFY agent_log_id INT(9) UNSIGNED NOT N
|
|||||||
|
|
||||||
CREATE TABLE vicidial_carrier_log_archive LIKE vicidial_carrier_log;
|
CREATE TABLE vicidial_carrier_log_archive LIKE vicidial_carrier_log;
|
||||||
|
|
||||||
UPDATE system_settings SET db_schema_version='1257',db_schema_update_date=NOW();
|
UPDATE system_settings SET db_schema_version='1258',db_schema_update_date=NOW();
|
||||||
|
|
||||||
GRANT RELOAD ON *.* TO cron@'%';
|
GRANT RELOAD ON *.* TO cron@'%';
|
||||||
GRANT RELOAD ON *.* TO cron@localhost;
|
GRANT RELOAD ON *.* TO cron@localhost;
|
||||||
|
|||||||
@@ -638,3 +638,10 @@ ALTER TABLE phones MODIFY webphone_dialpad ENUM('Y','N','TOGGLE','TOGGLE_OFF') d
|
|||||||
ALTER TABLE vicidial_user_groups MODIFY webphone_dialpad_override ENUM('DISABLED','Y','N','TOGGLE','TOGGLE_OFF') default 'DISABLED';
|
ALTER TABLE vicidial_user_groups MODIFY webphone_dialpad_override ENUM('DISABLED','Y','N','TOGGLE','TOGGLE_OFF') default 'DISABLED';
|
||||||
|
|
||||||
UPDATE system_settings SET db_schema_version='1257',db_schema_update_date=NOW();
|
UPDATE system_settings SET db_schema_version='1257',db_schema_update_date=NOW();
|
||||||
|
|
||||||
|
ALTER TABLE system_settings MODIFY queuemetrics_loginout ENUM('STANDARD','CALLBACK','NONE') default 'STANDARD';
|
||||||
|
ALTER TABLE system_settings ADD queuemetrics_dispo_pause VARCHAR(6) default '';
|
||||||
|
|
||||||
|
ALTER TABLE vicidial_campaigns ADD lead_order_randomize ENUM('Y','N') default 'N';
|
||||||
|
|
||||||
|
UPDATE system_settings SET db_schema_version='1258',db_schema_update_date=NOW();
|
||||||
|
|||||||
@@ -497,11 +497,19 @@ refresh||
|
|||||||
You can also set a label to ---HIDE--- to hide both the label and the field||
|
You can also set a label to ---HIDE--- to hide both the label and the field||
|
||||||
For inbound only, you can also set the stop call time higher than 2400 if you want the call time to go beyond midnight. So if you want your call time to run from 6 am until 2 am the next day, you would put 0600 as the start time and 2600 as the stop time||
|
For inbound only, you can also set the stop call time higher than 2400 if you want the call time to go beyond midnight. So if you want your call time to run from 6 am until 2 am the next day, you would put 0600 as the start time and 2600 as the stop time||
|
||||||
TOGGLE_OFF will default to not show the dialpad on first load, but will allow the user to show the dialpad by clicking on the dialpad link||
|
TOGGLE_OFF will default to not show the dialpad on first load, but will allow the user to show the dialpad by clicking on the dialpad link||
|
||||||
|
Add Multi-Server Phones Form||
|
||||||
|
Phones Bulk Insert||
|
||||||
|
List Order Randomize||
|
||||||
|
This option allows you to randomize the order of the leads in the hopper load within the results defined by the criteria set above. For instance, the List Order will be preserved, but the results will be randomized within that sorting. Setting this option to Y will enable this feature. Default is N for disabled. NOTE, if you have a large number of leads this option may slow down the speed of the hopper loading script||
|
||||||
|
NONE will not log any logins and logouts within queue_log||
|
||||||
|
QueueMetrics Dispo Pause Code||
|
||||||
|
This option, if populated, allows you to define whether a dispo pause code is entered into queue_log when an agent is in dispo status. Default is empty for disabled||
|
||||||
|
|
||||||
|
|
||||||
AST_LISTS_campaign_stats.php
|
AST_LISTS_campaign_stats.php
|
||||||
AST_VICIDIAL_ingrouplist.php
|
AST_VICIDIAL_ingrouplist.php
|
||||||
admin_lists_custom.php
|
admin_lists_custom.php
|
||||||
|
admin_phones_bulk_insert.php
|
||||||
############################################################ CLIENT
|
############################################################ CLIENT
|
||||||
VIEW CALL LOG||
|
VIEW CALL LOG||
|
||||||
click to dial||
|
click to dial||
|
||||||
|
|||||||
+63
-27
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
# vdc_db_query.php
|
# vdc_db_query.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# This script is designed to exchange information between vicidial.php and the database server for various actions
|
# This script is designed to exchange information between vicidial.php and the database server for various actions
|
||||||
#
|
#
|
||||||
@@ -265,12 +265,13 @@
|
|||||||
# 101124-1033 - Added require for functions.php and manual dial call time check campaign option
|
# 101124-1033 - Added require for functions.php and manual dial call time check campaign option
|
||||||
# 101128-0108 - Added list override for webforms
|
# 101128-0108 - Added list override for webforms
|
||||||
# 101208-0414 - Fixed Call Log dial bug (issue 393)
|
# 101208-0414 - Fixed Call Log dial bug (issue 393)
|
||||||
|
# 110103-1343 - Added queuemetrics_loginout NONE option
|
||||||
#
|
#
|
||||||
|
|
||||||
$version = '2.4-171';
|
$version = '2.4-172';
|
||||||
$build = '101208-0414';
|
$build = '110103-1343';
|
||||||
$mel=1; # Mysql Error Log enabled = 1
|
$mel=1; # Mysql Error Log enabled = 1
|
||||||
$mysql_log_count=363;
|
$mysql_log_count=365;
|
||||||
$one_mysql_log=0;
|
$one_mysql_log=0;
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
@@ -875,7 +876,7 @@ if ($ACTION == 'regCLOSER')
|
|||||||
|
|
||||||
#############################################
|
#############################################
|
||||||
##### START QUEUEMETRICS LOGGING LOOKUP #####
|
##### START QUEUEMETRICS LOGGING LOOKUP #####
|
||||||
$stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_addmember_enabled FROM system_settings;";
|
$stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_addmember_enabled,queuemetrics_dispo_pause FROM system_settings;";
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00349',$user,$server_ip,$session_name,$one_mysql_log);}
|
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00349',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||||
if ($format=='debug') {echo "\n<!-- $rowx[0]|$stmt -->";}
|
if ($format=='debug') {echo "\n<!-- $rowx[0]|$stmt -->";}
|
||||||
@@ -891,6 +892,7 @@ if ($ACTION == 'regCLOSER')
|
|||||||
$queuemetrics_pass = $row[4];
|
$queuemetrics_pass = $row[4];
|
||||||
$queuemetrics_log_id = $row[5];
|
$queuemetrics_log_id = $row[5];
|
||||||
$queuemetrics_addmember_enabled = $row[6];
|
$queuemetrics_addmember_enabled = $row[6];
|
||||||
|
$queuemetrics_dispo_pause = $row[7];
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
##### END QUEUEMETRICS LOGGING LOOKUP #####
|
##### END QUEUEMETRICS LOGGING LOOKUP #####
|
||||||
@@ -1425,7 +1427,7 @@ if ($ACTION == 'manDiaLnextCaLL')
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
##### gather no hopper dialing settings from campaign
|
##### gather no hopper dialing settings from campaign
|
||||||
$stmt="SELECT no_hopper_dialing,agent_dial_owner_only,local_call_time,dial_statuses,drop_lockout_time,lead_filter_id,lead_order FROM vicidial_campaigns where campaign_id='$campaign';";
|
$stmt="SELECT no_hopper_dialing,agent_dial_owner_only,local_call_time,dial_statuses,drop_lockout_time,lead_filter_id,lead_order,lead_order_randomize FROM vicidial_campaigns where campaign_id='$campaign';";
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00236',$user,$server_ip,$session_name,$one_mysql_log);}
|
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00236',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||||
if ($DB) {echo "$stmt\n";}
|
if ($DB) {echo "$stmt\n";}
|
||||||
@@ -1440,6 +1442,7 @@ if ($ACTION == 'manDiaLnextCaLL')
|
|||||||
$drop_lockout_time = $row[4];
|
$drop_lockout_time = $row[4];
|
||||||
$lead_filter_id = $row[5];
|
$lead_filter_id = $row[5];
|
||||||
$lead_order = $row[6];
|
$lead_order = $row[6];
|
||||||
|
$lead_order_randomize = $row[7];
|
||||||
}
|
}
|
||||||
if (eregi("N",$no_hopper_dialing))
|
if (eregi("N",$no_hopper_dialing))
|
||||||
{
|
{
|
||||||
@@ -1838,24 +1841,27 @@ if ($ACTION == 'manDiaLnextCaLL')
|
|||||||
if (eregi("TERRITORY",$agent_dial_owner_only)) {$adooSQL = "and owner IN('$territory')";}
|
if (eregi("TERRITORY",$agent_dial_owner_only)) {$adooSQL = "and owner IN('$territory')";}
|
||||||
if (eregi("USER_GROUP",$agent_dial_owner_only)) {$adooSQL = "and owner='$user_group'";}
|
if (eregi("USER_GROUP",$agent_dial_owner_only)) {$adooSQL = "and owner='$user_group'";}
|
||||||
|
|
||||||
|
if ($lead_order_randomize == 'Y') {$last_order = "RAND()";}
|
||||||
|
else {$last_order = "lead_id asc";}
|
||||||
|
|
||||||
$order_stmt = '';
|
$order_stmt = '';
|
||||||
if (eregi("DOWN",$lead_order)){$order_stmt = 'order by lead_id asc';}
|
if (eregi("DOWN",$lead_order)){$order_stmt = 'order by lead_id asc';}
|
||||||
if (eregi("UP",$lead_order)){$order_stmt = 'order by lead_id desc';}
|
if (eregi("UP",$lead_order)){$order_stmt = 'order by lead_id desc';}
|
||||||
if (eregi("UP LAST NAME",$lead_order)){$order_stmt = 'order by last_name desc, lead_id asc';}
|
if (eregi("UP LAST NAME",$lead_order)){$order_stmt = 'order by last_name desc, $last_order';}
|
||||||
if (eregi("DOWN LAST NAME",$lead_order)){$order_stmt = 'order by last_name, lead_id asc';}
|
if (eregi("DOWN LAST NAME",$lead_order)){$order_stmt = 'order by last_name, $last_order';}
|
||||||
if (eregi("UP PHONE",$lead_order)){$order_stmt = 'order by phone_number desc, lead_id asc';}
|
if (eregi("UP PHONE",$lead_order)){$order_stmt = 'order by phone_number desc, $last_order';}
|
||||||
if (eregi("DOWN PHONE",$lead_order)){$order_stmt = 'order by phone_number, lead_id asc';}
|
if (eregi("DOWN PHONE",$lead_order)){$order_stmt = 'order by phone_number, $last_order';}
|
||||||
if (eregi("UP COUNT",$lead_order)){$order_stmt = 'order by called_count desc, lead_id asc';}
|
if (eregi("UP COUNT",$lead_order)){$order_stmt = 'order by called_count desc, $last_order';}
|
||||||
if (eregi("DOWN COUNT",$lead_order)){$order_stmt = 'order by called_count, lead_id asc';}
|
if (eregi("DOWN COUNT",$lead_order)){$order_stmt = 'order by called_count, $last_order';}
|
||||||
if (eregi("UP LAST CALL TIME",$lead_order)){$order_stmt = 'order by last_local_call_time desc, lead_id asc';}
|
if (eregi("UP LAST CALL TIME",$lead_order)){$order_stmt = 'order by last_local_call_time desc, $last_order';}
|
||||||
if (eregi("DOWN LAST CALL TIME",$lead_order)){$order_stmt = 'order by last_local_call_time, lead_id asc';}
|
if (eregi("DOWN LAST CALL TIME",$lead_order)){$order_stmt = 'order by last_local_call_time, $last_order';}
|
||||||
if (eregi("RANDOM",$lead_order)){$order_stmt = 'order by RAND()';}
|
if (eregi("RANDOM",$lead_order)){$order_stmt = 'order by RAND()';}
|
||||||
if (eregi("UP RANK",$lead_order)){$order_stmt = 'order by rank desc, lead_id asc';}
|
if (eregi("UP RANK",$lead_order)){$order_stmt = 'order by rank desc, $last_order';}
|
||||||
if (eregi("DOWN RANK",$lead_order)){$order_stmt = 'order by rank, lead_id asc';}
|
if (eregi("DOWN RANK",$lead_order)){$order_stmt = 'order by rank, $last_order';}
|
||||||
if (eregi("UP OWNER",$lead_order)){$order_stmt = 'order by owner desc, lead_id asc';}
|
if (eregi("UP OWNER",$lead_order)){$order_stmt = 'order by owner desc, $last_order';}
|
||||||
if (eregi("DOWN OWNER",$lead_order)){$order_stmt = 'order by owner, lead_id asc';}
|
if (eregi("DOWN OWNER",$lead_order)){$order_stmt = 'order by owner, $last_order';}
|
||||||
if (eregi("UP TIMEZONE",$lead_order)){$order_stmt = 'order by gmt_offset_now desc, lead_id asc';}
|
if (eregi("UP TIMEZONE",$lead_order)){$order_stmt = 'order by gmt_offset_now desc, $last_order';}
|
||||||
if (eregi("DOWN TIMEZONE",$lead_order)){$order_stmt = 'order by gmt_offset_now, lead_id asc';}
|
if (eregi("DOWN TIMEZONE",$lead_order)){$order_stmt = 'order by gmt_offset_now, $last_order';}
|
||||||
|
|
||||||
$stmt="UPDATE vicidial_list SET status='QUEUE',user='$user' where called_since_last_reset='N' and status IN($Dsql) and list_id IN($camp_lists) and ($all_gmtSQL) $DLTsql $fSQL $adooSQL $order_stmt LIMIT 1;";
|
$stmt="UPDATE vicidial_list SET status='QUEUE',user='$user' where called_since_last_reset='N' and status IN($Dsql) and list_id IN($camp_lists) and ($all_gmtSQL) $DLTsql $fSQL $adooSQL $order_stmt LIMIT 1;";
|
||||||
if ($DB) {echo "$stmt\n";}
|
if ($DB) {echo "$stmt\n";}
|
||||||
@@ -3212,7 +3218,7 @@ if ($stage == "end")
|
|||||||
|
|
||||||
#############################################
|
#############################################
|
||||||
##### START QUEUEMETRICS LOGGING LOOKUP #####
|
##### START QUEUEMETRICS LOGGING LOOKUP #####
|
||||||
$stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;";
|
$stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_dispo_pause FROM system_settings;";
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00063',$user,$server_ip,$session_name,$one_mysql_log);}
|
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00063',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||||
if ($DB) {echo "$stmt\n";}
|
if ($DB) {echo "$stmt\n";}
|
||||||
@@ -3227,6 +3233,7 @@ if ($stage == "end")
|
|||||||
$queuemetrics_login = $row[3];
|
$queuemetrics_login = $row[3];
|
||||||
$queuemetrics_pass = $row[4];
|
$queuemetrics_pass = $row[4];
|
||||||
$queuemetrics_log_id = $row[5];
|
$queuemetrics_log_id = $row[5];
|
||||||
|
$queuemetrics_dispo_pause = $row[6];
|
||||||
|
|
||||||
if ($enable_queuemetrics_logging > 0)
|
if ($enable_queuemetrics_logging > 0)
|
||||||
{
|
{
|
||||||
@@ -4098,6 +4105,16 @@ if ($stage == "end")
|
|||||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00299',$user,$server_ip,$session_name,$one_mysql_log);}
|
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00299',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||||
|
|
||||||
|
### if queuemetrics_dispo_pause dispo tag is enabled, log it here
|
||||||
|
if (strlen($queuemetrics_dispo_pause) > 0)
|
||||||
|
{
|
||||||
|
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PAUSEREASON',serverid='$queuemetrics_log_id',data1='$queuemetrics_dispo_pause';";
|
||||||
|
if ($DB) {echo "$stmt\n";}
|
||||||
|
$rslt=mysql_query($stmt, $linkB);
|
||||||
|
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00364',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||||
|
$affected_rows = mysql_affected_rows($linkB);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5341,7 +5358,7 @@ if ($ACTION == 'userLOGout')
|
|||||||
{
|
{
|
||||||
#############################################
|
#############################################
|
||||||
##### START QUEUEMETRICS LOGGING LOOKUP #####
|
##### START QUEUEMETRICS LOGGING LOOKUP #####
|
||||||
$stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,allow_sipsak_messages,queuemetrics_loginout,queuemetrics_addmember_enabled FROM system_settings;";
|
$stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,allow_sipsak_messages,queuemetrics_loginout,queuemetrics_addmember_enabled,queuemetrics_dispo_pause FROM system_settings;";
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00138',$user,$server_ip,$session_name,$one_mysql_log);}
|
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00138',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||||
if ($DB) {echo "$stmt\n";}
|
if ($DB) {echo "$stmt\n";}
|
||||||
@@ -5358,6 +5375,7 @@ if ($ACTION == 'userLOGout')
|
|||||||
$allow_sipsak_messages = $row[6];
|
$allow_sipsak_messages = $row[6];
|
||||||
$queuemetrics_loginout = $row[7];
|
$queuemetrics_loginout = $row[7];
|
||||||
$queuemetrics_addmember_enabled = $row[8];
|
$queuemetrics_addmember_enabled = $row[8];
|
||||||
|
$queuemetrics_dispo_pause = $row[9];
|
||||||
}
|
}
|
||||||
##### END QUEUEMETRICS LOGGING LOOKUP #####
|
##### END QUEUEMETRICS LOGGING LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
@@ -5382,6 +5400,7 @@ if ($ACTION == 'userLOGout')
|
|||||||
# $rslt=mysql_query($stmt, $linkB);
|
# $rslt=mysql_query($stmt, $linkB);
|
||||||
# $affected_rows = mysql_affected_rows($linkB);
|
# $affected_rows = mysql_affected_rows($linkB);
|
||||||
|
|
||||||
|
$logintime=0;
|
||||||
$stmt = "SELECT time_id,data1 FROM queue_log where agent='Agent/$user' and verb IN('AGENTLOGIN','AGENTCALLBACKLOGIN') order by time_id desc limit 1;";
|
$stmt = "SELECT time_id,data1 FROM queue_log where agent='Agent/$user' and verb IN('AGENTLOGIN','AGENTCALLBACKLOGIN') order by time_id desc limit 1;";
|
||||||
$rslt=mysql_query($stmt, $linkB);
|
$rslt=mysql_query($stmt, $linkB);
|
||||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00139',$user,$server_ip,$session_name,$one_mysql_log);}
|
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00139',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||||
@@ -5400,14 +5419,31 @@ if ($ACTION == 'userLOGout')
|
|||||||
$time_logged_in = ($StarTtime - $logintime);
|
$time_logged_in = ($StarTtime - $logintime);
|
||||||
if ($time_logged_in > 1000000) {$time_logged_in=1;}
|
if ($time_logged_in > 1000000) {$time_logged_in=1;}
|
||||||
|
|
||||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='$QM_LOGOFF',data1='$loginphone',data2='$time_logged_in',serverid='$queuemetrics_log_id';";
|
if ($queuemetrics_loginout != 'NONE')
|
||||||
if ($DB) {echo "$stmt\n";}
|
{
|
||||||
$rslt=mysql_query($stmt, $linkB);
|
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='$QM_LOGOFF',data1='$loginphone',data2='$time_logged_in',serverid='$queuemetrics_log_id';";
|
||||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00140',$user,$server_ip,$session_name,$one_mysql_log);}
|
if ($DB) {echo "$stmt\n";}
|
||||||
$affected_rows = mysql_affected_rows($linkB);
|
$rslt=mysql_query($stmt, $linkB);
|
||||||
|
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00140',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||||
|
$affected_rows = mysql_affected_rows($linkB);
|
||||||
|
}
|
||||||
|
|
||||||
if ($queuemetrics_addmember_enabled > 0)
|
if ($queuemetrics_addmember_enabled > 0)
|
||||||
{
|
{
|
||||||
|
if ( ($logintime < 1) or ($queuemetrics_loginout == 'NONE') )
|
||||||
|
{
|
||||||
|
$stmtB = "SELECT time_id,data3 FROM queue_log where agent='Agent/$user' and verb='PAUSEREASON' and data1='LOGIN' order by time_id desc limit 1;";
|
||||||
|
$rsltB=mysql_query($stmtB, $linkB);
|
||||||
|
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00365',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||||
|
if ($DB) {echo "<BR>$stmtB\n";}
|
||||||
|
$qml_ct = mysql_num_rows($rsltB);
|
||||||
|
if ($qml_ct > 0)
|
||||||
|
{
|
||||||
|
$row=mysql_fetch_row($rsltB);
|
||||||
|
$logintime = $row[0];
|
||||||
|
$loginphone = $row[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
$stmt = "SELECT distinct queue FROM queue_log where time_id >= $logintime and agent='Agent/$user' and verb IN('ADDMEMBER','ADDMEMBER2') order by time_id desc;";
|
$stmt = "SELECT distinct queue FROM queue_log where time_id >= $logintime and agent='Agent/$user' and verb IN('ADDMEMBER','ADDMEMBER2') order by time_id desc;";
|
||||||
$rslt=mysql_query($stmt, $linkB);
|
$rslt=mysql_query($stmt, $linkB);
|
||||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00351',$user,$server_ip,$session_name,$one_mysql_log);}
|
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00351',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||||
|
|||||||
+26
-19
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
# vicidial.php - the web-based version of the astVICIDIAL client application
|
# vicidial.php - the web-based version of the astVICIDIAL client application
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# Other scripts that this application depends on:
|
# Other scripts that this application depends on:
|
||||||
# - vdc_db_query.php: Updates information in the database
|
# - vdc_db_query.php: Updates information in the database
|
||||||
@@ -328,10 +328,11 @@
|
|||||||
# 101208-1210 - Fixed focus/blur coding to work after Dispo
|
# 101208-1210 - Fixed focus/blur coding to work after Dispo
|
||||||
# 101216-1758 - Added the ability to hide fields if the label is set to ---HIDE--- in System Settings
|
# 101216-1758 - Added the ability to hide fields if the label is set to ---HIDE--- in System Settings
|
||||||
# 101227-1645 - Added dialplan off toggle options, and settings and code changes for top bar webphone
|
# 101227-1645 - Added dialplan off toggle options, and settings and code changes for top bar webphone
|
||||||
|
# 110109-1205 - Added queuemetrics_loginout NONE option
|
||||||
#
|
#
|
||||||
|
|
||||||
$version = '2.4-305';
|
$version = '2.4-306';
|
||||||
$build = '101227-1645';
|
$build = '110109-1205';
|
||||||
$mel=1; # Mysql Error Log enabled = 1
|
$mel=1; # Mysql Error Log enabled = 1
|
||||||
$mysql_log_count=69;
|
$mysql_log_count=69;
|
||||||
$one_mysql_log=0;
|
$one_mysql_log=0;
|
||||||
@@ -2308,7 +2309,7 @@ else
|
|||||||
{
|
{
|
||||||
$QM_LOGIN = 'AGENTLOGIN';
|
$QM_LOGIN = 'AGENTLOGIN';
|
||||||
$QM_PHONE = "$VD_login@agents";
|
$QM_PHONE = "$VD_login@agents";
|
||||||
if ($queuemetrics_loginout=='CALLBACK')
|
if ( ($queuemetrics_loginout=='CALLBACK') or ($queuemetrics_loginout=='NONE') )
|
||||||
{
|
{
|
||||||
$QM_LOGIN = 'AGENTCALLBACKLOGIN';
|
$QM_LOGIN = 'AGENTCALLBACKLOGIN';
|
||||||
$QM_PHONE = "$SIP_user_DiaL";
|
$QM_PHONE = "$SIP_user_DiaL";
|
||||||
@@ -2316,12 +2317,15 @@ else
|
|||||||
$linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass");
|
$linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass");
|
||||||
mysql_select_db("$queuemetrics_dbname", $linkB);
|
mysql_select_db("$queuemetrics_dbname", $linkB);
|
||||||
|
|
||||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='$QM_LOGIN',data1='$QM_PHONE',serverid='$queuemetrics_log_id';";
|
if ($queuemetrics_loginout!='NONE')
|
||||||
if ($DB) {echo "$stmt\n";}
|
{
|
||||||
$rslt=mysql_query($stmt, $linkB);
|
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='$QM_LOGIN',data1='$QM_PHONE',serverid='$queuemetrics_log_id';";
|
||||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01045',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
if ($DB) {echo "$stmt\n";}
|
||||||
$affected_rows = mysql_affected_rows($linkB);
|
$rslt=mysql_query($stmt, $linkB);
|
||||||
echo "<!-- queue_log $QM_LOGIN entry added: $VD_login|$affected_rows|$QM_PHONE -->\n";
|
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01045',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||||
|
$affected_rows = mysql_affected_rows($linkB);
|
||||||
|
echo "<!-- queue_log $QM_LOGIN entry added: $VD_login|$affected_rows|$QM_PHONE -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEALL',serverid='$queuemetrics_log_id';";
|
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEALL',serverid='$queuemetrics_log_id';";
|
||||||
if ($DB) {echo "$stmt\n";}
|
if ($DB) {echo "$stmt\n";}
|
||||||
@@ -2365,7 +2369,7 @@ else
|
|||||||
{
|
{
|
||||||
$QM_LOGIN = 'AGENTLOGIN';
|
$QM_LOGIN = 'AGENTLOGIN';
|
||||||
$QM_PHONE = "$VD_login@agents";
|
$QM_PHONE = "$VD_login@agents";
|
||||||
if ($queuemetrics_loginout=='CALLBACK')
|
if ( ($queuemetrics_loginout=='CALLBACK') or ($queuemetrics_loginout=='NONE') )
|
||||||
{
|
{
|
||||||
$QM_LOGIN = 'AGENTCALLBACKLOGIN';
|
$QM_LOGIN = 'AGENTCALLBACKLOGIN';
|
||||||
$QM_PHONE = "$SIP_user_DiaL";
|
$QM_PHONE = "$SIP_user_DiaL";
|
||||||
@@ -2373,12 +2377,15 @@ else
|
|||||||
$linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass");
|
$linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass");
|
||||||
mysql_select_db("$queuemetrics_dbname", $linkB);
|
mysql_select_db("$queuemetrics_dbname", $linkB);
|
||||||
|
|
||||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='$VD_campaign',agent='Agent/$VD_login',verb='$QM_LOGIN',data1='$QM_PHONE',serverid='$queuemetrics_log_id';";
|
if ($queuemetrics_loginout!='NONE')
|
||||||
if ($DB) {echo "$stmt\n";}
|
{
|
||||||
$rslt=mysql_query($stmt, $linkB);
|
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='$VD_campaign',agent='Agent/$VD_login',verb='$QM_LOGIN',data1='$QM_PHONE',serverid='$queuemetrics_log_id';";
|
||||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01048',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
if ($DB) {echo "$stmt\n";}
|
||||||
$affected_rows = mysql_affected_rows($linkB);
|
$rslt=mysql_query($stmt, $linkB);
|
||||||
echo "<!-- queue_log $QM_LOGIN entry added: $VD_login|$affected_rows|$QM_PHONE -->\n";
|
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01048',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||||
|
$affected_rows = mysql_affected_rows($linkB);
|
||||||
|
echo "<!-- queue_log $QM_LOGIN entry added: $VD_login|$affected_rows|$QM_PHONE -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEALL',serverid='$queuemetrics_log_id';";
|
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEALL',serverid='$queuemetrics_log_id';";
|
||||||
if ($DB) {echo "$stmt\n";}
|
if ($DB) {echo "$stmt\n";}
|
||||||
@@ -2483,12 +2490,12 @@ else
|
|||||||
$linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass");
|
$linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass");
|
||||||
mysql_select_db("$queuemetrics_dbname", $linkB);
|
mysql_select_db("$queuemetrics_dbname", $linkB);
|
||||||
|
|
||||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimEpause',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEREASON',data1='LOGIN',serverid='$queuemetrics_log_id';";
|
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimEpause',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEREASON',data1='LOGIN',data3='$QM_PHONE',serverid='$queuemetrics_log_id';";
|
||||||
if ($DB) {echo "$stmt\n";}
|
if ($DB) {echo "$stmt\n";}
|
||||||
$rslt=mysql_query($stmt, $linkB);
|
$rslt=mysql_query($stmt, $linkB);
|
||||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01063',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01063',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||||
$affected_rows = mysql_affected_rows($linkB);
|
$affected_rows = mysql_affected_rows($linkB);
|
||||||
echo "<!-- queue_log PAUSEREASON LOGIN entry added: $VD_login|$affected_rows -->\n";
|
echo "<!-- queue_log PAUSEREASON LOGIN entry added: $VD_login|$affected_rows|$QM_PHONE -->\n";
|
||||||
|
|
||||||
mysql_close($linkB);
|
mysql_close($linkB);
|
||||||
mysql_select_db("$VARDB_database", $link);
|
mysql_select_db("$VARDB_database", $link);
|
||||||
|
|||||||
+86
-41
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user