-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathBackup.php
More file actions
27 lines (27 loc) · 857 Bytes
/
Backup.php
File metadata and controls
27 lines (27 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
namespace FreePBX\modules\Callforward;
use FreePBX\modules\Backup as Base;
class Backup Extends Base\BackupBase{
public function runBackup($id,$transaction){
$cf = $this->FreePBX->Callforward;
$configs = [
'features' => $this->dumpFeatureCodes()
];
$users = $this->FreePBX->Core->getAllUsers();
$users = array_column($users,'extension');
$devices = $this->FreePBX->Core->getAllDevicesByType();
$devices = array_column($devices,'id');
$devices = array_merge($devices, $users);
foreach($devices as $exten){
$configs['data'][$exten] = [
'numbers' => [
'CF' => $cf->getNumberByExtension($exten,'CF'),
'CFU' => $cf->getNumberByExtension($exten,'CFU'),
'CFB' => $cf->getNumberByExtension($exten,'CFB'),
],
'ringtimer' => $cf->getRingtimerByExtension($exten),
];
}
$this->addConfigs($configs);
}
}