fix(trunk): match PJSIP endpoint name to username in receive mode and auto-reload on trunk save

This commit is contained in:
sorcier committed 2026-11-03 19:29:57 +01:00
1 parent f429a48ad6
commit db233f853c
2 files changed
+40 -34

No files matched your search

+13
View File
@@ -1279,6 +1279,12 @@ try {
$stmt->execute($params);
}
$generator->writeAllConfigs();
try {
$ami = AmiClient::fromDatabase($db);
$ami->reloadPjsipAndDialplan();
} catch (\Throwable $e) {}
$displayHost = $host !== '' ? "{$host}:{$port}" : "Passerelle locale / HT813";
echo json_encode([
'success' => true,
@@ -1289,6 +1295,13 @@ try {
case 'delete_trunk':
$id = (int)($payload['id'] ?? 0);
$db->prepare('DELETE FROM trunks WHERE id = :id')->execute([':id' => $id]);
$generator->writeAllConfigs();
try {
$ami = AmiClient::fromDatabase($db);
$ami->reloadPjsipAndDialplan();
} catch (\Throwable $e) {}
echo json_encode([
'success' => true,
'message' => 'Trunk SIP supprimé.',