From e3a3bbcd9f90d1bce086a0be26331b1b7eeb9247 Mon Sep 17 00:00:00 2001 From: Mafoo Date: Thu, 28 Jul 2016 03:06:41 +0100 Subject: [PATCH] BugFix-add missing default ringback to lua (#1682) add processing of when ringback is set to default_ringback and correctly set it to the current value of the globalvar for ringback --- .../scripts/resources/functions/format_ringback.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/resources/install/scripts/resources/functions/format_ringback.lua b/resources/install/scripts/resources/functions/format_ringback.lua index 83dcc95547..f9a5592c3d 100644 --- a/resources/install/scripts/resources/functions/format_ringback.lua +++ b/resources/install/scripts/resources/functions/format_ringback.lua @@ -7,8 +7,13 @@ api = freeswitch.API(); --handle ringback if (ringback == nil or ringback == "") then - --get the default ring back + --get the default hold_music ringback = trim(api:execute("global_getvar", "hold_music")); + elseif (ringback == "default_ringback") then + --get the default ringback variable + ringback = trim(api:execute("global_getvar", "ringback")); + --convert to tone_stream + ringback = "tone_stream://" .. ringback .. ";loops=-1"; elseif (ringback:match("%${.*}")) then --strip the ${ and } ringback = ringback:gsub("%${", "");