efax - send/receive faxes using Class 1 or 2 fax modems

[ ] [ | ]


Where _o_p_t_i_o_n_s are:

use the fax modem  connected  to  device  _d_e_v.   The  default  is
/dev/fax.


use option _o_p_t to accommodate a non-standard fax modem  protocol.
See  the  MODEM REQUIREMENTS section below for more details.  The
_o_p_tions are:

    1 Use Class 1 fax modem  commands.   The  modem  must  suport
Class 1 commands.  The default is to use Class 2 commands.

    a use software adaptive answer method.  If the first  attempt
to answer the call does not result in a data connection within 20
seconds the phone is hung up temporarily and  answered  again  in
fax mode (see "Accepting both fax and data calls" below).

    e ignore errors in modem initialization commands.  If  errors
are already being ignored, pay attention to them again.

    r reverse bit order during data reception.  Most  modems  re-
quire this option.

    x send XON (DC1) instead of DC2 to start data reception.  Ap-
plies to Class 2 only.

    z delay an additional 100 milliseconds before each modem ini-
tialization  or  reset command.  The initial delay is 100 ms. For
example, -ozzz produces a 400 ms delay.


send the command AT_s_t_r to the modem to initialize  it.   Multiple
-i may options be used.

send the command AT_s_t_r to the modem to reset it when done.   Mul-
tiple -z may options be used.

set the local capabilities to _c_a_p_s.  See the section on capabili-
ties  below  for  the format and meaning of _c_a_p_s.  The default is
1,3,0,2,0,0,0,0. For Class 2 operation this  option  must  appear
after the modem initialization (-i) option that enables fax mode.

set the local identification string to _i_d.  _i_d should be the  lo-
cal telephone number in international format (for example "+1 800
555 1212").  This option must appear after the modem  initializa-
tion (-i) option that enables fax mode.

select types of messages to be printed.  Each  _l_o_w_e_r-_c_a_s_e  letter
in _s_t_r_n_g enables one type of message:

e - errors
w - warnings
i - session progress information
n - capability negotiation information
c - modem (AT) commands and responses
h - HDLC frame data (Class 1 only)
m - modem output
a - program arguments
r - reception error details


The default is "ewin".

use UUCP-style lock file _l_k_f to  lock  the  modem  device  before
opening  it.   If  the  device  is  locked,  efax checks every 15
seconds until it is free.  Up to 16 -x options  may  be  used  if
there are several names for the same device.  A `#' prefix on the
file name creates an HDB-style (text) lock file.

remove lock file(s) after initializing the  modem.   This  allows
outgoing  calls  to proceed.  When efax detects modem activity it
will attempt to re-lock the device.  If the modem is  now  locked
by  another  program  efax will exit and return 1 (``busy'').  If
efax is run again (e.g. by init) it will then wait until the line
becomes free.

don't issue an answer (ATA) command before starting to receive  a
fax.  Use this option when the modem is set to auto-answer (using
S0=_n) or if another program has already answered the call.

if a CONNECT (or DATA) response indicates a data call, the  shell
/bin/sh  is  exec(2)'ed  with  _c_m_d  as  its  command.   _c_m_d  is a
printf(3) format that may contain up to 6 %d  escapes  which  are
replaced  by the baud rate following the most recent CONNECT mes-
sage. _c_m_d typically exec's getty(8).

ask for page retransmission if more than _n errors  detected,  De-
fault is 10.


answer phone and receive a fax.  Each fax page  is  stored  in  a
separate  file.   The  file  name  is  created  using  _p_a_t  as  a
strftime(3) format string.  A page number of the form .001, .002,
 ... is appended to the file name.  If _p_a_t is blank (""),  a  de-
fault  string of "%m%d%H%M%S" is used.  If a file already exists,
efax terminates with an error message.

dial telephone number _n_u_m and send the fax image  files  _f_i_l_e....
The  telephone  number  _n_u_m is a string that may contain any dial
modifiers that the modem supports, for example, a  T  prefix  for
tone dialing or commas for delays.


Each page is stored in a separate file.  The images are coded ac-
cording  to the ITU-T (CCITT) Group 3 fax standard, T.4.  The EX-
AMPLES section below shows how Ghostscript and the PBMPlus utili-
ties can be used to create and print these files.


The operating system must provide short response times  to  avoid
protocol  timeouts.   When  using Class 1 modems the program must
respond to certain events (DCS frame or end of  data)  within  55
milliseconds.   For  Class 2 modems the delay should not exceed 1
or 2 seconds.

The operating  system  must  also  provide  sufficient  low-level
buffering  to allow uninterrupted transfer of data from the modem
to a disk file at the selected baud  rate,  typically  9600  bps.
Since  the  fax protocol does not provide end-to-end flow control
the effectiveness of flow control while receiving is  limited  by
the  size of the modem's buffer. This can be less than 100 bytes.
Efax does not use flow control during reception.


"Group" describes the protocol used to send faxes over the  tele-
phone network.  Efax suports the universal Group 3 standard.  The
"Class" is the protocol used between a computer and a fax  modem.
Efax supports Class 1 and 2 (but not 2.0) fax modems.

Most modems (including those based on Rockwell  or  Sierra  chip-
sets)  reverse  the bit order (MSB to LSB) on receive.  This will
cause errors when trying to display or print the received  files.
The  -or  option  should  be specified when receiving faxes using
these modems.

While all fax modems support XON/XOFF flow control, most have un-
reliable  hardware  (RTS/CTS)  flow  control  in fax mode.  Since
XON/XOFF flow control adds very little overhead in fax mode, efax
does not support hardware flow control.

While some modems have serial buffers of  about  1k  bytes,  many
inexpensive  modems  have  buffers of about one hundred bytes and
are thus more likely to suffer overruns when receiving data.

Some modems may need a delay between commands of  more  than  the
default  value  used by efax (100 milliseconds).  If the delay is
too short, commands may not echo properly, may time out,  or  may
give  inconsistent responses.  Use one or more -oz options to in-
crease the delay between modem initialization commands.

Class 1 modems should not be used on systems that cannot  guaran-
tee  that  the program will respond to incoming data in less than
55 milliseconds.  Longer delays may cause  the  fax  protocol  to
fail  in  certain  places (between DCS and TCF or between RTC and
MPS).

By default efax sends DC2 to start the data flow from  the  modem
when receiving faxes from Class 2 modems.  A few older modems re-
quire XON instead.  Use of DC2 would cause the modem to  give  an
error  message  and/or  the  program to time out.  The -ox option
should be used in this case.

A few older Class 2 modems don't send DC2 or  XON  to  start  the
data  flow  to  the  modem  when  sending faxes.  After waiting 2
seconds efax will print a warning and start sending anyways.

The following modems have been reported to work with  efax:  AT&T
DataPort,  ATT/Paradyne,  Boca  modem, Cardinal Digital Fax Modem
(14400) (Class 1), Crosslink 9614FH faxmodem, FuryCard DNE  5005,
Intel  14.4  fax  modem,  MultiTech 1432MU, Practical Peripherals
PM14400FXMT, Supra V32bis, Supra Faxmodem 144LC (Class 1),  Tele-
bit Worldblazer, Twincom 144/DFi, Vobis Fax-Modem (BZT-approved),
Zoom VFX14.4V (Class 1 and 2), ZyXEL U-1496E[+].



Modem initialization commands are supplied as command-line  argu-
ments.

The modem must be set up to  issue  verbose(text)  result  codes.
The following command does this:

respond to commands with verbose result codes

The following commands may be useful in some cases:

don't wait for dial tone before dialing.  This  may  be  used  to
send  a  fax  when the call has already been dialed manually.  In
this case use an empty string ("") as the first argument  to  the
-t command.  Use X4 (usual default) to enable all result codes.

leave the monitor speaker turned on for the duration of the  call
(use M0 to leave it off).

turn monitor speaker volume to minimum (use L3 for maximum).

returns the modem to command mode when DTR is dropped.  The  pro-
gram drops DTR at the start and end of the call if it can't get a
response to a reset (ATZ) command.  &D3 resets the modem when DTR
is dropped.

wait up to two minutes (120 seconds) for carrier.   This  may  be
useful  if  the  answering fax machine takes a long time to start
the handshaking operation (e.g. a combined fax/answering  machine
with a long announcement).

The following initialization command be used with Class 1 modems:

enables Class 1 fax modem commands.

The following  initialization  commands  be  used  with  Class  2
modems:

enables Class 2 fax modem commands.

enable Class 2 fax reception.


The capabilities of the local hardware and software are set using
a string of 8 digits separated by commas:


where:

0 for 98 lines per inch
1 for 196 lpi

0 for 2400 bps
1 for 4800
2 for 7200
3 for 9600
4 for 12000 (V.17)
5 for 14400 (V.17)

0 for 8.5
1 for 10
2 for 12

0 for 11
1 for 14
2 for unlimited page length

0 for 1-D coding
1 for 2-D coding (not supported)

0 for no error correction

0 for no binary file transfer

0 for zero delay per line
1 for 5 ms per line
3 for 10 ms per line
5 for 20 ms per line
7 for 40 ms per line

It is important that the proper capability string be specified.

When _r_e_c_e_i_v_i_n_g a fax the _v_r, _w_d, _l_n and _d_f fields of the capabil-
ity  string should be set to the maximum values that your display
software supports.

When _s_e_n_d_i_n_g a fax the _v_r, _w_d, _l_n and _d_f fields of the capability
string  should  correspond  to the format of the image files.  If
necessary, efax will convert  a  file  in  high  resolution  mode
(_v_r=1)  to low resolution (_v_r=0) by sending alternate scan lines.
However, if the receiving machine does not  support  any  of  the
other format values then the fax files must be created again in a
compatible format and another call made.  Most fax  machines  can
receive _v_r=0 or 1 and _l_n up to 2.  Few machines support values of
_w_d or _d_f other than 0.



A session log is written to the standard error stream.  This  log
gives  status  and error messages from the program as selected by
the -v option. A time stamp showing the time (or just minutes and
seconds)  is printed after each message if more than 1 second has
elapsed since the last time stamp.


The program returns an error code as follows:

0 The fax was successfully sent or received.

1 The dialed number was busy or the modem device was in use.  Try
again later.

2 Something failed (e.g. file not found or disk full). Don't  re-
try.  Check the session log for more details.

3 Modem protocol error.  The program did not receive the expected
response  from  the  modem.  The modem may not have been properly
initialized, the correct -o options were not used, or a  bug  re-
port may be in order.  Check the session log for more details.

4 The modem is not responding.  Operator attention  is  required.
Check  that  the  modem is turned on and connected to the correct
port.

5 The program was terminated by a signal.



Ghostscript's and drivers can be used to generate  fax  files  in
Group  3 (T.4) format from postscript files if the 32-byte header
is removed.  For example, the command:

gs -q -sDEVICE=dfaxhigh -dNOPAUSE \
        -sOutputFile=letter.%03d letter.ps </dev/null

will convert the Postscript file into high-resolution  (_v_r=1)  G3
fax  image files letter.001, letter.002, ...  The header can then
be removed with the command:

dd if=_i_n_f_i_l_e of=_o_u_t_f_i_l_e _b_s=_3_2 _s_k_i_p=_1


_T_h_e _P_o_r_t_a_b_l_e _B_i_t _M_a_p (_p_b_m) _s_u_i_t_e _c_a_n  _a_l_s_o  _b_e  _u_s_e_d  _t_o  _c_o_n_v_e_r_t
_b_e_t_w_e_e_n _G_r_o_u_p _3 _a_n_d _m_a_n_y _o_t_h_e_r _i_m_a_g_e _f_o_r_m_a_t_s.  _F_o_r _e_x_a_m_p_l_e, _a _r_e_-
_c_e_i_v_e_d _i_m_a_g_e _f_i_l_e, reply.001, _m_a_y _b_e _p_r_i_n_t_e_d _o_n  _a_n  _H_P  _L_a_s_e_r_j_e_t
(_a_t _a_p_p_r_o_x_i_m_a_t_e_l_y _2/_3 _s_i_z_e) _b_y _u_s_i_n_g _t_h_e _c_o_m_m_a_n_d:

_g_3_t_o_p_b_m _r_e_p_l_y._0_0_1 | _p_b_m_t_o_l_j -_r_e_s_o_l_u_t_i_o_n _3_0_0 | _l_p_r


The following command will dial the number  222-2222  using  tone
dialing  and  send  a  two-page fax from the files letter.001 and
letter.002 using the  Class  1  fax  modem  connected  to  device
/dev/fax.   The  sending  modem  will  attempt to negotiate high-
resolution (_v_r=1, 196 lpi).

efax -i "+FCLASS=1" -o1 -c1 \
     -tT222-2222 letter.001 letter.002

_I_f _t_h_e _f_i_l_e_s _w_e_r_e _g_e_n_e_r_a_t_e_d _a_t _h_i_g_h _r_e_s_o_l_u_t_i_o_n (_1_9_6 _l_p_i) _a_n_d  _t_h_e
_r_e_c_e_i_v_i_n_g  _m_o_d_e_m _d_o_e_s _n_o_t _s_u_p_p_o_r_t _i_t, _e_v_e_r_y _s_e_c_o_n_d _s_c_a_n _l_i_n_e _w_i_l_l
_b_e _s_k_i_p_p_e_d _i_n _o_r_d_e_r _t_o _r_e_d_u_c_e _t_h_e _r_e_s_o_l_u_t_i_o_n.


_Y_o_u _c_a_n _u_s_e _e_f_a_x _t_o _a_n_s_w_e_r _t_h_e _p_h_o_n_e _i_m_m_e_d_i_a_t_e_l_y  _a_n_d  _s_t_a_r_t  _f_a_x
_r_e_c_e_p_t_i_o_n.  _U_s_e _t_h_i_s _m_o_d_e _i_f _y_o_u _n_e_e_d _t_o _a_n_s_w_e_r _c_a_l_l_s _m_a_n_u_a_l_l_y _t_o
_s_e_e _i_f _t_h_e_y _a_r_e _f_a_x _o_r _v_o_i_c_e.

_F_o_r _e_x_a_m_p_l_e, _t_h_e _f_o_l_l_o_w_i_n_g _c_o_m_m_a_n_d _w_i_l_l  _m_a_k_e  _t_h_e  _C_l_a_s_s  _2  _f_a_x
_m_o_d_e_m  _o_n  _d_e_v_i_c_e  /dev/ttyS1 _a_n_s_w_e_r _t_h_e _p_h_o_n_e _a_n_d _a_t_t_e_m_p_t _t_o _r_e_-
_c_e_i_v_e _a _f_a_x.  _T_h_e _r_e_c_e_i_v_e_d _f_a_x _w_i_l_l _b_e _s_t_o_r_e_d _i_n  _t_h_e  _f_i_l_e_s  re-
ply.001, reply.002, _a_n_d _s_o _o_n.  _T_h_e _m_o_d_e_m _w_i_l_l _i_d_e_n_t_i_f_y _i_t_s_e_l_f _a_s
(_8_0_0) _5_5_5-_1_2_1_2 _a_n_d  _r_e_c_e_i_v_e  _f_a_x_e_s  _a_t  _h_i_g_h  _o_r  _l_o_w  _r_e_s_o_l_u_t_i_o_n
(_v_r=_1),   _a_t  _u_p  _t_o  _9_6_0_0  _b_p_s  (_b_r=_3),  _f_o_r  _l_e_t_t_e_r-_s_i_z_e  _p_a_p_e_r
(_w_d,_l_n=_0).   _T_h_e  tee  _c_o_m_m_a_n_d  _c_a_u_s_e_s  _t_h_e  _s_e_s_s_i_o_n  _l_o_g  _t_o  _b_e
_d_i_s_p_l_a_y_e_d _a_s _w_e_l_l _a_s _b_e_i_n_g _s_a_v_e_d _i_n _t_h_e _f_i_l_e reply.log.

_e_f_a_x -_d /_d_e_v/_t_t_y_S_1 -_i "+_F_C_L_A_S_S=_2;+_F_C_R=_1" \
   -_l "(_8_0_0) _5_5_5 _1_2_1_2" -_c _1,_3,_0,_0,_0,_0,_0,_0 \
   -_r _r_e_p_l_y _2>&_1 | _t_e_e _r_e_p_l_y._l_o_g


The -w option makes efax wait for characters to become  available
from  the modem (indicating an incoming call) before starting fax
reception.  Use the -w option and a -iS0=_n option to  answer  the
phone  after  _n  rings.   The  example  below will make the modem
answer incoming calls in fax mode on the fourth ring and save the
received  faxes  using files names corresponding to the reception
date and time.

efax -d /dev/ttyb -or -i"+FCLASS=2;+FCR=1" \
   -iS0=4 -w -r "" 2>&1 >> fax.in.log


_T_h_e _m_o_d_e_m _d_e_v_i_c_e _c_a_n _b_e _s_h_a_r_e_d _b_y _p_r_o_g_r_a_m_s _t_h_a_t _u_s_e _t_h_e _U_U_C_P _d_e_v_-
_i_c_e _l_o_c_k_i_n_g _p_r_o_t_o_c_o_l (_k_e_r_m_i_t, _u_u_c_i_c_o, _e_f_a_x, _c_u, _e_t_c.).

_e_f_a_x _w_i_l_l _l_o_c_k _t_h_e _m_o_d_e_m _d_e_v_i_c_e _b_e_f_o_r_e _o_p_e_n_i_n_g _i_t _i_f _o_n_e _o_r  _m_o_r_e
_U_U_C_P  _l_o_c_k  _f_i_l_e  _n_a_m_e_s _a_r_e _g_i_v_e_n _w_i_t_h -x _o_p_t_i_o_n_s.  _T_h_e _l_o_c_k _f_i_l_e
_n_a_m_e_s _a_r_e _t_y_p_i_c_a_l_l_y /usr/spool/uucp/LCK.._d_e_v  _w_h_e_r_e  _d_e_v  _i_s  _t_h_e
_n_a_m_e  _o_f  _t_h_e  _d_e_v_i_c_e  _f_i_l_e  _i_n  _t_h_e /_d_e_v _d_i_r_e_c_t_o_r_y _t_h_a_t _i_s _t_o _b_e
_l_o_c_k_e_d.

_I_f _t_h_e -s (_s_h_a_r_e) _o_p_t_i_o_n _i_s _u_s_e_d, _t_h_e _l_o_c_k _f_i_l_e _i_s _r_e_m_o_v_e_d  _w_h_i_l_e
_w_a_i_t_i_n_g  _f_o_r  _i_n_c_o_m_i_n_g  _c_a_l_l_s  _s_o _o_t_h_e_r _p_r_o_g_r_a_m_s _c_a_n _u_s_e _t_h_e _s_a_m_e
_d_e_v_i_c_e.

_I_f _e_f_a_x _d_e_t_e_c_t_s _a_n_o_t_h_e_r _p_r_o_g_r_a_m _u_s_i_n_g _t_h_e _m_o_d_e_m _w_h_i_l_e _i_t _i_s _w_a_i_t_-
_i_n_g _t_o _r_e_c_e_i_v_e _a _f_a_x, _e_f_a_x _e_x_i_t_s _w_i_t_h _a _t_e_r_m_i_n_a_t_i_o_n _c_o_d_e _o_f _1.  _A
_s_u_b_s_e_q_u_e_n_t _e_f_a_x _p_r_o_c_e_s_s _u_s_i_n_g _t_h_i_s _d_e_v_i_c_e  _w_i_l_l  _w_a_i_t  _u_n_t_i_l  _t_h_e
_o_t_h_e_r  _p_r_o_g_r_a_m  _i_s  _f_i_n_i_s_h_e_d _b_e_f_o_r_e _r_e-_i_n_i_t_i_a_l_i_z_i_n_g _t_h_e _m_o_d_e_m _a_n_d
_s_t_a_r_t_i_n_g _t_o _w_a_i_t _f_o_r _i_n_c_o_m_i_n_g _c_a_l_l_s _a_g_a_i_n.


_M_a_n_y _m_o_d_e_m_s _h_a_v_e _a_n _a_d_a_p_t_i_v_e _d_a_t_a/_f_a_x _a_n_s_w_e_r _m_o_d_e _t_h_a_t _c_a_n _b_e _e_n_-
_a_b_l_e_d  _u_s_i_n_g _t_h_e -i+FAE=1 (_f_o_r _C_l_a_s_s _1) _o_r -i+FAA=1 (_f_o_r _C_l_a_s_s _2)
_i_n_i_t_i_a_l_i_z_a_t_i_o_n _s_t_r_i_n_g.  _T_h_e _t_y_p_e _o_f _c_a_l_l (_d_a_t_a _o_r _f_a_x)  _c_a_n  _t_h_e_n
_b_e _d_e_d_u_c_e_d _f_r_o_m _t_h_e _m_o_d_e_m'_s _r_e_s_p_o_n_s_e_s.

_S_o_m_e _m_o_d_e_m_s _h_a_v_e _l_i_m_i_t_e_d  _a_d_a_p_t_i_v_e  _a_n_s_w_e_r  _f_e_a_t_u_r_e_s  (_e._g.  _o_n_l_y
_w_o_r_k_i_n_g  _p_r_o_p_e_r_l_y  _a_t  _c_e_r_t_a_i_n  _b_a_u_d _r_a_t_e_s _o_r _o_n_l_y _i_n _C_l_a_s_s _2) _o_r
_n_o_n_e  _a_t  _a_l_l.   _I_n  _t_h_i_s  _c_a_s_e  _u_s_e  _t_h_e  _i_n_i_t_i_a_l_i_z_a_t_i_o_n  _s_t_r_i_n_g
-i+FCLASS=0  _t_o _a_n_s_w_e_r _i_n _d_a_t_a _m_o_d_e _f_i_r_s_t _a_n_d _t_h_e -oa _o_p_t_i_o_n _t_h_e_n
_h_a_n_g _u_p _a_n_d _t_r_y _a_g_a_i_n _i_n _f_a_x _m_o_d_e _i_f _t_h_e _t_h_e _f_i_r_s_t _a_n_s_w_e_r _a_t_t_e_m_p_t
_w_a_s  _n_o_t  _s_u_c_c_e_s_s_f_u_l.   _T_h_i_s  _m_e_t_h_o_d _o_n_l_y _w_o_r_k_s _i_f _y_o_u_r _t_e_l_e_p_h_o_n_e
_s_y_s_t_e_m _w_a_i_t_s _a _f_e_w _s_e_c_o_n_d_s _a_f_t_e_r _y_o_u _h_a_n_g _u_p _b_e_f_o_r_e _d_i_s_c_o_n_n_e_c_t_i_n_g
_i_n_c_o_m_i_n_g _c_a_l_l_s.

_I_f _t_h_e -g _o_p_t_i_o_n _i_s _u_s_e_d, _t_h_e _o_p_t_i_o_n'_s _a_r_g_u_m_e_n_t _w_i_l_l _b_e _r_u_n _a_s  _a
_s_h_e_l_l  _c_o_m_m_a_n_d _w_h_e_n _a_n _i_n_c_o_m_i_n_g _d_a_t_a _c_a_l_l _i_s _d_e_t_e_c_t_e_d.  _T_y_p_i_c_a_l_l_y
_t_h_i_s _c_o_m_m_a_n_d _w_i_l_l _e_x_e_c getty(_8).  _T_h_i_s _p_r_o_g_r_a_m _s_h_o_u_l_d  _e_x_p_e_c_t  _t_o
_f_i_n_d  _t_h_e  _m_o_d_e_m  _a_l_r_e_a_d_y  _o_f_f-_h_o_o_k _a_n_d _a _l_o_c_k _f_i_l_e _p_r_e_s_e_n_t _s_o _i_t
_s_h_o_u_l_d _n_o_t _t_r_y _t_o _h_a_n_g _u_p _t_h_e _l_i_n_e _o_r _c_r_e_a_t_e _a _l_o_c_k _f_i_l_e.

_T_h_e _f_o_l_l_o_w_i_n_g _c_o_m_m_a_n_d _w_i_l_l _m_a_k_e _e_f_a_x  _a_n_s_w_e_r  _i_n_c_o_m_i_n_g  _c_a_l_l_s  _o_n
/dev/cua1  _o_n  _t_h_e _s_e_c_o_n_d _r_i_n_g.  _T_h_i_s _d_e_v_i_c_e _w_i_l_l _b_e _l_o_c_k_e_d _u_s_i_n_g
_t_w_o _d_i_f_f_e_r_e_n_t _l_o_c_k _f_i_l_e_s _b_u_t _t_h_e_s_e _l_o_c_k  _f_i_l_e_s  _w_i_l_l  _b_e  _r_e_m_o_v_e_d
_w_h_i_l_e _w_a_i_t_i_n_g _f_o_r _i_n_c_o_m_i_n_g _c_a_l_l_s (-s).  _I_f _a _d_a_t_a _c_a_l_l _i_s _d_e_t_e_c_t_-
_e_d, _t_h_e getty _p_r_o_g_r_a_m _w_i_l_l _b_e  _r_u_n  _t_o  _i_n_i_t_i_a_l_i_z_e  _t_h_e  _t_e_r_m_i_n_a_l
_d_r_i_v_e_r  _a_n_d _s_t_a_r_t _a login(_1) _p_r_o_c_e_s_s.  _R_e_c_e_i_v_e_d _f_a_x _f_i_l_e_s _w_i_l_l _b_e
_s_t_o_r_e_d   _u_s_i_n_g   _n_a_m_e_s   _l_i_k_e    Dec02-12.32.33.001,    _i_n    _t_h_e
/usr/spool/fax/incoming  _d_i_r_e_c_t_o_r_y  _a_n_d  _t_h_e _l_o_g _f_i_l_e _w_i_l_l _b_e _a_p_-
_p_e_n_d_e_d _t_o /usr/spool/fax/faxlog.cua1.

_e_f_a_x -_d /_d_e_v/_c_u_a_1 -_o_r \
   -_i '+_F_C_L_A_S_S=_2;+_F_C_R=_1;+_F_A_A=_1' \
   -_x /_u_s_r/_s_p_o_o_l/_u_u_c_p/_L_C_K.._c_u_a_1 \
   -_x /_u_s_r/_s_p_o_o_l/_u_u_c_p/_L_C_K.._t_t_y_S_1 \
   -_g "_e_x_e_c /_s_b_i_n/_g_e_t_t_y -_h /_d_e_v/_c_u_a_1 %_d" \
   -_i_S_0=_2 -_w -_s \
   -_r "/_u_s_r/_s_p_o_o_l/_f_a_x/_i_n_c_o_m_i_n_g/%_b%_d-%_H.%_I.%_S" \
   >> /_u_s_r/_s_p_o_o_l/_f_a_x/_f_a_x_l_o_g._c_u_a_1 _2>&_1

Note that adaptive answer of either type is unreliable.  Some fax
modems  mistake  the  initial data-mode answering tones for a fax
machine's answering (CED) tone.  In some cases  the  duration  of
the  initial data-mode answer (set by TO_DATAF in efax.c) may not
be long enough for incoming data calls to be set  up.   In  other
cases it may be too long for incoming fax calls.  If you need re-
liable fax reception you should use a modem or other device  that
can detect incoming faxes using the fax calling (CNG) tones.


efax can answer all incoming calls if you place an entry for efax
in  /etc/inittab (for SysV-like systems) or /etc/ttytab (for BSD-
like systems). The init(8) process will run a new  copy  of  efax
when  the  system boots up and whenever the previous process ter-
minates.  The inittab or ttytab entry should invoke efax by  run-
ning the fax script with an answer argument.

For example, placing the following line in /etc/inittab will make
init  run the fax script with argument answer every time previous
process terminates (and init is in runlevel 4 or 5).

s1:45:respawn:/bin/sh /usr/bin/fax answer

In this case the fax script should be protected against tampering
since  init  will  execute it as a privileged (root) process.  If
you will also be allowing data calls  via  getty  and  login  you
should  ensure  that  your system is reasonably secure (e.g. that
all user id's have secure passwords).


Double check the configuration setup in the fax script.

Run the "fax test" script and check that the modem is  responding
to commands.

If efax hangs when trying to open  the  modem  device  (typically
ttyX),  the  device  is  either already in use by another process
(e.g. getty) or it requires the carrier detect line  to  be  true
before it can be opened.  Many systems define an alternate device
name for the same physical device (typically cuaX)  that  can  be
opened  even  if carrier is not present or other programs are al-
ready using it.

If modem responses are being lost or generated at random, another
processes  (e.g.  getty)  may be trying to use the same device at
the same time.  Using  lock  files  (-x  options)  can  sometimes
resolve this problem.

Check the response to the "AT+FCLASS=?" command to make sure your
modem supports the Class (1 or 2) that you have selected.

Attempt to send a fax. Check that the  modem  starts  making  CNG
tones  (a  0.5  second tone every 3 seconds) as soon as it's fin-
ished dialing.  This shows the modem is in  fax  mode.   You  may
need  to  enable  the  monitor  speaker  (add  -iM2L3 to the INIT
string) to monitor the phone line.

Listen to the answering fax machine and check that it sends  a  2
second  beep  (CED)  followed  by DIS HDLC frames (the "warbling"
signal) every 3 seconds.  If you hear a continuous signal instead
(tones or noise), then you've connected to a data modem instead.

Your modem should now send back  a  DCS  frame  followed  by  1.5
seconds of training check data.  If everything is OK, the receiv-
ing end will send a CFR frame and your modem will start  to  send
data.   If  you  have  a  modem  with a flow control (FC) LED, it
should start to blink.

When the transmission completes, check the  message  showing  the
line count and the average bit rate.

Low line counts (under 1000 for letter size image) or the warning
"fax  output  buffer  overflow" indicate that the image format is
probably incorrect. Possibly the bit order is reversed.

If the average bit rate is much higher than  the  negotiated  bit
rate  (e.g. 15000 bps for a 9600bps connection) then flow control
was not active.  This usually results in a garbled  transmission.
The receiving machine may reject the page, abort the call or hang
up.

An <XOFF> message appearing during the  transmission  means  that
the  operating  system  was ignoring the modem's XON/XOFF charac-
ters.  This is sometimes caused by compiling efax  with  an  out-
of-date "termios.h" include file.

Most modems enable XON/XOFF flow control when  fax  mode  is  en-
abled.   Check  the  output  of the fax test command for the flow
control settings in fax mode (typically &K4 or Q1).  If they  are
incorrect  you can use additional -i commands to enable flow con-
trol after the +FCLASS= command.

Check that the remote machine confirms reception with an  +FTPS:1
response (Class 2) or an MCF frame (Class 1).

The error message "abnormal call termination (code _n_n)" indicates
that  the  modem detected an error (in Class 2 mode) and hung up.
The modem's manual may give an explanation for the  error  number
_n_n.

Many companies advertise services that will fax back  information
on  their  products.   These can be useful for testing fax recep-
tion.

Finally, don't play "option bingo,"  if  you  can't  resolve  the
problem,  save the output of the fax test command to a file (e.g.
fax test >test.out) and send it along with the log of the  failed
session to the address below.

If efax should display the  message  "can't  happen  (<details>)"
please send a bug report to the author.


Efax was written by Ed Casas.  Please send comments  or  bug  re-
ports to edc@ee.ubc.ca.  Please mention the operating system, the
type of the modem used and include a copy of any relevant session
logs.


efax is copyright 1993, 1994 Ed Casas.  It may  be  used,  copied
and modified under the terms of the GNU Public License.


Although efax has been  tested  it  may  have  errors  that  will
prevent  it from working correctly on your system.  Some of these
errors may cause serious problems  including  loss  of  data  and
interruptions to telephone service.




Class 1 operation may fail if the program can't respond within 55
milliseconds.

May fail if multitasking delays cause the received data to  over-
flow  the  computer's  serial device buffer or if an under-run of
transmitted data exceeds 5 seconds.

Does not handle 2-D coded images, documents with pages  of  mixed
formats or procedure interrupts.

Can't read TIFF-F files.


















