Open Source Training Seminar FreePBX Paid Support

Ticket #2413 (closed Feature Requests: fixed)

Opened 1 year ago

Last modified 1 month ago

Fax email should include lower-res image

Reported by: splante Assigned to: p_lindheimer
Priority: minor Milestone: 2.5
Component: Core Version: 2.4-branch
Keywords: fax Cc:
Confirmation: Need testing SVN Revision (if applicable):
Backend Engine: All Backend Engine Version:

Description

When using the incoming fax-to-email feature of FreePBX, it is useful to have the email include a reduced resolution gif (or jpeg) image so you can quickly identify fax-spam from legitimate faxes. Most email clients will display an attached image inline without having to explicitly open it. I find that opening a PDF attachment takes several seconds which gets very annoying if many junk faxes come in.

This patch requires the "convert" command from the ImageMagick package, so this command needs to be run.

yum install ImageMagick

This is the diff to /var/lib/asterisk/bin/fax-process.pl

< my $enc_gif="";
98,104d96
<
<       open GIF, "convert -resize '50%' -monochrome -delay 300 ${file}[0,1] gif:- |";
<       $buf = "";
<       while (read(GIF, $buf, 60*57))  {
<               $enc_gif .= encode_base64($buf);
<       }
<       close GIF;
128d119
< my $len_gif = length $enc_gif;
147c138
< A Fax has been received by the fax gateway, and is attached to this message.
---
> A Fax has been recieved by the fax gateway, and is attached to this message.
151,155d141
< Content-Type: image/gif; name=\"thumb.gif\"
< Content-Transfer-Encoding: base64
<
< $enc_gif
< --$boundary

I suppose this patch could have been done by creating a new command line option for fax-process.pl, but then the extensions.conf would have to be changed as well. I will attach my modified version including the above changes.

The default ImageMagick? behavior is to create an animated gif of all the pages with no delay between frames, so the pages fly by so fast you can't read them. The parameter "-delay 300" makes each page display for 3 seconds in the animated gif.

Considering the purpose of the gif is to give the recipient an idea of what the fax is before opening the pdf, it would be useful to only include the first page or two. You can use square-bracket syntax to specify a page range, and it seems to be forgiving if not all the pages are there. I changed the "$file" to "${file}[0,1]" in the command line so only the first two pages appear in the gif.

I also corrected the spelling of "received".

This is a complete and working patch. Work remains to commit this to trunk and to include ImageMagick? in the base install if this patch is accepted.

Attachments

fax-process.pl (4.3 kB) - added by splante on 10/04/07 07:08:38.
Modified version of fax-process.pl with patch included
fax-process.2.pl (4.9 kB) - added by splante on 03/22/08 16:17:42.
Updated fax-process.pl for Core 2.4.0.1
fax-process.pl.patch (1.4 kB) - added by splante on 03/24/08 07:29:43.
Patch file for fax-process.pl (Against Core 2.4.0.1)

Change History

10/04/07 07:08:38 changed by splante

  • attachment fax-process.pl added.

Modified version of fax-process.pl with patch included

11/27/07 23:56:33 changed by p_lindheimer

  • confirmation changed from Unreviewed to Confirmed.
  • version deleted.
  • milestone deleted.

03/22/08 16:17:42 changed by splante

  • attachment fax-process.2.pl added.

Updated fax-process.pl for Core 2.4.0.1

03/23/08 12:25:36 changed by p_lindheimer

  • version set to 2.4-branch.
  • milestone set to 3.0.

please just put patch files, not the entire script. If you updated your patch, please regenerate it as follows:

diff -ubB fax-process.pl fax-process-modified.pl > fax-process.pl.patch

then attach that modified patch file, thanks much and for the fixes, we'll take a look at it all.

03/24/08 07:29:43 changed by splante

  • attachment fax-process.pl.patch added.

Patch file for fax-process.pl (Against Core 2.4.0.1)

07/06/08 13:24:42 changed by lazytt

devs: ping.

07/06/08 14:43:08 changed by p_lindheimer

  • confirmation changed from Confirmed to Need testing.

I'll be happy to include this if the following is done:

  • Someone modify it so that it 'fails gracefully' if the convert command is not present.
  • Someone wants to test it (with the above done) and confirm that it is working.

07/15/08 17:29:29 changed by p_lindheimer

  • type changed from Patches to Feature Requests.

if there's no feedback, will bump to consider in a future release.

07/18/08 23:58:35 changed by p_lindheimer

  • milestone changed from 2.5 to 3.0.

bumping due to lack of response

07/31/08 12:31:06 changed by p_lindheimer

  • milestone changed from 3.0 to 2.5.

07/31/08 12:39:27 changed by p_lindheimer

  • status changed from new to closed.
  • resolution set to fixed.

(In [6236]) closes #2413 and closes #2974 adding an optional low-res image and DID information

Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads