Several fixes and small changes to QM queue_log logging
Added phone alias load balance login server twin validation option Raising the input limit on most URL admin fields to 2000 characters git-svn-id: svn://192.168.202.10@1609 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -472,6 +472,9 @@ OTHER CHANGES:
|
||||
111. Added options to restrict agent lead search to the owner field equal to
|
||||
the user, user group or selected territories for the agent.
|
||||
|
||||
112. Added option for phone load balanced logins server twin checking on
|
||||
systems that have servers installed in pairs
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
#exten => _99909*.,2,AGI(agi-VDAD_ALL_inbound.agi)
|
||||
#exten => _99909*.,3,Hangup
|
||||
#
|
||||
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# changes:
|
||||
# 70828-0924 - First Build
|
||||
@@ -144,6 +144,7 @@
|
||||
# 100929-1201 - Added add_lead_url feature
|
||||
# 101008-0410 - Added option for alternate Minimum Hold Time Message
|
||||
# 101219-2110 - Added call time overflow
|
||||
# 110224-1735 - Added compatibility with QM phone environment logging
|
||||
#
|
||||
|
||||
$script = 'agi-VDAD_ALL_inbound.agi';
|
||||
@@ -155,7 +156,7 @@ $wait_prompt_runs=0;
|
||||
$at='@';
|
||||
$S='*';
|
||||
$mel=1; # Mysql Error Log enabled = 1
|
||||
$mysql_log_count=153;
|
||||
$mysql_log_count=157;
|
||||
$one_mysql_log=0;
|
||||
|
||||
|
||||
@@ -1881,7 +1882,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
|
||||
else
|
||||
{$vlia_users="''";}
|
||||
|
||||
$stmtA = "SELECT vicidial_live_agents.conf_exten,vicidial_live_agents.user,vicidial_live_agents.extension,vicidial_live_agents.server_ip,vicidial_live_inbound_agents.group_weight,ra_user from vicidial_live_agents, vicidial_live_inbound_agents WHERE vicidial_live_agents.user=vicidial_live_inbound_agents.user and status IN('CLOSER','READY') and lead_id<1 and server_ip='$VARserver_ip' $ADUfindSQL and vicidial_live_inbound_agents.group_id='$channel_group' and last_update_time > '$BDtsSQLdate' and vicidial_live_agents.user NOT IN($vlia_users) $qp_groupWAIT_camp_SQL $agent_call_order limit 1;";
|
||||
$stmtA = "SELECT vicidial_live_agents.conf_exten,vicidial_live_agents.user,vicidial_live_agents.extension,vicidial_live_agents.server_ip,vicidial_live_inbound_agents.group_weight,ra_user,vicidial_live_agents.campaign_id from vicidial_live_agents, vicidial_live_inbound_agents WHERE vicidial_live_agents.user=vicidial_live_inbound_agents.user and status IN('CLOSER','READY') and lead_id<1 and server_ip='$VARserver_ip' $ADUfindSQL and vicidial_live_inbound_agents.group_id='$channel_group' and last_update_time > '$BDtsSQLdate' and vicidial_live_agents.user NOT IN($vlia_users) $qp_groupWAIT_camp_SQL $agent_call_order limit 1;";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
@@ -1896,13 +1897,14 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
|
||||
$VDADserver_ip = $aryA[3];
|
||||
$VDADgroup_weight = $aryA[4];
|
||||
$ra_user = $aryA[5];
|
||||
$log_campaign = $aryA[6];
|
||||
}
|
||||
$sthA->finish();
|
||||
if ($AGILOG) {$agi_string = "$VDADuser|$VDADgroup_weight|$stmtA|"; &agi_output;}
|
||||
|
||||
if ($AGENTgrab > 0)
|
||||
{
|
||||
$stmtA = "SELECT conf_exten,extension,server_ip,ra_user from vicidial_live_agents WHERE user='$AGENTuser';";
|
||||
$stmtA = "SELECT conf_exten,extension,server_ip,ra_user,campaign_id from vicidial_live_agents WHERE user='$AGENTuser';";
|
||||
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
@@ -1916,6 +1918,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
|
||||
$VDADuser = $AGENTuser;
|
||||
$VDADserver_ip = $aryA[2];
|
||||
$ra_user = $aryA[3];
|
||||
$log_campaign = $aryA[4];
|
||||
}
|
||||
$sthA->finish();
|
||||
}
|
||||
@@ -1948,7 +1951,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
|
||||
if ($aco_sub<1)
|
||||
{
|
||||
$cbc=0;
|
||||
$stmtA = "SELECT conf_exten,user,extension,ra_user FROM vicidial_live_agents where status IN('QUEUE','INCALL') and server_ip='$VARserver_ip' and campaign_id IN($INBOUNDcampsSQL) and callerid='$callerid' and channel='$channel' order by last_call_time limit 1;";
|
||||
$stmtA = "SELECT conf_exten,user,extension,ra_user,campaign_id FROM vicidial_live_agents where status IN('QUEUE','INCALL') and server_ip='$VARserver_ip' and campaign_id IN($INBOUNDcampsSQL) and callerid='$callerid' and channel='$channel' order by last_call_time limit 1;";
|
||||
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
@@ -1962,6 +1965,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
|
||||
$VDADuser = $aryA[1];
|
||||
$VDADextension = $aryA[2];
|
||||
$ra_user = $aryA[3];
|
||||
$log_campaign = $aryA[4];
|
||||
|
||||
$cbc++;
|
||||
}
|
||||
@@ -1993,13 +1997,27 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
|
||||
|
||||
if ($enable_queuemetrics_logging > 0)
|
||||
{
|
||||
$dataSQL='';
|
||||
$stmtA = "SELECT queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id='$log_campaign' and queuemetrics_phone_environment!='';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArowsCQPE=$sthA->rows;
|
||||
$dbhP=$dbhA; $mysql_count='02154'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
|
||||
if ($sthArowsCQPE > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$dataSQL = ",data4='$aryA[0]'";
|
||||
}
|
||||
$sthA->finish();
|
||||
if ($AGILOG) {$agi_string = "$sthArowsCQPE|$dataSQL|$stmtA|"; &agi_output;}
|
||||
|
||||
$dbhB = DBI->connect("DBI:mysql:$queuemetrics_dbname:$queuemetrics_server_ip:3306", "$queuemetrics_login", "$queuemetrics_pass")
|
||||
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';";
|
||||
$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' $data4SQL;";
|
||||
$Baffected_rows = $dbhB->do($stmtB);
|
||||
$dbhP=$dbhB; $stmtA=$stmtB; $mysql_count='02045'; $MEL_aff_rows=$Baffected_rows; &mysql_error_logging;
|
||||
|
||||
@@ -2369,7 +2387,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
|
||||
else
|
||||
{$vlia_users="''";}
|
||||
|
||||
$stmtA = "SELECT vicidial_live_agents.conf_exten,vicidial_live_agents.user,vicidial_live_agents.extension,vicidial_live_agents.server_ip,vicidial_live_inbound_agents.group_weight,ra_user from vicidial_live_agents, vicidial_live_inbound_agents WHERE vicidial_live_agents.user=vicidial_live_inbound_agents.user and status IN('CLOSER','READY') and lead_id<1 $ADUfindSQL and vicidial_live_inbound_agents.group_id='$channel_group' and last_update_time > '$BDtsSQLdate' and vicidial_live_agents.user NOT IN($vlia_users) $qp_groupWAIT_camp_SQL $agent_call_order limit 1;";
|
||||
$stmtA = "SELECT vicidial_live_agents.conf_exten,vicidial_live_agents.user,vicidial_live_agents.extension,vicidial_live_agents.server_ip,vicidial_live_inbound_agents.group_weight,ra_user,vicidial_live_agents.campaign_id from vicidial_live_agents, vicidial_live_inbound_agents WHERE vicidial_live_agents.user=vicidial_live_inbound_agents.user and status IN('CLOSER','READY') and lead_id<1 $ADUfindSQL and vicidial_live_inbound_agents.group_id='$channel_group' and last_update_time > '$BDtsSQLdate' and vicidial_live_agents.user NOT IN($vlia_users) $qp_groupWAIT_camp_SQL $agent_call_order limit 1;";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
@@ -2385,13 +2403,14 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
|
||||
$VDADserver_ip = $aryA[3];
|
||||
$VDADgroup_weight = $aryA[4];
|
||||
$ra_user = $aryA[5];
|
||||
$log_campaign = $aryA[6];
|
||||
}
|
||||
$sthA->finish();
|
||||
if ($AGILOG) {$agi_string = "$VDADuser|$VDADgroup_weight|$stmtA|"; &agi_output;}
|
||||
|
||||
if ($AGENTgrab > 0)
|
||||
{
|
||||
$stmtA = "SELECT conf_exten,extension,server_ip,ra_user from vicidial_live_agents WHERE user='$AGENTuser';";
|
||||
$stmtA = "SELECT conf_exten,extension,server_ip,ra_user,campaign_id from vicidial_live_agents WHERE user='$AGENTuser';";
|
||||
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
@@ -2405,6 +2424,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
|
||||
$VDADuser = $AGENTuser;
|
||||
$VDADserver_ip = $aryA[2];
|
||||
$ra_user = $aryA[3];
|
||||
$log_campaign = $aryA[4];
|
||||
}
|
||||
$sthA->finish();
|
||||
}
|
||||
@@ -2438,7 +2458,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
|
||||
if ($aco_sub<1)
|
||||
{
|
||||
$cbc=0;
|
||||
$stmtA = "SELECT conf_exten,user,extension,server_ip,last_call_time,ra_user FROM vicidial_live_agents where status IN('QUEUE','INCALL') and campaign_id IN($INBOUNDcampsSQL) and callerid='$callerid' and channel='$channel' order by last_call_time limit 1;";
|
||||
$stmtA = "SELECT conf_exten,user,extension,server_ip,last_call_time,ra_user,campaign_id FROM vicidial_live_agents where status IN('QUEUE','INCALL') and campaign_id IN($INBOUNDcampsSQL) and callerid='$callerid' and channel='$channel' order by last_call_time limit 1;";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
@@ -2453,6 +2473,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
|
||||
$VDADserver_ip = $aryA[3];
|
||||
$VDADlast_call_time = $aryA[4];
|
||||
$ra_user = $aryA[5];
|
||||
$log_campaign = $aryA[6];
|
||||
$cbc++;
|
||||
}
|
||||
$sthA->finish();
|
||||
@@ -2489,7 +2510,21 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
|
||||
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';";
|
||||
$dataSQL='';
|
||||
$stmtA = "SELECT queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id='$log_campaign' and queuemetrics_phone_environment!='';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArowsCQPE=$sthA->rows;
|
||||
$dbhP=$dbhA; $mysql_count='02155'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
|
||||
if ($sthArowsCQPE > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$dataSQL = ",data4='$aryA[0]'";
|
||||
}
|
||||
$sthA->finish();
|
||||
if ($AGILOG) {$agi_string = "$sthArowsCQPE|$dataSQL|$stmtA|"; &agi_output;}
|
||||
|
||||
$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' $dataSQL;";
|
||||
$Baffected_rows = $dbhB->do($stmtB);
|
||||
$dbhP=$dbhB; $stmtA=$stmtB; $mysql_count='02065'; $MEL_aff_rows=$Baffected_rows; &mysql_error_logging;
|
||||
|
||||
@@ -3158,7 +3193,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
|
||||
|
||||
$stmtA = "UPDATE vicidial_auto_calls set last_update_time='$FDtsSQLdate' $no_block_SQL where callerid='$callerid' order by call_time desc limit 1;";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
$dbhP=$dbhA; $mysql_count='02156'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG) {$agi_string = "-- VDAC posttime record: |$affected_rows|$FDtsSQLdate|$callerid|$no_block_SQL|EHTM"; &agi_output;}
|
||||
|
||||
if ( (length($eht_minimum_prompt_filename) > 0) && ($eht_minimum_prompt_filename !~ /---NONE---/) )
|
||||
@@ -3188,7 +3223,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
|
||||
{
|
||||
$stmtA = "UPDATE vicidial_auto_calls set call_time='$ORIGINAL_call_time' where callerid='$callerid' order by call_time desc limit 1;";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
$dbhP=$dbhA; $mysql_count='02157'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG) {$agi_string = "-- No-Block Prompt Set: |$affected_rows|$ORIGINAL_call_time|$callerid|EHTM"; &agi_output;}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
#exten => 8366,4,AGI(agi-VDAD_ALL_outbound.agi,SURVEY-----LB-----US_pol_survey_hello-----1238-----8-----US_pol_survey_transfer-----US_thanks_no_contact-----OPTOUT-----DNC)
|
||||
#exten => 8366,5,Hangup
|
||||
#
|
||||
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# changes:
|
||||
# 80218-2027 - First Build
|
||||
@@ -80,6 +80,7 @@
|
||||
# 100903-0041 - Changed lead_id max length to 10 digits
|
||||
# 101207-0713 - Added fix for rare VDAC-entry-missing issue
|
||||
# 110213-0008 - Added scheduled callbacks custom statuses compatibility
|
||||
# 110224-1733 - Added compatibility with QM phone environment logging
|
||||
#
|
||||
|
||||
$script = 'agi-VDAD_ALL_outbound.agi';
|
||||
@@ -469,7 +470,7 @@ if ($VDACaffected_rows > 0)
|
||||
$sthA->finish();
|
||||
|
||||
### Grab campaign values from the database
|
||||
$stmtA = "SELECT drop_call_seconds,drop_action,safe_harbor_exten,concurrent_transfers,next_agent_call,voicemail_ext,drop_inbound_group,use_internal_dnc,use_campaign_dnc,cpd_amd_action,am_message_exten,three_way_call_cid,campaign_cid,survey_first_audio_file,survey_opt_in_audio_file,survey_ni_audio_file,survey_third_audio_file,survey_fourth_audio_file,extension_appended_cidname,queue_priority,closer_campaigns FROM vicidial_campaigns where campaign_id = '$VDADcampaign';";
|
||||
$stmtA = "SELECT drop_call_seconds,drop_action,safe_harbor_exten,concurrent_transfers,next_agent_call,voicemail_ext,drop_inbound_group,use_internal_dnc,use_campaign_dnc,cpd_amd_action,am_message_exten,three_way_call_cid,campaign_cid,survey_first_audio_file,survey_opt_in_audio_file,survey_ni_audio_file,survey_third_audio_file,survey_fourth_audio_file,extension_appended_cidname,queue_priority,closer_campaigns,queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id = '$VDADcampaign';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
@@ -501,6 +502,7 @@ if ($VDACaffected_rows > 0)
|
||||
$extension_appended_cidname = $aryA[18];
|
||||
$VDADqueue_priority = $aryA[19];
|
||||
$closer_campaigns = $aryA[20];
|
||||
$queuemetrics_phone_environment = $aryA[21];
|
||||
if (length($closer_campaigns) > 2)
|
||||
{
|
||||
$closer_campaigns =~ s/^ | -$//gi;
|
||||
@@ -1794,7 +1796,7 @@ while ($drop_timer <= $DROP_TIME)
|
||||
|
||||
if ($DBX) {print "CONNECTED TO DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";}
|
||||
|
||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$callerid',queue='$VDADcampaign',agent='Agent/$VDADuser',verb='CONNECT',data1='$drop_timer',serverid='$queuemetrics_log_id';";
|
||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$callerid',queue='$VDADcampaign',agent='Agent/$VDADuser',verb='CONNECT',data1='$drop_timer',serverid='$queuemetrics_log_id',data4='$queuemetrics_phone_environment';";
|
||||
$Baffected_rows = $dbhB->do($stmtB);
|
||||
$dbhP=$dbhB; $stmtA=$stmtB; $mysql_count='01039'; $MEL_aff_rows=$Baffected_rows; &mysql_error_logging;
|
||||
|
||||
@@ -2185,7 +2187,7 @@ while ($drop_timer <= $DROP_TIME)
|
||||
|
||||
if ($DBX) {print "CONNECTED TO DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";}
|
||||
|
||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$callerid',queue='$VDADcampaign',agent='Agent/$VDADuser',verb='CONNECT',data1='$drop_timer',serverid='$queuemetrics_log_id';";
|
||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$callerid',queue='$VDADcampaign',agent='Agent/$VDADuser',verb='CONNECT',data1='$drop_timer',serverid='$queuemetrics_log_id',data4='$queuemetrics_phone_environment';";
|
||||
$Baffected_rows = $dbhB->do($stmtB);
|
||||
$dbhP=$dbhB; $stmtA=$stmtB; $mysql_count='01046'; $MEL_aff_rows=$Baffected_rows; &mysql_error_logging;
|
||||
|
||||
|
||||
@@ -97,6 +97,7 @@
|
||||
# 110103-1227 - Added queuemetrics_loginout NONE option
|
||||
# 110124-1134 - Small query fix for large queue_log tables
|
||||
# 110224-1408 - Fixed trunk reservation bug
|
||||
# 110224-1859 - Added compatibility with QM phone environment logging
|
||||
#
|
||||
|
||||
|
||||
@@ -1967,10 +1968,11 @@ while($one_day_interval > 0)
|
||||
|
||||
$agents='@agents';
|
||||
$time_logged_in='';
|
||||
$data4='';
|
||||
$RAWtime_logged_in=$TDtarget;
|
||||
if ($queuemetrics_loginout !~ /NONE/)
|
||||
{
|
||||
$stmtB = "SELECT time_id,data1 FROM queue_log where agent='Agent/$VALOuser[$logrun]' and verb IN('AGENTLOGIN','AGENTCALLBACKLOGIN') and time_id > $check_time order by time_id desc limit 1;";
|
||||
$stmtB = "SELECT time_id,data1,data4 FROM queue_log where agent='Agent/$VALOuser[$logrun]' and verb IN('AGENTLOGIN','AGENTCALLBACKLOGIN') and time_id > $check_time 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;
|
||||
@@ -1980,6 +1982,7 @@ while($one_day_interval > 0)
|
||||
$time_logged_in = $aryB[0];
|
||||
$RAWtime_logged_in = $aryB[0];
|
||||
$phone_logged_in = $aryB[1];
|
||||
$data4 = $aryB[2];
|
||||
}
|
||||
$sthB->finish();
|
||||
|
||||
@@ -1987,7 +1990,7 @@ while($one_day_interval > 0)
|
||||
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';";
|
||||
$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',data4='$data4';";
|
||||
$Baffected_rows = $dbhB->do($stmtB);
|
||||
}
|
||||
|
||||
@@ -1995,7 +1998,7 @@ while($one_day_interval > 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;";
|
||||
$stmtB = "SELECT time_id,data3,data4 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;
|
||||
@@ -2005,6 +2008,7 @@ while($one_day_interval > 0)
|
||||
$time_logged_in = $aryB[0];
|
||||
$RAWtime_logged_in = $aryB[0];
|
||||
$phone_logged_in = $aryB[1];
|
||||
$data4 = $aryB[2];
|
||||
}
|
||||
$sthB->finish();
|
||||
|
||||
@@ -2012,7 +2016,12 @@ while($one_day_interval > 0)
|
||||
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;";
|
||||
if ($queuemetrics_loginout =~ /NONE/)
|
||||
{
|
||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$LOGOFFtime',call_id='NONE',queue='NONE',agent='Agent/$VALOuser[$logrun]',verb='PAUSEREASON',serverid='$queuemetrics_log_id',data1='LOGOFF';";
|
||||
$Baffected_rows = $dbhB->do($stmtB);
|
||||
}
|
||||
$stmtB = "SELECT distinct queue FROM queue_log where time_id >= $RAWtime_logged_in and agent='Agent/$VALOuser[$logrun]' and verb IN('ADDMEMBER','ADDMEMBER2') and queue != '$VALOcampaign[$logrun]' order by time_id desc;";
|
||||
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
||||
$sthB->execute or die "executing: $stmtB ", $dbhB->errstr;
|
||||
$sthBrows=$sthB->rows;
|
||||
@@ -2025,10 +2034,14 @@ while($one_day_interval > 0)
|
||||
}
|
||||
$sthB->finish();
|
||||
|
||||
$AM_queue[$rec_count] = $VALOcampaign[$logrun];
|
||||
$rec_count++;
|
||||
$sthBrows++;
|
||||
|
||||
$rec_count=0;
|
||||
while ($sthBrows > $rec_count)
|
||||
{
|
||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$LOGOFFtime',call_id='NONE',queue='$AM_queue[$rec_count]',agent='Agent/$VALOuser[$logrun]',verb='REMOVEMEMBER',data1='$phone_logged_in',serverid='$queuemetrics_log_id';";
|
||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$LOGOFFtime',call_id='NONE',queue='$AM_queue[$rec_count]',agent='Agent/$VALOuser[$logrun]',verb='REMOVEMEMBER',data1='$phone_logged_in',serverid='$queuemetrics_log_id',data4='$data4';";
|
||||
$Baffected_rows = $dbhB->do($stmtB);
|
||||
$rec_count++;
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
# 101108-0032 - Added ADDMEMBER queue_log code
|
||||
# 110103-1230 - Added queuemetrics_loginout NONE option
|
||||
# 110124-1134 - Small query fix for large queue_log tables
|
||||
# 110224-1903 - Added compatibility with QM phone environment logging
|
||||
#
|
||||
|
||||
### begin parsing run-time options ###
|
||||
@@ -502,8 +503,9 @@ while($one_day_interval > 0)
|
||||
if (length($DBremote_user[$h])>1)
|
||||
{
|
||||
$CAMPAIGN_autodial[$h] = 'Y';
|
||||
$CAMPAIGN_queuemetrics_phone_environment[$h] = '';
|
||||
### find the dial method of the campaign for each remote agent
|
||||
$stmtA = "SELECT dial_method FROM vicidial_campaigns where campaign_id='$DBremote_campaign[$h]';";
|
||||
$stmtA = "SELECT dial_method,queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id='$DBremote_campaign[$h]';";
|
||||
if ($DBX) {print STDERR "|$stmtA|\n";}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
@@ -512,6 +514,7 @@ while($one_day_interval > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$CAMPAIGN_dial_method[$h] = $aryA[0];
|
||||
$CAMPAIGN_queuemetrics_phone_environment[$h] = $aryA[1];
|
||||
|
||||
if ($CAMPAIGN_dial_method[$h] =~ /MANUAL|INBOUND_MAN/)
|
||||
{$CAMPAIGN_autodial[$h] = 'N';}
|
||||
@@ -633,16 +636,16 @@ while($one_day_interval > 0)
|
||||
|
||||
if ($queuemetrics_loginout !~ /NONE/)
|
||||
{
|
||||
$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';";
|
||||
$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',data4='$CAMPAIGN_queuemetrics_phone_environment[$h]';";
|
||||
$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',data4='$CAMPAIGN_queuemetrics_phone_environment[$h]';";
|
||||
$Baffected_rows = $dbhB->do($stmtB);
|
||||
|
||||
if ($queuemetrics_addmember_enabled > 0)
|
||||
{
|
||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$secX',call_id='NONE',queue='$DBremote_campaign[$h]',agent='Agent/$DBremote_user[$h]',verb='ADDMEMBER2',data1='$DBremote_user[$h]$agents',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='ADDMEMBER2',data1='$DBremote_user[$h]$agents',serverid='$queuemetrics_log_id',data4='$CAMPAIGN_queuemetrics_phone_environment[$h]';";
|
||||
$Baffected_rows = $dbhB->do($stmtB);
|
||||
}
|
||||
|
||||
@@ -705,7 +708,7 @@ while($one_day_interval > 0)
|
||||
|
||||
if ( ($enable_queuemetrics_logging > 0) && ($queuemetrics_addmember_enabled > 0) )
|
||||
{
|
||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$secX',call_id='NONE',queue='$TEMPingroups[$s]',agent='Agent/$DBremote_user[$h]',verb='ADDMEMBER2',data1='$DBremote_user[$h]$agents',serverid='$queuemetrics_log_id';";
|
||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$secX',call_id='NONE',queue='$TEMPingroups[$s]',agent='Agent/$DBremote_user[$h]',verb='ADDMEMBER2',data1='$DBremote_user[$h]$agents',serverid='$queuemetrics_log_id',data4='$CAMPAIGN_queuemetrics_phone_environment[$h]';";
|
||||
$Baffected_rows = $dbhB->do($stmtB);
|
||||
}
|
||||
}
|
||||
@@ -753,6 +756,7 @@ while($one_day_interval > 0)
|
||||
$VD_campaign_id[$z] = $VDcampaign_id;
|
||||
$VD_call_server_ip[$z] = $VDcall_server_ip;
|
||||
$VD_random[$z] = $VDrandom;
|
||||
$USER_queuemetrics_phone_environment[$z]='';
|
||||
|
||||
$z++;
|
||||
$rec_count++;
|
||||
@@ -774,6 +778,17 @@ while($one_day_interval > 0)
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
$stmtA = "SELECT queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id='$VD_campaign_id[$z]';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$USER_queuemetrics_phone_environment[$z] = $aryA[0];
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
if ($autocallexists[$z] < 1)
|
||||
{
|
||||
if ($DELusers =~ /R\/$VD_user[$z]\|/)
|
||||
@@ -795,7 +810,7 @@ while($one_day_interval > 0)
|
||||
|
||||
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='NONE',agent='Agent/$VD_user[$z]',verb='PAUSEALL',serverid='$queuemetrics_log_id';";
|
||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$secX',call_id='NONE',queue='NONE',agent='Agent/$VD_user[$z]',verb='PAUSEALL',serverid='$queuemetrics_log_id',data4='$USER_queuemetrics_phone_environment[$z]';";
|
||||
$Baffected_rows = $dbhB->do($stmtB);
|
||||
|
||||
$stmtB = "SELECT time_id,data1 FROM queue_log where agent='Agent/$VD_user[$z]' and verb IN('AGENTLOGIN','AGENTCALLBACKLOGIN') and time_id > $check_time order by time_id desc limit 1;";
|
||||
@@ -832,7 +847,12 @@ while($one_day_interval > 0)
|
||||
}
|
||||
$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;";
|
||||
if ($queuemetrics_loginout =~ /NONE/)
|
||||
{
|
||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$secX',call_id='NONE',queue='NONE',agent='Agent/$VD_user[$z]',verb='PAUSEREASON',serverid='$queuemetrics_log_id',data1='LOGOFF';";
|
||||
$Baffected_rows = $dbhB->do($stmtB);
|
||||
}
|
||||
$stmtB = "SELECT distinct queue FROM queue_log where time_id >= $logintime and agent='Agent/$VD_user[$z]' and verb IN('ADDMEMBER','ADDMEMBER2') and queue != '$VD_campaign_id[$z]' order by time_id desc;";
|
||||
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
||||
$sthB->execute or die "executing: $stmtB ", $dbhB->errstr;
|
||||
$sthBrows=$sthB->rows;
|
||||
@@ -845,10 +865,14 @@ while($one_day_interval > 0)
|
||||
}
|
||||
$sthB->finish();
|
||||
|
||||
$AM_queue[$rec_count] = $VD_campaign_id[$z];
|
||||
$rec_count++;
|
||||
$sthBrows++;
|
||||
|
||||
$rec_count=0;
|
||||
while ($sthBrows > $rec_count)
|
||||
{
|
||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$secX',call_id='NONE',queue='$AM_queue[$rec_count]',agent='Agent/$VD_user[$z]',verb='REMOVEMEMBER',data1='$phone_logged_in',serverid='$queuemetrics_log_id';";
|
||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$secX',call_id='NONE',queue='$AM_queue[$rec_count]',agent='Agent/$VD_user[$z]',verb='REMOVEMEMBER',data1='$phone_logged_in',serverid='$queuemetrics_log_id',data4='$USER_queuemetrics_phone_environment[$z]';";
|
||||
$Baffected_rows = $dbhB->do($stmtB);
|
||||
$rec_count++;
|
||||
}
|
||||
@@ -856,7 +880,7 @@ while($one_day_interval > 0)
|
||||
|
||||
if ($queuemetrics_loginout !~ /NONE/)
|
||||
{
|
||||
$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';";
|
||||
$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',data4='$USER_queuemetrics_phone_environment[$z]';";
|
||||
$Baffected_rows = $dbhB->do($stmtB);
|
||||
}
|
||||
|
||||
@@ -883,10 +907,10 @@ while($one_day_interval > 0)
|
||||
|
||||
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='NONE',agent='Agent/$VD_user[$z]',verb='PAUSEALL',serverid='$queuemetrics_log_id';";
|
||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$secX',call_id='NONE',queue='NONE',agent='Agent/$VD_user[$z]',verb='PAUSEALL',serverid='$queuemetrics_log_id',data4='$USER_queuemetrics_phone_environment[$z]';";
|
||||
$Baffected_rows = $dbhB->do($stmtB);
|
||||
|
||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$secX',call_id='NONE',queue='NONE',agent='Agent/$VD_user[$z]',verb='UNPAUSEALL',serverid='$queuemetrics_log_id';";
|
||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$secX',call_id='NONE',queue='NONE',agent='Agent/$VD_user[$z]',verb='UNPAUSEALL',serverid='$queuemetrics_log_id',data4='$USER_queuemetrics_phone_environment[$z]';";
|
||||
$Baffected_rows = $dbhB->do($stmtB);
|
||||
|
||||
$dbhB->disconnect();
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
# 100327-0926 - Added validation of four agent "sec" fields
|
||||
# 100331-0310 - Added one-day-ago and only-fix-old-lagged options, fixed validation process
|
||||
# 110124-1134 - Small query fix for large queue_log tables
|
||||
# 110224-1916 - Added compatibility with QM phone environment logging
|
||||
#
|
||||
|
||||
# constants
|
||||
@@ -1251,19 +1252,20 @@ if ($enable_queuemetrics_logging > 0)
|
||||
if ( ($CQ_records > 0) && ($Ctime_id[$h] > 1000) )
|
||||
{
|
||||
##### find the CALLSTATUS details for calls that were dispositioned by an agent
|
||||
$stmtB = "SELECT time_id,call_id,queue,agent,verb,serverid FROM queue_log where verb='CALLSTATUS' and call_id='$call_id[$h]' and agent='$Cagent[$h]';";
|
||||
$stmtB = "SELECT time_id,call_id,queue,agent,verb,serverid,data4 FROM queue_log where verb='CALLSTATUS' and call_id='$call_id[$h]' and agent='$Cagent[$h]';";
|
||||
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
||||
$sthB->execute or die "executing: $stmtB ", $dbhB->errstr;
|
||||
$SQ_records=$sthB->rows;
|
||||
if ($SQ_records > 0)
|
||||
{
|
||||
@aryB = $sthB->fetchrow_array;
|
||||
$Stime_id[$h] = "$aryB[0]";
|
||||
$Scall_id[$h] = "$aryB[1]";
|
||||
$Squeue[$h] = "$aryB[2]";
|
||||
$Sagent[$h] = "$aryB[3]";
|
||||
$Sverb[$h] = "$aryB[4]";
|
||||
$Sserverid[$h] = "$aryB[5]";
|
||||
$Stime_id[$h] = $aryB[0];
|
||||
$Scall_id[$h] = $aryB[1];
|
||||
$Squeue[$h] = $aryB[2];
|
||||
$Sagent[$h] = $aryB[3];
|
||||
$Sverb[$h] = $aryB[4];
|
||||
$Sserverid[$h] = $aryB[5];
|
||||
$Sdata4[$h] = $aryB[6];
|
||||
$Slead_id[$h] = substr($Scall_id[$h], 11, 9);
|
||||
$Slead_id[$h] = ($Slead_id[$h] + 0);
|
||||
}
|
||||
@@ -1337,7 +1339,7 @@ if ($enable_queuemetrics_logging > 0)
|
||||
|
||||
##### insert a COMPLETEAGENT record for this call into the queue_log
|
||||
$CALLtime[$h] = ($Stime_id[$h] - $time_id[$h]);
|
||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$Stime_id[$h]',call_id='$Scall_id[$h]',queue='$Squeue[$h]',agent='$Sagent[$h]',verb='COMPLETEAGENT',data1='$Cdata1[$h]',data2='$CALLtime[$h]',data3='$queue_position',serverid='$Sserverid[$h]';";
|
||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$Stime_id[$h]',call_id='$Scall_id[$h]',queue='$Squeue[$h]',agent='$Sagent[$h]',verb='COMPLETEAGENT',data1='$Cdata1[$h]',data2='$CALLtime[$h]',data3='$queue_position',serverid='$Sserverid[$h]',data4='$Sdata4[$h]';";
|
||||
if ($TEST < 1)
|
||||
{
|
||||
$Baffected_rows = $dbhB->do($stmtB);
|
||||
@@ -1351,19 +1353,20 @@ if ($enable_queuemetrics_logging > 0)
|
||||
if ($DB) {print "NO CALLSTATUS: $Ctime_id[$h]|$Ccall_id[$h]|$Cagent[$h] \n";}
|
||||
$noCALLSTATUS++;
|
||||
##### find the COMPLETE details for calls that were connected to an agent
|
||||
$stmtB = "SELECT time_id,call_id,queue,agent,verb,serverid FROM queue_log where verb IN('COMPLETEAGENT','COMPLETECALLER') and call_id='$call_id[$h]' and agent='$Cagent[$h]';";
|
||||
$stmtB = "SELECT time_id,call_id,queue,agent,verb,serverid,data4 FROM queue_log where verb IN('COMPLETEAGENT','COMPLETECALLER') and call_id='$call_id[$h]' and agent='$Cagent[$h]';";
|
||||
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
||||
$sthB->execute or die "executing: $stmtB ", $dbhB->errstr;
|
||||
$SQ_records=$sthB->rows;
|
||||
if ($SQ_records > 0)
|
||||
{
|
||||
@aryB = $sthB->fetchrow_array;
|
||||
$Stime_id[$h] = "$aryB[0]";
|
||||
$Scall_id[$h] = "$aryB[1]";
|
||||
$Squeue[$h] = "$aryB[2]";
|
||||
$Sagent[$h] = "$aryB[3]";
|
||||
$Sverb[$h] = "$aryB[4]";
|
||||
$Sserverid[$h] = "$aryB[5]";
|
||||
$Stime_id[$h] = $aryB[0];
|
||||
$Scall_id[$h] = $aryB[1];
|
||||
$Squeue[$h] = $aryB[2];
|
||||
$Sagent[$h] = $aryB[3];
|
||||
$Sverb[$h] = $aryB[4];
|
||||
$Sserverid[$h] = $aryB[5];
|
||||
$Sdata4[$h] = $aryB[6];
|
||||
}
|
||||
$sthB->finish();
|
||||
|
||||
@@ -1451,7 +1454,7 @@ if ($enable_queuemetrics_logging > 0)
|
||||
|
||||
##### insert a COMPLETEAGENT record for this call into the queue_log
|
||||
$CALLtime[$h] = ($Stime_id[$h] - $time_id[$h]);
|
||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$Stime_id[$h]',call_id='$Ccall_id[$h]',queue='$Cqueue[$h]',agent='$Cagent[$h]',verb='COMPLETEAGENT',data1='$Cdata1[$h]',data2='$CALLtime[$h]',data3='$queue_position',serverid='$Cserverid[$h]';";
|
||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$Stime_id[$h]',call_id='$Ccall_id[$h]',queue='$Cqueue[$h]',agent='$Cagent[$h]',verb='COMPLETEAGENT',data1='$Cdata1[$h]',data2='$CALLtime[$h]',data3='$queue_position',serverid='$Cserverid[$h]',data4='$Sdata4[$h]';";
|
||||
if ($TEST < 1)
|
||||
{
|
||||
$Baffected_rows = $dbhB->do($stmtB) or die "ERROR: $stmtB" . DBI->errstr;
|
||||
@@ -1510,7 +1513,7 @@ if ($enable_queuemetrics_logging > 0)
|
||||
|
||||
##############################################################
|
||||
##### grab all queue_log entries for COMPLETEAGENT verb to validate queue
|
||||
$stmtB = "SELECT time_id,call_id,queue,agent,serverid FROM queue_log where verb='COMPLETEAGENT' and serverid='$queuemetrics_log_id' $QM_SQL_time order by time_id;";
|
||||
$stmtB = "SELECT time_id,call_id,queue,agent,serverid,data4 FROM queue_log where verb='COMPLETEAGENT' and serverid='$queuemetrics_log_id' $QM_SQL_time order by time_id;";
|
||||
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
||||
$sthB->execute or die "executing: $stmtB ", $dbhB->errstr;
|
||||
$EQ_records=$sthB->rows;
|
||||
@@ -1519,11 +1522,12 @@ if ($enable_queuemetrics_logging > 0)
|
||||
while ($EQ_records > $h)
|
||||
{
|
||||
@aryB = $sthB->fetchrow_array;
|
||||
$time_id[$h] = "$aryB[0]";
|
||||
$call_id[$h] = "$aryB[1]";
|
||||
$queue[$h] = "$aryB[2]";
|
||||
$agent[$h] = "$aryB[3]";
|
||||
$serverid[$h] = "$aryB[4]";
|
||||
$time_id[$h] = $aryB[0];
|
||||
$call_id[$h] = $aryB[1];
|
||||
$queue[$h] = $aryB[2];
|
||||
$agent[$h] = $aryB[3];
|
||||
$serverid[$h] = $aryB[4];
|
||||
$data4[$h] = $aryB[5];
|
||||
$h++;
|
||||
}
|
||||
$sthB->finish();
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
# exten => h,1,DeadAGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})
|
||||
#
|
||||
#
|
||||
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGELOG:
|
||||
# 61010-1007 - First test build
|
||||
@@ -58,6 +58,7 @@
|
||||
# 100903-0041 - Changed lead_id max length to 10 digits
|
||||
# 101111-1556 - Added source to vicidial_hopper inserts
|
||||
# 101123-0443 - Fixed minor parked call manual dial bug
|
||||
# 110224-1854 - Added compatibility with QM phone environment logging
|
||||
#
|
||||
|
||||
# defaults for PreFork
|
||||
@@ -935,6 +936,7 @@ sub process_request
|
||||
###########################################
|
||||
if ( ($enable_queuemetrics_logging > 0) && ($VD_status !~ /IVR/) )
|
||||
{
|
||||
$data_four='';
|
||||
$VD_agent='NONE';
|
||||
$secX = time();
|
||||
$VD_call_length = ($secX - $VD_start_epoch);
|
||||
@@ -946,19 +948,6 @@ sub process_request
|
||||
|
||||
if ($DBX) {print "CONNECTED TO DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";}
|
||||
|
||||
$stmtB = "SELECT agent from queue_log where call_id='$VD_callerid' and verb='CONNECT';";
|
||||
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
||||
$sthB->execute or die "executing: $stmtB ", $dbhB->errstr;
|
||||
$sthBrows=$sthB->rows;
|
||||
$rec_count=0;
|
||||
while ($sthBrows > $rec_count)
|
||||
{
|
||||
@aryB = $sthB->fetchrow_array;
|
||||
$VD_agent = "$aryB[0]";
|
||||
$rec_count++;
|
||||
}
|
||||
$sthB->finish();
|
||||
|
||||
$secX = time();
|
||||
$Rtarget = ($secX - 21600); # look for VDCL entry within last 6 hours
|
||||
($Rsec,$Rmin,$Rhour,$Rmday,$Rmon,$Ryear,$Rwday,$Ryday,$Risdst) = localtime($Rtarget);
|
||||
@@ -985,6 +974,21 @@ sub process_request
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
$stmtB = "SELECT agent,data4 from queue_log where call_id='$VD_callerid' and verb='CONNECT' order by time_id desc limit 1;";
|
||||
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
||||
$sthB->execute or die "executing: $stmtB ", $dbhB->errstr;
|
||||
$sthBrows=$sthB->rows;
|
||||
$rec_count=0;
|
||||
if ($sthBrows > 0)
|
||||
{
|
||||
@aryB = $sthB->fetchrow_array;
|
||||
$VD_agent = $aryB[0];
|
||||
$data_four = $aryB[1];
|
||||
$rec_count++;
|
||||
}
|
||||
$sthB->finish();
|
||||
if ($AGILOG) {$agi_string = "$VD_agent|$data_four|$stmtB|"; &agi_output;}
|
||||
|
||||
if ($rec_count < 1)
|
||||
{
|
||||
### find current number of calls in this queue to find position when channel hung up
|
||||
@@ -1000,15 +1004,17 @@ sub process_request
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$secX',call_id='$VD_callerid',queue='$VD_campaign_id',agent='$VD_agent',verb='ABANDON',data1='$current_position',data2='$queue_position',data3='$VD_stage',serverid='$queuemetrics_log_id';";
|
||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$secX',call_id='$VD_callerid',queue='$VD_campaign_id',agent='$VD_agent',verb='ABANDON',data1='$current_position',data2='$queue_position',data3='$VD_stage',serverid='$queuemetrics_log_id',data4='$data_four';";
|
||||
$Baffected_rows = $dbhB->do($stmtB);
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$secX',call_id='$VD_callerid',queue='$VD_campaign_id',agent='$VD_agent',verb='COMPLETECALLER',data1='$VD_stage',data2='$VD_call_length',data3='$queue_position',serverid='$queuemetrics_log_id';";
|
||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$secX',call_id='$VD_callerid',queue='$VD_campaign_id',agent='$VD_agent',verb='COMPLETECALLER',data1='$VD_stage',data2='$VD_call_length',data3='$queue_position',serverid='$queuemetrics_log_id',data4='$data_four';";
|
||||
$Baffected_rows = $dbhB->do($stmtB);
|
||||
}
|
||||
|
||||
if ($AGILOG) {$agi_string = "|$stmtB|"; &agi_output;}
|
||||
|
||||
$dbhB->disconnect();
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +123,8 @@ rebuild_music_on_hold ENUM('Y','N') default 'Y',
|
||||
active_agent_login_server ENUM('Y','N') default 'Y',
|
||||
conf_secret VARCHAR(20) default 'test',
|
||||
external_server_ip VARCHAR(100) default '',
|
||||
custom_dialplan_entry TEXT
|
||||
custom_dialplan_entry TEXT,
|
||||
active_twin_server_ip VARCHAR(15) default ''
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX server_id on servers (server_id);
|
||||
@@ -788,7 +789,8 @@ lead_order_secondary ENUM('LEAD_ASCEND','LEAD_DESCEND','CALLTIME_ASCEND','CALLTI
|
||||
per_call_notes ENUM('ENABLED','DISABLED') default 'DISABLED',
|
||||
my_callback_option ENUM('CHECKED','UNCHECKED') default 'UNCHECKED',
|
||||
agent_lead_search ENUM('ENABLED','DISABLED') default 'DISABLED',
|
||||
agent_lead_search_method VARCHAR(30) default 'CAMPLISTS_ALL'
|
||||
agent_lead_search_method VARCHAR(30) default 'CAMPLISTS_ALL',
|
||||
queuemetrics_phone_environment VARCHAR(20) default ''
|
||||
);
|
||||
|
||||
CREATE TABLE vicidial_lists (
|
||||
@@ -2440,7 +2442,7 @@ ALTER TABLE vicidial_call_notes_archive MODIFY notesid INT(9) UNSIGNED NOT NULL;
|
||||
CREATE TABLE vicidial_lead_search_log_archive LIKE vicidial_lead_search_log;
|
||||
ALTER TABLE vicidial_lead_search_log_archive MODIFY search_log_id INT(9) UNSIGNED NOT NULL;
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1262',db_schema_update_date=NOW();
|
||||
UPDATE system_settings SET db_schema_version='1263',db_schema_update_date=NOW();
|
||||
|
||||
GRANT RELOAD ON *.* TO cron@'%';
|
||||
GRANT RELOAD ON *.* TO cron@localhost;
|
||||
|
||||
@@ -690,3 +690,9 @@ ALTER TABLE vicidial_campaigns MODIFY agent_lead_search_method VARCHAR(30) defau
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1262',db_schema_update_date=NOW();
|
||||
|
||||
ALTER TABLE vicidial_campaigns ADD queuemetrics_phone_environment VARCHAR(20) default '';
|
||||
|
||||
ALTER TABLE servers ADD active_twin_server_ip VARCHAR(15) default '';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1263',db_schema_update_date=NOW();
|
||||
|
||||
|
||||
@@ -533,6 +533,10 @@ Used for Answering Machine Detection after that same behavior as||
|
||||
Used for press-1, broadcast and survey campaigns with Cepstral Text-to-speech||
|
||||
Used for Answering Machine Detection then press-1, broadcast and survey campaigns with Cepstral Text-to-speech||
|
||||
One of these options with USER_ in front will only search within leads that have the owner field matching the user ID of the agent, the options with GROUP_ in front will only search within leads that have the owner field matching the user group that the user is a member of, the options with TERRITORY_ in front will only search within leads that have the owner field matching the territories that the agent has selected||
|
||||
QM Phone Environment||
|
||||
If QueueMetrics integration is enabled in the system settings then this setting allow the insertion of this data value in the data4 field of the queue_log for agent activity records. Default is empty for disabled||
|
||||
Active Twin Server IP||
|
||||
Some vicidial systems require setting up vicidial servers in pairs. This setting is where you can put the server IP of another vicidial server that this server is twinned with. Default is empty for disabled||
|
||||
|
||||
|
||||
AST_LISTS_campaign_stats.php
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# api.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 as an API(Application Programming Interface) to allow
|
||||
# other programs to interact with the VICIDIAL Agent screen
|
||||
@@ -50,10 +50,11 @@
|
||||
# 100527-0926 - Added send_dtmf, transfer_conference and park_call functions
|
||||
# 100914-1538 - Fixed bug in change_ingroups function
|
||||
# 101123-1050 - Added manual dial queue features to external_dial function
|
||||
# 110224-1711 - Added compatibility with QM phone environment logging
|
||||
#
|
||||
|
||||
$version = '2.4-17';
|
||||
$build = '101123-1050';
|
||||
$version = '2.4-18';
|
||||
$build = '110224-1711';
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
@@ -1991,7 +1992,18 @@ if ($function == 'ra_call_control')
|
||||
$ra_stage = preg_replace("/XFER|CLOSER|-/",'',$ra_stage);
|
||||
if ($ra_stage < 0.25) {$ra_stage=0;}
|
||||
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$value',queue='$campaign_id',agent='Agent/$ra_user',verb='COMPLETEAGENT',data1='$ra_stage',data2='$ra_length',data3='$queue_position',serverid='$queuemetrics_log_id';";
|
||||
$data4SQL='';
|
||||
$stmt="SELECT queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id='$campaign_id' and queuemetrics_phone_environment!='';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$cqpe_ct = mysql_num_rows($rslt);
|
||||
if ($cqpe_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$data4SQL = ",data4='$row[0]'";
|
||||
}
|
||||
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$value',queue='$campaign_id',agent='Agent/$ra_user',verb='COMPLETEAGENT',data1='$ra_stage',data2='$ra_length',data3='$queue_position',serverid='$queuemetrics_log_id' $data4SQL;";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
|
||||
@@ -1999,11 +2011,11 @@ if ($function == 'ra_call_control')
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$ra_user',verb='PAUSEALL',serverid='$queuemetrics_log_id';";
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$ra_user',verb='PAUSEALL',serverid='$queuemetrics_log_id' $data4SQL;";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$ra_user',verb='UNPAUSEALL',serverid='$queuemetrics_log_id';";
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$ra_user',verb='UNPAUSEALL',serverid='$queuemetrics_log_id' $data4SQL;";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# manager_send.php version 2.4
|
||||
#
|
||||
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server
|
||||
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
|
||||
@@ -44,6 +44,7 @@
|
||||
# - $alertCID - ('0','1')
|
||||
# - $preset_name = ('TESTING PRESET',...)
|
||||
# - $call_variables = ('Variable: vendor_lead_code=1234|campaign=TESTCAMP|...')
|
||||
# - $log_campaign
|
||||
#
|
||||
# CHANGELOG:
|
||||
# 50401-1002 - First build of script, Hangup function only
|
||||
@@ -105,11 +106,13 @@
|
||||
# 101024-1638 - Added park_log logging for parked calls
|
||||
# 101107-2331 - Added CALLERONHOLD/CALLEROFFHOLD queue_log entries
|
||||
# 101125-1018 - Added call_variables Originate variables
|
||||
# 110224-1710 - Added compatibility with QM phone environment logging
|
||||
#
|
||||
|
||||
$version = '2.4-54';
|
||||
$build = '101125-1018';
|
||||
$version = '2.4-55';
|
||||
$build = '110224-1710';
|
||||
$mel=1; # Mysql Error Log enabled = 1
|
||||
$mysql_log_count=115;
|
||||
$mysql_log_count=116;
|
||||
$one_mysql_log=0;
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -201,6 +204,8 @@ if (isset($_GET["preset_name"])) {$preset_name=$_GET["preset_name"];}
|
||||
elseif (isset($_POST["preset_name"])) {$preset_name=$_POST["preset_name"];}
|
||||
if (isset($_GET["call_variables"])) {$call_variables=$_GET["call_variables"];}
|
||||
elseif (isset($_POST["call_variables"])) {$call_variables=$_POST["call_variables"];}
|
||||
if (isset($_GET["log_campaign"])) {$log_campaign=$_GET["log_campaign"];}
|
||||
elseif (isset($_POST["log_campaign"])) {$log_campaign=$_POST["log_campaign"];}
|
||||
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
@@ -718,8 +723,20 @@ if ($ACTION=="Hangup")
|
||||
if ($time_id > 100000)
|
||||
{$secondS = ($StarTtime - $time_id);}
|
||||
|
||||
$data4SQL='';
|
||||
$stmt="SELECT queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id='$log_campaign' and queuemetrics_phone_environment!='';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02116',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$cqpe_ct = mysql_num_rows($rslt);
|
||||
if ($cqpe_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$data4SQL = ",data4='$row[0]'";
|
||||
}
|
||||
|
||||
if ($format=='debug') {echo "\n<!-- $caller_complete|$stmt -->";}
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$CalLCID',queue='$CLcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$secondS',data3='$CLqueue_position',serverid='$queuemetrics_log_id';";
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$CalLCID',queue='$CLcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$secondS',data3='$CLqueue_position',serverid='$queuemetrics_log_id' $data4SQL;";
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02019',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$affected_rows = mysql_affected_rows($linkB);
|
||||
|
||||
@@ -274,12 +274,13 @@
|
||||
# 110215-1125 - Added support for call_notes
|
||||
# 110218-1519 - Added support for agent lead search
|
||||
# 110222-2228 - Added owner restriction to agent lead search
|
||||
# 110224-1712 - Added compatibility with QM phone environment logging and QM pause code last call logging
|
||||
#
|
||||
|
||||
$version = '2.4-179';
|
||||
$build = '110222-2228';
|
||||
$version = '2.4-180';
|
||||
$build = '110224-1712';
|
||||
$mel=1; # Mysql Error Log enabled = 1
|
||||
$mysql_log_count=387;
|
||||
$mysql_log_count=396;
|
||||
$one_mysql_log=0;
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -949,7 +950,19 @@ if ($ACTION == 'regCLOSER')
|
||||
|
||||
if ( ($enable_queuemetrics_logging > 0) and ($queuemetrics_addmember_enabled > 0) )
|
||||
{
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$in_groups[$k]',agent='Agent/$user',verb='ADDMEMBER2',data1='$qm_phone',serverid='$queuemetrics_log_id';";
|
||||
$data4SQL='';
|
||||
$stmt="SELECT queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id='$campaign' and queuemetrics_phone_environment!='';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00388',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$cqpe_ct = mysql_num_rows($rslt);
|
||||
if ($cqpe_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$data4SQL = ",data4='$row[0]'";
|
||||
}
|
||||
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$in_groups[$k]',agent='Agent/$user',verb='ADDMEMBER2',data1='$qm_phone',serverid='$queuemetrics_log_id' $data4SQL;";
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'0350',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$affected_rows = mysql_affected_rows($linkB);
|
||||
@@ -2328,25 +2341,37 @@ if ($ACTION == 'manDiaLnextCaLL')
|
||||
###########################################
|
||||
if ($enable_queuemetrics_logging > 0)
|
||||
{
|
||||
$data4SQL='';
|
||||
$stmt="SELECT queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id='$campaign' and queuemetrics_phone_environment!='';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00389',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$cqpe_ct = mysql_num_rows($rslt);
|
||||
if ($cqpe_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$data4SQL = ",data4='$row[0]'";
|
||||
}
|
||||
|
||||
$linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass");
|
||||
mysql_select_db("$queuemetrics_dbname", $linkB);
|
||||
|
||||
# UNPAUSEALL
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='UNPAUSEALL',serverid='$queuemetrics_log_id';";
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='UNPAUSEALL',serverid='$queuemetrics_log_id' $data4SQL;";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00038',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$affected_rows = mysql_affected_rows($linkB);
|
||||
|
||||
# CALLOUTBOUND (formerly ENTERQUEUE)
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='NONE',verb='CALLOUTBOUND',data2='$agent_dialed_number',serverid='$queuemetrics_log_id';";
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='NONE',verb='CALLOUTBOUND',data2='$agent_dialed_number',serverid='$queuemetrics_log_id' $data4SQL;";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00039',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$affected_rows = mysql_affected_rows($linkB);
|
||||
|
||||
# CONNECT
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='Agent/$user',verb='CONNECT',data1='0',serverid='$queuemetrics_log_id';";
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='Agent/$user',verb='CONNECT',data1='0',serverid='$queuemetrics_log_id' $data4SQL;";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00040',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -2914,25 +2939,37 @@ if ($ACTION == 'manDiaLonly')
|
||||
###########################################
|
||||
if ($enable_queuemetrics_logging > 0)
|
||||
{
|
||||
$data4SQL='';
|
||||
$stmt="SELECT queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id='$campaign' and queuemetrics_phone_environment!='';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00390',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$cqpe_ct = mysql_num_rows($rslt);
|
||||
if ($cqpe_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$data4SQL = ",data4='$row[0]'";
|
||||
}
|
||||
|
||||
$linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass");
|
||||
mysql_select_db("$queuemetrics_dbname", $linkB);
|
||||
|
||||
# UNPAUSEALL
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='UNPAUSEALL',serverid='$queuemetrics_log_id';";
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='UNPAUSEALL',serverid='$queuemetrics_log_id' $data4SQL;";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00049',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$affected_rows = mysql_affected_rows($linkB);
|
||||
|
||||
# CALLOUTBOUND (formerly ENTERQUEUE)
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='NONE',verb='CALLOUTBOUND',data2='$phone_number',serverid='$queuemetrics_log_id';";
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='NONE',verb='CALLOUTBOUND',data2='$phone_number',serverid='$queuemetrics_log_id' $data4SQL;";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00050',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$affected_rows = mysql_affected_rows($linkB);
|
||||
|
||||
# CONNECT
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='Agent/$user',verb='CONNECT',data1='0',serverid='$queuemetrics_log_id';";
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='Agent/$user',verb='CONNECT',data1='0',serverid='$queuemetrics_log_id' $data4SQL;";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00051',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -3705,7 +3742,19 @@ if ($stage == "end")
|
||||
{
|
||||
if ($enable_queuemetrics_logging > 0)
|
||||
{
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PAUSEALL',serverid='$queuemetrics_log_id';";
|
||||
$data4SQL='';
|
||||
$stmt="SELECT queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id='$campaign' and queuemetrics_phone_environment!='';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00391',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$cqpe_ct = mysql_num_rows($rslt);
|
||||
if ($cqpe_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$data4SQL = ",data4='$row[0]'";
|
||||
}
|
||||
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PAUSEALL',serverid='$queuemetrics_log_id' $data4SQL;";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00083',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -3743,7 +3792,19 @@ if ($stage == "end")
|
||||
$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='$CLqueue_position',serverid='$queuemetrics_log_id';";
|
||||
$data4SQL='';
|
||||
$stmt="SELECT queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id='$campaign' and queuemetrics_phone_environment!='';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00392',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$cqpe_ct = mysql_num_rows($rslt);
|
||||
if ($cqpe_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$data4SQL = ",data4='$row[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='$CLqueue_position',serverid='$queuemetrics_log_id' $data4SQL;";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00085',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -3778,7 +3839,7 @@ if ($stage == "end")
|
||||
{
|
||||
if ($enable_queuemetrics_logging > 0)
|
||||
{
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PAUSEALL',serverid='$queuemetrics_log_id';";
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PAUSEALL',serverid='$queuemetrics_log_id' $data4SQL;";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00088',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -3946,7 +4007,19 @@ if ($stage == "end")
|
||||
if (strlen($VDqueue_position) < 1)
|
||||
{$VDqueue_position=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='$VDqueue_position',serverid='$queuemetrics_log_id';";
|
||||
$data4SQL='';
|
||||
$stmt="SELECT queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id='$campaign' and queuemetrics_phone_environment!='';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00393',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$cqpe_ct = mysql_num_rows($rslt);
|
||||
if ($cqpe_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$data4SQL = ",data4='$row[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='$VDqueue_position',serverid='$queuemetrics_log_id' $data4SQL;";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00094',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -5546,12 +5619,24 @@ if ($ACTION == 'userLOGout')
|
||||
$i++;
|
||||
}
|
||||
|
||||
$data4SQL='';
|
||||
$stmt="SELECT queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id='$campaign' and queuemetrics_phone_environment!='';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00394',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$cqpe_ct = mysql_num_rows($rslt);
|
||||
if ($cqpe_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$data4SQL = ",data4='$row[0]'";
|
||||
}
|
||||
|
||||
$time_logged_in = ($StarTtime - $logintime);
|
||||
if ($time_logged_in > 1000000) {$time_logged_in=1;}
|
||||
|
||||
if ($queuemetrics_loginout != 'NONE')
|
||||
{
|
||||
$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';";
|
||||
$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' $data4SQL;";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$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);}
|
||||
@@ -5560,6 +5645,14 @@ if ($ACTION == 'userLOGout')
|
||||
|
||||
if ($queuemetrics_addmember_enabled > 0)
|
||||
{
|
||||
if ($queuemetrics_loginout == 'NONE')
|
||||
{
|
||||
$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='LOGOFF';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00396',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$affected_rows = mysql_affected_rows($linkB);
|
||||
}
|
||||
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;";
|
||||
@@ -5574,7 +5667,7 @@ if ($ACTION == 'userLOGout')
|
||||
$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') and queue != '$campaign' order by time_id desc;";
|
||||
$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 ($DB) {echo "$stmt\n";}
|
||||
@@ -5588,10 +5681,15 @@ if ($ACTION == 'userLOGout')
|
||||
$i++;
|
||||
}
|
||||
|
||||
### add the logged-in campaign as well
|
||||
$AMqueue[$i] = $campaign;
|
||||
$i++;
|
||||
$amq_conf_ct++;
|
||||
|
||||
$i=0;
|
||||
while ($i < $amq_conf_ct)
|
||||
{
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$AMqueue[$i]',agent='Agent/$user',verb='REMOVEMEMBER',data1='$loginphone',serverid='$queuemetrics_log_id';";
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$AMqueue[$i]',agent='Agent/$user',verb='REMOVEMEMBER',data1='$loginphone',serverid='$queuemetrics_log_id' $data4SQL;";
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00352',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$affected_rows = mysql_affected_rows($linkB);
|
||||
@@ -7151,7 +7249,19 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') )
|
||||
$user_group = trim("$row[0]");
|
||||
}
|
||||
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='$QMstatus',serverid='$queuemetrics_log_id';";
|
||||
$data4SQL='';
|
||||
$stmt="SELECT queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id='$campaign' and queuemetrics_phone_environment!='';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00395',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$cqpe_ct = mysql_num_rows($rslt);
|
||||
if ($cqpe_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$data4SQL = ",data4='$row[0]'";
|
||||
}
|
||||
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='$QMstatus',serverid='$queuemetrics_log_id' $data4SQL;";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00168',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -7392,10 +7502,12 @@ if ($ACTION == 'PauseCodeSubmit')
|
||||
}
|
||||
if ($enable_queuemetrics_logging > 0)
|
||||
{
|
||||
$pause_call_id='NONE';
|
||||
if (strlen($campaign_cid) > 12) {$pause_call_id = $campaign_cid;}
|
||||
$linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass");
|
||||
mysql_select_db("$queuemetrics_dbname", $linkB);
|
||||
|
||||
$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='$status';";
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$pause_call_id',queue='NONE',agent='Agent/$user',verb='PAUSEREASON',serverid='$queuemetrics_log_id',data1='$status';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00177',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
@@ -336,12 +336,13 @@
|
||||
# 110215-1412 - Added my_callback_option and per_call_notes options
|
||||
# 110218-1522 - Added agent_lead_search feature
|
||||
# 110221-1251 - Changed statuses display to keep track of non-selectable statuses
|
||||
# 110224-1713 - Added compatibility with QM phone environment logging, QM pause code last call logging and active server twin check
|
||||
#
|
||||
|
||||
$version = '2.4-313';
|
||||
$build = '110221-1251';
|
||||
$version = '2.4-314c';
|
||||
$build = '110224-1713';
|
||||
$mel=1; # Mysql Error Log enabled = 1
|
||||
$mysql_log_count=69;
|
||||
$mysql_log_count=71;
|
||||
$one_mysql_log=0;
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -1322,7 +1323,7 @@ else
|
||||
$HKstatusnames = substr("$HKstatusnames", 0, -1);
|
||||
|
||||
##### grab the campaign settings
|
||||
$stmt="SELECT park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,agent_pause_codes_active,no_hopper_leads_logins,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,use_campaign_dnc,three_way_call_cid,dial_method,three_way_dial_prefix,web_form_target,vtiger_screen_login,agent_allow_group_alias,default_group_alias,quick_transfer_button,prepopulate_transfer_preset,view_calls_in_queue,view_calls_in_queue_launch,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,manual_preview_dial,api_manual_dial,manual_dial_call_time_check,my_callback_option,per_call_notes,agent_lead_search,agent_lead_search_method FROM vicidial_campaigns where campaign_id = '$VD_campaign';";
|
||||
$stmt="SELECT park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,agent_pause_codes_active,no_hopper_leads_logins,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,use_campaign_dnc,three_way_call_cid,dial_method,three_way_dial_prefix,web_form_target,vtiger_screen_login,agent_allow_group_alias,default_group_alias,quick_transfer_button,prepopulate_transfer_preset,view_calls_in_queue,view_calls_in_queue_launch,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,manual_preview_dial,api_manual_dial,manual_dial_call_time_check,my_callback_option,per_call_notes,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id = '$VD_campaign';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01013',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
@@ -1415,6 +1416,7 @@ else
|
||||
$per_call_notes = $row[85];
|
||||
$agent_lead_search = $row[86];
|
||||
$agent_lead_search_method = $row[87];
|
||||
$qm_phone_environment = $row[88];
|
||||
|
||||
if ( ($VU_agent_lead_search_override == 'ENABLED') or ($VU_agent_lead_search_override == 'DISABLED') )
|
||||
{$agent_lead_search = $VU_agent_lead_search_override;}
|
||||
@@ -1893,6 +1895,24 @@ else
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01023',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$rowy=mysql_fetch_row($rslt);
|
||||
|
||||
### find out if this server has a twin
|
||||
$twin_not_live=0;
|
||||
$stmt="SELECT active_twin_server_ip from servers where server_ip = '$rowx[0]';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01070',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$rowyy=mysql_fetch_row($rslt);
|
||||
if (strlen($rowyy[0]) > 4)
|
||||
{
|
||||
### find out whether the twin server_updater is running
|
||||
$stmt="SELECT count(*) from server_updater where server_ip = '$rowyy[0]' and last_update > '$past_minutes_date';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01071',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$rowyz=mysql_fetch_row($rslt);
|
||||
if ($rowyz[0] < 1) {$twin_not_live=1;}
|
||||
}
|
||||
|
||||
### find out whether the server_updater is running
|
||||
$stmt="SELECT count(*) from server_updater where server_ip = '$rowx[0]' and last_update > '$past_minutes_date';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
@@ -1900,11 +1920,11 @@ else
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01024',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$rowz=mysql_fetch_row($rslt);
|
||||
|
||||
$pb_log .= "$phones_auto[$pb]|$rowx[0]|$row[0]|$rowy[0]|$rowz[0]| ";
|
||||
$pb_log .= "$phones_auto[$pb]|$rowx[0]|$row[0]|$rowy[0]|$rowz[0]|$twin_not_live| ";
|
||||
|
||||
if ( ($rowy[0] > 0) && ($rowz[0] > 0) )
|
||||
if ( ($rowy[0] > 0) and ($rowz[0] > 0) and ($twin_not_live < 1) )
|
||||
{
|
||||
if ( ($pb_count >= $row[0]) || (strlen($pb_server_ip) < 4) )
|
||||
if ( ($pb_count >= $row[0]) or (strlen($pb_server_ip) < 4) )
|
||||
{
|
||||
$pb_count=$row[0];
|
||||
$pb_server_ip=$rowx[0];
|
||||
@@ -2360,7 +2380,7 @@ else
|
||||
|
||||
if ($queuemetrics_loginout!='NONE')
|
||||
{
|
||||
$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';";
|
||||
$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',data4='$qm_phone_environment';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01045',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -2368,7 +2388,7 @@ else
|
||||
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',data4='$qm_phone_environment';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01046',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -2377,7 +2397,7 @@ else
|
||||
|
||||
if ($queuemetrics_addmember_enabled > 0)
|
||||
{
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='$VD_campaign',agent='Agent/$VD_login',verb='ADDMEMBER2',data1='$QM_PHONE',serverid='$queuemetrics_log_id';";
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='$VD_campaign',agent='Agent/$VD_login',verb='ADDMEMBER2',data1='$QM_PHONE',serverid='$queuemetrics_log_id',data4='$qm_phone_environment';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01069',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -2420,7 +2440,7 @@ else
|
||||
|
||||
if ($queuemetrics_loginout!='NONE')
|
||||
{
|
||||
$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';";
|
||||
$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',data4='$qm_phone_environment';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01048',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -2428,7 +2448,7 @@ else
|
||||
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',data4='$qm_phone_environment';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01049',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -3249,6 +3269,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
var per_call_notes='<?php echo $per_call_notes ?>';
|
||||
var agent_lead_search='<?php echo $agent_lead_search ?>';
|
||||
var agent_lead_search_method='<?php echo $agent_lead_search_method ?>';
|
||||
var qm_phone_environment='<?php echo $qm_phone_environment ?>';
|
||||
var LastCallCID='';
|
||||
var DiaLControl_auto_HTML = "<img src=\"./images/vdc_LB_pause_OFF.gif\" border=\"0\" alt=\" Pause \" /><a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready');\"><img src=\"./images/vdc_LB_resume.gif\" border=\"0\" alt=\"Resume\" /></a>";
|
||||
var DiaLControl_auto_HTML_ready = "<a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADpause');\"><img src=\"./images/vdc_LB_pause.gif\" border=\"0\" alt=\" Pause \" /></a><img src=\"./images/vdc_LB_resume_OFF.gif\" border=\"0\" alt=\"Resume\" />";
|
||||
var DiaLControl_auto_HTML_OFF = "<img src=\"./images/vdc_LB_pause_OFF.gif\" border=\"0\" alt=\" Pause \" /><img src=\"./images/vdc_LB_resume_OFF.gif\" border=\"0\" alt=\"Resume\" />";
|
||||
@@ -3341,7 +3363,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
{
|
||||
var queryCID = "HLagcW" + epoch_sec + user_abb;
|
||||
var hangupvalue = taskvar;
|
||||
livehangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Hangup&format=text&channel=" + hangupvalue + "&queryCID=" + queryCID;
|
||||
livehangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Hangup&format=text&channel=" + hangupvalue + "&queryCID=" + queryCID + "&log_campaign=" + campaign;
|
||||
xmlhttp.open('POST', 'manager_send.php');
|
||||
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
|
||||
xmlhttp.send(livehangup_query);
|
||||
@@ -5942,6 +5964,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
|
||||
|
||||
var MDnextResponse_array=MDnextResponse.split("\n");
|
||||
MDnextCID = MDnextResponse_array[0];
|
||||
LastCallCID = MDnextResponse_array[0];
|
||||
|
||||
var regMNCvar = new RegExp("HOPPER EMPTY","ig");
|
||||
var regMDFvarDNC = new RegExp("DNC","ig");
|
||||
@@ -6427,6 +6450,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
|
||||
|
||||
var MDOnextResponse_array=MDOnextResponse.split("\n");
|
||||
MDnextCID = MDOnextResponse_array[0];
|
||||
LastCallCID = MDOnextResponse_array[0];
|
||||
agent_log_id = MDOnextResponse_array[1];
|
||||
if (MDnextCID == " CALL NOT PLACED")
|
||||
{
|
||||
@@ -6892,6 +6916,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
|
||||
document.vicidial_form.uniqueid.value = VDIC_data_VDAC[1];
|
||||
CIDcheck = VDIC_data_VDAC[2];
|
||||
CalLCID = VDIC_data_VDAC[2];
|
||||
LastCallCID = VDIC_data_VDAC[2];
|
||||
document.getElementById("callchannel").innerHTML = VDIC_data_VDAC[3];
|
||||
lastcustchannel = VDIC_data_VDAC[3];
|
||||
document.vicidial_form.callserverip.value = VDIC_data_VDAC[4];
|
||||
@@ -7440,7 +7465,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
|
||||
var queryCID = "HLvdcW" + epoch_sec + user_abb;
|
||||
var hangupvalue = customer_channel;
|
||||
// alert(auto_dial_level + "|" + CalLCID + "|" + customer_server_ip + "|" + hangupvalue + "|" + VD_live_call_secondS);
|
||||
custhangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=Hangup&format=text&user=" + user + "&pass=" + pass + "&channel=" + hangupvalue + "&call_server_ip=" + customer_server_ip + "&queryCID=" + queryCID + "&auto_dial_level=" + auto_dial_level + "&CalLCID=" + CalLCID + "&secondS=" + VD_live_call_secondS + "&exten=" + session_id + "&campaign=" + group + "&stage=CALLHANGUP&nodeletevdac=" + nodeletevdac;
|
||||
custhangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=Hangup&format=text&user=" + user + "&pass=" + pass + "&channel=" + hangupvalue + "&call_server_ip=" + customer_server_ip + "&queryCID=" + queryCID + "&auto_dial_level=" + auto_dial_level + "&CalLCID=" + CalLCID + "&secondS=" + VD_live_call_secondS + "&exten=" + session_id + "&campaign=" + group + "&stage=CALLHANGUP&nodeletevdac=" + nodeletevdac + "&log_campaign=" + campaign;
|
||||
xmlhttp.open('POST', 'manager_send.php');
|
||||
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
|
||||
xmlhttp.send(custhangup_query);
|
||||
@@ -7685,7 +7710,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
|
||||
{
|
||||
var queryCID = "HXvdcW" + epoch_sec + user_abb;
|
||||
var hangupvalue = xfer_channel;
|
||||
custhangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=Hangup&format=text&user=" + user + "&pass=" + pass + "&channel=" + hangupvalue + "&queryCID=" + queryCID;
|
||||
custhangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=Hangup&format=text&user=" + user + "&pass=" + pass + "&channel=" + hangupvalue + "&queryCID=" + queryCID + "&log_campaign=" + campaign;
|
||||
xmlhttp.open('POST', 'manager_send.php');
|
||||
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
|
||||
xmlhttp.send(custhangup_query);
|
||||
@@ -7759,7 +7784,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
|
||||
if (xmlhttp)
|
||||
{
|
||||
var queryCID = "HTvdcW" + epoch_sec + user_abb;
|
||||
custhangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=HangupConfDial&format=text&user=" + user + "&pass=" + pass + "&exten=" + session_id + "&ext_context=" + ext_context + "&queryCID=" + queryCID;
|
||||
custhangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=HangupConfDial&format=text&user=" + user + "&pass=" + pass + "&exten=" + session_id + "&ext_context=" + ext_context + "&queryCID=" + queryCID + "&log_campaign=" + campaign;
|
||||
xmlhttp.open('POST', 'manager_send.php');
|
||||
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
|
||||
xmlhttp.send(custhangup_query);
|
||||
@@ -8418,7 +8443,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
|
||||
}
|
||||
if (xmlhttp)
|
||||
{
|
||||
VMCpausecode_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=PauseCodeSubmit&format=text&status=" + newpausecode + "&agent_log_id=" + agent_log_id + "&campaign=" + campaign + "&extension=" + extension + "&protocol=" + protocol + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&stage=" + pause_code_counter;
|
||||
VMCpausecode_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=PauseCodeSubmit&format=text&status=" + newpausecode + "&agent_log_id=" + agent_log_id + "&campaign=" + campaign + "&extension=" + extension + "&protocol=" + protocol + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&stage=" + pause_code_counter + "&campaign_cid=" + LastCallCID;
|
||||
pause_code_counter++;
|
||||
xmlhttp.open('POST', 'vdc_db_query.php');
|
||||
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
|
||||
@@ -8432,12 +8457,14 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
|
||||
var check_PC_array=check_pause_code.split("\n");
|
||||
if (check_PC_array[1] == 'Next agent_log_id:')
|
||||
{agent_log_id = check_PC_array[2];}
|
||||
// alert(VMCpausecode_query);
|
||||
// alert(xmlhttp.responseText + "\n|" + check_PC_array[1] + "\n|" + check_PC_array[2] + "|" + agent_log_id + "|" + pause_code_counter);
|
||||
}
|
||||
}
|
||||
delete xmlhttp;
|
||||
}
|
||||
// return agent_log_id;
|
||||
LastCallCID='';
|
||||
scroll(0,0);
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -17,6 +17,7 @@
|
||||
# 100309-0544 - Added queuemetrics_loginout option
|
||||
# 101108-0032 - Added ADDMEMBER queue_log code
|
||||
# 110124-1134 - Small query fix for large queue_log tables
|
||||
# 110224-2350 - Small QM logout fix
|
||||
#
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
@@ -373,6 +374,14 @@ if ($stage == "log_agent_out")
|
||||
$agent_logged_in='';
|
||||
$time_logged_in='0';
|
||||
|
||||
if ($queuemetrics_loginout == 'NONE')
|
||||
{
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='Agent/" . mysql_real_escape_string($user) . "',verb='PAUSEREASON',serverid='$queuemetrics_log_id',data1='LOGOFF';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
$affected_rows = mysql_affected_rows($linkB);
|
||||
}
|
||||
|
||||
$stmtB = "SELECT agent,time_id,data1 FROM queue_log where agent='Agent/" . mysql_real_escape_string($user) . "' and verb IN('AGENTLOGIN','AGENTCALLBACKLOGIN') and time_id > $check_time order by time_id desc limit 1;";
|
||||
$rsltB=mysql_query($stmtB, $linkB);
|
||||
if ($DB) {echo "<BR>$stmtB\n";}
|
||||
@@ -391,7 +400,18 @@ if ($stage == "log_agent_out")
|
||||
|
||||
if ($queuemetrics_addmember_enabled > 0)
|
||||
{
|
||||
$stmt = "SELECT distinct queue FROM queue_log where time_id >= $RAWtime_logged_in and agent='$agent_logged_in' and verb IN('ADDMEMBER','ADDMEMBER2') order by time_id desc;";
|
||||
$queuemetrics_phone_environment='';
|
||||
$stmt = "SELECT queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id='$VLA_campaign_id';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "<BR>$stmt\n";}
|
||||
$cqpe_ct = mysql_num_rows($rslt);
|
||||
if ($cqpe_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$queuemetrics_phone_environment = $row[0];
|
||||
}
|
||||
|
||||
$stmt = "SELECT distinct queue FROM queue_log where time_id >= $RAWtime_logged_in and agent='$agent_logged_in' and verb IN('ADDMEMBER','ADDMEMBER2') and queue != '$VLA_campaign_id' order by time_id desc;";
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$amq_conf_ct = mysql_num_rows($rslt);
|
||||
@@ -403,19 +423,27 @@ if ($stage == "log_agent_out")
|
||||
$i++;
|
||||
}
|
||||
|
||||
### add the logged-in campaign as well
|
||||
$AMqueue[$i] = $VLA_campaign_id;
|
||||
$i++;
|
||||
$amq_conf_ct++;
|
||||
|
||||
$i=0;
|
||||
while ($i < $amq_conf_ct)
|
||||
{
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='$AMqueue[$i]',agent='$agent_logged_in',verb='REMOVEMEMBER',data1='$phone_logged_in',serverid='$queuemetrics_log_id';";
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='$AMqueue[$i]',agent='$agent_logged_in',verb='REMOVEMEMBER',data1='$phone_logged_in',serverid='$queuemetrics_log_id',data4='$queuemetrics_phone_environment';";
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
$affected_rows = mysql_affected_rows($linkB);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='$QM_LOGOFF',serverid='$queuemetrics_log_id',data1='$phone_logged_in',data2='$time_logged_in';";
|
||||
if ($DB) {echo "<BR>$stmtB\n";}
|
||||
$rsltB=mysql_query($stmtB, $linkB);
|
||||
if ($queuemetrics_loginout != 'NONE')
|
||||
{
|
||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='$QM_LOGOFF',serverid='$queuemetrics_log_id',data1='$phone_logged_in',data2='$time_logged_in';";
|
||||
if ($DB) {echo "<BR>$stmtB\n";}
|
||||
$rsltB=mysql_query($stmtB, $linkB);
|
||||
}
|
||||
}
|
||||
|
||||
echo "Agent $user - $full_name has been emergency logged out, make sure they close their web browser<BR>\n";
|
||||
|
||||
Reference in New Issue
Block a user