Add a new switch class with a method to get the directories needed for FreeSWITCH and add them to default settings -> switch category.
This commit is contained in:
@@ -24,45 +24,4 @@
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
//process this only one time
|
||||
if ($domains_processed == 1) {
|
||||
|
||||
//add switch call_center dir if it is missing
|
||||
$sql = "select count(*) as num_rows from v_default_settings ";
|
||||
$sql .= "where default_setting_category = 'switch' ";
|
||||
$sql .= "and default_setting_subcategory = 'call_center' ";
|
||||
$sql .= "and default_setting_name = 'dir' ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||
if ($row['num_rows'] == 0) {
|
||||
$sql = "insert into v_default_settings ";
|
||||
$sql .= "(";
|
||||
$sql .= "default_setting_uuid, ";
|
||||
$sql .= "default_setting_category, ";
|
||||
$sql .= "default_setting_subcategory, ";
|
||||
$sql .= "default_setting_name, ";
|
||||
$sql .= "default_setting_value, ";
|
||||
$sql .= "default_setting_enabled, ";
|
||||
$sql .= "default_setting_description ";
|
||||
$sql .= ")";
|
||||
$sql .= "values ";
|
||||
$sql .= "(";
|
||||
$sql .= "'".uuid()."', ";
|
||||
$sql .= "'switch', ";
|
||||
$sql .= "'call_center', ";
|
||||
$sql .= "'dir', ";
|
||||
$sql .= "'".$_SESSION['switch']['conf']['dir']."/autoload_configs', ";
|
||||
$sql .= "'false', ";
|
||||
$sql .= "'' ";
|
||||
$sql .= ")";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
}
|
||||
unset($prep_statement, $row);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -17,25 +17,33 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2016
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
|
||||
//use the module class to get the list of modules from the db and add any missing modules
|
||||
//process one time
|
||||
if ($domains_processed == 1) {
|
||||
$mod = new modules;
|
||||
$mod->db = $db;
|
||||
$mod->dir = $_SESSION['switch']['mod']['dir'];
|
||||
$mod->get_modules();
|
||||
$mod->synch();
|
||||
$msg = $mod->msg;
|
||||
|
||||
//synchronize the modules
|
||||
save_module_xml();
|
||||
//add missing switch directories in default settings
|
||||
$switch = new switch;
|
||||
$switch->settings();
|
||||
unset($switch);
|
||||
|
||||
//use the module class to get the list of modules from the db and add any missing modules
|
||||
if (isset($_SESSION['switch']['mod']['dir'])) {
|
||||
$mod = new modules;
|
||||
$mod->db = $db;
|
||||
$mod->dir = $_SESSION['switch']['mod']['dir'];
|
||||
$mod->get_modules();
|
||||
$mod->synch();
|
||||
$msg = $mod->msg;
|
||||
|
||||
//save the modules.conf
|
||||
save_module_xml();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user