mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
Enhance-make voicemail length configurable (#1702)
allow the voicemail max_lengths to be configured from domain/default settings
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user