home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / BBS_UTIL / BGFAX121.ZIP / BGFAX.DOC next >
Text File  |  1994-03-25  |  63KB  |  1,288 lines

  1.  
  2.                Voice              B.J. Guillot            Data/Fax
  3.             713.893.9320      2611 Rushwood Circle      713.893.9124
  4.                             Houston Texas 77067-1941
  5.  
  6.           Copyright (C) 1993-1994 B.J. Guillot.  All Rights Reserved.
  7.  
  8.          =============================================================
  9.          BGFAX 1.21                                      FRI 25 MAR 94
  10.                                                      EXPIRES 30 JUN 94
  11.          =============================================================
  12.  
  13.                          Dedicated to Gene Roddenberry
  14.                                   1921-1991
  15.  
  16.          -------------------------------------------------------------
  17.          ABSTRACT                                  FidoNet 1:106/400.0
  18.          -------------------------------------------------------------
  19.  
  20.          * Allows sysops to receives faxes on their BBS telephone line
  21.            without needing a fax switch box and real fax machine
  22.  
  23.          * Everything runs in the foreground, no TSR programs needed
  24.  
  25.          * If you are already running a Fido mailer, you can configure
  26.            your mailer to exit and run BGFAX when the line is hot, thus
  27.            BGFAX does not necessarily have to answer the phone itself
  28.  
  29.          * Comes with a small and quick fax viewing program that supports
  30.            CGA, EGA, and VGA display modes as well as FAX->PCX conversion
  31.  
  32.          * Works with modems that offer a feature known as adaptive
  33.            answering on Class 1, Class 2, Class 2.0 and ZyXEL fax modems
  34.  
  35.          * Can send faxes
  36.  
  37.          -------------------------------------------------------------
  38.          INCLUDED FILES
  39.          -------------------------------------------------------------
  40.  
  41.          1.     BGFAX.DOC -- general documentation
  42.  
  43.          2.     WHATS.NEW -- release notes
  44.  
  45.          3.     BGFAX.EXE -- the main executable
  46.  
  47.          4.    HELPME.ARJ -- specialized help files for various setups
  48.  
  49.          5.      VIEW.EXE -- fax viewing and PCX conversion utility
  50.  
  51.          6.      NFAX.COM --\  optional TSR utility to notify the user
  52.          7.    FAXOFF.COM --/  if a fax has been received
  53.  
  54.          8.   MAKEFAX.EXE --\ converts PCX and ASCII files to ZFAX format
  55.          9.     BGFAX.FNT --/ font file for MAKEFAX
  56.  
  57.          10.   SOURCE.ARJ -- TP 7.0 source to VIEW.EXE and MAKEFAX.EXE
  58.  
  59.          11. REGISTER.FRM -- registration form
  60.  
  61.          -------------------------------------------------------------
  62.          DISCLAIMER
  63.          -------------------------------------------------------------
  64.  
  65.          BGFAX and accompanying files are provided AS IS without any
  66.          warranty, expressed or implied.  This includes without limitation
  67.          the fitfulness for a particular purpose or application and any
  68.          warranties of merchantability.
  69.  
  70.          While I tried to be as through as possible in preparing BGFAX,
  71.          B.J. Guillot shall not be liable for any damages, whether direct,
  72.          indirect, special, incidental or consequential arising from a
  73.          failure of this program or accompanying files to operate in a
  74.          manner desired by the user.  B.J. Guillot shall not be liable for
  75.          any damage to data or property which may by caused directly or
  76.          indirectly by use of this program.
  77.  
  78.          In no event will B.J. Guillot be liable to you for any damages,
  79.          including any lost profits, lost savings or other incidental or
  80.          consequential damages arising out of your use or inability to use
  81.          the program, or for any claim by any other party.  Individuals using
  82.          the software bear all risk as to its quality and performance.
  83.   
  84.          -------------------------------------------------------------
  85.          CONTACTING ME
  86.          -------------------------------------------------------------
  87.  
  88.           FidoNet:  1:106/400                   Voice: +1 713.893.9320
  89.          InterNet:  st1r8@jetson.uh.edu      Data/Fax: +1 713.893.9124
  90.  
  91.          The latest versions of BGFAX can be obtained by Fido FREQ at the
  92.          above Fido node number with the magic name "BGFAX" and can be
  93.          obtained by anonymous FTP for InterNet users at the site
  94.          "CSN.ORG" in the "Computech" directory.
  95.  
  96.          BGFAX can also be obtained from Fido 2:512/39.  This system is
  97.          called The Owl's Nest and is the Dutch Supra Distributor.  They
  98.          have three nodes:
  99.  
  100.          +31 0.2155.10921      +31 0.2155.12571      +31 0.2155.28096
  101.  
  102.          An alternate distribution site is Fido 3:635/552.  Cloud Nine.
  103.  
  104.          +61-3-803-6954
  105.  
  106.          -------------------------------------------------------------
  107.          MISCELLANEOUS NOTES
  108.          -------------------------------------------------------------
  109.  
  110.          Currently, BGFAX does not come with a utility to print faxes.  If
  111.          you wish to be able to print faxes, you will need to have a copy
  112.          of ZyXEL's ZFAX software (version 2.23 perferred) or Smith Micro
  113.          Software's QuickLink II, a commerical program included with many
  114.          fax modems.
  115.  
  116.          Support for Fax Talk Plus-style fax images will be added in a
  117.          later version.  WinFax support may or may not be offered.  It
  118.          depends on whether or not Delrina will release the information to
  119.          me I need.
  120.  
  121.          BGFAX supports Desqview's alternate video buffer zone, if used,
  122.          and will return ticks to other tasks.  BGFAX also issues an
  123.          Interrupt 28h call every now and then for OS/2 time slices.
  124.  
  125.          This program was compiled under Borland's Turbo Pascal 7.0.
  126.  
  127.          I routinely test BGFAX with a Supra Fax Modem (v.32bis external
  128.          with V1.80-02 firmware), a USR 21.6K terbo (with 12/08/93
  129.          firmware), a Hayes Optima 288 (V3.1 firmware), and a generic
  130.          SIERRA based 2400 data/9600 fax modem from Computer City.
  131.  
  132.          If you wish to put BGFAX in DEBUG mode (where it logs most of the
  133.          strings sent out and in from the modem in a DEBUG.LOG file), you
  134.          must set the following environment variable:
  135.  
  136.               SET FAX=DEBUG
  137.  
  138.          -------------------------------------------------------------
  139.          TALKING WITH THE COM PORT
  140.          -------------------------------------------------------------
  141.  
  142.          BGFAX does not require a FOSSIL driver.  It will normally use its
  143.          own internal communications routines to talk to your UART chip.
  144.          BGFAX supports the 8250, 16450, and 16550A chips directly.
  145.  
  146.          BGFAX assumes...
  147.  
  148.              COM1=3F8x4     COM2=2F8x3     COM3=3E8x4     COM4=2E8x3
  149.  
  150.          NONSTANDARD PORTS
  151.          =================
  152.  
  153.          If you are using a nonstandard port configuration, whenever BGFAX
  154.          requires a port number to be entered (such as po=2), instead of
  155.          entering the port number, enter the base address and IRQ seperated
  156.          by an 'x' character (such as po=2E8x5).  BGFAX requires the base
  157.          address be given in HEXIDECIMAL notation, and the IRQ to be given
  158.          in DECIMAL notation, since all IO boards seem to use this method.
  159.          If your COM3 was at 2F8h and IRQ 10, you would say (in the .CNF):
  160.  
  161.               po=2f8x10
  162.  
  163.          THE 19200 SHIFT
  164.          ===============
  165.  
  166.          Many Class 2 fax modems require a DTE shift to 19200 bps when
  167.          performing fax operations.  Yes, even if you have your port locked
  168.          at 57600 bps, BGFAX will temporarily shift the speed to 19200.  It
  169.          should be noted, however, that there are some exceptions to this
  170.          rule.  Some modem manufactuers did not follow the 19200 shift
  171.          method, and thus, you will have to tell BGFAX if you have one of
  172.          these special modems.  The ZyXEL modem is a prime example.  Also,
  173.          it has been brought to my attention that some Zoom modems also do
  174.          not need to be shifted to 19200 bps.  (Which ones?  It seems very
  175.          random.  You'll have to discover for yourself with trial and
  176.          error.)  So, how do you tell BGFAX _not_ to shift to 19200?
  177.  
  178.          Putting an exclamation mark (bang) after the port will tell BGFAX
  179.          not to shift the DTE speed to 19200 when receiving a fax.  (i.e.,
  180.          whenever you want to specify COM2, do as as "2!" instead of "2").
  181.  
  182.          Class 1 and Class 2.0 fax modems do not require the 19200 DTE
  183.          shift and BGFAX already knows this.
  184.  
  185.          IF YOU ARE NUTS AND WANT TO USE BGFAX WITH A FOSSIL DRIVER
  186.          ==========================================================
  187.  
  188.          If for some reason, you NEED to use a FOSSIL driver (this is not
  189.          recommended), you can put the letter 'F' in front of the COM port
  190.          designator and BGFAX will use your FOSSIL driver.  BGFAX treats
  191.          COM1 as F1, COM2 as F2, etc.  So, to use FOSSIL-COM2:
  192.  
  193.               po=F2
  194.  
  195.          If you are using a Class 2 fax modem that requires a 19200 shift
  196.          when operating in fax mode, if you "lock" your FOSSIL driver,
  197.          BGFAX will not be able to shift the port speed to 19200!  You will
  198.          have to tell your FOSSIL driver to "unlock" the port, i.e.:
  199.  
  200.               BNU /L0=0
  201.               BGFAX /FAX C:\BGFAX F1 Z
  202.               BNU /L0=38400
  203.  
  204.          Note the "F1" means for BGFAX to use the FOSSIL on COM1.  The
  205.          "/L0=0" parameter on BNU means for BNU to "unlock the port".
  206.          Why?  Because, the FOSSIL driver will *ignore* a DTE shift request
  207.          when its in "locked" mode.  BGFAX will be unable to relock your
  208.          port with the FOSSIL driver, so that is the purpose of the
  209.          second BNU line.  It re-locks COM1 at 38400 (or whatever) rate
  210.          you want to use.
  211.  
  212.          Rememeber that BGFAX has its own communications routines, and
  213.          doesn't need to use a FOSSIL driver, but it can if you absolutely
  214.          have to use one.
  215.  
  216.          OPTIONS WHEN NOT USED IN THE BGFAX.CNF FILE
  217.          ===========================================
  218.  
  219.          If you are running BGFAX in rear end mode (using one of the /Fxxxx
  220.          parameters on the command line), BGFAX does NOT look for the
  221.          BGFAX.CNF file.  Everything is passed to it on the command line,
  222.          so if you needed to specify an alternate address and IRQ:
  223.  
  224.               bgfax /fax c:\bgfax 3f8x9 z
  225.  
  226.          ...or use a FOSSIL driver on COM4...
  227.  
  228.               bgfax /fax c:\bgfax F4 z
  229.  
  230.          -------------------------------------------------------------
  231.          RECOMMENDED INITIALIZATION AND ANSWER STRINGS
  232.          -------------------------------------------------------------
  233.  
  234.          This section tells you the recommended initialization and answer
  235.          strings for your modem.  It will not tell you what the commands
  236.          do.  Look in the "Quick tutorial" second to find that out.
  237.  
  238.          Class 2 modems (Supra v.32bis, PPI, Zoom, etc.)
  239.             Init-1 ... ATZ|
  240.             Init-2 ... AT+FCR=1;+FDCC=1,5,0,2,0,0,0,0|
  241.             Init-3 ... AT+FLID="713 555 1212"|
  242.             Answer ... AT+FAA=1;A|
  243.             Dial ..... ATDT
  244.  
  245.          Class 2.0 modems (USR 21.6K)
  246.             Init-1 ... ATZ|
  247.             Init-2 ... AT+FCLASS=2.0|
  248.             Init-3 ... AT+FLI="713 555 1212"|
  249.             Answer ... AT+FCLASS=2.0|~AT+FAA=1+FNR=1,1,1;A|
  250.             Dial ..... AT+FCLASS=0DT
  251.  
  252.          Class 1 modems (Hayes Optima 288, Supra 144LC)
  253.             Init-1 ... ATHZ|
  254.             Answer ... AT+FCLASS=1|~AT+FAE=1;A|
  255.             Dial ..... AT+FCLASS=0DT
  256.  
  257.          ZyXEL modems (ZyXEL E, S, E+, S+, etc.)
  258.  
  259.             Init-1 ... ATZ|
  260.             Init-2 ... AT#P713 893 9124
  261.             Init-3 ... AT#B1+FCLASS=6|
  262.             Answer ... ATA|
  263.             Dial ..... ATDT|
  264.  
  265.          -------------------------------------------------------------
  266.          QUICK TUTORIAL ON FAX COMMANDS AND ODDITIES
  267.          -------------------------------------------------------------
  268.  
  269.          AT+FCLASS=?
  270.          ===========
  271.          This command asks the modem to tell you what fax classes it
  272.          is compatible with.  It will respond with something like:
  273.  
  274.          0,1,2  or  0,2  or  0,1,2.0  or  0,2,6  or  0,1,2,6  or  ERROR
  275.  
  276.              0 = Data
  277.              1 = Fax Class 1 capable
  278.              2 = Draft Fax Class 2 "compatible"
  279.            2.0 = Fax Class 2.0 capable
  280.              6 = ZyXEL or Rockwell voice mode compatible
  281.          ERROR = no fax capabilities
  282.  
  283.          GROUP and CLASS
  284.          ===============
  285.  
  286.          Many people are often confused between the terminology "GROUP" and
  287.          "CLASS" with regards fax modems.
  288.  
  289.          ALL FAX EQUIPMENT is "GROUP 3" compatible.  This includes fax
  290.          machines, fax modems, standalone PC fax cards, etc.  Group 3 just
  291.          defines the fax specifications, e.g., black-and-white, the
  292.          resolutions, etc.
  293.  
  294.          "CLASS" refers only to fax modems.  CLASS has NOTHING AT ALL to do
  295.          with fax machines.  Class 1, Class 2 and Class 2.0 are different
  296.          methods of sending COMMANDS to a fax modem from a computer serial
  297.          port.  Many fax modems offer the Class 2 command set.
  298.  
  299.          GROUP III
  300.          =========
  301.  
  302.          Most Group III fax images are 1728 bits across.  A normal
  303.          resolution page is approximately 1100 scan lines long, while
  304.          a high resolution page is approximately 2200 scan lines long.
  305.  
  306.          When the fax devices are handshaking, this occurs at 300 bps,
  307.          regardless of what the negoiated fax DCE rate is (i.e., 9600).
  308.  
  309.          Computer fax modems use v.17 modulation at 12000 and 14400,
  310.          v.29 at 7200 and 9600, and v.27ter at 2400 and 4800 bps.
  311.  
  312.          Fax images can use one or two-dimensional modified huffman
  313.          encoding.  One-dimensional is known as MH, and two-dimensional is
  314.          known as MR (Modified Read).  MR encoding sends one scan line,
  315.          followed by special bits that spell out differences between the
  316.          above line and the current line.  Some higher tech machines also
  317.          use MMR encoding (Modified, Modified Read).  MMR encoding sends
  318.          the first scan line of the page, followed by x-number of
  319.          difference lines, rather than just 1 difference line.  BGFAX
  320.          currently supports only MH encoding.  The remote fax machines will
  321.          always default to MH encoding since MR and MMR is not available.
  322.  
  323.          Fax images have things known as EOLs and RTC.  EOL stands for
  324.          End-Of-Line and is represented as 000000000001.  Fax viewing
  325.          programs read through the fax image file, scan line by scan line.
  326.          They know where each scan line ends by searching for all the EOLs
  327.          in the file.  RTC, Return-To-Control, is a series of six EOLs.
  328.          The RTC sequence usually indicates an "end of page".  No huffman
  329.          codes start with 11 zeros like the EOL character.  Why am I
  330.          telling you all this?  Because many older fax machines send "fill"
  331.          to your fax modem when receiving.  "Fill" is just extraneous zeros
  332.          that are stored on your hard disk that take up space.  For
  333.          example, you might have an scan line that ends with...
  334.  
  335.               0000000000000000000000000000000000000000000000000000000000001
  336.  
  337.          ...but, all that is actually needed is 000000000001.  As you can
  338.          see, many extraneous zeros could be filtered from this line to
  339.          reduce the size of fax image files a few bytes per scan line.
  340.  
  341.          Another interesting Group III fact is that a "training check" is
  342.          performed by fax machines shortly after they connect.  The
  343.          training check consists of the sender sending zeros for
  344.          approximately 1.5 seconds (at the negoiated rate, i.e., 9600
  345.          bps).  The receiving end will count all the zeros received, and
  346.          any non-zeros received (bad bits that got corrupted by noise over
  347.          the phone line), and if 10% of the bytes received were bad
  348.          (non-zero), the receiving end will request a RETRAIN.  This
  349.          usually involves a downshift of 2400 bps, i.e., 9600 -> 7200 bps.
  350.          After the shift, another training check will be performed.
  351.  
  352.          AT+FAA=1
  353.          ========
  354.          This command will put a Class 2/Class 2.0 modem in ADAPTIVE
  355.          ANSWERING mode.
  356.  
  357.          Your modem will properly mate with either a standard modem
  358.          data call or a fax machine/fax modem.  Some modems, such as the
  359.          Supra, will report a "FAX" response the instant a fax CNG tone is
  360.          heard from the remote end.
  361.  
  362.          All modems, on true fax calls, will report a "+FCON" response code
  363.          when the fax connection is truly established.  (This is similar to
  364.          a "CONNECT 9600" or "CONNECT 14400" on a data call.)
  365.  
  366.          Many modems are slightly brain dead and will forget the +FAA
  367.          setting when another command is issued to the modem.  To ensure
  368.          you always answer in adaptive mode, rather than using "ATA" to
  369.          answer the phone, use the following: "AT+FAA=1;A".
  370.  
  371.          The ";", semicolon, is used as a seperator for fax commands.  Some
  372.          modems, such as the Supra, do not require it.  Others, such as the
  373.          PPI, will "ERROR" out if the semicolons are not used.
  374.  
  375.          Please note that many modem manufactuers did not test adaptive
  376.          answering as much as they should have before they released their
  377.          modems.  Some modems won't allow low speed callers into your BBS
  378.          when adaptive answering is enabled.  Others won't allow high
  379.          speed callers into your BBS when adaptive answering is enabled.
  380.          If this is happening, you will need to call your modem manufactuer
  381.          and request new ROMs if any are available.  For example, the 14.4K
  382.          PC Logic modem's adaptive answering doesn't work at all.  Even
  383.          well known companies sometimes overlook adaptive answering.  A key
  384.          example is that early version of the USR 21.6K modem would lock up
  385.          whenever an HST call would come into their BBS when adaptive answer
  386.          mode was enabled.
  387.  
  388.          The Supra Fax Modem, for example, is pretty good concerning
  389.          adaptive answering.  (Note that very earlier versions of the
  390.          Supra, did not offer adaptive answering until the 1.2-H and 1.2-J
  391.          ROMs appeared on the scene.)  However, many older fax machines do
  392.          not send out a CNG tone when they are engaged.  Many fax modems,
  393.          including the Supra, won't know what to do, and will assume the
  394.          old fax machine is really a data caller.  Again, this is not good,
  395.          but its not that much of a problem.  Tell the operator of the old
  396.          fax machine to push their "START" button *IMMEDIATELY* after dialing
  397.          the last digit of the telephone number instead of waiting to hear
  398.          the fax tones on our end like many office people do.
  399.  
  400.          AT+FAE=1
  401.          ========
  402.          This is the Class 1 command to enable adaptive answering.
  403.  
  404.          AT+FCR=1
  405.          ========
  406.          This is a Class 2/2.0 command to give your modem PERMISSION to
  407.          take faxes.  Note that Class 2.0 modems default +FCR=1, so you
  408.          won't need to use this command.
  409.  
  410.          AT+FLID="713 893 9124"
  411.          ======================
  412.          ( The Class 2.0 command is AT+FLI="713 893 9124" )
  413.  
  414.          The above command sets your modems fax ID string.  This is the
  415.          string that is send to the remote end on fax connects.  (It's the
  416.          deal that's printed on the little 'confirmation reports' that many
  417.          fax machines make.)  The fax ID can ONLY BE A MAXIMUM OF *20*
  418.          CHARACTERS.  If you try to stuff more than 20 characters in a fax
  419.          ID string, the modem will respond with an "ERROR".  DO NOT USE
  420.          HIGH-BIT ASCII CHARACTERS IN THIS STRING.  Use only simple
  421.          letters, numbers, and punctuation marks.  (High-bit ASCII
  422.          characters include foreign accented letters, inverted question
  423.          marks, etc.)
  424.  
  425.          I've been told that some older fax machines will go nuts if you
  426.          use a fax ID with ALPHABETIC letters and that the only true valid
  427.          values, as specified by the CCITT (PLUS, SPACE, DASH, and the
  428.          numbers ZERO through NINE).  I've never seen this happen
  429.          personally, but am informing you of it nevertheless.
  430.  
  431.          Class 1 fax modems have their ID set by the fax software.
  432.  
  433.          AT+FDCC=1,5,0,2,0,0,0,0
  434.          =======================
  435.  
  436.          The above command is what the power on defaults to a 14400 fax
  437.          modem are, with one exception.  The first number, 1, allows your
  438.          fax modem to accept high resolution fax documents.  The power on
  439.          default to most modems are to accept only low resolution
  440.          documents.  The second number, 5, allows your fax modem to use fax
  441.          speeds up to 14400 bps.
  442.  
  443.          If you issue the above command on a fax modem with an upper limit
  444.          of 9600 on fax tranmissions, you will receive an "ERROR" or cause
  445.          the modem to behave odd.  Use this string on a 9600 fax modem:
  446.  
  447.          AT+FDCC=1,3,0,2,0,0,0,0
  448.  
  449.          The remaining numbers are not that important.  Changing them
  450.          around, though, may cause BGFAX to fail.  The command can also be
  451.          abbreviated to "AT+FDCC=1,5" or "AT+FDCC=1,3".
  452.  
  453.          You do not need to use this command on Class 1 and 2.0 modems.
  454.  
  455.          STACKING
  456.          ========
  457.          A single command string can be made using what we need ...
  458.  
  459.          AT+FAA=1;+FCR=1;+FLID="713 893 9124";+FDCC=1,5,0,2,0,0,0,0
  460.  
  461.          However, if you are using BGFAX in rear end mode with a Fido
  462.          mailer, you may have a hard time of making an initialization
  463.          string that long, so you may be required to split the line into a
  464.          few pieces.  Remeber to make your ATA command "AT+FAA=1;A" if it
  465.          is possible to change in your mailer.
  466.  
  467.          The +FDCC string must come at the end of the stack of commands!
  468.  
  469.          AT+FMFR?
  470.          ========
  471.          ( The Class 2.0 command is AT+FMI? )
  472.  
  473.          If you want to find out who makes the fax datapump for your modem,
  474.          this command should tell you if you enter it in while in terminal
  475.          mode.  My Supra (and many others) report "ROCKWELL".  My Cheap
  476.          2400 data, 9600 S/R fax modem reports "SIERRA".  Others report
  477.          "EXAR" and other things as well.
  478.  
  479.          AT+FNR=1,1,1
  480.          ============
  481.  
  482.          This is a Class 2.0 command that tells the USR modem to let BGFAX
  483.          know many details about the current fax reception, such as the
  484.          resolution of the fax, what the fax DCE speed is currently
  485.          negotiated at, etc.  Class 2 modems always report this.  However,
  486.          for some strange reason, the Class 2.0 spec writers thought it's
  487.          be "nice" to have the fax program NOT knowing this critical
  488.          information.  I can think of no logically reason for this command
  489.          existing, but if you forget to set it, your faxes on your Class
  490.          2.0 modems may look elongated or smashed together.
  491.  
  492.          AT#B1+FCLASS=6
  493.          ==============
  494.  
  495.          This is a ZyXEL fax command.  This is of use only to ZyXEL owners,
  496.          and the ZyXEL user manual explains it very nicely.
  497.  
  498.          FAX MODE
  499.          ========
  500.  
  501.          Probably 95% of you will be using BGFAX with a high speed modem
  502.          (v.32 or v.32bis).  Many of you may have started off with slower
  503.          300, 1200, or 2400 modems from long ago.  If you can remember back
  504.          that far, when an incoming data call came in, you would see a
  505.          string like "CONNECT 1200".  If your port was set at 2400, you
  506.          would garbage on the screen unless you shifted your bps rate down
  507.          to 1200 to match that of the caller.  Many newer terminal programs
  508.          refer to this speed shift as "Autobaud".
  509.  
  510.          Modern modems require your serial port be locked at a specific
  511.          speed (such as 19200, 38400, 57600, etc.) so that you can achieve
  512.          higher thruput via compression engines such as MNP and v.42bis.
  513.          The modem-to-modem speed may only be 14400, but the modem-to-
  514.          computer speed stays "locked" at 38400.  Autobaud is not required,
  515.          and if used, would result is garbage on the screen.
  516.  
  517.          Why am I telling you all this?  Well, I don't know who's silly
  518.          idea it was, but the powers that be decided that fax modems should
  519.          use the ancient method of changing the port rate when a fax is
  520.          incoming or outgoing.
  521.  
  522.          After your modem reports the result code "+FCON" all further
  523.          communications *MUST* be done at 19200 bps, even if you are locked
  524.          at 38400 or 57600.  If the port speed is not relocked at 19200,
  525.          nothing but garbage will come on the screen.
  526.  
  527.          I'm telling you this because I frequently get mail asking me why
  528.          I'm changing the port speed to 19200.  It's not my fault!  That's
  529.          the way is has to be done!  The only modem that I know that does
  530.          not require this idiotic speed shift is the ZyXEL modem.  In fact,
  531.          a special option must be used to tell BGFAX you are using a ZyXEL
  532.          or BGFAX will fail as it will try talking to the ZyXEL modem at
  533.          19200 instead of 57600 or whatever rate it's locked at.
  534.  
  535.          Note that the 19200 shift is not needed on Class 1 and 2.0 modems.
  536.  
  537.          BIT ORDER
  538.          =========
  539.  
  540.          Class 2 fax modems receive in reverse bit order and transmit in
  541.          direct bit order.  Actually, this is not in the Class 2 spec, but
  542.          a bug in Rockwell's Class 2 implementation.  This reverse bit
  543.          order bug became so wide spread, that other fax modem manufactuers
  544.          now have to receive in reverse bit order to make their modems
  545.          compatible with existing fax software.  :-)
  546.  
  547.          BGFAX will save all incoming fax files in direct bit order, so it
  548.          effectively flips all the bytes on the fly when receiving.
  549.  
  550.          Class 1, Class 2.0, and ZyXEL modems receive and transmit in
  551.          direct bit order.
  552.  
  553.          -------------------------------------------------------------
  554.          FRONTEND/HOST MODE
  555.          -------------------------------------------------------------
  556.  
  557.          If you want BGFAX to answer the phone, BGFAX is started up using
  558.          the /HOST command line parameter.
  559.  
  560.          If you plan on using BGFAX in Frontend mode, you need to do a
  561.          couple of things first.
  562.  
  563.          1. An evironment variable called BGFAX needs to be inserted in
  564.             your AUTOEXEC.BAT or someother batch file.  Example:
  565.  
  566.             SET BGFAX=C:\BGFAX
  567.  
  568.             This environment variable points to the location of your BGFAX
  569.             configuration file and the directory where faxes will be
  570.             received into.
  571.  
  572.             (Note, some people don't like cluttering their environment with
  573.             variables.  You can start up /HOST mode using a different config
  574.             file other than BGFAX.CNF, by using the "$" modifier, e.g.:
  575.  
  576.               BGFAX /HOST /50 $C:\BAT\ROBIN.CNF
  577.               BGFAX /SEND C:\BGFAX\FAX0001.FAX 893-9124 $C:\BAT\BATGIRL.CNF
  578.  
  579.             The "$" modifer must be the last thing on the command line.
  580.             Instead of looking for a BGFAX.CNF file as specified by the
  581.             BGFAX environment variable, this will cause BGFAX to look for
  582.             a "ROBIN.CNF" (in host mode) or "BATGIRL.CNF" if sending.
  583.             The "$" modifer has NO EFFECT on rear end mode operation.)
  584.  
  585.          2. Make sure the BGFAX.CNF configuration file is in the directory
  586.             pointed to by the BGFAX environment variable and make any
  587.             changes you think necessary.  The included configuration file
  588.             is self explantory.  I won't repeat the format here.
  589.  
  590.          3. BGFAX can exit with 7 possible internal errorlevels:
  591.  
  592.                6 - host mode idle for more than x minutes
  593.                4 - fax was received
  594.                3 - local logon
  595.                2 - data call
  596.                1 - restart batch file
  597.  
  598.             If no errorlevel is encountered, it means the sysop aborted
  599.             BGFAX by pressing the [Esc] key or a serious error occurred.
  600.  
  601.          4. When BGFAX is waiting for a call, pressing Ctrl-R will reset
  602.             the on screen counters.  Ctrl-A will force BGFAX to send the
  603.             answer string to the modem.
  604.  
  605.          5. If you some reason, you want to use the USR Class 2.0 modem in
  606.             Class 1 mode with BGFAX's /HOST mode, you will need to use the
  607.             /ATO switch which will cause BGFAX to send an "ATO" to the
  608.             modem after the "DATA" response is received.
  609.  
  610.          6. When a data call comes in, BGFAX creates a DOBBS.BAT file that
  611.             looks like so:
  612.  
  613.             C:\BGFAX\EXEBBS.BAT 9600 1 528 /ARQ
  614.             
  615.             The first parameter is the DCE data speed, then the com port,
  616.             number of minutes until the next event, and then the error
  617.             correcting string, if any.  The EXEBBS.BAT file must be created
  618.             by you so that your bulletin board software is loaded up in
  619.             frontend mode (ie., the data connection is already hot.)
  620.  
  621.                  %1 -> the DCE speed, modem-to-modem real connect speed
  622.                  %2 -> the COM port
  623.                  %3 -> number of minutes until the next event
  624.                  %4 -> error correction/reliable mode indicators
  625.  
  626.          DOBBS.BAT theory
  627.          ================
  628.  
  629.          If you have never used a frontend program uses DOBBS.BAT theory,
  630.          there are several things you need to know.  You have to be pretty
  631.          confident in DOS and batch files, or you will get lost very
  632.          easily.  First, you need a main batch file that runs BGFAX.  Let's
  633.          call this FBBS.BAT:
  634.  
  635.               @echo off
  636.               c:
  637.               cd\bgfax
  638.               bgfax /host
  639.               if errorlevel 4 goto faxrcvd
  640.               if errorlevel 3 goto datacall
  641.               if errorlevel 2 goto datacall
  642.               if errorlevel 1 fbbs.bat
  643.               goto end
  644.               :faxrcvd
  645.                 rem [you can put a printing batch here if you want]
  646.                 %bgfax%\doprint.bat
  647.                 del %bgfax%\doprint.bat
  648.               :datacall
  649.                 rem [errorlevel 3 is local login, 2 is data caller]
  650.                 %bgfax%\dobbs.bat
  651.               :end
  652.  
  653.          Note that DOS requires all if-errorlevel statements to go in
  654.          DESCENDING ORDER!  (255,254,253,...,4,3,2,1).  This is a fact that
  655.          many people forget.
  656.  
  657.          This FBBS.BAT file will run BGFAX and when a data caller calls
  658.          your system, BGFAX will exit with an errorlevel of 3.  This will
  659.          cause the batch file to jump to the ":datacall" label.  Here, the
  660.          line "%bgfax%\dobbs.bat" is executed, causing DOS to shift control
  661.          of the computer to the DOBBS.BAT file.  Rememeber, this is a file
  662.          that BGFAX creates!  You do not need to make a DOBBS.BAT file.
  663.          The DOBBS.BAT then executes _another_ batch file called EXEBBS.BAT
  664.          which will look something like:
  665.  
  666.               @echo off
  667.               bbsprog /f:%1:%2
  668.               fbbs
  669.  
  670.          The EXEBBS.BAT file will look different for EVERY different type
  671.          of BBS software!  PC Board, Wildcat, GT, etc. all use different
  672.          formats.  You will have to look up the info for the EXEBBS.BAT
  673.          file in your BBS user's manual.  I can't help you with that.
  674.          Notice that the last line "fbbs" restarts the original FBBS.BAT
  675.          file that runs BGFAX in /HOST mode.
  676.  
  677.          In review: (1) Modify FBBS.BAT to meet your needs, (2) BGFAX will
  678.          MAKE a DOBBS.BAT file by itself, (3) YOU will need to MAKE an
  679.          EXEBBS.BAT file, (4) the EXEBBS.BAT file must restart FBBS.BAT.
  680.  
  681.          Do not use the CALL statement anywhere unless you really know what
  682.          you are doing.  "FBBS.BAT" and "CALL FBBS.BAT" causes two
  683.          completely different things to happen.  Only experienced DOS/batch
  684.          file writers need to experiment with that.
  685.  
  686.          -------------------------------------------------------------
  687.          INITIALIZATION MODE
  688.          -------------------------------------------------------------
  689.  
  690.          If you want BGFAX just to initialize the modem, you can have it do
  691.          so with the BGFAX /INIT parameter.  BGFAX will get the port,
  692.          speed, and initialization strings from the BGFAX.CNF file in the
  693.          directory specified by the BGFAX environment variable.
  694.  
  695.          This mode is provided for people who need to use BGFAX in rear end
  696.          mode, but their Fido mailers (or BBS software) do not allow them
  697.          to use the long initialization strings required for fax usage.
  698.  
  699.          -------------------------------------------------------------
  700.          REAR END MODE (FIDO MAILERS, ETC.)
  701.          -------------------------------------------------------------
  702.  
  703.          Rear end mode is useful for those of us who are FidoNet members
  704.          where a Fido mailer is required to be running 24 hours a day.  It
  705.          will be your job to figure out how to get your mailer to exit to
  706.          BGFAX when your modem informs the mailer a fax call is coming
  707.          through.  (See the HELPME.ARJ file for hints on specific mailers.)
  708.  
  709.          You will need to know the result code your modem sends when an
  710.          incoming fax call is detected.  Some modems send TWO fax connect
  711.          strings.  For example, the Supra will send "FAX" followed by an
  712.          "+FCON" response about 2 seconds later.  The ZyXEL will send
  713.          "CONNECT FAX" followed immediately by "ZyXEL".  Most fax modems
  714.          report only one string though.  Use this chart for reference:
  715.  
  716.          Result   Modems
  717.          ======   ====================================================
  718.          FAX      Supra, Zoom, Hayes, most Rockwell based chipsets
  719.          +FCON    PPI, other Class 2 modems
  720.          +FCO     USR 21.6K and other Class 2.0 modems
  721.  
  722.          You need to configure your mailer (or BBS software) to exit
  723.          IMMEDIATELY upon receipt of the proper fax result code.  You
  724.          need to call BGFAX in the following manner:
  725.  
  726.          BGFAX /how [faxpath port faxtype [pid]]
  727.  
  728.          FAXPATH will be the directory where incoming faxes are to be
  729.          placed.  PORT is a valid communications port from 1 to 4, or,
  730.          optionally, a hexidecial base address and IRQ formatted as
  731.          followed "3F8x5".  Also, optionally, if the port has a bang, !,
  732.          following it, it will force the port to stay locked at the current
  733.          speed rather than shifting to 19200 on fax connects.  FAXTYPE is a
  734.          single character 'Z' or 'Q'.  'Z' for ZyXEL ZFAX format, 'Q' for
  735.          Smith Micro Software's Quick Link II fax format.
  736.  
  737.          The "/how" deal is the most critical switch.  There are three
  738.          possible settings.
  739.  
  740.               /FAX   ... Modem reports "FAX" or "CONNECT FAX".
  741.                          BGFAX will automatically detect whether it should
  742.                          use Class 2 (Supra, Zoom) or the ZyXEL fax mode
  743.                          based on the next message (ie, "+FCON" or "ZyXEL").
  744.  
  745.               /FAX:713_893_9124     If your modem in Class 1, try one of
  746.               /FHAY:713_893_9124    these two options.
  747.  
  748.               /FAST  ... Modem reports "+FCON" (PPI, other Class 2 modems)
  749.               /FCON  ... Try this option if /FAST doens't work.
  750.  
  751.               /FCO   ... Modem reports "+FCO" (USR 21.6K)
  752.               /FCOS  ... Try this option if /FCO doesn't work.
  753.  
  754.               /FZYX  ... ZyXEL owners use this if /FAX doesn't work.
  755.  
  756.          Here is a schematic of how each option behaves:
  757.  
  758.               /FAX [ Supra, ZyXEL, i.e. all modems that report "FAX" ]
  759.                 1. keeps port at locked DTE
  760.                 2. waits for "+FCON"     _or_  2. waits for "ZyXEL"
  761.                 3. drops port to 19200         3. waits for high CTS
  762.                 4. waits for "OK"              4. sends <DC2>
  763.                 5. sends "AT+FDR"
  764.  
  765.               /FAX:713_893_9124 [ Supra LC modem, Class 1 modem ]
  766.                 1. keeps port at locked DTE
  767.                 2. waits for "CONNECT"
  768.                 3. begins sending Class 1 HDLC frames
  769.  
  770.               /FHAY:713_893_9124 [ Hayes 288, other Class 1 modems ]
  771.                 1. keeps port at locked DTE
  772.                 2. blindly starts sending Class 1 HDLC frames
  773.  
  774.               /FAST [ PPI, i.e. all modems that report "+FCON" ]
  775.                 1. drops port to 19200
  776.                 2. waits for "OK"
  777.                 3. sends "AT+FDR"
  778.  
  779.               /FCON [ PPI, use this if above options don't work ]
  780.                 1. drops port to 19200
  781.                 2. blindly sends "AT+FDR"
  782.  
  783.               /FCO  [ USR, i.e. all Class 2.0 modems that report "+FCO" ]
  784.                 1. keeps port at locked DTE
  785.                 2. waits for "OK"
  786.                 3. drops port to 19200 _only if_ DTE rate is 38400
  787.                    (leaves port alone if set at 19200, 57600 or 115200)
  788.                 4. sends "AT+FDR"
  789.  
  790.               /FCOS [ USR, i.e. all Class 2.0 modems that report "+FCO" ]
  791.                 1. drops port to 19200 _only if_ DTE rate is 38400
  792.                    (leaves port alone if set at 19200, 57600 or 115200)
  793.                 2. blindly sends "AT+FDR"
  794.  
  795.               /FZYX  [ ZyXEL, use this only if /FAX doesn't work ]
  796.                 1. waits for high CTS
  797.                 2. sends <DC2>
  798.  
  799.          When a fax is inbound, I call BGFAX in rearend mode with the
  800.          following command line for my Supra:
  801.  
  802.               BGFAX /FAX C:\BGFAX 1 Z
  803.               bgfax /fax c:\bgfax f3 z
  804.               bgfax /fax c:\bgfax 3f8x7 z
  805.  
  806.          Using my Hayes 288, example command line options might be:
  807.  
  808.               bgfax /fhay:713_893_9124 c:\bgfax 1 z
  809.  
  810.          ...note that the ID string MUST be presented on the command line
  811.          when you are receiving with a Class 1 modem in rear end mode.
  812.          In Class 1, the fax software is responsible for sending the ID
  813.          string to the remote machine.  (In contrast to Class 2/2.0 modems,
  814.          which automatically send the ID to the remote machine.)
  815.  
  816.          The /FAX means that I used the modem response "FAX" as a trigger
  817.          for FD (see BGFAX.HLP for more details), C:\BGFAX is the path
  818.          where I want all faxes to be stored, "1" is the communications
  819.          port, and the "Z" represents I want faxes saved in ZyXEL's ZFAX
  820.          image format.
  821.  
  822.          If you want to run BGFAX on a multinode system, an optional fifth
  823.          parameter can be used.  This fifth parameter can be up to three
  824.          characters and it is called the PID.  Example:
  825.  
  826.               BGFAX /FAX C:\BGFAX 1 Z 99
  827.  
  828.          The only difference between the command above and the previous one
  829.          is that rather than making a BGFAX.LOG, all log entries will be
  830.          written to a file called BGFAXpid.LOG, in this case, BGFAX99.LOG.
  831.  
  832.          -------------------------------------------------------------
  833.          MISCELLANEOUS /HOST AND REAREND (/Fxxx) OPTIONS
  834.          -------------------------------------------------------------
  835.  
  836.          Stop that hopping blue box
  837.          ==========================
  838.  
  839.          In /HOST mode, the BGFAX status box hops around the screen every
  840.          10 seconds to prevent screen burn-in.  However, some people got
  841.          dizzy watching the box, and others complained that the screen move
  842.          was taking up too many time slices in multitasking environment.
  843.          The /NH parameter will force "No Hop" mode which has considerably
  844.          less screen writes when sitting idle.
  845.  
  846.               bgfax /host /nh
  847.  
  848.          50 Line Mode
  849.          ============
  850.  
  851.          BGFAX can use VGA's 50 line mode if you wish by using the /50
  852.          command line parameter:
  853.  
  854.               bgfax /host /50
  855.               bgfax /send c:\bgfax\fax0004.fax 893-9124 /50
  856.               bgfax /fco c:\bgfax 1 z /50
  857.  
  858.          BGFAX and the USR 21.6K modem with September 93 chips
  859.          =====================================================
  860.  
  861.          If you are using BGFAX with the USR 21.6K modem, BGFAX will
  862.          default to use the 12/08/93 firmware revision.  If you wish to use
  863.          BGFAX with the 09/20/93 firmware, you will need to use the /OU
  864.          switch on the BGFAX command line.  Example:
  865.  
  866.               bgfax /host /ou
  867.               bgfax /fco c:\bgfax 4 q /ou
  868.  
  869.          ...DO NOT USE THE /OU SWITCH WITH ANY OTHER MODEM *EXCEPT* THE USR
  870.          21.6K WITH SEPTEMBER 1993 FIRMWARE!
  871.  
  872.          Turning off the alert sound BGFAX makes when it receives a fax
  873.          ==============================================================
  874.  
  875.          BGFAX will automatically sound an "alarm" to let you know when a
  876.          succesful fax reception occurs.  This "alarm" is annoying to some
  877.          people.  To disable the "alarm", use the /NS switch for No Sound
  878.  
  879.               bgfax /host /ns
  880.               bgfax /fast c:\bgfax 1 z /ns
  881.  
  882.          Telling Class 1 modems to receive at a maximum of 9600 bps
  883.          ==========================================================
  884.  
  885.          If your Class 1 modem can receive at a maximum of 9600, strange
  886.          things will happen if you forgot to tell BGFAX this, since it will
  887.          default to tell the other side you will be using 14400 bps for fax
  888.          operations.  To force BGFAX to receive at a maximum of 9600 bps
  889.          with Class 1 faxmodems, use the /DIS:79 parameter, i.e.:
  890.  
  891.               bgfax /fhay:713_893_9124 c:\bgfax 1 z /dis:79 /ns
  892.  
  893.          Don't try using any other values on the /DIS: parameter.  It is
  894.          mainly available as a debuging option for me.
  895.  
  896.          TSR fax notification
  897.          ====================
  898.  
  899.          BGFAX comes with an optional TSR program (NFAX.COM) that will
  900.          place the word "FAX" on your screen whenever a successful incoming
  901.          fax occurs.  However, you must tell BGFAX that you wish to alert
  902.          NFAX.COM to display the message.  You can do this by using the /NF
  903.          switch.  Example:
  904.  
  905.               bgfax /fcon c:\bgfax 2 q /nf
  906.  
  907.          This will activate the NFAX.COM interrupt and cause the message to
  908.          get displayed.  To turn the message off, you can run the FAXOFF.COM
  909.          program contained in the BGFAX archive.  Remember, NFAX.COM is a
  910.          TSR and must be loaded in your AUTOEXEC.BAT properly if you wish
  911.          to use it with BGFAX.  It is totally optional!
  912.  
  913.          NFAX.COM/FAXOFF.COM techinical information:
  914.          ===========================================
  915.  
  916.          Here is a snip of the Turbo Pascal source code that tells NFAX.COM
  917.          to put the fax indicator on the screen:
  918.  
  919.               var
  920.                 regs : registers;
  921.               begin
  922.                 writeln('Activating "NFAX" interrupt.');
  923.                 regs.ah := 30; { nfax-function }
  924.                 regs.al := 21; { nfax-sub function }
  925.                 regs.bl := 95; { nfax-"FAX" attribute, white on purple }
  926.                 intr($55, regs); { nfax-tsr }
  927.               end;
  928.  
  929.          When you want to turn off the "FAX" alert message, you need to
  930.          run the included "FAXOFF.COM" file.  It basically issues the
  931.          same code above except that "regs.al := 22" instead of 21.
  932.          (Go into DEBUG and do an unassemble on the .COM file to see
  933.          exactly how to turn it off.)
  934.  
  935.          -------------------------------------------------------------
  936.          AFTER YOU RECEIVE THE FAX
  937.          -------------------------------------------------------------
  938.  
  939.          NAMING CONVENTION
  940.          =================
  941.          The name of the fax file will be FAXnnnn.xFX where "nnnn" is a
  942.          number that is padded with zeros and "x" is the letter "Z" or "Q"
  943.          depending upon which fax format you save the file in.  If you ever
  944.          see a BGFAX.$$$ file in your directory, it should *NOT* be there,
  945.          as it should have been renamed in the FAXnnnn.xFX format.  If it
  946.          is there, it means some kind of problem happened during the fax
  947.          reception.
  948.  
  949.          FAXIN.LOG
  950.          =========
  951.          BGFAX creates a BGFAX.LOG file that contains a bunch of
  952.          information that is mainly only for debug purposes.  A much
  953.          cleaner log file is called FAXIN.LOG and looks like this:
  954.  
  955. Date  Time  ET    Bytes   Rate  Filename     Remote Fax ID        Pgs  Notes
  956. -------------------------------------------------------------------------------
  957. 12-21 11:52 00:42   18183  9600*FAX0001.FAX  Unknown                2  Finished
  958. 12-21 18:04 00:38   18182  9600 FAX0002.FAX  Unknown                2  Not Done
  959. 12-22 21:30 00:29   17793 14400*FAX0003.FAX  7138939124             1  Finished
  960. 12-22 21:42 00:29   17541 14400 FAX0004.FAX  TRANQUILITY BASE       1  Finished
  961. 12-23 06:44 00:32   16941  9600*FAX0005.FAX  Null ID Received       1  Finished
  962. 12-25 17:21 01:22  107392 14400*FAX0006.FAX  7132424708             1  Finished
  963.  
  964.          The asterick between the fax DCE rate and the filename indicates
  965.          the fax was marked as high resolution.  "Not Done" under Notes
  966.          means that BGFAX believed more pages were to have followed, but
  967.          were not actually received.  "ET" is estimated time.  Everything
  968.          else is self explanatory.
  969.  
  970.          VIEWING/PCX CONVERSION
  971.          ======================
  972.  
  973.          You can use the included VIEW.EXE file to view the faxes you have
  974.          received.  It's use is quite simple:
  975.  
  976.               VIEW FAX0002.FAX
  977.  
  978.          ...will cause VIEW.EXE to start viewing operations on FAX0002.FAX.
  979.          Note that VIEW will default to VGA graphics mode.  If you need to
  980.          use EGA or CGA modes, do so like this:
  981.  
  982.               VIEW FAX0002.FAX /CGA   or  VIEW FAX0002.FAX /EGA
  983.  
  984.          When you are viewing the fax, you have a few options:
  985.  
  986.          Alt-F ... Flip the image (makes upside down and mirrors)
  987.          Alt-I ... Inverse the image (white-black -> black-white)
  988.          Alt-S ... Shrink current on-screen image to 1/3 width
  989.          PgDn .... go to next page
  990.          PgUp .... go to previous page
  991.          ...and the Up/Down/Right/Left arrows do their normal job.
  992.  
  993.          Note that viewing the fax, with my VIEW.EXE program, takes up
  994.          quite a bit of memory.  (It uses 216 bytes of memory for each scan
  995.          line, so a single high resolution fax page of 2200 lines uses
  996.          a minimum of 475K of memory!)
  997.  
  998.          If you want to convert a fax to PCX ...
  999.  
  1000.               VIEW FAX0002.FAX /PCX
  1001.  
  1002.          ...would create a FAX0002.P01 and FAX0002.P02 file.  (Two PCX
  1003.          files since there are two pages in this fax image.)
  1004.  
  1005.          A special option, /BO, is also available with VIEW.EXE.  /BO
  1006.          tells VIEW that you wish to flip all the bytes in the fax data
  1007.          stream before processing it.  This should NEVER need to be used,
  1008.          as it is for my debugging purposes only.  (Basically, using the
  1009.          /BO parameter will let VIEW display/convert reverse bit order
  1010.          faxes.  Normally, BGFAX will save all faxes in direct bit order,
  1011.          no matter what bit order the modem actually receives in.)
  1012.  
  1013.          Another special option, /DB, forces VIEW to display the bad scan
  1014.          lines of a fax image.  Normally, if VIEW encounters a bad scan
  1015.          line, it will display it is a dotted line going all the way across
  1016.          the width of the fax image.  If /DB is active, VIEW will put up to
  1017.          1728 bits of the incorrectly decoded scan line on the page.
  1018.  
  1019.          DOPRINT.BAT
  1020.          ===========
  1021.          After you successfully receive a fax, BGFAX will exit with an
  1022.          errorlevel of 4 and append (or create) a DOPRINT.BAT file.
  1023.  
  1024.          CALL C:\BGFAX\EXEPRINT.BAT C:\BGFAX\FAX0085.FAX
  1025.          CALL C:\BGFAX\EXEPRINT.BAT C:\BGFAX\FAX0086.FAX
  1026.  
  1027.          You do not have to do anything with this at all, but it is
  1028.          provided for those of you who wish to print faxes as they are
  1029.          received.  It will call the EXEPRINT.BAT file and pass it the
  1030.          parameter with the path and name of the fax file that was just
  1031.          received.  If you are using Smith Micro Software's Quick Link II,
  1032.          for example, and are one of those people that leave your printer
  1033.          on 24 hours a day, your EXEPRINT.BAT file might contain this:
  1034.  
  1035.          @echo off
  1036.          printfax %bgfax%\%1 24pin.qlp
  1037.  
  1038.          Remeber to delete the DOPRINT.BAT file after you process it.
  1039.  
  1040.          -------------------------------------------------------------
  1041.          SEND FAX MODE
  1042.          -------------------------------------------------------------
  1043.  
  1044.          Currently, if you want to send a fax to another person, the fax
  1045.          file must already be in either ZFAX or Quick Link II fax image
  1046.          format.
  1047.  
  1048.               BGFAX /SEND FAX0001.FAX 893-9124
  1049.  
  1050.          See the BGFAX.CNF file for more info, such as maximum amount of
  1051.          busy signals and failures before exit, etc.
  1052.  
  1053.          At this time, only previously converted fax files can be sent.
  1054.          (i.e., ASCII files have to be translated to ZFAX .FAX format or
  1055.          QLII .QFX format.)
  1056.  
  1057.          BGFAX can exit with three possible errorlevels when sending...
  1058.  
  1059.               errorlevel 5  -> fax sent successfully
  1060.               errorlevel 1  -> fax send failure
  1061.               no errorlevel -> file not found, keypress abort, etc.
  1062.  
  1063.          If the number is BUSY, BGFAX will try a few more times (the number
  1064.          of times specified in the MB= entry in the BGFAX.CNF file) and
  1065.          will pause for SW= number of seconds between dials.  If a failure
  1066.          occurs during handshaking or during the actual sending of the fax,
  1067.          BGFAX will terminate with an failure errorlevel.
  1068.  
  1069.          If you are a programmer, and need to use BGFAX to send faxes, but
  1070.          need more information than success or failure, you need to use the
  1071.          /ER switch on the BGFAX /SEND command line.  BGFAX will make only
  1072.          ONE attempt to send the fax in /ER mode (regardless of BUSY, etc.)
  1073.  
  1074.               bgfax /send fax0001.fax 893-9124 /er
  1075.  
  1076.          The following "Extended Results" are available:
  1077.  
  1078.               errorlevel 14 -> a timeout occurred
  1079.               errorlevel 13 -> no +FCON ever occurred (NO CARRIER, etc.)
  1080.               errorlevel 12 -> a failure after connect (+FHNG, no XON, etc.)
  1081.               errorlevel 11 -> "NO DIALTONE"
  1082.               errorlevel 10 -> "BUSY"
  1083.               errorlevel 7  -> the number is BLACKLISTED by the modem
  1084.               errorlevel 5  -> fax sent succesfully
  1085.               errorlevel 1  -> generic fax send failure
  1086.               no errorlevel -> file not found, keypress abort, etc.
  1087.  
  1088.          MISCELLANEOUS /SEND OPTIONS
  1089.          ===========================
  1090.  
  1091.          Some Class 2 modems have bugs and cannot send to all fax machines
  1092.          reliably in Class 2 mode.  Because of this, the /C1 parameter is
  1093.          available.  It causes BGFAX to force the use of Class 1 when
  1094.          sending:
  1095.  
  1096.               bgfax /send c:\bgfax\fax0001.fax 893-9124 /c1
  1097.  
  1098.          Some fax machines and fax modems don't operate very well together
  1099.          at 14400 speeds.  You can force BGFAX to use a lower maximum speed
  1100.          by putting the BPS rate after the send command, e.g.:
  1101.  
  1102.               bgfax /send:9600 fax0001.fax 893-9124
  1103.               bgfax /send:7200 fax0001.fax 893-9124
  1104.               bgfax /send:12000 fax0001.fax 1-713-893-9124 /c1
  1105.  
  1106.          Some Class 1 fax modems, when sending, send the first few scan
  1107.          lines on each page garbled unless there is a pause before the
  1108.          actual page data is sent.  Using the /HW command will force a
  1109.          small delay, which should clear up the pages on the receiving
  1110.          end.  The Hayes modem seems to need this wait, while the Supra
  1111.          will loose the connection if the delay is initiated.
  1112.  
  1113.               bgfax /send fax0001.zfx 893-9124 /hw
  1114.  
  1115.          A special option, /SMD, is available for my testing purposes only.
  1116.          You should NEVER use this option.  Basically, between each page,
  1117.          it will tell the remote fax machine another "document" is coming
  1118.          next, rather than the normal response that another "page" is
  1119.          coming next.  Example:
  1120.  
  1121.               bgfax /send fax0001.fax 893-9124 /smd
  1122.  
  1123.          REMEMBER, /SMD is only for testing purposes.  DON'T USE /SMD!
  1124.  
  1125.          FAXOUT.LOG
  1126.          ==========
  1127.  
  1128.          A FAXOUT.LOG file is created when sending out faxes to indicate
  1129.          the success or failure.  Here is an example:
  1130.  
  1131. Date  Time  ET    Bytes   Rate  Filename     Phone Number         Pgs  Notes
  1132. -------------------------------------------------------------------------------
  1133. 03-22 13:18 00:25    3882 14400 RESPOND.FAX  8939124                2  Finished
  1134. 03-22 13:18 00:11    3884 NOFAX RESPOND.FAX  8939124                0  Busy
  1135. 03-22 13:19 00:11    3884 NOFAX RESPOND.FAX  8939124                0  No Fcon
  1136. 03-22 13:30 00:31    3208  7200 RESPOND.FAX  8939124                0  Bad Conn
  1137. 03-22 13:31 00:28    3882  9600 RESPOND.FAX  8939124                2  Finished
  1138. 03-23 14:42 00:26    3882 14400 RESPOND.FAX  8939124                1  Timeout
  1139. 03-23 14:44 00:29    3882 NOFAX RESPOND.FAX  8939124                0  BlackLst
  1140. 03-23 14:47 00:21    3882 NOFAX RESPOND.FAX  8939124                0  Max Busy
  1141. 03-23 14:51 00:23    3882 14400 RESPOND.FAX  8939124                1  Gen Fail
  1142. 03-23 14:54 00:05    3882 NOFAX RESPOND.FAX  8939124                0  No Dial
  1143.  
  1144.          -------------------------------------------------------------
  1145.          HANGUP STATUS CODES
  1146.          -------------------------------------------------------------
  1147.  
  1148.          When BGFAX reports "Problematic fax reception", it will indicate a
  1149.          fax hangup code, such as [+FHNG: 73].  This chart, taken from the
  1150.          Supra CLASS_2.TXT fax command set documentation (which, I believe
  1151.          was taken from the Rockwell Class 2 documentation), allows you to
  1152.          match up the +FHNG message with its true meaning.  For example,
  1153.          +FHNG: 73 would indicate "T.30 T2 timeout, expected page not
  1154.          received", which really does not say much, but it may give you
  1155.          some clue.  I don't know what most of these mean myself, so I
  1156.          don't know whether it will provide you any luck or not, but, many
  1157.          people asked that it be included, so here it is.
  1158.  
  1159.      /-----------------------------------------------------------------\
  1160.      | 2.0   Class 2 |  Cause Description                              |
  1161.      | --------------|-------------------------------------------------|
  1162.      | 00-0F     0-9 |  CALL PLACEMENT AND TERMINATION                 |
  1163.      |---------------|-------------------------------------------------|
  1164.      | 00          0 |  Normal and proper end of connection            |
  1165.      | 01          1 |  Ring Detect without successful handshake       |
  1166.      | 02          2 |  Call aborted, from +FK/+FKS or <CAN>           |
  1167.      | 03          3 |  No Loop Current                                |
  1168.      | 04        n/a |  Ringback detected, no answer (timeout)         |
  1169.      | 05        n/a |  Ringback detected, answer without CED          |
  1170.      |---------------|-------------------------------------------------|
  1171.      | 10-1F   10-19 |  TRANSMIT PHASE A & MISCELLANEOUS ERRORS        |
  1172.      |---------------|-------------------------------------------------|
  1173.      | 10         10 |  Unspecified Phase A error                      |
  1174.      | 11         11 |  No Answer (T.30 T1 timeout)                    |
  1175.      |---------------|-------------------------------------------------|
  1176.      | 20-3F   20-39 |  TRANSMIT PHASE B HANGUP CODES                  |
  1177.      |---------------|-------------------------------------------------|
  1178.      | 20         20 |  Unspecified Transmit Phase B error             |
  1179.      | 21         21 |  Remote cannot receive or send                  |
  1180.      | 22         22 |  COMREC error in transmit Phase B               |
  1181.      | 23         23 |  COMREC invalid command received                |
  1182.      | 24         24 |  RSPEC error                                    |
  1183.      | 25         25 |  DCS sent three times without response          |
  1184.      | 26         26 |  DIS/DTC received 3 times; DCS not recognized   |
  1185.      | 27         27 |  Failure to train at 2400 bps or +FMS/          |
  1186.      |               |                                  +FMINSP value  |
  1187.      | 28         28 |  RSPREC invalid response received               |
  1188.      |---------------|-------------------------------------------------|
  1189.      | 40-4F   40-49 |  TRANSMIT PHASE C HANGUP CODES                  |
  1190.      |---------------|-------------------------------------------------|
  1191.      | 40         40 |  Unspecified Transmit Phase C error             |
  1192.      | 41        n/a |  Unspecified Image format error                 |
  1193.      | 42        n/a |  Image conversion error                         |
  1194.      | 43         43 |  DTE to DCE data underflow                      |
  1195.      | 44        n/a |  Unrecognized Transparent data command          |
  1196.      | 45        n/a |  Image error, line length wrong                 |
  1197.      | 46        n/a |  Image error, page length wrong                 |
  1198.      | 47        n/a |  Image error, wrong compression code            |
  1199.      |---------------|-------------------------------------------------|
  1200.      | 50-6F   50-69 |  TRANSMIT PHASE D HANGUP CODES                  |
  1201.      |---------------|-------------------------------------------------|
  1202.      | 50         50 |  Unspecified Transmit Phase D error             |
  1203.      | 51         51 |  RSPREC error                                   |
  1204.      | 52         52 |  No response to MPS repeated 3 times            |
  1205.      | 53         53 |  Invalid response to MPS                        |
  1206.      | 54         54 |  No response to EOP repeated 3 times            |
  1207.      | 55         55 |  Invalid response to EOP                        |
  1208.      | 56         56 |  No response to EOM repeated 3 times            |
  1209.      | 57         57 |  Invalid response to EOM                        |
  1210.      | 58         58 |  Unable to continue after PIN or PIP            |
  1211.      |---------------|-------------------------------------------------|
  1212.      | 70-8F   70-89 |  RECEIVE PHASE B HANGUP CODES                   |
  1213.      |---------------|-------------------------------------------------|
  1214.      | 70         70 |  Unspecified Receive Phase B error              |
  1215.      | 71         71 |  RSPREC error   (before TCF??)                  |
  1216.      | 72         72 |  COMREC error   (after TCF??)                   |
  1217.      | 73         73 |  T.30 T2 timeout, expected page not received    |
  1218.      | 74         74 |  T.30 T1 timeout after EOM received             |
  1219.      |---------------|-------------------------------------------------|
  1220.      | 90-9F   90-99 |  RECEIVE PHASE C HANGUP CODES                   |
  1221.      |---------------|-------------------------------------------------|
  1222.      | 90         90 |  Unspecified Receive Phase C error              |
  1223.      | 91         91 |  Missing EOL after 5 seconds                    |
  1224.      | n/a        92 |  < Not assigned >           /--- Rockwell only  |
  1225.      | 92 -Note-> 94 |  Bad CRC or frame (ECM {or BFT} modes)          |
  1226.      | 93         93 |  DCE to DTE buffer overflow                     |
  1227.      |---------------|-------------------------------------------------|
  1228.      | A0-BF 100-119 |  RECEIVE PHASE D HANGUP CODES                   |
  1229.      |---------------|-------------------------------------------------|
  1230.      | A0        100 |  Unspecified Receive Phase D errors             |
  1231.      | A1        101 |  RSPREC invalid response received               |
  1232.      | A2        102 |  COMREC invalid response received               |
  1233.      | A3        103 |  Unable to continue after PIN or PIP            |
  1234.      |---------------|-------------------------------------------------|
  1235.      | C0-DF     n/a |  RESERVED FOR FUTURE STANDARDIZATION            |
  1236.      | E0-FF     n/a |  REVERVED FOR MANUFACTURER SPECIFIC USE         |
  1237.      | n/a   120-255 |  RESERVED CODES                                 |
  1238.      \-----------------------------------------------------------------/
  1239.  
  1240.          -------------------------------------------------------------
  1241.          ACKNOWLEDGEMENTS
  1242.          -------------------------------------------------------------
  1243.  
  1244.          I would like to thank the following people for their assistance
  1245.          during the beta test phase.
  1246.  
  1247.          Bill Huther
  1248.          Brian Wood
  1249.          Russell Kroll
  1250.          Ethan Brofman
  1251.          Ed Lucas
  1252.          ...and many people from the Internet and FidoNet.
  1253.  
  1254.          US Robotics and Hayes have also been very helpful in getting
  1255.          BGFAX to work with their modems.
  1256.  
  1257.          -------------------------------------------------------------
  1258.          SHAREWARE
  1259.          -------------------------------------------------------------
  1260.  
  1261.          THIS PROGRAM IS SHAREWARE.
  1262.  
  1263.          If you use this program for more than four weeks you are required
  1264.          to register it for its low cost of only $25 US DOLLARS.  If you
  1265.          cannot afford this we can work something out.
  1266.  
  1267.          Please make sure BGFAX works before registering.
  1268.  
  1269.          Registrations encourage frequent updates.
  1270.  
  1271.          If you are paying by check or money order, please print out the
  1272.          REGISTER.FRM file, fill it out, and mail it to my address.
  1273.  
  1274.          If you are paying by credit card (Visa, Mastercard, Discover or
  1275.          American Express) you can (1) mail the form to me, (2) fax the
  1276.          form to me, (3) netmail the form to me, or (4) call my BBS and
  1277.          open door #6 and instantly register.
  1278.  
  1279.          All people will have to call my BBS and open door #6 to pick up
  1280.          the BGFAX.KEY registration key file.
  1281.  
  1282.          I will mail (or air mail) registration letters out as well.
  1283.  
  1284.          -------------------------------------------------------------
  1285.  
  1286.          Regards,
  1287.          B.J. Guillot
  1288.