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:
@@ -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';
|
||||
@@ -29,7 +29,7 @@ if (!function_exists('transcribe')) {
|
||||
|
||||
if (isset($api_key) && $api_key != '') {
|
||||
//start output buffer
|
||||
ob_start();
|
||||
ob_start();
|
||||
$out = fopen('php://output', 'w');
|
||||
|
||||
//create the curl resource
|
||||
@@ -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';
|
||||
@@ -136,7 +136,7 @@ if (!function_exists('transcribe')) {
|
||||
if ($file_extension == "wav") {
|
||||
$content_type = 'audio/wav';
|
||||
}
|
||||
|
||||
|
||||
//version 1
|
||||
if (substr($api_url, 0, 32) == 'https://speech.googleapis.com/v1') {
|
||||
if (isset($api_key) && $api_key != '') {
|
||||
@@ -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";
|
||||
@@ -339,7 +339,7 @@ if (!function_exists('transcribe')) {
|
||||
$full_file_name = $file_path.'/'.$file_name ;
|
||||
|
||||
//start output buffer
|
||||
ob_start();
|
||||
ob_start();
|
||||
$out = fopen('php://output', 'w');
|
||||
|
||||
//create the curl resource
|
||||
@@ -366,7 +366,7 @@ if (!function_exists('transcribe')) {
|
||||
|
||||
//execute the curl with the options
|
||||
$http_content = curl_exec($ch);
|
||||
|
||||
|
||||
//return the error
|
||||
if (curl_errno($ch)) {
|
||||
echo 'Error:' . curl_error($ch);
|
||||
@@ -380,9 +380,9 @@ if (!function_exists('transcribe')) {
|
||||
$debug = ob_get_clean();
|
||||
echo $debug;
|
||||
|
||||
|
||||
|
||||
$ob = json_decode($http_content, true);
|
||||
|
||||
|
||||
$message = $ob['text'];
|
||||
return array(
|
||||
'provider' => $transcribe_provider,
|
||||
@@ -396,5 +396,5 @@ if (!function_exists('transcribe')) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user