-
Notifications
You must be signed in to change notification settings - Fork 10
/
Backup.php
28 lines (28 loc) · 957 Bytes
/
Backup.php
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
28
<?php
namespace FreePBX\modules\Ringgroups;
use FreePBX\modules\Backup as Base;
class Backup Extends Base\BackupBase{
public function runBackup($id,$transaction){
$this->addDependency('core');
$this->addDependency('callrecording');
$astdbval = $this->FreePBX->astman->database_show("RINGGROUP");
$astValArr = [];
foreach ($astdbval as $key => $value) {
$gdetails = explode("/", (string) $key);
$astValArr[$gdetails[2]][$gdetails[3]] = $value;
}
$allringGroups = $this->FreePBX->Database->query('SELECT * FROM ringgroups')->fetchAll(\PDO::FETCH_ASSOC);
$rgrps = [];
foreach ($allringGroups as $rgp) {
if(array_key_exists($rgp['grpnum'],$astValArr)) {
$rgp['changecid'] = $astValArr[$rgp['grpnum']]['changecid'] ?? 'default';
$rgp['fixedcid'] = $astValArr[$rgp['grpnum']]['fixedcid'] ?? '';
}
$rgrps[] = $rgp;
}
$this->addConfigs([
'groups' => $rgrps,
'settings' => $this->dumpAdvancedSettings()
]);
}
}