[eavesdrop] Fix eavesdropping wrong uuid (#6815)

If the extension is in a call and also receives calls at the same time, the query will return more than one uuid causing to eavesdrop the wrong channel.
This commit is contained in:
agree 2023-10-24 19:07:55 -04:00 committed by GitHub
parent 2be533687d
commit a785292811
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -109,7 +109,7 @@
--check the database to get the uuid to eavesdrop on
if (session:ready()) then
local sql = "select uuid from channels where presence_id = :presence_id ";
local sql = "select uuid from channels where presence_id = :presence_id and callstate = 'ACTIVE'";
local params = {presence_id = extension.."@"..domain_name};
if (debug["sql"]) then
freeswitch.consoleLog("notice", "[eavesdrop] SQL: " .. sql .. "; params:" .. json.encode(params) .. "\n");