diff --git a/app/voicemails/app_defaults.php b/app/voicemails/app_defaults.php index 0fab2304d7..34d2544a2c 100644 --- a/app/voicemails/app_defaults.php +++ b/app/voicemails/app_defaults.php @@ -58,8 +58,7 @@ if ($domains_processed == 1) { //iterate and add each, if necessary foreach ($array as $index => $default_settings) { - - //add the default setting + //add the default setting $sql = "select count(*) as num_rows from v_default_settings "; $sql .= "where default_setting_category = '".$default_settings['default_setting_category']."' "; $sql .= "and default_setting_subcategory = '".$default_settings['default_setting_subcategory']."' "; @@ -78,9 +77,22 @@ if ($domains_processed == 1) { } unset($row); } - } + //add that the directory structure for voicemail each domain and voicemail id is + $sql = "select d.domain_name, v.voicemail_id "; + $sql .= "from v_domains as d, v_voicemails as v "; + $sql .= "where v.domain_uuid = d.domain_uuid "; + $prep_statement = $db->prepare($sql); + $prep_statement->execute(); + $voicemails = $prep_statement->fetchAll(PDO::FETCH_ASSOC); + foreach ($voicemails as $row) { + $path = $_SESSION['switch']['voicemail']['dir'].'/default/'.$row['domain_name'].'/'.$row['voicemail_id']; + echo $path."\n"; + mkdir($path, 07, true); + } + unset ($prep_statement, $sql); + } ?> \ No newline at end of file