BGFAX 1.0 ALPHA 06  WED 26 MAY 93
---------------------------------

POSSIBLE VERY GOOD NEWS --- THIS RELEASE SUPPORTS "REAR END" OPERATION.

I'll list the minor changes first, then discuss "rear end" mode after.

1. A user requested I check for an actual "RING" response from the modem
   because some users don't have the RI (ring indicator) capability that most
   users do that BGFAX uses to determine when to send the answer string to the
   modem.  Anyway, I hope this helps those few that don't have RI.

2. Since Fido mailers can't be rear ended into, I took the "q.,FidoNet"
   line out of the BGFAX.CNF file.  Only one "crash" entry is now available,
   and that is for GT Power sysops, the "CQ,GT Crash call line".  If you were
   running BGFAX alpha 5, just delete the "Q.,FidoNet" line.

Now, here come the major changes.  If you want to run BGFAX in frontend
mode, you don't even have to read the following.  However, if you want to
run it in rear end mode, you gotta read through my pitiful docs some more.
I'm typing this at near-midnight hours, so I'm probably going to type
incoherently after a few minutes.

First the bad news.  I couldn't get Frontdoor to work on my system so that
it would exit out with an errorlevel if it determined the incoming fax was
a fax call.  However, I hope you will be able to get Frontdoor, or Binkley,
or whatever frontend system you use to do this.  (If you can, drop me a
note so I can try to duplicate it).  So, in order to test the BGFAX "rear
end", I had to write my own psuedo-front end.  This psuedo-front end, BGFFF
can be configured to exit with an errorlevel of 80 when it detects a string
with "FAX" in it (such as "FAX", "CONNECT FAX", "CONNECT 9600/FAX", etc.)
or when it encounters a "+FCON" string.  You specify the choice.

Why am I telling you this?  Because, before you go start to play with
Frontdoor, you might want to try to get the BGFAX rear end working with
BGFFF first.  If it works, then try playing with Frontdoor.

BGFFF is very simple to use.  It has three command line parameters.

    BGFFF 1 38400 /FAX     or     BGFFF 1 38400 /FCON

The first parameter is the com port, the second is the DTE rate you want to
lock it at.  The third can be either "/FAX" or "/FCON".  If you specify
/FAX, BGFFF will exit with an errorlevel of 80 when it encounters the "FAX"
string.  Try this one first.  (See the included FFF.BAT file).  After that,
change the FFF.BAT file so that you use /FCON in the two places where /FAX
is specified.  In /FCON mode, BGFFF will wait until it receives a +FCON
from the port.  Make a note of which methods work and don't work.  If
you're lucky, both methods will.  You can get read of the FFF.BAT and
BGFFF.EXE after these tests.  If both pass, you have a pretty good chance
of being able to use rear end mode of BGFAX in a Fido mailer.

To run BGFAX is rear end mode, it requires three parameters as well.  A
BGFAX.CNF FILE IS NOT REQUIRED FOR REAR END OPERATION.  Recall that no
command line parameters are required to run BGFAX in front end mode.

    BGFAX 1 Z /FAX

That means use COM1, ZyXEL Z-FAX format fax files, and the /FAX means that
Frontdoor/Binkley/etc. was able to detect the "FAX" string from your modem
properly.

If you are using a ZyXEL modem, you will have to put an e-point after the
COM port, like so:  BGFAX 1! Z /FAX   this would tell BGFAX *not* to shift
DTE to 19200 after the +FCON message is received.  (However, ZyXEL users
can already use ZyXEL's RCVFAX program to do this, so it's not really
necessary to use BGFAX unless you just want something to do for fun.)

If your Fido frontend is unable to detect the "FAX"-like string, but will
detect the +FCON message (by the way, some FaxModems do not even return a
"FAX"-like string, only the "+FCON"), you will have to use the /FCON
paramateer on BGFAX like so:   BGFAX 1 Z /FCON

If your Frontend and modem will allow you to use /FAX parameter on BGFAX,
USE IT.  AVOID HAVING TO USE THE /FCON PARAMETER.  However, some people
will have to use it.

Remember, BGFFF is only for testing BGFAX's rear end capability on your
modem.  It is not needed after you use it for the initial testing.

Again, if you actually get BGFAX working in rear end mode with something
besides BGFFF, *please* let me know.  Send me your batch files, config
files from Frontdoor, etc., and let me know what kind of modem you use.

Special note.  I had this file ARJed up and all ready to go on the FTP when
I tried a few last minute tests.  Turned out, the rear end mode wasn't
working too hot on my 2400 S/R faxmodem, so I changed a few routines
around.  What's quite interesting though is that my 2400 modem doesn't
issue a "FAX" command, so it would be logical to think you would have to
use the /FCON switch.  Well, turns out that BGFAX works best with my 2400
S/R fax modem when used with the /FAX switch.  WEIRD, HUH?  Oh well, this
might just be something you have to try, too.

By the way, these BBS systems on the other continent should also carry
BGFAX in the future as a downloadable file.

The Owl's Nest (Dutch Supra Distr) Support BBS has 3 numbers;
 
(31)-(0)2155-10921   (Also fidonet node 2:512/39)
(31)-(0)2155-12571   Node 2
(31)-(0)2155-28096   Node 3
 
All three with Supra V.32bis

BGFAX 1.0 ALPHA 05  SAT 22 MAY 93
---------------------------------

1. Fixed some problems with faxes having single trashed lines.  Seems I was
   writing 2049 bytes to the file when I only had 2048 bytes in my disk write
   buffer.  Oops.

2. NOTE FOR ZYXEL USERS: You must change the DTE rate in the BGFAX.CNF file
   so that you have a e-point (bang, "!") after it.

      1
      38400!
      ATZ

   The e-point will make BGFAX *not* shift the DTE to 19200 when fax
   receiption begins.  Seems ZyXEL conveniently forgot to do this.  This is
   actually a better idea than what CCITT recommends doing (why, oh why did
   they want the DTE to be shifted to 19200) and that's why ZyXEL users
   have such an easy time with fax receiption.  The other guys, like me,
   don't have ZyXEL's though, so don't add the "!" if you don't.

3. If one of the three modem initialization strings are less than two
   characters, the string will not be sent to the modem.  (If the line just
   read "AT", it would not get sent).

4. If you don't want your users to have to hit <Esc> to enter the BBS, ie.,
   you want to it load automatically, change the line in the BGFAX.CNF file
   that says "Press <esc> to blah blah blah", so that it says "<load>" as the
   first thing on the line.

5. Look at the included BGFAX.CNF file.  A line has been added ... see:

     Please wait loading the bulletin board.
     /RELIABLE                                        <-- new line
     2400
     We're sorry, but we do not accept calls below 2400.

   The new line can contain anything you want.  What happens is when a data
   call is detected, if it is an error correcting modem (ie., it is
   something like CONNECT 2400/ARQ, /REL, or 2400/EC), it will set the
   environment variable called ARQ to whatever is on the line.  So, in the
   case of "CONNECT 14400/ARQ", the following environment gets set:

        DCE=14400
        ARQ=/RELIABLE

6. Another new environment variable is now set.  The "EVT" variable will
   be set to the number of minutes (minus three) until the next event.
   This is set on both local logins and data calls.

BGFAX 1.0 ALPHA 04  FRI 21 MAY 93
---------------------------------

BGFAX alpha 1 through 3 were non-public releases.  This is a public
release.  Send all bug reports to ... (my name is B.J. Guillot) ...

Internet: st1r8@jetson.uh.edu
GT/Power: Net/Node 001/040
   Voice: 713-893-9320
Data/Fax: 713-893-9124

I am a terrible doc writer.  You'll believe me by the time you finish
reading this, if you can make it that far.  :)

BGFAX is a program designed for BBS operators that have Class 2 compliant
fax modems that support adaptive answering.  The only modems that I've been
able to test it on so far include the SupraFax 14.4, Practical Periperhals,
and an el-cheapo Computer City generic 2400 data, 9600 S/R fax modem.  It
seems to work on all of these.

DISCLAIMER: I'm not responsible for ANYTHING negative that happens to you
or your computer system or your business, etc., etc., etc.

The program does not require a FOSSIL driver as it has communications
routines built into it.  Yes, it supports the FIFO buffer of the 16550
UART chip.

Here is how the program works:

It is to be ran as a "frontend" system to your BBS.  When it starts, it
will initialize the modem and wait for the modem to ring.  When it does
ring, it will send the modem answer string to the modem.  It the modem
determines it is a data call, it will ask the user to press <ESC> to log
onto the system.  It will also look for "CQ" or "q." and exit with a
specific errorlevel if one of those strings is encountered.  I am not sure
as it the "q." determination is really meaningful, though.

If your modem detects a fax call, BGFAX will attempt to take the fax.
Please note that depending on the type of modem you have and the way it
determines adaptive answering, human faxes (ie., non fax-modems) may not
understand how to send a fax to you.  This seems to be the case with my
Uncle.  He tried to send me a fax the other day on his fax machine, but he
waits until he hears a fax tone on the other end before pressing his
"START" button.  So, my Supra never heard the CNG tones from his machine
until after the Supra modem decided it was already a data call.  I've heard
that some modems will shift into FAX mode anytime a CNG tone is heard, but
I just wanted to tell you this in case you had problems.  (To solve the
problem, I told my Uncle to hit the "START" key as soon as he heard the
line start ringing instead of waiting for my modem to start sending tones).

YOU NEED TO SET THE BGFAX ENVIRONMENT VARIABLE.

It's easy, just say SET BGFAX=C:\BGFAX or some other directory in a batch
file that runs before you run the batch file that runs BGFAX (ie., in your
AUTOEXEC.BAT).

All incoming faxes will be received in that directory.  BGFAX.LOG will
reside in that directory, and BGFAX.CNF must exist in that directory.

BGFAX.CNF is the configuration file for BGFAX.  Here is the file I use with
my Supra FaxModem:

-----<cut>-----
1
38400
ATZ
ATH0M1%G1%E0N1\N3&K3+FCLASS=0+FCR=1
AT+FLID="TRANQUILITY_BASE"
AT+FAA=1 A
Please press the [Esc] key to load Tranquility Base.
Loading the bulletin board.  Please wait.
2400
Calls are not accepted below 2400 bps.  Sorry.
Z
q.,FidoNet crash calls
CQ,GT crash calls
event=07:00
event=00:15
-----<cut>-----

Line 1 is the com port number.  Line 2 is the DTE rate you use for your BBS
software.  The next three lines are initialization string lines.  My Supra
seemed to like it with all commands compressed on one line, but I noticed
the Practicial Peripherals was peculiarly picky about packed strings, so
one fax command had to be one a seperate line.  Anyway, if you don't need
three lines for initialization, just put an "AT" on the line.  You'll
notice my second initialization string has a bunch of garbage in it,
"H0M1%G1%E0N1\N3&K3".  These are just commands I use when I want the modem
to be able to answer calls.  You can probably take all that out.  The +F
things are fax commands and should be left alone, except for the +FLID=
command which sets your FAX ID.

The line with "2400" by itself lets BGFAX know what the lowest DCE speed
you allow on your BBS.  Set it to "300" if you want all calls.

The line with "Z" by itself means you want BGFAX to store fax files with
the ZyXEL ZFAX header record.  (So you can use the public domain ZFAX
program, available by anonymous FTP to view incoming faxes).  The only
other valid entry for this line is a single "Q" which means you want BGFAX
to store the incoming faxes with the Smith Micro Software's QuickLink II
Fax format header, so you view faxes with QL II's "VIEWFAX.EXE" file which
comes with quite a few fax modems (but not all).  Please note that the QL
II header record has a field for "scan lines" and I don't know what to put
in it, so it's being fudged and this may create some side effects, but it
seems that viewing the fax still works fine.

Notice there are two "event" lines.  You can have up to 20 of them.  The
first event is Event #0 and will cause BGFAX to exit with an errorlevel of
50 when the time is encounted for it.  The second event is Event #1 and
will exit with errorlevel 51, etc.  You can have no events by taking out
the event lines.  So far, these "event=" lines are the only flexible lines
in the config file that can be removed without causing BGFAX problems.

Here's the batch file I use to run BGFAX:

-----<cut>-----
@echo off
bgfax
if errorlevel 255 bbs
if errorlevel 101 gtmail
if errorlevel 100 fidomail
if errorlevel 90 goto faxrcvd
if errorlevel 51 midmaint
if errorlevel 50 maint
if errorlevel 20 goto datacall
if errorlevel 10 goto datacall
goto end
:faxrcvd
  echo fax received as [%fax%]
  echo you can put a printing batch here if you want
  bbs
:datacall
  echo data call received dce=[%dce%]
  %gt% %key% /mn /f:%dce%:1
  bbs
:end
-----<cut>-----

Here's a rundown of the errorlevels:

  255 ... bad connect, no carrier, bad fax, etc., rerun BBS.BAT
  101 ... mailer software signature #2
  100 ... mailer software signature #1
   90 ... at least a one page fax received, option of going and doing
          something with the fax, filename stored in FAX environment
          varible maintained by BGFAX
69-50 ... Events #19 through Events #0
   20 ... data call, actual DCE carrier rate set by DCE environment varible
          maintained by BGFAX
   10 ... local logon, handle however your software requires
<no errorlevel> ... terminated by user or something terrible happens :)

If sometimes it appears BGFAX gets locked up during a fax receiption,
pressing the <ESC> key should quit BGFAX and leave a DEBUG line that has
whatever was in the modem receive buffer at the time.

------- In the future, I hope to have an alpha out that will allow the use
of another frontend that runs BGFAX when a fax is already ready to come in
on the line.  This version must be run as a frontend, though!

