static char sccsid
[] = "@(#)va212.c 4.3 (Berkeley) %G%";
va212opn(telno
, flds
, dev
)
int i
, ok
, er
= 0, delay
;
sprintf(dcname
, "/dev/%s", dev
->D_line
);
DEBUG(1, "timeout va212 open\n", 0);
logent("va212 open", "TIMEOUT");
signal(SIGALRM
, alarmtr
);
DEBUG (4, errno
== 4 ? "%s: no carrier\n" : "%s: can't open\n",
return errno
== 4 ? CF_DIAL
: CF_NODEV
;
fixline(dh
, dev
->D_speed
);
/* translate - to K for Vadic */
DEBUG(4, "calling %s -> ", telno
);
for (i
= 0; i
< strlen(telno
); ++i
) {
case '=': /* await dial tone */
for(i
= 0; i
< TRYCALLS
; ++i
) { /* make TRYCALLS tries */
DEBUG(4, "wanted * ", CNULL
);
DEBUG(4, "got %s\n", ok
? "?" : "that");
sendthem("D\\d", dh
); /* "D" (enter number) command */
DEBUG(4, "wanted NUMBER? ", CNULL
);
ok
= expect("NUMBER?", dh
);
DEBUG(4, "got %s\n", ok
? "?" : "that");
/* send telno, send \r */
DEBUG(4, "wanted %s ", telno
);
DEBUG(4, "got %s\n", ok
? "?" : "that");
sendthem("", dh
); /* confirm number */
DEBUG(4, "wanted %s ", "DIALING...");
ok
= expect("DIALING...", dh
);
DEBUG(4, "wanted ANSWER TONE", CNULL
);
ok
= expect("ANSWER TONE", dh
);
DEBUG(4, "got %s\n", ok
? "?" : "that");
DEBUG(4, "wanted ON LINE\\r\\n ", CNULL
);
ok
= expect("ON LINE\r\n", dh
);
DEBUG(4, "got %s\n", ok
? "?" : "that");
sendthem("I\\d", dh
); /* back to idle */
DEBUG(4, "vadDial failed\n", CNULL
);
DEBUG(4, "va212 ok\n", 0);