Merge pull request #1219 from mafoo/bugfix_voicemail

Bugfix voicemail
This commit is contained in:
FusionPBX
2015-11-02 20:18:58 -07:00
4 changed files with 20 additions and 7 deletions

View File

@@ -48,6 +48,13 @@ if ($domains_processed == 1) {
$array[$x]['default_setting_enabled'] = 'true';
$array[$x]['default_setting_description'] = 'Define whether to keep voicemail files on the local system after sending attached via email.';
$x++;
$array[$x]['default_setting_category'] = 'voicemail';
$array[$x]['default_setting_subcategory'] = 'storage_type';
$array[$x]['default_setting_name'] = 'text';
$array[$x]['default_setting_value'] = 'base64';
$array[$x]['default_setting_enabled'] = 'false';
$array[$x]['default_setting_description'] = 'Define which storage type (base_64 stores in the database).';
$x++;
//iterate and add each, if necessary
foreach ($array as $index => $default_settings) {

View File

@@ -161,7 +161,7 @@
if ($result_count > 0) {
foreach($result as &$row) {
//set the greeting directory
$path = $_SESSION['switch']['storage']['dir'].'/voicemail/default/'.$_SESSION['domain_name'].'/'.$row['voicemail_id'];
$path = $_SESSION['switch']['voicemail']['dir'].'/default/'.$_SESSION['domain_name'].'/'.$row['voicemail_id'];
if (file_exists($path.'/msg_'.$row['voicemail_message_uuid'].'.wav')) {
$row['file_path'] = $path.'/msg_'.$row['voicemail_message_uuid'].'.wav';
}
@@ -239,7 +239,7 @@
}
//delete the recording
$file_path = $_SESSION['switch']['storage']['dir']."/voicemail/default/".$_SESSION['domain_name']."/".$this->voicemail_id;
$file_path = $_SESSION['switch']['voicemail']['dir']."/default/".$_SESSION['domain_name']."/".$this->voicemail_id;
foreach (glob($file_path."/msg_".$this->voicemail_message_uuid.".*") as $file_name) {
unlink($file_name);
}
@@ -278,7 +278,7 @@
session_cache_limiter('public');
//set source folder path
$path = $_SESSION['switch']['storage']['dir'].'/voicemail/default/'.$_SESSION['domain_name'].'/'.$this->voicemail_id;
$path = $_SESSION['switch']['voicemail']['dir'].'/default/'.$_SESSION['domain_name'].'/'.$this->voicemail_id;
//prepare base64 content from db, if enabled
if ($_SESSION['voicemail']['storage_type']['text'] == 'base64') {

View File

@@ -131,9 +131,6 @@ if ($domains_processed == 1) {
if (strlen($_SESSION['switch']['sounds']['dir']) > 0) {
$tmp .= correct_path(" sounds_dir = [[".$_SESSION['switch']['sounds']['dir']."]];\n");
}
if (strlen($_SESSION['switch']['phrases']['dir']) > 0) {
$tmp .= correct_path(" phrases_dir = [[".$_SESSION['switch']['phrases']['dir']."]];\n");
}
if (strlen($_SESSION['switch']['db']['dir']) > 0) {
$tmp .= correct_path(" database_dir = [[".$_SESSION['switch']['db']['dir']."]];\n");
}

View File

@@ -142,9 +142,18 @@
table.insert(xml, [[ </macro>]]);;
end
require "resources.functions.settings";
settings = settings(domain_uuid);
lang_path = "/usr/local/freeswitch/conf/lang/";
if (settings['switch']['phrases'] ~= nil) then
if (settings['switch']['phrases']['dir'] ~= nil) then
lang_path = settings['switch']['phrases']['dir'];
end
end
--read root xml language file, parse included xml files
local xml_file_paths = {}
local file_handle = io.open(phrases_dir.."/"..language.."/"..language..".xml", "r");
local file_handle = io.open(lang_path.."/"..language.."/"..language..".xml", "r");
if (file_handle ~= nil) then
for file_line in file_handle:lines() do
if (string.find(file_line, 'cmd="include" data="', 0, true) ~= nil) then