diff --git a/resources/install/scripts/app/xml_handler/resources/scripts/configuration/callcenter.conf.lua b/resources/install/scripts/app/xml_handler/resources/scripts/configuration/callcenter.conf.lua index 9806d6a76d..a7169c70ab 100644 --- a/resources/install/scripts/app/xml_handler/resources/scripts/configuration/callcenter.conf.lua +++ b/resources/install/scripts/app/xml_handler/resources/scripts/configuration/callcenter.conf.lua @@ -24,6 +24,9 @@ -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- POSSIBILITY OF SUCH DAMAGE. +--include functions + require "resources.functions.format_ringback" + --get the cache hostname = trim(api:execute("switchname", "")); if (trim(api:execute("module_exists", "mod_memcache")) == "true") then @@ -95,25 +98,9 @@ table.insert(xml, [[ ]]); table.insert(xml, [[ ]]); - if (string.len(queue_moh_sound) == 0) then - table.insert(xml, [[ ]]); - else - if (string.sub(queue_moh_sound, 0, 14) == 'tone_stream://' or string.sub(queue_moh_sound, 0, 2) == '${') then - --given this string --tone_stream://${us-ring};loops=-1 --return us-ring - a, b, tone_string = string.find(queue_moh_sound, ".*{(.*)}.*"); - if (tone_string ~= nil) then - tone_string = trim(api:execute("global_getvar", tone_string)); - table.insert(xml, [[ ]]); - end - elseif (string.sub(queue_moh_sound, 0, 15) == 'local_stream://') then - table.insert(xml, [[ ]]); - else - if (queue_moh_sound == nil or queue_moh_sound == "") then - queue_moh_sound = "local_stream://default"; - end - table.insert(xml, [[ ]]); - end - end + --set ringback + queue_ringback = format_ringback(queue_moh_sound); + table.insert(xml, [[ ]]); if (queue_record_template ~= nil) then table.insert(xml, [[ ]]); end