Only one row allowed so added limit 1.
This commit is contained in:
+4
-2
@@ -1,6 +1,6 @@
|
|||||||
-- xml_handler.lua
|
-- xml_handler.lua
|
||||||
-- Part of FusionPBX
|
-- 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.
|
-- All rights reserved.
|
||||||
--
|
--
|
||||||
-- Redistribution and use in source and binary forms, with or without
|
-- Redistribution and use in source and binary forms, with or without
|
||||||
@@ -155,7 +155,9 @@
|
|||||||
--get the agents
|
--get the agents
|
||||||
table.insert(xml, [[ <agents>]]);
|
table.insert(xml, [[ <agents>]]);
|
||||||
sql = "select SPLIT_PART(SPLIT_PART(a.agent_contact, '/', 2), '@', 1) as extension, ";
|
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 .. "from v_call_center_agents as a, v_domains as d ";
|
||||||
sql = sql .. "where d.domain_uuid = a.domain_uuid; ";
|
sql = sql .. "where d.domain_uuid = a.domain_uuid; ";
|
||||||
--sql = "select * from v_call_center_agents as a, v_domains as d ";
|
--sql = "select * from v_call_center_agents as a, v_domains as d ";
|
||||||
|
|||||||
Reference in New Issue
Block a user