NAME

tfone – control computer telephone

SYNOPSIS

tfone [options...]

DESCRIPTION

Tfone controls an AT&T Computer Telephone 8130. Program control is supplementary: normal functioning of the phone is not affected.

Tfone is run once per terminal session; it sets the date and time on the telephone from the computer's internal date and time and then accepts commands typed in its window. When you first start tfone, you should be greeted with something resembling:

AT&T 8130 Computer Telephone 8130
Version 1.0 06/15/96

If the file call.log exists and is writable, it will contain a log of calls. A log file can be created with:
chmod 644 call.log >call.log

Options for tfone are:
-f file
The telephone is controlled through file instead of /dev/eia1.
-l file
Calls are logged in file instead of call.log.
-d    Increase the debugging level by one.
-r file
Use file instead of the default fone-rewrite for the rewriting rules.
-t cmd
Run cmd instead of /v/bin/tel when using the t command.

Commands for tfone are read, one per line, from the standard input.
c string
Call telephone number string. Invalid characters are discarded, and the appropriate prefix is inserted before dialing.
C string
The alphanumeric characters in string are dialed exactly as given.
d     Drop the active call, or an entire conference call.
h     Put the active call on hold.
i     Dump all info about the telephone: volumes, line statistics, current dialing and line selection modes, etc.
k string
Add a party to a conference call. The active call is placed on hold, and string is parsed and dialed. Once the second call is connected, the k command with no option adds the new call to the previously active call. If the called party is indisposed, the commands d and r will drop the second call and reconnect the first. When used with an argument, the k command is equivalent to h followed by C string .
r id   Reconnect a call on hold and make it the active call. If the line id is omitted, it defaults to the lowest numbered call on hold.
t string
Run the tel (1) command on string .
. string
Same as the c command above.
?     Print a summary of commands.

The c command must be given before lifting the handset and before turning on speakerphone. If you do not, then phone number rewriting will not take place. (The rationale is that if the phone is already picked up, you might be dialing an extension or using a faxback service or whatnot. See the BUGS section). It will turn the speakerphone on so you can hear what is happening. If you specify the -m flag (see above), the speakerphone will be muted when turned on.

Telephone Number Translation

The translation of strings as done in the c and . commands is as follows. First, letters are changed into numbers, (q maps to 7, z maps to 9) and non-alphanumeric characters that are not *, #, or $ are stripped out. (The $ tells the phone to wait for a bong before continuing to dial.)

Then, the dialing string is subject to the rules in the fone-rewrite file. The fone-rewrite file consists of one rule per line, with a # beginning a comment that lasts until the end of the line, as in shell scripts. Each rule consists of two fields. The first is a pattern to match, and the second is a sed(1)-like expression to replace it with. An representative file might be:

1 # fone-rewrite
2 # numbers are subject to these rules as long as they hold
3 # regexps must match the entire number, not just a substring
4 # hack around area code boundaries
5 (360|635|966|538)....         973&
6 # emulate "at work" conditions
7 ....            360&    # 2912 becomes 3602912
8 9(.......)          \1     # strip a 9 off
9 9(...........) \1
10 # basic rewriting rules
11 ..........     1&     # 9085551212 becomes 19085551212
(Line numbers are used for ease of reference. They are not in the actual file). Numbers are subjected to the first matching rule and then are processed again, until no rules apply. For example, 7700 would be caught by line 7, becoming 3607700. The number 3607700 would go through, and be caught by line 5, becoming 9733607700. That number would match rule 11, becoming 19733607700. Since this does not match any rules, it gets dialed.

FILES

call.log
log of calls
/dev/eia1
1200 bps RS-232 line to phone
fone-rewrite
Telephone rewrite file.

SOURCE

/sys/src/cmd/tfone

BUGS

Setting the volumes is not supported yet.
The c command should work if you pickup the handset first, but we don't have a way to know if anything has been dialed yet.

Copyright © 2000 Lucent Technologies. All rights reserved.