|
Anonymous calls to calling card access numbers 16045554444 and 14162225523 get dropped due to SQL lookup error for a field 'anonymous'.
https://pastebin.com/AhBfyB1b
I fixed it by skipping the sql query if ani_number is 'anonymous' or 'private'
in '/opt/ASTPP/freeswitch/scripts/astpp/lib/calingcard.functions.lua'
--[[ Check DID info. Original code changed to DCI code below
function get_ani(ani_number)
local query = "SELECT * FROM ani_map WHERE number = ".. ani_number
Logger.debug("[CHECK_DID] Query :" .. query)
assert (dbh:query(query, function(u)
ani = u;
end))
return ani;
end ]]
– DCI change. Check DID info. Skip sql query if ani_number is anonymous
function get_ani(ani_number)
local ani = nil – Initialize ani variable to nil
– Check if ani_number contains alphanumeric characters to avoid SQL query execution
if ani_number == "anonymous" or ani_number == "private" or ani_number == "Unavailable" then
Logger.debug("[CHECK_DID] Skipping SQL query for ani_number: " .. ani_number)
else
local query = "SELECT * FROM ani_map WHERE number = ".. ani_number
Logger.debug("[CHECK_DID] Query :" .. query)
– Execute the SQL query only if ani_number doesn't contain special values
assert(dbh:query(query, function(u)
ani = u;
end))
end
return ani;
end – DCI end ]]
|