some minor bug fixes and queue_log fix for leave-3way in vdc_db_query.php and vicidial.php

git-svn-id: svn://192.168.202.10@989 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2008-10-26 14:41:19 +00:00
parent 35ee66d9c8
commit fd942d32ea
6 changed files with 41 additions and 12 deletions
@@ -1112,6 +1112,7 @@ if ($agent_search_method =~ /^SO|^LO/)
or die "Couldn't connect to database: " . DBI->errstr;
if ($DBX) {print "CONNECTED TO DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";}
$now_date_epoch = time();
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$YqueryCID',queue='$channel_group',agent='Agent/$VDADuser',verb='CONNECT',data1='$drop_timer',serverid='$queuemetrics_log_id';";
$Baffected_rows = $dbhB->do($stmtB);
@@ -1392,6 +1393,7 @@ if ($agent_search_method =~ /^LO|^LB/)
or die "Couldn't connect to database: " . DBI->errstr;
if ($DBX) {print "CONNECTED TO DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";}
$now_date_epoch = time();
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$YqueryCID',queue='$channel_group',agent='Agent/$VDADuser',verb='CONNECT',data1='$drop_timer',serverid='$queuemetrics_log_id';";
$Baffected_rows = $dbhB->do($stmtB);
@@ -95,6 +95,7 @@ vicidial_balance_active ENUM('Y','N') default 'N',
balance_trunks_offlimits SMALLINT(5) UNSIGNED default '0'
);
CREATE UNIQUE INDEX server_id on servers (server_id);
CREATE TABLE live_channels (
channel VARCHAR(100) NOT NULL,
@@ -1324,7 +1325,7 @@ INSERT INTO vicidial_phone_codes (country_code, country, areacode, state, GMT_of
UPDATE system_settings SET qc_last_pull_time=NOW();
UPDATE system_settings SET db_schema_version='1110';
UPDATE system_settings SET db_schema_version='1111';
GRANT RELOAD ON *.* TO cron@'%';
GRANT RELOAD ON *.* TO cron@localhost;
+4
View File
@@ -485,3 +485,7 @@ UPDATE system_settings SET db_schema_version='1109';
ALTER TABLE vicidial_campaigns MODIFY dial_method ENUM('MANUAL','RATIO','ADAPT_HARD_LIMIT','ADAPT_TAPERED','ADAPT_AVERAGE','INBOUND_MAN') default 'MANUAL';
UPDATE system_settings SET db_schema_version='1110';
CREATE UNIQUE INDEX server_id on servers (server_id);
UPDATE system_settings SET db_schema_version='1111';
+23 -1
View File
@@ -1753,7 +1753,7 @@ if ($stage == "end")
$CLuniqueid = $row[9];
}
$CLstage = preg_replace("/XFER|-/",'',$CLstage);
$CLstage = preg_replace("/XFER|CLOSER|-/",'',$CLstage);
if ($CLstage < 0.25) {$CLstage=0;}
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$VDcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';";
@@ -1828,6 +1828,7 @@ if ($stage == "end")
else
{
$SQLterm = "term_reason='$term_reason'";
$QL_term='';
if ( (ereg("NONE",$term_reason)) or (ereg("NONE",$VDterm_reason)) or (strlen($VDterm_reason) < 1) )
{
@@ -1849,6 +1850,7 @@ if ($stage == "end")
else
{
$SQLterm = "term_reason='AGENT'";
$QL_term = 'COMPLETEAGENT';
}
}
@@ -1857,6 +1859,26 @@ if ($stage == "end")
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$affected_rows = mysql_affected_rows($link);
if ( (strlen($QL_term) > 0) and ($leaving_threeway > 0) )
{
$stmt="SELECT count(*) from queue_log where call_id='$MDnextCID' and verb='COMPLETEAGENT' and queue='$VDcampaign_id';";
$rslt=mysql_query($stmt, $linkB);
if ($DB) {echo "$stmt\n";}
$VAC_cc_ct = mysql_num_rows($rslt);
if ($VAC_cc_ct > 0)
{
$row=mysql_fetch_row($rslt);
$agent_complete = $row[0];
}
if ($agent_complete < 1)
{
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$VDcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $linkB);
$affected_rows = mysql_affected_rows($linkB);
}
}
}
}
+9 -9
View File
@@ -2211,15 +2211,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
mainxfer_send_redirect('3WAY','','',tempvarattempt);
if (threeway_end == '0')
{
document.vicidial_form.xferchannel.value = '';
xfercall_send_hangup();
document.vicidial_form.callchannel.value = '';
document.vicidial_form.callserverip.value = '';
dialedcall_send_hangup();
}
// if (threeway_end == '0')
// {
// document.vicidial_form.xferchannel.value = '';
// xfercall_send_hangup();
//
// document.vicidial_form.callchannel.value = '';
// document.vicidial_form.callserverip.value = '';
// dialedcall_send_hangup();
// }
if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;}
}
@@ -872,7 +872,7 @@ while ($i <= 96)
$hour_count[$i] = $row[0];
if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
if ($hour_count[$i] > 0) {$last_full_record = $i;}
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id IN($group_SQL) and status IN('DROP','XDROP')';";
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id IN($group_SQL) and status IN('DROP','XDROP');";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$row=mysql_fetch_row($rslt);