From cbe9e9f6195b222bd1d3fe82eb9ee302b3d13fea Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Fri, 28 Nov 2014 20:40:59 +0000 Subject: [PATCH] Ensure that call forward doesn't update follow me if follow_me_uuid is an empty string. --- resources/install/scripts/call_forward.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/resources/install/scripts/call_forward.lua b/resources/install/scripts/call_forward.lua index 938ea99feb..779dbbd02b 100644 --- a/resources/install/scripts/call_forward.lua +++ b/resources/install/scripts/call_forward.lua @@ -223,14 +223,16 @@ --disable the follow me if (session:ready() and enabled == "true" and follow_me_uuid ~= nil) then - sql = "update v_follow_me set "; - sql = sql .. "follow_me_enabled = 'false' "; - sql = sql .. "where domain_uuid = '"..domain_uuid.."' "; - sql = sql .. "and follow_me_uuid = '"..follow_me_uuid.."' "; - if (debug["sql"]) then - freeswitch.consoleLog("notice", "[call_forward] "..sql.."\n"); + if (string.len(follow_me_uuid) > 0) then + sql = "update v_follow_me set "; + sql = sql .. "follow_me_enabled = 'false' "; + sql = sql .. "where domain_uuid = '"..domain_uuid.."' "; + sql = sql .. "and follow_me_uuid = '"..follow_me_uuid.."' "; + if (debug["sql"]) then + freeswitch.consoleLog("notice", "[call_forward] "..sql.."\n"); + end + dbh:query(sql); end - dbh:query(sql); end --check the destination