diff --git a/www/VERM/VERM_AGENTS_rpt.inc b/www/VERM/VERM_AGENTS_rpt.inc index 125b0467..69310be8 100644 --- a/www/VERM/VERM_AGENTS_rpt.inc +++ b/www/VERM/VERM_AGENTS_rpt.inc @@ -369,7 +369,7 @@ foreach ($agent_sessions_array as $user => $sessions) $call_stmt_inb=""; if ($atomic_queue_ingroups_str!="") { - $vcl_uniqueid_stmt="select uniqueid, status, length_in_sec-queue_seconds from vicidial_closer_log $vicidial_closer_log_SQL and call_date+INTERVAL ceil(queue_seconds) SECOND>=from_unixtime(".$agent_sessions_array["$user"]["$start_event_date"]["start_hour"].") and call_date+INTERVAL ceil(queue_seconds) SECOND<=from_unixtime(".$agent_sessions_array["$user"]["$start_event_date"]["end_hour"].") and user='$user' and status!='AFTHRS'"; + $vcl_uniqueid_stmt="select uniqueid, status, if(comments='EMAIL', length_in_sec, length_in_sec-queue_seconds) from vicidial_closer_log $vicidial_closer_log_SQL and call_date+INTERVAL ceil(if(comments='EMAIL', 0, queue_seconds)) SECOND>=from_unixtime(".$agent_sessions_array["$user"]["$start_event_date"]["start_hour"].") and call_date+INTERVAL ceil(if(comments='EMAIL', 0, queue_seconds)) SECOND<=from_unixtime(".$agent_sessions_array["$user"]["$start_event_date"]["end_hour"].") and user='$user' and status!='AFTHRS'"; $vcl_uniqueid_stmt.=" and call_date>=from_unixtime(".$agent_sessions_array["$user"]["$start_event_date"]["start_hour"].")-INTERVAL 24 HOUR and call_date<=from_unixtime(".$agent_sessions_array["$user"]["$start_event_date"]["end_hour"].")+INTERVAL 24 HOUR"; # $DB=1; diff --git a/www/VERM/VERM_ANSWERED_DT_rpt.inc b/www/VERM/VERM_ANSWERED_DT_rpt.inc index b34470cf..25bf0b8e 100644 --- a/www/VERM/VERM_ANSWERED_DT_rpt.inc +++ b/www/VERM/VERM_ANSWERED_DT_rpt.inc @@ -90,7 +90,7 @@ else } $sort_answered_details_preg=preg_replace('/ desc$/', '', $sort_answered_details); -$stmt="select call_date, phone_number, campaign_id, 0 as ivr, '0:00' as wait, sec_to_time(round(length_in_sec)) as duration, '1' as queue_position, CAST(term_reason AS CHAR) as term_reason, user, '1' as attempts, status, uniqueid, 0 as moh_events, '00:00:00' as moh_duration, '' as ivr_duration, '' as ivr_path, '' as did, '' as url, '' as tag, '0' as feat, '0' as vars, '' as feature_codes, '' as variables, uniqueid as detail_id, 'O' as direction from vicidial_log $vicidial_log_SQL and user not in ('VDAD') UNION select call_date, phone_number, campaign_id, 0 as ivr, sec_to_time(round(queue_seconds)) as wait, sec_to_time(round(length_in_sec-queue_seconds)) as duration, queue_position, CAST(term_reason AS CHAR) as term_reason, user, '1' as attempts, status, uniqueid, 0 as moh_events, '00:00:00' as moh_duration, '' as ivr_duration, '' as ivr_path, '' as did, '' as url, '' as tag, '0' as feat, '0' as vars, '' as feature_codes, '' as variables, CONCAT(uniqueid, '|', closecallid) as detail_id, 'I' as direction from vicidial_closer_log $vicidial_closer_log_SQL and (user!='VDCL') $sort_clause"; +$stmt="select call_date, phone_number, campaign_id, 0 as ivr, '0:00' as wait, sec_to_time(round(length_in_sec)) as duration, '1' as queue_position, CAST(term_reason AS CHAR) as term_reason, user, '1' as attempts, status, uniqueid, 0 as moh_events, '00:00:00' as moh_duration, '' as ivr_duration, '' as ivr_path, '' as did, '' as url, '' as tag, '0' as feat, '0' as vars, '' as feature_codes, '' as variables, uniqueid as detail_id, 'O' as direction from vicidial_log $vicidial_log_SQL and user not in ('VDAD') UNION select call_date, phone_number, campaign_id, 0 as ivr, sec_to_time(round(queue_seconds)) as wait, sec_to_time(round(if(comments='EMAIL', length_in_sec, length_in_sec-queue_seconds))) as duration, queue_position, CAST(term_reason AS CHAR) as term_reason, user, '1' as attempts, status, uniqueid, 0 as moh_events, '00:00:00' as moh_duration, '' as ivr_duration, '' as ivr_path, '' as did, '' as url, '' as tag, '0' as feat, '0' as vars, '' as feature_codes, '' as variables, CONCAT(uniqueid, '|', closecallid) as detail_id, 'I' as direction from vicidial_closer_log $vicidial_closer_log_SQL and (user!='VDCL') $sort_clause"; if ($DB) {$HTML_output.="$stmt";} diff --git a/www/VERM/VERM_AREA_rpt.inc b/www/VERM/VERM_AREA_rpt.inc index 1d7eace9..cad2507e 100644 --- a/www/VERM/VERM_AREA_rpt.inc +++ b/www/VERM/VERM_AREA_rpt.inc @@ -100,7 +100,7 @@ while ($outb_row=mysqli_fetch_array($outb_rslt)) } } -$inb_stmt="select substr(phone_number, $CLI_position, $CLI_digits) as snippet, user, uniqueid, length_in_sec-queue_seconds as talk_time, queue_seconds, queue_position, lead_id from vicidial_closer_log $vicidial_closer_log_SQL $and_NANQUE_clause $exc_addtl_statuses"; +$inb_stmt="select substr(phone_number, $CLI_position, $CLI_digits) as snippet, user, uniqueid, if(comments='EMAIL', length_in_sec, length_in_sec-queue_seconds) as talk_time, if(comments='EMAIL', 0, queue_seconds) as queue_seconds, queue_position, lead_id from vicidial_closer_log $vicidial_closer_log_SQL $and_NANQUE_clause $exc_addtl_statuses"; if ($DB) {$HTML_output.="$inb_stmt";} # print $inb_stmt."\n"; $inb_rslt=mysql_to_mysqli($inb_stmt, $link); @@ -301,4 +301,4 @@ function GetAgentLogTalkTime($call_uniqueid, $call_user, $call_lead_id, $current return $current_call_time; } -?> \ No newline at end of file +?> diff --git a/www/VERM/VERM_CALLS_rpt.inc b/www/VERM/VERM_CALLS_rpt.inc index 2c410411..78d6b7f7 100644 --- a/www/VERM/VERM_CALLS_rpt.inc +++ b/www/VERM/VERM_CALLS_rpt.inc @@ -108,7 +108,7 @@ else } $sort_answered_details_preg=preg_replace('/ desc$/', '', $sort_answered_details); -$stmt="select call_date, phone_number, campaign_id, 0 as ivr, '0:00' as wait, sec_to_time(round(length_in_sec)) as duration, '1' as queue_position, CAST(term_reason AS CHAR) as term_reason, user, '1' as attempts, status, uniqueid, 0 as moh_events, '00:00:00' as moh_duration, '' as ivr_duration, '' as ivr_path, '' as did, '' as url, '' as tag, '0' as feat, '0' as vars, '' as feature_codes, '' as variables, uniqueid as detail_id, 'O' as direction from vicidial_log $vicidial_log_SQL and user not in ('VDAD') UNION select call_date, phone_number, campaign_id, 0 as ivr, sec_to_time(round(queue_seconds)) as wait, sec_to_time(round(length_in_sec-queue_seconds)) as duration, queue_position, CAST(term_reason AS CHAR) as term_reason, user, '1' as attempts, status, uniqueid, 0 as moh_events, '00:00:00' as moh_duration, '' as ivr_duration, '' as ivr_path, '' as did, '' as url, '' as tag, '0' as feat, '0' as vars, '' as feature_codes, '' as variables, CONCAT(uniqueid, '|', closecallid) as detail_id, 'I' as direction from vicidial_closer_log $vicidial_closer_log_SQL and (user!='VDCL') $sort_clause"; +$stmt="select call_date, phone_number, campaign_id, 0 as ivr, '0:00' as wait, sec_to_time(round(length_in_sec)) as duration, '1' as queue_position, CAST(term_reason AS CHAR) as term_reason, user, '1' as attempts, status, uniqueid, 0 as moh_events, '00:00:00' as moh_duration, '' as ivr_duration, '' as ivr_path, '' as did, '' as url, '' as tag, '0' as feat, '0' as vars, '' as feature_codes, '' as variables, uniqueid as detail_id, 'O' as direction from vicidial_log $vicidial_log_SQL and user not in ('VDAD') UNION select call_date, phone_number, campaign_id, 0 as ivr, sec_to_time(round(queue_seconds)) as wait, sec_to_time(round(if(comments='EMAIL', length_in_sec, length_in_sec-queue_seconds))) as duration, queue_position, CAST(term_reason AS CHAR) as term_reason, user, '1' as attempts, status, uniqueid, 0 as moh_events, '00:00:00' as moh_duration, '' as ivr_duration, '' as ivr_path, '' as did, '' as url, '' as tag, '0' as feat, '0' as vars, '' as feature_codes, '' as variables, CONCAT(uniqueid, '|', closecallid) as detail_id, 'I' as direction from vicidial_closer_log $vicidial_closer_log_SQL and (user!='VDCL') $sort_clause"; if ($DB) {$HTML_output.="$stmt";} @@ -292,7 +292,7 @@ else } $sort_unanswered_details_preg=preg_replace('/ desc$/', '', $sort_unanswered_details); -$stmt="select call_date, phone_number, campaign_id, 0 as ivr, '0:00' as wait, sec_to_time(round(length_in_sec)) as duration, '1' as queue_position, CAST(term_reason AS CHAR) as term_reason, user, '1' as attempts, status, uniqueid, 0 as moh_events, '00:00:00' as moh_duration, '' as ivr_duration, '' as ivr_path, '' as did, '' as url, '' as tag, '0' as feat, '0' as vars, '' as feature_codes, '' as variables, uniqueid as detail_id, 'O' as direction from vicidial_log $vicidial_log_SQL and user in ('VDAD') UNION select call_date, phone_number, campaign_id, 0 as ivr, sec_to_time(round(queue_seconds)) as wait, sec_to_time(round(length_in_sec-queue_seconds)) as duration, queue_position, CAST(term_reason AS CHAR) as term_reason, user, '1' as attempts, status, uniqueid, 0 as moh_events, '00:00:00' as moh_duration, '' as ivr_duration, '' as ivr_path, '' as did, '' as url, '' as tag, '0' as feat, '0' as vars, '' as feature_codes, '' as variables, CONCAT(uniqueid, '|', closecallid) as detail_id, 'I' as direction from vicidial_closer_log $vicidial_closer_log_SQL and user in ('VDCL') $and_NANQUE_clause $sort_clause"; +$stmt="select call_date, phone_number, campaign_id, 0 as ivr, '0:00' as wait, sec_to_time(round(length_in_sec)) as duration, '1' as queue_position, CAST(term_reason AS CHAR) as term_reason, user, '1' as attempts, status, uniqueid, 0 as moh_events, '00:00:00' as moh_duration, '' as ivr_duration, '' as ivr_path, '' as did, '' as url, '' as tag, '0' as feat, '0' as vars, '' as feature_codes, '' as variables, uniqueid as detail_id, 'O' as direction from vicidial_log $vicidial_log_SQL and user in ('VDAD') UNION select call_date, phone_number, campaign_id, 0 as ivr, sec_to_time(round(queue_seconds)) as wait, sec_to_time(round(if(comments='EMAIL', length_in_sec, length_in_sec-queue_seconds))) as duration, queue_position, CAST(term_reason AS CHAR) as term_reason, user, '1' as attempts, status, uniqueid, 0 as moh_events, '00:00:00' as moh_duration, '' as ivr_duration, '' as ivr_path, '' as did, '' as url, '' as tag, '0' as feat, '0' as vars, '' as feature_codes, '' as variables, CONCAT(uniqueid, '|', closecallid) as detail_id, 'I' as direction from vicidial_closer_log $vicidial_closer_log_SQL and user in ('VDCL') $and_NANQUE_clause $sort_clause"; if ($DB) {$HTML_output.="$stmt";} diff --git a/www/VERM/VERM_DAY_rpt.inc b/www/VERM/VERM_DAY_rpt.inc index 6941ffae..02772861 100644 --- a/www/VERM/VERM_DAY_rpt.inc +++ b/www/VERM/VERM_DAY_rpt.inc @@ -74,7 +74,7 @@ $coverage_wi="100%"; ################# -$stmt="select substr(call_date, 1, 10) as cdate, campaign_id, status, user, length_in_sec as call_length, uniqueid, '0' as wait_sec, 'O' as direction, '1' as queue_position, lead_id from vicidial_log $vicidial_log_SQL $and_NANQUE_clause $exc_addtl_statuses UNION ALL select substr(call_date, 1, 10) as cdate, campaign_id, status, user, length_in_sec-queue_seconds as call_length, uniqueid, queue_seconds as wait_sec, 'I' as direction, queue_position, lead_id from vicidial_closer_log $vicidial_closer_log_SQL $and_NANQUE_clause $exc_addtl_statuses"; +$stmt="select substr(call_date, 1, 10) as cdate, campaign_id, status, user, length_in_sec as call_length, uniqueid, '0' as wait_sec, 'O' as direction, '1' as queue_position, lead_id from vicidial_log $vicidial_log_SQL $and_NANQUE_clause $exc_addtl_statuses UNION ALL select substr(call_date, 1, 10) as cdate, campaign_id, status, user, if(comments='EMAIL', length_in_sec, length_in_sec-queue_seconds) as call_length, uniqueid, queue_seconds as wait_sec, 'I' as direction, queue_position, lead_id from vicidial_closer_log $vicidial_closer_log_SQL $and_NANQUE_clause $exc_addtl_statuses"; if ($DB) {$HTML_output.="$stmt";} # print $stmt."\n"; $rslt=mysql_to_mysqli($stmt, $link); diff --git a/www/VERM/VERM_DOW_rpt.inc b/www/VERM/VERM_DOW_rpt.inc index a987bcef..451fb35b 100644 --- a/www/VERM/VERM_DOW_rpt.inc +++ b/www/VERM/VERM_DOW_rpt.inc @@ -114,7 +114,7 @@ for ($q=0; $q<=6; $q++) $user_array["$key"]=array(); } -$stmt="select dayname(call_date) as cdate, dayofweek(call_date) as day_no, campaign_id, status, user, length_in_sec as call_length, uniqueid, '0' as wait_sec, 'O' as direction, '1' as queue_position, lead_id from vicidial_log $vicidial_log_SQL $and_NANQUE_clause $exc_addtl_statuses UNION ALL select dayname(call_date) as cdate, dayofweek(call_date) as day_no, campaign_id, status, user, length_in_sec-queue_seconds as call_length, uniqueid, queue_seconds as wait_sec, 'I' as direction, queue_position, lead_id from vicidial_closer_log $vicidial_closer_log_SQL $and_NANQUE_clause $exc_addtl_statuses order by day_no"; +$stmt="select dayname(call_date) as cdate, dayofweek(call_date) as day_no, campaign_id, status, user, length_in_sec as call_length, uniqueid, '0' as wait_sec, 'O' as direction, '1' as queue_position, lead_id from vicidial_log $vicidial_log_SQL $and_NANQUE_clause $exc_addtl_statuses UNION ALL select dayname(call_date) as cdate, dayofweek(call_date) as day_no, campaign_id, status, user, if(comments='EMAIL', length_in_sec, length_in_sec-queue_seconds) as call_length, uniqueid, queue_seconds as wait_sec, 'I' as direction, queue_position, lead_id from vicidial_closer_log $vicidial_closer_log_SQL $and_NANQUE_clause $exc_addtl_statuses order by day_no"; if ($DB) {$HTML_output.="$stmt";} # print $stmt."\n"; $rslt=mysql_to_mysqli($stmt, $link); diff --git a/www/VERM/VERM_HOUR_rpt.inc b/www/VERM/VERM_HOUR_rpt.inc index bdb89be0..7428e715 100644 --- a/www/VERM/VERM_HOUR_rpt.inc +++ b/www/VERM/VERM_HOUR_rpt.inc @@ -132,7 +132,7 @@ for ($q=0; $q<1440; $q+=$hourly_slot) $user_array["$key"]=array(); } -$stmt="select substr(call_date-INTERVAL (unix_timestamp(call_date)%".($hourly_slot*60).") SECOND, 12, 5) as cdate, campaign_id, status, user, length_in_sec as call_length, uniqueid, '0' as wait_sec, 'O' as direction, '1' as queue_position, lead_id from vicidial_log $vicidial_log_SQL $and_NANQUE_clause $exc_addtl_statuses UNION ALL select substr(call_date-INTERVAL (unix_timestamp(call_date)%".($hourly_slot*60).") SECOND, 12, 5) as cdate, campaign_id, status, user, length_in_sec-queue_seconds as call_length, uniqueid, queue_seconds as wait_sec, 'I' as direction, queue_position, lead_id from vicidial_closer_log $vicidial_closer_log_SQL $and_NANQUE_clause $exc_addtl_statuses order by cdate"; +$stmt="select substr(call_date-INTERVAL (unix_timestamp(call_date)%".($hourly_slot*60).") SECOND, 12, 5) as cdate, campaign_id, status, user, length_in_sec as call_length, uniqueid, '0' as wait_sec, 'O' as direction, '1' as queue_position, lead_id from vicidial_log $vicidial_log_SQL $and_NANQUE_clause $exc_addtl_statuses UNION ALL select substr(call_date-INTERVAL (unix_timestamp(call_date)%".($hourly_slot*60).") SECOND, 12, 5) as cdate, campaign_id, status, user, if(comments='EMAIL', length_in_sec, length_in_sec-queue_seconds) as call_length, uniqueid, queue_seconds as wait_sec, 'I' as direction, queue_position, lead_id from vicidial_closer_log $vicidial_closer_log_SQL $and_NANQUE_clause $exc_addtl_statuses order by cdate"; # print $stmt."\n"; die; $rslt=mysql_to_mysqli($stmt, $link); while ($row=mysqli_fetch_array($rslt)) diff --git a/www/VERM/VERM_UNANSWERED_DT_rpt.inc b/www/VERM/VERM_UNANSWERED_DT_rpt.inc index 8f552596..2b4adb22 100644 --- a/www/VERM/VERM_UNANSWERED_DT_rpt.inc +++ b/www/VERM/VERM_UNANSWERED_DT_rpt.inc @@ -128,7 +128,7 @@ $sort_unanswered_details_preg=preg_replace('/ desc$/', '', $sort_unanswered_deta # $stmt="select call_date, phone_number, campaign_id, 0 as ivr, '0:00' as wait, sec_to_time(round(length_in_sec)) as duration, '1' as queue_position, CAST(term_reason AS CHAR) as term_reason, user, '1' as attempts, status, uniqueid, 0 as moh_events, '00:00:00' as moh_duration, '' as ivr_duration, '' as ivr_path, '' as did, '' as url, '' as tag, '0' as feat, '0' as vars, '' as feature_codes, '' as variables, uniqueid as detail_id, 'O' as direction from vicidial_log where call_date>='$start_date $start_time' and call_date<='$end_date $end_time' and user in ('VDAD') UNION select call_date, phone_number, campaign_id, 0 as ivr, sec_to_time(round(queue_seconds)) as wait, sec_to_time(round(length_in_sec-queue_seconds)) as duration, queue_position, CAST(term_reason AS CHAR) as term_reason, user, '1' as attempts, status, uniqueid, 0 as moh_events, '00:00:00' as moh_duration, '' as ivr_duration, '' as ivr_path, '' as did, '' as url, '' as tag, '0' as feat, '0' as vars, '' as feature_codes, '' as variables, CONCAT(uniqueid, '|', closecallid) as detail_id, 'I' as direction from vicidial_closer_log where call_date>='$start_date $start_time' and call_date<='$end_date $end_time' and user in ('VDCL') $and_NANQUE_clause $sort_clause"; -$stmt="select call_date, phone_number, campaign_id, 0 as ivr, '0:00' as wait, sec_to_time(round(length_in_sec)) as duration, '1' as queue_position, CAST(term_reason AS CHAR) as term_reason, user, '1' as attempts, status, uniqueid, 0 as moh_events, '00:00:00' as moh_duration, '' as ivr_duration, '' as ivr_path, '' as did, '' as url, '' as tag, '0' as feat, '0' as vars, '' as feature_codes, '' as variables, uniqueid as detail_id, 'O' as direction from vicidial_log $vicidial_log_SQL $exc_addtl_statuses and user in ('VDAD') UNION select call_date, phone_number, campaign_id, 0 as ivr, sec_to_time(round(queue_seconds)) as wait, sec_to_time(round(length_in_sec-queue_seconds)) as duration, queue_position, CAST(term_reason AS CHAR) as term_reason, user, '1' as attempts, status, uniqueid, 0 as moh_events, '00:00:00' as moh_duration, '' as ivr_duration, '' as ivr_path, '' as did, '' as url, '' as tag, '0' as feat, '0' as vars, '' as feature_codes, '' as variables, CONCAT(uniqueid, '|', closecallid) as detail_id, 'I' as direction from vicidial_closer_log $vicidial_closer_log_SQL $exc_addtl_statuses and user in ('VDCL') $and_NANQUE_clause $sort_clause"; +$stmt="select call_date, phone_number, campaign_id, 0 as ivr, '0:00' as wait, sec_to_time(round(length_in_sec)) as duration, '1' as queue_position, CAST(term_reason AS CHAR) as term_reason, user, '1' as attempts, status, uniqueid, 0 as moh_events, '00:00:00' as moh_duration, '' as ivr_duration, '' as ivr_path, '' as did, '' as url, '' as tag, '0' as feat, '0' as vars, '' as feature_codes, '' as variables, uniqueid as detail_id, 'O' as direction from vicidial_log $vicidial_log_SQL $exc_addtl_statuses and user in ('VDAD') UNION select call_date, phone_number, campaign_id, 0 as ivr, sec_to_time(round(queue_seconds)) as wait, sec_to_time(round(if(comments='EMAIL', length_in_sec, length_in_sec-queue_seconds))) as duration, queue_position, CAST(term_reason AS CHAR) as term_reason, user, '1' as attempts, status, uniqueid, 0 as moh_events, '00:00:00' as moh_duration, '' as ivr_duration, '' as ivr_path, '' as did, '' as url, '' as tag, '0' as feat, '0' as vars, '' as feature_codes, '' as variables, CONCAT(uniqueid, '|', closecallid) as detail_id, 'I' as direction from vicidial_closer_log $vicidial_closer_log_SQL $exc_addtl_statuses and user in ('VDCL') $and_NANQUE_clause $sort_clause"; if ($DB) {$HTML_output.="$stmt";} diff --git a/www/VERM/VERM_main_report_page.php b/www/VERM/VERM_main_report_page.php index 177abc41..2b49c2a5 100644 --- a/www/VERM/VERM_main_report_page.php +++ b/www/VERM/VERM_main_report_page.php @@ -853,7 +853,7 @@ if ($length_in_sec_min || $length_in_sec_max) $and_length_in_sec_sql.=" and length_in_sec>='$length_in_sec_min' "; # Closer log - $and_closer_length_in_sec_sql.=" and (length_in_sec-queue_seconds)>='$length_in_sec_min' "; + $and_closer_length_in_sec_sql.=" and if(comments='EMAIL', length_in_sec, (length_in_sec-queue_seconds))>='$length_in_sec_min' "; # Agent log $and_agent_length_in_sec_sql.=" and talk_sec>='$length_in_sec_min' "; @@ -865,7 +865,7 @@ if ($length_in_sec_min || $length_in_sec_max) $and_length_in_sec_sql.=" and length_in_sec<='$length_in_sec_max' "; # Closer log - $and_closer_length_in_sec_sql.=" and (length_in_sec-queue_seconds)<='$length_in_sec_max' "; + $and_closer_length_in_sec_sql.=" and if(comments='EMAIL', length_in_sec, (length_in_sec-queue_seconds))<='$length_in_sec_max' "; # Agent log $and_agent_length_in_sec_sql.=" and talk_sec<='$length_in_sec_max' "; diff --git a/www/VERM/display_call_details.php b/www/VERM/display_call_details.php index 8538837e..71bdaaa1 100644 --- a/www/VERM/display_call_details.php +++ b/www/VERM/display_call_details.php @@ -226,7 +226,7 @@ if (!$closecallid) } else { - $stmt="select date_format(call_date, '%m/%d - %H:%i:%s') as call_date, phone_number, campaign_id, 0 as ivr, queue_seconds as wait, length_in_sec-queue_seconds as duration, queue_position, CAST(term_reason AS CHAR) as term_reason, user, '1' as attempts, status, uniqueid, 0 as moh_events, '00:00:00' as moh_duration, '' as ivr_duration, '' as ivr_path, '' as dnis, '' as url, '' as tag, '0' as feat, '0' as vars, '' as feature_codes, '' as variables, xfercallid, 'I' as direction, lead_id from vicidial_closer_log where uniqueid='$uniqueid' and closecallid='$closecallid'"; + $stmt="select date_format(call_date, '%m/%d - %H:%i:%s') as call_date, phone_number, campaign_id, 0 as ivr, queue_seconds as wait, if(comments='EMAIL', length_in_sec, length_in_sec-queue_seconds) as duration, queue_position, CAST(term_reason AS CHAR) as term_reason, user, '1' as attempts, status, uniqueid, 0 as moh_events, '00:00:00' as moh_duration, '' as ivr_duration, '' as ivr_path, '' as dnis, '' as url, '' as tag, '0' as feat, '0' as vars, '' as feature_codes, '' as variables, xfercallid, 'I' as direction, lead_id from vicidial_closer_log where uniqueid='$uniqueid' and closecallid='$closecallid'"; $vicidial_id=$closecallid; } @@ -409,4 +409,4 @@ function GetRecording($vicidial_id) return array("$rec_row[filename]", "$rec_row[location]", "$rec_row[recording_id]"); } -?> \ No newline at end of file +?> diff --git a/www/VERM/display_outcomes_details.php b/www/VERM/display_outcomes_details.php index fc86dc82..eb654b9e 100644 --- a/www/VERM/display_outcomes_details.php +++ b/www/VERM/display_outcomes_details.php @@ -534,7 +534,7 @@ else $sort_answered_details_preg=preg_replace('/ desc$/', '', $sort_answered_details); ### ALL CALLS FROM vicidial_log AND vicidial_closer_log TABLES - CONTAINS ALL INFO NEEDED BUT DISPO IS UNRELIABLE IN VoxQ -$stmt="select call_date, phone_number, campaign_id, 0 as ivr, '0:00' as wait, sec_to_time(round(length_in_sec)) as duration, '1' as queue_position, CAST(term_reason AS CHAR) as term_reason, user, '1' as attempts, status, uniqueid, 0 as moh_events, '00:00:00' as moh_duration, '' as ivr_duration, '' as ivr_path, '' as did, '' as url, '' as tag, '0' as feat, '0' as vars, '' as feature_codes, '' as variables, uniqueid as detail_id, 'O' as direction from vicidial_log $vicidial_log_SQL and user not in ('VDAD') UNION select call_date, phone_number, campaign_id, 0 as ivr, sec_to_time(round(queue_seconds)) as wait, sec_to_time(round(length_in_sec-queue_seconds)) as duration, queue_position, CAST(term_reason AS CHAR) as term_reason, user, '1' as attempts, status, uniqueid, 0 as moh_events, '00:00:00' as moh_duration, '' as ivr_duration, '' as ivr_path, '' as did, '' as url, '' as tag, '0' as feat, '0' as vars, '' as feature_codes, '' as variables, CONCAT(uniqueid, '|', closecallid) as detail_id, 'I' as direction from vicidial_closer_log $vicidial_closer_log_SQL and user not in ('VDCL') $sort_clause"; +$stmt="select call_date, phone_number, campaign_id, 0 as ivr, '0:00' as wait, sec_to_time(round(length_in_sec)) as duration, '1' as queue_position, CAST(term_reason AS CHAR) as term_reason, user, '1' as attempts, status, uniqueid, 0 as moh_events, '00:00:00' as moh_duration, '' as ivr_duration, '' as ivr_path, '' as did, '' as url, '' as tag, '0' as feat, '0' as vars, '' as feature_codes, '' as variables, uniqueid as detail_id, 'O' as direction from vicidial_log $vicidial_log_SQL and user not in ('VDAD') UNION select call_date, phone_number, campaign_id, 0 as ivr, sec_to_time(round(queue_seconds)) as wait, sec_to_time(round(if(comments='EMAIL', length_in_sec, length_in_sec-queue_seconds))) as duration, queue_position, CAST(term_reason AS CHAR) as term_reason, user, '1' as attempts, status, uniqueid, 0 as moh_events, '00:00:00' as moh_duration, '' as ivr_duration, '' as ivr_path, '' as did, '' as url, '' as tag, '0' as feat, '0' as vars, '' as feature_codes, '' as variables, CONCAT(uniqueid, '|', closecallid) as detail_id, 'I' as direction from vicidial_closer_log $vicidial_closer_log_SQL and user not in ('VDCL') $sort_clause"; # print $stmt; ### ALL CALLS FROM vicidial_agent_log - DISPO COUNTS RELIABLE, NEED TO FILL GAPS IN REPORT WITH ADDITIONAL QUERIES diff --git a/www/vicidial/help_documentation.txt b/www/vicidial/help_documentation.txt index e2562309..a35832b6 100644 --- a/www/vicidial/help_documentation.txt +++ b/www/vicidial/help_documentation.txt @@ -677,7 +677,7 @@ inbound_groups-add_lead_url Add Lead URL This web URL address is not seen b inbound_groups-add_lead_timezone Add Lead Timezone This is the method that the system will use to determine the current timezone when a lead is created when a call is being routed through this in-group. SERVER will use the current timezone of the server. PHONE_CODE_AREACODE will look up the timezone based on the phone code set in the lead and the areacode of the phone number. Default is SERVER. inbound_groups-default_group_alias Default Group Alias If you have allowed Group Aliases for the campaign that the agent is logged into then this is the group alias that is selected first by default on a call coming in from this inbound group when the agent chooses to use a Group Alias for an outbound manual call. Default is NONE or empty. inbound_groups-dial_ingroup_cid Dial In-Group CID If the agent campaign allows for Manual In-Group Dialing, this caller ID number will be sent as the outgoing CID of the phone call if it is populated, overriding the campaign settings and list CID override setting. Default is empty. -inbound_groups-extension_appended_cidname Extension Append CID If enabled, the calls coming in from this in-group will have a space and the phone extension of the agent appended to the end of the CallerID name for the call before it is sent to the agent. Default is N for disabled. If USER is part of the option, then the user ID will be used instead of the phone extension. If WITH_CAMPAIGN is used, then another spae and the campaign ID will be included as well. +inbound_groups-extension_appended_cidname Extension Append CID If enabled, the calls coming in from this in-group will have a space and the phone extension of the agent appended to the end of the CallerID name for the call before it is sent to the agent. Default is N for disabled. If USER is part of the option, then the user ID will be used instead of the phone extension. If WITH_CAMPAIGN is used, then another space and the campaign ID will be included as well. inbound_groups-uniqueid_status_display Uniqueid Status Display If enabled, when an agent receives a call through this in-group they will see the uniqueid of the call added to the status line in their agent interface. The PREFIX option will add the prefix, defined below, to the beginning of the uniqueid in the display. Default is DISABLED. If there was already a Uniqueid defined on a call entering this in-group, then the original uniqueid will be displayed. If the PRESERVE option is used and the call is sent to a second agent, the uniqueid and prefix displayed to the first agent will also be displayed to the second agent. inbound_groups-uniqueid_status_prefix Uniqueid Status Prefix If PREFIX option is selected above then this is the value of that prefix. Default is empty. inbound_groups-customer_chat_screen_colors Customer Chat Screen Colors This option allows you to select the colors and logo that the customer will see when they use the chat screen. default is the default blue color scheme.