mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
@@ -39,6 +39,7 @@ local log = require "resources.functions.log".ring_group
|
||||
require "resources.functions.base64";
|
||||
require "resources.functions.file_exists";
|
||||
require "resources.functions.channel_utils"
|
||||
require "resources.functions.format_ringback"
|
||||
|
||||
--get the variables
|
||||
domain_name = session:getVariable("domain_name");
|
||||
@@ -321,27 +322,7 @@ local log = require "resources.functions.log".ring_group
|
||||
domain_name = row.domain_name;
|
||||
|
||||
--set ringback
|
||||
if (ring_group_ringback == "${uk-ring}") then
|
||||
ring_group_ringback = "tone_stream://%(400,200,400,450);%(400,2200,400,450);loops=-1";
|
||||
end
|
||||
if (ring_group_ringback == "${us-ring}") then
|
||||
ring_group_ringback = "tone_stream://%(2000,4000,440.0,480.0);loops=-1";
|
||||
end
|
||||
if (ring_group_ringback == "${pt-ring}") then
|
||||
ring_group_ringback = "tone_stream://%(1000,5000,400.0,0.0);loops=-1";
|
||||
end
|
||||
if (ring_group_ringback == "${fr-ring}") then
|
||||
ring_group_ringback = "tone_stream://%(1500,3500,440.0,0.0);loops=-1";
|
||||
end
|
||||
if (ring_group_ringback == "${rs-ring}") then
|
||||
ring_group_ringback = "tone_stream://%(1000,4000,425.0,0.0);loops=-1";
|
||||
end
|
||||
if (ring_group_ringback == "${it-ring}") then
|
||||
ring_group_ringback = "tone_stream://%(1000,4000,425.0,0.0);loops=-1";
|
||||
end
|
||||
if (ring_group_ringback == "") then
|
||||
ring_group_ringback = "local_stream://default";
|
||||
end
|
||||
ring_group_ringback = format_ringback(ring_group_ringback);
|
||||
session:setVariable("ringback", ring_group_ringback);
|
||||
session:setVariable("transfer_ringback", ring_group_ringback);
|
||||
|
||||
|
||||
@@ -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, [[ <queue name="]]..queue_name..[[@]]..domain_name..[[">]]);
|
||||
table.insert(xml, [[ <param name="strategy" value="]]..queue_strategy..[["/>]]);
|
||||
if (string.len(queue_moh_sound) == 0) then
|
||||
table.insert(xml, [[ <param name="moh-sound" value="local_stream://default"/>]]);
|
||||
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, [[ <param name="moh-sound" value="tone_stream://]]..tone_string..[[;loops=-1"/>]]);
|
||||
end
|
||||
elseif (string.sub(queue_moh_sound, 0, 15) == 'local_stream://') then
|
||||
table.insert(xml, [[ <param name="moh-sound" value="]]..queue_moh_sound..[["/>]]);
|
||||
else
|
||||
if (queue_moh_sound == nil or queue_moh_sound == "") then
|
||||
queue_moh_sound = "local_stream://default";
|
||||
end
|
||||
table.insert(xml, [[ <param name="moh-sound" value="]]..queue_moh_sound..[["/>]]);
|
||||
end
|
||||
end
|
||||
--set ringback
|
||||
queue_ringback = format_ringback(queue_moh_sound);
|
||||
table.insert(xml, [[ <param name="moh-sound" value="]]..queue_ringback..[["/>]]);
|
||||
if (queue_record_template ~= nil) then
|
||||
table.insert(xml, [[ <param name="record-template" value="]]..queue_record_template..[["/>]]);
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user