MasterVitronic / fusionpbx

Automatically exported from code.google.com/p/fusionpbx
0 stars 0 forks source link

Calls not being recorded, solved #486

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a new tenant\domain and setup call recording in the dialplan
2. Place a test call (which is to be recorded)

What is the expected output? What do you see instead?

The call should be recorded, instead we see a permissions error since only 
apache has permission to the recording directory not freeswitch.

What version of the product are you using? On what operating system?

FusionPBX Revision: 4642
Freeswitch Version: 1.2.13
CentOS release 6.4 (Final)

Please provide any additional information below.

I've fixed the problem by replacing the existing code starting at line 134 with 
the following in the file /var/www/html/fusionpbx/resources/switch.php

//create the recordings/archive/year/month/day directory structure
    $recording_archive_dir = $_SESSION['switch']['recordings']['dir']."/archive/".date("Y")."/".date("M")."/".date("d");
    $freeswitch_user = "freeswitch";
    if(!is_dir($recording_archive_dir)) {
        mkdir($recording_archive_dir, 0774, true);
        chmod($_SESSION['switch']['recordings']['dir']."/archive/".date("Y"), 0774);
        chgrp($_SESSION['switch']['recordings']['dir']."/archive/".date("Y"), $freeswitch_user);
        chmod($_SESSION['switch']['recordings']['dir']."/archive/".date("Y")."/".date("M"), 0774);
        chgrp($_SESSION['switch']['recordings']['dir']."/archive/".date("Y")."/".date("M"), $freeswitch_user);
        chmod($recording_archive_dir, 0774);
        chgrp($recording_archive_dir, $freeswitch_user);
    }

Original issue reported on code.google.com by shaun.st...@itec-support.co.uk on 24 Oct 2013 at 9:55

GoogleCodeExporter commented 9 years ago
A better thing to do is have freeswitch create the directory. That way the 
permissions will be correct.

Original comment by markjcrane@gmail.com on 12 Apr 2014 at 5:44