From c3cbaeea86df01cbf0a5c2677aee75f163d914de Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Wed, 10 Apr 2019 09:40:36 -0600 Subject: [PATCH] Update index.lua --- .../install/scripts/app/is_local/index.lua | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/resources/install/scripts/app/is_local/index.lua b/resources/install/scripts/app/is_local/index.lua index b1f1669935..86f1017750 100644 --- a/resources/install/scripts/app/is_local/index.lua +++ b/resources/install/scripts/app/is_local/index.lua @@ -47,19 +47,20 @@ --set the cache key key = "app:dialplan:outbound:is_local:" .. destination_number .. "@" .. domain_name; ---set the outbound caller id - if (outbound_caller_id_name ~= nil) then - session:execute("set", "caller_id_name="..outbound_caller_id_name); - session:execute("set", "effective_caller_id_name="..outbound_caller_id_name); - end - if (outbound_caller_id_number ~= nil) then - session:execute("set", "caller_id_number="..outbound_caller_id_number); - session:execute("set", "effective_caller_id_number="..outbound_caller_id_number); - end - --get the destination number value, err = cache.get(key); if (err == 'NOT FOUND') then + + --set the outbound caller id + if (outbound_caller_id_name ~= nil) then + session:execute("set", "caller_id_name="..outbound_caller_id_name); + session:execute("set", "effective_caller_id_name="..outbound_caller_id_name); + end + if (outbound_caller_id_number ~= nil) then + session:execute("set", "caller_id_number="..outbound_caller_id_number); + session:execute("set", "effective_caller_id_number="..outbound_caller_id_number); + end + --connect to the database local Database = require "resources.functions.database"; local dbh = Database.new('system');