From a55b5b9c4e15fb00bb8bf62c5d7f20237bf6f783 Mon Sep 17 00:00:00 2001 From: Johan Brannlund Date: Sun, 12 Oct 2014 15:29:31 +0000 Subject: [PATCH] Fix *2 recording path for single-tenant (right patch for dev branch this time) --- app/xml_cdr/xml_cdr.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/xml_cdr/xml_cdr.php b/app/xml_cdr/xml_cdr.php index bc9d157203..f10ad7323b 100644 --- a/app/xml_cdr/xml_cdr.php +++ b/app/xml_cdr/xml_cdr.php @@ -352,6 +352,13 @@ else { require_once "resources/classes/database.php"; $database = new database; } + + if (count($_SESSION['domains']) == 1) { // add to path if single-tenant + $path_mod = $_SESSION["domain_name"]; + } + else { + $path_mod = ""; + } if ($result_count > 0) { foreach($result as $row) { $tmp_year = date("Y", strtotime($row['start_stamp'])); @@ -372,7 +379,7 @@ else { //If they cancelled, show the ring time, not the bill time. $seconds = ($row['hangup_cause']=="ORIGINATOR_CANCEL") ? $row['duration'] : $row['billsec']; - $tmp_dir = $_SESSION['switch']['recordings']['dir'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day; + $tmp_dir = $_SESSION['switch']['recordings']['dir'].'/'.$path_mod.'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day; $tmp_name = ''; if(!empty($row['recording_file']) && file_exists($row['recording_file'])){ $tmp_name=$row['recording_file'];