-->

Previous | Table of Contents | Next

Page 149


# line to initialize

INITLINE=cua1

# timeout in seconds before disconnect

TIMEOUT=60

# initialize modem

INIT="" AT\r OK\r\n

WAITFOR=RING

# modem connect

CONNECT="" ATA\r CONNECT\s\A

# delay in seconds before sending contents of /etc/issue

DELAY=1



Change the values for ALTLOCK, ALTLINE, and INITLINE to match your file's name and serial port. The TIMEOUT value is the amount of time in seconds your modem will wait for a carriage return from the caller before it disconnects. The INIT string initializes your modem (note that you could also put the previous AT command string in here, too), and the CONNECT string contains the AT command to answer the phone. The DELAY is the amount of time in seconds before the contents of the file /etc/issue, the login banner, is sent to the screen.

JUST A MINUTE
You should be familiar with the contents of the /etc/issue file, because it contains the text printed on your display right before the login prompt. This file is created by the startup script rc.local in the /etc/rc.d directory every time you start Linux as part of the booting process. You can customize the rc.local script if you'd like a different login banner.

The third step involves a one-line edit of the /etc/inittab, or initialization table, file. If you look in this file, you should see these lines:


# cat /etc/inittab

...

# Run gettys in standard runlevels

1:12345:respawn:/sbin/mingetty tty1

2:2345:respawn:/sbin/mingetty tty2

3:2345:respawn:/sbin/mingetty tty3

4:2345:respawn:/sbin/mingetty tty4

5:2345:respawn:/sbin/mingetty tty5

6:2345:respawn:/sbin/mingetty tty6

...

Each line represents a different Linux runlevel, documented at the beginning of the /etc/inittab file. This discussion doesn't cover runlevels or the details of how Linux boots, but all you have to do to enable dial-in logins for your Linux system is to change the following line:


3:2345:respawn:/sbin/mingetty tty3

to

Page 150


3:2345:respawn:/sbin/uugetty -d /etc/conf.uugetty.ttyS1 ttyS1 38400 vt100

You should then save the file and restart your system. This line tells Linux to start the uugetty command and have uugetty monitor your /dev/ttyS1 serial port for incoming calls. If you call into your Linux system, the modem will synchronize with your calling modem's speed, wait for a carriage return (or Enter keystroke), and then present a login prompt.

TIME SAVER
If you've set up your system to accept incoming calls, you should run minicom as the root operator and make sure that the serial device listed under serial port setup in the configuration menu is the name of your modem's actual device, such as /dev/cua1, and not a symbolic link such as /dev/modem.

Sending and Receiving Faxes

If your modem supports fax protocols, chances are that you can send and receive faxes with Linux. Sending and receiving faxes under Linux involves graphics translation of received files and files you want to send. Your Linux distribution on the CD-ROM contains the efax family of fax software and documentation. You should have your modem's documentation on hand and read the efax manual pages and documentation under the /usr/doc directory carefully before you start.

Faxing with the efax System

The efax system, by Ed Casas, is a simple and easy-to-use fax system, best suited, according to its documentation, to a single-user, standalone Linux system. This software consists of a series of programs and scripts, and supports Class 1 and 2 fax modems.

The system is made up of the following programs:

If you want to preview or fax PostScript graphics files, you'll also need to have the gs PostScript interpreter and the companion viewer, ghostview, installed on your system. For viewing received faxes, you can use the X11 clients xv, xloadimage, or xwud.

Page 151

CAUTION
Before you make changes to the /usr/bin/fax shell script, make a copy first. If you make errors or delete the file, you'll need to reinstall the efax software.

Before you start sending or receiving faxes, you should take a look at the /usr/bin/fax shell script. This program is the main way you'll send or receive faxes, but you'll need to check several sections in the file to make sure that the script is configured properly. For example, the first section lists the names of the efax programs:


FAX=/usr/bin/fax

EFAX=/usr/bin/efax

EFIX=/usr/bin/efix

These shouldn't pose a problem, because the programs are installed in the correct place when you installed the software. The next section lists your modem:


DEV=modem

You can use the word modem if you've created a symbolic link. However, if you have Linux set up to answer incoming calls for logins, you should use the actual name of the device—for example, cua1. The next section to check is the type of faxing your modem supports:


# CLASS=1

CLASS=2

# CLASS=2.0

Comment or uncomment the proper support by using the octothorpe, or pound character (#), but make sure that only one CLASS is listed. After this, you'll want to customize your faxes with your phone number:


# Use only digits, spaces, and the "+" character.

FROM="0 000 000 0000"

# Your name as it should appear on the page header.

NAME="from a Red Hat Linux system"

Enter your phone number, such as "1 202 555 1212," and name, such as "Catherine Taulbee," into the these strings. Finally, you'll want to set the default page size for faxing—for example,


 PAGE=letter

# PAGE=legal

# PAGE=a4

Comment or uncomment the different page sizes, but use only one. After you finish making

Page 152

your changes, you should try the fax command to test your configuration and modem by using the test command-line option—for example,


# fax test

--------------------------------------



Please wait, this will take a minute...



--------------------------------------

-- /usr/bin/fax --



FAX=/usr/bin/fax

EFAX=/usr/bin/efax

EFIX=/usr/bin/efix

DEV=cua1

CLASS=2

...

You'll get a three-page listing of information about your configuration, and your modem's response to the fax script's queries. If you'd like to see this information at your leisure, redirect the output of the text to a file—for example,


# fax test > faxtest.txt

You can then read about any error messages or problems with missing software. Assuming that everything is OK, you can then try faxing a document by using the fax command:


# fax send -l 12025551212 faxtest.txt

This tells the fax program to send a low-resolution, or 98 lines per inch, fax by using the fax testing information you created. To send a high-resolution fax, no option is needed—for example,


# fax send 7201945 faxtest.txt

faxtest.txt is text...

/usr/bin/efax: Thu Dec 04 16:29:14 1997 efax v 0.8a Copyright 1996 Ed Casas

efax: 29:14 opened /dev/cua1

efax: 29:16 dialing T7201945

efax: 29:52 connected

efax: 29:59 session 196lpi  9600bps 8.5"/215mm 11"/A4 1D    -     -  0ms

efax: 29:59 header:[97/12/04 16:29  William H. Ball (+657 0210)

Â-->  7201945  p. 1/4]

efax: 30:32 sent 20+2156 lines, 38848+0 bytes, 33 s  9417 bps

efax: 30:35 sent -> faxtest.txt.001

efax: 30:36 header:[97/12/04 16:29  William H. Ball (+657 0210)

Â-->  7201945  p. 2/4]

efax: 30:54 sent 20+2156 lines, 20854+0 bytes, 18 s  9268 bps

efax: 30:57 sent -> faxtest.txt.002

efax: 30:58 header:[97/12/04 16:29  William H. Ball (+657 0210)

Â-->  7201945  p. 3/4]



Previous | Table of Contents | Next