feat(sounds): absolute audio paths for custom sounds making IVRs fully language-agnostic (v1.5.0)

This commit is contained in:
sorcier committed 2026-11-04 12:09:32 +01:00
1 parent 6c74e09203
commit accec47d08
4 files changed
+15 -9

No files matched your search

+1 -1
View File
@@ -140,7 +140,7 @@ try {
$installedVerData = file_exists("{$appDir}/version.json") $installedVerData = file_exists("{$appDir}/version.json")
? json_decode((string)file_get_contents("{$appDir}/version.json"), true) ? json_decode((string)file_get_contents("{$appDir}/version.json"), true)
: []; : [];
$installedVer = $installedVerData['version'] ?? '1.4.9'; $installedVer = $installedVerData['version'] ?? '1.5.0';
echo json_encode([ echo json_encode([
'success' => true, 'success' => true,
+1 -1
View File
@@ -18,7 +18,7 @@ $companyLogo = trim($branding['company_logo'] ?? '');
$hasBranding = !empty($companyName) || !empty($companyLogo); $hasBranding = !empty($companyName) || !empty($companyLogo);
$appVerData = file_exists(__DIR__ . '/../version.json') ? json_decode((string)file_get_contents(__DIR__ . '/../version.json'), true) : []; $appVerData = file_exists(__DIR__ . '/../version.json') ? json_decode((string)file_get_contents(__DIR__ . '/../version.json'), true) : [];
$appVersion = $appVerData['version'] ?? '1.4.9'; $appVersion = $appVerData['version'] ?? '1.5.0';
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="fr" class="h-full"> <html lang="fr" class="h-full">
+8 -2
View File
@@ -2219,18 +2219,24 @@ class ConfigGenerator
$stmt = $this->db->prepare('SELECT slug FROM sounds WHERE id = :id'); $stmt = $this->db->prepare('SELECT slug FROM sounds WHERE id = :id');
$stmt->execute([':id' => (int)$soundRef]); $stmt->execute([':id' => (int)$soundRef]);
$slug = $stmt->fetchColumn(); $slug = $stmt->fetchColumn();
return $slug ? "custom/{$slug}" : $fallback; return $slug ? "/var/lib/asterisk/sounds/custom/{$slug}" : $fallback;
} }
$ref = trim((string)$soundRef); $ref = trim((string)$soundRef);
if (str_starts_with($ref, 'sound-')) { if (str_starts_with($ref, 'sound-')) {
return $this->resolveSoundFile(substr($ref, 6), $fallback); return $this->resolveSoundFile(substr($ref, 6), $fallback);
} }
if (str_starts_with($ref, 'custom/')) {
return "/var/lib/asterisk/sounds/{$ref}";
}
if (str_starts_with($ref, '/var/lib/asterisk/sounds/custom/')) {
return $ref;
}
if (!str_contains($ref, '/') && !in_array($ref, ['demo-instruct', 'demo-echotest', 'pbx-invalid', 'hello-world', 'beep', 'silence/1', 'vm-goodbye'])) { if (!str_contains($ref, '/') && !in_array($ref, ['demo-instruct', 'demo-echotest', 'pbx-invalid', 'hello-world', 'beep', 'silence/1', 'vm-goodbye'])) {
$stmt = $this->db->prepare('SELECT slug FROM sounds WHERE slug = :slug OR name = :name'); $stmt = $this->db->prepare('SELECT slug FROM sounds WHERE slug = :slug OR name = :name');
$stmt->execute([':slug' => $ref, ':name' => $ref]); $stmt->execute([':slug' => $ref, ':name' => $ref]);
$slug = $stmt->fetchColumn(); $slug = $stmt->fetchColumn();
if ($slug) { if ($slug) {
return "custom/{$slug}"; return "/var/lib/asterisk/sounds/custom/{$slug}";
} }
} }
return $ref ?: $fallback; return $ref ?: $fallback;
+5 -5
View File
@@ -1,12 +1,12 @@
{ {
"version": "1.4.9", "version": "1.5.0",
"codename": "Helios", "codename": "Helios",
"release_date": "2026-11-04", "release_date": "2026-11-04",
"min_php_version": "8.2", "min_php_version": "8.2",
"changelog": [ "changelog": [
"Résolution du chemin audio des annonces personnalisées SVI sous Debian (/sounds/fr/custom/)", "Gestion native et universelle des sons personnalisés par chemin absolu Asterisk (compatible multilingue français, anglais, italien, espagnol sans dépendance aux liens symboliques)",
"Restauration instantanée du statut en ligne des postes après restauration de sauvegarde (sans délai de Qualify)", "Préservation automatique des invites système par langue (fr, en, it, es)",
"Correction des conflits de préfixes Dialplan (*801-*899 vs *8 / *80)", "Résolution définitive et propre des conflits de préfixes Dialplan sur les SVI/IVR (*801-*899)",
"Code propre, robuste et optimisé sans surcharge" "Restauration instantanée du statut en ligne des postes après restauration de sauvegarde"
] ]
} }