diff --git a/agi/agi-VDAD_ALL_inbound.agi b/agi/agi-VDAD_ALL_inbound.agi index 7b24f4c6..81191fd0 100644 --- a/agi/agi-VDAD_ALL_inbound.agi +++ b/agi/agi-VDAD_ALL_inbound.agi @@ -85,6 +85,7 @@ # 81002-1120 - Added processing for DID forwarded calls # 81011-1019 - Added option for press 1 to leave voicemail if wait time > hold-time-option-seconds # 81020-0237 - Added term_reason logging for all possible exits of the script +# 81021-2315 - Changed and add queue_log logging # $script = 'agi-VDAD_ALL_inbound.agi'; @@ -1559,7 +1560,15 @@ if ($hold_recall_xfer_group !~ /NONE/) 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='$YqueryCID',queue='$channel_group',agent='NONE',verb='TRANSFER',data1='$DROPexten',data2='$ext_context',data3='1',data4='1',serverid='$queuemetrics_log_id';"; + $place=0; + if ($rec_countWAIT > 0) {$place = $rec_countWAIT;} + if ($rec_countWAITrem > 0) {$place = $rec_countWAITrem;} + $place++; + + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$YqueryCID',queue='$channel_group',agent='NONE',verb='EXITWITHKEY',data1='3',data2='$place',serverid='$queuemetrics_log_id';"; + $Baffected_rows = $dbhB->do($stmtB); + + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$YqueryCID',queue='$channel_group',agent='NONE',verb='CALLSTATUS',data1='HXFER',serverid='$queuemetrics_log_id';"; $Baffected_rows = $dbhB->do($stmtB); $dbhB->disconnect(); @@ -1843,6 +1852,9 @@ if ($hold_time_option =~ /PRESS_VMAIL/) $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$YqueryCID',queue='$channel_group',agent='NONE',verb='EXITWITHKEY',data1='1',data2='$place',serverid='$queuemetrics_log_id';"; $Baffected_rows = $dbhB->do($stmtB); + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$YqueryCID',queue='$channel_group',agent='NONE',verb='CALLSTATUS',data1='QVMAIL',serverid='$queuemetrics_log_id';"; + $Baffected_rows = $dbhB->do($stmtB); + $exitwithkey++; $dbhB->disconnect(); @@ -1940,9 +1952,18 @@ if ($wait_in_queue < 1) 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='$YqueryCID',queue='$channel_group',agent='NONE',verb='TRANSFER',data1='$DROPexten',data2='$ext_context',data3='$drop_seconds',data4='$drop_seconds',serverid='$queuemetrics_log_id';"; + $place=0; + if ($rec_countWAIT > 0) {$place = $rec_countWAIT;} + if ($rec_countWAITrem > 0) {$place = $rec_countWAITrem;} + $place++; + + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$YqueryCID',queue='$channel_group',agent='NONE',verb='EXITWITHKEY',data1='2',data2='$place',serverid='$queuemetrics_log_id';"; $Baffected_rows = $dbhB->do($stmtB); + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$YqueryCID',queue='$channel_group',agent='NONE',verb='CALLSTATUS',data1='HOLDTO',serverid='$queuemetrics_log_id';"; + $Baffected_rows = $dbhB->do($stmtB); + + $dbhB->disconnect(); } @@ -2042,6 +2063,9 @@ if ($enable_queuemetrics_logging > 0) $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$YqueryCID',queue='$channel_group',agent='NONE',verb='EXITWITHTIMEOUT',data1='$place',serverid='$queuemetrics_log_id';"; $Baffected_rows = $dbhB->do($stmtB); + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$YqueryCID',queue='$channel_group',agent='NONE',verb='CALLSTATUS',data1='DROP',serverid='$queuemetrics_log_id';"; + $Baffected_rows = $dbhB->do($stmtB); + $dbhB->disconnect(); } diff --git a/agi/agi-VDAD_ALL_outbound.agi b/agi/agi-VDAD_ALL_outbound.agi index 2422a182..fc0a8383 100644 --- a/agi/agi-VDAD_ALL_outbound.agi +++ b/agi/agi-VDAD_ALL_outbound.agi @@ -1229,6 +1229,9 @@ if ($enable_queuemetrics_logging > 0) $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$callerid',queue='$VDADcampaign',agent='NONE',verb='EXITWITHTIMEOUT',data1='1',serverid='$queuemetrics_log_id';"; $Baffected_rows = $dbhB->do($stmtB); + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$callerid',queue='$VDADcampaign',agent='NONE',verb='CALLSTATUS',data1='DROP',serverid='$queuemetrics_log_id';"; + $Baffected_rows = $dbhB->do($stmtB); + $dbhB->disconnect(); } diff --git a/bin/AST_VDadapt.pl b/bin/AST_VDadapt.pl index 7ac92819..9f5884f8 100644 --- a/bin/AST_VDadapt.pl +++ b/bin/AST_VDadapt.pl @@ -24,14 +24,20 @@ # 70521-1038 - Fixed bug when no live campaigns are running, define $vicidial_log # 70619-1339 - Added Status Category tally calculations # 71029-1906 - Changed CLOSER-type campaign_id restriction +# 81021-2201 - Deactivated queue_log QUEUESTART event +# 81022-0713 - Added gathering of vicidial_inbound_groups stats(day only) # # constants $DB=0; # Debug flag, set to 0 for no debug messages, On an active system this will generate lots of lines of output per minute $US='__'; $MT[0]=''; + +##### table definitions: $vicidial_log = 'vicidial_log FORCE INDEX (call_date) '; # $vicidial_log = 'vicidial_log'; + $vicidial_closer_log = 'vicidial_closer_log FORCE INDEX (call_date) '; +# $vicidial_closer_log = 'vicidial_closer_log'; $i=0; @@ -244,36 +250,37 @@ if ($DBX) {print "CONNECTED TO DATABASE: $VARDB_server|$VARDB_database\n";} ############################################# ##### START QUEUEMETRICS LOGGING LOOKUP ##### -$stmtA = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; -$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; -$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; -$sthArows=$sthA->rows; -$rec_count=0; -while ($sthArows > $rec_count) - { - @aryA = $sthA->fetchrow_array; - $enable_queuemetrics_logging = "$aryA[0]"; - $queuemetrics_server_ip = "$aryA[1]"; - $queuemetrics_dbname = "$aryA[2]"; - $queuemetrics_login = "$aryA[3]"; - $queuemetrics_pass = "$aryA[4]"; - $queuemetrics_log_id = "$aryA[5]"; - $rec_count++; - } -$sthA->finish(); - -if ($enable_queuemetrics_logging > 0) - { - $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";} - - $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$secT',call_id='NONE',queue='NONE',agent='NONE',verb='QUEUESTART',serverid='$queuemetrics_log_id';"; - $Baffected_rows = $dbhB->do($stmtB); - - $dbhB->disconnect(); - } +# Disabled per Lorenzo at QueueMetrics because this event is apparently useless +#$stmtA = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; +#$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; +#$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; +#$sthArows=$sthA->rows; +#$rec_count=0; +#while ($sthArows > $rec_count) +# { +# @aryA = $sthA->fetchrow_array; +# $enable_queuemetrics_logging = "$aryA[0]"; +# $queuemetrics_server_ip = "$aryA[1]"; +# $queuemetrics_dbname = "$aryA[2]"; +# $queuemetrics_login = "$aryA[3]"; +# $queuemetrics_pass = "$aryA[4]"; +# $queuemetrics_log_id = "$aryA[5]"; +# $rec_count++; +# } +#$sthA->finish(); +# +#if ($enable_queuemetrics_logging > 0) +# { +# $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";} +# +# $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$secT',call_id='NONE',queue='NONE',agent='NONE',verb='QUEUESTART',serverid='$queuemetrics_log_id';"; +# $Baffected_rows = $dbhB->do($stmtB); +# +# $dbhB->disconnect(); +# } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -508,6 +515,52 @@ if ($RESETdrop_count_updater>0) {$RESETdrop_count_updater=0; $drop_count_updat $diff_ratio_updater = ($diff_ratio_updater + $CLIdelay); $drop_count_updater = ($drop_count_updater + $CLIdelay); + + + + + + + + +################################################################################ +#### BEGIN gather stats for inbound groups for the real-time display +################################################################################ +$stmtA = "SELECT group_id from vicidial_inbound_groups where active='Y';"; +$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; +$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; +$sthArows=$sthA->rows; +$ibg_count=0; +while ($sthArows > $ibg_count) + { + @aryA = $sthA->fetchrow_array; + $group_id[$ibg_count] = $aryA[0]; + $ibg_count++; + } +$sthA->finish(); +if ($DB) {print "$now_date INBOUND GROUPS TO GET STATS FOR: $ibg_count|$#group_id IT: $master_loop\n";} + + +##### LOOP THROUGH EACH INBOUND GROUP AND GATHER STATS ##### +$p=0; +foreach(@group_id) + { + &calculate_drops_inbound; + + $p++; + } + +################################################################################ +#### END gather stats for inbound groups for the real-time display +################################################################################ + + + + + + + + sleep($CLIdelay); $stat_count++; @@ -1092,6 +1145,203 @@ if ($DBX) {print "$campaign_id[$i]|$stmtA|\n";} +sub calculate_drops_inbound +{ +$camp_ANS_STAT_SQL=''; +# GET LIST OF HUMAN-ANSWERED STATUSES +$stmtA = "SELECT status from vicidial_statuses where human_answered='Y';"; +$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; +$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; +$sthArows=$sthA->rows; +$rec_count=0; +while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $camp_ANS_STAT_SQL .= "'$aryA[0]',"; + $rec_count++; + } +$sthA->finish(); + +$stmtA = "SELECT distinct(status) from vicidial_campaign_statuses where human_answered='Y';"; +$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; +$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; +$sthArows=$sthA->rows; +$rec_count=0; +while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $camp_ANS_STAT_SQL .= "'$aryA[0]',"; + $rec_count++; + } +$sthA->finish(); +chop($camp_ANS_STAT_SQL); + +if ($DBX) {print " ANSWERED STATUSES: $group_id[$p]|$camp_ANS_STAT_SQL|\n";} + +#$RESETdrop_count_updater++; +$VCScalls_today[$p]=0; +$VCSanswers_today[$p]=0; +$VCSdrops_today[$p]=0; +$VCSdrops_today_pct[$p]=0; +$VCSdrops_answers_today_pct[$p]=0; + + +# TODAY CALL AND DROP STATS +$stmtA = "SELECT count(*) from $vicidial_closer_log where campaign_id='$group_id[$p]' and call_date > '$VDL_date';"; +$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; +$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; +$sthArows=$sthA->rows; +$rec_count=0; +while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $VCScalls_today[$p] = "$aryA[0]"; + $rec_count++; + } +$sthA->finish(); +if ($VCScalls_today[$p] > 0) + { + # TODAY ANSWERS + $stmtA = "SELECT count(*) from $vicidial_closer_log where campaign_id='$group_id[$p]' and call_date > '$VDL_date' and status IN($camp_ANS_STAT_SQL);"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $VCSanswers_today[$p] = "$aryA[0]"; + $rec_count++; + } + $sthA->finish(); + # TODAY DROPS + $stmtA = "SELECT count(*) from $vicidial_closer_log where campaign_id='$group_id[$p]' and call_date > '$VDL_date' and status IN('DROP','XDROP');"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $VCSdrops_today[$p] = "$aryA[0]"; + if ($VCSdrops_today[$p] > 0) + { + $VCSdrops_today_pct[$p] = ( ($VCSdrops_today[$p] / $VCScalls_today[$p]) * 100 ); + $VCSdrops_today_pct[$p] = sprintf("%.2f", $VCSdrops_today_pct[$p]); + if ($VCSanswers_today[$p] < 1) {$VCSanswers_today[$p] = 1;} + $VCSdrops_answers_today_pct[$p] = ( ($VCSdrops_today[$p] / $VCSanswers_today[$p]) * 100 ); + $VCSdrops_answers_today_pct[$p] = sprintf("%.2f", $VCSdrops_answers_today_pct[$p]); + } + $rec_count++; + } + $sthA->finish(); + } + + + + +# DETERMINE WHETHER TO GATHER STATUS CATEGORY STATISTICS +$VSC_categories=0; +$VSCupdateSQL=''; +$stmtA = "SELECT vsc_id from vicidial_status_categories where tovdad_display='Y' limit 4;"; +$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; +$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; +$sthArows=$sthA->rows; +$rec_count=0; +while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $VSC_categories[$rec_count] = "$aryA[0]"; + $rec_count++; + } +$sthA->finish(); + +$g=0; +foreach (@VSC_categories) + { + $VSCcategory=$VSC_categories[$g]; + $VSCtally=''; + $CATstatusesSQL=''; + # FIND STATUSES IN STATUS CATEGORY + $stmtA = "SELECT status from vicidial_statuses where category='$VSCcategory';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $CATstatusesSQL .= "'$aryA[0]',"; + $rec_count++; + } + # FIND CAMPAIGN_STATUSES IN STATUS CATEGORY + $stmtA = "SELECT status from vicidial_campaign_statuses where category='$VSCcategory';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $CATstatusesSQL .= "'$aryA[0]',"; + $rec_count++; + } + chop($CATstatusesSQL); + if (length($CATstatusesSQL)>2) + { + # FIND STATUSES IN STATUS CATEGORY + $stmtA = "SELECT count(*) from $vicidial_closer_log where campaign_id='$group_id[$p]' and call_date > '$VDL_date' and status IN($CATstatusesSQL);"; + # if ($DBX) {print "|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $VSCtally = "$aryA[0]"; + $rec_count++; + } + } + $g++; + if ($DBX) {print " $group_id[$p]|$VSCcategory|$VSCtally|$CATstatusesSQL|\n";} + $VSCupdateSQL .= "status_category_$g='$VSCcategory',status_category_count_$g='$VSCtally',"; + } +while ($g < 4) + { + $g++; + $VSCupdateSQL .= "status_category_$g='',status_category_count_$g='0',"; + } +chop($VSCupdateSQL); + +$vcs_exists=1; +$stmtA = "SELECT count(*) from vicidial_campaign_stats where campaign_id='$group_id[$p]';"; +$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; + $vcs_exists = "$aryA[0]"; + } +$sthA->finish(); + +if ($vcs_exists < 1) + { + $stmtA = "INSERT INTO vicidial_campaign_stats (campaign_id) values('$group_id[$p]');"; + $affected_rows = $dbhA->do($stmtA); + if ($DBX) {print "$group_id[$p]|$stmtA|\n";} + } + +$stmtA = "UPDATE vicidial_campaign_stats SET calls_today='$VCScalls_today[$p]',answers_today='$VCSanswers_today[$p]',drops_today='$VCSdrops_today[$p]',drops_today_pct='$VCSdrops_today_pct[$p]',drops_answers_today_pct='$VCSdrops_answers_today_pct[$p]',$VSCupdateSQL where campaign_id='$group_id[$p]';"; +$affected_rows = $dbhA->do($stmtA); +if ($DBX) {print "$group_id[$p]|$stmtA|\n";} +} +##### END calculate_drops_inbound + + + + sub calculate_dial_level { $RESETdiff_ratio_updater++; diff --git a/www/agc/vdc_db_query.php b/www/agc/vdc_db_query.php index 7ff74683..215cac77 100644 --- a/www/agc/vdc_db_query.php +++ b/www/agc/vdc_db_query.php @@ -2621,7 +2621,7 @@ else $time_logged_in = ($StarTtime - $logintime); if ($time_logged_in > 1000000) {$time_logged_in=1;} - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='AGENTLOGOFF',data1='$user$agents',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='AGENTLOGOFF',data1='$user$agents',data2='$time_logged_in',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkB); $affected_rows = mysql_affected_rows($linkB); diff --git a/www/agc/vicidial.php b/www/agc/vicidial.php index 144836c8..96ae411a 100644 --- a/www/agc/vicidial.php +++ b/www/agc/vicidial.php @@ -1449,7 +1449,7 @@ else $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='$VD_campaign',agent='Agent/$VD_login',verb='AGENTLOGIN',data1='$VD_login@agents',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='AGENTLOGIN',data1='$VD_login@agents',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkB); $affected_rows = mysql_affected_rows($linkB); diff --git a/www/vicidial/AST_timeonVDADall.php b/www/vicidial/AST_timeonVDADall.php index c80b7a8a..da82ea69 100644 --- a/www/vicidial/AST_timeonVDADall.php +++ b/www/vicidial/AST_timeonVDADall.php @@ -38,6 +38,7 @@ # 80704-0543 - Added DEAD status for agents INCALL with no live call # 80822-1222 - Added option for display of customer phone number # 81011-0335 - Fixed remote agent display bug +# 81022-1500 - Added inbound call stats display option # header ("Content-type: text/html; charset=utf-8"); @@ -83,6 +84,8 @@ if (isset($_GET["PHONEdisplay"])) {$PHONEdisplay=$_GET["PHONEdisplay"];} elseif (isset($_POST["PHONEdisplay"])) {$PHONEdisplay=$_POST["PHONEdisplay"];} if (isset($_GET["CUSTPHONEdisplay"])) {$CUSTPHONEdisplay=$_GET["CUSTPHONEdisplay"];} elseif (isset($_POST["CUSTPHONEdisplay"])) {$CUSTPHONEdisplay=$_POST["CUSTPHONEdisplay"];} +if (isset($_GET["with_inbound"])) {$with_inbound=$_GET["with_inbound"];} + elseif (isset($_POST["with_inbound"])) {$with_inbound=$_POST["with_inbound"];} ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### @@ -110,6 +113,7 @@ if (!isset($SERVdisplay)) {$SERVdisplay=1;} # 0=no, 1=yes if (!isset($CALLSdisplay)) {$CALLSdisplay=1;} # 0=no, 1=yes if (!isset($PHONEdisplay)) {$PHONEdisplay=0;} # 0=no, 1=yes if (!isset($CUSTPHONEdisplay)) {$CUSTPHONEdisplay=0;} # 0=no, 1=yes +if (!isset($with_inbound)) {$with_inbound='N';} # 0=no, 1=yes function get_server_load($windows = false) { $os = strtolower(PHP_OS); @@ -257,13 +261,13 @@ $F=''; $FG=''; $B=''; $BG=''; echo "\n-->\n \n"; -$stmt = "select count(*) from vicidial_campaigns where campaign_id='$group' and campaign_allow_inbound='Y';"; +$stmt = "select count(*) from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "' and campaign_allow_inbound='Y';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $campaign_allow_inbound = $row[0]; echo "\n"; -echo"\n"; +echo"\n"; echo "