Replace io.popen with api:executeString

This commit is contained in:
FusionPBX 2022-05-24 16:55:25 -06:00 committed by GitHub
parent 56f8d4ba44
commit d897fad100
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -64,6 +64,9 @@
:gsub('\'', '\\\''))
end
--create the api object
api = freeswitch.API();
--set channel variables to lua variables
domain_uuid = env:getHeader("domain_uuid");
domain_name = env:getHeader("domain_name");
@ -230,9 +233,7 @@
cmd = cmd .. "fax_prefix=false ";
end
freeswitch.consoleLog("notice", "[fax] command: " .. cmd .. "\n");
local handle = io.popen(cmd);
result = handle:read("*a");
handle:close();
result = api:executeString(cmd);
--add to fax logs
sql = "insert into v_fax_logs ";