Update index.lua
This commit is contained in:
parent
e80593bd5e
commit
fa232dc6c5
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
-- The Initial Developer of the Original Code is
|
-- The Initial Developer of the Original Code is
|
||||||
-- Mark J Crane <markjcrane@fusionpbx.com>
|
-- Mark J Crane <markjcrane@fusionpbx.com>
|
||||||
-- Portions created by the Initial Developer are Copyright (C) 2016
|
-- Portions created by the Initial Developer are Copyright (C) 2019
|
||||||
-- the Initial Developer. All Rights Reserved.
|
-- the Initial Developer. All Rights Reserved.
|
||||||
|
|
||||||
-- load config
|
-- load config
|
||||||
|
|
@ -40,16 +40,15 @@
|
||||||
--get the argv values
|
--get the argv values
|
||||||
destination = argv[2];
|
destination = argv[2];
|
||||||
|
|
||||||
-- search in memcache first
|
-- search in cache first
|
||||||
local key = "app:dialplan:outbound:speed_dial:" .. user .. ":" .. destination .. "@" .. domain_name
|
local key = "app:dialplan:outbound:speed_dial:" .. user .. ":" .. destination .. "@" .. domain_name
|
||||||
local source = "memcache"
|
|
||||||
local value = cache.get(key)
|
local value = cache.get(key)
|
||||||
|
|
||||||
-- decode value from memcache
|
-- decode value from cache
|
||||||
if value then
|
if value then
|
||||||
local t = json.decode(value)
|
local t = json.decode(value)
|
||||||
if not (t and t.phone_number) then
|
if not (t and t.phone_number) then
|
||||||
log.warningf("can not decode value from memcache: %s", value)
|
log.warningf("can not decode value from cache: %s", value)
|
||||||
value = nil
|
value = nil
|
||||||
else
|
else
|
||||||
value = t
|
value = t
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue