Ticket #2974: fax-process.pl.diff

File fax-process.pl.diff, 2.0 kB (added by ip-rob, 4 months ago)
  • fax-process.pl.old

    old new  
    1111# Default paramaters 
    1212my $to = "xrobau\@gmail.com"; 
    1313my $from = "fax\@"; 
     14my $dest = undef; 
    1415my $subject = "Fax received"; 
    1516my $ct = "application/x-pdf"; 
    1617my $file = undef; 
     
    2526$from .= $hostname; 
    2627 
    2728# Usage: 
    28 my $usage="Usage: --file filename [--attachment filename] [--to email_address] [--from email_address] [--type content/type] [--subject \"Subject Of Email\"]"; 
     29my $usage="Usage: --file filename [--attachment filename] [--to email_address] [--from email_address] [--type content/type] [--subject \"Subject Of Email\"] [--dest DID]"; 
    2930 
    3031# Parse command line.. 
    3132while (my $cmd = shift @ARGV) { 
     
    8788  } elsif ($cmd eq "--attachment") { 
    8889       my $tmp = shift @ARGV; 
    8990       $attachment = $tmp if (defined $tmp); 
     91  } elsif ($cmd eq "--dest") { 
     92       my $tmp = shift @ARGV; 
     93       if ($tmp =~ /\^(\")|^(\')/) { 
     94               # It's a quoted string 
     95               my $delim = $+;   # $+ is 'last match', which is ' or " 
     96               $tmp =~ s/\Q$delim\E//; # Strip out ' or " 
     97               $dest = $tmp; 
     98               while ($tmp = shift @ARGV) { 
     99                       if ($tmp =~ /\Q$delim\E/) { 
     100                               $tmp =~ s/\Q$delim\E//; 
     101                               last; 
     102                       } 
     103               $dest .= $tmp; 
     104               } 
     105       } else { 
     106               # It's a single word 
     107               $dest = $tmp; 
     108       } 
    90109  } else { 
    91110       die "$cmd not understood\n$usage\n"; 
    92111  } 
     
    156175Content-Type: text/plain; charset=\"us-ascii\" 
    157176Content-Transfer-Encoding: quoted-printable 
    158177 
    159 A Fax has been recieved by the fax gateway, and is attached to this message. 
     178A Fax has been recieved by the fax gateway and is attached to this message. 
     179 
     180The destination number for this fax is ".$dest." 
    160181 
    161182 
    162183--$boundary 
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads