Change $setting to $settings (#7318)
* Change $setting to $settings * Update app_defaults.php * Update fax_queue.php * Update xml_cdr.php * Update email_queue.php * Update transcribe.php * Update send.php * Update fax_queue.php * Update fax_send.php * Update app_defaults.php * Update email_queue.php * Update app_defaults.php * Update app_defaults.php * Update app_defaults.php * Update app_defaults.php * Update app_defaults.php * Update app_defaults.php * Update app_defaults.php * Update app_defaults.php * Update app_defaults.php * Update app_defaults.php * Update app_defaults.php
This commit is contained in:
parent
7639f0755c
commit
1e96df6e95
|
|
@ -33,7 +33,7 @@
|
|||
if ($num_rows == 0) {
|
||||
|
||||
//set the directory
|
||||
$xml_dir = $setting->get('switch','conf').'/autoload_configs';
|
||||
$xml_dir = $settings->get('switch','conf').'/autoload_configs';
|
||||
$xml_file = $xml_dir."/acl.conf.xml";
|
||||
$xml_file_alt = $_SERVER["DOCUMENT_ROOT"].'/'.PROJECT_PATH.'/app/switch/resources/conf/autoload_configs/acl.conf';
|
||||
|
||||
|
|
|
|||
|
|
@ -93,8 +93,8 @@ if ($domains_processed == 1) {
|
|||
|
||||
//add the recording path if needed
|
||||
if ($row['queue_greeting'] != '') {
|
||||
if (file_exists($setting->get('switch','recordings').'/'.$row['domain_name'].'/'.$row['queue_greeting'])) {
|
||||
$queue_greeting_path = $setting->get('switch','recordings').'/'.$row['domain_name'].'/'.$row['queue_greeting'];
|
||||
if (file_exists($settings->get('switch','recordings').'/'.$row['domain_name'].'/'.$row['queue_greeting'])) {
|
||||
$queue_greeting_path = $settings->get('switch','recordings').'/'.$row['domain_name'].'/'.$row['queue_greeting'];
|
||||
}
|
||||
else {
|
||||
$queue_greeting_path = trim($row['queue_greeting']);
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
if ($num_rows == 0) {
|
||||
|
||||
//set the directory
|
||||
$xml_dir = $setting->get('switch','conf').'/autoload_configs';
|
||||
$xml_dir = $settings->get('switch','conf').'/autoload_configs';
|
||||
$xml_file = $xml_dir."/conference.conf";
|
||||
$xml_file_alt = $_SERVER["DOCUMENT_ROOT"].'/'.PROJECT_PATH.'/app/switch/resources/conf/autoload_configs/conference.conf';
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
if ($num_rows == 0) {
|
||||
|
||||
//set the directory
|
||||
$xml_dir = $setting->get('switch','conf').'/autoload_configs';
|
||||
$xml_dir = $settings->get('switch','conf').'/autoload_configs';
|
||||
$xml_file = $xml_dir."/conference.conf";
|
||||
$xml_file_alt = $_SERVER["DOCUMENT_ROOT"].'/'.PROJECT_PATH.'/app/switch/resources/conf/autoload_configs/conference.conf';
|
||||
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@
|
|||
//add not found dialplan to inbound routes
|
||||
/*
|
||||
if ($domains_processed == 1) {
|
||||
if (is_readable($setting->get('switch','dialplan'))) {
|
||||
if (is_readable($settings->get('switch','dialplan'))) {
|
||||
$sql = "select count(*) from v_dialplans ";
|
||||
$sql .= "where dialplan_uuid = 'ea5339de-1982-46ca-9695-c35176165314' ";
|
||||
$num_rows = $database->select($sql, null, 'column');
|
||||
|
|
|
|||
|
|
@ -153,10 +153,9 @@
|
|||
unset($parameters);
|
||||
|
||||
//get the email queue settings
|
||||
$setting = new settings(["domain_uuid" => $domain_uuid]);
|
||||
$smtp_from = $setting->get('email', 'smtp_from');
|
||||
$smtp_from_name = $setting->get('email', 'smtp_from_name', $smtp_from);
|
||||
$save_response = $setting->get('email_queue', 'save_response');
|
||||
$smtp_from = $settings->get('email', 'smtp_from');
|
||||
$smtp_from_name = $settings->get('email', 'smtp_from_name', $smtp_from);
|
||||
$save_response = $settings->get('email_queue', 'save_response');
|
||||
|
||||
//debug information
|
||||
if (!empty($debug) && $debug == 'true') {
|
||||
|
|
|
|||
|
|
@ -9,16 +9,16 @@ if (!function_exists('transcribe')) {
|
|||
}
|
||||
|
||||
//get the email queue settings
|
||||
$setting = new settings(['category' => 'voicemail']);
|
||||
$settings = new settings(['category' => 'voicemail']);
|
||||
|
||||
//transcription variables
|
||||
$transcribe_provider = $setting->get('voicemail', 'transcribe_provider');
|
||||
$transcribe_language = $setting->get('voicemail', 'transcribe_language');
|
||||
$transcribe_provider = $settings->get('voicemail', 'transcribe_provider');
|
||||
$transcribe_language = $settings->get('voicemail', 'transcribe_language');
|
||||
|
||||
//transcribe - watson
|
||||
if ($transcribe_provider == 'watson') {
|
||||
$api_key = $setting->get('voicemail', 'watson_key');
|
||||
$api_url = $setting->get('voicemail', 'watson_url');
|
||||
$api_key = $settings->get('voicemail', 'watson_key');
|
||||
$api_url = $settings->get('voicemail', 'watson_url');
|
||||
|
||||
if ($file_extension == "mp3") {
|
||||
$content_type = 'audio/mp3';
|
||||
|
|
@ -118,11 +118,11 @@ if (!function_exists('transcribe')) {
|
|||
|
||||
//transcribe - google
|
||||
if ($transcribe_provider == 'google') {
|
||||
$api_key = $setting->get('voicemail', 'google_key');
|
||||
$api_url = $setting->get('voicemail', 'google_url');
|
||||
$application_credentials = $setting->get('voicemail', 'google_application_credentials');
|
||||
$transcribe_language = $setting->get('voicemail', 'transcribe_language');
|
||||
$transcribe_alternate_language = $setting->get('voicemail', 'transcribe_alternate_language');
|
||||
$api_key = $settings->get('voicemail', 'google_key');
|
||||
$api_url = $settings->get('voicemail', 'google_url');
|
||||
$application_credentials = $settings->get('voicemail', 'google_application_credentials');
|
||||
$transcribe_language = $settings->get('voicemail', 'transcribe_language');
|
||||
$transcribe_alternate_language = $settings->get('voicemail', 'transcribe_alternate_language');
|
||||
|
||||
if (!isset($transcribe_language) && empty($transcribe_language)) {
|
||||
$transcribe_language = 'en-US';
|
||||
|
|
@ -195,8 +195,8 @@ if (!function_exists('transcribe')) {
|
|||
|
||||
//transcribe - azure
|
||||
if ($transcribe_provider == 'azure') {
|
||||
$api_key = $setting->get('voicemail', 'azure_key');
|
||||
$api_url = $setting->get('voicemail', 'azure_server_region');
|
||||
$api_key = $settings->get('voicemail', 'azure_key');
|
||||
$api_url = $settings->get('voicemail', 'azure_server_region');
|
||||
|
||||
if (empty($transcribe_language)) {
|
||||
$transcribe_language = 'en-US';
|
||||
|
|
@ -241,8 +241,8 @@ if (!function_exists('transcribe')) {
|
|||
// transcribe - custom
|
||||
// Works with self-hostable transcription service at https://github.com/AccelerateNetworks/an-transcriptions
|
||||
if ($transcribe_provider == 'custom') {
|
||||
$api_key = $setting->get('voicemail', 'api_key');
|
||||
$api_url = $setting->get('voicemail', 'transcription_server');
|
||||
$api_key = $settings->get('voicemail', 'api_key');
|
||||
$api_url = $settings->get('voicemail', 'transcription_server');
|
||||
|
||||
if (empty($transcribe_language)) {
|
||||
$transcribe_language = 'en-US';
|
||||
|
|
@ -322,9 +322,9 @@ if (!function_exists('transcribe')) {
|
|||
// openai_url
|
||||
// openai_model
|
||||
if ($transcribe_provider == 'openai') {
|
||||
$api_key = $setting->get('voicemail', 'openai_key');
|
||||
$api_url = $setting->get('voicemail', 'openai_url');
|
||||
$api_voice_model = $setting->get('voicemail', 'openai_model');
|
||||
$api_key = $settings->get('voicemail', 'openai_key');
|
||||
$api_url = $settings->get('voicemail', 'openai_url');
|
||||
$api_voice_model = $settings->get('voicemail', 'openai_model');
|
||||
|
||||
if (empty($api_url)) {
|
||||
$api_url = "https://api.openai.com/v1/audio/transcriptions";
|
||||
|
|
|
|||
|
|
@ -69,11 +69,8 @@
|
|||
exit;
|
||||
}
|
||||
|
||||
//get the email queue settings
|
||||
$setting = new settings(["category" => "email_queue"]);
|
||||
|
||||
//email queue enabled
|
||||
if ($setting->get('email_queue', 'enabled') != 'true') {
|
||||
if ($settings->get('email_queue', 'enabled') != 'true') {
|
||||
echo "Email Queue is disabled in Default Settings\n";
|
||||
exit;
|
||||
}
|
||||
|
|
@ -102,20 +99,20 @@
|
|||
}
|
||||
|
||||
//get the call center settings
|
||||
$interval = $setting->get('email_queue', 'interval');
|
||||
$interval = $settings->get('email_queue', 'interval');
|
||||
|
||||
//set the defaults
|
||||
if (!is_numeric($interval)) { $interval = 30; }
|
||||
|
||||
//set the email queue limit
|
||||
if (!empty($setting->get('email_queue', 'limit'))) {
|
||||
$email_queue_limit = $setting->get('email_queue', 'limit');
|
||||
if (!empty($settings->get('email_queue', 'limit'))) {
|
||||
$email_queue_limit = $settings->get('email_queue', 'limit');
|
||||
}
|
||||
else {
|
||||
$email_queue_limit = '30';
|
||||
}
|
||||
if (!empty($setting->get('email_queue', 'debug'))) {
|
||||
$debug = $setting->get('email_queue', 'debug');
|
||||
if (!empty($settings->get('email_queue', 'debug'))) {
|
||||
$debug = $settings->get('email_queue', 'debug');
|
||||
}
|
||||
|
||||
//get the messages waiting in the email queue
|
||||
|
|
|
|||
|
|
@ -82,11 +82,8 @@
|
|||
exit;
|
||||
}
|
||||
|
||||
//get the email queue settings
|
||||
$setting = new settings(["category" => "email_queue"]);
|
||||
|
||||
//email queue enabled
|
||||
if ($setting->get('email_queue', 'enabled') != 'true') {
|
||||
if ($settings->get('email_queue', 'enabled') != 'true') {
|
||||
echo "Email Queue is disabled in Default Settings\n";
|
||||
exit;
|
||||
}
|
||||
|
|
@ -115,20 +112,20 @@
|
|||
}
|
||||
|
||||
//get the call center settings
|
||||
$interval = $setting->get('email_queue', 'interval');
|
||||
$interval = $settings->get('email_queue', 'interval');
|
||||
|
||||
//set the defaults
|
||||
if (!is_numeric($interval)) { $interval = 30; }
|
||||
|
||||
//set the email queue limit
|
||||
if (!empty($setting->get('email_queue', 'limit'))) {
|
||||
$email_queue_limit = $setting->get('email_queue', 'limit');
|
||||
if (!empty($settings->get('email_queue', 'limit'))) {
|
||||
$email_queue_limit = $settings->get('email_queue', 'limit');
|
||||
}
|
||||
else {
|
||||
$email_queue_limit = '30';
|
||||
}
|
||||
if (!empty($setting->get('email_queue', 'debug'))) {
|
||||
$debug = $setting->get('email_queue', 'debug');
|
||||
if (!empty($settings->get('email_queue', 'debug'))) {
|
||||
$debug = $settings->get('email_queue', 'debug');
|
||||
}
|
||||
|
||||
//get the messages waiting in the email queue
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@
|
|||
if ($domains_processed == 1) {
|
||||
|
||||
//create the directory
|
||||
if (!empty($setting->get('switch','extensions'))) {
|
||||
if (!is_dir($setting->get('switch','extensions'))) {
|
||||
mkdir($setting->get('switch','extensions'), 0770, false);
|
||||
if (!empty($settings->get('switch','extensions'))) {
|
||||
if (!is_dir($settings->get('switch','extensions'))) {
|
||||
mkdir($settings->get('switch','extensions'), 0770, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2015-2024
|
||||
Portions created by the Initial Developer are Copyright (C) 2015-2025
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
|
@ -78,37 +78,34 @@ if (!empty($result) && @sizeof($result) != 0) {
|
|||
$fax_accountcode = $row["accountcode"];
|
||||
$fax_toll_allow = $row["fax_toll_allow"];
|
||||
|
||||
//get event socket connection parameters
|
||||
$setting = new settings(["database" => $database, "domain_uuid" => $domain_uuid]);
|
||||
|
||||
//send the domain name to the command line output
|
||||
if (!empty($fax_email_connection_host) && !empty($fax_email_connection_username)) {
|
||||
echo "Domain Name: ".$domain_name."\n";
|
||||
}
|
||||
|
||||
//get the cover font
|
||||
$fax_cover_font_default =$setting->get('fax','cover_font');
|
||||
$fax_cover_font = $setting->get('fax','cover_font');
|
||||
$fax_cover_font_default =$settings->get('fax','cover_font');
|
||||
$fax_cover_font = $settings->get('fax','cover_font');
|
||||
if(empty($fax_cover_font)) {
|
||||
$fax_cover_font = $fax_cover_font_default;
|
||||
}
|
||||
|
||||
//get the allowed file extensions
|
||||
$fax_allowed_extension_default = arr_to_map($setting->get('fax','allowed_extension'));
|
||||
$fax_allowed_extension_default = arr_to_map($settings->get('fax','allowed_extension'));
|
||||
if($fax_allowed_extension_default == false){
|
||||
$tmp = array('.pdf', '.tiff', '.tif');
|
||||
$fax_allowed_extension_default = arr_to_map($tmp);
|
||||
}
|
||||
$fax_allowed_extension = arr_to_map($setting->get('fax','allowed_extension'));
|
||||
$fax_allowed_extension = arr_to_map($settings->get('fax','allowed_extension'));
|
||||
if($fax_allowed_extension == false) {
|
||||
$fax_allowed_extension = $fax_allowed_extension_default;
|
||||
}
|
||||
|
||||
//set needed variables
|
||||
$fax_page_size = $setting->get('fax','page_size');
|
||||
$fax_resolution = $setting->get('fax','resolution');
|
||||
$fax_header = $setting->get('fax','cover_header');
|
||||
$fax_footer = $setting->get('fax','cover_footer');
|
||||
$fax_page_size = $settings->get('fax','page_size');
|
||||
$fax_resolution = $settings->get('fax','resolution');
|
||||
$fax_header = $settings->get('fax','cover_header');
|
||||
$fax_footer = $settings->get('fax','cover_footer');
|
||||
$fax_sender = $fax_caller_id_name;
|
||||
|
||||
//open account connection
|
||||
|
|
@ -221,7 +218,7 @@ if (!empty($result) && @sizeof($result) != 0) {
|
|||
}
|
||||
|
||||
// set fax directory (used for pdf creation - cover and/or attachments)
|
||||
$fax_dir = $setting->get('switch','storage').'/fax'.(($domain_name != '') ? '/'.$domain_name : null);
|
||||
$fax_dir = $settings->get('switch','storage').'/fax'.(($domain_name != '') ? '/'.$domain_name : null);
|
||||
|
||||
//handle attachments (if any)
|
||||
$emailed_files = Array();
|
||||
|
|
|
|||
|
|
@ -56,31 +56,28 @@
|
|||
return $exists;
|
||||
}
|
||||
|
||||
//get the email queue settings
|
||||
$setting = new settings(["category" => "fax_queue"]);
|
||||
|
||||
//set the fax queue interval
|
||||
if (!empty($setting->get('fax_queue', 'interval'))) {
|
||||
$fax_queue_interval = $setting->get('fax_queue', 'interval');
|
||||
if (!empty($settings->get('fax_queue', 'interval'))) {
|
||||
$fax_queue_interval = $settings->get('fax_queue', 'interval');
|
||||
}
|
||||
else {
|
||||
$fax_queue_interval = '30';
|
||||
}
|
||||
|
||||
//set the fax queue limit
|
||||
if (!empty($setting->get('fax_queue', 'limit'))) {
|
||||
$fax_queue_limit = $setting->get('fax_queue', 'limit');
|
||||
if (!empty($settings->get('fax_queue', 'limit'))) {
|
||||
$fax_queue_limit = $settings->get('fax_queue', 'limit');
|
||||
}
|
||||
else {
|
||||
$fax_queue_limit = '30';
|
||||
}
|
||||
if (!empty($setting->get('fax_queue', 'debug'))) {
|
||||
$debug = $setting->get('fax_queue', 'debug');
|
||||
if (!empty($settings->get('fax_queue', 'debug'))) {
|
||||
$debug = $settings->get('fax_queue', 'debug');
|
||||
}
|
||||
|
||||
//set the fax queue retry interval
|
||||
if (!empty($setting->get('fax_queue', 'retry_interval'))) {
|
||||
$fax_retry_interval = $setting->get('fax_queue', 'retry_interval');
|
||||
if (!empty($settings->get('fax_queue', 'retry_interval'))) {
|
||||
$fax_retry_interval = $settings->get('fax_queue', 'retry_interval');
|
||||
}
|
||||
else {
|
||||
$fax_retry_interval = '180';
|
||||
|
|
|
|||
|
|
@ -184,22 +184,19 @@
|
|||
}
|
||||
unset($parameters);
|
||||
|
||||
//get the email queue settings
|
||||
$setting = new settings(["domain_uuid" => $domain_uuid]);
|
||||
|
||||
//prepare the smtp from and from name variables
|
||||
$email_from = $setting->get('fax','smtp_from');
|
||||
$email_from_name = $setting->get('fax','smtp_from_name');
|
||||
$email_from = $settings->get('fax','smtp_from');
|
||||
$email_from_name = $settings->get('fax','smtp_from_name');
|
||||
if (empty($email_from)) {
|
||||
$email_from = $setting->get('email','smtp_from');
|
||||
$email_from = $settings->get('email','smtp_from');
|
||||
}
|
||||
if (empty($email_from_name)) {
|
||||
$email_from_name = $setting->get('email','smtp_from_name');
|
||||
$email_from_name = $settings->get('email','smtp_from_name');
|
||||
}
|
||||
|
||||
//prepare the variables to send the fax
|
||||
$email_from_address = $email_from;
|
||||
$retry_limit = $setting->get('fax_queue','retry_limit');
|
||||
$retry_limit = $settings->get('fax_queue','retry_limit');
|
||||
|
||||
//prepare the fax retry count
|
||||
if (!isset($fax_retry_count)) {
|
||||
|
|
@ -252,7 +249,7 @@
|
|||
if ($fax_retry_count == 0) {
|
||||
//use default settings or domain settings (defaults to t38)
|
||||
$fax_options = '';
|
||||
foreach($setting->get('fax','variable') as $variable) {
|
||||
foreach($settings->get('fax','variable') as $variable) {
|
||||
$fax_options .= $variable.",";
|
||||
}
|
||||
}
|
||||
|
|
@ -283,7 +280,7 @@
|
|||
else {
|
||||
//try the user definable method again
|
||||
$fax_options = '';
|
||||
foreach($setting->get('fax','variable') as $variable) {
|
||||
foreach($settings->get('fax','variable') as $variable) {
|
||||
$fax_options .= $variable.",";
|
||||
}
|
||||
}
|
||||
|
|
@ -298,7 +295,7 @@
|
|||
|
||||
//check to see if the destination number is local
|
||||
$local_destination = false;
|
||||
if ($setting->get('fax_queue','prefer_local', false)) {
|
||||
if ($settings->get('fax_queue','prefer_local', false)) {
|
||||
$sql = "select count(destination_uuid) ";
|
||||
$sql .= "from v_destinations ";
|
||||
$sql .= "where (";
|
||||
|
|
@ -463,7 +460,7 @@
|
|||
//send the email
|
||||
if (!empty($fax_email_address) && file_exists($fax_file)) {
|
||||
//get the language code
|
||||
$language_code = $setting->get('domain','language');
|
||||
$language_code = $settings->get('domain','language');
|
||||
|
||||
//get the template subcategory
|
||||
if (isset($fax_relay) && $fax_relay == 'true') {
|
||||
|
|
|
|||
|
|
@ -103,31 +103,28 @@
|
|||
file_put_contents($pid_file, getmypid());
|
||||
}
|
||||
|
||||
//get the fax queue settings
|
||||
$setting = new settings(["category" => "fax_queue"]);
|
||||
|
||||
//set the fax queue interval
|
||||
if (!empty($setting->get('fax_queue', 'interval'))) {
|
||||
$fax_queue_interval = $setting->get('fax_queue', 'interval');
|
||||
if (!empty($settings->get('fax_queue', 'interval'))) {
|
||||
$fax_queue_interval = $settings->get('fax_queue', 'interval');
|
||||
}
|
||||
else {
|
||||
$fax_queue_interval = '30';
|
||||
}
|
||||
|
||||
//set the fax queue limit
|
||||
if (!empty($setting->get('fax_queue', 'limit'))) {
|
||||
$fax_queue_limit = $setting->get('fax_queue', 'limit');
|
||||
if (!empty($settings->get('fax_queue', 'limit'))) {
|
||||
$fax_queue_limit = $settings->get('fax_queue', 'limit');
|
||||
}
|
||||
else {
|
||||
$fax_queue_limit = '30';
|
||||
}
|
||||
if (!empty($setting->get('fax_queue', 'debug'))) {
|
||||
$debug = $setting->get('fax_queue', 'debug');
|
||||
if (!empty($settings->get('fax_queue', 'debug'))) {
|
||||
$debug = $settings->get('fax_queue', 'debug');
|
||||
}
|
||||
|
||||
//set the fax queue retry interval
|
||||
if (!empty($setting->get('fax_queue', 'retry_interval'))) {
|
||||
$fax_retry_interval = $setting->get('fax_queue', 'retry_interval');
|
||||
if (!empty($settings->get('fax_queue', 'retry_interval'))) {
|
||||
$fax_retry_interval = $settings->get('fax_queue', 'retry_interval');
|
||||
}
|
||||
else {
|
||||
$fax_retry_interval = '180';
|
||||
|
|
|
|||
|
|
@ -57,8 +57,8 @@
|
|||
unset($sql, $modules, $index, $row);
|
||||
|
||||
//use the module class to get the list of modules from the db and add any missing modules
|
||||
if (!empty($setting->get('switch','mod'))) {
|
||||
$module->dir = $setting->get('switch','mod');
|
||||
if (!empty($settings->get('switch','mod'))) {
|
||||
$module->dir = $settings->get('switch','mod');
|
||||
$module->get_modules();
|
||||
$module->synch();
|
||||
$module->xml();
|
||||
|
|
|
|||
|
|
@ -27,13 +27,13 @@
|
|||
if ($domains_processed == 1) {
|
||||
|
||||
//set the directory
|
||||
if (!empty($setting->get('switch','conf'))) {
|
||||
$xml_dir = $setting->get('switch','conf').'/autoload_configs';
|
||||
if (!empty($settings->get('switch','conf'))) {
|
||||
$xml_dir = $settings->get('switch','conf').'/autoload_configs';
|
||||
$xml_file = $xml_dir."/local_stream.conf";
|
||||
}
|
||||
|
||||
//rename the file
|
||||
if (!empty($setting->get('switch','conf'))) {
|
||||
if (!empty($settings->get('switch','conf'))) {
|
||||
if (file_exists($xml_dir.'/local_stream.conf.xml')) {
|
||||
rename($xml_dir.'/local_stream.conf', $xml_dir.'/'.$xml_file);
|
||||
}
|
||||
|
|
@ -43,7 +43,7 @@ if ($domains_processed == 1) {
|
|||
}
|
||||
|
||||
//add the music_on_hold list to the database
|
||||
if (!empty($setting->get('switch','conf'))) {
|
||||
if (!empty($settings->get('switch','conf'))) {
|
||||
$sql = "select count(music_on_hold_uuid) from v_music_on_hold; ";
|
||||
$num_rows = $database->select($sql, null, 'column');
|
||||
unset($sql);
|
||||
|
|
|
|||
|
|
@ -45,9 +45,9 @@
|
|||
}
|
||||
|
||||
//check for existing configuration
|
||||
if (!empty($setting->get('switch','conf')) && file_exists($setting->get('switch','conf')."/autoload_configs/translate.conf.xml")) {
|
||||
if (!empty($settings->get('switch','conf')) && file_exists($settings->get('switch','conf')."/autoload_configs/translate.conf.xml")) {
|
||||
//import existing data
|
||||
$xml = file_get_contents($setting->get('switch','conf')."/autoload_configs/translate.conf.xml");
|
||||
$xml = file_get_contents($settings->get('switch','conf')."/autoload_configs/translate.conf.xml");
|
||||
|
||||
//convert the xml string to an xml object
|
||||
$xml = simplexml_load_string($xml);
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@ if ($domains_processed == 1) {
|
|||
|
||||
//create phrases folder and add include line in xml for each language found
|
||||
/*
|
||||
if (!empty($setting->get('switch','languages'))) {
|
||||
if (is_readable($setting->get('switch','languages'))) {
|
||||
$conf_lang_folders = glob($setting->get('switch','languages')."/*");
|
||||
if (!empty($settings->get('switch','languages'))) {
|
||||
if (is_readable($settings->get('switch','languages'))) {
|
||||
$conf_lang_folders = glob($settings->get('switch','languages')."/*");
|
||||
foreach ($conf_lang_folders as $conf_lang_folder) {
|
||||
//create phrases folder, if necessary
|
||||
if (!file_exists($conf_lang_folder."/phrases/")) {
|
||||
|
|
@ -65,7 +65,7 @@ if ($domains_processed == 1) {
|
|||
*/
|
||||
|
||||
//if base64, convert existing incompatible phrases
|
||||
if (!empty($setting->get('recordings','storage_type')) && $setting->get('recordings','storage_type') == 'base64') {
|
||||
if (!empty($settings->get('recordings','storage_type')) && $settings->get('recordings','storage_type') == 'base64') {
|
||||
$sql = "select phrase_detail_uuid, phrase_detail_data ";
|
||||
$sql .= "from v_phrase_details where phrase_detail_function = 'play-file' ";
|
||||
$result = $database->select($sql, null, 'all');
|
||||
|
|
@ -73,8 +73,8 @@ if ($domains_processed == 1) {
|
|||
foreach ($result as $index => $row) {
|
||||
$phrase_detail_uuid = $row['phrase_detail_uuid'];
|
||||
$phrase_detail_data = $row['phrase_detail_data'];
|
||||
if (substr_count($phrase_detail_data, $setting->get('switch','recordings').'/'.$domain_name) > 0) {
|
||||
$phrase_detail_data = str_replace($setting->get('switch','recordings').'/'.$domain_name.'/', '', $phrase_detail_data);
|
||||
if (substr_count($phrase_detail_data, $settings->get('switch','recordings').'/'.$domain_name) > 0) {
|
||||
$phrase_detail_data = str_replace($settings->get('switch','recordings').'/'.$domain_name.'/', '', $phrase_detail_data);
|
||||
}
|
||||
//update function and data to be base64 compatible
|
||||
$phrase_detail_data = "lua(streamfile.lua ".$phrase_detail_data.")";
|
||||
|
|
@ -98,7 +98,7 @@ if ($domains_processed == 1) {
|
|||
}
|
||||
|
||||
//if not base64, revert base64 phrases to standard method
|
||||
else if (!empty($setting->get('recordings','storage_type')) && $setting->get('recordings','storage_type') != 'base64') {
|
||||
else if (!empty($settings->get('recordings','storage_type')) && $settings->get('recordings','storage_type') != 'base64') {
|
||||
$sql = "select phrase_detail_uuid, phrase_detail_data ";
|
||||
$sql .= "from v_phrase_details where ";
|
||||
$sql .= "phrase_detail_function = 'execute' ";
|
||||
|
|
@ -112,7 +112,7 @@ if ($domains_processed == 1) {
|
|||
$phrase_detail_data = str_replace('lua(streamfile.lua ', '', $phrase_detail_data);
|
||||
$phrase_detail_data = str_replace(')', '', $phrase_detail_data);
|
||||
if (substr_count($phrase_detail_data, '/') === 0) {
|
||||
$phrase_detail_data = $setting->get('switch','recordings').'/'.$domain_name.'/'.$phrase_detail_data;
|
||||
$phrase_detail_data = $settings->get('switch','recordings').'/'.$domain_name.'/'.$phrase_detail_data;
|
||||
}
|
||||
$array['phrase_details'][$index]['phrase_detail_uuid'] = $phrase_detail_uuid;
|
||||
$array['phrase_details'][$index]['phrase_detail_function'] = 'play-file';
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@
|
|||
*/
|
||||
|
||||
//if the recordings directory doesn't exist then create it
|
||||
if (!empty($setting->get('switch','recordings')) && !empty($domain_name)) {
|
||||
if (!is_readable($setting->get('switch','recordings')."/".$domain_name)) {
|
||||
mkdir($setting->get('switch','recordings')."/".$domain_name."/archive", 0770, true);
|
||||
if (!empty($settings->get('switch','recordings')) && !empty($domain_name)) {
|
||||
if (!is_readable($settings->get('switch','recordings')."/".$domain_name)) {
|
||||
mkdir($settings->get('switch','recordings')."/".$domain_name."/archive", 0770, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -35,7 +35,7 @@
|
|||
if ($domains_processed == 1) {
|
||||
|
||||
//if base64, populate from existing recording files, then remove
|
||||
if (!empty($setting->get('recordings','storage_type')) && $setting->get('recordings','storage_type') == 'base64') {
|
||||
if (!empty($settings->get('recordings','storage_type')) && $settings->get('recordings','storage_type') == 'base64') {
|
||||
//get recordings without base64 in db
|
||||
$sql = "select recording_uuid, domain_uuid, recording_filename ";
|
||||
$sql .= "from v_recordings ";
|
||||
|
|
@ -50,7 +50,7 @@
|
|||
$recording_filename = $row['recording_filename'];
|
||||
|
||||
//set recording directory
|
||||
$recording_directory = $setting->get('switch','recordings').'/'.$domain_name;
|
||||
$recording_directory = $settings->get('switch','recordings').'/'.$domain_name;
|
||||
|
||||
//encode recording file (if exists)
|
||||
if (file_exists($recording_directory.'/'.$recording_filename)) {
|
||||
|
|
@ -77,7 +77,7 @@
|
|||
unset($sql, $result, $row);
|
||||
}
|
||||
//if not base64, decode to local files, remove base64 data from db
|
||||
else if (!empty($setting->get('recordings','storage_type')) && $setting->get('recordings','storage_type') != 'base64') {
|
||||
else if (!empty($settings->get('recordings','storage_type')) && $settings->get('recordings','storage_type') != 'base64') {
|
||||
//get recordings with base64 in db
|
||||
$sql = "select recording_uuid, domain_uuid, recording_filename, recording_base64 ";
|
||||
$sql .= "from v_recordings ";
|
||||
|
|
@ -92,7 +92,7 @@
|
|||
$recording_base64 = $row['recording_base64'];
|
||||
|
||||
//set recording directory
|
||||
$recording_directory = $setting->get('switch','recordings').'/'.$domain_name;
|
||||
$recording_directory = $settings->get('switch','recordings').'/'.$domain_name;
|
||||
|
||||
//remove local file, if any
|
||||
if (file_exists($recording_directory.'/'.$recording_filename)) {
|
||||
|
|
|
|||
|
|
@ -68,8 +68,8 @@ if ($domains_processed == 1) {
|
|||
unset($sql, $result, $row);
|
||||
|
||||
//get settings
|
||||
$voicemail_storage_type = $setting->get('voicemail','storage_type');
|
||||
$switch_storage = $setting->get('switch','storage');
|
||||
$voicemail_storage_type = $settings->get('voicemail','storage_type');
|
||||
$switch_storage = $settings->get('switch','storage');
|
||||
|
||||
//if base64, populate from existing greeting files, then remove
|
||||
if (!empty($voicemail_storage_type) && $voicemail_storage_type == 'base64') {
|
||||
|
|
|
|||
|
|
@ -36,18 +36,18 @@ if ($domains_processed == 1) {
|
|||
unset($sql, $parameters);
|
||||
if (!empty($voicemails) && is_array($voicemails)) {
|
||||
foreach($voicemails as $row) {
|
||||
if (!empty($setting->get('switch','voicemail')) && !empty($row['voicemail_id']) && is_numeric($row['voicemail_id'])) {
|
||||
if (!file_exists($setting->get('switch','voicemail')."/default/".$row['domain_name']."/".$row['voicemail_id'])) {
|
||||
mkdir($setting->get('switch','voicemail')."/default/".$row['domain_name']."/".$row['voicemail_id'], 0770, true);
|
||||
if (!empty($settings->get('switch','voicemail')) && !empty($row['voicemail_id']) && is_numeric($row['voicemail_id'])) {
|
||||
if (!file_exists($settings->get('switch','voicemail')."/default/".$row['domain_name']."/".$row['voicemail_id'])) {
|
||||
mkdir($settings->get('switch','voicemail')."/default/".$row['domain_name']."/".$row['voicemail_id'], 0770, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//define initial, get current, define correct languages folder paths
|
||||
$switch_configuration_dir = !empty($setting->get('switch','conf')) ? $setting->get('switch','conf') : '/etc/freeswitch';
|
||||
$switch_configuration_dir = !empty($settings->get('switch','conf')) ? $settings->get('switch','conf') : '/etc/freeswitch';
|
||||
$switch_languages_dir_initial = $switch_configuration_dir.'/lang';
|
||||
$switch_languages_dir_current = $setting->get('switch','languages') ?? '';
|
||||
$switch_languages_dir_current = $settings->get('switch','languages') ?? '';
|
||||
$switch_languages_dir_correct = $switch_configuration_dir.'/languages';
|
||||
|
||||
//ensure switch using languages (not lang) folder
|
||||
|
|
|
|||
|
|
@ -80,11 +80,8 @@
|
|||
exit;
|
||||
}
|
||||
|
||||
//get the settings
|
||||
$setting = new settings();
|
||||
|
||||
//get cdr settings
|
||||
//$interval = $setting->get('xml_cdr', '$interval');
|
||||
//$interval = $settings->get('xml_cdr', '$interval');
|
||||
|
||||
//make sure the /var/run/fusionpbx directory exists
|
||||
if (!file_exists('/var/run/fusionpbx')) {
|
||||
|
|
@ -119,7 +116,7 @@
|
|||
$cdr = new xml_cdr;
|
||||
|
||||
//get the cdr record
|
||||
$xml_cdr_dir = $setting->get('switch', 'log').'/xml_cdr';
|
||||
$xml_cdr_dir = $settings->get('switch', 'log').'/xml_cdr';
|
||||
|
||||
//loop through
|
||||
while (true) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue