feat(ucp): v2.6.0 provisionnement XML Acrobits GroundWire par poste
This commit is contained in:
1 parent
135a6267db
commit
28efb2d6bc
10 files changed
+359
-30
No files matched your search
+8
-4
@@ -311,6 +311,7 @@ try {
|
||||
$voicemail_attach = isset($payload['voicemail_attach']) ? (int)!empty($payload['voicemail_attach']) : 1;
|
||||
$voicemail_delete = isset($payload['voicemail_delete']) ? (int)!empty($payload['voicemail_delete']) : 0;
|
||||
$ring_time = max(5, min(120, (int)($payload['ring_time'] ?? 20)));
|
||||
$groundwire_enabled = !empty($payload['groundwire_enabled']) ? 1 : 0;
|
||||
|
||||
if ($force_pin_change === 1) {
|
||||
$secFile = "/var/spool/asterisk/voicemail/default/{$extension}/secret.conf";
|
||||
@@ -339,7 +340,7 @@ try {
|
||||
encryption = :encryption, codecs = :codecs, max_contacts = :max_contacts, enabled = :enabled,
|
||||
voicemail_enabled = :vme, voicemail_pin = :vmp, force_pin_change = :fpc,
|
||||
voicemail_skip_pin = :vsp, voicemail_email = :vme_mail, voicemail_attach = :vma,
|
||||
voicemail_delete = :vmd, ring_time = :rt
|
||||
voicemail_delete = :vmd, ring_time = :rt, groundwire_enabled = :gwe
|
||||
WHERE id = :id
|
||||
');
|
||||
$stmt->execute([
|
||||
@@ -360,14 +361,15 @@ try {
|
||||
':vma' => $voicemail_attach,
|
||||
':vmd' => $voicemail_delete,
|
||||
':rt' => $ring_time,
|
||||
':gwe' => $groundwire_enabled,
|
||||
]);
|
||||
} else {
|
||||
$stmt = $db->prepare('
|
||||
INSERT INTO extensions (extension, name, secret, transport, encryption, codecs, max_contacts, enabled,
|
||||
voicemail_enabled, voicemail_pin, force_pin_change, voicemail_skip_pin,
|
||||
voicemail_email, voicemail_attach, voicemail_delete, ring_time)
|
||||
voicemail_email, voicemail_attach, voicemail_delete, ring_time, groundwire_enabled)
|
||||
VALUES (:ext, :name, :secret, :transport, :encryption, :codecs, :max_contacts, :enabled,
|
||||
:vme, :vmp, :fpc, :vsp, :vme_mail, :vma, :vmd, :rt)
|
||||
:vme, :vmp, :fpc, :vsp, :vme_mail, :vma, :vmd, :rt, :gwe)
|
||||
ON CONFLICT(extension) DO UPDATE SET
|
||||
name = excluded.name,
|
||||
secret = excluded.secret,
|
||||
@@ -383,7 +385,8 @@ try {
|
||||
voicemail_email = excluded.voicemail_email,
|
||||
voicemail_attach = excluded.voicemail_attach,
|
||||
voicemail_delete = excluded.voicemail_delete,
|
||||
ring_time = excluded.ring_time
|
||||
ring_time = excluded.ring_time,
|
||||
groundwire_enabled = excluded.groundwire_enabled
|
||||
');
|
||||
$stmt->execute([
|
||||
':ext' => $extension,
|
||||
@@ -402,6 +405,7 @@ try {
|
||||
':vma' => $voicemail_attach,
|
||||
':vmd' => $voicemail_delete,
|
||||
':rt' => $ring_time,
|
||||
':gwe' => $groundwire_enabled,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user