diff --git a/app/voicemails/app_defaults.php b/app/voicemails/app_defaults.php index d81acb5140..0fab2304d7 100644 --- a/app/voicemails/app_defaults.php +++ b/app/voicemails/app_defaults.php @@ -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) { diff --git a/app/voicemails/resources/classes/voicemail.php b/app/voicemails/resources/classes/voicemail.php index ca5b55ba00..27f7e304af 100644 --- a/app/voicemails/resources/classes/voicemail.php +++ b/app/voicemails/resources/classes/voicemail.php @@ -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') {