Add per leg ring group domain name control. Contributed by Daniel Lucio.
dest1: 100 dest2: 999@otherdomain dest3: 555
This commit is contained in:
@@ -23,6 +23,11 @@
|
|||||||
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
-- POSSIBILITY OF SUCH DAMAGE.
|
-- POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
--
|
||||||
|
-- Contributor(s):
|
||||||
|
-- Mark J Crane <markjcrane@fusionpbx.com>
|
||||||
|
-- Luis Daniel Lucio Qurioz <daniel.lucio@astraqom.com>
|
||||||
|
|
||||||
|
|
||||||
--connect to the database
|
--connect to the database
|
||||||
dofile(scripts_dir.."/resources/functions/database_handle.lua");
|
dofile(scripts_dir.."/resources/functions/database_handle.lua");
|
||||||
@@ -105,7 +110,16 @@
|
|||||||
if (row.destination_prompt == "1" or row.destination_prompt == "2") then
|
if (row.destination_prompt == "1" or row.destination_prompt == "2") then
|
||||||
prompt = "true";
|
prompt = "true";
|
||||||
end
|
end
|
||||||
cmd = "user_exists id ".. row.destination_number .." "..domain_name;
|
|
||||||
|
local array = explode("@",row.destination_number);
|
||||||
|
if (array[2] == nil) then
|
||||||
|
-- no @
|
||||||
|
leg_domain_name = domain_name;
|
||||||
|
else
|
||||||
|
leg_domain_name = array[2];
|
||||||
|
row.destination_number = array[1]
|
||||||
|
end
|
||||||
|
cmd = "user_exists id ".. row.destination_number .." "..leg_domain_name;
|
||||||
user_exists = api:executeString(cmd);
|
user_exists = api:executeString(cmd);
|
||||||
if (user_exists == "true") then
|
if (user_exists == "true") then
|
||||||
row['user_exists'] = "true";
|
row['user_exists'] = "true";
|
||||||
@@ -113,6 +127,7 @@
|
|||||||
external = "true";
|
external = "true";
|
||||||
row['user_exists'] = "false";
|
row['user_exists'] = "false";
|
||||||
end
|
end
|
||||||
|
row['domain_name'] = leg_domain_name;
|
||||||
destinations[x] = row;
|
destinations[x] = row;
|
||||||
x = x + 1;
|
x = x + 1;
|
||||||
end));
|
end));
|
||||||
@@ -160,6 +175,7 @@
|
|||||||
destination_delay = row.destination_delay;
|
destination_delay = row.destination_delay;
|
||||||
destination_timeout = row.destination_timeout;
|
destination_timeout = row.destination_timeout;
|
||||||
destination_prompt = row.destination_prompt;
|
destination_prompt = row.destination_prompt;
|
||||||
|
domain_name = row.domain_name;
|
||||||
|
|
||||||
--set ringback
|
--set ringback
|
||||||
if (ring_group_ringback == "${uk-ring}") then
|
if (ring_group_ringback == "${uk-ring}") then
|
||||||
@@ -285,8 +301,8 @@
|
|||||||
end
|
end
|
||||||
previous_dialplan_uuid = r.dialplan_uuid;
|
previous_dialplan_uuid = r.dialplan_uuid;
|
||||||
end
|
end
|
||||||
--freeswitch.consoleLog("notice", "[ring group] dial_string: " .. dial_string .. "\n");
|
|
||||||
end
|
end
|
||||||
|
freeswitch.consoleLog("notice", "[ring group] dial_string: " .. dial_string .. "\n");
|
||||||
|
|
||||||
--prompt will use the confirm lua script and the content of else will use the concatenated dialstring seperated by the delimiter
|
--prompt will use the confirm lua script and the content of else will use the concatenated dialstring seperated by the delimiter
|
||||||
if (prompt == "true") then
|
if (prompt == "true") then
|
||||||
|
|||||||
Reference in New Issue
Block a user