feat(outbound): add voice announcement on trunk congestion & clarify MoH options
This commit is contained in:
1 parent
a308f5d0ed
commit
e98410202f
4 files changed
+47
-9
No files matched your search
+22
-6
@@ -2561,14 +2561,30 @@ function openOutboundRouteModal(route = null) {
|
|||||||
const recMode = route ? route.record_mode : 'dontcare';
|
const recMode = route ? route.record_mode : 'dontcare';
|
||||||
form.querySelectorAll('input[name="record_mode"]').forEach(r => r.checked = (r.value === recMode));
|
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');
|
const congSel = document.getElementById('ob-congestion-dest-select');
|
||||||
if (congSel) {
|
if (congSel) {
|
||||||
congSel.innerHTML = `
|
const curCong = route ? route.congestion_dest : 'all-circuits-busy';
|
||||||
<option value="terminate-congestion" ${(!route || route.congestion_dest === 'terminate-congestion') ? 'selected' : ''}>Congestion (Tonalité réseau saturé)</option>
|
let congOpts = `
|
||||||
<option value="terminate-busy" ${route?.congestion_dest === 'terminate-busy' ? 'selected' : ''}>Busy (Occupation définitive)</option>
|
<optgroup label="📢 Messages Vocaux (Recommandé)">
|
||||||
<option value="terminate-hangup" ${route?.congestion_dest === 'terminate-hangup' ? 'selected' : ''}>Hangup (Raccrocher)</option>
|
<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)
|
// Musique d'attente (MOH)
|
||||||
@@ -2576,7 +2592,7 @@ function openOutboundRouteModal(route = null) {
|
|||||||
if (mohSel) {
|
if (mohSel) {
|
||||||
const curMoh = route ? (route.moh_class || 'default') : 'default';
|
const curMoh = route ? (route.moh_class || 'default') : 'default';
|
||||||
const mohSounds = (appState.sounds || []).filter(s => s.usage_type === 'moh');
|
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 => {
|
mohSounds.forEach(s => {
|
||||||
const sSlug = slugifyTrunkName(s.site_category || 'global');
|
const sSlug = slugifyTrunkName(s.site_category || 'global');
|
||||||
const cName = (sSlug === 'global' || sSlug === 'default') ? 'default' : `moh-${sSlug}`;
|
const cName = (sSlug === 'global' || sSlug === 'default') ? 'default' : `moh-${sSlug}`;
|
||||||
|
|||||||
+1
-1
@@ -3102,7 +3102,7 @@ $currentUser = Auth::getUsername();
|
|||||||
<select id="ob-musicclass-select" name="moh_class" class="w-full px-3 py-2 rounded-lg bg-anthracite-900 border border-anthracite-700 text-xs text-white"></select>
|
<select id="ob-musicclass-select" name="moh_class" class="w-full px-3 py-2 rounded-lg bg-anthracite-900 border border-anthracite-700 text-xs text-white"></select>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label class="block text-xs font-medium text-slate-200 mb-1">Destination sur Congestion <span class="text-slate-400">(Échec total)</span></label>
|
<label class="block text-xs font-medium text-slate-200 mb-1">📢 Si Trunks indisponibles <span class="text-slate-400">(Échec / Congestion)</span></label>
|
||||||
<select id="ob-congestion-dest-select" name="congestion_dest" class="w-full px-3 py-2 rounded-lg bg-anthracite-900 border border-anthracite-700 text-xs text-white"></select>
|
<select id="ob-congestion-dest-select" name="congestion_dest" class="w-full px-3 py-2 rounded-lg bg-anthracite-900 border border-anthracite-700 text-xs text-white"></select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+23
-1
@@ -1240,6 +1240,24 @@ class ConfigGenerator
|
|||||||
$lines[] = " same => n,Congestion(20)";
|
$lines[] = " same => n,Congestion(20)";
|
||||||
$lines[] = " same => n,Hangup()";
|
$lines[] = " same => n,Hangup()";
|
||||||
$lines[] = "";
|
$lines[] = "";
|
||||||
|
$lines[] = "exten => all-circuits-busy,1,NoOp(Terminate Call: Message vocal toutes les lignes sont occupees)";
|
||||||
|
$lines[] = " same => n,Answer()";
|
||||||
|
$lines[] = " same => n,Playback(all-circuits-busy-now)";
|
||||||
|
$lines[] = " same => n,Congestion(10)";
|
||||||
|
$lines[] = " same => n,Hangup()";
|
||||||
|
$lines[] = "";
|
||||||
|
$lines[] = "exten => _play-custom-.,1,NoOp(Terminate Call: Lecture annonce personnalisee \${EXTEN:12})";
|
||||||
|
$lines[] = " same => n,Answer()";
|
||||||
|
$lines[] = " same => n,Playback(custom/\${EXTEN:12})";
|
||||||
|
$lines[] = " same => n,Congestion(10)";
|
||||||
|
$lines[] = " same => n,Hangup()";
|
||||||
|
$lines[] = "";
|
||||||
|
$lines[] = "exten => _play-.,1,NoOp(Terminate Call: Lecture annonce systeme \${EXTEN:5})";
|
||||||
|
$lines[] = " same => n,Answer()";
|
||||||
|
$lines[] = " same => n,Playback(\${EXTEN:5})";
|
||||||
|
$lines[] = " same => n,Congestion(10)";
|
||||||
|
$lines[] = " same => n,Hangup()";
|
||||||
|
$lines[] = "";
|
||||||
$lines[] = "exten => zapateller,1,NoOp(Terminate Call: Tonalite SIT Anti-Robot)";
|
$lines[] = "exten => zapateller,1,NoOp(Terminate Call: Tonalite SIT Anti-Robot)";
|
||||||
$lines[] = " same => n,Answer()";
|
$lines[] = " same => n,Answer()";
|
||||||
$lines[] = " same => n,Zapateller()";
|
$lines[] = " same => n,Zapateller()";
|
||||||
@@ -2130,6 +2148,9 @@ class ConfigGenerator
|
|||||||
if ($dest === 'congestion' || $dest === 'terminate-congestion') {
|
if ($dest === 'congestion' || $dest === 'terminate-congestion') {
|
||||||
return 'Goto(app-terminate,congestion,1)';
|
return 'Goto(app-terminate,congestion,1)';
|
||||||
}
|
}
|
||||||
|
if ($dest === 'all-circuits-busy' || $dest === 'voice-all-circuits-busy') {
|
||||||
|
return 'Goto(app-terminate,all-circuits-busy,1)';
|
||||||
|
}
|
||||||
if ($dest === 'zapateller' || $dest === 'terminate-zapateller') {
|
if ($dest === 'zapateller' || $dest === 'terminate-zapateller') {
|
||||||
return 'Goto(app-terminate,zapateller,1)';
|
return 'Goto(app-terminate,zapateller,1)';
|
||||||
}
|
}
|
||||||
@@ -2160,7 +2181,8 @@ class ConfigGenerator
|
|||||||
if (str_starts_with($dest, 'sound-')) {
|
if (str_starts_with($dest, 'sound-')) {
|
||||||
$snd = $this->resolveSoundFile(substr($dest, 6));
|
$snd = $this->resolveSoundFile(substr($dest, 6));
|
||||||
if ($snd !== '') {
|
if ($snd !== '') {
|
||||||
return "Playback({$snd})";
|
$safeTarget = str_replace('/', '-', $snd);
|
||||||
|
return "Goto(app-terminate,play-{$safeTarget},1)";
|
||||||
}
|
}
|
||||||
return 'Goto(app-terminate,hangup,1)';
|
return 'Goto(app-terminate,hangup,1)';
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -639,7 +639,7 @@ class Database
|
|||||||
':agroups' => json_encode($grps),
|
':agroups' => json_encode($grps),
|
||||||
':aexts' => json_encode($exts),
|
':aexts' => json_encode($exts),
|
||||||
':cont' => 1,
|
':cont' => 1,
|
||||||
':cdest' => 'terminate-busy',
|
':cdest' => 'all-circuits-busy',
|
||||||
':rec' => 'dontcare',
|
':rec' => 'dontcare',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user