Work around for FreeSWITCH bug where .loc break Music on Hold.

Fixed in the following commit.
https://github.com/signalwire/freeswitch/pull/1577

The commit was accepted. Hoping the bug fix is included in the next release of FreeSWITCH 1.10.8. However we need a work around for those using older versions and 1.10.8 hasn't been released yet.
This commit is contained in:
FusionPBX
2022-07-19 12:02:54 -06:00
committed by GitHub
parent 3eb258c7ea
commit 4cf53c9719

View File

@@ -229,6 +229,7 @@
//define default path
if ($action == "add") {
$stream_path = path_join($_SESSION['switch']['sounds']['dir'], 'music', $_SESSION['domain_name'], $stream_name, $path_rate);
$stream_path = str_replace('.loc', '._loc', $stream_path); // 14.03.22 freeswitch bug
}
//find whether the path already exists
@@ -277,6 +278,13 @@
//check target folder, move uploaded file
if (!is_dir($stream_path)) {
mkdir($stream_path, 0770, true);
// 14.03.22 freeswitch bug - shouldn't be needed with freeswitch 1.10.8
if (preg_match('|^(/usr/share/freeswitch/sounds/music/(.*?\._loc.*?))/|', $stream_path, $m)) {
$fs_bug_target = $m[2];
$fs_bug_link = str_replace('._loc', '.loc', $m[1]);
symlink($fs_bug_target, $fs_bug_link);
}
}
if (is_dir($stream_path)) {
if (copy($stream_file_name_temp, $stream_path.'/'.$stream_file_name)) {