
***************
<HR>

<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>

<TR>
<TD VALIGN=top><LISTING>
hyla# \fBfaxaddmodem ttyf2\fP

Ok, time to setup a configuration file for the modem.   The manual
page config(4F) may be useful during this process.   Also be aware
that at any time you can safely interrupt this procedure.
</LISTING></TD>

<TD VALIGN=top><FONT SIZE=2>
If your modem is configured to
communicate with the host at a fixed speed, then use the
\f(CW-s\fP option to lock the host-modem bit rate.
Note also that \fIfaxaddmodem\fP must be run as root.
</FONT></TD>
</TR>

<TR>
<TD COLSPAN=2><FONT SIZE=2>
<HR>
\fICollect server-specific configuration parameters.\fP
Per-modem configuration files contain parameters that pertain to
the operation of the modem and parameters that control the function
of the HylaFAX server software that controls the modem.
The former parameters are termed modem-specific while the
latter are referred to as server-specific.
\fIfaxaddmodem\fP collects server-specific parameters first and then
modem-related parameters are setup based on the type of modem.
<HR>
</FONT></TD>
</TR>

<TR>
<TD VALIGN=top><LISTING>
Reading scheduler config file /var/spool/fax/etc/config.
</LISTING></TD>

<TD><FONT SIZE=2>
The configuration file for the HylaFAX scheduler is automatically
read to get default settings for parameters such as the area code.
<HR>
</FONT></TD>
</TR>

<TR>
<TD VALIGN=top><LISTING>
No existing configuration, let's do this from scratch.
</LISTING></TD>

<TD><FONT SIZE=2>
If a configuration file already exists for a modem, the
server-specific parameters will be carried over to the new configuration,
but the modem-specific parameters will not.  
<HR>
</FONT></TD>
</TR>

<TR>
<TD VALIGN=top><LISTING>
Country code [1]? \f(BIENTER pressed\fP\|
Area code [510]?
</LISTING></TD>

<TD><FONT SIZE=2>
<EM>The area code may be set to a null string or omitted
in locations where one does not exist.</EM>
<HR>
</FONT></TD>
</TR>

<TR>
<TD VALIGN=top><LISTING>
Phone number of fax modem [+1.999.555.1212]? \fB+1 510 526-8788\fP
</LISTING></TD>

<TD><FONT SIZE=2>
This is the phone number associated with the modem.
By default this number is passed as an \fIidentity\fP
to peer fax machines (see below) and it may also appear
on tag lines created by the fax server.
</FONT></TD>
</TR>

<TR>
<TD COLSPAN=2><FONT SIZE=2>
<HR>
<IMG SRC="icons/info_icon.gif" HSPACE=8 ALIGN=left>
Phone numbers should be supplied with a
complete international dialing specification:
``+&lt\fIcountry code\fP&gt; &lt\fIlocal part\fP&gt;''
(the &lt\fIlocal part\fP&gt; includes an area code
where such a notion exists.)
<BR CLEAR=left>
<HR>
</FONT></TD>
</TR>

<TR>
<TD VALIGN=top><LISTING>
Local identification string (for TSI/CIG) ["NothingSetup"]? \fB""\fP
</LISTING></TD>

<TD VALIGN=top><FONT SIZE=2>
The local identification string is passed to
peer fax machines during
communication.   If it is not specified, or set to a null string, then
the canonical phone number of the fax modem is used instead.
</FONT></TD>
</TR>

<TR>
<TD COLSPAN=2><FONT SIZE=2>
<HR>
<IMG SRC="icons/info_icon.gif" HSPACE=8 ALIGN=left>
Beware
that the fax communication protocol restricts
the local identification string to numbers, blank, and the ``+'' symbol.
In practice however, most fax machines will accept any ASCII string.
<BR CLEAR=left>
<HR>
</FONT></TD>
</TR>

<TR>
<TD VALIGN=top><LISTING>
Long distance dialing prefix [1]? \f(BIENTER pressed\fP\|
International dialing prefix [011]? \f(BIENTER pressed\fP\|
Dial string rules file (relative to /var/spool/fax)
   [etc/dialrules.sf-ba]?
</LISTING></TD>

<TD VALIGN=top><FONT SIZE=2>
The dial string rules file holds rules
used to convert user-supplied
dialing strings (i.e.  phone numbers) to a canonical format and to
prepare strings for delivery to a modem.   The default rules do very
little.   Specific dialing rules may be useful for your site or locale
based on how your modems are connected to the PTT.   Consult the
section in the <A HREF="setup-advanced.html#DialRules">Advanced Server
Configuration chapter for more information.
<HR>
</FONT></TD>
</TR>

<TR>
<TD VALIGN=top><LISTING>
Tracing during normal server operation [1]? \f(BIENTER pressed\fP\|
Tracing during send and receive sessions [11]? \f(BIENTER pressed\fP\|
</LISTING></TD>

<TD VALIGN=top><FONT SIZE=2>
These parameters control the logging done by server processes.
</FONT></TD>
</TR>


<TR>
<TD COLSPAN=2><FONT SIZE=2>
<HR>
<IMG SRC="icons/warning_icon.gif" HSPACE=8 VSPACE=8 ALIGN=left>
<EM>It is important that tracing during send and receive sessions include
sufficient information to diagnose problems.   For Class 1 modems this
parameter is usually set to \f(CW0x4f\fP so that HDLC frames are
included in the logs.   For Class 2 and Class 2.0 modems the default
setting of 11 is typically ok.
Consult the descriptions of \f(CWServerTracing\fP and \f(CWSessionTracing\fP
in the
<A HREF="@CGIPATH@/manpage?4+config">config(4F) manual page.</EM>
<BR CLEAR=left>
<HR>
</FONT></TD>
</TR>

<TR>
<TD VALIGN=top><LISTING>
Protection mode for received fax [0600]? \f(BIENTER pressed\fP\|
</LISTING></TD>

<TD VALIGN=top><FONT SIZE=2>
The default parameter selected here makes
all received fax accessible
only to the fax user.   It may be desirable to set this parameter to
\f(CW0644\fP so that anyone can look at received fax.
<HR>
</FONT></TD>
</TR>

<TR>
<TD VALIGN=top><LISTING>
Protection mode for session logs [0600]? \f(BIENTER pressed\fP\|
Protection mode for ttym2 [0600]? \f(BIENTER pressed\fP\|
</LISTING></TD>

<TD VALIGN=top><FONT SIZE=2>
Note that if sensitive information such as credit card access codes
are supplied by users that they will appear in the session logs kept
on the server machine.   For this reason the default protection mode
for session logs protects them from public access.
<HR>
</FONT></TD>
</TR>

<TR>
<TD VALIGN=top><LISTING>
Rings to wait before answering [1]? \f(BIENTER pressed\fP\|
</LISTING></TD>

<TD><FONT SIZE=2>
This parameter is used during inbound call handling.   It
specifies the number of rings to wait before answering the phone.
See the section on inbound call handling for a discussion of
the different schemes that are supported for handling calls.
<HR>
</FONT></TD>
</TR>

<TR>
<TD VALIGN=top><LISTING>
Modem speaker volume [off]? \f(BIENTER pressed\fP\|
Command line arguments to getty program ["-h %l dx_%s"]? \f(BIENTER pressed\fP\|
</LISTING></TD>

<TD VALIGN=top><FONT SIZE=2>
This parameter is also related to inbound call handling.   It controls
whether or not to enable support for inbound data calls and should
not be set without first understanding how to setup your system
for incoming data usage.
<HR>
</FONT></TD>
</TR>

<TR>
<TD VALIGN=top><LISTING>
Pathname of TSI access control list file
   (relative to /var/spool/fax) [""]? \f(BIENTER pressed\fP\|
</LISTING></TD>

<TD VALIGN=top><FONT SIZE=2>
The TSI access control list file can be used to restrict inbound
fax access.   The default parameter causes all inbound calls
to be accepted.   This parameter is discussed more below.
<HR>
</FONT></TD>
</TR>

<TR>
<TD VALIGN=top><LISTING>
Tag line font file (relative to /var/spool/fax) [etc/lutRS18.pcf]? \f(BIENTER pressed\fP\|
Tag line format string ["From %%l|%c|Page %%p of %%t"]? \f(BIENTER pressed\fP\|
</LISTING></TD>

<TD VALIGN=top><FONT SIZE=2>
Tag lines are an optional feature that cause each
page of an outbound fax to be marked with a line of text.
A proper description of the tag line support is provided in the
<A HREF="setup-advanced.html#TagLine">Tagline Configuration section
of the next chapter.
</FONT></TD>
</TR>

<TR>
<TD COLSPAN=2><FONT SIZE=2>
<HR>
<IMG SRC="icons/warning_icon.gif" HSPACE=8 ALIGN=left>
<EM>Note that in the United States some form of identification
of the sender of a fax is required by law; properly configured
tag lines are an acceptable form of identification.
Beware that the default tag line includes the phone number
defined above; make sure this number is correct!
</EM>
<BR CLEAR=left>
<HR>
</FONT></TD>
</TR>

<TR>
<TD VALIGN=top><LISTING>
Time before purging a stale UUCP lock file (secs) [30]?
</LISTING></TD>

<TD VALIGN=top><FONT SIZE=2>
This parameter controls the time that a HylaFAX server process
will wait before removing a UUCP lock file whose owner appears
to be gone.   The default parameter forces these stale lock files
to be left around for just 30 seconds.
This is an appropriate value to use on systems where applications
that use UUCP lock files are known to be well behaved.
<HR>
</FONT></TD>
</TR>

<TR>
<TD VALIGN=top><LISTING>
Percent good lines to accept during copy quality checking [95]? \f(BIENTER pressed\fP\|
Max consecutive bad lines to accept during copy quality checking [5]? \f(BIENTER pressed\fP\|
Max number of pages to accept in a received fax [25]? \f(BIENTER pressed\fP\|
Syslog facility name for ServerTracing messages ["local5"]?
</LISTING></TD>

<TD VALIGN=top><FONT SIZE=2>
More parameters associated with inbound fax jobs; consult
the section below.
</FONT></TD>
</TR>

<TR>
<TD COLSPAN=2><FONT SIZE=2>
<HR>
<IMG SRC="icons/info_icon.gif" HSPACE=8 ALIGN=left>
The syslog facility controls where HylaFAX directs server tracing-related
messages.  By setting this parameter to a non-standard
value HylaFAX messages can easily be recorded in a file separate
from the normal system messages.   Consult the
<A HREF="troubleshooting.html#ServerBasics">Troubleshooting chapter,
for more information.
<BR CLEAR=left>
<HR>
</FONT></TD>
</TR>

<TR>
<TD VALIGN=top><LISTING>
Set UID to 0 to manipulate CLOCAL [""]? \fByes\fP
</LISTING></TD>

<TD VALIGN=top><FONT SIZE=2>
This parameter should only need to be set on Silicon Graphics
systems.   Consult the section on
<A HREF="#IRIX">IRIX-specific guidance for
a description of why this parameter might be used.
<HR>
</FONT></TD>
</TR>

<TR>
<TD VALIGN=top><LISTING>
The non-default server configuration parameters are:

CountryCode:            1
AreaCode:               510
FAXNumber:              +1 510 526-8788
LongDistancePrefix:     1
InternationalPrefix:    011
DialStringRules:        etc/dialrules.sf-ba
SessionTracing:         11
RingsBeforeAnswer:      1
SpeakerVolume:          off
GettyArgs:              "-h %l dx_%s"
LogFacility:            local5
TagLineFont:            etc/lutRS18.pcf
TagLineFormat:          "From %%l|%c|Page %%p of %%t"
MaxRecvPages:           25
ClocalAsRoot:           yes

Are these ok [yes]? \f(BIENTER pressed\fP\|
</LISTING></TD>

<TD VALIGN=top><FONT SIZE=2>
This completes the collection of server-related parameters; the
remaining steps identify and configure the modem for use.
If the displayed parameters are unacceptable, typing something other
than \f(CWyes\fP or a carriage return will cause \fIfaxaddmodem\fP
to prompt for new/changed parameter settings.
</FONT></TD>
</TR>

<TR>
<TD COLSPAN=2><FONT SIZE=2>
<HR>
\fISetup modem-specific configuration parameters.\fP
\fIfaxaddmodem\fP probes the modem to find out what type it is and
what capabilities it has.
The modem identity is then matched against a set of prototype
configuration files to come up with modem-specific parameters
that are appropriate to the modem and the style of flow control
that is to be used between the host and modem.
If the modem is not supported by an existing prototype configuration
then \fIfaxaddmodem\fP will prompt to get values for parameters.
<HR>
</FONT></TD>
</TR>

<TR>
<TD VALIGN=top><LISTING>
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).
</LISTING></TD>
</TR>

<TR>
<TD VALIGN=top><LISTING>
Probing for best speed to talk to modem: 38400 OK.
</LISTING></TD>

<TD><FONT SIZE=2>
Use the \f(CW-s\fP option to avoid probing.
<HR>
</FONT></TD>
</TR>

<TR>
<TD VALIGN=top><LISTING>
This modem looks to have support for both Class 1 and 2;
how should it be configured [2]? \f(BIENTER pressed\fP\|
</LISTING></TD>

<TD VALIGN=top><FONT SIZE=2>
Modems that support multiple classes can be configured to use
any supported class.   By default Class 2.0 is considered better
than Class 2 which is preferred over Class 1.
</FONT></TD>
</TR>

<TR>
<TD VALIGN=top><LISTING>
Hmm, this looks like a Class 2.0 modem.
Modem manufacturer is "USRobotics Courier V.Everything".
Modem model is "Product type           US/Canada External".
</LISTING></TD>
</TR>

<TR>
<TD VALIGN=top><LISTING>
DTE-DCE flow control scheme [default]? \f(BIENTER pressed\fP\|
</LISTING></TD>

<TD VALIGN=top><FONT SIZE=2>
The flow control scheme requested is one of \f(CWxonxoff\fP for
software flow control, \f(CWrtscts\fP for hardware flow control,
or \f(CWdefault\fP for a setting that is appropriate for the
modem and the tty device.
</TD>
</TR>

<TR>
<TD COLSPAN=2><FONT SIZE=2>
<HR>
<IMG SRC="icons/warning_icon.gif" HSPACE=8 VSPACE=8 ALIGN=left>
<EM>Beware of using an improper flow control scheme for the selected
tty device.   On systems where \fIfaxaddmodem\fP understands how
tty device names reflect flow control characteristics, selecting
a flow control scheme not supported by the device will cause
\fIfaxaddmodem\fP to prompt for confirmation and/or to change the device
name or the flow control scheme.</EM>
<BR CLEAR=left>
<HR>
</FONT></TD>
</TR>

<TR>
<TD VALIGN=top><LISTING>
Using prototype configuration file usr-2.0...

The modem configuration parameters are:

ModemFlowControl:       rtscts
ModemHardFlowCmd:       AT&H1&I0&R2
ModemNoFlowCmd:         AT&H0&I0&R1
ModemRate:              38400
ModemResultCodesCmd:    ATQ0X4
ModemSetVolumeCmd:      "ATM0 ATM1 ATM1 ATM1 ATM1"
ModemSetupAACmd:        AT+FAA=1
ModemSetupDCDCmd:       AT&C1
ModemSetupDTRCmd:       ATS13=1&D2
ModemSoftFlowCmd:       AT&H2&I2&R1
Class2BUGCmd:           AT+FBU=0
Class2CQQueryCmd:       !(0),(0)

Are these ok [yes]? \f(BIENTER pressed\fP\|
</LISTING></TD>

<TD VALIGN=top><FONT SIZE=2>
The modem-specific configuration parameters are obtained
from prototype configuration files that reside in the \fBconfig\fP
subdirectory of the HylaFAX spooling area.   These parameters have
been taken from working systems and should provide a functioning configuration
based on the modem type and the selected flow control scheme.
</FONT></TD>
</TR>

<TR>
<TD COLSPAN=2><FONT SIZE=2>
<HR>
\fIIf no prototype configuration file exists for a modem then \fIfaxaddmodem\fP
will prompt for settings.\fP
There are generic prototype configuration
files for Class 1, Class 2, and Class 2.0 modems.
Because there are many configuration parameters for modems it may
be preferrable to use a normal text editor instead of
\fIfaxaddmodem\fP when constructing a configuration file for an
unsupported modem,  To do this simply accept the default parameters
and then edit the generated configuration file before starting up
a server for the modem.   Once a working configuration file is
created it is simple to create a prototype file from it; consult the
<A HREF="@CGIPATH@/manpage?1+\fIfaxaddmodem\fP">\fIfaxaddmodem\fP(1M)
or
<A HREF="@CGIPATH@/manpage?4+config">config(4F)
manual pages for information on doing this.
<HR>
</FONT></TD>
</TR>

<TR>
<TD VALIGN=top><LISTING>
Creating new configuration file /var/spool/fax/etc/config.ttyf2...
Done setting up the modem configuration.
</LISTING>.Le
</TR>

<TR>
<TD VALIGN=top><LISTING>
Checking /var/spool/fax/etc/config for consistency...
...everything looks ok; leaving existing file unchanged.

Don't forget to run faxmodem(1M) (if you have a send-only environment)
or configure init to run faxgetty on ttyf2.
</LISTING></TD>

<TD VALIGN=top><FONT SIZE=2>
At this point \fIfaxaddmodem\fP compares the parameters setup
for the modem against the parameters setup for the HylaFAX scheduler
process.   If any parameters are incompatible
it prompts to see if they should be used to create a new
file for the scheduler.
</FONT></TD>
</TR>
</TR>

</TABLE>

<HR>

Once a modem has been setup with \fIfaxaddmodem\fP the HylaFAX
scheduler process must be informed of its presence.
This can be accomplished in one of two ways.
If a system is to be used only for transmitting fax then the
scheduler is informed by running the faxmodem command.
Otherwise, if a modem is to be used for both inbound and outbound
use then a faxgetty process should be setup to manage
the modem\(emthis process will automatically inform the scheduler
once it has initialized the modem for use.
There are also valid reasons to use faxgetty on modems that
are to be used strictly for data; this and other variations in
configuring the software are discussed later.
If a modem was previously in use nothing needs to be
done; the HylaFAX server processes will notice the new configuration
file and automatically use its contents.
If \fIfaxaddmodem\fP was invoked by \fIfaxsetup\fP then \fIfaxsetup\fP should complete
the steps necessary to complete the setup of a HylaFAX server machine.

<A NAME="Starting">.P<HR WIDTH=65% ALIGN=right>
.H3 "Starting Outbound Service"


Outbound service is carried out by the HylaFAX scheduler process, the
<A HREF="@CGIPATH@/manpage?1+faxq">faxq(1M) program.
There is one faxq process for all modems on a system.
The faxq program learns about modems that can be used for outbound
jobs by messages it receives on a FIFO special file located
in the HylaFAX spooling area on the server machine.
These messages come from two sources: from the
faxmodem program that is used to manually enable a modem for use, or
from faxgetty processes that are
setup to run on each tty device where a fax modem resides.

.P
Specifying modems with faxmodem is useful when HylaFAX
is to be used in a \fIsend-only configuration\fP.
Doing this however limits the functionality of the scheduler
because it will not know the true state of each modem; for example  when
a modem is in use by an outbound application such as uucp or tip.
Instead faxq will assume that each modem is ready for use except
when it is actively being used by HylaFAX to transmit a fax
or alpha-numeric page.

.P
A modem specified with faxmodem
is identified by the tty device it is attached to.
Thus, to notify the scheduler that two modems are available for use, the
following might be used:

.Ls B<LISTING>
hyla# \fBfaxmodem tty01\fP
hyla# \fBfaxmodem /dev/tty02\fP
</LISTING>.Le

(note that devices may be specified with or without a leading
\fB/dev/\fP prefix.)
Modem specified as above are assumed to have a default set of
\fIcapabilities\fP: whether or not they support polled retrieval
of fax documents, what speeds they support for transmitting
fax, whether or not they handle high resolution fax, etc.
It is a good idea to specify the correct set of capabilities
for a modem when using faxmodem, otherwise you may not get best use
of a modem.
Not identifying when a modem has limited capabilities can also
cause HylaFAX to do extra work or cause errors that might be
avoided.

.P
Modem capabilities are specified through faxmodem with the syntax
used by Class 2 and Class 2.0 modems.
This makes it easy to setup a Class 2/2.0 modem: all you need to
do is make a simple query to the modem to get the capabilities
string to pass to faxmodem.
For example, for a Class 2.0 modem the following commands would
be used:

.Ls B<LISTING>
hyla% \fBcu -l ttyf2\fP
Connected
\fBat+fclass=2.0\fP
OK
\fBat+fcc=?\fP
(0,1),(0-5),(0-2),(0-2),0,0,0,(0-7)
OK
</LISTING>.Le

This sets the modem in Class 2.0 and then asks for the set of
communication capabilities.
The resulting string is then passed to faxmodem:

.Ls B<LISTING>
hyla# \fBfaxmodem -c '(0,1),(0-5),(0-2),(0-2),0,0,0,(0-7)' ttyf2\fP
</LISTING>.Le

(note the quote marks around the string so that the shell does
not interpret the parentheses).

.P
For a Class 2 modem the commands are slightly different:

.Ls B<LISTING>
hyla% \fBcu -l ttyf2\fP
Connected
\fBat+fclass=2\fP
OK
\fBat+fdcc=?\fP
(0,1),(0-5),(0-2),(0-2),0,0,0,(0-7)
OK
</LISTING>.Le

.P
For a Class 1 modem an entirely different procedure is needed because
the modem only implements a small portion of the fax protocol.
This means that the capabilities are mostly dependent on the HylaFAX
software and not on the modem.
The only information needed from the modem is which signalling rates
are supported for transmitting fax data; this is obtained with:

.Ls B<LISTING>
hyla% \fBcu -l ttyf2\fP
Connected
\fBat+fclass=1\fP
OK
\fBat+ftm=?\fP
24,48,72,73,74,96,97,98
OK
</LISTING>.Le

and from there a capabilities string can be crafted by understanding
that the above list indicates the modem can transmit at speeds from
2400 bps (\f(CW24\fP), 4800 bps (\f(CW48\fP), 7200 bps
(\f(CW72,73,74\fP), and 9600 bps (\f(CW96,97,98\fP).
(Multiple values for a particular speed indicate support for
multiple \fImodulation schemes\fP; if any one value is reported then
the corresponding speed should be specified in the capabilities string.)
Thus the capabilities string is 
``(0,1),(0-3),(0-2),(0-2),0,0,0,(0-7)''
(note the second segment is 0-3 instead of the 0-5 used above
which indicated that the modem supported 12200 and 14400 bps
signalling rates).
Consult the
<A HREF="@CGIPATH@/manpage?1+faxmodem">faxmodem(1M)
manual page for more information.

.P
When faxq is used in conjunction with faxgetty no modems need
to be specified using faxmodem.
If modems are specified however; faxq will
just treat the modems as ready for use until it receives more up to date
information from the faxgetty processes.


<A NAME="Inbound">.P<HR WIDTH=65% ALIGN=right>
.H3 "Setting up Inbound Service"


To setup HylaFAX for inbound fax or data service a
modem configuration file must be setup and
a faxgetty program must be started to listen for input on the tty device.
The configuration file setup is usually done at the same time
that outbound service is configured; i.e.  when \fIfaxaddmodem\fP is run.
A faxgetty server for the modem should be setup to be run by the
<A HREF="@CGIPATH@/manpage?1+init">init(1M)
process according to local system conventions.
For System V-based systems this is done by editing the
\fB/etc/inittab\fP file to spawn faxgetty on the appropriate port.
For example, if a modem is to be started on \fB/dev/ttyf2\fP the
following line might be appropriate:

.Ls B\f(CW
<PRE>t2:23:respawn:/usr/local/sbin/faxgetty ttyf2</PRE>
\fP.Le

For systems that use a BSD-style setup the following line might
be appropriate for the \fB/etc/ttyab\fP file.

.Ls B\f(CW
<PRE>cua0	"/usr/local/sbin/faxgetty /dev/cua0"	dialup	on</PRE>
\fP.Le

Note that faxgetty may be run on a modem port whether or not it is
to provide inbound service.
By setting the \f(CWRingsBeforeAnswer\fP configuration parameter to zero,
faxgetty will not answer an
incoming phone call unless it is explicitly commanded to by the
<A HREF="@CGIPATH@/manpage?1+faxanswer">faxanswer(1M)
program.
This may be desirable if a phone line is used, for example,
as the primary line for voice calls.

.P
In general it is desirable to run faxgetty because
faxgetty informs the HylaFAX scheduler process whenever
modems are in use and because it identifies modems' capabilities
(passing them on to the scheduler so that it can make informed
scheduling decisions).
faxgetty also includes support for
screening calls based on
caller-ID information (consult the section
``<A HREF=setup-advanced.html#CallerID>Caller-ID Support'')
and for automatically routing calls based
on distinctive ring when these services are provided by the local PTT
(consult the section
``<A HREF=setup-advanced.html#DistinctiveRing>Distinctive Ring Support'') .
For this additional functionality, and
because faxgetty does a reliable job of reseting and configuring
recalcitrant modems, it may even be desirable to run faxgetty on
non-fax modems.

.P
The following sections discuss HylaFAX support for
servicing particular types of inbound calls.

<A NAME="Fax">.P<HR WIDTH=25% ALIGN=center>
.H4 "Facsimile Service"


In normal operation HylaFAX's faxgetty process
will automatically answer inbound phone
calls and receive fax.
Received fax are written to files in the \fBrecvq\fP directory
in the spooling area on the server machine.
Facsimile data is stored as a TIFF Class F (TIFF/F) file and
protected according to the \f(CWRecvFileMode\fP configuration parameter
specified in the modem configuration file.
The \f(CWRecvDataFormat\fP configuration parameter can be used to
control the encoding of data stored in these files; consult the
section on
``<A HREF=setup-advanced.html#Transcoding>Transcoding of Received Facsimile''
for more information on this facility.
The maximum number of pages that will be received in a single
call can also be controlled with the \f(CWMaxRecvPages\fP
configuration parameter.
Finally, HylaFAX provides an access control list mechanism for
restricting recived fax according to the TSI
string passed as part of the fax protocol;
consult the section on
``<A HREF="setup-advanced.html#QualifyTSI">Rejecting Junk Facsimile''
for more information.

<A NAME="Data">.P<HR WIDTH=25% ALIGN=center>
.H4 "Data Service"


By default HylaFAX does not enable support for inbound data calls.
Data service is not enabled so that naive users do not accidentally
setup inbound access to their system before proper password controls
are in place.
To enable inbound data service the modem configuration file must
be setup to accept data calls and to invoke the normal system
getty program to process the incoming call.
Normally this involves enabling the use of
\fIadaptive-answer\fP functionality
and the setup of the \f(CWGettyArgs\fP parameter
in the configuration file.

.P
Adaptive answer is the ability for a modem to determine
whether an incoming phone call is for data, fax, or voice use.
If a modem supports a good adaptive-answering facility
then it should be enabled with the \f(CWModemSetupAACmd\fP
and the faxgetty process will automatically service fax, data, or voice
calls <EM>as identified by the modem</EM>.
Most Class 2 and Class 2.0 modems provide adaptive-answer support
that distinguishes data calls from fax calls
and the prototype configuration files that come with HylaFAX
automatically enable it if it is provided by the modem.
Most Class 1 modems do not provide adaptive-answer support, but
HylaFAX provides adaptive-answer support in the server.
Consult the section on
``<A HREF="setup-advanced.html#AdaptiveAnswer">Adaptive Answer Support''
in the next chapter for help on configuring adaptive-answer support.

.P
Setting up the \f(CWGettyArgs\fP parameter requires an
understanding of how to automatically startup the system getty program.
HylaFAX will invoke the getty program when a data call is
recognized and set up the standard input, output, and error
descriptors to point to the appropriate tty device.
The getty program should not reopen or reinitialize the modem
before doing its work.
Some getty programs are incapable of this and are unsuitable
for use with HylaFAX.
The parameters passed to the getty program must also identify the
speed to use to communicate with the local modem.
Some getty programs want to automatically detect this rate based
on the \f(CWCONNECT\fP message that a modem sends to the host
when a connection is established; these programs are unsuitable for use
with HylaFAX.
A getty program used with HylaFAX must be able to handle a fixed speed
for host-modem communication, with the speed specified on the command line.

.P
For System V-style getty programs the appropriate parameters
are typically of the form:

.Ls B\f(CW
GettyArgs:	"-h %l dx_%s"
\fP.Le

where the \f(CW-h\fP parameter instructs getty to not hangup the
device first, the \f(CW%l\fP parameter is translated to the
device name (``the tty line''), and the \f(CWdx_%s\fP parameter
identifies the \fB/etc/gettydefs\fP entry to use (\f(CW%s\fP
is translated by HylaFAX to the speed used to communicate with
the modem).   Note that the exact parameters to supply depend
on the getty program used; consult local documentation to understand
what options should be used.

.P
For BSD-style systems, \f(CWGettyArgs\fP is usually of the form:

.Ls B\f(CW
GettyArgs:	"std.%s -"
\fP.Le

where \f(CWstd.%s\fP refers to an entry in the \fB/etc/gettytab\fP
file for a fixed speed port; e.g.

.Ls B\f(CW
g|std.19200|19200-bps:sp#19200:<BR>
h|std.38400|38400-bps:sp#38400:<BR>
\fP.Le

(Note that as before, the ``\f(CW%s\fP'' is replaced by the speed
for host-modem communication.)

<A NAME="HFaxd">.P<HR WIDTH=65% ALIGN=right>
.H2 "Setting up Client Access"


HylaFAX client applications such as sendfax do not communicate directly
with server processes such as faxq or faxgetty.
Instead they communicate with the 
<A HREF="@CGIPATH@/manpage?1+hfaxd">hfaxd(1M)
client-server protocol process.
This architecture insulates client applications from the internal
structure of a server machine, provides a more robust operating
environment, and scales better for many clients.

.P
hfaxd is normally started up when the \fIfaxsetup\fP program is run.
\fIfaxsetup\fP also arranges for hfaxd to be
automatically started up each time a server machine is booted;
either \fIstandalone\fP
by a script invoked by the init process or \fIindirectly\fP
by the inetd process.
The preferred way to run hfaxd is in a standalone mode as this
gives optimal performance.

.P
When hfaxd is started the command line arguments specify which of
several client-server protocols it should offer.
hfaxd currently has support for three protocols:

.Ls B
.LI
the Version 4.0 HylaFAX client-server protocol,
.LI
the old HylaFAX client-server protocol used in versions prior to 4.0, and
.LI
the Simple Network Pager Protocol (SNPP) that is used to submit
    alpha-numeric text pager requests.
.Le

When operating in a standalone fashion the command line
options specify the protocols to support
and the ports at which service should be provided.
For example, to startup hfaxd in a standalone mode supporting all three
protocols the following might be used:

.Ls B<LISTING>
# \fB/usr/local/sbin/hfaxd -i 4559 -o 4557 -s 444\fP
</LISTING>.Le

This specifies that the Version 4.0 protocol is to be offered at
port 4559, the old protocol at port 4557, and SNPP at port 444.

.P
It is also possible to have the inetd program startup hfaxd.
In this case only a single protocol can be requested since inetd
advertises service and establishes the network connection.
For example, the following entry might be used in the \fBinetd.conf\fP
file to startup hfaxd to service SNPP requests:

.Ls B<LISTING>
snpp	stream	tcp	nowait	fax	/usr/local/sbin/hfaxd	hfaxd -S -d
</LISTING>.Le

The \f(CW-S\fP option specifies that hfaxd should service SNPP
requests using the standard input and output descriptors and the
\f(CW-d\fP option keeps hfaxd from detaching itself from the
controlling tty.

.P
It is possible to run hfaxd in a standalone mode as well
as indirectly from inetd so long as this is done for
separate protocols.
Doing this however is of questionable value since it is much more
efficient for a single standalone hfaxd process to support multiple
protocols than to have multiple unrelated hfaxd processes.

.P
<TABLE BORDER=0>
<TR>
<TD><IMG SRC=icons/warning_icon.gif HSPACE=8></TD>
<TD><EM>Beware that hfaxd must either be started up by the super-user
or be installed setuid-root for proper operation.</EM></TD>
</TR>
</TABLE>

.P
Besides arranging for hfaxd to get started up when a server machine
is booted, it is necessary
to specify which client machines and users can have access to a HylaFAX
server machine.
This is specified by the contents of the \fBetc/hosts\fP file in
the HylaFAX spooling area on the server machine.
The contents of this file is specified in the
<A HREF="@CGIPATH@/manpage?4+hosts">hosts(4F)
manual page.
The default \fBetc/hosts\fP file that comes with HylaFAX permits anyone
to have access through the \fIlocalhost\fP network interface; i.e.  the
hosts file contains:

.Ls B\f(CW
<PRE>localhost
127.0.0.1</PRE>
\fP.Le

It is a good idea to refine the controls specified in this file before
providing general access to the server.
Access can be restricted both on a per-client-machine basis and
by user.
Passwords can also be required though support for this is presently
somewhat awkward.

.P
<TABLE BORDER=0>
<TR>
<TD><IMG SRC=icons/warning_icon.gif HSPACE=8></TD>
<TD><EM>The \fBetc/hosts\fP file must be owned by the fax user and
be mode 0600 or hfaxd will not permit client access.</EM></TD>
</TR>
</TABLE>

<A NAME="Cron">.P<HR WIDTH=65% ALIGN=right>
.H3 "Setting up Periodic Maintenance Work"


HylaFAX comes with two programs that need to be run periodically on the
server machine: 
<A HREF="@CGIPATH@/manpage?1+faxqclean">faxqclean(1M)
and
<A HREF="@CGIPATH@/manpage?1+faxcron">faxcron(1M).

.P
The faxqclean
program is responsible for removing old
document and job description
files from the spooling area on a server.
These files are created when outbound jobs are created but are removed
in a delayed fashion to permit clients to resubmit jobs without
retransmitting all the information to the server and to allow imaged
documents to be reused in unrelated fax transmissions.
faxqclean is also responsible for \fIarchiving\fP outbound jobs that
have completed.

.P
<TABLE BORDER=0>
<TR>
<TD><IMG SRC=icons/warning_icon.gif HSPACE=8></TD>
<TD><EM>The faxqclean program in version 4.0 does not support
job archiving; but consult the manual page to verify this
(in case someone has done some local improvements).</EM></TD>
</TR>
</TABLE>

.P
faxqclean must be run by the super-user.
A sample entry for the cron program that runs faxqclean
once each hour might be:

.Ls B<LISTING>
0   *    *    *    *	/usr/local/sbin/faxqclean
</LISTING>.Le

The second program that should be routinely run on each server machine is
faxcron.
This is a script that does maintenance such as truncating log files
and purging old session logs and received fax.
faxcron needs to be run by the fax user once a day or so and it is
a good idea to capture its output since it includes information
about failed phone calls that might warrant investigation.
A sample cron entry to run faxcron might be:

.Ls B<LISTING>
25   23    *    *    *	sh /usr/local/sbin/faxcron | mail FaxMaster
</LISTING>.Le


<A NAME="Problems">.P<HR WIDTH=65% ALIGN=right>
.H3 "Modem Configuration Issues"


Beware that when faxgetty processes control a modem they
may leave the modem in a state suitable for sending and receiving fax.
That is, they may leave the modem running in Class 1, Class 2, or Class 2.0.
This may have implications for data communication programs such as
\fItip\fP,
\fIcu\fP,
and \fIuucp\fP.   For example, it may be
necessary to force the modem into Class 0 (for data communication) when
placing a call:

.Ls B\f(CW
<PRE>AT+FCLASS=0DT&lt;\fIphone number\fP&gt;</PRE>
\fP.Le

Exactly how things work depends on the contents of the
modem configuration file.   It is usually a good idea to
setup the configuration parameters so that the modem is
left idling in Class 0 (for data use) when HylaFAX is not
actively using a modem.
Note however that this may not always be possible as some modems
require that a modem idle in Class 2 or 2.0
when doing adaptive answer.

.P
<TABLE BORDER=0>
<TR>
<TD><IMG SRC="icons/warning_icon.gif" HSPACE=4></TD>
<TD><EM>Note that when HylaFAX places an outbound fax call it
automatically forces the modem into Class 1, 2, or 2.0
<STRONG>before</STRONG> issuing \f(CWModemDialCmd\fP.
Thus the old FlexFAX trick of changing the class in the
\f(CWModemDialCmd\fP parameter should not be used.</EM></TD>
</TR>
</TABLE>

<A NAME="Guidance">.P<HR WIDTH=65% ALIGN=right>
.H2 "System-specific Guidance"


This section contains some setup-related issues that are
dependent on the operating system installed on the target machine.
The information included here is by no means exhaustive; it reflects
feedback from users accumulated over multiple HylaFAX versions
and/or operating system releases.

<A NAME="IRIX">.P<HR WIDTH=65% ALIGN=right>
.H3 "IRIX Guidance"


On Silicon Graphics Indigo and Indy machines
you can not use a Macintosh modem cable to connect your modem
to the DIN-8 connector on the back of your host.
A Macintosh cable uses a special wiring pattern to pass
the RTS and CTS signals between the host and modem.
This wiring is not compatible with the wiring used on SGI machines.
While it may appear that the the modem and cable work,
hardware flow control will not function properly and
data will eventually be lost.   Consult the
<A HREF="@CGIPATH@/manpage?7+serial">serial(7)
manual page for an explanation of how to wire up modem cables.

.P
The tty device that is used must reflect whether
hardware or software flow control is to be used.
Under IRIX, modem devices (i.e.  those that monitor DCD) come
in two flavors: \f(CWttyf*\fP
devices support RTS/CTS flow control while \f(CWttym*\fP
devices support XON/XOFF flow control.
If you want to use hardware flow control to communicate with your
modem you should use a \f(CWttyf*\fP device, otherwise use a
\f(CWttym*\fP device.
If you fail to use the correct device you may still get the
correct flow control (because later versions of IRIX actually
permit flow control to be switched irrespective of the device
used), but you are likely to collide with other modem users such
as cu, uucp, ppp, and slip that still use the old-style device names
(so UUCP lock files may be created for a different name than the
one HylaFAX is using).

.P
<TABLE BORDER=0>
<TR>
<TD><IMG SRC="icons/warning_icon.gif" HSPACE=4></TD>
<TD><EM>USR modems work under IRIX 5.x 
only when patch 475 or a successor is installed
and \f(CWClocalAsRoot\fP is set to \f(CWYes\fP
in the modem configuration file</EM>.</TD>
</TR>
</TABLE>

.P
Versions of IRIX prior to 6.2 have a bug in the
device driver for the on-board serial ports on several systems
that causes RTS/CTS flow control to be turned off as a
side effect of setting the \f(CWCLOCAL\fP flag on the associated
tty device.
Patch 475 (``RTS/CTS flow control busted when \f(CWCLOCAL\fP is set'')
and its successors correct
this problem and must be installed to use HylaFAX with RTS/CTS flow control
(install the appropriate successor to patch 475).
Also, when this patch is installed the
\f(CWClocalAsRoot\fP modem configuration parameter must be set
to \f(CWYes\fP for proper operation
(see
<A HREF="@CGIPATH@/manpage?4+config">config(4F) for a detailed
explanation of what this parameter does).
If you do not have the appropriate patch installed on your system
then you will either see flow control-related problems when transmitting
fax or possibly some other problems related to modems dropping
DCD when carrier is lost.

.P
<TABLE BORDER=0>
<TR>
<TD><IMG SRC="icons/warning_icon.gif" HSPACE=4></TD>
<TD><EM>
The DPS-based PostScript imager program distributed with HylaFAX
is available only in COFF format.
Because IRIX 6.2 does not support COFF executables this program cannot
be used with HylaFAX.
A Ghostscript-based RIP should be used under IRIX 6.2</EM>.
</TD>
</TR>
</TABLE>

.P
The font metric files required by client applications are contained
in the \fBdps_eoe.sw.dpsfonts\fP image that is part of
the standard IRIX distribution.

<A NAME="SCO">.P<HR WIDTH=65% ALIGN=right>
.H3 "SCO Guidance"


The standard SCO serial I/O driver (SIO) does nothing with modem control
lines if \f(CWCLOCAL\fP is set on the tty device.
The usual workaround is to use the FAS driver instead.

<A NAME="Solaris">.P<HR WIDTH=65% ALIGN=right>
.H3 "Solaris Guidance"


.P
Versions of Solaris prior to 2.5 require a patch to
correct the handling of RTS/CTS flow control with serial ports
built around the Zilog ZS8530 chip.

.P
Some versions of Solaris (2.3 is known to do this) silently
truncate or discard syslog messages longer than about 120 characters.

.P
Use the \fB/dev/cua/*\fP devices and not the \fB/dev/term/*\fP
devices.

.P
When using \fIttymon\fP to service inbound data calls set the
\f(CWGettyArgs\fP parameter to something like the following:

.Ls B\f(CW
<PRE>GettyArgs: "-g -h -d /dev/cua/a -l 38400 -m ldterm,ttcompat"</PRE>
\fP.Le

.P
<TABLE BORDER=0>
<TR>
<TD><IMG SRC="icons/warning_icon.gif" ALT="NOTE: " HSPACE=8></TD>
<TD><EM>Be certain you are not running a ttymon with sac when using HylaFAX.
Disable all ports that are to be used by HylaFAX
with admintool or \fIpmadm\fP(1m).</EM></TD>
</TR>
</TABLE>

<A NAME="SunOS">.P<HR WIDTH=65% ALIGN=right>
.H3 "SunOS Guidance"


.P
Versions of SunOS prior to 4.1.4 require a patch to
correct the handling of RTS/CTS flow control with serial ports
built around the Zilog ZS8530 chip.
These patches are available at:

.Ls B
.LI
<A HREF="ftp://sunsolve1.sun.com/pub/patches/100513-05.tar.Z">ftp://sunsolve1.sun.com/pub/patches/100513-05.tar.Z for SunOS 4.1.[123], and
.LI
<A HREF="ftp://sunsolve1.sun.com/pub/patches/100621-04.tar.Z">ftp://sunsolve1.sun.com/pub/patches/101621-04.tar.Z for SunOS 4.1.3_U1.
.Le

(choose the one appropriate to the system you are running).

<A NAME="SVR4">.P<HR WIDTH=65% ALIGN=right>
.H3 "SVR4 Guidance"


.P
The following \fBGettyArgs:\fP configuration parameter is
suitable for many SVR4-based systems:

.Ls B\f(CW
<PRE>GettyArgs:	"-g -h -t 60 -l ff_%s"</PRE>
\fP.Le

Be sure entries for different bit rates are defined in the
\fB/etc/ttydefs\fP file.

<A NAME="Ultrix">.P<HR WIDTH=65% ALIGN=right>
.H3 "Ultrix Guidance"


[\fIEd: this information is old.\fP]<BR>

.P
Hardware flow control does not work in HylaFAX Version 3.0,
modems must be configured
to use software flow control.

.P
Serial ports are conventionally called \fBtty00\fP, \fBtty01\fP,
etc; see <A HREF="@CGIPATH@/manpage?8+MAKEDEV">MAKEDEV(8)
if you need to create devices.

<!\(emFOOTER\(em>

.P
<TABLE BORDER=0 WIDTH=100%>
<TR>
<TD><A HREF="setup-advanced.html"><IMG SRC="icons/next.gif">
Advanced server configuration.</TD>
<TD><A HREF="toc.html"><IMG SRC="icons/back.gif">
HylaFAX table of contents.</TD>
</TR>
</TABLE>

<HR>

<ADDRESS>
<A HREF="sam.html">Sam Leffler / <A HREF="mailto:sam@engr.sgi.com">sam@engr.sgi.com.
Last updated $Date: 1996/08/23 20:47:36 $.
</ADDRESS>

</BODY>
</HTML>
