static acu_t
*acu
= NOACU
;
* Establish connection for tip
* If DU is true, we should dial an ACU whose type is AT.
* The phone numbers are in PN, and the call unit is in CU.
* If the PN is an '@', then we consult the PHONES file for
* the phone numbers. This file is /etc/phones, unless overriden
* by an exported shell variable.
* The data base files must be in the format:
* host-name[ \t]*phone-number
* with the possibility of multiple phone numbers
* for a single host acting as a rotary (in the order
char *phnum
, string
[256];
if (!DU
) { /* regular connect message */
* @ =>'s use data base in PHONES environment variable
* otherwise, use /etc/phones
signal(SIGINT
, acuabort
);
signal(SIGQUIT
, acuabort
);
signal(SIGQUIT
, SIG_IGN
);
printf("\ncall aborted\n");
logent(value(HOST
), "", "", "call aborted");
boolean(value(VERBOSE
)) = FALSE
;
if ((acu
= acutype(AT
)) == NOACU
)
return ("unknown ACU type");
for (phnum
= cp
; any(*cp
, "0123456789-*=&%"); cp
++)
if (conflag
= (*acu
->acu_dialer
)(phnum
, CU
)) {
logent(value(HOST
), phnum
, acu
->acu_name
,
logent(value(HOST
), phnum
, acu
->acu_name
,
if ((fd
= fopen(PH
, "r")) == NOFILE
) {
return ("can't open phone number file");
while (fgets(string
, sizeof(string
), fd
) != NOSTR
) {
for (cp
= string
; !any(*cp
, " \t\n"); cp
++)
return ("unrecognizable host name");
if (strcmp(string
, value(HOST
)))
return ("missing phone number");
for (phnum
= cp
; any(*cp
, "0123456789-*=&%"); cp
++)
if (conflag
= (*acu
->acu_dialer
)(phnum
, CU
)) {
logent(value(HOST
), phnum
, acu
->acu_name
,
logent(value(HOST
), phnum
, acu
->acu_name
,
logent(value(HOST
), "", acu
->acu_name
, "missing phone number");
return (tried
? "no answer" : "missing phone number");
logent(value(HOST
), "", acu
->acu_name
, "call terminated");
if (boolean(value(VERBOSE
)))
printf("\r\ndisconnecting...");
(*acu
->acu_disconnect
)();
for (p
= acutable
; p
->acu_name
!= '\0'; p
++)
if (!strcmp(s
, p
->acu_name
))