* Copyright (c) 1983 The Regents of the University of California.
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
static char sccsid
[] = "@(#)biz22.c 5.2 (Berkeley) %G%";
#define DISCONNECT_CMD "\20\04" /* disconnection string */
static jmp_buf timeoutbuf
;
* Dial up on a BIZCOMP Model 1022 with either
* tone dialing (mod = "V")
* pulse dialing (mod = "W")
register int connected
= 0;
if (boolean(value(VERBOSE
)))
printf("\nstarting call...");
* Disable auto-answer and configure for tone/pulse
printf("can't initialize bizcomp...");
printf("can't set dialing mode...");
write(FD
, cbuf
, strlen(cbuf
));
printf("can't get dial tone...");
if (boolean(value(VERBOSE
)))
* The reply from the BIZCOMP should be:
connected
= detect("1\r");
sprintf(line
, "%d second dial timeout",
number(value(DIALTIMEOUT
)));
logent(value(HOST
), num
, "biz1022", line
);
biz22_disconnect(); /* insurance */
return (biz_dialer(num
, "W"));
return (biz_dialer(num
, "V"));
write(FD
, DISCONNECT_CMD
, 4);
ioctl(FD
, TIOCFLUSH
, &rw
);
f
= signal(SIGALRM
, sigALRM
);
if (setjmp(timeoutbuf
)) {
alarm(number(value(DIALTIMEOUT
)));
f
= signal(SIGALRM
, sigALRM
);
if (setjmp(timeoutbuf
)) {
alarm(number(value(DIALTIMEOUT
)));