Received faxes are not sent by eMail, but sent ones are.

Status
Not open for further replies.

diwou

New Member
Dec 1, 2021
7
0
1
56
Germany
Hello,

I'm trying to get into the FusionPBX/FreeSwitch topic right now. And right now I'm a bit stuck on the fax server.

In general, sending and receiving fax works. When I send a fax, I also get an eMail. When I receive a fax, no eMail is sent.

What I noticed is that in the outbound of the fax server the fax is available as TIFF as well as PDF.

In the inbox, however, only the TIFF is available, but no PDF. The fax reception was confirmed with "OK" and also no error appears in the log.

Probably no eMail comes, because no PDF is generated. When I look at the TIFF file, it looks fine.

Does anyone have a tip for me, where I could still look, or what could be misconfigured?

Many thanks in advance.
Dirk

Platform: amd64
OS: Debian 10.11.0 (4.19.0-18)
FreeSWITCH: Version: 1.10.7-release-19-883d2cb662~64bit
FusionPBX: Version 4.5.31
PHP-Version: 7.3.31-1~deb10u1
 
Feb 5, 2021
52
4
8
54
Hi Dirk, for what I have seen for Fax notifications. The emails added inside the Email section (enclosed in red circle on my image), are notified as follows> the first email will be notified when a fax is sent and when its received. The second email will be notified only when a fax is received.
1638393438853.png
 
Feb 5, 2021
52
4
8
54
You might also want to check the "keep_local" option inside the Fax section in Domain settings, I think that if its disabled, then the notifications that the fax was sent successfully will also be disabled.
 

diwou

New Member
Dec 1, 2021
7
0
1
56
Germany
Hello Lorena,

I had already tried around with the eMail addresses. Also different entered. Also with the parameter keep_local I tested (stood per default on true). But still there are no incoming faxes via eMail.

I am also surprised that no PDFs are created for the incoming faxes. But with the outgoing faxes the PDFs are created without any problems.

In the meantime, I have installed another instance in a VM under Ubuntu Server as a test. But the result is the same. When sending an email comes, when receiving not. (I had not installed a backup, but a completely new installation).

Greetings
Dirk
 

diwou

New Member
Dec 1, 2021
7
0
1
56
Germany
I called the fs_cli while receiving the fax and switched on the log for the fax server before.

There comes among other things the following entry:

Code:
2021-12-02 10:45:09.907683 94.83% [NOTICE] switch_cpp.cpp:1465 [fax] command: /usr/bin/php /var/www/fusionpbx/secure/fax_to_email.php email=my@email.com extension=910 name=/var/lib/freeswitch/storage/fax/test.test.com/910/inbox/0123456789-2021-12-02-10-44-50.tif messages='result:OK sender:+49 815 47110815 pages:1' domain=test.test.com caller_id_name=081547110815 caller_id_number=081547110815 fax_relay=false fax_prefix=false

Then I just ran the following on the command line:

Code:
/usr/bin/php /var/www/fusionpbx/secure/fax_to_email.php email=my@email.com extension=910 name=/var/lib/freeswitch/storage/fax/test.test.com/910/inbox/0123456789-2021-12-02-10-44-50.tif messages='result:OK sender:+49 815 47110815 pages:1' domain=test.test.com caller_id_name=081547110815 caller_id_number=081547110815 fax_relay=false fax_prefix=false[

And already the eMail with the PDF arrived by eMail. For some reason, this does not seem to be executed automatically. Unfortunately no error is displayed.

If I execute the line by hand, a PDF is also displayed in the FusionPBX GUI.

Greetings
Dirk
 

diwou

New Member
Dec 1, 2021
7
0
1
56
Germany
Hello,

I have now installed another 3rd instance from scratch. And also here the error shows up. The necessary script is shown as [NOTICE], but apparently not executed.

What is in any case a bug in FusionPBX is that the necessary directories for the FaxServer are not created. If you create a new fax extension and want to receive a fax you get several messages that this or that directory has been found.

This error is reproducible.

Only when you send a fax, these directories are created. If you create a fax server for receiving only, you have to create several directories manually.

Maybe something else is not created correctly in the current version, but I can't find it. The logfile is also not very informative.

Maybe someone has a tip for me.

Greetings
Dirk
 

diwou

New Member
Dec 1, 2021
7
0
1
56
Germany
I give it up. Doesn't seem like any of the specialists here want to help. I'm just glad I haven't signed up for one of those expensive memberships yet. :mad:
 
Feb 5, 2021
52
4
8
54
Hi DIrk, last thing you might want to check is the email settings, since this is the service that Fusion uses to send you the fax. So go inside Default Settings, section Email and make sure is configured, like this:

1638643584535.png
 

diwou

New Member
Dec 1, 2021
7
0
1
56
Germany
Hello Lorena,

As for the email settings, everything is correct and works. I also get emails when I send a fax. The test also works.

As I wrote above, I can see in the log file which command line is sent. It is just not executed.

If I manually execute this line in the Unix shell, the email is sent by FusionPBX.

Then I experimented a little bit today. When I run a LUA script via luarun from the FS_CLI it works as expected. Only when I execute a Shell Exec, it returns a +OK, but it is not really executed.

So, for example, if I simply execute a "touch test.txt" via a LUA script, this does not work via Freeswitch. It is confirmed with +OK, but not done. If I then try the script directly via LUA direct (Unix Shell), it works.

So there seems to be something wrong. And this with every installation that I have tried now. I also noticed that other scripts that execute the api:execute do not work correctly in the filesystem.

So this is not an eMail issue, but a shell exec issue. Maybe this doesn't work on a new installation and therefore doesn't affect older installations.

Greetings
Dirk
 

mcs3ss2

Active Member
Sep 8, 2020
247
26
28
AU
Please also try one of the old install. I am on 4.5.26 working Ok for me
There is a possibility the updated master branch might have something broken inside it.
 

Metcom

New Member
Apr 19, 2020
15
1
3
59
Hi Dirk
Having exactly the same problem on new installation(3rd try) 4.5.31 my backup install is working fine 4.5.23 so I assume there are problems
don't bother to report you won't here back unless you pay
 
  • Like
Reactions: diwou

diwou

New Member
Dec 1, 2021
7
0
1
56
Germany
Hello Metcom,

Thank you for your hint. This has now allowed me to determine approximately when the "error" must have been installed.

So I could also find the problem. So whoever writes the scripts here must really be a dilettante. This is a hopeless mess. There is screwed at a place, and forgotten to adapt this also in other scripts accordingly.

I have some scripts now times cleaned up the code and corrected some errors. Now at least the generation of the PDF with subsequent email works.

But I don't think it's worth to invest more time. I prefer to build my own GUI around Freeswitch.

Everybody who installs this crap from a certain point on (I could name it here now, but since nobody here does anything without money, I'll go along with it) will have the same error.

I'm out of here then too.

Greetings
Dirk
 

Metcom

New Member
Apr 19, 2020
15
1
3
59
Hi dirk
did you get it working? if so would you care to share my backup is about to die
Regards
Paul
 

philipp

New Member
Jan 25, 2022
1
0
1
43
Hi together!

I've had the same problem. It's because the lua script /usr/share/freeswitch/scripts/app/fax/resources/scripts/hangup_rx.lua doesn't successfully call the php script to send the email. The command result = api:execute("system", "/usr/bin/php"); always returns "INVALID COMMAND!". But, if you use os.execute(cmd); it works. Actually I didn't further test why api:execute doesn't work...

So in conclusion:

- Edit /usr/share/freeswitch/scripts/app/fax/resources/scripts/hangup_rx.lua
- Append
os.execute(cmd);
after the line
result = api:execute("system", "/usr/bin/php");

Best regars
Philipp
 

topogigio

Member
Jun 17, 2019
68
0
6
57
Hi,
I have the same problem with a a 5.0.1: incoming fax are received, but saved as TIF instead of PDF, and emails are not sent. Email service is ok (voicemails are delivered), it seems that the PBX is ignoring the received fax.
I tried to found the suggested line to fix, but it seems missing in my fusion..

any idea? :(
thanks
 

Nedo

Member
Jun 22, 2020
59
3
8
40
Hi,
I have the same problem with a a 5.0.1: incoming fax are received, but saved as TIF instead of PDF, and emails are not sent. Email service is ok (voicemails are delivered), it seems that the PBX is ignoring the received fax.
I tried to found the suggested line to fix, but it seems missing in my fusion..

any idea? :(
thanks

I have the same problem and also in mine the suggested fix line is missing
 

mcs3ss2

Active Member
Sep 8, 2020
247
26
28
AU
fusionpbx 4.5.26

Code:
--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");
    result = api:execute("system", cmd);

fusionpbx 5.0.1

Code:
--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");
    result = api:executeString(cmd);
 
Status
Not open for further replies.