   This is the online documentation for the mgetty + sendfax package.

   Copyright (C) 1993-1997 Gert Doering

mgetty, incoming fax call
-------------------------

   This is a log file of a fax call I got today. It was a fax call with
14400 bps (actually, the call came from another faxmodem, but you won't
see that in the log file), using high resolution. One page was
received, the connection time was 33 seconds. No errors occured.

   (All the stuff up to "waiting..." is identical to the example above,
so I don't list it again)

     [...]
     03/03 21:39:32  waiting...
     03/03 21:46:22  waiting for ``RING'' ** found **
     03/03 21:46:22  send: ATA[0d]
     03/03 21:46:22  waiting for ``CONNECT''
     03/03 21:46:32  found action string: ``+FCON''
     03/03 21:46:32  action is A_FAX, start fax receiver...
     03/03 21:46:32  fax_wait_for(OK)
     03/03 21:46:36  fax_id: '+FTSI:+31 20 6147110       '
     03/03 21:46:36  transmission par.: '+FDCS:1,5,0,2,0,0,0,0'** found **
     03/03 21:46:36  fax_command: send 'AT+FDR'
     03/03 21:46:36  fax_wait_for(CONNECT)
     03/03 21:46:37  fax_id: '+FTSI:+31 20 6147110       '
     03/03 21:46:37  transmission par.: '+FDCS:1,5,0,2,0,0,0,0'** found **
     03/03 21:46:38  fax_get_page_data: receiving /usr/spool/fax/incoming/ffd764c9e4d-+31-20-6147110.01...
     03/03 21:46:51  fax_get_page_data: page end, bytes received: 24933
     03/03 21:46:51  fax_wait_for(OK)
     03/03 21:46:51  page status: +FPTS:1** found **
     03/03 21:46:53  fax_wait_for(CONNECT)
     03/03 21:46:55  connection hangup: '+FHNG:000'** found **
     03/03 21:46:56 ##### fax dev=tty4d, pid=4807, caller=none, name='', id='+31 20 6147110       ', +FHNG=000, pages=1, time=00:00:33

mgetty, logging into syslog
---------------------------

   If your system has a `syslogd' and the `syslog()' C function, mgetty
can send parts of its log files to the `syslog' (For details, see
comments in `policy.h'). Not all the information from the log file is
logged here (to avoid clobbering the syslog), just errors and so-called
"audit" messages (seen in the log file as lines with "####" at the
beginning). These have a fixed format, and could easily be parsed by a
program. Let me list a few, and then comment them.

     Mar  3 18:36:16 greenie mgetty[673]: failed A_FAIL dev=tty4d, pid=673, caller=none, conn='', name=''
     Mar  3 18:41:56 greenie mgetty[1866]: fax dev=tty4d, pid=1866, caller=none, name='', id='49 89 3243328        ', +FHNG=100, pages=1, time=00:00:29
     Mar  3 21:46:56 greenie mgetty[4807]: fax dev=tty4d, pid=4807, caller=none, name='', id='+31 20 6147110       ', +FHNG=000, pages=1, time=00:00:33
     Mar  3 20:45:59 greenie mgetty[4038]: data dev=tty4d, pid=4038, caller=none, conn='38400/V.32  9600/MNP5', name='', cmd='/bin/login', user='mbox'
     Mar  3 22:41:43 greenie mgetty[6470]: data dev=tty4c, pid=6470, caller=none, conn='38400/ZyX  16800/V42b', name='', cmd='/usr/lib/uucp/uucico', user='Uartinet'

   Those five lines are one failed call, two fax calls, one of them
failed and one successful, and two data calls, one of a human caller,
loggin into the BBS system, and one of a calling uucico.

   It looks very confusing until you understand the system behind it.
The first fields specify date and time, originating host (greenie is my
machine) and program (mgetty). The next field specifies the type of the
connection made: `fax', `data' or `failed' - the latter one usually
means failure to initialize the modem or failure to connect to a
calling modem, resulting in the well-known `NO CARRIER' message...

   The `dev' and `pid' fields specify the line and process ID of the
mgetty process writing that line.

   The `caller' and `name' fields give caller ID information - if none
is available (as it is here in Germany), or if your modem doesn't
handle it, it will list `none' and `''', respectively.

   For fax calls, additional informations given are the remote station
ID (`id='...''), the hangup code (`+FHNG=...', 0 means "ok"), the
number of pages and the connection time.

   For data calls, the string that the modem returned after `CONNECT' is
listed as `conn='...''. The string that was entered at the login prompt
is listed as `user='...'', and the program that is called to do the
login is given as `cmd='...''. Usually this will be `/bin/login' unless
you have some special system setup for fido or uucp callers - as I have
here, as you can see above.

sendfax, sending a single page
------------------------------

   This is a simple one-page fax that I sent some days ago. Just a
single page, f1.g3, to the phone number 2710834. No errors of any kind
occured.

     02/18 11:10:05  sending fax to 2710834
     02/18 11:10:06  checking f1.g3
     02/18 11:10:06  makelock(tty4c) called
     02/18 11:10:06  do_makelock: lock='/usr/spool/uucp/LCK..tty4c'
     02/18 11:10:06  lock made
     02/18 11:10:06  fax_open_device succeeded, tty4c -> 4
     02/18 11:10:06  fax_command: send 'AT'
     02/18 11:10:06  fax_wait_for(OK)
     02/18 11:10:06  fax_wait_for: string 'AT'
     02/18 11:10:06  fax_wait_for: string 'OK'** found **
     02/18 11:10:06  fax_command: send 'AT+FCLASS=2'
     02/18 11:10:06  fax_wait_for(OK)
     02/18 11:10:06  fax_wait_for: string 'AT+FCLASS=2'
     02/18 11:10:06  fax_wait_for: string 'OK'** found **
     02/18 11:10:06  fax_command: send 'AT+FLID="49 89 3243328"'
     02/18 11:10:06  fax_wait_for(OK)
     02/18 11:10:06  fax_wait_for: string 'AT+FLID="49 89 3243328"'
     02/18 11:10:06  fax_wait_for: string 'OK'** found **
     02/18 11:10:06  fax_command: send 'ATL7M1'
     02/18 11:10:06  fax_wait_for(OK)
     02/18 11:10:06  fax_wait_for: string 'ATL7M1'
     02/18 11:10:06  fax_wait_for: string 'OK'** found **
     02/18 11:10:06  fax_command: send 'AT+FDCC=1,5,0,2,0,0,0,0'
     02/18 11:10:06  fax_wait_for(OK)
     02/18 11:10:06  fax_wait_for: string 'AT+FDCC=1,5,0,2,0,0,0,0'
     02/18 11:10:06  fax_wait_for: string 'OK'** found **
     02/18 11:10:06  fax_command: send 'AT+FBOR=0'
     02/18 11:10:06  fax_wait_for(OK)
     02/18 11:10:06  fax_wait_for: string 'AT+FBOR=0'
     02/18 11:10:06  fax_wait_for: string 'OK'** found **
     02/18 11:10:06  fax_command: send 'AT&H3D2710834'
     02/18 11:10:06  fax_wait_for(OK)
     02/18 11:10:07  fax_wait_for: string 'AT&H3D2710834'
     02/18 11:10:39  fax_wait_for: string '+FCON'
     02/18 11:10:39  fax_wait_for: string '+FNSF:00 00 00 00 '
     02/18 11:10:39  fax_wait_for: string '+FCSI:       49 89 2710834 '
     02/18 11:10:39  fax_id: '+FCSI:       49 89 2710834 '
     02/18 11:10:39  fax_wait_for: string '+FDIS:1,3,0,2,0,0,0,4'
     02/18 11:10:39  fax_wait_for: string 'OK'** found **
     02/18 11:10:39  fax_send_page("f1.g3") started...
     02/18 11:10:39  fax_command: send 'AT+FDT'
     02/18 11:10:39  fax_wait_for(CONNECT)
     02/18 11:10:39  fax_wait_for: string 'AT+FDT'
     02/18 11:10:45  fax_wait_for: string '+FDCS:1,3,0,2,0,0,0,4'
     02/18 11:10:45  transmission par.: '+FDCS:1,3,0,2,0,0,0,4'
     02/18 11:10:45  fax_wait_for: string 'CONNECT'** found **
     02/18 11:10:45  waiting for XON, got:[0a][11]
     02/18 11:10:45  sending f1.g3...
     02/18 11:11:03  sending DLE ETX...
     02/18 11:11:03  fax_wait_for(OK)
     02/18 11:11:16  fax_wait_for: string 'OK'** found **
     02/18 11:11:16  fax_command: send 'AT+FET=2'
     02/18 11:11:16  fax_wait_for(OK)
     02/18 11:11:16  fax_wait_for: string 'AT+FET=2'
     02/18 11:11:25  fax_wait_for: string '+FPTS:1'
     02/18 11:11:25  page status: +FPTS:1
     02/18 11:11:26  fax_wait_for: string '+FHNG:00'
     02/18 11:11:26  connection hangup: '+FHNG:00'
     02/18 11:11:26  (Normal and proper end of connection)
     02/18 11:11:26  fax_wait_for: string 'OK'** found **
     02/18 11:11:26  fax_send: 'AT+FCLASS=0^M'
     02/18 11:11:26  removing lock file

How to get the mentioned software by FTP?
=========================================

   Most of the software mentioned in this document should be available
on most major ftp sites. Nevertheless, I've got so many questions about
the software that I'll list some ftp sites here.

   Furthermore, I'll list some other software that may be interesting
if you plan to use `mgetty+sendfax' in different environments than I do.

   * `mgetty+sendfax'

     The current release can usually be found at:

     sunsite.unc.edu:`/pub/Linux/system/serial/getty/mgetty+sendfax*'

     tsx-11.mit.edu:`/pub/linux/sources/sbin/mgetty+sendfax*'

     ftp.leo.org:`/pub/comp/networking/communication/modem/mgetty/*'

     ftp.mathematik.th-darmstadt.de:`/pub/linux/mirrors/misc/mgetty/*'

     linux.nrao.edu:`/pub/packages/mgetty+sendfax/*'

     ... and on all sites that mirror SunSITE.unc.edu or tsx-11.

     The most recent beta release is always placed in the listed
     directory on ftp.leo.org and its mirrors on th-darmstadt.de and
     linux.nrao.edu.  On SunSITE and TSX-11, you'll only find "stable"
     releases (even version numbers, no date stamp in the file name).

     Use betas on your own risk!

   * `pbmplus'

     I found the pbmplus package (bitmap manipulation tools) at the
     following places (most other sites mirroring X11 should also have
     them):

     src.doc.ic.ak.uk:`/computing/graphics/pbmplus10dec91.tar.Z'

     wuarchive.wustl.edu:`/packages/X11R5/contrib-pub/pbmplus10dec91.tar.Z'

     ftp.germany.eu.net:`/X11/contrib/pbmplus10dec91.tar.Z'

     ftp.leo.org:`/pub/comp/networking/communication/modem/mgetty/'

     The `pbmplus' package has been superceded by the `NetPBM' package
     which has some more conversion tools (but also some more bugs). It
     should be available on the same sites. You could also check:

     wuarchive.wstl.edu:`/graphics/graphics/packages/NetPBM'

     ftp.rahul.net:`/pub/davidsen/source'

     ftp.informatik.uni-oldenburg.de:`/???'

     The `pbmtodot' program mentioned in the "fax" chapter can be found,
     if nowhere else, in the `mgetty' directory on ftp.leo.org (see
     above).

   * `FAS'

     Some sites carrying the `fas' serial driver for SCO Unix, ISC, ...:

     ftp.fu-berlin.de:`/pub/unix/driver/fas/fas-2.11.tar.gz'

     ftp.germany.eu.net:`/pub/newsarchive/comp.sources.unix/volume27/fas-2.11.0/*'

     src.doc.ic.ac.uk:`/usenet/comp.sources.unix/volume27/fas-2.11.0/*'

     As far as I know, the current version is 2.12, but you should find
     2.12 at the same places as 2.11. I never upgraded, 2.11 works very
     fine for me :)

   * `GhostScript'

     The GNU GhostScript postscript interpreter can be found at all
     sites carrying GNU Software. The "main" GNU site is
     *prep.ai.mit.edu*.

     The new version 3.x isn't GNU software anymore, but uses a special
     license. You can find it in `/pub/ghost/aladdin' on
     *ftp.cs.wisc.edu*, and on various other mirror sites (e.g.
     ftp.leo.org).

   * `hp2pbm'

     GhostScript is huge and slow... if you don't need it for other
     purposes, you could use Chris Lewis' hp2pbm package, placed at

     ftp.uunet.ca:`distrib/chris_lewis/hp2pbm/*'

     and on

     ftp.leo.org as `hp2pbm*' (in the mgetty directory mentioned above).

     This package contains all you need to convert ASCII or LJ PCL4 ->
     PBM, G3, PS, X windows, Epson 24 pin. Coupled with mgetty's
     `g32pbm', it's all you need to send ASCII or HP LJ via FAX, and
     display/print FAXes on X, PS, LJ, Epson, or via PBM utilities

     It performs better than most of the equivalent PBMPLUS utilities.
     Indeed, if your application can generate both LJ and PS,
     generating LJ and converting to G3 via `hp2pbm' is *much* faster
     than generating PS and converting via GhostScript.

     [Citing Chris: Incidentally, "g32pbm" plus my "pbm2lj" is much
     faster than g3tolj.  Am not entirely sure why yet.  May have
     something to do with scaling, which g32pbm and pbm2lj don't do.]

   * `psroff'

     ftp.uunet.ca:`/distrib/chris_lewis/psroff3.0pl17/*'

     [Chris: It should be ...psroff/*, but they never answer when I ask
     them to fix my symlink]

     Contains all you need to generate PS, LJ, or ditroff from ditroff
     or CAT troff or groff. Together with hp2pbm, you can generate
     FAXes.  Contains quite a number of LJ fonts, font manipulation,
     and font scaling utilities.

     With the last two tools, you can send, receive, and print FAXes
     using _just_ mgetty and hp2pbm (and a Laserjet printer ;-),
     without needing pbmplus or GhostScript or anything else.

   * `Ifmail'

     Ifmail is Eugene Crosser's FidoNet (tm) compatible mailer + gateway
     software for Unix and Linux. Together with `mgetty', it provides
     the perfect modem solution, allowing incoming Fido calls as well
     as Unix-Login and fax. It can be found on:

     tsx-11.mit.edu:`/pub/linux/sources/usr.bin/ifmail*'

     sunsite.unc.edu:`/pub/Linux/system/Fido/ifmail*'

   * `dialog'

     Dialog is a very nice shell tool to simplify input/output
     functions in shell scripts. All the programs in
     `mgetty/frontends/dialog/' rely on it. It runs on most operating
     systems (except FreeBSD), as long as they have a `curses' library.
     The source can be found on

     sunsite.unc.edu:`/pub/Linux/utils/shell/dialog*'

   * `ps2g3'

     is a small package to integrate `mgetty+sendfax' into the NeXTStep
     operating system. It can be found on ftp.leo.org in the directory
     `/pub/comp/platforms/next/Tools/postscript/ps2g3.s.tar.gz'.

   * `dvips5.47'

     Dvips 5.x and up create a strange kind of postscript that, when
     converted with Ghostscript 3.x, produces Fax files that can not be
     faxed to paper fax machines (modems work fine) because the line
     width isn't exactly 1728 pixels. Dvips 5.47 doesn't do this. It
     can be found on:

     `ftp.leo.org:/pub/comp/networking/communications/modem/mgetty/dvips*'

     `midway.uchicago.edu:pub/tex/dvips/dvips547.tar.Z'

   * `g3vga'

     Is a nice, fast G3 viewer for Linux and SVGALIB (standard console
     mode, no X11). You can find it in `.../apps/graphics/viewers' on
     all mirrors of SunSITE.unc.edu.

How to get the mentioned software by UUCP
=========================================

   For those of you that do not have FTP access: all the software
mentioned in the last section can also be found on the following UUCP
sites:

   * GREENIE (my system): ++49-89-3545988, V32bis/V.34, get
     greenie!~/green.files.gz

   * Nasim (Frank Bartels): ++49-89-5469594, ZyXEL, get
     /pub/ls-lR.nasim.gz

Thanks
******

   Many thanks to (in no special order):

   * Peter Bechtold, peter@fns.greenie.muc.de, for sending me dozens of
     faxes to test mgetty, for calling me back numerous times after
     failed attempts to send him a fax with sendfax, ...

     Further, for the idea to use the remote fax id as part of the
     filename on received faxes.

   * Klaus Weidner, klaus@greenie.muc.de, for the original linux port,
     testing dozens of pre-releases, writing the original texinfo
     documentation, and finally for writing `vgetty'.

   * Lawrence 'dreamer' Chen, lawrence@combdyn.com, for the initial ISC
     port, and for testing the package with a SupraFAX-Modem.

   * Kay Schulz, kschulz@gold.t-informatik.ba-stuttgart.de, for testing
     on ISC -- and telling me that it's possible to ask dozens of
     questions without having ever read the README file ...

   * Georg Edelmann, georg@alpha.saar.de, for testing on Linux, and
     finding some stupid bugs.

   * Uwe S. Fuerst, uwe@phiger.com, for testing on SCO 3.2v4 (and
     helping me a lot nailing down the problem with dial-in/dial-out)

   * Bodo Bauer, bodo@hal.nbg.sub.org, for porting mgetty to SVR4
     (though he did quite confuse me by insisting that the fax receiver
     does not work ...), and later, bodo@suse.de, for his `faxrunqd'
     daemon.

   * Christoph Adomeit, for bugging me long enough to implement XON /
     XOFF flow control in fax sending / receiving, and for lending me
     one of his GVC modems long enough to make faxing (well, fax
     sending) work with it.

   * Christopher M. Ward, for testing on SCO with another GVC modem.

   * Ralf Stephan, for finding a problem in sendfax whith some modems
     that lower CD too soon.

   * John C. Peterson, for correcting a similar problem in mgetty /
     faxrec.

   * Chel van Gennip, for the `pbmscale', `g3toxwd' and `g3tolj'
     programs.

   * Glenn Thobe and Chris Lewis, for doing the 3B1 port(s).

   * Chris Lewis, for doing all the `/etc/gettdefs' stuff, CallerID,
     space limiting, making the source look really awful (K&R C
     support), miscellaneous minor fixes, and tolerating my sometimes
     very unfriendly reactions to his suggestions.

   * Caz Yokoyama, for his suggestions concerning faxspool and the
     mail-to-fax gateway

   * Martin Husemann, for SVR4 testing (damn ESIX) and the NetBSD 386
     port

   * Michael A. Meiszl, mam@mamunx.werries.de, because he asked me to
     (*grin*) - and because he found + changed lots of small,
     nevertheless annoying things.

   * Brent Mosbrook from ZyXEL USA, brentm@zyxel.com, who has been
     *very* helpful solving some ZyXEL-specific and generic fax
     questions.

   * ELSA Computer GmbH, Germany, for giving me an ELSA 28.8 TQV
     voice/fax modem for testing (I had to pay for it, to keep it, but
     the price was far below list price).

   * Sam Leffler, sam@sgi.com, for many interesting discussions and
     insights.

   * Christian Starkjohann, cs@ds1.kph.tuwien.ac.at, for important
     parts of the NeXT port.

   * Geoffrey Collyer and Henry Spencer, for writing the `newslock.c'
     program I use in `faxrunq'.

   * Simone "Neko" Demmel, for going to bed early, giving me time to
     proof read this manual and correct all the nasty bugs.

   * Russel Nelson, nelson@crynwr.com, for hosting the mgetty mailing
     list since December '96.

   * ... and to all others who tested release after release.