Update record_greeting.lua

This commit is contained in:
FusionPBX 2018-04-30 10:32:25 -06:00 committed by GitHub
parent 1f8d92d759
commit f1e45f2aaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 3 deletions

View File

@ -29,14 +29,22 @@
--define a function to record the greeting
function record_greeting(greeting_id, menu)
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') or 90;
--setup the database connection
local db = dbh or Database.new('system')
--get the voicemail settings
local settings = Settings.new(db, domain_name, domain_uuid)
--set the maximum greeeting length
local max_len_seconds = settings:get('voicemail', 'greeting_max_length', 'numeric') or 90;
--flush dtmf digits from the input buffer
session:flushDigits();
--disable appending to the recording
session:setVariable("record_append", "false");
--choose a greeting between 1 and 9
if (greeting_id == nil) then
if (session:ready()) then