Como instalar un servidor de Fax en Debian

Imagen de RazaMetaL

No tengo fax y es necesario que pueda enviar y recibirlos, que mejor oportunidad para probar que tal funciona GNU/Linux como servidor de fax. Para esta tarea estoy usando el siguiente hardware:


CPU Intel Pentium III 400Mhz
128 MB en RAM
Disco duro de 80GB
Winmodem PCTEL Rockwell de los que vienen incorporados en le motherboard

Instalar el modem fui lo mas dificil, pero para vuestra buena fortuna [url=http://www.ecualug.org/?q=2007/02/26/comos/instalar_modem_pctel_en_debian]aqui[/url] estoy colocando un [url=http://www.ecualug.org/?q=2007/02/26/comos/instalar_modem_pctel_en_debian]mini how[/url] to para lograr que funcione :).

Requerimientos:
- Debian (Sarge, Etch o Sid)
- Un modem, yo tengo un PCTel el cual me dió mucho trabajo para instalarlo :(

00:0f.1 Communication controller: C-Media Electronics Inc CM8738 (rev 20)

La aplicación de fax que vamos a instalar se llama Hylafax, se trata de un sencillo y a su vez
potente conjunto de demonios que hacen posible el envio y recepción de faxes desde una máquina
de la red, esto es posible debido a que existen varias aplicaciones que permiten integrar el
envio de faxes desde compuradores que corran otros sistemas operativos. Adicionalmente en esta
guia se indicará como instalar un administrador via web de hylafax, la aplicación se llama
AvantFAX y le resulta muy útil a otras personas de otras áreas que no tienen el conocimiento
suficiente en la hora de realizar tareas de mantenimiento.

Para instalar hylafax ejecutamos:

aptitude install hylafax-server

La configuración de Hylafax se logra desde la línea de comandos con faxsetup, este nos pedirá
mediante un menu interactivo varias opciones de configuración, la gran mayoría las vamos a
dejar por defecto, excepto las que son relativas a los datos de codigo de área, número de fax,
nombre de la empresa y permisología de los archivos. Finalmente probará nuestro modem y
seleccionará la velocidad idonea de este úlimo.


# faxsetup

Setup program for HylaFAX (tm) 4.3.1.
Created for i686-pc-linux-gnu on Sun Jan 7 09:32:03 CET 2007.
Reading cached parameters from /var/spool/hylafax/etc/setup.cache.

Checking system for proper server configuration.

Warning: /etc/hylafax/getty-link does not exist or is not an executable program!

The file:

/etc/hylafax/getty-link

does not exist or this file is not an executable program. The
HylaFAX software optionally uses this program and the fact that
it does not exist on the system is not a fatal error. If the
program resides in a different location and you do not want to
install a symbolic link for /etc/hylafax/getty-link that points to your program
then you must reconfigure and rebuild HylaFAX from source code.

Warning: /etc/hylafax/vgetty-link does not exist or is not an executable program!

The file:

/etc/hylafax/vgetty-link

does not exist or this file is not an executable program. The
HylaFAX software optionally uses this program and the fact that
it does not exist on the system is not a fatal error. If the
program resides in a different location and you do not want to
install a symbolic link for /etc/hylafax/vgetty-link that points to your program
then you must reconfigure and rebuild HylaFAX from source code.

Warning: /etc/hylafax/egetty-link does not exist or is not an executable program!

The file:

/etc/hylafax/egetty-link

does not exist or this file is not an executable program. The
HylaFAX software optionally uses this program and the fact that
it does not exist on the system is not a fatal error. If the
program resides in a different location and you do not want to
install a symbolic link for /etc/hylafax/egetty-link that points to your program
then you must reconfigure and rebuild HylaFAX from source code.

Make /var/spool/hylafax/bin/ps2fax a link to /var/spool/hylafax/bin/ps2fax.gs.

Make /var/spool/hylafax/bin/pdf2fax a link to /var/spool/hylafax/bin/pdf2fax.gs.

Update /var/spool/hylafax/status/any.info.

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]?

Modem support functions written to /var/spool/hylafax/etc/setup.modem.
Configuration parameters written to /var/spool/hylafax/etc/setup.cache.

Restarting HylaFAX server processes.

You have a HylaFAX scheduler process running. faxq will be
restarted shortly, as soon as some other work has been completed.
Can I terminate this faxq process (8481) [yes]?
Should I restart the HylaFAX server processes [yes]?

/etc/init.d/hylafax start
Not starting HylaFAX daemons since they are already running.

You do not appear to have any modems configured for use. Modems are
configured for use with HylaFAX with the faxaddmodem(8) command.
Do you want to run faxaddmodem to configure a modem [yes]?
Serial port that modem is connected to [ttyS0]? ttyS_PCTEL0
Serial port that modem is connected to [ttyS_PCTEL0]?

Ok, time to setup a configuration file for the modem. The manual
page config(5) 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]? 593
Area code [415]? 5
Phone number of fax modem [+1.999.555.1212]? 262.6666
Local identification string (for TSI/CIG) ["NothingSetup"]? FaxMachine
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]? 0644
Protection mode for session logs [0600]? 0644
Protection mode for ttyS0 [0600]? 0666
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]? 3
Max number of pages to accept in a received facsimile [25]? 50
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: 593
AreaCode: 5
FAXNumber: 262.6666
LongDistancePrefix: 0
InternationalPrefix: 00
DialStringRules: etc/dialrules
SessionTracing: 11
RecvFileMode: 0644
LogFileMode: 0644
DeviceMode: 0666
RingsBeforeAnswer: 1
SpeakerVolume: off
GettyArgs: "-h %l dx_%s"
LocalIdentifier: FaxMachine
TagLineFont: etc/lutRS18.pcf
TagLineFormat: "From %%l|%c|Page %%P of %%T"
MaxConsecutiveBadLines: 3
MaxRecvPages: 50

Are these ok [yes]?

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.

Hmm, this looks like a Class 1 modem.
Product code (ATI0) is "56000".
Other information (ATI3) is "PCtel HSP56 MicroModem 8.00-LN211".
DTE-DCE flow control scheme [default]?
Modem manufacturer is "Rockwell/Conexant".
Modem model is "AC/K56".

Using prototype configuration file rc288dpi-1...

The modem configuration parameters are:

ModemDialCmd: ATDT%s
ModemFlowControl: rtscts
ModemHardFlowCmd: AT&K3
ModemMfrQueryCmd: !Rockwell
ModemModelQueryCmd: !RC288DPi
ModemNoFlowCmd: AT&K0
ModemRate: 19200
ModemRevQueryCmd: ATI3
ModemSetupDCDCmd: AT&C1
ModemSetupDTRCmd: AT&D2
ModemSoftFlowCmd: AT&K4

Are these ok [yes]?

Creating new configuration file /var/spool/hylafax/etc/config.ttyS_PCTEL0...
Creating fifo /var/spool/hylafax/FIFO.ttyS_PCTEL0 for faxgetty... done.
Done setting up the modem configuration.

Checking /var/spool/hylafax/etc/config for consistency...
...everything looks ok; leaving existing file unchanged.

Don't forget to restart hylafax in order to run faxgetty on this new modem
line.
Creating /etc/hylafax/config.ttyS_PCTEL0 from /var/spool/hylafax/etc/config.ttyS_PCTEL0.
Updating /etc/hylafax/setup.cache from /var/spool/hylafax/etc/setup.cache.
Updating /etc/hylafax/setup.modem from /var/spool/hylafax/etc/setup.modem.
/var/spool/hylafax/config
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(8) 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/sbin/faxmodem ttyS_PCTEL0

Done verifying system setup.
/var/spool/hylafax

Ahora vamos a indicarle a HylaFAX cuales son los hosts que pueden enviar fax, modificamos /etc/hylafax/hosts.hfaxd :


# hosts.hfaxd
# This file contains permissions and password for every user in
# the system.
#
# For more information on this biject, please see its man page
# and the commands faxadduser and faxdeluser.
localhost:21::
192\.168\.:::
127\.0\.0\.:::

Para habilitar la recepcion de fax editamos y agregamos /etc/inittab y despues reiniciamos:


t2:23:respawn:/usr/sbin/faxgetty ttyS_PCTEL0

Al marcar al numero en el que el modem esta conectado podremos ver en el log actividad:


Feb 26 13:25:44 fileserver FaxGetty[3912]: ANSWER: FAX CONNECTION DEVICE '/dev/ttyS_PCTEL0'
Feb 26 13:26:27 fileserver kernel: pctel(424): PCTel initialization. Country code is 33.
Feb 26 13:26:27 fileserver kernel:
Feb 26 13:26:31 fileserver kernel: pctel(424): PCTel initialization. Country code is 33.
Feb 26 13:26:31 fileserver kernel:
Feb 26 13:26:35 fileserver FaxGetty[3912]: MODEM ROCKWELL RC288DPi/PCtel HSP56 MicroModem 8.00-LN211

Y al ejecutar faxstat veremos el estado del modem y del servidor:

faxstat -a -s

HylaFAX scheduler on fileserver.midominio.com: Running
Modem ttyS/PCTEL0 (+593 5 292-2061): Running and idle

Si revisamos nuestro e-mail, veremos que los faxes nos llegan al correo electronico como un archivo adjunto :)

Comentarios

Hylafax-Iaxmodem- Avantfax

Saludos, yo instalé en Etch hylafax con iaxmodem, se me registró el modem con asterisk y pensé que todo iba bien hasta que traté de enviar un fax desde la consola y nada, probé instalando avantfax y se instaló pero de hecho, debería aparecerme el modem registrado en la interfaz y nada tampoco, me salen estos warning:

Notice: Undefined index: alias in /var/www/avantfax/includes/FaxModem.php on line 178

Notice: Undefined index: device in /var/www/avantfax/includes/FaxModem.php on line 179

Notice: Undefined index: contact in /var/www/avantfax/includes/FaxModem.php on line 180

Notice: Undefined index: devid in /var/www/avantfax/includes/FaxModem.php on line 181

Notice: Undefined index: printer in /var/www/avantfax/includes/FaxModem.php on line 182

Notice: Undefined index: faxcatid in /var/www/avantfax/includes/FaxModem.php on line 183

Notice: Undefined index: alias in /var/www/avantfax/includes/FaxModem.php on line 178

Notice: Undefined index: device in /var/www/avantfax/includes/FaxModem.php on line 179

Notice: Undefined index: contact in /var/www/avantfax/includes/FaxModem.php on line 180

Notice: Undefined index: devid in /var/www/avantfax/includes/FaxModem.php on line 181

Notice: Undefined index: printer in /var/www/avantfax/includes/FaxModem.php on line 182

Notice: Undefined index: faxcatid in /var/www/avantfax/includes/FaxModem.php on line 183

Debo reinstalar hylafax y luego de faxsetup hacer faxmodem para integrar iaxmodem con hylafax o puedo editar el archivo faxmodem? Otra duda, he investigado y me dicen que el error tiene que ver con los usuarios del fax y eso tiene que ver con el archivo host.hfaxd, qué significa esto que colocan ustedes:

localhost:21::
192\.168\.:::
127\.0\.0\.:::

de antemano gracias por su ayuda.