Fix PHP out of memory error on App Defaults (#3403)

If 400+ domains exist it's not possible to Execute App Defaults without getting PHP out of memory error on line 630 in 'app\dialplan\resources\classes\dialplan.php'.

It would be better to first build XML for each domain_name (context) then for all else.
This commit is contained in:
shaunjstokes 2018-09-14 06:50:08 +01:00 committed by FusionPBX
parent 19a3c59474
commit e1b989d91b
1 changed files with 15 additions and 2 deletions

View File

@ -102,12 +102,25 @@
//add xml for each dialplan where the dialplan xml is empty
if ($domains_processed == 1) {
$sql = "select domain_name ";
$sql .= "from v_domains \n";
$prep_statement = $this->db->prepare(check_sql($sql));
$prep_statement->execute();
$results = $prep_statement->fetchAll(PDO::FETCH_NAMED);
foreach ($results as $row) {
$dialplans = new dialplan;
$dialplans->source = "details";
$dialplans->destination = "database";
$dialplans->context = $row["domain_name"];
$dialplans->is_empty = "dialplan_xml";
$array = $dialplans->xml();
//print_r($array);
}
$dialplans = new dialplan;
$dialplans->source = "details";
$dialplans->destination = "database";
$dialplans->is_empty = "dialplan_xml";
$array = $dialplans->xml();
//print_r($array);
}
//add not found dialplan to inbound routes