feat(trunk): add customizable Asterisk Trunk Dial Options field with quick presets (tTR, TR, T)

This commit is contained in:
sorcier committed 2026-11-04 00:18:37 +01:00
1 parent bf2e2098f0
commit b3c98834c8
5 files changed
+43 -3

No files matched your search

+11
View File
@@ -2032,6 +2032,13 @@ function syncTrunkHostDomain(hostVal) {
form.elements['from_domain'].value = '';
}
function setTrunkDialOptionsPreset(val) {
const form = document.getElementById('form-trunk');
if (form && form.elements['dial_options']) {
form.elements['dial_options'].value = val;
}
}
function populateInboundDestDropdown(selectedValue = '101') {
const select = document.getElementById('trunk-inbound-select');
const form = document.getElementById('form-trunk');
@@ -2096,6 +2103,7 @@ function parseFreePbxConfig() {
if (val.includes('toheader')) form.elements['context'].value = 'from-pstn-toheader';
else form.elements['context'].value = 'from-external';
}
else if (key === 'dialopts' || key === 'dial_options' || key === 'asterisk_trunk_dial_options') form.elements['dial_options'].value = val;
else if (key === 'outboundproxy') form.elements['outbound_proxy'].value = val;
});
@@ -2324,6 +2332,9 @@ function openTrunkModal(trunk = null) {
if (form.elements['cid_name_prefix']) {
form.elements['cid_name_prefix'].value = trunk ? (trunk.cid_name_prefix || '') : '';
}
if (form.elements['dial_options']) {
form.elements['dial_options'].value = trunk ? (trunk.dial_options || 'tTR') : 'tTR';
}
populateInboundDestDropdown(trunk ? (trunk.inbound_dest || '101') : '101');
// Musique d'attente (MoH) spécifique à ce Trunk