[comp.unix.microport] Anyone successufully used dial

johnk@ihlpl.ATT.COM (John Kennedy) (06/24/88)

Anyone had any luck with using dial(3c) as supplied withSys V/AT?

Am trying to start with a simple program to access a modem
from a C program, but without success.

cu, uucp, etc work fine with the L-devices, L.sys, etc files as
they currently exist, but my C program does otherwise.

Summary of existing files that work with cu & uucp:

	L-devices:

		ACU tty0 hayes 1200

	L.sys:

		sysname Any ACU 1200 5555555

cu sysname or uucp ... sysname works fine, accessing tty0 and
successfully calling the distant system.

When the C program runs, the system complains of not being able
to find "/dev/hayes", obviously having used the third field of
the L-devices field for the device.  


Any answers/theories/expert opinions/wags?

Thanks in advance,

John
(703) 876-1144
ihlpl!johnk

offending program:

#include <termio.h>
#include <dial.h>

main(argc,argv)
int argc;
char *argv[];
{

	CALL call;

	int line,dialerr;
	char number[20];
	char device[20];
	char linestr[20];

	struct termio attributes;

	if (argc < 3) {
		printf("usage: %s line number\n",argv[0]);
		exit(-1);
	}

	call.attr = &attributes;

	line = atoi(argv[1]) - 1;
	call.baud = 1200;
	call.speed = 1200;

	sprintf(linestr,"tty%1.1d",line);
	call.line = linestr;

	call.telno = argv[2];

	call.modem = 0;
	call.device = device;
	call.dev_len = sizeof(device);

	if ((dialerr = dial(call)) < 0) {
		printf("%s: dial failed, error = %d\n",argv[0],dialerr);
		exit(-1);
	}

	exit(0);
}


--