Es gibt eine Reihe von Ansätzen und Projekten, mit Asterisk einen Faxserver zu implementieren. Lange Zeit war app_rxfax von http://www.soft-switch.org/ die von vielen angepriesene Lösung. Allerdings gilt diese Variante als fehleranfällig. Faxe werden regelmäßig unvollständig übertragen.
Deshalb beschreiben wir hier das Projekt IAXmodem (siehe http://iaxmodem.sourceforge.net/). Das IAXmodem ist ein virtuelles Modem, das von einer beliebigen Faxsoftware angesteuert werden kann. Für die Faxserversoftware nehmen wir das populäre Hylafax.
IAXmodem ist eine Software, die ein Modem simuliert, und dieses Asterisk mit dem IAX2-Protokoll zur Verfügung stellt. Alle Schritte in diesem Kapitel werden als User root ausgeführt.
Um IAXmodem installieren zu können, benötigen wir noch einige Debian-Packete, die mit apt-get -y install g++ libtiff-tools libtiff4 libtiff4-dev installiert werden.
debian:~# apt-get -y install g++ libtiff-tools libtiff4 libtiff4-dev Paketlisten werden gelesen... Fertig Abhängigkeitsbaum wird aufgebaut... Fertig Die folgenden zusätzlichen Pakete werden installiert: g++ libjpeg62 libjpeg62-dev libtiffxx0 zlib1g-dev [...] Richte zlib1g-dev ein (1.2.2-4.sarge.2) ... Richte libtiff4-dev ein (3.7.2-7) ... debian:~#
Die Sourcen zu IAXmodem können auf der Webseite http://iaxmodem.sourceforge.net
heruntergeladen werden (in diesem Beispiel ist es die Version 0.1.16).
Nach dem Download muss der TarBall mit tar -xzf
iaxmodem-0.1.16.tar.gz enpackt werden. Das Kompilieren geschieht
danach mit den Befehlen ./configure und
make. Das dabei entstehende Binary iaxmodem kopieren
wir zum Schluss mit cp iaxmodem /usr/bin nach
/usr/bin.
debian:~# tar xfz iaxmodem-0.1.16.tar.gz debian:~# cd iaxmodem-0.1.16 debian:~# ./configure debian:~# make debian:~# cp iaxmodem /usr/bin
Jetzt kommen wir zur Konfiguration des Modems. IAXmodem sucht seine
Konfiguration im Verzeichnis /etc/iaxmodem
. Dieses
müssen wir jetzt anlegen und in ihm eine Datei erzeugen, in der die
Konfiguration steht. In dieser Datei müssen folgende Parameter angegeben
werden:
device
- Das ist das Device, das im
/dev
Verzeichnis angelegt wird. Über dieses Device kann später Hylafax auf das Modem zugreifen. Der Name des Devices ist frei wählbar, wir halten uns aber an die allgemeinen Konventionen und nennen es äquivalent zum Device für die serielle Schnittstelle ttyIAX0. owner
- Das ist der Eigentümer des Devices in der Form
. Es sollte derselbe User und dieselbe Gruppe sein, unter der Hylafax laufen soll.user
:group
port
- Der Port, auf dem das IAXmodem lauscht. Da Asterisk auf Port 4569 auf IAX2-Verbindungen hört, sollte man hier einen anderen Port verwenden, z.B. 4570.
refresh
- Das Intervall, nach dem sich das Modem erneut bei Asterisk registriert. Wenn dieses auf 0 steht, registriert sich das Modem nicht bei Asterisk.
server
- Der Server, auf dem der Asterisk läuft. Wenn der Server derselbe ist, auf dem auch das IAXmodem läuft, steht hier die lokale Adresse 127.0.0.1.
peername
- Der Name, unter dem sich das IAXmodem bei Asterisk registriert.
secret
- Das Passwort zur Registrierung am Asterisk
codec
- Der Codec, der vom IAXmodem verwendet wird. Erlaubt sind
hier
alaw
,ulaw
undslinear
. Andere machen hier auch wenig Sinn, da diese komprimieren und die Übertragung dadurch nicht verlustfrei ist. Bei reiner Sprachübertragung wirkt sich das für einen Menschen nicht negativ aus, bei Faxübertragungen aber hätte es störende Fehler zur Folge.
Die Konfigurationsdatei für ttyIAX0 heißt
/etc/iaxmodem/ttyIAX0
und hat folgenden
Inhalt:
device /dev/ttyIAX0 owner uucp:uucp mode 660 port 4570 refresh 50 server 127.0.0.1 peername iaxmodem secret password codec alaw
Nachdem das IAXmodem nun fertig konfiguriert ist, muss es gestartet
werden. Der Start geschieht am besten über den init-Prozess. Also fügen
wir folgenden Eintrag der Datei /etc/inittab
hinzu:
IA00:23:respawn:/usr/bin/iaxmodem ttyIAX0
Wobei ttyIAX0
der Name der
Konfigurationsdatei unter /etc/iaxmodem
ist. Mit dem
Kommando init q aktivieren wir das neue Device.
Bevor die Faxserversoftware gebaut werden kann, müssen mit apt-get -y install libtiff-tools libtiff4 libtiff4-dev gs noch ein paar Debian-Pakete installiert werden:
debian:~# apt-get -y install libtiff-tools libtiff4 libtiff4-dev gs Paketlisten werden gelesen... Fertig Abhängigkeitsbaum wird aufgebaut... Fertig [...] Updating category gsfontderivative.. Updating category truetype.. Updating category cid.. Updating category cmap.. Updating category psprint.. debian:~#
Jetzt müssen Sie über den auf der Hylafax-Homepage http://www.hylafax.org vorhandenen Download-Link die aktuellen Sourcen herunterladen. Natürlich geht dies auch mit dem Command-Line-Befehl wget ftp://ftp.hylafax.org/source/hylafax-4.3.1.tar.gz.
debian:~# cd /usr/src/ debian:/usr/src# wget ftp://ftp.hylafax.org/source/hylafax-4.3.1.tar.gz --12:35:25-- ftp://ftp.hylafax.org/source/hylafax-4.3.1.tar.gz => `hylafax-4.3.1.tar.gz' Auflösen des Hostnamen »ftp.hylafax.org«.... 66.179.245.142 Verbindungsaufbau zu ftp.hylafax.org[66.179.245.142]:21... verbunden. Anmelden als anonymous ... Angemeldet! ==> SYST ... fertig. ==> PWD ... fertig. ==> TYPE I ... fertig. ==> CWD /source ... fertig. ==> PASV ... fertig. ==> RETR hylafax-4.3.1.tar.gz ... fertig. Länge: 1,498,444 (unmaßgeblich) 100%[====================================>] 1,498,444 229.94K/s ETA 00:00 12:35:33 (217.14 KB/s) - »hylafax-4.3.1.tar.gz« gespeichert [1498444] debian:/usr/src#
Danach mit tar -xzf hylafax-4.3.1.tar.gz entpacken und ./configure aufrufen.
debian:/usr/src# tar xfz hylafax-4.3.1.tar.gz debian:/usr/src# cd hylafax-4.3.1 debian:/usr/src/hylafax-4.3.1# ./configure Configuring HylaFAX (tm) (aka FlexFAX) 4.3.1. If configure does the wrong thing, check the file config.log for information that may help you understand what went wrong. Reading site-wide parameters from ./config.site. Gosh, aren't you lucky to have a i686-pc-linux-gnu system! Using /usr/bin/gcc for a C compiler (set CC to override). Looks like /usr/bin/gcc supports the -g option. Using " -g" for C compiler options. [...]
Mit ./configure werden die Sourcen für das Übersetzen vorbereitet, das heißt, es wird überprüft, ob alle Voraussetzungen erfüllt sind. Wenn dies der Fall ist, fragt das Programm diverse Parameter ab.
HylaFAX configuration parameters (part 1 of 2) are: [ 1] Directory for applications: /usr/local/bin [ 2] Directory for lib data files: /usr/local/lib/fax [ 3] Directory for lib executables: /usr/local/sbin [ 4] Directory for system apps: /usr/local/sbin [ 5] Directory for manual pages: /usr/local/man [ 6] Directory for HTML documentation: /var/httpd/htdocs/hylafax [ 7] Directory for spooling: /var/spool/hylafax [ 8] Directory for uucp lock files: /var/lock [ 9] Uucp lock file scheme: ascii [10] PostScript imager package: gs [11] PostScript imager program: /usr/bin/gs [12] Manual page installation scheme: bsd-source-cat [13] Default page size: North American Letter [14] Default vertical res (lpi): 98 Are these ok [yes]?
Hier müssen für den Betrieb in Deutschland die Werte für das
Papierformat auf A4
gesetzt werden:
Are these ok [yes]?13 Default page size [North American Letter]? A4 HylaFAX configuration parameters (part 1 of 2) are: [ 1] Directory for applications: /usr/local/bin [ 2] Directory for lib data files: /usr/local/lib/fax [ 3] Directory for lib executables: /usr/local/sbin [ 4] Directory for system apps: /usr/local/sbin [ 5] Directory for manual pages: /usr/local/man [ 6] Directory for HTML documentation: /var/httpd/htdocs/hylafax [ 7] Directory for spooling: /var/spool/hylafax [ 8] Directory for uucp lock files: /var/lock [ 9] Uucp lock file scheme: ascii [10] PostScript imager package: gs [11] PostScript imager program: /usr/bin/gs [12] Manual page installation scheme: bsd-source-cat [13] Default page size: ISO A4 [14] Default vertical res (lpi): 98 Are these ok [yes]?
Tipp | |
---|---|
Wer will, kann hier auch die Auflösung ändern. Da im Geschäftsumfeld über einen solchen Faxserver wahrscheinlich auch Briefe und Verträge verschickt werden, können Sie die Auflösung bei entsprechendem Bedarf auf 196 lpi einstellen (feine Auflösung).[125] Are these ok [yes]? 14 Default vertical res (lpi) [98]? 196 HylaFAX configuration parameters (part 1 of 2) are: [ 1] Directory for applications: /usr/local/bin [ 2] Directory for lib data files: /usr/local/lib/fax [ 3] Directory for lib executables: /usr/local/sbin [ 4] Directory for system apps: /usr/local/sbin [ 5] Directory for manual pages: /usr/local/man [ 6] Directory for HTML documentation: /var/httpd/htdocs/hylafax [ 7] Directory for spooling: /var/spool/hylafax [ 8] Directory for uucp lock files: /var/lock [ 9] Uucp lock file scheme: ascii [10] PostScript imager package: gs [11] PostScript imager program: /usr/bin/gs [12] Manual page installation scheme: bsd-source-cat [13] Default page size: ISO A4 [14] Default vertical res (lpi): 196 Are these ok [yes]? |
Alle anderen Werte auf dieser Seite können so bleiben, wir
bestätigen also mit yes
.
Are these ok [yes]? yes HylaFAX configuration parameters (part 2 of 2) are: [15] Location of getty program: /sbin/agetty [16] Location of voice getty program: /bin/vgetty [17] Location of sendmail program: /usr/sbin/sendmail [18] Location of TIFF tools: /usr/bin [19] Location of SysV init scripts: /etc/init.d [20] Location of SysV start scripts: ../rc2.d ../rc3.d ../rc4.d ../rc5.d [21] Location of SysV stop scripts: ../rc0.d ../rc1.d ../rc6.d [22] Name of SysV start script: S97hylafax [23] Name of SysV stop script: K05hylafax [24] Init script starts faxq: yes [25] Init script starts hfaxd yes [26] Start old protocol: no [27] Start paging protocol: no Are these ok [yes]?
Auch hier muss nichts verändern werden (also einfach mit
yes
übernehmen). Danach werden automatisch alle zum
Kompilieren benötigten Makefiles angelegt. Das Kompilieren starten wir mit
make und danach können wir mit einem make
install die Software installieren.
debian:/usr/src/hylafax-4.3.1# make make[1]: Entering directory `/usr/src/hylafax-4.3.1' = regex make[2]: Entering directory `/usr/src/hylafax-4.3.1/regex' make[3]: Entering directory `/usr/src/hylafax-4.3.1/regex' make[4]: Entering directory `/usr/src/hylafax-4.3.1/regex' /bin/bash ../port/mkdepend -e 's@ /usr/include/@ /@' -c /usr/bin/gcc -D__ANSI_CPP__ -I. -I.. -I.././regex -I.././regex -I.././util -I/usr/local/include -g -fpic -O -c -M -i Makedepend regexec.c regcomp.c regfree.c regerror.c make[4]: Leaving directory `/usr/src/hylafax-4.3.1/regex' [...] for i in README depend make.links preremove proto.local ; do \ [ -f $i ] || cp .././pkg/$i . ; \ done make[2]: Leaving directory `/usr/src/hylafax-4.3.1/pkg' make[1]: Leaving directory `/usr/src/hylafax-4.3.1' debian:/usr/src/hylafax-4.3.1# make install [...] if test -d /etc/config; then \ /bin/bash ../port/install.sh -idb hylafax.sw.server -F /etc/config -m 644 -src config.fax -O fax; \ fi make[1]: Leaving directory `/usr/src/hylafax-4.3.1/etc' debian:/usr/src/hylafax-4.3.1#
Der nächste Schritt ist das Setup des Faxservers. Hierzu rufen wir das Programm faxsetup auf:
debian:/usr/src/hylafax-4.3.1# faxsetup [...] There does not appear to be an entry for the FaxMaster either in the YP/NIS database or in the /etc/aliases file. The FaxMaster is the primary point of contact for HylaFAX problems. The HylaFAX client-server protocol server identifies this alias as the place to register complaints and HylaFAX directs automatic mail messages to this user when problems are identified on a server machine or when the routine server maintainence scripts are run (e.g. faxcron). Should an entry be added for the FaxMaster to /etc/aliases [yes]?
Bei den folgenden 2-3 Fragen einfach immer Enter drücken.
HylaFAX configuration parameters are: [1] Init script starts faxq: yes [2] Init script starts hfaxd yes [3] Start old protocol: no [4] Start paging protocol: no Are these ok [yes]?
Bei den folgenden Einstellungen müssen Sie die für Ihre Installation geeigneten Werte eingeben:
No scheduler config file exists, creating one from scratch. Country code [1]? 49 Area code []? 69 Long distance dialing prefix [1]? 0 International dialing prefix [011]? 00 Dial string rules file (relative to /var/spool/hylafax) ["etc/dialrules"]? Tracing during normal server operation [1]? Default tracing during send and receive sessions [0xffffffff]? Continuation cover page (relative to /var/spool/hylafax) []? Timeout when converting PostScript documents (secs) [180]? Maximum number of concurrent jobs to a destination [1]? Define a group of modems []? Time of day restrictions for outbound jobs ["Any"]? Pathname of destination controls file (relative to /var/spool/hylafax) []? Timeout before purging a stale UUCP lock file (secs) [30]? Max number of pages to permit in an outbound job [0xffffffff]? Syslog facility name for ServerTracing messages [daemon]? The non-default scheduler parameters are: CountryCode: 49 AreaCode: 69 LongDistancePrefix: 0 InternationalPrefix: 00 Are these ok [yes]?
Dabei sind an sich nur die ersten vier Fragen wichtig. Die erste
betrifft die Landesvorwahl als zweistellige Zahl, für Deutschland also die
49
. Dann folgt die Ortsnetznummer ohne führende Null, in
diesem Beispiel die 69
für Frankfurt am Main. Dann eine Null
für Ferngespräche und zwei Nullen für internationale Gespräche. Am Schluss
mit yes
bestätigen.
Restarting HylaFAX server processes. Should I restart the HylaFAX server processes [yes]? /etc/init.d/hylafax start HylaFAX: faxq hfaxd (without old protocol & without SNPP support). You do not appear to have any modems configured for use. Modems are configured for use with HylaFAX with the faxaddmodem(8C) command. Do you want to run faxaddmodem to configure a modem [yes]?
Jetzt bestätigen wir den Restart des Serverprozesses mit
yes
und werden gefragt, ob wir ein Modem
installieren wollen. Da unser IAXmodem bereits eingerichtet ist, können
wir hier direkt weitermachen und bestätigen wieder mit
yes
.
Serial port that modem is connected to []? ttyIAX0 Ok, time to setup a configuration file for the modem. The manual page config(5F) may be useful during this process. Also be aware that at any time you can safely interrupt this procedure. Reading scheduler config file /var/spool/hylafax/etc/config. No existing configuration, let's do this from scratch. Country code [1]? 49 Area code [415]? 69 Phone number of fax modem [+1.999.555.1212]? +49 69 12345678 Local identification string (for TSI/CIG) ["NothingSetup"]? Apfelmus GmbH Long distance dialing prefix [1]? 0 International dialing prefix [011]? 00 Dial string rules file (relative to /var/spool/hylafax) [etc/dialrules]? Tracing during normal server operation [1]? Tracing during send and receive sessions [11]? Protection mode for received facsimile [0600]? Protection mode for session logs [0600]? Protection mode for ttyIAX0 [0600]? Rings to wait before answering [1]? Modem speaker volume [off]? Command line arguments to getty program ["-h %l dx_%s"]? Pathname of TSI access control list file (relative to /var/spool/hylafax) [""]? Pathname of Caller-ID access control list file (relative to /var/spool/hylafax) [""]? Tag line font file (relative to /var/spool/hylafax) [etc/lutRS18.pcf]? Tag line format string ["From %%l|%c|Page %%P of %%T"]? Time before purging a stale UUCP lock file (secs) [30]? Hold UUCP lockfile during inbound data calls [Yes]? Hold UUCP lockfile during inbound voice calls [Yes]? Percent good lines to accept during copy quality checking [95]? Max consecutive bad lines to accept during copy quality checking [5]? Max number of pages to accept in a received facsimile [25]? Syslog facility name for ServerTracing messages [daemon]? Set UID to 0 to manipulate CLOCAL [""]? Use available priority job scheduling mechanism [""]? The non-default server configuration parameters are: CountryCode: 49 AreaCode: 69 FAXNumber: +49 69 12345678 LongDistancePrefix: 0 InternationalPrefix: 00 DialStringRules: etc/dialrules SessionTracing: 11 RingsBeforeAnswer: 1 SpeakerVolume: off GettyArgs: "-h %l dx_%s" LocalIdentifier: Apfelmus GmbH TagLineFont: etc/lutRS18.pcf TagLineFormat: "From %%l|%c|Page %%P of %%T" MaxRecvPages: 25 Are these ok [yes]?
Fragen über Fragen, aber nur die wenigsten sind wirklich wichtig.[126] Wichtig sind natürlich die Faxnummer und der sogenannte LocalIdentifier. Das ist der Text, der auf jedem gesendeten Fax in der obersten Zeile steht.
Yes bringt uns weiter zur Modemerkennung.
Now we are going to probe the tty port to figure out the type of modem that is attached. This takes a few seconds, so be patient. Note that if you do not have the modem cabled to the port, or the modem is turned off, this may hang (just go and cable up the modem or turn it on, or whatever). Probing for best speed to talk to modem: 38400 OK. About fax classes: The difference between fax classes has to do with how HylaFAX interacts with the modem and the fax protocol features that are used when sending or receiving faxes. One class isn't inherently better than another; however, one probably will suit a user's needs better than others. Class 1 relies on HylaFAX to perform the bulk of the fax protocol. Class 2 relies on the modem to perform the bulk of the fax protocol. Class 2.0 is similar to Class 2 but may include more features. Class 1.0 is similar to Class 1 but may add V.34-fax capability. Class 2.1 is similar to Class 2.0 but adds V.34-fax capability. HylaFAX generally will have more features when using Class 1/1.0 than when using most modems' Class 2 or Class 2.0 implementations. Generally any problems encountered in Class 1/1.0 can be resolved by modifications to HylaFAX, but usually any problems encountered in Class 2/2.0/2.1 will require the modem manufacturer to resolve it. If you're unsure and your modem supports it, use Class 1. This modem looks to have support for Class 1 and 1.0. How should it be configured [1]?1 Hmm, this looks like a Class 1 modem. Product code (ATI0) is "spandsp". Other information (ATI3) is "www.soft-switch.org". DTE-DCE flow control scheme [default]? Modem manufacturer is "spandsp". Modem model is "IAXmodem". Using prototype configuration file iaxmodem... The modem configuration parameters are: ModemResetCmds: "ATH1\nAT+VCID=1" Are these ok [yes]? Creating new configuration file /var/spool/hylafax/etc/config.ttyIAX0... Creating fifo /var/spool/hylafax/FIFO.ttyIAX0 for faxgetty... done. Done setting up the modem configuration. Checking /var/spool/hylafax/etc/config for consistency... ...some parameters are different. The non-default scheduler parameters are: CountryCode: 49 AreaCode: 69 LongDistancePrefix: 0 InternationalPrefix: 00 DialStringRules: etc/dialrules Are these ok [yes]?
Das Modem wurde erkannt und wir werden gefragt, ob es ein Class
1-Modem ist. Da das genau das ist, was wir wollen, bestätigen wir. Auch
das Reset-Kommando für das Modem können wir so übernehmen. Wenn alles in
Ordnung ist, bestätigen wir mit yes
.
Creating new configuration file /var/spool/hylafax/etc/config... ...saving current file as /var/spool/hylafax/etc/config.sav. Don't forget to run faxmodem(8C) (if you have a send-only environment) or configure init to run faxgetty on ttyIAX0. Do you want to run faxaddmodem to configure another modem [yes]? no You do not appear to be using faxgetty to notify the HylaFAX scheduler about new modems and/or their status. This means that you must use the faxmodem program to inform the new faxq process about the modems you want to have scheduled by HylaFAX. Beware that if you have modems that require non-default capabilities specified to faxmodem then you should read faxmodem(8C) manual page and do this work yourself (since this script is not intelligent enough to automatically figure out the modem capabilities and supply the appropriate arguments). Should I run faxmodem for each configured modem [yes]? /usr/local/sbin/faxmodem ttyIAX0 Done verifying system setup.
Ein zweites Modem haben wir nicht, also beantworten wir die Frage
mit no
. Das Ausführen von faxmodem macht durchaus
Sinn, denn dadurch sind die Modems an Hylafax angebunden.
Jetzt ist das Hylafax zum Senden von Faxen eingerichtet. Aber
vielleicht möchten Sie ja auch welche empfangen. Dazu brauchen wir einen
getty, der am IAXmodem auf Verbindungen lauscht. Das erreicht man ganz
einfach durch einen weiteren Eintrag in der Datei
/etc/inittab
.
mo00:23:respawn:/usr/local/sbin/faxgetty ttyIAX0
Jetzt muss diese Faxlösung noch in Asterisk integriert werden.
Dazu müssen wir Asterisk das IAXmodem bekannt machen. Dies erreichen
wir, indem wir es als IAX2-Peer definieren. Die dazu erforderliche Datei
heißt /etc/asterisk/iax.conf
(siehe auch Abschnitt 7, „IAX“):
[general] bindport = 4569 bindaddr = 0.0.0.0 disallow=all allow=ulaw allow=alaw [iaxmodem] type=friend secret=password port=4570 host=dynamic context=fax-out disallow=all allow=alaw
Im Abschnitt general
sind die globalen IAX2-Daten
abgelegt. In diesem Beispiel wird der Bindport auf den Standart für IAX2
4569 gesetzt. Die Bindadresse gibt das Interface an, auf dem IAX2
lauscht, in diesem Falle auf allen Interfaces.
In der Konfiguration für das IAXmodem wird der
type
auf friend
gesetzt, d.h. es
sind eingehende und ausgehende Verbindungen erlaubt.
secret
und port
entsprechen der Konfiguration des IAXmodems, der
context
ist der, der bei einer ausgehenden
Verbindung angesprochen wird.
Mit dem Befehl iax2 show peers können wir jetzt in der Asterisk-Console (CLI) unser IAXmodem sehen:
*CLI> iax2 show peers Name/Username Host Mask Port Status iaxmodem 127.0.0.1 (D) 255.255.255.255 4570 Unmonitored 1 iax2 peers [0 online, 0 offline, 1 unmonitored] *CLI>
Damit Asterisk weiß, was es mit einem ankommenden Fax anstellen
soll, müssen wir eine entsprechende Extension schreiben. Das Ziel soll
sein, dass ein ankommendes Fax direkt an das Hylafax weitergeleitet
wird. In diesem Beispiel gehen wir davon aus, dass alle Faxe über einen
SIP-Provider-Anschluss reinkommen. Eine entsprechende Konfiguration in
der sip.conf
kann wie folgt aussehen (die
entsprechenden Einstellungen müssen natürlich an die jeweilige
Installation und den SIP-Provider angepasst werden):
[...] [123456] type=friend insecure=very; nat=yes username=123456 fromuser=12345 fromdomain=mein-voip-provider.de secret=secret host=mein-voip-provider.de qualify=yes context=fax-in [...]
Der entsprechende Context in der
extensions.conf
sieht dann so aus:
[fax-in] exten => _.,1,Answer() exten => _.,2,Dial(IAX2/iaxmodem) exten => h,1,Hangup()
Jetzt wird das Fax vom Asterisk an Hylafax über IAXmodem übergeben
und per Mail an den User gesendet, auf den das Mailalias
Faxmaster
zeigt.
Der nächste Schritt ist das Versenden von Faxen. Auch hierfür
brauchen wir Context [fax-out]
in der
extension.conf
. Wenn das virtuelle IAXmodem ein Fax
versenden will, kommt es automatisch in diesen Context. Sollen die Faxe
dann über unsere Beispiel-SIP-Verbindung 123456 gefaxt werden, so sieht
der Eintrag in der extensions.conf
wie folgt
aus:
[fax-out] exten => _X.,1,Answer() exten => _X.,2,Dial(SIP/123456/${EXTEN}) exten => h,1,Hangup()
Testen können wir das Senden mit sendfax -n -d <Faxnummer> <datei.txt>
debian:~# sendfax -n -d 06912345678 /etc/issue.net
Im CLI sollten wir jetzt Folgendes sehen:
-- Accepting AUTHENTICATED call from 127.0.0.1: > requested format = alaw, > requested prefs = (), > actual format = alaw, > host prefs = (alaw), > priority = mine -- Executing Answer("IAX2/iaxmodem-3", "") in new stack -- Executing Dial("IAX2/iaxmodem-3", "SIP/123456/06912345678") in new stack -- Called 123456/06912345678 -- SIP/123456-0818f630 is making progress passing it to IAX2/iaxmodem-3 -- SIP/123456-0818f630 answered IAX2/iaxmodem-3 -- parse_srv: SRV mapped to host mein-voip-provider.de, port 5060 == Spawn extension (fax-out, 06912345678, 2) exited non-zero on 'IAX2/iaxmodem-3' -- Executing Hangup("IAX2/iaxmodem-3", "") in new stack == Spawn extension (fax-out, h, 1) exited non-zero on 'IAX2/iaxmodem-3' -- Hungup 'IAX2/iaxmodem-3'
Das Kommando faxstat -s gibt während des Sendens folgende Zeilen aus:
debian:~# faxstat -s HylaFAX scheduler on w077.example.com: Running Modem ttyIAX0 (123456): Sending job 7 JID Pri S Owner Number Pages Dials TTS Status 7 127 R root 06912345678 0:1 0:12 debian:~#
Fertig! Jetzt können Sie über Asterisk mit Hylafax Faxe versenden und empfangen.
Auf der Hylafax-Webseite http://www.hylafax.org finden Sie viele Hinweise und Howtos, wie Sie Ihren neuen Faxserver möglichst einfach in Ihre bestehende Büroinfrastruktur einbinden.
1.1. | Kann man anstatt Hylafax auch andere Faxserversoftware einsetzen? |
Ja, selbstverständlich. Allerdings hat sich Hylafax sehr bewährt. | |
1.2. | Gibt es zu Hylafax ein eigenes FAQ? |
Ja, dieses finden Sie unter http://www.hylafax.org/content/FAQ. |
Version 1.2, November 2002
Neue Version verfügbar
Sie betrachten gerade die alte Version des Buches (Version 1.0). Wir empfehlen Ihnen für Asterisk 1.4 und 1.6 die neue Version des Buches.
Asterisk-Tag 2008
Lernen Sie Mark Spencer (den Erfinder von Asterisk) kennen! Viele Vorträge, Case-Studies und Workshops rund um das Thema VoIP. Asterisk-Tag.org