diff --git a/app/scripts/resources/scripts/app/voicemail/index.lua b/app/scripts/resources/scripts/app/voicemail/index.lua index 24f1564da2..cacd0c54eb 100644 --- a/app/scripts/resources/scripts/app/voicemail/index.lua +++ b/app/scripts/resources/scripts/app/voicemail/index.lua @@ -99,7 +99,7 @@ if (effective_caller_id_name ~= nil) then caller_id_name = effective_caller_id_name; end - + --set default values if (string.sub(caller_id_number, 1, 1) == "/") then caller_id_number = string.sub(caller_id_number, 2, -1); @@ -113,12 +113,6 @@ if (not vm_message_ext) then vm_message_ext = 'wav'; end - if (not vm_say_caller_id_number) then - vm_say_caller_id_number = "true"; - end - if (not vm_say_date_time) then - vm_say_date_time = "true"; - end --set the sounds path for the language, dialect and voice default_language = session:getVariable("default_language"); @@ -188,6 +182,26 @@ end end + if (not vm_say_caller_id_number) then + if (settings['voicemail']['message_caller_id_number'] ~= nil) then + if (settings['voicemail']['message_caller_id_number']['text'] ~= nil) then + vm_say_caller_id_number = settings['voicemail']['message_caller_id_number']['text']; + end + end + else + vm_say_caller_id_number = "before"; + end + + if (not vm_say_date_time) then + if (settings['voicemail']['message_date_time'] ~= nil) then + if (settings['voicemail']['message_date_time']['text'] ~= nil) then + vm_say_date_time = settings['voicemail']['message_date_time']['text']; + end + end + else + vm_say_date_time = "before"; + end + remote_access = ''; if (settings['voicemail']['remote_access'] ~= nil) then if (settings['voicemail']['remote_access']['boolean'] ~= nil) then @@ -400,7 +414,7 @@ --send to the main menu timeouts = 0; - if (voicemail_tutorial == "true") then + if (voicemail_tutorial == "true") then tutorial("intro"); else main_menu(); @@ -479,7 +493,7 @@ --freeswitch.consoleLog("notice", "[voicemail][destinations] SQL:" .. sql .. "; params:" .. json.encode(params) .. "\n"); destinations = {}; x = 1; - + dbh:query(sql, params, function(row) destinations[x] = row; x = x + 1; @@ -487,12 +501,12 @@ table.insert(destinations, {domain_uuid=domain_uuid,voicemail_destination_uuid=voicemail_uuid,voicemail_uuid=voicemail_uuid,voicemail_uuid_copy=voicemail_uuid}); --show the storage type freeswitch.consoleLog("notice", "[voicemail] ".. storage_type .. "\n"); - + count = 0 for k,v in pairs(destinations) do count = count + 1 end - + --loop through the voicemail destinations y = 1; for key,row in pairs(destinations) do diff --git a/app/scripts/resources/scripts/app/voicemail/resources/functions/listen_to_recording.lua b/app/scripts/resources/scripts/app/voicemail/resources/functions/listen_to_recording.lua index e1ace902c6..02e31ca783 100644 --- a/app/scripts/resources/scripts/app/voicemail/resources/functions/listen_to_recording.lua +++ b/app/scripts/resources/scripts/app/voicemail/resources/functions/listen_to_recording.lua @@ -56,7 +56,8 @@ session:ready() and caller_id_number ~= nil and ( vm_say_caller_id_number == nil or - vm_say_caller_id_number == "true" + vm_say_caller_id_number == "true" or + vm_say_caller_id_number == "before" )) then session:streamFile(sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/voicemail/vm-from.wav"); session:say(caller_id_number, default_language, "name_spelled", "iterated"); @@ -67,7 +68,8 @@ session:ready() and string.len(dtmf_digits) == 0 and ( vm_say_date_time == nil or - vm_say_date_time == "true" + vm_say_date_time == "true" or + vm_say_date_time == "before" )) then if (current_time_zone ~= nil) then session:execute("set", "timezone="..current_time_zone..""); @@ -117,7 +119,7 @@ if (mime_type == 'audio/mpeg') then vm_message_ext = 'mp3'; end - + --rename the file os.execute('mv '..message_location..' '..message_location..'.'..vm_message_ext); end); @@ -197,8 +199,10 @@ session:ready() and caller_id_number ~= nil and vm_say_caller_id_number ~= nil and - vm_say_caller_id_number == "last" - ) then + ( + vm_say_caller_id_number == "last" or + vm_say_caller_id_number == "after" + )) then session:streamFile(sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/voicemail/vm-from.wav"); session:say(caller_id_number, default_language, "name_spelled", "iterated"); end @@ -208,8 +212,10 @@ session:ready() and string.len(dtmf_digits) == 0 and vm_say_date_time ~= nil and - vm_say_date_time == "last" - ) then + ( + vm_say_date_time == "last" or + vm_say_date_time == "after" + )) then if (current_time_zone ~= nil) then session:execute("set", "timezone="..current_time_zone..""); end diff --git a/app/voicemails/app_config.php b/app/voicemails/app_config.php index bd9d95acf7..7ef8823732 100644 --- a/app/voicemails/app_config.php +++ b/app/voicemails/app_config.php @@ -173,6 +173,22 @@ $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "Define which storage type (base_64 stores in the database)."; $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "14df4ba8-122d-4d2e-8a2e-6fda33c13f74"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "voicemail"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "message_caller_id_number"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "before"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Controls automatic playback of the Caller ID Number: Before (default) or After message playback, or False (disabled)."; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "17b33693-f684-4003-9488-52e55e31a476"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "voicemail"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "message_date_time"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "before"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Controls automatic playback of the Date & Time: Before (default) or After message playback, or False (disabled)."; + $y++; $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "690a36a8-b6d3-47ea-8780-1af609c1966c"; $apps[$x]['default_settings'][$y]['default_setting_category'] = "voicemail"; $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "message_max_length"; diff --git a/core/default_settings/default_setting_edit.php b/core/default_settings/default_setting_edit.php index c4b25cef93..db57725211 100644 --- a/core/default_settings/default_setting_edit.php +++ b/core/default_settings/default_setting_edit.php @@ -699,6 +699,13 @@ echo " \n"; echo " \n"; } + elseif ($category == "voicemail" && ($subcategory == "message_caller_id_number" || $subcategory == "message_date_time") && $name == "text" ) { + echo " \n"; + } elseif ($category == "recordings" && $subcategory == "storage_type" && $name == "text" ) { echo " \n"; } + elseif ($category == "voicemail" && ($subcategory == "message_caller_id_number" || $subcategory == "message_date_time") && $name == "text" ) { + echo " \n"; + } elseif ($category == "recordings" && $subcategory == "storage_type" && $name == "text" ) { echo "