From 05c657f55468b7ca50c36be0549f71c01afd8d5b Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Sun, 13 Jul 2014 04:12:04 +0000 Subject: [PATCH] Add global outbound route compatibility for ring groups external destinations --- .../install/scripts/app/ring_groups/index.lua | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/resources/install/scripts/app/ring_groups/index.lua b/resources/install/scripts/app/ring_groups/index.lua index 377d482262..ce5f934df1 100644 --- a/resources/install/scripts/app/ring_groups/index.lua +++ b/resources/install/scripts/app/ring_groups/index.lua @@ -7,11 +7,11 @@ -- modification, are permitted provided that the following conditions are met: -- -- 1. Redistributions of source code must retain the above copyright notice, --- this list of conditions and the following disclaimer. +-- this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright --- notice, this list of conditions and the following disclaimer in the --- documentation and/or other materials provided with the distribution. +-- notice, this list of conditions and the following disclaimer in the +-- documentation and/or other materials provided with the distribution. -- -- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -28,7 +28,6 @@ -- Mark J Crane -- Luis Daniel Lucio Qurioz - --connect to the database dofile(scripts_dir.."/resources/functions/database_handle.lua"); dbh = database_handle('system'); @@ -92,9 +91,9 @@ --set the caller id if (session:ready()) then - if (string.len(ring_group_cid_name_prefix) > 0) then - session:execute("set", "effective_caller_id_name="..ring_group_cid_name_prefix.."#"..caller_id_name); - end + if (string.len(ring_group_cid_name_prefix) > 0) then + session:execute("set", "effective_caller_id_name="..ring_group_cid_name_prefix.."#"..caller_id_name); + end end --process the ring group @@ -110,7 +109,7 @@ and d.ring_group_uuid = ']]..ring_group_uuid..[[' and r.ring_group_enabled = 'true' order by d.destination_delay, d.destination_number asc ]] -freeswitch.consoleLog("notice", "SQL:" .. sql .. "\n"); + freeswitch.consoleLog("notice", "SQL:" .. sql .. "\n"); destinations = {}; x = 1; assert(dbh:query(sql, function(row) @@ -142,7 +141,7 @@ freeswitch.consoleLog("notice", "SQL:" .. sql .. "\n"); --get the dialplan data and save it to a table if (external) then sql = [[select * from v_dialplans as d, v_dialplan_details as s - where d.domain_uuid = ']] .. domain_uuid .. [[' + where (d.domain_uuid = ']] .. domain_uuid .. [[' or d.domain_uuid is null) and d.app_uuid = '8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3' and d.dialplan_enabled = 'true' and d.dialplan_uuid = s.dialplan_uuid @@ -413,7 +412,6 @@ freeswitch.consoleLog("notice", "SQL:" .. sql .. "\n"); end end - --actions --ACTIONS = {} --table.insert(ACTIONS, {"set", "hangup_after_bridge=true"});