From fe0575faa645ee361a4393e2e32348394b086da5 Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Fri, 6 Feb 2015 18:51:22 +0000 Subject: [PATCH] Fix hot desking internal and outbound caller id for the hot desked phone. --- resources/install/scripts/dial_string.lua | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/resources/install/scripts/dial_string.lua b/resources/install/scripts/dial_string.lua index b9c648e83f..b4a7a2f522 100644 --- a/resources/install/scripts/dial_string.lua +++ b/resources/install/scripts/dial_string.lua @@ -51,6 +51,7 @@ if ( session:ready() ) then sip_from_host = session:getVariable("sip_from_host"); direction = session:getVariable("direction"); --in, out, both extension = tostring(session:getVariable("extension")); --true, false + user_name = tostring(session:getVariable("user_name")); context = session:getVariable("context"); dial_string = tostring(session:getVariable("dial_string")); if (dial_string == "nil") then dial_string = ""; end @@ -195,16 +196,30 @@ if ( session:ready() ) then session:streamFile(sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/voicemail/vm-saved.wav"); end end - --clear the cache - if (db_extension ~= nil) then - api:execute("memcache", "delete directory:"..db_extension.."@"..context); - end else session:streamFile("phrase:voicemail_fail_auth:#"); session:hangup("NORMAL_CLEARING"); return; end + --clear the cache + if (user_name ~= nil) then + cmd = "delete directory:"..user_name.."@"..context; + result = api:execute("memcache", cmd); + if (debug["var"]) then + freeswitch.consoleLog("NOTICE", "[dial_string] memcache ".. cmd .. "\n"); + freeswitch.consoleLog("NOTICE", "[dial_string] result: ".. result .. "\n"); + end + end + if (db_extension ~= nil) then + cmd = "delete directory:"..db_extension.."@"..context; + result = api:execute("memcache", cmd); + if (debug["var"]) then + freeswitch.consoleLog("NOTICE", "[dial_string] memcache ".. cmd .. "\n"); + freeswitch.consoleLog("NOTICE", "[dial_string] result: ".. result .. "\n"); + end + end + --log to the console if (debug["var"]) then if sip_from_host~=nil then