home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / BGFAX150.ZIP / BGFXDOCS.ZIP / BGFAX.DOC next >
Encoding:
Text File  |  1995-08-21  |  92.0 KB  |  1,872 lines

  1.  
  2.          DON'T FORGET TO LOOK AT THE "READ.ME" AND "WHATS.NEW" FILES!
  3.  
  4.     =======================================================================
  5.  
  6.               Voice               B.J. Guillot           Data/Fax
  7.          +1 713.893.9320      2611 Rushwood Circle   +1 713.893.9124
  8.                             Houston Texas 77067-1941
  9.  
  10.           Copyright (C) 1993-1995 B.J. Guillot.  All Rights Reserved.
  11.  
  12.     =======================================================================
  13.     BGFAX 1.50                                                THU 17 AUG 95
  14.     =======================================================================
  15.  
  16.                          Dedicated to Gene Roddenberry
  17.                                   1921-1991
  18.  
  19.       "It wasn't a miracle... We just decided to go."
  20.               -- Tom Hanks, playing Jim Lovell in APOLLO 13,
  21.                  referring to the Apollo 11 moon landing.
  22.  
  23.       "Let's make sure history never forgets the name, ENTERPRISE."
  24.               -- Captain Jean-Luc Picard.  Star Trek: The Next Generation.
  25.  
  26.       "...Humans and aliens wrapped in two million, five hundred
  27.       thousand tons of spinning metal, all alone in the night..."
  28.               -- Commander Sinclair.  BABYLON 5.
  29.  
  30.  
  31.          -------------------------------------------------------------
  32.          ABSTRACT
  33.          -------------------------------------------------------------
  34.  
  35.          * Allows sysops to receives faxes on their BBS telephone line
  36.            without needing any additional hardware!
  37.  
  38.          * Everything runs in the foreground, no TSR programs needed
  39.  
  40.          * If you are already running a Fido mailer, you can configure
  41.            your mailer to exit and run BGFAX when the line is hot, thus
  42.            BGFAX does not necessarily have to answer the phone itself
  43.  
  44.          * Comes with a small and quick fax viewing program that supports
  45.            CGA, EGA, VGA, and VESA SVGA display modes as well as options
  46.            for fax printing and FAX-to-PCX conversion; it even can use XMS!
  47.  
  48.          * Works with modems that offer a feature known as adaptive
  49.            answering on Class 1, Class 2, Class 2.0 and ZyXEL fax modems
  50.  
  51.          * Can send faxes via the command line and return status by
  52.            errorlevel; fully configurable top of page headers on outgoing
  53.            faxes so that user names and phone numbers can be added
  54.  
  55.          * Multitasker aware; releases ticks to DesqView and OS/2
  56.  
  57.          * Written in Borland Pascal 7.0... and proud of it!
  58.  
  59.          -------------------------------------------------------------
  60.          INCLUDED FILES
  61.          -------------------------------------------------------------
  62.  
  63.          1.     BGFAX.DOC -- general documentation, looking at it now
  64.  
  65.          2.       READ.ME -- read this
  66.          3.     WHATS.NEW -- release notes
  67.  
  68.          4.     BGFAX.EXE -- the main DOS executable
  69.          5.    BGFAX2.EXE -- the main OS/2 executable
  70.  
  71.          6.      VIEW.EXE -- fax viewing, PCX conversion, and printing
  72.  
  73.          7.      NFAX.COM --\  optional TSR utility to notify the user
  74.          8.    FAXOFF.COM --/  if a fax has been received (DOS ONLY)
  75.  
  76.           9.  MAKEFAX.EXE -- converts PCX and ASCII files to ZFAX format
  77.          10. MAKEFAX2.EXE -- same thing, but for OS/2
  78.          11     BGFAX.FNT -- font file for MAKEFAX and MAKEFAX2
  79.          12.  FNTEDIT.EXE -- font editor to make customized fonts (DOS ONLY)
  80.  
  81.          13.    BGFAX.CNF -- configuration file for /SEND, /HOST, /INIT
  82.          14.     FBBS.BAT -- example batch file for using /HOST mode
  83.  
  84.          15.  FILE_ID.DIZ -- short abstract for bgfax
  85.  
  86.          16. REGISTER.FRM -- registration form
  87.          17.  REGISTER.NL -- dutch registration form for the netherlands
  88.          18. REGISTER.AUS -- australian registration form
  89.  
  90.          Several *.TXT files that describe setting up BGFAX step-by-step
  91.          for various BBS systems, mailers, etc.
  92.  
  93.          -------------------------------------------------------------
  94.          DISCLAIMER
  95.          -------------------------------------------------------------
  96.  
  97.          BGFAX and accompanying files are provided AS IS without any
  98.          warranty, expressed or implied.  This includes without limitation
  99.          the fitfulness for a particular purpose or application and any
  100.          warranties of merchantability.  [Did you really understand that?]
  101.  
  102.          While I tried to be as through as possible in preparing BGFAX,
  103.          B.J. Guillot shall not be liable for any damages, whether direct,
  104.          indirect, special, incidental or consequential arising from a
  105.          failure of this program or accompanying files to operate in a
  106.          manner desired by the user.  B.J. Guillot shall not be liable for
  107.          any damage to data or property which may by caused directly or
  108.          indirectly by use of this program.
  109.  
  110.          In no event will B.J. Guillot be liable to you for any damages,
  111.          including any lost profits, lost savings or other incidental or
  112.          consequential damages arising out of your use or inability to use
  113.          the program, or for any claim by any other party.  Individuals using
  114.          the software bear all risk as to its quality and performance.
  115.   
  116.          -------------------------------------------------------------
  117.          OBTAINING THE LATEST VERSION OF BGFAX:
  118.          -------------------------------------------------------------
  119.  
  120.           FidoNet:  1:106/400                     Voice: +1 713.893.9320
  121.          InterNet: bjg90783@jetson.uh.edu      Data/Fax: +1 713.893.9124
  122.  
  123.          1. Calling my BBS in the United States, +1 713-893-9124
  124.  
  125.          2. Internet...  Telnet/Vmodem: bgfax.com
  126.                                   FTP: ftp.bgfax.com                (ISDN)
  127.                                   FTP: ftp://ftp.csn.net/Computech  (T1)
  128.                         World Wide Web: http://www.bgfax.com
  129.  
  130.          3. FidoNet FREQ of the magic name "BGFAX" from 1:106/400
  131.             (Beta copies are available under magic name "BGBETA")
  132.  
  133.          4. FidoNet FREQ...  The Netherlands...  2:512/39
  134.             The Owl's Nest is the Dutch Supra distributor and they
  135.             have three nodes:
  136.               +31 0.2155.10921   +31 0.2155.12571   +31 0.2155.28096
  137.  
  138.          5. FidoNet FREQ...  Austraila...  3:632/552
  139.             Hamish Moffatt, Cloud Nine, +61 03.886.5195
  140.  
  141.          6. E-mail request for users that do not have FTP access...
  142.             Just send Internet e-mail to "bgfax-request@stat.com"
  143.             (Beta copes are available from bgfax-beta-request@stat.com)
  144.  
  145.          To join the BGFAX mailing list, send Internet e-mail to
  146.          "listserv@stat.com" with the text "subscribe bgfax-list" as the
  147.          first line in your message.
  148.  
  149.          -------------------------------------------------------------
  150.          MISCELLANEOUS NOTES
  151.          -------------------------------------------------------------
  152.  
  153.          BGFAX does not offer printing for 9-pin dot matrix printers.
  154.          Epson LQ 24-pin dot matrix, Canon Bubble Jet, HP Desk Jet and
  155.          Laser Jets are supported.
  156.  
  157.          Modems that I have direct access to:
  158.            SupraFaxModem v.32bis (V1.80-02, Rockwell AC ROM)
  159.            SupraFaxModem 144 Express Plus
  160.            SupraFaxModem 288 V.FC (FLASH firmware, latest version)
  161.            SupraFaxModem 288 V.34 (FLASH firmware, latest version)
  162.            USR Courier V.Everything (FLASH firmware, latest version)
  163.            ZyXEL 2864I ISDN modem (FLASH firmware, currently in beta)
  164.            Hayes Optima 288 V.34 (V3.1 firmware)
  165.            Zoom Voice-Fax-Data Modem v.32bis (old piece of junk firmware)
  166.            SIERRA based 2400 data/9600 fax modem from Computer City
  167.  
  168.          If you wish to put BGFAX in DEBUG mode (where it logs most of the
  169.          strings sent out and in from the modem in a BGFAX.LOG file), you
  170.          must set the following environment variable:
  171.  
  172.               SET FAX=DEBUG
  173.  
  174.    *************************************************************************
  175.    *************************************************************************
  176.  
  177.          Things are going to get VERY confusing from this point on.
  178.  
  179.          If you haven't looked at any of the *.TXT files, well, I hope
  180.          you are feeling lucky...  :-)
  181.  
  182.          The *.TXT files provide step-by-step setup instructions for most
  183.          mailers and BBS software.  What follows is for techno geeks like
  184.          me.  If you don't know that much about modems, you probably will
  185.          not understand any of it.
  186.  
  187.    *************************************************************************
  188.    *************************************************************************
  189.  
  190.          -------------------------------------------------------------
  191.          TALKING WITH THE COM PORT
  192.          -------------------------------------------------------------
  193.  
  194.          Introduction
  195.          ~~~~~~~~~~~~
  196.          If you want BGFAX to answer the phone, you will be using BGFAX
  197.          in /HOST mode.  In this case, BGFAX will get the com port
  198.          information from the BGFAX.CNF file.  To specify COM2, a line
  199.          in that file must read "po=2".
  200.  
  201.          If you are running PC Board, Spitfire, FrontDoor, Intermail or
  202.          any other software that has been designed to interface with
  203.          BGFAX only when the modem detects an incoming fax call, you
  204.          can use BGFAX in rear-end mode.  In this mode, BGFAX gets the
  205.          com port information as a command line parameter.  (BGFAX.CNF
  206.          IS NOT USED IN REAR-END MODE).  To specify the use of COM2 on the
  207.          command line for rear-end mode...
  208.  
  209.                    bgfax /fax c:\bgfax 2 z
  210.  
  211.          The /FAX command line switch is explained in detail later in
  212.          this document as well as the other possible switches that you
  213.          may need to use with your modem.
  214.  
  215.          If BGFAX were running in /HOST mode, the following lines would
  216.          be EQUIVILENT to the "bgfax /fax c:\bgfax 2 z" example...
  217.  
  218.                 BGFAX.CNF    rp=c:\bgfax        { receive path }
  219.          for BGFAX /HOST:    po=2               { com port number, dos }
  220.                              p2=2               { com port number, os2 }
  221.                              ft=z               { fax type, ZFAX 2.23 }
  222.  
  223.          Note that the actual BGFAX.CNF file contains many additional
  224.          lines, and they will be fully explained later in this document.
  225.          The additional lines in BGFAX.CNF are required because /HOST
  226.          mode does much more than rear-end mode.  (/HOST mode has a
  227.          simple event manager, records Caller ID, tells the modem to
  228.          answer the phone, etc.  Rear-end mode simply takes control of
  229.          the modem when your BBS or Fido software tells it to.)
  230.  
  231.          Pop Quiz.  How do I tell BGFAX to use COM1 ?
  232.  
  233.               In /HOST mode, "po=1" is placed in the BGFAX.CNF file.
  234.  
  235.               In rear-end mode, COM1 is specified by putting "1" as the
  236.               THIRD command line parameter.  (bgfax /fax c:\bgfax 1 z).
  237.                                                      1st    2nd  3rd
  238.  
  239.          Putting an exclamation mark (bang) after the port will tell BGFAX
  240.          not to shift the DTE speed to 19200 when receiving a fax.  (i.e.,
  241.          whenever you want to specify COM2, do as "2!" instead of "2").
  242.          This is required on a very small amount of modems.
  243.  
  244.          Non-Standard Ports (under BGFAX/DOS, BGFAX.EXE)
  245.          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  246.          By default, BGFAX knows only the normal four com ports...
  247.  
  248.                    COM1    address 3F8  irq 4
  249.                    COM2    address 2F8  irq 3
  250.                    COM3    address 3E8  irq 4
  251.                    COM4    address 2E8  irq 3
  252.  
  253.          If you are using one of the above standard port configurations,
  254.          you can skip to the next section of the documentation.
  255.  
  256.          However, if you are using a configurable serial card, you will
  257.          need to tell BGFAX the address and IRQ for your non-standard
  258.          port.  If your I/O card has COM4 configured as follows...
  259.  
  260.                    COM4    address 2e8  irq 12
  261.  
  262.          In this case, if you wish to use BGFAX with this non-standard
  263.          port, you must _tell_ BGFAX the address and IRQ.  To do this,
  264.          instead of using "po=4", you will use "po=2e8x12".
  265.  
  266.          Remember that each device in your computer should use a
  267.          different IRQ and address.  IRQ sharing is risky and will cause
  268.          problems under DOS, OS/2 and Windows.
  269.  
  270.          Standard and Non-Standard Ports (under OS/2, BGFAX2.EXE)
  271.          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  272.          Make sure you are using SIO 1.30 or higher.
  273.  
  274.          Under OS/2, in the eyes of BGFAX/2, there isn't a such thing as
  275.          a "non-standard" port.  If you have a COM7 for example, of ANY
  276.          address and IRQ, for /HOST mode, set "p2=7" in the BGFAX.CNF
  277.          file, and for rear-end mode, pass the number "7" as the third
  278.          command line parameter.
  279.  
  280.          How does BGFAX/2 know what address and IRQ to use?  BGFAX/2
  281.          does not have to know.  BGFAX/2 will simply tell Ray Gwinn's
  282.          SIO.SYS to open "COM7", and SIO.SYS will use the information
  283.          you provided in OS/2's CONFIG.SYS to handle the port
  284.          operations.
  285.  
  286.          You will notice that in /HOST mode, I said to use "p2=7".  Is
  287.          that a typo?  Shouldn't it be "po=7"?  Not a typo.  The "p2"
  288.          tells BGFAX that what follows is an OS/2 style port.  Many
  289.          people may want to dual-boot between DOS and OS/2.  Remember,
  290.          under OS/2, we didn't care what address and IRQ COM7 used.
  291.          But, under DOS, BGFAX.EXE will have no idea what port to use if
  292.          you simply had "po=7".  So, we have two lines in the BGFAX.CNF
  293.          for the com port.  One for DOS, and one for OS/2.  Example:
  294.  
  295.                    po=278x12              { for BGFAX.EXE, DOS }
  296.                    p2=7                   { for BGFAX2.EXE, OS/2 }
  297.  
  298.          In this case, our example COM7 actually used base address $278
  299.          and IRQ 12.  Our OS/2 CONFIG.SYS line read...
  300.  
  301.                    DEVICE=C:\SIO.SYS (COM7,278,12,-).
  302.  
  303.          If we were using a standard port, such as COM1, then both
  304.          "po=1" and "p2=1" in BGFAX.CNF.
  305.  
  306.          OS/2 WARNING: Most people that I've talked to "lock" their
  307.          ports using SIO.SYS under OS/2.  Unless you are using a ZyXEL
  308.          modem or USR V.Everything.  If you are using an "average
  309.          Joe" modem like a Supra, if you lock your port at anything
  310.          other than 19200, you will have problems receiving faxes.
  311.  
  312.          For example, let's say you have a Supra (or PPI, or Zoom, etc.)
  313.          and your CONFIG.SYS reads:
  314.  
  315.                    DEVICE=C:\SIO.SYS (COM2:57600,3E8,3,-)
  316.                                           ^^^^^^^
  317.          BGFAX will attempt to receive the fax, but, at a specific point
  318.          during fax receive, the DTE speed _MUST_ be changed to 19200.
  319.          If this change does not occur, the fax receive will not work.
  320.          Since SIO is "locked" in at 57600, SIO will ignore BGFAX/2's
  321.          request for a speed shift.  You have a few options:
  322.  
  323.               1. If you are using a registered version of SIO, you must
  324.                  tell SIO to UNLOCK the port before BGFAX loads.  Example
  325.                  BBS.CMD file:
  326.  
  327.                         @echo off
  328.                         :start
  329.                         OS2BBS.EXE
  330.                         if errorlevel 255 goto fax
  331.                         goto start
  332.                         :fax
  333.                         rem If using a USR or ZyXEL don't worry about SU.EXE
  334.                         SU.EXE 2 LOCK 0
  335.                         BGFAX2.EXE /FAX C:\BGFAX 2 Z
  336.                         SU.EXE 2 LOCK 57600
  337.                         goto start
  338.  
  339.                  (Note, you may have to call BGFAX with a COM handle
  340.                  instead of the COM port number.  Read your OS/2 BBS
  341.                  software documentation for more information.)
  342.  
  343.                  The SU.EXE will only function with registered version
  344.                  of OS/2.  The "2 LOCK 0" means to UNLOCK port 2, so
  345.                  that the application program (BGFAX2.EXE) will be able
  346.                  to change the DTE speed at will.  After BGFAX/2 runs,
  347.                  we issue another SU.EXE line which relocks the port at
  348.                  57600 for your BBS software.
  349.  
  350.                  I've seen many people that really distort my
  351.                  instructions and do "SU 2 LOCK 19200" instead of "SU 2
  352.                  LOCK 0".  The "LOCK 19200" will NOT work, because, as
  353.                  I've said before, the DTE must be shifted at the right
  354.                  moment.  If you do it yourself instead of letting
  355.                  BGFAX2.EXE do it, you will not receive your fax.
  356.  
  357.               2. If you are using an unregistered version of SIO, it's
  358.                  best to lock your port at 19200.  For a 14400 modem, a
  359.                  19200 locked DTE speed is FINE.  If your users
  360.                  download pre-compressed ZIP and ARJ files like both BBS
  361.                  users, they won't even notice the difference.  If you
  362.                  are using a 28800 modem, obviously, locking at 19200 is
  363.                  not an valid solution.
  364.  
  365.               3. If you are using an unregistered SIO, with a 28800
  366.                  modem, you will need to leave the DTE rate at the mercy
  367.                  of your BBS software.  This usually doesn't work out
  368.                  very well.  I suggest you register SIO before
  369.                  attempting to configure BGFAX/2.
  370.  
  371.          If you are running BGFAX.EXE (DOS) under OS/2, there are a few
  372.          other things you need to worry about:
  373.  
  374.               1. If your DOS-based BBS software requires a FOSSIL driver,
  375.                  use VX00.SYS, which is included with SIO.  DO NOT
  376.                  ATTEMPT TO USE THE 'REAL' X00.SYS OR BNU.SYS.  That
  377.                  will cause you nothing but trouble.  (I've gotten some
  378.                  calls saying that the opposite is sometimes true.  Now,
  379.                  I don't know what to think.  :-)
  380.  
  381.               2. If you try to /SEND faxes under OS/2, you _MUST_ use
  382.                  BGFAX2.EXE in an OS/2 box.  The way SIO.SYS handles
  383.                  XON/XOFF communications in a DOS box will prevent the
  384.                  DOS-based BGFAX.EXE from sending faxes properly.  Or,
  385.                  you can use the /HW switch at the end of the BGFAX/DOS
  386.                  command line to use hardware (CTS) flow control.
  387.  
  388.               3. If you are using BGFAX.EXE (DOS) under OS/2, make sure you
  389.                  are using the "DEVICE=C:\VSIO.SYS" line in your CONFIG.SYS.
  390.                  Also, make sure you are using the dash ("-") option on the
  391.                  SIO.SYS command line.
  392.  
  393.                      DEVICE=C:\SIO.SYS (1,,,-) (COM2,3E8,3,-)
  394.                      DEVICE=C:\VSIO.SYS
  395.  
  396.          FOSSIL drivers (under DOS, without DesqView)
  397.          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  398.          It is always best to let BGFAX talk directly to the port, even
  399.          if you have a FOSSIL driver loaded.  BGFAX will not care that
  400.          the FOSSIL driver is loaded.  It will default to talking
  401.          directly to the port.
  402.  
  403.          If for some reason, BGFAX is unable to directly talk to your
  404.          com port using direct communications, you may want to tell
  405.          BGFAX to try and _use_ the FOSSIL driver.  See the next section
  406.          (FOSSIL drivers, under DOS, with DV) for instructions on
  407.          telling BGFAX to _use_ the FOSSIL.
  408.  
  409.          FOSSIL drivers (under DOS, with DesqView)
  410.          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  411.          I have seen many problems that occur when people are using FOSSIL
  412.          drivers under DV.  The problems only seem to occur if you are
  413.          using both FOSSIL and non-FOSSIL applications.  If all your
  414.          applications are FOSSIL, or all non-FOSSIL, things seem to work
  415.          fine.  So, if your BBS or Fido Mailer requires the use of a
  416.          FOSSIL driver, AND YOU ARE RUNNING UNDER DESQVIEW, in this
  417.          case, it is best to tell BGFAX to _use_ the FOSSIL driver.
  418.  
  419.          If you must make BGFAX _use_ the FOSSIL driver, e.g. the FOSSIL
  420.          for COM2, in the BGFAX.CNF file, a "po=F2" would be specified.
  421.          TELLING BGFAX TO _USE_ THE FOSSIL DRIVER IS NOT RECOMMENDED
  422.          UNLESS YOU ARE RUNNING UNDER DESQVIEW AND YOUR BBS PROGRAM,
  423.          FIDO MAILER, AND DOORS ALL REQUIRE THE USE OF A FOSSIL DRIVER.
  424.  
  425.          Many people that use FOSSIL drivers lock their port at a
  426.          specific DTE speed.  This will cause problems with BGFAX.EXE
  427.          since BGFAX must change the port speed at a specific point
  428.          during the fax receive.  You have a few options...
  429.  
  430.               1. Do NOT lock the FOSSIL, and hope that your BBS or Fido
  431.                  Mailer software is correctly able to set the speed.
  432.                  This isn't really that good of an option due to the
  433.                  nature of the FOSSIL drivers and high speed modems.
  434.                  (WE REALLY NEED TO MAKE AN UPDATE TO THE FOSSIL
  435.                  STANDARD SINCE THEY WERE DESIGNED WHEN 19200 WAS
  436.                  CONSIDERED THE FASTEST WE WOULD EVER NEED.)
  437.  
  438.               2. If you are using a 14400 modem, you can lock the port
  439.                  at 19200.  If you are using a 28800 modem however, you
  440.                  have to try option 3...
  441.  
  442.               3. You can use the FOSSIL utility program to manually
  443.                  unlock the port before BGFAX.EXE loads.  Here is an
  444.                  example using X00 and BNU on COM2.  (We refer to the
  445.                  port as "1" since FOSSIL drivers can't count right.)
  446.  
  447.          @echo off                       @echo off
  448.          rem X00 example                 rem BNU example
  449.          :start                          :start
  450.          fosbbs.exe                      fosbbs.exe
  451.          if errorlevel 255 goto fax      if errorlevel 255 goto fax
  452.          goto start                      goto start
  453. -->      XU.EXE LOCK:1:OFF               BNU.EXE /L1=0
  454.          BGFAX.EXE /fax c:\bgfax F2 z    BGFAX.EXE /fax c:\bgfax F2 z
  455. -->      XU.EXE LOCK:1:38400             BNU.EXE /L1=38400
  456.          goto start                      goto start
  457.  
  458.          If you are having trouble when trying to /SEND faxes under DV,
  459.          make sure that "Optimize Communications=YES" in the DV config.
  460.  
  461.          -------------------------------------------------------------
  462.          RECOMMENDED INITIALIZATION AND ANSWER STRINGS
  463.          -------------------------------------------------------------
  464.  
  465.          This section tells you the recommended initialization and answer
  466.          strings for your modem.  It will not tell you what the commands
  467.          do.  Look in the "Quick tutorial" section to find that out.
  468.  
  469.          MAKE SURE YOU ARE _NOT_ USING THE AUTO ANSWER FEATURE OF YOUR
  470.          MODEM.  Auto answer tells the modem to answer (by itself) on X
  471.          number of rings.  We want to be able to send the modem special
  472.          commands when the phone rings, so auto answer will not want to be
  473.          used.  (Auto answer should never be used in a BBS environment,
  474.          anyway.)  Make sure that auto answer is disabled by checking to
  475.          see that the S0 register is set to 0.  (S0=0).
  476.  
  477.          The "pipe", or |, is used at various places in the following
  478.          section.  The | simply means a carriage return is to be sent
  479.          after typing that line.  i.e., if you were in terminal mode,
  480.          "ATZ|" would mean press "A", "T", "Z", then <ENTER>.
  481.  
  482.          The "tilde" or ~, is used by various software to instruct the
  483.          software to "pause" because sending the next command.  This should
  484.          be unneccessary, but some mailers and BBS software are "brain dead"
  485.          and do not wait for an "OK" response from the modem before sending
  486.          the next initiailization string.  "ATZ|~~AT|" would send ATZ to
  487.          the modem, <ENTER>, pause for 2 seconds (or some other period of
  488.          time set by the mailer or BBS software), then send AT, <ENTER>.
  489.  
  490.          If the software is smart, it SHOULD wait for an "OK" to come
  491.          back from the modem before sending the next string.
  492.          Unfortunately, most software I've seen is dumb ("brain dead") and
  493.          tries to rapid-fire the init strings to the modem without
  494.          waiting for an "OK".  :-(
  495.  
  496.          Class 2 modems (Supra v.32bis, PPI, Zoom, etc.)
  497.             Init-1 ... ATZ|
  498.             Init-2 ... AT+FCR=1;+FDCC=1,3,0,2,0,0,0,0|
  499.             Init-3 ... AT+FAA=1;+FLID="713 555 1212"|
  500.             Answer ... ATA|
  501.             Dial ..... ATDT
  502.  
  503.          Class 2.0 modems (USR Courier V.Everything and 28800 Sportsters)
  504.             Init-1 ... ATZ|
  505.             Init-2 ... AT+FCLASS=2.0|
  506.             Init-3 ... AT+FLI="713 555 1212"|
  507.             Answer ... AT+FCLASS=2.0|~AT+FAA=1;+FNR=1,1,1,1;A|
  508.             Dial ..... AT+FCLASS=0DT
  509.  
  510.          Class 1 modems (Hayes Optima 288, Supra 144LC)
  511.             Init-1 ... ATHZ|
  512.             Init-2 ... AT+FCLASS=1|
  513.             Init-3 ... AT+FAE=1|
  514.             Answer ... ATA|
  515.             Dial ..... AT+FCLASS=0DT
  516.  
  517.          ZyXEL modems (ZyXEL E, S, E+, S+, etc.)
  518.  
  519.             Init-1 ... ATZ|
  520.             Init-2 ... AT#P713 555 1212|
  521.             Init-3 ... AT#B1+FCLASS=6|
  522.             Answer ... ATA|
  523.             Dial ..... ATDT|
  524.  
  525.          Note, BGFAX is not brain dead and will not accept "|" and "~"
  526.          modifiers.  BGFAX always sends an <ENTER> at the end of each
  527.          line (that's why you have five in= initialization lines).  The
  528.          BGFAX.CNF file already has good examples.
  529.  
  530.          -------------------------------------------------------------
  531.          QUICK TUTORIAL ON FAX COMMANDS AND ODDITIES
  532.          -------------------------------------------------------------
  533.  
  534.          Skip this section if you do not care about the internal
  535.          workings of fax modems...
  536.  
  537.          AT+FCLASS=?
  538.          ===========
  539.          This command asks the modem to tell you what fax classes it
  540.          is compatible with.  It will respond with something like:
  541.  
  542.      0,1,2 or 0,2 or 0,1,2.0 or 0,2,6 or 0,1,2,6 or 0,2,2.0,6 or ERROR
  543.  
  544.              0 = Data
  545.              1 = Fax Class 1 capable
  546.              2 = Draft Fax Class 2 "compatible" (TR29.2)
  547.            2.0 = Fax Class 2.0 capable
  548.              6 = ZyXEL or Rockwell voice mode compatible
  549.          ERROR = no fax capabilities
  550.  
  551.          GROUP and CLASS
  552.          ===============
  553.  
  554.          Many people are often confused between the terminology "GROUP" and
  555.          "CLASS" with regards fax modems.
  556.  
  557.          ALL FAX EQUIPMENT is "GROUP 3" compatible.  This includes fax
  558.          machines, fax modems, stand-alone PC fax cards, etc.  Group 3 just
  559.          defines the fax specifications, e.g., black-and-white, the
  560.          resolutions, etc.
  561.  
  562.          "CLASS" refers only to fax modems.  CLASS has NOTHING AT ALL to do
  563.          with fax machines.  Class 1, Class 2 and Class 2.0 are different
  564.          methods of sending "AT" COMMANDS to a fax modem from a computer
  565.          serial port.  Many fax modems offer the Class 2 command set.
  566.  
  567.          GROUP III
  568.          =========
  569.  
  570.          Most Group III fax images are 1728 bits across.  A normal
  571.          resolution page is approximately 1100 scan lines long, while
  572.          a high resolution page is approximately 2200 scan lines long.
  573.  
  574.          When the fax devices are handshaking, this occurs at 300 bps,
  575.          regardless of what the negotiated fax DCE rate is (i.e., 9600).
  576.          (This is why on some modems, you will see the HS [high speed]
  577.          light go on and off several times during the fax transfer.)
  578.  
  579.          Computer fax modems use v.17 modulation at 12000 and 14400,
  580.          v.29 at 7200 and 9600, and v.27ter at 2400 and 4800 bps.  The 300
  581.          bps handshaking signals use something called v.21 channel 2.  All
  582.          fax modulations are half duplex (data going only in one direction
  583.          at any given time.)
  584.  
  585.          Fax images can use one or two-dimensional Modified Huffman
  586.          encoding.  One-dimensional is known as MH, and two-dimensional is
  587.          known as MR (Modified Read).  MR encoding sends one scan line,
  588.          followed by special bits that spell out differences between the
  589.          above line and the current line.  This results in generally about
  590.          as 12% compression.  BGFAX's VIEW.EXE program can only view 1D-MH
  591.          faxes at this time, although BGFAX will support receiving and
  592.          saving to disk of both types of compression.  (See T4SPEC.TEC for
  593.          a very detailed description of the 1D-MH compression method.)
  594.  
  595.          Fax images have things known as EOLs and RTC.  EOL stands for
  596.          End-Of-Line and is represented as 000000000001.  Fax viewing
  597.          programs read through the fax image file, scan line by scan line.
  598.          They know where each scan line ends by searching for all the EOLs
  599.          in the file.  RTC, Return-To-Control, is a series of six EOLs.
  600.          The RTC sequence usually indicates an "end of page".  No huffman
  601.          codes start with 11 zeros like the EOL character.  Why am I
  602.          telling you all this?  Because many older fax machines send "fill"
  603.          to your fax modem when receiving.  "Fill" is just extraneous zeros
  604.          that are stored on your hard disk that take up space.  For
  605.          example, you might have an scan line that ends with...
  606.  
  607.               0000000000000000000000000000000000000000000000000000000000001
  608.  
  609.          ...but, all that is actually needed is 000000000001.  As you can
  610.          see, many extraneous zeros could be filtered from this line to
  611.          reduce the size of fax image files a few bytes per scan line.  Fax
  612.          machines like to add all those extra zeros in there.  That's why
  613.          you should notice that fax modem->fax modem facsimile transfer is
  614.          faster than fax modem->fax machine or fax machine->fax modem.
  615.  
  616.          Another interesting Group III fact is that a "training check" is
  617.          performed by fax machines shortly after they connect.  The
  618.          training check consists of the sender sending zeros (nulls) for
  619.          approximately 1.5 seconds (at the negotiated rate, i.e., 9600
  620.          bps).  The receiving end will count all the zeros received, and
  621.          any non-zeros received (bad bits that got corrupted by noise over
  622.          the phone line), and if 10% (or more) of the bytes received were
  623.          bad (non-zero), the receiving end will request a RETRAIN.  This
  624.          usually involves a downshift of 2400 bps, i.e., 9600 -> 7200 bps.
  625.          After the shift, another training check will be performed.
  626.  
  627.          AT+FAA=1
  628.          ========
  629.          This command will put a Class 2/Class 2.0 modem in ADAPTIVE
  630.          ANSWERING mode.
  631.  
  632.          Your modem will properly mate with either a standard modem
  633.          data call or a fax machine/fax modem.  Some modems, such as the
  634.          Supra, will report a "FAX" response the instant a fax CNG tone is
  635.          heard from the remote end.
  636.  
  637.          All modems, on true fax calls, will report a "+FCON" response code
  638.          when the fax connection is truly established.  (This is similar to
  639.          a "CONNECT 9600" or "CONNECT 14400" on a data call.)
  640.  
  641.          Many modems are slightly brain dead and will forget the +FAA
  642.          setting when another command is issued to the modem.  To ensure
  643.          you always answer in adaptive mode, rather than using "ATA" to
  644.          answer the phone, use the following: "AT+FAA=1;A".
  645.  
  646.          The ";", semicolon, is used as a separator for fax commands.  Some
  647.          modems, such as the Supra, do not require it.  Others, such as the
  648.          PPI, will "ERROR" out if the semicolons are not used.
  649.  
  650.          Please note that many modem manufacturers did not test adaptive
  651.          answering as much as they should have before they released their
  652.          modems.  Some modems won't allow low speed callers into your BBS
  653.          when adaptive answering is enabled.  Others won't allow high
  654.          speed callers into your BBS when adaptive answering is enabled.
  655.          If this is happening, you will need to call your modem manufactuer
  656.          and request new ROMs if any are available.  For example, the 14.4K
  657.          PC Logic modem's adaptive answering doesn't work at all.  Even
  658.          well known companies sometimes overlook adaptive answering.  A key
  659.          example is that early version of the USR 21.6K modem would lock up
  660.          whenever an HST call would come into their BBS when adaptive answer
  661.          mode was enabled.
  662.  
  663.          The SupraFaxModem v.32bis, for example, is pretty good concerning
  664.          adaptive answering.  (Note that very earlier versions of the
  665.          Supra, did not offer adaptive answering until the 1.2-H and 1.2-J
  666.          ROMs appeared on the scene.)  However, many older fax machines do
  667.          not send out a CNG tone when they are engaged.  Many fax modems,
  668.          including the Supra, won't know what to do, and will assume the
  669.          old fax machine is really a data caller.  Again, this is not good,
  670.          but its not that much of a problem.  Tell the operator of the old
  671.          fax machine to push their "START" button *IMMEDIATELY* after dialing
  672.          the last digit of the telephone number instead of waiting to hear
  673.          the fax tones on our end like many office people do.
  674.  
  675.          AT+FAE=1
  676.          ========
  677.          This is the Class 1 command to enable adaptive answering.
  678.  
  679.          AT+FCR=1
  680.          ========
  681.          This is a Class 2/2.0 command to give your modem PERMISSION to
  682.          take faxes.  Note that Class 2.0 modems default +FCR=1, so you
  683.          won't need to use this command.
  684.  
  685.          AT+FLID="713 893 9124"
  686.          ======================
  687.          ( The Class 2.0 command is AT+FLI="713 893 9124" )
  688.  
  689.          The above command sets your modems fax ID string.  This is the
  690.          string that is send to the remote end on fax connects.  (It's the
  691.          deal that's printed on the little 'confirmation reports' that many
  692.          fax machines make.)  The fax ID can ONLY BE A MAXIMUM OF *20*
  693.          CHARACTERS.  If you try to stuff more than 20 characters in a fax
  694.          ID string, the modem will respond with an "ERROR".  DO NOT USE
  695.          HIGH-BIT ASCII CHARACTERS IN THIS STRING.  Use only simple
  696.          letters, numbers, and punctuation marks.  (High-bit ASCII
  697.          characters include foreign accented letters, inverted question
  698.          marks, etc.)
  699.  
  700.          Some fax machines will go nuts (hang up on you) if you use
  701.          non-CCITT defined characters in the fax ID field.  The only
  702.          "valid" characters are PLUS, SPACE, and ZERO through NINE.
  703.  
  704.          +1 713 893 9124   <-- Valid
  705.          713 893 9124      <-- Valid
  706.          +1 713.893.9124   <-- Not Defined  (the periods)
  707.          713-893-9124      <-- Not Defined  (the dash)
  708.          MY GREAT BBS      <-- Not Defined  (the letters)
  709.  
  710.          I've never personally seen a fax machine that will hang up on you
  711.          for using any of the above "Not Defined" strings, however, I have
  712.          been told that someone found an old fax machine that did, in fact,
  713.          hang up if you used letters (or dashes) in the ID string.
  714.  
  715.          Class 1 fax modems have their ID set by the fax software.
  716.  
  717.          AT+FDCC=1,3,0,2,0,0,0,0
  718.          =======================
  719.  
  720.          The above command is what the power on defaults to a 9600 fax
  721.          modem are, with one exception.  The first number, 1, allows your
  722.          fax modem to accept high resolution fax documents.  The power on
  723.          default to most modems are to accept only low resolution
  724.          documents.  The second number, 3, allows your fax modem to use fax
  725.          speeds up to 9600 bps.  In the past I would always tell people
  726.          to use 1,5,0,2,0,0,0,0 (where the "5" uses 14400), but I've since
  727.          discovered that a large number of fax modems do not work in 14400
  728.          fax mode very well.  (Most stand-alone fax machines only support
  729.          9600 bps anyway, so it's no real loss to limit your maximum receive
  730.          fax speed to 9600.)
  731.  
  732.          If you issue the above command on a fax modem with an upper limit
  733.          of 9600 on fax transmissions, you will receive an "ERROR" or cause
  734.          the modem to behave odd.  Use this string on a 9600 fax modem:
  735.  
  736.          AT+FDCC=1,3,0,2,0,0,0,0
  737.  
  738.          If you want to activate 2D-MR compression on a 14400 capable fax
  739.          modem, use:
  740.  
  741.          AT+FDCC=1,5,0,2,1,0,0,0
  742.                          ^
  743.          That "1" after the "2" means that you wish to allow 2D-MR
  744.          compression.  As previously mentioned, 2D-MR approximates gets
  745.          about 12% better compression than the more familiar 1D-MH.  If you
  746.          tell your modem to allow 2D-MR compression, it should be noted
  747.          that you will not lose any compatibility.  Enabling 2D-MR allows
  748.          for both receiving in standard 1D-MH mode and 2D-MR mode.
  749.          Remember that VIEW.EXE will not yet view 2D-MR faxes.  If you
  750.          decide to use that extra "1", you must use ZFAX to view any
  751.          received 2D faxes!
  752.  
  753.          The remaining numbers are not that important.  Changing them
  754.          around, though, may cause BGFAX to fail.  The command can also be
  755.          abbreviated to "AT+FDCC=1,5" or "AT+FDCC=1,3".
  756.  
  757.          You do not need to use this command on Class 1 and 2.0 modems.  On
  758.          Class 1 modems, if you wish to change these settings, you will
  759.          need to do it via BGFAX's /DIS:nnn command line parameter.
  760.  
  761.          STACKING COMMANDS
  762.          =================
  763.          A single command string can be made using what we need ...
  764.  
  765.          AT+FAA=1;+FCR=1;+FLID="713 893 9124";+FDCC=1,3,0,2,0,0,0,0
  766.  
  767.          However, if you are using BGFAX in rear end mode with a Fido
  768.          mailer, you may have a hard time of making an initialization
  769.          string that long, so you may be required to split the line into a
  770.          few pieces.  Remember to make your ATA command "AT+FAA=1;A" if it
  771.          is possible to change in your mailer.
  772.  
  773.          The +FDCC string must come at the end of the stack of commands!
  774.  
  775.          AT+FMFR?
  776.          ========
  777.          ( The Class 2.0 command is AT+FMI? )
  778.  
  779.          If you want to find out who makes the fax datapump for your modem,
  780.          this command should tell you if you enter it in while in terminal
  781.          mode.  My Supra (and many others) report "ROCKWELL".  My Cheap
  782.          2400 data, 9600 S/R fax modem reports "SIERRA".  Others report
  783.          "EXAR" and other things as well.
  784.  
  785.          AT+FNR=1,1,1,1
  786.          ==============
  787.  
  788.          This is a Class 2.0 command that tells the USR modem to let BGFAX
  789.          know many details about the current fax reception, such as the
  790.          resolution of the fax, what the fax DCE speed is currently
  791.          negotiated at, etc.  Class 2 modems always report this.  However,
  792.          for some strange reason, the Class 2.0 spec writers thought it's
  793.          be "nice" to have the fax program NOT knowing this critical
  794.          information.  I can think of no logically reason for this command
  795.          existing, but if you forget to set it, your faxes on your Class
  796.          2.0 modems may look elongated or smashed together.
  797.  
  798.          AT#B1+FCLASS=6
  799.          ==============
  800.  
  801.          This is a ZyXEL fax command.  This is of use only to ZyXEL owners,
  802.          and the ZyXEL user manual explains it very nicely.
  803.  
  804.          FAX MODE
  805.          ========
  806.  
  807.          99.44% of you will be using BGFAX with a high speed modem (v.32,
  808.          v.32bis, v.34).  Many of you may have started off with slower
  809.          300, 1200, or 2400 modems from long ago.  If you can remember back
  810.          that far, when an incoming data call came in, you would see a
  811.          string like "CONNECT 1200".  If your port was set at 2400, you
  812.          would garbage on the screen unless you shifted your bps rate down
  813.          to 1200 to match that of the caller.  Many newer terminal programs
  814.          refer to this speed shift as "Autobaud".
  815.  
  816.          Modern modems require your serial port be locked at a specific
  817.          speed (such as 19200, 38400, 57600, etc.) so that you can achieve
  818.          higher thruput via compression engines such as MNP and v.42bis.
  819.          The modem-to-modem speed may only be 14400, but the modem-to-
  820.          computer speed stays "locked" at 38400.  Autobaud is not required,
  821.          and if used, would result is garbage on the screen.
  822.  
  823.          Why am I telling you all this?  Well, I don't know who's silly
  824.          idea it was, but the powers that be decided that fax modems should
  825.          use the ancient method of changing the port rate when a fax is
  826.          incoming or outgoing.
  827.  
  828.          After your modem reports the result code "+FCON" all further
  829.          communications *MUST* be done at 19200 bps, even if you are locked
  830.          at 38400 or 57600.  If the port speed is not relocked at 19200,
  831.          nothing but garbage will come on the screen.
  832.  
  833.          I'm telling you this because I frequently get mail asking me why
  834.          I'm changing the port speed to 19200.  It's not my fault!  That's
  835.          the way is has to be done!  The only modem that I know that does
  836.          not require this idiotic speed shift is the ZyXEL modem.  In fact,
  837.          a special option must be used to tell BGFAX you are using a ZyXEL
  838.          or BGFAX will fail as it will try talking to the ZyXEL modem at
  839.          19200 instead of 57600 or whatever rate it's locked at.
  840.  
  841.          Note that the 19200 shift is not needed on Class 2.0 modems.  In
  842.          some cases, a 19200 shift _IS_ required on Class 1 modems.  (i.e.,
  843.          19200 shift is NOT required on a Class 1 Hayes Optima 28800, but
  844.          is required on a Class 1 Hayes Accura 14400).
  845.  
  846.          BIT ORDER
  847.          =========
  848.  
  849.          Class 2 fax modems receive in reverse bit order and transmit in
  850.          direct bit order.  Actually, this is not in the Class 2 spec, but
  851.          a bug in Rockwell's Class 2 implementation.  This reverse bit
  852.          order bug became so wide spread, that other fax modem
  853.          manufacturers now have to receive in reverse bit order to
  854.          make their modems compatible with existing fax software.  :-)
  855.  
  856.          BGFAX will save all incoming fax files in direct bit order, so it
  857.          effectively flips all the bytes on the fly when receiving.  (Unless
  858.          you are telling BGFAX to save faxes in TIFF Class F [Faxworks]
  859.          mode, in which case it stores it in the opposite order.)
  860.  
  861.          Class 1, Class 2.0, and ZyXEL modems receive and transmit in
  862.          direct bit order.  BGFAX will know this and keep the received
  863.          faxes in the correct bit order.
  864.  
  865.          -------------------------------------------------------------
  866.          FRONTEND/HOST MODE
  867.          -------------------------------------------------------------
  868.  
  869.          If you want BGFAX to answer the phone, BGFAX is started up using
  870.          the /HOST command line parameter.
  871.  
  872.          If you plan on using BGFAX in Frontend mode, you need to do a
  873.          couple of things first.
  874.  
  875.          1. An environment variable called BGFAX needs to be inserted in
  876.             your AUTOEXEC.BAT or some other batch file.  Example:
  877.  
  878.             SET BGFAX=C:\BGFAX
  879.  
  880.             This environment variable points to the location of your BGFAX
  881.             configuration file and the directory where faxes will be
  882.             received into.
  883.  
  884.             (Note, some people don't like cluttering their environment with
  885.             variables.  You can start up /HOST mode using a different config
  886.             file other than BGFAX.CNF, by using the "$" modifier, e.g.:
  887.  
  888.               BGFAX /HOST $C:\BAT\ROBIN.CNF
  889.               BGFAX /SEND C:\BGFAX\FAX0001.FAX 893-9124 $C:\BAT\BATGIRL.CNF
  890.  
  891.             The "$" modifier must be the last thing on the command line.
  892.             Instead of looking for a BGFAX.CNF file as specified by the
  893.             BGFAX environment variable, this will cause BGFAX to look for
  894.             a "ROBIN.CNF" (in host mode) or "BATGIRL.CNF" if sending.
  895.             The "$" modifer has NO EFFECT on rear end mode operation.)
  896.  
  897.          2. Make sure the BGFAX.CNF configuration file is in the directory
  898.             pointed to by the BGFAX environment variable and make any
  899.             changes you think necessary.  The included configuration file
  900.             is self explanatory.  I won't repeat the format here.
  901.  
  902.          3. BGFAX can exit with 7 possible internal errorlevels:
  903.  
  904.                6 - host mode idle for more than x minutes
  905.                4 - fax was received
  906.                3 - local logon
  907.                2 - data call
  908.                1 - restart batch file
  909.  
  910.             If no errorlevel is encountered, it means the sysop aborted
  911.             BGFAX by pressing the [Esc] key or a serious error occurred.
  912.  
  913.             Actually, BGFAX can exit with several errorlevels if you setup
  914.             events.  Events are specified in the BGFAX.CNF file (see the
  915.             example file included).  Example:
  916.  
  917.             ev=07:00,192
  918.             ev=19:00,193
  919.  
  920.             That would cause BGFAX to exit with errorlevel 192 at 7:00am
  921.             and errorlevel 193 at 7:00pm.  BGFAX's event handling is very
  922.             crude, and I very much need to change it.  The event handling
  923.             still has several bugs that need to be fixed.  It works best if
  924.             you use a total of two events.  One event doesn't work very
  925.             well, and if you use more (up to 20 are allowed), you can miss
  926.             an event or two if a caller to your BBS overstays their visit.
  927.             BGFAX will always execute the first event that is passed over,
  928.             but won't do any more.  And, if you only have one event setup,
  929.             it will not execute that one if it is missed.  But it will, if
  930.             you set up two events.  You can probably tell I hate events.
  931.             If anyone has some ideas on how to keep track of events and
  932.             execute the ones that are missed, etc., I'd appreciate it.
  933.  
  934.          4. When BGFAX is waiting for a call, pressing Ctrl-R will reset
  935.             the on screen counters.  Ctrl-A will force BGFAX to send the
  936.             answer string to the modem.
  937.  
  938.          5. If you some reason, you want to use the USR Class 2.0 modem in
  939.             Class 1 mode with BGFAX's /HOST mode, you will need to use the
  940.             /ATO switch which will cause BGFAX to send an "ATO" to the
  941.             modem after the "DATA" response is received.
  942.  
  943.          6. When a data call comes in, BGFAX creates a DOBBS.BAT file that
  944.             looks like so...
  945.  
  946.             C:\BGFAX\EXEBBS.BAT 9600 1 528 /ARQ
  947.  
  948.             BGFAX/2 will create DOBBS.CMD: C:\BGFAX\EXEBBS.CMD 9600 5 528 /ARQ
  949.             
  950.             The first parameter is the DCE data speed, then the com port,
  951.             number of minutes until the next event, and then the error
  952.             correcting string, if any.  The EXEBBS.BAT file must be created
  953.             by you so that your bulletin board software is loaded up in
  954.             frontend mode (ie., the data connection is already hot.)
  955.  
  956.                  %1 -> the DCE speed, modem-to-modem real connect speed
  957.                  %2 -> the COM port (BGFAX/2 will put the OS/2 com handle)
  958.                  %3 -> number of minutes until the next event
  959.                  %4 -> error correction/reliable mode indicators
  960.  
  961.          DOBBS.BAT theory
  962.          ================
  963.  
  964.          If you have never used a frontend program uses DOBBS.BAT theory,
  965.          there are several things you need to know.  You have to be pretty
  966.          confident in DOS and batch files, or you will get lost very
  967.          easily.  First, you need a main batch file that runs BGFAX.  Let's
  968.          call this FBBS.BAT:
  969.  
  970.               @echo off
  971.               c:
  972.               cd\bgfax
  973.               bgfax /host
  974.               if errorlevel 4 goto faxrcvd
  975.               if errorlevel 3 goto datacall
  976.               if errorlevel 2 goto datacall
  977.               if errorlevel 1 fbbs.bat
  978.               goto end
  979.               :faxrcvd
  980.                 rem [you can put a printing batch here if you want]
  981.                 call %bgfax%\doprint.bat
  982.                 del %bgfax%\doprint.bat
  983.               :datacall
  984.                 rem [errorlevel 3 is local login, 2 is data caller]
  985.                 %bgfax%\dobbs.bat
  986.               :end
  987.  
  988.  -->     Note that DOS requires all if-errorlevel statements to go in
  989.  -->     DESCENDING ORDER!  (255,254,253,...,4,3,2,1).  This is a fact that
  990.  -->     many people forget.
  991.  
  992.          This FBBS.BAT file will run BGFAX and when a data caller calls
  993.          your system, BGFAX will exit with an errorlevel of 3.  This will
  994.          cause the batch file to jump to the ":datacall" label.  Here, the
  995.          line "%bgfax%\dobbs.bat" is executed, causing DOS to shift control
  996.          of the computer to the DOBBS.BAT file.  Remember, this is a file
  997.          that BGFAX creates!  You do not need to make a DOBBS.BAT file.
  998.          The DOBBS.BAT then executes _another_ batch file called EXEBBS.BAT
  999.          which will look something like:
  1000.  
  1001.               EXEBBS.BAT
  1002.               ==========
  1003.               @echo off
  1004.               bbsprog /f:%1:%2
  1005.               fbbs
  1006.  
  1007.          THE EXEBBS.BAT FILE WILL LOOK DIFFERENT FOR EVERY DIFFERENT
  1008.          TYPE OF BBS SOFTWARE!!!
  1009.  
  1010.          You will have to look up the info for the EXEBBS.BAT file in
  1011.          your BBS user's manual.  I can't help you with that.  Notice
  1012.          that the last line "fbbs" restarts the original FBBS.BAT
  1013.          file that runs BGFAX in /HOST mode.
  1014.  
  1015.          In review: (1) Modify FBBS.BAT to meet your needs, (2) BGFAX will
  1016.          MAKE a DOBBS.BAT file by itself, (3) YOU will need to MAKE an
  1017.          EXEBBS.BAT file, (4) the EXEBBS.BAT file must restart FBBS.BAT.
  1018.  
  1019.          Do not use the CALL statement anywhere unless you really know what
  1020.          you are doing.  "FILE.BAT" and "CALL FILE.BAT" causes two
  1021.          completely different things to happen.  Only experienced DOS/batch
  1022.          file writers need to experiment with that.  Example:
  1023.  
  1024.                TEST.BAT
  1025.                ========
  1026.                echo **TEST**
  1027.  
  1028.                EXAMPLE1.BAT                Example1.BAT output:
  1029.                ===========
  1030.                echo Hello World!             Hello World!
  1031.                call test.bat                 **TEST**
  1032.                echo Bye World!               Bye World!
  1033.                rem ***We RETURNED to the batch file after TEST.BAT
  1034.  
  1035.                EXAMPLE2.BAT                Example2.BAT output:
  1036.                ============
  1037.                echo Hello World!             Hello World!
  1038.                test.bat                      **TEST**
  1039.                echo Bye World!
  1040.                rem ***We DID NOT RETURN to the batch file after TEST.BAT
  1041.  
  1042.          If you want to allow 300 bps callers, you must use the /300
  1043.          command line switch.  ( Example:  BGFAX /HOST /300 ).  Yes, there
  1044.          is a reason for this, but if I told you, you'd just get more
  1045.          confused.
  1046.  
  1047.          -------------------------------------------------------------
  1048.          INITIALIZATION MODE
  1049.          -------------------------------------------------------------
  1050.  
  1051.          If you want BGFAX just to initialize the modem, you can have it do
  1052.          so with the BGFAX /INIT parameter.  BGFAX will get the port,
  1053.          speed, and initialization strings from the BGFAX.CNF file in the
  1054.          directory specified by the BGFAX environment variable.
  1055.  
  1056.          This mode is provided for people who need to use BGFAX in rear end
  1057.          mode, but their Fido mailers (or BBS software) do not allow them
  1058.          to use the long initialization strings required for fax usage.
  1059.  
  1060.          -------------------------------------------------------------
  1061.          REAR END MODE (FIDO MAILERS, ETC.)
  1062.          -------------------------------------------------------------
  1063.  
  1064.          Rear end mode is useful for those of us who are FidoNet members
  1065.          where a Fido mailer is required to be running 24 hours a day.  It
  1066.          will be your job to figure out how to get your mailer to exit to
  1067.          BGFAX when your modem informs the mailer a fax call is coming
  1068.          through.  (See the *.TXT files for hints on specific mailers.)
  1069.  
  1070.          You will need to know the result code your modem sends when an
  1071.          incoming fax call is detected.  Some modems send TWO fax connect
  1072.          strings.  For example, the Supra will send "FAX" followed by an
  1073.          "+FCON" response about 2 seconds later.  The ZyXEL will send
  1074.          "CONNECT FAX" followed immediately by "ZyXEL".  Most fax modems
  1075.          report only one string though.  Use this chart for reference:
  1076.  
  1077.          Result   Modems
  1078.          ======   ====================================================
  1079.          FAX      Supra, Zoom, Hayes, most Rockwell based chipsets
  1080.          +FCON    PPI, Intel, GVC, some other Class 2 modems
  1081.          +FCO     USR V.Everything and other Class 2.0 modems
  1082.             ^
  1083.          THAT IS NOT A ZERO!!  IT'S THE LETTER "O"!
  1084.  
  1085.          You need to configure your mailer (or BBS software) to exit
  1086.          IMMEDIATELY upon receipt of the proper fax result code.  You
  1087.          need to call BGFAX in the following manner:
  1088.  
  1089.          BGFAX /how [faxpath port faxtype [pid]]
  1090.  
  1091.          FAXPATH will be the directory where incoming faxes are to be
  1092.          placed.  PORT is a valid communications port from 1 to 4, or,
  1093.          optionally, a hexidecial base address and IRQ formatted as
  1094.          followed "3F8x5".  Also, optionally, if the port has a bang, !,
  1095.          following it, it will force the port to stay locked at the current
  1096.          speed rather than shifting to 19200 on fax connects.  FAXTYPE is a
  1097.          single character 'Z' or 'Q'.
  1098.  
  1099.          'Z' for ZyXEL ZFAX format,
  1100.          'Q' for Smith Micro Software's Quick Link II fax format,
  1101.          'F' for TIFF Class F, specially, Faxworks for OS/2 format.
  1102.  
  1103.          The "/how" deal is the most critical switch.  There are three
  1104.          possible settings.
  1105.  
  1106.               /FAX   ... Modem reports "FAX" or "CONNECT FAX".
  1107.                          BGFAX will automatically detect whether it should
  1108.                          use Class 2 (Supra, Zoom) or the ZyXEL fax mode
  1109.                          based on the next message (ie, "+FCON" or "ZyXEL").
  1110.  
  1111.               /FAX:713_893_9124     If your modem in Class 1, try one of
  1112.               /FHAY:713_893_9124    these two options.
  1113.  
  1114.               /FAST:nn .... Modem reports "+FCON" (PPI, other Class 2 modems)
  1115.  
  1116.               /FCO:nn ..... Modem reports "+FCO" (USR V.Everything)
  1117.  
  1118.               /FZYX ....... ZyXEL owners use this if /FAX doesn't work.
  1119.  
  1120.               THE "nn" WILL BE A NUMBER IN SECONDS!
  1121.  
  1122.          Here is a schematic of how each option behaves:
  1123.  
  1124. ***           /FAX [ Supra, ZyXEL, i.e. all modems that report "FAX" ]
  1125. 1. keeps port at locked DTE    1. <same>                1. <same>
  1126. 2. waits for "+FCON"     _or_  2. waits for "OK"  _or_  2. waits for "ZyXEL"
  1127. 3. drops port to 19200         3. sends "AT+FDR"        3. waits for high CTS
  1128. 4. waits for "OK"                                       4. sends <DC2>
  1129. 5. sends "AT+FDR"
  1130.  
  1131.  
  1132. ***           /FAX:713_893_9124 [ Supra LC modem, Class 1 modem ]
  1133.                 1. keeps port at locked DTE
  1134.                 2. waits for "CONNECT"
  1135.                 3. begins sending Class 1 HDLC frames
  1136.  
  1137.  
  1138. ***           /FHAY:713_893_9124 [ Hayes 288, other Class 1 modems ]
  1139.                 1. keeps port at locked DTE
  1140.                 2. blindly starts sending Class 1 HDLC frames
  1141.  
  1142.  
  1143. ***           /FAST:nn [ all Class 2 modems where /FAX won't work ]
  1144.                 Let's present we use /FAST:4 ...
  1145.                 1. drops port to 19200
  1146.                 2. waits for "OK" for nn seconds (FOUR seconds if /FAST:4)
  1147.                 3. if "OK" occurs before nn seconds, sends AT+FDR
  1148.                          _or_
  1149.                 3. if "OK" is not received in nn seconds,
  1150.                      blindly sends AT+FDR
  1151.  
  1152.  
  1153. ***           /FCO:nn [ USR, i.e., all Class 2.0 modems that report "+FCO"]
  1154.                 This switch is a hybrid of the /FCO and /FCOS switches.
  1155.                 Let's pretend we use /FCO:4 ...
  1156.                 1. keeps port at locked DTE
  1157.                 2. waits for "OK" for nn seconds (FOUR seconds if /FCO:4)
  1158.                 3. if "OK" occurs before nn seconds, sends "AT+FDR"
  1159.                             _or_
  1160.                 3. if "OK" is not received in nn seconds,
  1161.                      blindly sends "AT+FDR"
  1162.  
  1163.  
  1164. ***           /FZYX  [ ZyXEL, use this only if /FAX doesn't work ]
  1165.                 1. waits for high CTS
  1166.                 2. sends <DC2>
  1167.  
  1168.          NOTE:  /FCO:0 is equivilant to the old /FCOS switch
  1169.                 /FAST:0 is equivilant to the old /FCON switch
  1170.  
  1171.          When a fax is inbound, here are some example BGFAX command
  1172.          lines for rear-end mode operation on my Supra:
  1173.  
  1174.               BGFAX /FAX C:\BGFAX 1 Z
  1175.               bgfax /fax c:\bgfax f3 z
  1176.               bgfax /fax c:\bgfax 3f8x7 z
  1177.  
  1178.          Using my Hayes 288, example command line options might be:
  1179.  
  1180.               bgfax /fhay:713_893_9124 c:\bgfax 1 z
  1181.  
  1182.          ...note that the ID string MUST be presented on the command line
  1183.          when you are receiving with a Class 1 modem in rear end mode.
  1184.          In Class 1, the fax software is responsible for sending the ID
  1185.          string to the remote machine.  (In contrast to Class 2/2.0 modems,
  1186.          which automatically send the ID to the remote machine.)
  1187.  
  1188.          The /FAX means that I used the modem response "FAX" as a trigger
  1189.          for FD (see FD212.TXT for more details), C:\BGFAX is the path
  1190.          where I want all faxes to be stored, "1" is the communications
  1191.          port, and the "Z" represents I want faxes saved in ZyXEL's ZFAX
  1192.          image format.
  1193.  
  1194.          If you want to run BGFAX on a multinode system, an optional fifth
  1195.          parameter can be used.  This fifth parameter can be up to three
  1196.          characters and it is called the PID.  Example:
  1197.  
  1198.               BGFAX /FAX C:\BGFAX 1 Z /PID:99
  1199.  
  1200.          The only difference between the command above and the previous one
  1201.          is that rather than making a BGFAX.LOG, all log entries will be
  1202.          written to a file called BGFAXpid.LOG, in this case, BGFAX99.LOG.
  1203.  
  1204.          -------------------------------------------------------------
  1205.          MISCELLANEOUS /HOST AND REAREND (/Fxxx) OPTIONS
  1206.          -------------------------------------------------------------
  1207.  
  1208.          Stop that hopping blue box
  1209.          ==========================
  1210.  
  1211.          In /HOST mode, the BGFAX status box hops around the screen every
  1212.          10 seconds to prevent screen burn-in.  However, some people got
  1213.          dizzy watching the box, and others complained that the screen move
  1214.          was taking up too many time slices in multitasking environment.
  1215.          The /NH parameter will force "No Hop" mode which has considerably
  1216.          less screen writes when sitting idle.
  1217.  
  1218.               bgfax /host /nh
  1219.  
  1220.          Turning off the alert sound BGFAX makes when it receives a fax
  1221.          ==============================================================
  1222.  
  1223.          BGFAX will automatically sound an "alarm" to let you know when a
  1224.          successful fax reception occurs.  This "alarm" is annoying to some
  1225.          people.  To disable the "alarm", use the /NS switch for No Sound.
  1226.          (ONLY AVAILABLE IN THE REGISTERED VERSION.)
  1227.  
  1228.               bgfax /host /ns
  1229.               bgfax /fast c:\bgfax 1 z /ns
  1230.  
  1231.          Telling Class 1 modems to receive at a maximum of 9600 bps  /DIS
  1232.          ================================================================
  1233.  
  1234.          If your Class 1 modem can receive at a maximum of 9600, strange
  1235.          things will happen if you forgot to tell BGFAX this, since it will
  1236.          default to tell the other side you will be using 14400 bps for fax
  1237.          operations.  To force BGFAX to receive at a maximum of 9600 bps
  1238.          with Class 1 faxmodems, use the /DIS:79 parameter, i.e.:
  1239.  
  1240.               bgfax /fhay:713_893_9124 c:\bgfax 1 z /dis:79 /ns
  1241.  
  1242.          To compute your own /DIS value, first, pick a value from the
  1243.          following table:
  1244.  
  1245.          2400  -> 3
  1246.          4800  -> 11
  1247.          9600  -> 15
  1248.          14400 -> 47
  1249.  
  1250.          Next, you have two options.  If you want to allow high resolution
  1251.          documents, add the value 64 to your choice.  If you want to allow
  1252.          2D-MR documents, add the value 128 to your choice.  For example,
  1253.          let's say you wanted a maximum speed of 9600 along with high
  1254.          resolution documents: 15 + 64 = 79, so use /DIS:79.
  1255.  
  1256.          See the following chart for pre-computed examples:
  1257.  
  1258.          /DIS:nnn   Description (all of the following allow high res faxes)
  1259.          --------   -------------------------------------------------------
  1260.          75         Maximum speed of 4800 bps, 1D-MH faxes only
  1261.          79         Maximum speed of 9600 bps, 1D-MH faxes only
  1262.          207        Maximum speed of 9600 bps, 1D-MH & 2D-MR faxes
  1263.          111        Maximum speed of 14400 bps, 1D-MH faxes only [DEFAULT]
  1264.          239        Maximum speed of 14400 bps, 1D-MH & 2D-MR faxes
  1265.  
  1266.  
  1267.          TSR fax notification
  1268.          ====================
  1269.  
  1270.          BGFAX comes with an optional TSR program (NFAX.COM) that will
  1271.          place the word "FAX" on your screen whenever a successful incoming
  1272.          fax occurs.  However, you must tell BGFAX that you wish to alert
  1273.          NFAX.COM to display the message.  You can do this by using the /NF
  1274.          switch.  Example:
  1275.  
  1276.               bgfax /fcon c:\bgfax 2 q /nf
  1277.  
  1278.          This will activate the NFAX.COM interrupt and cause the message to
  1279.          get displayed.  To turn the message off, you can run the FAXOFF.COM
  1280.          program contained in the BGFAX archive.  Remember, NFAX.COM is a
  1281.          TSR and must be loaded in your AUTOEXEC.BAT properly if you wish
  1282.          to use it with BGFAX.  It is totally optional!  Also, note that if
  1283.          your machine is rebooted, the fax message will not be on your
  1284.          screen when your system powers back up.
  1285.  
  1286.          NFAX.COM/FAXOFF.COM technical information:
  1287.          ===========================================
  1288.  
  1289.          Here is a snip of the Turbo Pascal source code that tells NFAX.COM
  1290.          to put the fax indicator on the screen:
  1291.  
  1292.               var
  1293.                 regs : registers;
  1294.               begin
  1295.                 writeln('Activating "NFAX" interrupt.');
  1296.                 regs.ah := 30; { nfax-function }
  1297.                 regs.al := 21; { nfax-sub function }
  1298.                 regs.bl := 95; { nfax-"FAX" attribute, white on purple }
  1299.                 intr($55, regs); { nfax-tsr }
  1300.               end;
  1301.  
  1302.          When you want to turn off the "FAX" alert message, you need to
  1303.          run the included "FAXOFF.COM" file.  It basically issues the
  1304.          same code above except that "regs.al := 22" instead of 21.
  1305.          (Go into DEBUG and do an unassemble on the .COM file to see
  1306.          exactly how to turn it off.)
  1307.  
  1308.     ************************************************************************
  1309.          AFTER YOU RECEIVE THE FAX
  1310.     ************************************************************************
  1311.  
  1312.          NAMING CONVENTION
  1313.          =================
  1314.          The name of the fax file will be FAXnnnn.??? where "nnnn" is a
  1315.          number that is padded with zeros and "???" is "FAX" or "QFX",
  1316.          depending upon which fax format you save the file in.  If you ever
  1317.          see a BGFAX.$$$ file in your directory, it should *NOT* be there,
  1318.          as it should have been renamed in the FAXnnnn.??? format.  If it
  1319.          is there, it means some kind of problem happened during the fax
  1320.          reception.  Normally, problem faxes will be renamed to BADnnnn.???.
  1321.  
  1322.          FAXIN.LOG
  1323.          =========
  1324.          BGFAX creates a BGFAX.LOG file that contains a bunch of
  1325.          information that is mainly only for debug purposes.  A much
  1326.          cleaner log file is called FAXIN.LOG and looks like this:
  1327.  
  1328. Date  Time  ET    Bytes   Rate  Filename     Remote Fax ID        Pgs  Notes
  1329. -------------------------------------------------------------------------------
  1330. 12-21 11:52 00:42   18183  9600*FAX0001.FAX  Unknown                2  Finished
  1331. 12-21 18:04 00:38   18182  9600 FAX0002.FAX  Unknown                2  Not Done
  1332. 12-22 21:30 00:29   17793 14400*FAX0003.FAX  7138939124             1  Finished
  1333. 12-22 21:42 00:29   17541 14400#FAX0004.FAX  TRANQUILITY BASE       1  Finished
  1334. 12-23 06:44 00:32   16941  9600%FAX0005.FAX  Null ID Received       1  Finished
  1335. 12-25 17:21 01:22  107392 14400*FAX0006.FAX  7132424708             1  Finished
  1336.  
  1337.          Notice the special symbols between the Rate and Filename:
  1338.  
  1339.            -> (space) means low resolution, 1D-MR compression
  1340.          * -> means high resolution, 1D-MH compression
  1341.          % -> means low resoltion, 2D-MR compression
  1342.          # -> means high resolution, 2D-MR compression
  1343.  
  1344.          "Not Done" under Notes means that BGFAX believed more pages were
  1345.          to have followed, but were not actually received.  "ET" is
  1346.          estimated time.  Everything else is self explanatory.
  1347.  
  1348.          VIEWING/PCX CONVERSION
  1349.          ======================
  1350.  
  1351.          You can use the included VIEW.EXE file to view the faxes you have
  1352.          received.  It's use is quite simple:
  1353.  
  1354.          c:\bgfax> VIEW
  1355.  
  1356.          ...will cause VIEW.EXE to start up in menu mode.
  1357.  
  1358.          VIEW should automatically detect what kind of video card you are
  1359.          using (VGA, EGA, and CGA) and use that video card's monochrome
  1360.          mode.  If VIEW.EXE has trouble finding a video mode, you can force
  1361.          VIEW to use an alternate mode with the /CGA, /EGA, or /VGA
  1362.          command as the second command line parameter after the filename.
  1363.  
  1364.               VIEW FAX0002.FAX /CGA   or  VIEW FAX0002.FAX /EGA
  1365.  
  1366.          /SVGA (800x600) and /1024 (1024x768) options are also available!
  1367.  
  1368.          When you are viewing the fax, you have a few options:
  1369.  
  1370.          Alt-F ........ Flip the image (makes upside down and mirrors)
  1371.          Alt-I ........ Inverse the image (white-black -> black-white)
  1372.          Alt-S ........ Shrink current on-screen image to 1/3, 1/2 width
  1373.          PgDn ......... go to next page
  1374.          PgUp ......... go to previous page
  1375.          Ctrl-Enter ... print the current page on screen
  1376.          ...and the Up/Down/Right/Left arrows do their normal job.
  1377.  
  1378.          Note that viewing the fax, with my VIEW.EXE program, takes up
  1379.          quite a bit of memory.  (It uses 216 bytes of memory for each scan
  1380.          line, so a single high resolution fax page of 2200 lines uses
  1381.          a minimum of 475K of memory!)  This isn't a problem though, since
  1382.          VIEW can spool to XMS when conventional memory runs out!
  1383.  
  1384.          If you want to convert a fax to PCX ...
  1385.  
  1386.               VIEW FAX0002.FAX /PCX
  1387.  
  1388.          ...would create a FAX0002.PCX and FAX0002.P02 file.  (Two PCX
  1389.          files since there are two pages in this fax image.)
  1390.  
  1391.          If you want to convert a fax to DCX ...
  1392.  
  1393.               VIEW FAX0002.FAX /DCX
  1394.  
  1395.          ...would create a FAX0002.DCX file, no matter how many pages
  1396.          are in the fax.  A DCX file is basically a multipage PCX file.
  1397.  
  1398.          To identity a DCX file, look at the first 4 bytes of the file.
  1399.          It will be a long integer with the value "987654321".  Then,
  1400.          keep reading a long integer at a time (4 bytes) until the
  1401.          value of the long integer is zero.  All the long integers up
  1402.          to that point represent the file offset of the page.  (At the
  1403.          offset, you will find a PCX header.)
  1404.  
  1405.          A special option, /BO, is also available with VIEW.EXE.  /BO
  1406.          tells VIEW that you wish to flip all the bytes in the fax data
  1407.          stream before processing it.  This should NEVER need to be used,
  1408.          as it is for my debugging purposes only.  (Basically, using the
  1409.          /BO parameter will let VIEW display/convert reverse bit order
  1410.          faxes.  Normally, BGFAX will save all faxes in direct bit order,
  1411.          no matter what bit order the modem actually receives in.)
  1412.  
  1413.          Another special option, /DB, forces VIEW to display the bad scan
  1414.          lines of a fax image.  Normally, if VIEW encounters a bad scan
  1415.          line, it will display it is a dotted line going all the way across
  1416.          the width of the fax image.  If /DB is active, VIEW will put up to
  1417.          1728 bits of the incorrectly decoded scan line on the page.
  1418.  
  1419.          DOPRINT.BAT
  1420.          ===========
  1421.          After you successfully receive a fax, BGFAX will exit with an
  1422.          errorlevel of 4 and append (or create) a DOPRINT.BAT file.
  1423.  
  1424.          CALL C:\BGFAX\EXEPRINT.BAT C:\BGFAX\FAX0085.FAX
  1425.          CALL C:\BGFAX\EXEPRINT.BAT C:\BGFAX\FAX0086.FAX
  1426.  
  1427.          You do not have to do anything with this at all, but it is
  1428.          provided for those of you who wish to print faxes as they are
  1429.          received.  It will call the EXEPRINT.BAT file and pass it the
  1430.          parameter with the path and name of the fax file that was just
  1431.          received.  If you are using Smith Micro Software's Quick Link II,
  1432.          for example, and are one of those people that leave your printer
  1433.          on 24 hours a day, your EXEPRINT.BAT file might contain this:
  1434.  
  1435.          @echo off
  1436.          printfax %1 24pin.qlp
  1437.  
  1438.          Remember to delete the DOPRINT.BAT file after you process it.
  1439.          (If you do not, every time BGFAX goes to print another fax,
  1440.          it will print ALL faxes received since you first set it up.)
  1441.  
  1442.          -------------------------------------------------------------
  1443.          SEND FAX MODE
  1444.          -------------------------------------------------------------
  1445.  
  1446.          Currently, if you want to send a fax to another person, the fax
  1447.          file must already be in either ZFAX or Quick Link II fax image
  1448.          format.
  1449.  
  1450.               BGFAX /SEND FAX0001.FAX 893-9124
  1451.  
  1452.          See the BGFAX.CNF file for more info, such as maximum amount of
  1453.          busy signals and failures before exit, etc.
  1454.  
  1455.          At this time, only previously converted fax files can be sent.
  1456.          (i.e., ASCII files have to be translated to ZFAX .FAX format or
  1457.          QLII .QFX format.)  You can use the included MAKEFAX.EXE program
  1458.          to convert an ASCII file to .FAX format.  MAKEFAX.EXE will require
  1459.          that the font file BGFAX.FNT exists in your BGFAX directory.
  1460.          MAKEFAX allows a width of up to 100 characters per line.  (Use
  1461.          the /SP command line parameter on MAKEFAX if you want it to use
  1462.          short sized pages for pages in the fax that aren't fully used.)
  1463.  
  1464.          BGFAX can exit with three possible errorlevels when sending...
  1465.  
  1466.               errorlevel 5  -> fax sent successfully
  1467.               errorlevel 1  -> fax send failure
  1468.               no errorlevel -> file not found, keypress abort, etc.
  1469.  
  1470.          If the number is BUSY, BGFAX will try a few more times (the number
  1471.          of times specified in the MB= entry in the BGFAX.CNF file) and
  1472.          will pause for SW= number of seconds between dials.  If a failure
  1473.          occurs during handshaking or during the actual sending of the fax,
  1474.          BGFAX will terminate with an failure errorlevel.
  1475.  
  1476.          If you are a programmer, and need to use BGFAX to send faxes, but
  1477.          need more information than success or failure, you need to use the
  1478.          /ER switch on the BGFAX /SEND command line.  BGFAX will make only
  1479.          ONE attempt to send the fax in /ER mode (regardless of BUSY, etc.)
  1480.  
  1481.               bgfax /send fax0001.fax 893-9124 /er
  1482.  
  1483.          The following "Extended Results" are available:
  1484.  
  1485.               errorlevel 18 -> input fax file not found on disk
  1486.               errorlevel 17 -> remote fax device does not support 2D-MR
  1487.               errorlevel 16 -> remote fax does not support high resolution
  1488.               errorlevel 15 -> failure after connect (HDLC frameout, etc.)
  1489.                                (a class 1 failure)
  1490.               errorlevel 14 -> a timeout occurred
  1491.               errorlevel 13 -> no +FCON ever occurred (NO CARRIER, etc.)
  1492.               errorlevel 12 -> failure after connect (+FHNG, no XON, etc.)
  1493.                                (a class 2 or 2.0 failure)
  1494.               errorlevel 11 -> "NO DIALTONE"
  1495.               errorlevel 10 -> "BUSY"
  1496.               errorlevel 7  -> the number is BLACKLISTED by the modem
  1497.               errorlevel 5  -> *** FAX SENT SUCCESSFULLY ***
  1498.                  4,3,2      <reserved for bgfax /host mode>
  1499.               errorlevel 1  -> generic fax send failure
  1500.               no errorlevel -> keypress abort, unknown failure type
  1501.  
  1502.          TOP OF PAGE HEADERS
  1503.          ===================
  1504.          BGFAX will print a top of page header at the top of each page
  1505.          BGFAX sends out.  This is same time of things that real fax
  1506.          machines and other computer fax software do that identify who sent
  1507.          the fax, where it's going, the date and time, and the page number.
  1508.  
  1509.          BGFAX will need to call MAKEFAX.EXE with a special command line
  1510.          parameter to cause the creation of the top of make banners.  Make
  1511.          sure you keep both MAKEFAX.EXE and BGFAX.FNT in your BGFAX
  1512.          environment directory.
  1513.  
  1514.          If you get lost real easy, you can skip the rest of this section.
  1515.          This rest of this section describes how to configure BGFAX to
  1516.          change the format of the top of page banners.
  1517.  
  1518.          BGFAX lets you be very flexible with what exactly is said on the
  1519.          top of page headers.  It does this by the use of a "template" that
  1520.          is located in the BGFAX.CNF file.  This is necessary so that
  1521.          countries that do not use English can put their own language on
  1522.          the top of page banners.  Also, it's just plain fun.
  1523.  
  1524. fh=To: %to21% From: %fr42% %mo2%/%dy2%/%yr2%  %hr2%:%mi2%  Pg %pg2%/%mp2%
  1525. fr=B.J. Guillot (713-893-9124)
  1526.  
  1527.          The fh= entry is the template.
  1528.  
  1529.          It should be obvious as to what all those %TTNN% things do,
  1530.          but if not, here's a little dictionary:
  1531.  
  1532.    %toNN% -> who the fax is for (will default to the sending phone number,
  1533.      but can override to say any text with the /TO= command line switch)
  1534.    %frNN% -> who the fax if from (will default to the ID= entry in the
  1535.      BGFAX.CNF file, unless a FR= entry is found, but can override to say
  1536.      any text with the /FR= command line switch)
  1537.    %moNN% -> month
  1538.    %dyNN% -> year
  1539.    %hrNN% -> hour
  1540.    %miNN% -> minute
  1541.    %pgNN% -> current page number
  1542.    %mpNN% -> maximum number of pages
  1543.  
  1544.    With %to and %fr, BGFAX will right pad the whoto or whofrom strings to
  1545.    a total number of NN characters with blanks.  All other fields, are
  1546.    left padded to NN characters with ZEROS.  Keep in mind that BGFAX can
  1547.    fit 100 characters across the page.
  1548.  
  1549.          The fr= option, is used in the fh= template entry.  Basically,
  1550.          fr= is what will be inserted into the %frNN% template variable.
  1551.  
  1552.          Are you lost?  Here is an example and what it would look like:
  1553.  
  1554.           C:\> bgfax /send output.fax 555-1212
  1555.  
  1556. To: 555-1212              From: B.J. Guillot (713-893-9124)                05/08/94  16:25  Pg 01/15
  1557.  
  1558.          Let's say you run a BBS with a fax door and want to stick you
  1559.          user's name at the top of each page instead of your personal name.
  1560.          No need to rebuild a BGFAX.CNF!  You can manipulate the %toNN% and
  1561.          %frNN% template variables from the command line.  If you do this,
  1562.          remember to use underscores (_) to indicate spaces.  Example:
  1563.  
  1564. C:\> bgfax /send output.fax 555-1212 /fr=BGFAX_Tech_Support /to=John_Doe
  1565.  
  1566. To: John Doe              From: BGFAX Tech Support                         05/08/94  16:25  Pg 01/15
  1567.  
  1568.          MISCELLANEOUS /SEND OPTIONS
  1569.          ===========================
  1570.  
  1571. /C1      Some Class 2 modems have bugs and cannot send to all fax machines
  1572.          reliably in Class 2 mode.  Because of this, the /C1 parameter is
  1573.          available.  It causes BGFAX to force the use of Class 1 when
  1574.          sending:
  1575.  
  1576.               bgfax /send c:\bgfax\fax0001.fax 893-9124 /c1
  1577.  
  1578. maximum  Some fax machines and fax modems don't operate very well together
  1579.          at 14400 speeds.  You can force BGFAX to use a lower maximum speed
  1580.          by putting the BPS rate after the send command, e.g.:
  1581.  
  1582.               bgfax /send:9600 fax0001.fax 893-9124
  1583.               bgfax /send:7200 fax0001.fax 893-9124
  1584.               bgfax /send:12000 fax0001.fax 1-713-893-9124 /c1
  1585.  
  1586.  
  1587.          FAXOUT.LOG
  1588.          ==========
  1589.  
  1590.          A FAXOUT.LOG file is created when sending out faxes to indicate
  1591.          the success or failure.  Here is an example:
  1592.  
  1593. Date  Time  ET    Bytes   Rate  Filename     Phone Number         Pgs  Notes
  1594. -------------------------------------------------------------------------------
  1595. 03-22 13:18 00:25    3882 14400 RESPOND.FAX  8939124                2  Finished
  1596. 03-22 13:18 00:11    3884 NOFAX RESPOND.FAX  8939124                0  Busy
  1597. 03-22 13:19 00:11    3884 NOFAX RESPOND.FAX  8939124                0  No Fcon
  1598. 03-22 13:30 00:31    3208  7200 RESPOND.FAX  8939124                0  Bad Conn
  1599. 03-22 13:31 00:28    3882  9600 RESPOND.FAX  8939124                2  Finished
  1600. 03-23 14:42 00:26    3882 14400 RESPOND.FAX  8939124                1  Timeout
  1601. 03-23 14:44 00:29    3882 NOFAX RESPOND.FAX  8939124                0  BlackLst
  1602. 03-23 14:47 00:21    3882 NOFAX RESPOND.FAX  8939124                0  Max Busy
  1603. 03-23 14:51 00:23    3882 14400 RESPOND.FAX  8939124                1  Gen Fail
  1604. 03-23 14:54 00:05    3882 NOFAX RESPOND.FAX  8939124                0  No Dial
  1605.  
  1606.          -------------------------------------------------------------
  1607.          HANGUP STATUS CODES
  1608.          -------------------------------------------------------------
  1609.  
  1610.          When BGFAX reports "Problematic fax reception", it will indicate a
  1611.          fax hangup code, such as [+FHNG: 73].  This chart, taken from the
  1612.          Supra CLASS_2.TXT fax command set documentation (which, I believe
  1613.          was taken from the Rockwell Class 2 documentation), allows you to
  1614.          match up the +FHNG message with its true meaning.  For example,
  1615.          +FHNG: 73 would indicate "T.30 T2 timeout, expected page not
  1616.          received", which really does not say much, but it may give you
  1617.          some clue.  I don't know what most of these mean myself, so I
  1618.          don't know whether it will provide you any luck or not, but, many
  1619.          people asked that it be included, so here it is.
  1620.  
  1621.      /-----------------------------------------------------------------\
  1622.      | 2.0   Class 2 |  Cause Description                              |
  1623.      | --------------|-------------------------------------------------|
  1624.      | 00-0F     0-9 |  CALL PLACEMENT AND TERMINATION                 |
  1625.      |---------------|-------------------------------------------------|
  1626.      | 00          0 |  Normal and proper end of connection            |
  1627.      | 01          1 |  Ring Detect without successful handshake       |
  1628.      | 02          2 |  Call aborted, from +FK/+FKS or <CAN>           |
  1629.      | 03          3 |  No Loop Current                                |
  1630.      | 04      4,n/a |  Ringback detected, no answer (timeout)         |
  1631.      | 05        n/a |  Ringback detected, answer without CED          |
  1632.      |---------------|-------------------------------------------------|
  1633.      | 10-1F   10-19 |  TRANSMIT PHASE A & MISCELLANEOUS ERRORS        |
  1634.      |---------------|-------------------------------------------------|
  1635.      | 10         10 |  Unspecified Phase A error                      |
  1636.      | 11         11 |  No Answer (T.30 T1 timeout)                    |
  1637.      |---------------|-------------------------------------------------|
  1638.      | 20-3F   20-39 |  TRANSMIT PHASE B HANGUP CODES                  |
  1639.      |---------------|-------------------------------------------------|
  1640.      | 20         20 |  Unspecified Transmit Phase B error             |
  1641.      | 21         21 |  Remote cannot receive or send                  |
  1642.      | 22         22 |  COMREC error in transmit Phase B               |
  1643.      | 23         23 |  COMREC invalid command received                |
  1644.      | 24         24 |  RSPEC error                                    |
  1645.      | 25         25 |  DCS sent three times without response          |
  1646.      | 26         26 |  DIS/DTC received 3 times; DCS not recognized   |
  1647.      | 27         27 |  Failure to train at 2400 bps or +FMS/          |
  1648.      |               |                                  +FMINSP value  |
  1649.      | 28         28 |  RSPREC invalid response received               |
  1650.      |---------------|-------------------------------------------------|
  1651.      | 40-4F   40-49 |  TRANSMIT PHASE C HANGUP CODES                  |
  1652.      |---------------|-------------------------------------------------|
  1653.      | 40         40 |  Unspecified Transmit Phase C error             |
  1654.      | 41        n/a |  Unspecified Image format error                 |
  1655.      | 42        n/a |  Image conversion error                         |
  1656.      | 43         43 |  DTE to DCE data underflow                      |
  1657.      | 44        n/a |  Unrecognized Transparent data command          |
  1658.      | 45        n/a |  Image error, line length wrong                 |
  1659.      | 46        n/a |  Image error, page length wrong                 |
  1660.      | 47        n/a |  Image error, wrong compression code            |
  1661.      |---------------|-------------------------------------------------|
  1662.      | 50-6F   50-69 |  TRANSMIT PHASE D HANGUP CODES                  |
  1663.      |---------------|-------------------------------------------------|
  1664.      | 50         50 |  Unspecified Transmit Phase D error             |
  1665.      | 51         51 |  RSPREC error                                   |
  1666.      | 52         52 |  No response to MPS repeated 3 times            |
  1667.      | 53         53 |  Invalid response to MPS                        |
  1668.      | 54         54 |  No response to EOP repeated 3 times            |
  1669.      | 55         55 |  Invalid response to EOP                        |
  1670.      | 56         56 |  No response to EOM repeated 3 times            |
  1671.      | 57         57 |  Invalid response to EOM                        |
  1672.      | 58         58 |  Unable to continue after PIN or PIP            |
  1673.      |---------------|-------------------------------------------------|
  1674.      | 70-8F   70-89 |  RECEIVE PHASE B HANGUP CODES                   |
  1675.      |---------------|-------------------------------------------------|
  1676.      | 70         70 |  Unspecified Receive Phase B error              |
  1677.      | 71         71 |  RSPREC error   (before TCF??)                  |
  1678.      | 72         72 |  COMREC error   (after TCF??)                   |
  1679.      | 73         73 |  T.30 T2 timeout, expected page not received    |
  1680.      | 74         74 |  T.30 T1 timeout after EOM received             |
  1681.      |---------------|-------------------------------------------------|
  1682.      | 90-9F   90-99 |  RECEIVE PHASE C HANGUP CODES                   |
  1683.      |---------------|-------------------------------------------------|
  1684.      | 90         90 |  Unspecified Receive Phase C error              |
  1685.      | 91         91 |  Missing EOL after 5 seconds                    |
  1686.      | n/a        92 |  < Not assigned >           /--- Rockwell only  |
  1687.      | 92 -Note-> 94 |  Bad CRC or frame (ECM {or BFT} modes)          |
  1688.      | 93         93 |  DCE to DTE buffer overflow                     |
  1689.      |---------------|-------------------------------------------------|
  1690.      | A0-BF 100-119 |  RECEIVE PHASE D HANGUP CODES                   |
  1691.      |---------------|-------------------------------------------------|
  1692.      | A0        100 |  Unspecified Receive Phase D errors             |
  1693.      | A1        101 |  RSPREC invalid response received               |
  1694.      | A2        102 |  COMREC invalid response received               |
  1695.      | A3        103 |  Unable to continue after PIN or PIP            |
  1696.      |---------------|-------------------------------------------------|
  1697.      | C0-DF     n/a |  RESERVED FOR FUTURE STANDARDIZATION            |
  1698.      | E0-FF     n/a |  RESERVED FOR MANUFACTURER SPECIFIC USE         |
  1699.      | n/a   120-255 |  RESERVED CODES                                 |
  1700.      \-----------------------------------------------------------------/
  1701.  
  1702.          -------------------------------------------------------------
  1703.          LIST OF ALL COMMAND LINE PARAMETERS, SHORT DESCRIPTIONS
  1704.          ------------------------------------------------------------
  1705.  
  1706.          Valid in all modes
  1707.          ~~~~~~~~~~~~~~~~~~
  1708.          /50       Tell BGFAX (DOS version only) to use 50 line text mode
  1709.  
  1710.          /ED       Tells BGFAX to use "European Date" format.  DD-MM-YY.
  1711.  
  1712.          /PID:nnn  Example... /PID:34 will make all log files named
  1713.                    BGFAX34.LOG to keep from having trouble on multi-node
  1714.                    systems.
  1715.  
  1716.  
  1717.          Valid only in "Rear End" mode
  1718.          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1719.         /DTE:nnnnn If BGFAX has trouble determining the DTE speed when
  1720.                    used in rear-end mode (sometimes happens on FOSSIL
  1721.                    based systems), you can tell BGFAX what DTE speed the
  1722.                    port is set to.  Example...  /DTE:57600
  1723.                    People using BGFAX/DOS in a dos session of Windows 3.11,
  1724.                    Windows 95, and OS/2 may need to use this.
  1725.  
  1726.  
  1727.          Valid in both "Rear End" and /HOST modes
  1728.          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1729.          /NS       Eliminates the sound that BGFAX plays after successfully
  1730.                    receiving a fax.  Registered version only.
  1731.  
  1732.          /NF       Make "FAX" appear on screen after fax received, must be
  1733.                    have the NFAX.COM TSR loaded.  Use only on 286 machines
  1734.                    and higher.  Do not use under OS/2
  1735.  
  1736.          /DIS:nnn  Useful for limiting/changing the fax capabilities on
  1737.                    a Class 1 modem.  Discussed in detail in another part
  1738.                    of the documentation.
  1739.  
  1740.          /EX       If you are using an EXAR based fax modem, BGFAX will
  1741.                    not perform DLE escapes so that you can get a readable
  1742.                    fax image when receiving.  DO NOT USE THIS COMMAND ON
  1743.                    A ROCKWELL OR OTHER TYPE OF FAX MODEM.  Most people
  1744.                    in the United States will never need this parameter.
  1745.                    A few people in other countries might need to use it.
  1746.  
  1747.  
  1748.          Valid only in /HOST mode
  1749.          ~~~~~~~~~~~~~~~~~~~~~~~~
  1750.          /NH       No Hop.  In /HOST mode, BGFAX will normally do a
  1751.                    "screen saving" hop.  This takes less CPU resources.
  1752.  
  1753.          /ATO      In /HOST mode, use this parameter if you are using
  1754.                    some very old modems in Class 1 mode (some old 2400/9600
  1755.                    modems, as well as the newer USR modems).
  1756.  
  1757.          /300      Tells BGFAX's /HOST mode to allow 300 bps callers.
  1758.                    Only use this on a Class 2, 2.0, or ZyXEL modem.
  1759.                    Class 1 (when adaptive answering is disabled) uses
  1760.                    a string of "CONNECT" to represent a fax connect,
  1761.                    which is the same as a 300 BPS data caller.
  1762.  
  1763.          /SB       In /HOST mode for the OS/2 version of BGFAX, it causes
  1764.                    BGFAX/2 to _spawn_ the DOBBS.CMD file so that BBS
  1765.                    software such as Maximus/2 can be used successfully.
  1766.                    This switch is meaningless to the DOS version.
  1767.  
  1768.          /ME       In /HOST mode, if you make BGFAX ask the user to hit
  1769.                    <Escape> to load the BBS, normally, if nothing
  1770.                    happens in ten seconds or so, BGFAX times out and
  1771.                    loads the BBS anyway.  /ME stands for Must hit Escape
  1772.                    to actually load the BBS.  If the user does not,
  1773.                    BGFAX will hang up on them instead of loading the
  1774.                    BBS.  Can be used to keep people that don't have
  1775.                    <Esc> keys on their keyboard off your BBS.
  1776.  
  1777.          /ND       In /HOST mode, BGFAX will send a message to any human
  1778.                    (data) callers telling them the BBS is not currently
  1779.                    accepting modem callers.  You should never really need
  1780.                    to use this.
  1781.  
  1782.  
  1783.          Valid only in /SEND mode
  1784.          ~~~~~~~~~~~~~~~~~~~~~~~~
  1785.          /HW       Tells BGFAX to use hardware flow control (CTS) when
  1786.                    sending faxes.  See WHATS.NEW for more info.  Applies
  1787.                    only to the DOS version of BGFAX.
  1788.  
  1789.          /ER       Extended Results send mode.  Discussed earlier.
  1790.  
  1791.          /NB       Do not create top of page banners when sending faxes.
  1792.  
  1793.          /C1       Forces BGFAX to use Class 1 mode when sending.
  1794.  
  1795.          /C2       Forces BGFAX to use Class 2 mode when sending.
  1796.  
  1797.          /FR:xxxx  Overrides the FR= field in BGFAX.CNF when sending
  1798.                    faxes.  This text goes in the "From:" field in the
  1799.                    top of page banner.  Use underscores instead of
  1800.                    spaces.  Example... /FR:BGFAX_Tech_Support
  1801.  
  1802.          /TO:xxxx  Stuffs the "%toNN%" field template.  Use underscores
  1803.                    instead of spaces.
  1804.  
  1805.  
  1806.          Undocumented
  1807.          ~~~~~~~~~~~~
  1808.          /HB       For internal testing purposes only, /SEND
  1809.          /XB       For internal testing purposes only, /SEND
  1810.          /SMD      For internal testing purposes only, /SEND
  1811.  
  1812.          -------------------------------------------------------------
  1813.          ACKNOWLEDGEMENTS
  1814.          -------------------------------------------------------------
  1815.  
  1816.          I would like to thank the following people for their assistance
  1817.          during the initial alpha and beta test phase.
  1818.  
  1819.          Bill Huther
  1820.          Brian Wood
  1821.          Russell Kroll
  1822.          Ethan Brofman
  1823.          Ed Lucas
  1824.  
  1825.          I also think the many people from the Internet and FidoNet that
  1826.          help out with the on-going public beta program.
  1827.  
  1828.          US Robotics, Hayes and Supra have also been very helpful in
  1829.          getting BGFAX to work/work better with their modems.
  1830.  
  1831.          -------------------------------------------------------------
  1832.          SHAREWARE
  1833.          -------------------------------------------------------------
  1834.  
  1835.          THIS PROGRAM IS SHAREWARE.
  1836.  
  1837.          If you use this program for more than four weeks you are required
  1838.          to register it for its low cost of only $25 US DOLLARS.
  1839.  
  1840.          Please make sure BGFAX works for you BEFORE registering.  If you
  1841.          have a question or problem, I'll answer it (or say I don't know
  1842.          the answer) whether you have registered or not.  I receive so much
  1843.          mail that it sometimes takes me up to two months to reply to your
  1844.          question.  Again, this is whether you are registered or not.
  1845.          Voice contact is the only way you will be able to get prompt reply.
  1846.  
  1847.          Registrations encourage frequent updates.
  1848.  
  1849.          If you are paying by check or money order, please print out the
  1850.          REGISTER.FRM file, fill it out, and mail it to my address.  Please
  1851.          try your best to make sure checks are drawn on a US bank.
  1852.  
  1853.          If you are paying by credit card (Visa, Mastercard, Discover or
  1854.          American Express) you can (1) mail the form to me, (2) fax the
  1855.          form to me, (3) netmail the form to me, or (4) call my BBS and
  1856.          open door #6 and quickly register.
  1857.  
  1858.          You can also register with Authur Mol in the Netherlands.  (See
  1859.          the REGISTER.NL file for more info.  I hope you read Dutch.)
  1860.  
  1861.          Hamish Moffatt is the registration agent for Australia.  (See
  1862.          the REGISTER.AUS file for more info.  This one is in English.)
  1863.  
  1864.          -------------------------------------------------------------
  1865.  
  1866.          Regards,
  1867.          B.J. Guillot
  1868.  
  1869.          "Don't take a vacation while basting your Rick Roger's turkey."
  1870.                                  -- Yan Can Cook, PBS television network
  1871.  
  1872.