Ticket #2359 (closed Bugs: fixed)

Opened 4 years ago

Last modified 4 years ago

additional corrections for the %2x codes in e-mailed faxes

Reported by: fskrotzki Assigned to: p_lindheimer
Priority: minor Milestone: 2.4
Component: Core Version: 2.3.0
Keywords: fax subject line conversion corrections Cc:
Confirmation: Unreviewed SVN Revision (if applicable):
Backend Engine: Asterisk <1.2 Backend Engine Version: 1.2.22

Description

It has a correction that I first posted on the trixbox site many months ago but it never caught up to the final set of corrections. So I thought I'd also post them here.

Sorry I'm not sure of the proper format so. I'll try and make this simple...

Edit the fax-process.pl script.

Search for the line: "# Convert %20 to spaces, leave anythign else alone." remove that line and the following one (should be line 54 and 55).

Replace with the following lines: # Convert %2x to proper characters, leave anything else alone. $subject =~ s/\%20/ /g; $subject =~ s/\%21/\!/g; $subject =~ s/\%22/\"/g; $subject =~ s/\%23/\#/g; $subject =~ s/\%24/\$/g; $subject =~ s/\%25/\%/g; $subject =~ s/\%26/\&/g; $subject =~ s/\%27/\'/g; $subject =~ s/\%28/\(/g; $subject =~ s/\%29/\)/g; $subject =~ s/\%2a/\*/g; $subject =~ s/\%2A/\*/g; $subject =~ s/\%2b/\+/g; $subject =~ s/\%2B/\+/g; $subject =~ s/\%2c/\,/g; $subject =~ s/\%2C/\,/g; $subject =~ s/\%2d/\-/g; $subject =~ s/\%2D/\-/g; $subject =~ s/\%2e/\./g; $subject =~ s/\%2E/\./g; $subject =~ s/\%2f/\//g; $subject =~ s/\%2F/\//g;

This will translate any of the special characters that I've seen to date in any fax DID line back to the proper ASCII characters. Yes I'm also sure there is a better and more efficient way to do it in a loop with a string array (or convert the hex to it's number, then convert that to a character, but I don't do Perl, so I hacked it this way to work.

Enjoy.

Thanks to Rob Thomas for all his great work on the original script.

Attachments

fax-process.patch (1.0 kB) - added by fskrotzki on 10/23/07 14:13:30.

Change History

10/04/07 10:05:01 changed by fskrotzki

 ok a proper diff
55,56c55,77
<   # Convert %20 to spaces, leave anythign else alone.
<   $subject =~ s/\%20/ /g;
---
>   # Convert %2x to proper characters, leave anything else alone.
>     $subject =~ s/\%20/ /g;
>     $subject =~ s/\%21/\!/g;
>     $subject =~ s/\%22/\"/g;
>     $subject =~ s/\%23/\#/g;
>     $subject =~ s/\%24/\$/g;
>     $subject =~ s/\%25/\%/g;
>     $subject =~ s/\%26/\&/g;
>     $subject =~ s/\%27/\'/g;
>     $subject =~ s/\%28/\(/g;
>     $subject =~ s/\%29/\)/g;
>     $subject =~ s/\%2a/\*/g;
>     $subject =~ s/\%2A/\*/g;
>     $subject =~ s/\%2b/\+/g;
>     $subject =~ s/\%2B/\+/g;
>     $subject =~ s/\%2c/\,/g;
>     $subject =~ s/\%2C/\,/g;
>     $subject =~ s/\%2d/\-/g;
>     $subject =~ s/\%2D/\-/g;
>     $subject =~ s/\%2e/\./g;
>     $subject =~ s/\%2E/\./g;
>     $subject =~ s/\%2f/\//g;
>     $subject =~ s/\%2F/\//g;

10/23/07 14:13:30 changed by fskrotzki

  • attachment fax-process.patch added.

11/02/07 17:47:30 changed by p_lindheimer

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