*BSD News Article 7133


Return to BSD News archive

Newsgroups: comp.unix.bsd
Path: sserve!manuel.anu.edu.au!munnari.oz.au!sgiblab!darwin.sura.net!jvnc.net!yale.edu!think.com!ames!decwrl!csus.edu!netcom.com!alm
From: alm@netcom.com (Andrew Moore)
Subject: minor tip patch
Message-ID: <1992Oct27.230346.7183@netcom.com>
Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
Date: Tue, 27 Oct 1992 23:03:46 GMT
Lines: 75

The hayes modem dialer does blind dialing, but doesn't initialize the
modem accordingly (with ATX0 or ATX5).  BTW, if you can't get /etc/phones
working, it's because tip assumes each line is a system entry (no
comments allowed).

The following patch is relative to Chris Demetriou's tip-diffs (was part of
his com package).

*** /usr/src/usr.bin/tip/aculib/hayes.c.pl1	Tue Oct 27 14:48:32 1992
--- /usr/src/usr.bin/tip/aculib/hayes.c	Tue Oct 27 15:39:19 1992
***************
*** 92,107 ****
  	fflush(stdout);
  	ioctl(FD, TIOCHPCL, 0);
  	ioctl(FD, TIOCFLUSH, 0);	/* get rid of garbage */
! 	write(FD, "ATv0\r", 5);	/* tell modem to use short status codes */
  	gobble("\r");
  	gobble("\r");
! 	write(FD, "ATTD", 4);	/* send dial command */
  	write(FD, num, strlen(num));
  	state = DIALING;
  	write(FD, "\r", 1);
  	connected = 0;
  	if (gobble("\r")) {
! 		if ((dummy = gobble("01234")) != '1')
  			error_rep(dummy);
  		else
  			connected = 1;
--- 92,115 ----
  	fflush(stdout);
  	ioctl(FD, TIOCHPCL, 0);
  	ioctl(FD, TIOCFLUSH, 0);	/* get rid of garbage */
! #ifdef ATX5
! 	write(FD, "ATm0x5v0\r", 9);	/* mute speaker; short status codes */
! #else /* ATX5 */
! 	write(FD, "ATx0v0\r", 7);	/* short status codes */
! #endif /* ATX5 */
  	gobble("\r");
  	gobble("\r");
! #ifdef PULSE_DIAL
! 	write(FD, "ATD", 3);	/* send dial command */
! #else	/* PULSE_DIAL */
! 	write(FD, "ATDT", 4);	/* send dial command */
! #endif	/* PULSE_DIAL */
  	write(FD, num, strlen(num));
  	state = DIALING;
  	write(FD, "\r", 1);
  	connected = 0;
  	if (gobble("\r")) {
! 		if ((dummy = gobble("012345678")) != '1')
  			error_rep(dummy);
  		else
  			connected = 1;
***************
*** 228,233 ****
--- 236,253 ----
  		printf("CONNECT 1200");
  		break;
  	
+ 	case '6':
+ 		printf("NO DIALTONE");
+ 		break;
+ 
+ 	case '7':
+ 		printf("BUSY");
+ 		break;
+ 
+ 	case '8':
+ 		printf("NO ANSWER");
+ 		break;
+ 
  	default:
  		printf("Unknown Modem error: %c (0x%x)", c, c);
  	}
END_OF_PATCH