Initial commit - NexusPBX IP Telephony Platform

This commit is contained in:
sorcier committed 2026-11-02 02:24:47 +01:00
commit c5de8d0c71
25 files changed
+18123

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
// Arguments transmis par Asterisk externpassnotify : <context> <mailbox> <newpassword>
$context = $argv[1] ?? 'default';
$mailbox = trim((string)($argv[2] ?? ''));
$newPass = trim((string)($argv[3] ?? ''));
if ($mailbox === '' || $newPass === '') {
exit(0);
}
require_once __DIR__ . '/../src/Database.php';
try {
$db = \App\Database::getConnection();
$stmt = $db->prepare('
UPDATE extensions
SET voicemail_pin = :pin, force_pin_change = 0
WHERE extension = :ext
');
$stmt->execute([
':pin' => $newPass,
':ext' => $mailbox,
]);
} catch (\Throwable $e) {
error_log("[voicemail_pass_sync] Erreur synchronisation PIN : " . $e->getMessage());
}