Enhance-make voicemail length configurable (#1702)

allow the voicemail max_lengths to be configured from domain/default
settings
This commit is contained in:
Mafoo
2016-06-24 17:28:47 +01:00
committed by FusionPBX
parent 2189ce1e82
commit f88691618e
3 changed files with 21 additions and 2 deletions

View File

@@ -25,6 +25,10 @@
--define a function to record the greeting
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
session:flushDigits();
@@ -62,7 +66,6 @@
else
--prepare to record the greeting
if (session:ready()) then
max_len_seconds = 90;
silence_seconds = 5;
mkdir(voicemail_dir.."/"..voicemail_id);
-- syntax is session:recordFile(file_name, max_len_secs, silence_threshold, silence_secs)

View File

@@ -25,6 +25,10 @@
--save the recording
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
if (skip_instructions == "true") then
@@ -142,7 +146,6 @@
--save the recording
-- syntax is session:recordFile(file_name, max_len_secs, silence_threshold, silence_secs)
max_len_seconds = 300;
silence_seconds = 5;
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);