mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 09:03:49 +00:00
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
This commit is contained in:
@@ -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("%${", "");
|
||||
|
||||
Reference in New Issue
Block a user