From e06d5a64c54648cc5e52cd6f8ec525ba75e61a79 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 22 Nov 2021 09:45:41 -0700 Subject: [PATCH] Create new voicemail directory when adding a new domain. --- core/domains/domain_edit.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/core/domains/domain_edit.php b/core/domains/domain_edit.php index bba7b7ef71..459f4e39ec 100644 --- a/core/domains/domain_edit.php +++ b/core/domains/domain_edit.php @@ -155,12 +155,19 @@ } //create the recordings directory for the new domain. - if (is_array($_SESSION['switch']['recordings']) && strlen($_SESSION['switch']['recordings']['dir']."/".$domain_name) > 0) { - if (!is_readable($_SESSION['switch']['recordings']['dir']."/".$domain_name)) { + if (isset($_SESSION['switch']['recordings']['dir']) && strlen($_SESSION['switch']['recordings']['dir']) > 0) { + if (!file_exists($_SESSION['switch']['recordings']['dir']."/".$domain_name)) { mkdir($_SESSION['switch']['recordings']['dir']."/".$domain_name, 0770); } } + //create the voicemail directory for the new domain. + if (isset($_SESSION['switch']['voicemail']['dir']) && strlen($_SESSION['switch']['voicemail']['dir']) > 0) { + if (!file_exists($_SESSION['switch']['voicemail']['dir']."/default/".$domain_name)) { + mkdir($_SESSION['switch']['voicemail']['dir']."/default/".$domain_name, 0770); + } + } + } else { message::add($text['message-domain_exists'],'negative');