                            LIBMODEM

Author:        Riccardo Facchetti
e-mail:        fizban@tin.it
Copyright:     (C) 1994,1995,1996,1997,1998,1999 Riccardo Facchetti under
               the terms of the GNU Library General Public Licence

WHAT IS THIS ?
==============

libmodem is a library that allow you to use your modems transparently with
regard of kind of modem attached to a line. You have just to

int fd;
...
fd = dial("Some-phone-number");
...

and it will return to you a file descriptor of the dialed line.
To hangup just hangup(fd).
Of course, you have to configure all your modem lines in the /etc/modems file to
allow the library know which modem lines it can use to dial.


NOTES
=====

libmodem is written for Linux, but i think you can easily port this package on
other platforms (that have POSIX_TERMIOS of course :))
The library libmodem is distributed as a package, subjected to the
GNU LIBRARY GENERAL PUBLIC LICENSE.
This package permit dialout only (for now). In the future, i think i will write
the routines that manage dialin connections too.


THANKS
======

Some parts of the code (mainly termios setup) are based on the work
of Gert Doering (mgetty-0.21): thanks Gert, without your code i
couldn't write down the termios spaghetti.
In no way Gert is responsible for the pieces of code i'd stolen from his
mgetty: I have somewhat changed the code so if you find bugs in it, they are
all my own.

Many thanks also to Randy Fay that have ported this library to Solaris 2.x
I have included part of his code in the 0.99.4 version of the library (more
than a year after his original e-mail). His code correct some bugs too. Hmm ... I'm sorry to have included it so late, but I have had lot of things to worry
about, other than libmodem, in the last year.

Thanks to Nicolai P Guba <nicolai@bigbro.demon.co.uk> who sent me the first
patch to let the libmodem compile into shared library.

Angelo Masci <angelom@redac.co.uk> work on sms_client uncovered a major
problem: now the libmodem don't eat any more characters during its operation.

Philippe Andersson <philipa@bernward.ste.scitex.com> contributed the code
to send to modem AT commands without the need to dial.

Peter Sasse <sasse@teco.uni-karlsruhe.de> is using this library linking it
with C++ so that I have added support for C++ linking (for kphone).

Thanks to Sotiris Vassilopoulos <Sotiris.Vassilopoulos@betatech.gr> now we
have an environmental variable that control the location of modems file.


HISTORY
=======

I needed a modem library that with a single function call allows me to
dial a remote modem, and returns a file descriptor that i can use,
dupping it to stdin and stdout. This is a part of a project of
communication software: a 2nd level password protection for a Linux box
used as terminal server (here in Italy we still have not enabled the CallerID).

I've searched for such a modem package and i've found a little but promising
package called libmodemcap. It is a package that manage modems with a file
a la termcap. After unpacking and examination of the package i've pointed
out at least two important things that make libmodemcap not the Right Thing for
me:

1)  It have little or nothing at all control over modem talking (here i mean
    write INIT string
        Wait 'OK'
        Check 'OK'
    write CALL string
        Wait 'CONNECT'
        Check 'CONNECT'
    write HANGUP string
        Wait 'OK' ... maybe
        Check 'OK' ... maybe
    )
    It lacks 'Wait <something>' just to be sure the modem have done what you
    just asked it to do; was a little problem, but present (to be truth that was
    a major problem for me: i don't want a modem be hung without a way to know
    that it must be reset!!!).

2)  Look at its copyright. It is not GPL, it is something i don't like too much.

3)  ...

Anyway thanks to John F. Haugh II (the author of libmodemcap) for having made me
write this package (in fact i don't know him, i never heard nothing about him,
and i suppose he's never heard nothing about me :)


JUST ANOTHER WORD
=================

The decision to write libmodem was not only reached for the above reasons.
I have not found a similar package in the Linux distributions and ftp sites.
So I've written this package for the Linux community.

Guys and gals, enjoy it!
