From 64cb9fd01fcf01ce8149a14b9734ac703abc7c0c Mon Sep 17 00:00:00 2001 From: Alexey Melnichuk Date: Tue, 20 Oct 2015 20:29:57 +0300 Subject: [PATCH] Add. cache `switchname` --- .../install/scripts/resources/functions/channel_utils.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resources/install/scripts/resources/functions/channel_utils.lua b/resources/install/scripts/resources/functions/channel_utils.lua index 6fb859adc7..b4a1c55477 100644 --- a/resources/install/scripts/resources/functions/channel_utils.lua +++ b/resources/install/scripts/resources/functions/channel_utils.lua @@ -45,12 +45,16 @@ function channel_evalute(uuid, cmd) return result end +local _switchname local function switchname() + if _switchname then return _switchname end + local result = api:executeString("switchname") if result:sub(1, 4) == '-ERR' then return nil, result end if result == '_undef_' then return false end + _switchname = result return result end