mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-03-04 15:56:36 +00:00
Update cidlookup.lua (#5134)
Added callee parameter to SQL query and changed v_destinations.destination_number to look at callee.
This commit is contained in:
@@ -87,15 +87,15 @@
|
||||
sql = "SELECT v_contacts.contact_name_given || ' ' || v_contacts.contact_name_family AS name FROM v_contacts ";
|
||||
end
|
||||
sql = sql .. "INNER JOIN v_contact_phones ON v_contact_phones.contact_uuid = v_contacts.contact_uuid ";
|
||||
sql = sql .. "INNER JOIN v_destinations ON v_destinations.domain_uuid = v_contacts.domain_uuid AND v_destinations.destination_number = :caller ";
|
||||
sql = sql .. "INNER JOIN v_destinations ON v_destinations.domain_uuid = v_contacts.domain_uuid AND v_destinations.destination_number = :callee ";
|
||||
|
||||
local params;
|
||||
if ((not domain_uuid) or (domain_uuid == "")) then
|
||||
sql = sql .. "WHERE v_contact_phones.phone_number = :caller ";
|
||||
params = {caller = caller};
|
||||
params = {caller = caller, callee = callee};
|
||||
else
|
||||
sql = sql .. "WHERE v_contacts.domain_uuid = :domain_uuid and v_contact_phones.phone_number = :caller ";
|
||||
params = {caller = caller, domain_uuid = domain_uuid};
|
||||
params = {caller = caller, domain_uuid = domain_uuid, callee = callee};
|
||||
end
|
||||
|
||||
if (debug["sql"]) then
|
||||
|
||||
Reference in New Issue
Block a user