From c746119faaea8fef5dc781e5268ff920066c180a Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Wed, 14 Jun 2023 19:15:16 -0600 Subject: [PATCH] Replace tonumber function with # which casts the string to a number --- .../resources/scripts/app/conference_center/index.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/scripts/resources/scripts/app/conference_center/index.lua b/app/scripts/resources/scripts/app/conference_center/index.lua index bdd94591a9..f298121919 100644 --- a/app/scripts/resources/scripts/app/conference_center/index.lua +++ b/app/scripts/resources/scripts/app/conference_center/index.lua @@ -206,7 +206,7 @@ if (debug["sql"]) then freeswitch.consoleLog("notice", "[conference center] SQL: " .. sql .. "; params:" .. json.encode(params) .. "; Rows: "..num_rows.."\n"); end - if (tonumber(num_rows) == 0) then + if (#num_rows == 0) then local sql = {} table.insert(sql, "INSERT INTO v_conference_sessions "); table.insert(sql, "("); @@ -651,14 +651,14 @@ --set a conference parameter if (max_members ~= nil) then - if (tonumber(max_members) > 0) then + if (#max_members > 0) then --max members must be 2 or more session:execute("set","conference_max_members="..max_members); if (conference_exists) then cmd = "conference "..conference_room_uuid.."@"..domain_name.." get count"; count = trim(api:executeString(cmd)); if (count ~= nil) then - if (tonumber(count) >= tonumber(max_members)) then + if (#count >= #max_members) then session:execute("playback", sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/conference/conf-locked.wav"); session:hangup("CALL_REJECTED"); end