From 05188ffd24810d0110bcff25cb605f5ea9456050 Mon Sep 17 00:00:00 2001 From: Alexey Melnichuk Date: Tue, 2 Feb 2016 19:54:23 +0300 Subject: [PATCH] Fix. cache.support always returns `false` --- .../install/scripts/resources/functions/cache.lua | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/resources/install/scripts/resources/functions/cache.lua b/resources/install/scripts/resources/functions/cache.lua index 6d121eb995..a110927e85 100644 --- a/resources/install/scripts/resources/functions/cache.lua +++ b/resources/install/scripts/resources/functions/cache.lua @@ -9,11 +9,15 @@ require "resources.functions.trim"; local api = api -if (not api) and freeswitch then api = freeswitch.API() else -api = {} -function api:execute() - return '-ERR UNSUPPORTTED' -end +if not api then + if freeswitch then + api = freeswitch.API() + else + api = {} + function api:execute() + return '-ERR UNSUPPORTTED' + end + end end local function send_event(action, key)