Fix *2 recording path for single-tenant (right patch for dev branch this time)

This commit is contained in:
Johan Brannlund 2014-10-12 15:29:31 +00:00
parent 344c9e5768
commit a55b5b9c4e
1 changed files with 8 additions and 1 deletions

View File

@ -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'];