HylaFAX e modem USRobotics

Nonostante sia una tecnologia destinata all’oblio, il Fax è ancora largamente utilizzato, con tutti i problemi ad esso legati quali lo spreco di carta ed inchiostro. Problemi aggravati dal fatto che diversi di questi dispositivi utilizzano ancora la cosiddetta carta chimica, inchiostri o nastri inchiostrati di difficile smaltimento.

Da parecchi anni sono disponibili dei software FAX Server che ci permettono di utilizzare un PC con il modem per trasformare i Fax ricevuti in documenti digitali (normalmente PDF) e trasmetterli direttamente alla nostra casella email.

Tra questi troviamo HylaFAX, gratuito, Open Source ed in grado di assolvere in maniera più che egregia a tale compito.

Con l’evoluzione della tecnologia e dell’informatica, i modem sono finiti in cantina sostituiti dalle connessioni ADSL ma possono ancora rivelarsi utili grazie alle funzionalità FAX. Grazie a GNU/Linux ed a HylaFAX, possiamo costruirci un FAX Server senza grandi spese utilizzando un vecchio PC riciclato ed il modem che da tempo è finito in cantina.

Problemi di HylaFAX e modem USRobotics

Nonostante sia un ottimo software, anche HylaFAX può incappare in qualche problema, soprattutto quando lo si vuole interfacciara ad un hardware non prettamente standard.

Per parecchio tempo ho utilizzato modem USR Sportster per la connessione ad Internet, rimanendo soddisfatto per prestazioni ed affidabilità offerte da tali prodotti ma al momento di riesumarne uno per implementare un FAX Server ho scoperto che ha qualche problemino con HylaFAX.

L’installazione del sistema e di HylaFAX rimane abbastanza semplice (si trovano comunque molte informazioni utili in rete) mentre al momento di configurare il modem possono sorgere alcuni problemi: il nostro beneamato USR Sportster ci fa ricredere sulla ottima reputazione che gli abbiamo sempre attribuito !

Facciamo funzionare il modem USRobotics

Personalmente ho perso una giornata prima di riuscire a farlo funzionare, a differenza di altri modem assolutamente non blasonati che hanno funzionato al primo colpo, richiedendo una manciata di minuti per essere configurati. In effetti nel mondo HylaFAX i modem USR non sono particolarmente apprezzati, dato che si discostano dagli standard generalmente implementati sui modem/fax; non per questo dovrete rinunciare ad riutilizzarli: vi occorrerà solamente un po’ di pazienza in più.

La chiave della soluzione sta nel file config.ttyS0 (per COM1, o config.ttyS1 per COM2 ecc.) che va adeguatamente personalizzato. Cercando in rete ho trovato alcune indicazioni che mi hanno permesso di raggiungere una configurazione funzionante:

#
# HylaFAX Facsimile Software
#
# Copyright (c) 1990-1996 Sam Leffler
# Copyright (c) 1991-1996 Silicon Graphics, Inc.
# HylaFAX is a trademark of Silicon Graphics, Inc.
#
# Permission to use, copy, modify, distribute, and sell this software and
# its documentation for any purpose is hereby granted without fee, provided
# that (i) the above copyright notices and this permission notice appear in
# all copies of the software and related documentation, and (ii) the names of
# Sam Leffler and Silicon Graphics may not be used in any advertising or
# publicity relating to the software without the specific, prior written
# permission of Sam Leffler and Silicon Graphics.
#
# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
#
# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
#
#
# Generic Class 1 modem configuration.
#
# EDIT THIS CONFIGURATION TO REFLECT YOUR SETUP
#
CountryCode: 39
AreaCode: 011
FAXNumber: +39.012.3456789
LongDistancePrefix: 0
InternationalPrefix: 00
DialStringRules: etc/dialrules
ServerTracing: 1
SessionTracing: 11
RecvFileMode: 0666
LogFileMode: 0666
DeviceMode: 0666
RingsBeforeAnswer: 7
SpeakerVolume: off
GettyArgs: "-h %l dx_%s"
LocalIdentifier: InfoRisorse
TagLineFont: etc/lutRS18.pcf
TagLineFormat: "Da %%l|%c|Pag. %%P di %%T"
MaxRecvPages: 25
#
#
# Modem-related stuff: should reflect modem command interface
# and hardware connection/cabling (e.g. flow control).
#
ModemType: Class1 # use this to supply a hint
ModemRate: 38400 # rate for DCE-DTE communication
#ModemFlowControl: xonxoff # XON/XOFF flow control assumed
ModemFlowControl: rtscts # XON/XOFF flow control assumed
#
ModemSetupDTRCmd: ATS13=1&D2 # setup so DTR drop resets modem
ModemSetupDCDCmd: AT&C1 # setup so DCD follows carrier
#GettyArgs: "-h %l dx_%s" # modem must auto-detect fax/data
#
# We can append the "@" symbol to the dial string so that
# the modem will wait 5 seconds before attempting to connect
# and return result codes that distinguish between no carrier
# and no answer. This makes it possible to avoid problems with
# repeatedly dialing a number that doesn't have a fax machine
# (kudos to Stuart Lynne for this trick.)
#
# NB: If you need to prefix phone numbers to get through a PBX,
# put it in the ModemDialCmd; e.g. "DT9%s@".
#
ModemDialCmd: ATX3DT,%s # T for tone dialing
#
# Other possible configuration stuff. The default strings are
# shown below. Only those that are different from the defaults
# need to be included in the configuration file.
#
#ModemResetCmds: "" # stuff to do when modem is reset
#ModemAnswerCmd: ATA # use this to answer phone
ModemNoFlowCmd: AT&H0&I0&R1 # disable flow control cmd
ModemHardFlowCmd: AT&H1&I0&R2 # hardware flow control cmd
ModemSoftFlowCmd: AT&H2&I2&R1 # software flow control cmd
#ModemNoAutoAnswerCmd: ATS0=0 # disable auto-answer
#
# Set modem speaker volume commands: OFF QUIET LOW MEDIUM HIGH.
# Note that we both turn the speaker on/off and set volume.
#
#ModemSetVolumeCmd: "ATM0 ATL0M1 ATL1M1 ATL2M1 ATL3M1"
#ModemEchoOffCmd: ATE0 # disable command echo
#ModemVerboseResultsCmd: ATV1 # enable verbose command results
ModemResultCodesCmd: ATQ0X4 # enable result codes
#ModemOnHookCmd: ATH0 # place phone on hook (hangup)
#ModemSoftResetCmd: ATZ # do soft reset of modem
#ModemSoftResetCmdDelay: 3000 # pause after soft reset
#ModemWaitTimeCmd: ATS7=60 # wait 60 seconds for carrier
#ModemCommaPauseTimeCmd: ATS8=2 # comma pause time is 2 seconds
#ModemRecvFillOrder: LSB2MSB # bit order of received facsimile
#ModemSendFillOrder: LSB2MSB # bit order modem expects for transmit
#
Class1Cmd: AT+FCLASS=1 # command to enter class 1
Class1PPMWaitCmd: AT+FTS=7 # command to stop and wait before PPM
Class1TCFWaitCmd: AT+FTS=7 # command to stop and wait before TCF
Class1EOPWaitCmd: AT+FTS=9 # command to stop and wait before EOP
Class1SwitchingCmd: AT+FRS=7 # silence between HDLC recv and trans
Class1RecvAbortOK: 200 # wait 200ms for abort response
Class1FrameOverhead: 4 # 4 byte overhead in recvd HDLC frames
Class1RecvIdentTimer: 40000 # 35+5secs waiting for ident frames
Class1TCFMaxNonZero: 10 # max 10% of data may be non-zero
Class1TCFMinRun: 1000 # min run is 2/3rds of TCF duration
#
ModemSetupAACmd: AT+FAA=1
AdaptiveAnswer: yes
NoAnswerVoice: on