From 720a55fd2540e74a84ef2113ad9475bb56f364c0 Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Thu, 11 Apr 2013 10:49:30 +0200 Subject: beep added --- misc/freeswitch/scripts/dialplan/ivr.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'misc/freeswitch/scripts') diff --git a/misc/freeswitch/scripts/dialplan/ivr.lua b/misc/freeswitch/scripts/dialplan/ivr.lua index e6ddd58..6b230dc 100644 --- a/misc/freeswitch/scripts/dialplan/ivr.lua +++ b/misc/freeswitch/scripts/dialplan/ivr.lua @@ -146,16 +146,23 @@ function Ivr.check_pin(self, phrase_enter, phrase_incorrect, pin, pin_timeout, p end -function Ivr.record(self, file_name, phrase_record, phrase_too_short, record_length_max, record_length_min, record_repeat, silence_level, silence_lenght_abort) +function Ivr.record(self, file_name, beep, phrase_record, phrase_too_short, record_length_max, record_length_min, record_repeat, silence_level, silence_lenght_abort) local duration = nil; for index=1, record_repeat do if (duration and duration >= record_length_min) or not self.caller:ready() then break; elseif duration then self.caller:send_display('Recording too short'); - self.caller.session:sayPhrase(phrase_too_short); + if phrase_too_short then + self.caller.session:sayPhrase(phrase_too_short); + end + end + if phrase_record then + self.caller.session:sayPhrase(phrase_record); + end + if beep then + self.caller:playback(beep); end - self.caller.session:sayPhrase(phrase_record); self.caller:send_display('Recording...'); local result = self.caller.session:recordFile(file_name, record_length_max, silence_level, silence_lenght_abort); duration = self.caller:to_i('record_seconds'); -- cgit v1.2.3