From c38d19b8990a71d08ec98fefdc2522fa52c1e232 Mon Sep 17 00:00:00 2001 From: Alexey Melnichuk Date: Mon, 28 Sep 2015 11:35:12 +0400 Subject: [PATCH] Change. Reduce search parent host name. This can be done because child and parent channels have to be on same FS. --- resources/install/scripts/intercept.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/resources/install/scripts/intercept.lua b/resources/install/scripts/intercept.lua index ce683dc5fd..b0955af566 100644 --- a/resources/install/scripts/intercept.lua +++ b/resources/install/scripts/intercept.lua @@ -138,6 +138,8 @@ end -- search parent hostname + call_hostname = hostname + --[[ parent and child have to be on same box so we do not search it log.notice("Found parent channel try detect parent hostname") local dbh = Database.new('switch') local sql = "SELECT hostname FROM channels WHERE uuid='" .. parent_uuid .. "'" @@ -148,6 +150,7 @@ log.notice("Can not find host name. Channels is dead?") return true end + --]] if hostname == call_hostname then log.notice("Found parent call on local machine. Do intercept....") @@ -288,18 +291,22 @@ channel_variable(uuid, 'fifo_bridge_uuid') or uuid + --[[ parent and child have to be on same box so we do not search it if parent_uuid ~= uuid then - uuid = parent_uuid local sql = "SELECT hostname FROM channels WHERE uuid='" .. uuid .. "'" call_hostname = dbh:first_value(sql) end + --]] + if call_hostname then + uuid = parent_uuid if call_hostname ~= hostname then log.noticef("Found parent call on remote machine `%s`.", call_hostname) else log.notice("Found parent call on local machine.") end end + else log.noticef("Found child call on remote machine `%s`.", call_hostname) -- we can not find parent on this box because channel on other box so we have to