From f9d191c520ffe998428a59c857c259ba504bf9f0 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Thu, 23 Jun 2016 15:29:14 -0600 Subject: [PATCH] Add full path to the music on hold chime list. --- .../configuration/local_stream.conf.lua | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/resources/install/scripts/app/xml_handler/resources/scripts/configuration/local_stream.conf.lua b/resources/install/scripts/app/xml_handler/resources/scripts/configuration/local_stream.conf.lua index 55fce4adc2..b48024f80d 100644 --- a/resources/install/scripts/app/xml_handler/resources/scripts/configuration/local_stream.conf.lua +++ b/resources/install/scripts/app/xml_handler/resources/scripts/configuration/local_stream.conf.lua @@ -25,6 +25,21 @@ --replace the variable with the path to the sounds directory music_on_hold_path = row.music_on_hold_path:gsub("$${sounds_dir}", sounds_dir); + --add the full path to the chime list + chime_list = row.music_on_hold_chime_list; + if (chime_list ~= nil) then + chime_array = explode(",", chime_list); + chime_list = ""; + for k,v in pairs(chime_array) do + f = explode("/", v); + if (file_exists(sounds_dir.."/en/us/callie/"..f[1].."/8000/"..f[2])) then + chime_list = chime_list .. sounds_dir.."/en/us/callie/"..v; + else + chime_list = chime_list .. v; + end + end + end + --build the xml ]]..row.music_on_hold_name..[[" table.insert(xml, [[ ]]); table.insert(xml, [[ ]]); @@ -32,8 +47,8 @@ table.insert(xml, [[ ]]); table.insert(xml, [[ ]]); table.insert(xml, [[ ]]); - if (row.music_on_hold_chime_list ~= nil) then - table.insert(xml, [[ ]]); + if (chime_list ~= nil) then + table.insert(xml, [[ ]]); end if (row.music_on_hold_chime_freq ~= nil) then table.insert(xml, [[ ]]); @@ -50,9 +65,9 @@ table.insert(xml, [[ ]]); table.insert(xml, [[]]); XML_STRING = table.concat(xml, "\n"); - if (debug["xml_string"]) then +-- if (debug["xml_string"]) then freeswitch.consoleLog("notice", "[xml_handler] XML_STRING: " .. XML_STRING .. "\n"); - end +-- end --close the database connection dbh:release();