From 73032b5fae2165eb93ec9f9711fcd333be1310f8 Mon Sep 17 00:00:00 2001 From: netpro25 Date: Sat, 3 Jun 2017 00:33:32 -0400 Subject: [PATCH] Update fax_retry.lua (#2625) Had an issue with malformed email confirmation where the number_dialed was showing up with a bunch of random repeating strings after it. This resolved it for me. Also fixed a grammar error. --- resources/install/scripts/fax_retry.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/install/scripts/fax_retry.lua b/resources/install/scripts/fax_retry.lua index 76a7ea0c83..dd19c9036b 100644 --- a/resources/install/scripts/fax_retry.lua +++ b/resources/install/scripts/fax_retry.lua @@ -301,8 +301,8 @@ if (from_address == nil) then from_address = email_address; end - --needs to be fixed on operating systems that do not have sed or echo utilities. - number_dialed = api:execute("system", "/bin/echo -n "..fax_uri.." | sed -e s,.*/,,g"); + uri_array = explode("/",fax_uri); + number_dialed = uri_array[4]; --do not use apostrophies in message, they are not escaped and the mail will fail. email_message_fail = "We are sorry the fax failed to go through. It has been attached. Please check the number "..number_dialed..", and if it was correct you might consider emailing it instead." email_message_success = "We are happy to report the fax was sent successfully. It has been attached for your records." @@ -519,7 +519,7 @@ freeswitch.consoleLog("INFO","[FAX] RETRY FAILED: tried ["..fax_retry_attempts.."] of [4]: GIVING UP\n"); freeswitch.consoleLog("INFO", "[FAX] RETRY STATS FAILURE: GATEWAY[".. fax_uri .."], tried 5 combinations without success"); - email_message_fail = email_message_fail.." We tried sending 5 times ways. You may also want to know that the call was busy "..fax_busy_attempts.." of those times." + email_message_fail = email_message_fail.." We tried sending 5 times. You may also want to know that the call was busy "..fax_busy_attempts.." of those times." email_address = email_address:gsub("\\,", ","); freeswitch.email(email_address,