Fix errors when fax directory isn't set
This commit is contained in:
parent
51b22069ee
commit
d5a4146c57
|
|
@ -111,7 +111,9 @@ if (!$included) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//set the fax directory
|
//set the fax directory
|
||||||
|
if (!empty($_SESSION['switch']['storage']['dir'])) {
|
||||||
$fax_dir = $_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domain_name'];
|
$fax_dir = $_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domain_name'];
|
||||||
|
}
|
||||||
|
|
||||||
//set fax cover font to generate pdf
|
//set fax cover font to generate pdf
|
||||||
$fax_cover_font = $_SESSION['fax']['cover_font']['text'] ?? null;
|
$fax_cover_font = $_SESSION['fax']['cover_font']['text'] ?? null;
|
||||||
|
|
@ -154,20 +156,20 @@ if (!function_exists('fax_split_dtmf')) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//get the fax extension
|
//get the fax extension
|
||||||
if (isset($fax_extension) && is_numeric($fax_extension)) {
|
if (isset($fax_dir) && isset($fax_extension) && is_numeric($fax_extension)) {
|
||||||
//set the fax directories. example /usr/local/freeswitch/storage/fax/329/inbox
|
//set the fax directories. example /usr/local/freeswitch/storage/fax/329/inbox
|
||||||
$dir_fax_inbox = $fax_dir.'/'.$fax_extension.'/inbox';
|
$dir_fax_inbox = $fax_dir.'/'.$fax_extension.'/inbox';
|
||||||
$dir_fax_sent = $fax_dir.'/'.$fax_extension.'/sent';
|
$dir_fax_sent = $fax_dir.'/'.$fax_extension.'/sent';
|
||||||
$dir_fax_temp = $fax_dir.'/'.$fax_extension.'/temp';
|
$dir_fax_temp = $fax_dir.'/'.$fax_extension.'/temp';
|
||||||
|
|
||||||
//make sure the directories exist
|
//make sure the directories exist
|
||||||
if (!is_dir($_SESSION['switch']['storage']['dir'])) {
|
if (!empty($_SESSION['switch']['storage']['dir']) && !is_dir($_SESSION['switch']['storage']['dir'])) {
|
||||||
mkdir($_SESSION['switch']['storage']['dir'], 0770);
|
mkdir($_SESSION['switch']['storage']['dir'], 0770);
|
||||||
}
|
}
|
||||||
if (!is_dir($_SESSION['switch']['storage']['dir'].'/fax')) {
|
if (!empty($_SESSION['switch']['storage']['dir']) && !is_dir($_SESSION['switch']['storage']['dir'].'/fax')) {
|
||||||
mkdir($_SESSION['switch']['storage']['dir'].'/fax', 0770);
|
mkdir($_SESSION['switch']['storage']['dir'].'/fax', 0770);
|
||||||
}
|
}
|
||||||
if (!is_dir($_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domain_name'])) {
|
if (!empty($_SESSION['switch']['storage']['dir']) && !is_dir($_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domain_name'])) {
|
||||||
mkdir($_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domain_name'], 0770);
|
mkdir($_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domain_name'], 0770);
|
||||||
}
|
}
|
||||||
if (!is_dir($fax_dir.'/'.$fax_extension)) {
|
if (!is_dir($fax_dir.'/'.$fax_extension)) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue