From 6b245369faaf50c8110e9ec4d4f127dfa7111911 Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Fri, 21 Jun 2013 16:09:31 +0000 Subject: [PATCH] Fix a bug that made the the IVR Menu not play the long greeting when the short greeting was not provided. --- app/ivr_menu/ivr_menu_edit.php | 8 ++++++-- resources/install/scripts/ivr_menu.lua | 10 +++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/app/ivr_menu/ivr_menu_edit.php b/app/ivr_menu/ivr_menu_edit.php index d68df4565c..f9ddd20c8c 100644 --- a/app/ivr_menu/ivr_menu_edit.php +++ b/app/ivr_menu/ivr_menu_edit.php @@ -122,6 +122,10 @@ if (count($_POST)>0) { $ivr_menu_enabled = check_str($_POST["ivr_menu_enabled"]); $ivr_menu_description = check_str($_POST["ivr_menu_description"]); + if (isset($ivr_menu_greet_long) && !isset($ivr_menu_greet_short)) { +// $ivr_menu_greet_short = $ivr_menu_greet_long; + } + $ivr_menu_exit_action = check_str($_POST["ivr_menu_exit_action"]); //$ivr_menu_exit_action = "transfer:1001 XML default"; $timeout_action_array = explode(":", $ivr_menu_exit_action); @@ -481,7 +485,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo "\n"; - echo " \n"; echo " \n"; //misc if (if_group("superadmin")) { @@ -535,7 +539,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; //select if (if_group("superadmin")) { - if (!$tmp_selected) { + if (!$tmp_selected && strlen($ivr_menu_greet_short) > 0) { echo "\n"; if (file_exists($_SESSION['switch']['recordings']['dir']."/".$ivr_menu_greet_short)) { echo " \n"; diff --git a/resources/install/scripts/ivr_menu.lua b/resources/install/scripts/ivr_menu.lua index 0e9758d2ab..557f77ea16 100644 --- a/resources/install/scripts/ivr_menu.lua +++ b/resources/install/scripts/ivr_menu.lua @@ -130,10 +130,14 @@ ivr_menu_greet_long = sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/"..ivr_menu_greet_long; end end - if (not file_exists(ivr_menu_greet_short)) then - if (file_exists(sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/"..ivr_menu_greet_short)) then - ivr_menu_greet_short = sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/"..ivr_menu_greet_short; + if (string.len(ivr_menu_greet_short) > 1) then + if (not file_exists(ivr_menu_greet_short)) then + if (file_exists(sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/"..ivr_menu_greet_short)) then + ivr_menu_greet_short = sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/"..ivr_menu_greet_short; + end end + else + ivr_menu_greet_short = ivr_menu_greet_long; end ivr_menu_invalid_entry = sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/ivr/ivr-that_was_an_invalid_entry.wav";