feat(outbound): add voice announcement on trunk congestion & clarify MoH options

This commit is contained in:
sorcier committed 2026-11-04 00:55:53 +01:00
1 parent a308f5d0ed
commit e98410202f
4 files changed
+47 -9

No files matched your search

+22 -6
View File
@@ -2561,14 +2561,30 @@ function openOutboundRouteModal(route = null) {
const recMode = route ? route.record_mode : 'dontcare';
form.querySelectorAll('input[name="record_mode"]').forEach(r => r.checked = (r.value === recMode));
// Destination sur congestion
// Destination sur congestion / Trunks indisponibles
const congSel = document.getElementById('ob-congestion-dest-select');
if (congSel) {
congSel.innerHTML = `
<option value="terminate-congestion" ${(!route || route.congestion_dest === 'terminate-congestion') ? 'selected' : ''}>Congestion (Tonalité réseau saturé)</option>
<option value="terminate-busy" ${route?.congestion_dest === 'terminate-busy' ? 'selected' : ''}>Busy (Occupation définitive)</option>
<option value="terminate-hangup" ${route?.congestion_dest === 'terminate-hangup' ? 'selected' : ''}>Hangup (Raccrocher)</option>
const curCong = route ? route.congestion_dest : 'all-circuits-busy';
let congOpts = `
<optgroup label="📢 Messages Vocaux (Recommandé)">
<option value="all-circuits-busy" ${(curCong === 'all-circuits-busy' || (!route && curCong !== 'terminate-congestion')) ? 'selected' : ''}>📢 Message vocal standard (« Toutes les lignes sont occupées »)</option>
`;
const annSounds = (appState.sounds || []).filter(s => s.usage_type !== 'moh');
if (annSounds.length > 0) {
annSounds.forEach(s => {
const val = `sound-${s.id}`;
congOpts += `<option value="${val}" ${curCong === val ? 'selected' : ''}>🎙️ Annonce : ${escapeHtml(s.name)}</option>`;
});
}
congOpts += `
</optgroup>
<optgroup label="📴 Tonalités & Raccrochage">
<option value="terminate-congestion" ${curCong === 'terminate-congestion' ? 'selected' : ''}>Tonalité de Congestion (Bip rapide réseau saturé)</option>
<option value="terminate-busy" ${curCong === 'terminate-busy' ? 'selected' : ''}>Tonalité d'Occupation (Bip occupé)</option>
<option value="terminate-hangup" ${curCong === 'terminate-hangup' ? 'selected' : ''}>Raccrocher immédiatement</option>
</optgroup>
`;
congSel.innerHTML = congOpts;
}
// Musique d'attente (MOH)
@@ -2576,7 +2592,7 @@ function openOutboundRouteModal(route = null) {
if (mohSel) {
const curMoh = route ? (route.moh_class || 'default') : 'default';
const mohSounds = (appState.sounds || []).filter(s => s.usage_type === 'moh');
let mohOpts = `<option value="default" ${curMoh === 'default' ? 'selected' : ''}>Défaut (Standard)</option>`;
let mohOpts = `<option value="default" ${curMoh === 'default' ? 'selected' : ''}>🌐 Hériter du Trunk / Global (Recommandé)</option>`;
mohSounds.forEach(s => {
const sSlug = slugifyTrunkName(s.site_category || 'global');
const cName = (sSlug === 'global' || sSlug === 'default') ? 'default' : `moh-${sSlug}`;