From a66580eaa1a054ba8439cc1e00c54ce420d3410c Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 2 Apr 2022 23:28:17 -0600 Subject: [PATCH] Update hangup_rx.lua Enabled for now until code is completed to replace it. --- .../app/fax/resources/scripts/hangup_rx.lua | 53 ++++++++----------- 1 file changed, 22 insertions(+), 31 deletions(-) diff --git a/app/scripts/resources/scripts/app/fax/resources/scripts/hangup_rx.lua b/app/scripts/resources/scripts/app/fax/resources/scripts/hangup_rx.lua index 21eeaf9be2..a7c5a0db48 100644 --- a/app/scripts/resources/scripts/app/fax/resources/scripts/hangup_rx.lua +++ b/app/scripts/resources/scripts/app/fax/resources/scripts/hangup_rx.lua @@ -210,38 +210,29 @@ end --fax to email - ---- cmd = "lua" .. " " .. quote(scripts_dir .. "/fax_to_email.lua") .. " "; - --cmd = quote(shell_esc(php_dir).."/"..shell_esc(php_bin)).." "..quote(shell_esc(document_root).."/secure/fax_to_email.php").." "; - --cmd = cmd .. "email="..quote(shell_esc(fax_email)).." "; - --cmd = cmd .. "extension="..quote(shell_esc(fax_extension)).." "; - --cmd = cmd .. "name="..quote(shell_esc(fax_file)).." "; - --cmd = cmd .. "messages=" .. quote("result:"..shell_esc(fax_result_text).." sender:"..shell_esc(fax_remote_station_id).." pages:"..shell_esc(fax_document_total_pages)).." "; - --cmd = cmd .. "domain="..quote(shell_esc(domain_name)).." "; - --cmd = cmd .. "caller_id_name=" .. quote(shell_esc(caller_id_name) or '') .. " "; - --cmd = cmd .. "caller_id_number=" .. quote(shell_esc(caller_id_number) or '') .. " "; - --if #fax_forward_number > 0 then - -- cmd = cmd .. "fax_relay=true "; - --else - -- cmd = cmd .. "fax_relay=false "; - --end - --if #fax_prefix > 0 then - -- cmd = cmd .. "fax_prefix=true "; - --else - -- cmd = cmd .. "fax_prefix=false "; - --end - --freeswitch.consoleLog("notice", "[fax] command: " .. cmd .. "\n"); - --local handle = io.popen(cmd); - --result = handle:read("*a"); - --handle:close(); - ---update the email queue status - if (fax_success == '1') then - sql = "update v_fax_queue "; - sql = sql .. "set fax_status = 'sent' "; - sql = sql .. "where fax_queue_uuid = :fax_queue_uuid "; - local params = {fax_queue_uuid = fax_queue_uuid} - dbh:query(sql, params); + cmd = "lua" .. " " .. quote(scripts_dir .. "/fax_to_email.lua") .. " "; + cmd = quote(shell_esc(php_dir).."/"..shell_esc(php_bin)).." "..quote(shell_esc(document_root).."/secure/fax_to_email.php").." "; + cmd = cmd .. "email="..quote(shell_esc(fax_email)).." "; + cmd = cmd .. "extension="..quote(shell_esc(fax_extension)).." "; + cmd = cmd .. "name="..quote(shell_esc(fax_file)).." "; + cmd = cmd .. "messages=" .. quote("result:"..shell_esc(fax_result_text).." sender:"..shell_esc(fax_remote_station_id).." pages:"..shell_esc(fax_document_total_pages)).." "; + cmd = cmd .. "domain="..quote(shell_esc(domain_name)).." "; + cmd = cmd .. "caller_id_name=" .. quote(shell_esc(caller_id_name) or '') .. " "; + cmd = cmd .. "caller_id_number=" .. quote(shell_esc(caller_id_number) or '') .. " "; + if #fax_forward_number > 0 then + cmd = cmd .. "fax_relay=true "; + else + cmd = cmd .. "fax_relay=false "; end + if #fax_prefix > 0 then + cmd = cmd .. "fax_prefix=true "; + else + cmd = cmd .. "fax_prefix=false "; + end + freeswitch.consoleLog("notice", "[fax] command: " .. cmd .. "\n"); + local handle = io.popen(cmd); + result = handle:read("*a"); + handle:close(); --add to fax logs sql = "insert into v_fax_logs ";