diff --git a/resources/install/scripts/app/xml_handler/resources/scripts/configuration/conference.conf.lua b/resources/install/scripts/app/xml_handler/resources/scripts/configuration/conference.conf.lua index cd00c0f133..36f8cba3cb 100644 --- a/resources/install/scripts/app/xml_handler/resources/scripts/configuration/conference.conf.lua +++ b/resources/install/scripts/app/xml_handler/resources/scripts/configuration/conference.conf.lua @@ -1,6 +1,6 @@ -- xml_handler.lua -- Part of FusionPBX --- Copyright (C) 2013 Mark J Crane +-- Copyright (C) 2016 Mark J Crane -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without @@ -13,7 +13,7 @@ -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- --- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +-- THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, @@ -37,82 +37,63 @@ table.insert(xml, [[]]); table.insert(xml, [[
]]); table.insert(xml, [[ ]]); + +--start the conference controls table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); + sql = [[SELECT * FROM v_conference_controls + WHERE control_enabled = 'true' ]]; + if (debug["sql"]) then + freeswitch.consoleLog("notice", "[conference_control] SQL: " .. sql .. "\n"); + end + status = dbh:query(sql, function(field) + conference_control_uuid = field["conference_control_uuid"]; + table.insert(xml, [[ ]]); + + --get the conference control details from the database + sql = [[SELECT * FROM v_conference_control_details + WHERE conference_control_uuid = ']] .. conference_control_uuid ..[[' + AND control_enabled = 'true' ]]; + if (debug["sql"]) then + freeswitch.consoleLog("notice", "[conference_control] SQL: " .. sql .. "\n"); + end + + status = dbh:query(sql, function(row) + --conference_control_uuid = row["conference_control_uuid"]; + --conference_control_detail_uuid = row["conference_control_detail_uuid"]; + table.insert(xml, [[ ]]); + end); + table.insert(xml, [[ ]]); + end); table.insert(xml, [[ ]]); - --start the conference profiles - table.insert(xml, [[ ]]); - sql = [[SELECT * FROM v_conference_profiles - WHERE profile_enabled = 'true' ]]; + +--start the conference profiles + table.insert(xml, [[ ]]); + sql = [[SELECT * FROM v_conference_profiles + WHERE profile_enabled = 'true' ]]; + if (debug["sql"]) then + freeswitch.consoleLog("notice", "[conference_profiles] SQL: " .. sql .. "\n"); + end + status = dbh:query(sql, function(field) + conference_profile_uuid = field["conference_profile_uuid"]; + table.insert(xml, [[ ]]); + + --get the conference profile parameters from the database + sql = [[SELECT * FROM v_conference_profile_params + WHERE conference_profile_uuid = ']] .. conference_profile_uuid ..[[' + AND profile_param_enabled = 'true' ]]; if (debug["sql"]) then freeswitch.consoleLog("notice", "[conference_profiles] SQL: " .. sql .. "\n"); end - status = dbh:query(sql, function(field) - conference_profile_uuid = field["conference_profile_uuid"]; - table.insert(xml, [[ ]]); - - --get the conference profile parameters from the database - sql = [[SELECT * FROM v_conference_profile_params - WHERE conference_profile_uuid = ']] .. conference_profile_uuid ..[[' - AND profile_param_enabled = 'true' ]]; - if (debug["sql"]) then - freeswitch.consoleLog("notice", "[conference_profiles] SQL: " .. sql .. "\n"); - end - - status = dbh:query(sql, function(row) - --conference_profile_uuid = row["conference_profile_uuid"]; - --conference_profile_param_uuid = row["conference_profile_param_uuid"]; - --profile_param_description = row["profile_param_description"]; - table.insert(xml, [[ ]]); - end); - table.insert(xml, [[ ]]); + status = dbh:query(sql, function(row) + --conference_profile_uuid = row["conference_profile_uuid"]; + --conference_profile_param_uuid = row["conference_profile_param_uuid"]; + --profile_param_description = row["profile_param_description"]; + table.insert(xml, [[ ]]); end); - + table.insert(xml, [[ ]]); + end); table.insert(xml, [[ ]]); --set the xml array and then concatenate the array to a string