Enhance-make voicemail length configurable (#1702)
allow the voicemail max_lengths to be configured from domain/default settings
This commit is contained in:
@@ -55,6 +55,19 @@ if ($domains_processed == 1) {
|
|||||||
$array[$x]['default_setting_enabled'] = 'false';
|
$array[$x]['default_setting_enabled'] = 'false';
|
||||||
$array[$x]['default_setting_description'] = 'Define which storage type (base_64 stores in the database).';
|
$array[$x]['default_setting_description'] = 'Define which storage type (base_64 stores in the database).';
|
||||||
$x++;
|
$x++;
|
||||||
|
$array[$x]['default_setting_category'] = 'voicemail';
|
||||||
|
$array[$x]['default_setting_subcategory'] = 'message_max_length';
|
||||||
|
$array[$x]['default_setting_name'] = 'numeric';
|
||||||
|
$array[$x]['default_setting_value'] = '300';
|
||||||
|
$array[$x]['default_setting_enabled'] = 'false';
|
||||||
|
$array[$x]['default_setting_description'] = 'Maximum length of a voicemail (in seconds).';
|
||||||
|
$x++;
|
||||||
|
$array[$x]['default_setting_category'] = 'voicemail';
|
||||||
|
$array[$x]['default_setting_subcategory'] = 'greeting_max_length';
|
||||||
|
$array[$x]['default_setting_name'] = 'numeric';
|
||||||
|
$array[$x]['default_setting_value'] = '90';
|
||||||
|
$array[$x]['default_setting_enabled'] = 'false';
|
||||||
|
$array[$x]['default_setting_description'] = 'Maximum length of a voicemail greeting (in seconds).';
|
||||||
|
|
||||||
//iterate and add each, if necessary
|
//iterate and add each, if necessary
|
||||||
foreach ($array as $index => $default_settings) {
|
foreach ($array as $index => $default_settings) {
|
||||||
|
|||||||
@@ -25,6 +25,10 @@
|
|||||||
|
|
||||||
--define a function to record the greeting
|
--define a function to record the greeting
|
||||||
function record_greeting(greeting_id)
|
function record_greeting(greeting_id)
|
||||||
|
local db = dbh or Database.new('system')
|
||||||
|
local settings = Settings.new(db, domain_name, domain_uuid)
|
||||||
|
|
||||||
|
local max_len_seconds = settings:get('voicemail', 'greeting_max_length', 'numeric');
|
||||||
|
|
||||||
--flush dtmf digits from the input buffer
|
--flush dtmf digits from the input buffer
|
||||||
session:flushDigits();
|
session:flushDigits();
|
||||||
@@ -62,7 +66,6 @@
|
|||||||
else
|
else
|
||||||
--prepare to record the greeting
|
--prepare to record the greeting
|
||||||
if (session:ready()) then
|
if (session:ready()) then
|
||||||
max_len_seconds = 90;
|
|
||||||
silence_seconds = 5;
|
silence_seconds = 5;
|
||||||
mkdir(voicemail_dir.."/"..voicemail_id);
|
mkdir(voicemail_dir.."/"..voicemail_id);
|
||||||
-- syntax is session:recordFile(file_name, max_len_secs, silence_threshold, silence_secs)
|
-- syntax is session:recordFile(file_name, max_len_secs, silence_threshold, silence_secs)
|
||||||
|
|||||||
@@ -25,6 +25,10 @@
|
|||||||
|
|
||||||
--save the recording
|
--save the recording
|
||||||
function record_message()
|
function record_message()
|
||||||
|
local db = dbh or Database.new('system')
|
||||||
|
local settings = Settings.new(db, domain_name, domain_uuid)
|
||||||
|
|
||||||
|
local max_len_seconds = settings:get('voicemail', 'message_max_length', 'numeric');
|
||||||
|
|
||||||
--record your message at the tone press any key or stop talking to end the recording
|
--record your message at the tone press any key or stop talking to end the recording
|
||||||
if (skip_instructions == "true") then
|
if (skip_instructions == "true") then
|
||||||
@@ -142,7 +146,6 @@
|
|||||||
|
|
||||||
--save the recording
|
--save the recording
|
||||||
-- syntax is session:recordFile(file_name, max_len_secs, silence_threshold, silence_secs)
|
-- syntax is session:recordFile(file_name, max_len_secs, silence_threshold, silence_secs)
|
||||||
max_len_seconds = 300;
|
|
||||||
silence_seconds = 5;
|
silence_seconds = 5;
|
||||||
if (storage_path == "http_cache") then
|
if (storage_path == "http_cache") then
|
||||||
result = session:recordFile(storage_path.."/"..voicemail_id.."/msg_"..uuid.."."..vm_message_ext, max_len_seconds, record_silence_threshold, silence_seconds);
|
result = session:recordFile(storage_path.."/"..voicemail_id.."/msg_"..uuid.."."..vm_message_ext, max_len_seconds, record_silence_threshold, silence_seconds);
|
||||||
|
|||||||
Reference in New Issue
Block a user