[net.bugs.4bsd] Mods to 4.2BSD UUCP for VENTEL modem registers

dan@rna.UUCP (05/03/84)

Hi,
	The diffs to the 4.2BSD UUCP file condevs.c allow the usage of
a Ventel 212's phone number registers and linking capabilities. In particular,
the Ventel can be directed to try a number over again if it gets a BUSY, or
to try a different phone number.
	The additional L.sys syntax support is:

	if the phone number spec begins with '$', then
		1) do not send 'K' to begin dialing,
		2) do not send a terminating \r after the phone number spec
	if a '|' occurs in the phone number spec, sleep(1),
	if a '$' occurs after the first char in the phone number spec, then
		send a \r

	Thus if the phone number is 123-4567, (experiment with the '|''s)

		$S1|1234567%L1|1

	will cause the Ventel to store the number in register 1, including the
	link of register 1 to register 1, and to dial register 1. Then if the
	number is "BUSY" or "NO ANSWER", etc, the number will be redialed
	(until uucico timeouts).

		$S2|1234567%L2|K|9876543L2

	will store a number in register 2 with a link to itself and dial
	another number, which if BUSY, will dial register 2.


	My experience is that a number which is BUSY is many times not BUSY
the second time it is dialed by the Ventel, i.e. redialing is often helpful.
	BTW, the Ventel has 5 registers.
	If you didn't want to hack UUCICO, the above scheme might work if you
hand loaded the registers and included a link in the phone number spec. The
old code, however, insists on terminating the phone number with a \r, which
often ABORTs the dialing.

					Cheers,
					Dan Ts'o
					...cmcl2!rna!dan


*** condevs.c	Wed May  2 18:10:11 1984
--- condevs.c.org	Wed May  2 17:58:30 1984
***************
*** 1117,1125
  		DEBUG(4, "got %s\n", ok ? "?" : "that");
  		if (ok != 0)
  			continue;
- 		/* dyt */
- 		if (*telno == '$')
- 			break;
   		slowrite(dh, "K");	/* "K" (enter number) command */
  		DEBUG(4, "wanted %s ", "DIAL: ");
  		ok = expect("DIAL: ", dh);

--- 1117,1122 -----
  		DEBUG(4, "got %s\n", ok ? "?" : "that");
  		if (ok != 0)
  			continue;
   		slowrite(dh, "K");	/* "K" (enter number) command */
  		DEBUG(4, "wanted %s ", "DIAL: ");
  		ok = expect("DIAL: ", dh);
***************
*** 1129,1140
  	}
  
  	if (ok == 0) {
- 		/* dyt - Added support for Ventel dial registers and linking */
- 		i = 0;
- 		if (*telno == '$') {
- 			i++;
- 			telno++;
- 		}
   		slowrite(dh, telno); /* send telno, send \r */
  		if (i == 0)
   			slowrite(dh, "\r");

--- 1126,1131 -----
  	}
  
  	if (ok == 0) {
   		slowrite(dh, telno); /* send telno, send \r */
   		slowrite(dh, "\r");
  		DEBUG(4, "wanted %s ", "ONLINE");
***************
*** 1136,1143
  			telno++;
  		}
   		slowrite(dh, telno); /* send telno, send \r */
! 		if (i == 0)
!  			slowrite(dh, "\r");
  		DEBUG(4, "wanted %s ", "ONLINE");
  		ok = expect("ONLINE!", dh);
  		DEBUG(4, "got %s\n", ok ? "?" : "that");

--- 1127,1133 -----
  
  	if (ok == 0) {
   		slowrite(dh, telno); /* send telno, send \r */
!  		slowrite(dh, "\r");
  		DEBUG(4, "wanted %s ", "ONLINE");
  		ok = expect("ONLINE!", dh);
  		DEBUG(4, "got %s\n", ok ? "?" : "that");
***************
*** 1217,1233
  	while (*str) {
  		DEBUG(6, "%c", *str);
  		uucpdelay(1,10);	/* delay 1/10 second */
! 	/* dyt - More flexible for Ventel registers and linking */
! 		switch (*str) {
! 		case '|':
! 			sleep(1);
! 			break;
! 		case '$':
! 			write(fd, "\r", 1);
! 			break;
! 		default:
! 			write(fd, str, 1);
! 			}
  		str++;
  		}
  	DEBUG(6, "\n", "");

--- 1207,1213 -----
  	while (*str) {
  		DEBUG(6, "%c", *str);
  		uucpdelay(1,10);	/* delay 1/10 second */
! 		write(fd, str, 1);
  		str++;
  		}
  	DEBUG(6, "\n", "");