Trixbox 2.0 Faxempfang

moin

mhm, hab ich alles gemacht und jetzt geht es auch mehr oder weniger. komisch ist nur, dass die faxe meist zerstückelt werden, bzw. nicht richtig dargestellt.
ich schick mir jetzt nochma einen, und hänge diesen da ins forum rein.

meine einstellungen bei der entsprechenden inbound route:

FaxNebenstelle: System
FaxEmail: meine Email
Fax Detection Type: Zaptel
Pause nach Antwort: 5

Ich empfange die Faxe via ISDN, nicht via VOIP. deshalb auch Zaptel.
 
ok. hier ma 3 verschiedene fax, welche eingegangen sind. irgendwie werden die nach dem zufallsprinzip abgeklemmt :mad:
 

Anhänge

  • Fax from 0413612118.zip
    1.8 KB · Aufrufe: 12
  • Fax from 0413612119.zip
    1.4 KB · Aufrufe: 5
  • Fax from CID_20withheld.zip
    1.6 KB · Aufrufe: 5
Zuletzt bearbeitet:
zapata.conf :

PHP:
;
; Zapata telephony interface
;
; Configuration file

[trunkgroups]

[channels]

language=de
context=from-zaptel
signalling=fxs_ks
rxwink=300		; Atlas seems to use long (250ms) winks
;
; Whether or not to do distinctive ring detection on FXO lines
;
;usedistinctiveringdetection=yes

usecallerid=yes
hidecallerid=no
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
cancallforward=yes
callreturn=yes
echocancel=yes
echocancelwhenbridged=no
echotraining=800
rxgain=0.0
txgain=0.0
group=0
callgroup=1
pickupgroup=1
immediate=no

;faxdetect=both
faxdetect=incoming
;faxdetect=outgoing
faxdetect=yes

;Include genzaptelconf configs
#include zapata-auto.conf

group=1

;Include AMP configs
#include zapata_additional.conf



;Include BRI-HFC configs
#include zapata-BRI-HFC.conf

und hier noch die fax-process.pl :

PHP:
#!/usr/bin/perl -w

# Small program to process a tiff file into a PDF and email it.
#
# Distributed under the terms of the GNU General Public License (GPL) Version 2
# Copyright 2005 by Rob Thomas ([email protected])

use MIME::Base64;
use Net::SMTP;

# Default paramaters
my $to = "xrobau\@gmail.com";
my $from = "fax\@";
my $subject = "Fax received";
my $ct = "application/x-pdf";
my $file = undef;
my $attachment = undef;

# Care about the hostname.
my $hostname = `/bin/hostname`;
chomp ($hostname);
if ($hostname =~ /localhost/) {
        $hostname = "set.your.hostname.com";
}
$from .= $hostname;

# Usage:
my $usage="Usage: --file filename [--attachment filename] [--to email_address] [--from email_address] [--type content/type] [--subject \"Subject Of Email\"]";

# Parse command line..
while (my $cmd = shift @ARGV) {
  chomp $cmd;
  # My kingdom for a 'switch'
  if ($cmd eq "--to") {
        my $tmp = shift @ARGV;
        $to = $tmp if (defined $tmp);
  } elsif ($cmd eq "--subject") {
        my $tmp = shift @ARGV;
        if ($tmp =~ /\^(\")|^(\')/) {
                # It's a quoted string
                my $delim = $+;   # $+ is 'last match', which is ' or "
                $tmp =~ s/\Q$delim\E//; # Strip out ' or "
                $subject = $tmp;
                while ($tmp = shift @ARGV) {
                        if ($tmp =~ /\Q$delim\E/) {
                                $tmp =~ s/\Q$delim\E//;
                                last;
                        }
                $subject .= $tmp;
                }
        } else {
                # It's a single word
                $subject = $tmp;
        }
  } elsif ($cmd eq "--type") {
        my $tmp = shift @ARGV;
        $ct = $tmp if (defined $tmp);
  } elsif ($cmd eq "--from") {
        my $tmp = shift @ARGV;
        $from = $tmp if (defined $tmp);
  } elsif ($cmd eq "--file") {
        my $tmp = shift @ARGV;
        $file = $tmp if (defined $tmp);
  } elsif ($cmd eq "--attachment") {
        my $tmp = shift @ARGV;
        $attachment = $tmp if (defined $tmp);
  } else {
        die "$cmd not understood\n$usage\n";
  }

}

# OK. All our variables are set up.
# Lets make sure that we know about a file...
die $usage unless $file;
# and that the file exists...
open( FILE, $file ) or die "Error opening $file: $!";
# Oh, did we possibly not specify an attachment name?
$attachment = $file unless ($attachment);

my $encoded="";
my $buf="";
# First, lets find out if it's a TIFF file
read(FILE, $buf, 4);
if ($buf eq "MM\x00\x2a" || $buf eq "II\x2a\x00") {
        # Tiff magic - We need to convert it to pdf first
        # Need to do some error testing here - what happens if tiff2pdf
        # doesn't exist?
        open PDF, "tiff2pdf $file|";
        $buf = "";
        while (read(PDF, $buf, 60*57))  {
                $encoded .= encode_base64($buf);
        }
        close PDF;
} else {
        # It's a PDF already
        # Go back to the start of the file, and start again
        seek(FILE, 0, 0);
        while (read(FILE, $buf, 60*57)) {
                $encoded .= encode_base64($buf);
        }
}
close FILE;

# Now we have the file, we should ensure that there's no paths on the
# filename..
$attachment =~ s/^.+\///;

# And that's pretty much all the hard work done. Now we just create the
# headers for the MIME encapsulation:
my $boundary = '------FREEPBX_FAX_MAIL:';
my $dtime = `date`;
chomp $dtime;
my @chrs = ('0' .. '9', 'A' .. 'Z', 'a' .. 'z');
foreach (0..16) { $boundary .= $chrs[rand (scalar @chrs)]; }

my $len = length $encoded;
# message body..
my $msg ="Content-Class: urn:content-classes:message
Content-Transfer-Encoding: 7bit
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=\"$boundary\"
From: $from
Date: $dtime
Reply-To: $from
X-Mailer: dofaxmail.pl
To: $to
Subject: $subject

This is a multi-part message in MIME format.

--$boundary
Content-Type: text/plain; charset=\"us-ascii\"
Content-Transfer-Encoding: quoted-printable

A Fax has been recieved by the fax gateway, and is attached to this message.


--$boundary
Content-Type: $ct; name=\"$attachment\"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=\"$attachment\"

$encoded
--$boundary--
";

#print "$msg";
# Now we just send it.
my $smtp = Net::SMTP-> new("127.0.0.1", Debug => 0) or
  die "Net::SMTP::new: $!";
$smtp-> mail($from);
$smtp-> recipient($to);
$smtp-> data();
$smtp-> datasend($msg);
$smtp-> dataend();
 
ändere mal den rxgain Wert in der zapata.conf auf 7.0
 
hmmm. hab das ma geändert. anbei der fax welcher angekommen ist. da fehlen aber noch 4 smilys... :(
 

Anhänge

  • Fax2 from 0413612117.zip
    2.2 KB · Aufrufe: 6
hmmm... komisch, bei mir ist alles so eingestellt wie bei dir..
bis auf den Eintrag
Code:
faxdetect=yes
in der zapata.conf.
der steht bei mir auf
Code:
faxdetect=no
??????
der rest ist alles gleich, auch
Code:
rxgain=0.0
:noidea:
 
hab das testweise mal probiert, mir dem faxdetect=no. aber dann geht gar nix mehr.
 
:D langsam wirds verwirrend.....
aber weitere ideen hab ich jetzt leider auch nicht mehr
 
Hatte das Problem auch, habe jetzt auch RXgain auf 7.0 gestellt. Die letzten fax kamen jetzt gut an. Werde das mal beobachten.
Das Problem kann natürlich auch am Sende-Programm oder -fax liegen.
 
Hi,

ich habe:
Trixbox 2.0
die app_rxfax.so ins Verzeichnis kopiert und die Rechte vergeben
Inbound Channel Fax Extension: freePBX default
Inbound Channel Fax Detection Type: zaptel
General Settings Extension of fax machine: System

Sende ich das Testfax (666) erhalte ich diese Consolenausgabe:
== Spawn extension (ext-fax, h, 2) exited non-zero on 'SIP/200-e8d2'
-- Executing Goto("SIP/200-793a", "ext-fax|in_fax|1") in new stack
-- Goto (ext-fax,in_fax,1)
-- Executing StopPlayTones("SIP/200-793a", "") in new stack
-- Executing GotoIf("SIP/200-793a", "1?3:analog_fax|1") in new stack
-- Goto (ext-fax,in_fax,3)
-- Executing Macro("SIP/200-793a", "faxreceive") in new stack
-- Executing Set("SIP/200-793a", "FAXFILE=/var/spool/asterisk/fax/asterisk-3855-1175323226.58.tif") in new stack
-- Executing Set("SIP/200-793a", "[email protected]") in new stack
-- Executing RxFAX("SIP/200-793a", "/var/spool/asterisk/fax/asterisk-3855-1175323226.58.tif") in new stack
-- Executing Hangup("SIP/200-793a", "") in new stack
== Spawn extension (ext-fax, in_fax, 4) exited non-zero on 'SIP/200-793a'
-- Executing System("SIP/200-793a", "/var/lib/asterisk/bin/fax-process.pl --to [email protected] --from [email protected] --subj
ect "Fax from 200 device" --attachment fax_200.pdf --type application/pdf --file /var/spool/asterisk/fax/asterisk-3855-1175323226.58.tif") in new stac
k
-- Executing Hangup("SIP/200-793a", "") in new stack
== Spawn extension (ext-fax, h, 2) exited non-zero on 'SIP/200-793a'

Leider befindet sich zu keinem Zeitpunkt irgendetwas in /var/spool/asterisk/fax/ und kann somit auch nicht versendet werden.

Was mache ich falsch?

Danke

Roland
 
Ich habe die 666 so verstanden, dass zwar ein Fax-Signal gesendet wird, aber nicht wirklich ein fax erstellt wird.

Wie sehen das die anderen?
 
sehe das auch so....
weder die -tif unter /var/spool/asterisk/fax noch sonst irgendwas wird erstellt.
tippe von daher auch auf ein reines "testprogramm"
hast du kein normales fax irgendwo rumstehen mit dem du das mal testen kannst?
 

Zurzeit aktive Besucher

Statistik des Forums

Themen
245,830
Beiträge
2,240,788
Mitglieder
373,105
Neuestes Mitglied
maame
Holen Sie sich 3CX - völlig kostenlos!
Verbinden Sie Ihr Team und Ihre Kunden Telefonie Livechat Videokonferenzen

Gehostet oder selbst-verwaltet. Für bis zu 10 Nutzer dauerhaft kostenlos. Keine Kreditkartendetails erforderlich. Ohne Risiko testen.

3CX
Für diese E-Mail-Adresse besteht bereits ein 3CX-Konto. Sie werden zum Kundenportal weitergeleitet, wo Sie sich anmelden oder Ihr Passwort zurücksetzen können, falls Sie dieses vergessen haben.