Only one row allowed so added limit 1.

This commit is contained in:
FusionPBX 2022-05-07 09:02:58 -06:00 committed by GitHub
parent 90f33bd64d
commit a4c0e93cbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,6 @@
-- xml_handler.lua
-- Part of FusionPBX
-- Copyright (C) 2015-2021 Mark J Crane <markjcrane@fusionpbx.com>
-- Copyright (C) 2015-2022 Mark J Crane <markjcrane@fusionpbx.com>
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
@ -155,7 +155,9 @@
--get the agents
table.insert(xml, [[ <agents>]]);
sql = "select SPLIT_PART(SPLIT_PART(a.agent_contact, '/', 2), '@', 1) as extension, ";
sql = sql .. "(select extension_uuid from v_extensions where domain_uuid = a.domain_uuid and extension = SPLIT_PART(SPLIT_PART(a.agent_contact, '/', 2), '@', 1)) as extension_uuid, a.*, d.domain_name ";
sql = sql .. "(select extension_uuid from v_extensions where domain_uuid = a.domain_uuid ";
sql = sql .. "and extension = SPLIT_PART(SPLIT_PART(a.agent_contact, '/', 2), '@', 1) limit 1) as extension_uuid, ";
sql = sql .. "a.*, d.domain_name ";
sql = sql .. "from v_call_center_agents as a, v_domains as d ";
sql = sql .. "where d.domain_uuid = a.domain_uuid; ";
--sql = "select * from v_call_center_agents as a, v_domains as d ";