diff --git a/LANG_www/agc_it/vdc_db_query.php b/LANG_www/agc_it/vdc_db_query.php index 94966221..d41b2cf5 100644 --- a/LANG_www/agc_it/vdc_db_query.php +++ b/LANG_www/agc_it/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/LANG_www/agc_it/vicidial.php b/LANG_www/agc_it/vicidial.php index 1f653a17..bef9faf4 100644 --- a/LANG_www/agc_it/vicidial.php +++ b/LANG_www/agc_it/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/LANG_www/vicidial_it/AST_timeonVDADall.php b/LANG_www/vicidial_it/AST_timeonVDADall.php index 85b15b95..b9e4b1d3 100644 --- a/LANG_www/vicidial_it/AST_timeonVDADall.php +++ b/LANG_www/vicidial_it/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 "VICIDIAL: Time On VDAD Campagna: $group\n"; echo "
\n"; echo "VICIDIAL Campagna: \n"; @@ -303,10 +307,17 @@ if ($UGdisplay > 0) } echo "\n"; } +if (!eregi('XXXX-ALL-ACTIVE-XXXX', $group)) + { + echo "   Inbound:         \n"; -echo "STOP | "; -echo "PIU LENTO | "; -echo "INIZIA"; +echo "STOP | "; +echo "PIU LENTO | "; +echo "INIZIA"; if ($group == 'XXXX-ALL-ACTIVE-XXXX') { echo "       MODIFICA | \n"; @@ -323,11 +334,40 @@ echo "\n\n"; if (!$group) {echo "

per favore seleziona una campagna dal menu qui in alto\n"; exit;} else { -$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; if ($group=='XXXX-ALL-ACTIVE-XXXX') { $stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses) from vicidial_campaigns;"; + + $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),min(status_category_1),sum(status_category_count_1),min(status_category_2),sum(status_category_count_2),min(status_category_3),sum(status_category_count_3),min(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats;"; } +else + { + if ($DB > 0) {echo "\n|$with_inbound|$campaign_allow_inbound|\n";} + + if ( (ereg('Y',$with_inbound)) and ($campaign_allow_inbound > 0) ) + { + $stmt = "select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $closer_campaigns = $row[0]; + $closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns); + $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); + $closer_campaignsSQL = "'$closer_campaigns'"; + if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";} + + $stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses from vicidial_campaigns where campaign_id IN ('" . mysql_real_escape_string($group) . "',$closer_campaignsSQL);"; + + $stmtB="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4 from vicidial_campaign_stats where campaign_id IN ('" . mysql_real_escape_string($group) . "',$closer_campaignsSQL);"; + } + else + { + $stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; + + $stmtB="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4 from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; + } + } +if ($DB > 0) {echo "\n|$stmt|$stmtB|\n";} + $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $DIALlev = $row[0]; @@ -361,12 +401,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDhop = $row[0]; -$stmt="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4 from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; -if ($group=='XXXX-ALL-ACTIVE-XXXX') - { - $stmt="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),min(status_category_1),sum(status_category_count_1),min(status_category_2),sum(status_category_count_2),min(status_category_3),sum(status_category_count_3),min(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats;"; - } -$rslt=mysql_query($stmt, $link); +$rslt=mysql_query($stmtB, $link); $row=mysql_fetch_row($rslt); $DAleads = $row[0]; $callsTODAY = $row[1]; @@ -472,55 +507,55 @@ echo ""; if ($adastats<2) { - echo "+ VISUALIZZA PIU DATI"; + echo "+ VISUALIZZA PIU DATI"; } if ($UGdisplay>0) { - echo "       NASCONDI GRUPPI UTENTI"; + echo "       NASCONDI GRUPPI UTENTI"; } else { - echo "       MOSTRA GRUPPI UTENTI"; + echo "       MOSTRA GRUPPI UTENTI"; } if ($UidORname>0) { - echo "       MOSTRA ID OPERATORE"; + echo "       MOSTRA ID OPERATORE"; } else { - echo "       MOSTRA NOME OPERATORE"; + echo "       MOSTRA NOME OPERATORE"; } if ($SERVdisplay>0) { - echo "       NASCONDI INFO SERVER"; + echo "       NASCONDI INFO SERVER"; } else { - echo "       MOSTRA INFO SERVER"; + echo "       MOSTRA INFO SERVER"; } if ($CALLSdisplay>0) { - echo "       NASCONDI WAITING CALLS"; + echo "       NASCONDI WAITING CALLS"; } else { - echo "       MOSTRA WAITING CALLS"; + echo "       MOSTRA WAITING CALLS"; } if ($PHONEdisplay>0) { - echo "       NASCONDI PHONES"; + echo "       NASCONDI PHONES"; } else { - echo "       MOSTRA PHONES"; + echo "       MOSTRA PHONES"; } if ($CUSTPHONEdisplay>0) { - echo "       NASCONDI CUSTPHONES"; + echo "       NASCONDI CUSTPHONES"; } else { - echo "       MOSTRA CUSTPHONES"; + echo "       MOSTRA CUSTPHONES"; } echo ""; echo ""; @@ -721,11 +756,11 @@ $HTbegin = "|"; $HDstation = "------------+"; $HTstation = " STATION |"; $HDphone = "------------+"; -$HTphone = " PHONE |"; +$HTphone = " PHONE |"; $HDuser = "--------------------+"; -$HTuser = " UTENTE |"; +$HTuser = " UTENTE |"; $HDusergroup = "--------------+"; -$HTusergroup = " USER GROUP |"; +$HTusergroup = " USER GROUP |"; $HDsessionid = "------------------+"; $HTsessionid = " SESSIONID |"; $HDbarge = "-------+"; @@ -739,9 +774,9 @@ $HTserver_ip = " SERVER IP |"; $HDcall_server_ip = "-----------------+"; $HTcall_server_ip = " CALL SERVER IP |"; $HDtime = "---------+"; -$HTtime = " MM:SS |"; +$HTtime = " MM:SS |"; $HDcampaign = "------------+"; -$HTcampaign = " CAMPAGNA |"; +$HTcampaign = " CAMPAGNA |"; $HDcalls = "-------+"; $HTcalls = " CALLS |"; @@ -981,12 +1016,12 @@ $calls_to_list = mysql_num_rows($rslt); if (eregi("INCALL",$Lstatus)) { ### temporarily deactivate DEAD calls display until bug is fixed - # if (!ereg("$Acallerid[$i]\|",$callerids)) - # { - # $Astatus[$i] = 'DEAD'; - # $Lstatus = 'DEAD'; - # $status = ' DEAD '; - # } + if (!ereg("$Acallerid[$i]\|",$callerids)) + { + $Astatus[$i] = 'DEAD'; + $Lstatus = 'DEAD'; + $status = ' DEAD '; + } if ( (eregi("AUTO",$comments)) or (strlen($comments)<1) ) {$CM='A';} diff --git a/LANG_www/vicidial_it/admin.php b/LANG_www/vicidial_it/admin.php index c7511ce8..4b7d1300 100644 --- a/LANG_www/vicidial_it/admin.php +++ b/LANG_www/vicidial_it/admin.php @@ -6631,6 +6631,9 @@ if ($ADD==2111) $stmt="INSERT INTO vicidial_inbound_groups (group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch) values('$group_id','$group_name','$group_color','$active','" . mysql_real_escape_string($web_form_address) . "','$voicemail_ext','$next_agent_call','$fronter_display','$script_id','$get_call_launch');"; $rslt=mysql_query($stmt, $link); + $stmt="INSERT INTO vicidial_campaign_stats (campaign_id) values('$group_id');"; + $rslt=mysql_query($stmt, $link); + echo "
GRUPPO AGGIUNTO: $group_id\n"; ### LOG CHANGES TO LOG FILE ### @@ -6708,7 +6711,7 @@ if ($ADD==2311) {echo "
DID NOT ADDED - there is already a DID in the system with this extension\n";} else { - if ( (strlen($did_pattern) < 1) or (strlen($did_pattern) < 1) or (eregi(' ',$did_pattern)) or (eregi(' ',$did_pattern)) or (eregi("\+",$did_pattern)) ) + if ( (strlen($source_did) < 1) or (strlen($did_pattern) < 1) or (eregi(' ',$source_did)) or (eregi(' ',$did_pattern)) or (eregi("\+",$source_did)) ) { echo "
DID NOT ADDED - Per favore torna indietro e ricontrolla i dati inseriti\n"; echo "
DID Extension must be between 2 and 20 characters in length and contain no ' -+'.\n"; @@ -6723,7 +6726,7 @@ if ($ADD==2311) $row=mysql_fetch_row($rslt); $did_id = $row[0]; - echo "
DID ADDED: $did_pattern - $did_id\n"; + echo "
DID ADDED: $did_pattern $did_description - $did_id\n"; ### LOG CHANGES TO LOG FILE ### if ($WeBRooTWritablE > 0) @@ -10200,6 +10203,9 @@ if ($ADD==6111) $stmt="DELETE from vicidial_live_inbound_agents where group_id='$group_id';"; $rslt=mysql_query($stmt, $link); + $stmt="DELETE from vicidial_campaign_stats where campaign_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + ### LOG CHANGES TO LOG FILE ### if ($WeBRooTWritablE > 0) { @@ -13858,7 +13864,7 @@ if ($ADD==3311) echo "User Route Settings In-Gruppo: $NWB#vicidial_inbound_dids-user_route_settings_ingroup$NWE\n"; - echo "In-ID Gruppo: "; echo "$Dgroups_menu"; echo "$NWB#vicidial_inbound_dids-group_id$NWE\n"; echo "In-Group Call Handle Method: $NWB#vicidial_inbound_dids-call_handle_method$NWE\n";