mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-03-13 03:58:48 +00:00
Update follow_me.lua
1. Use `cache` class so now it generates memcache events. 2. Do not use nested if (simplify code) 3. Use local variables. 4. Remove redundant checks.
This commit is contained in:
@@ -23,6 +23,14 @@ function channel_evalute(uuid, cmd)
|
||||
return result
|
||||
end
|
||||
|
||||
function channel_display(uuid, text)
|
||||
local cmd = ("uuid_display %s '%s'"):format(uuid, text)
|
||||
local result = trim(api:executeString(cmd))
|
||||
if result:sub(1, 4) == '-ERR' then return nil, result end
|
||||
if result == '_undef_' then return false end
|
||||
return result
|
||||
end
|
||||
|
||||
local _switchname
|
||||
local function switchname()
|
||||
if _switchname then return _switchname end
|
||||
|
||||
Reference in New Issue
Block a user