Copy of the domain array and used it in dialplan import

This commit is contained in:
FusionPBX 2022-10-19 13:48:15 -06:00 committed by GitHub
parent 2bdf0d382e
commit 2ea90bfc52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -132,10 +132,17 @@
//add the domain name
$domain_enabled = 'true';
$domain_uuid = uuid();
//build the domain array
$array['domains'][0]['domain_uuid'] = $domain_uuid;
$array['domains'][0]['domain_name'] = $domain_name;
$array['domains'][0]['domain_enabled'] = $domain_enabled;
$array['domains'][0]['domain_description'] = $domain_description;
//create a copy of the domain array as the database save method empties the array that we still need.
$domain_array = $array;
//add the new domain
$database = new database;
$database->app_name = 'domains';
$database->app_uuid = '8b91605b-f6d2-42e6-a56d-5d1ded01bb44';
@ -145,7 +152,7 @@
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/dialplans/app_config.php")) {
//import the dialplans
$dialplan = new dialplan;
$dialplan->import($array['domains']);
$dialplan->import($domain_array['domains']);
unset($array);
//add xml for each dialplan where the dialplan xml is empty