Xref: utzoo unix-pc.general:183 comp.sys.att:2146 Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!amdcad!ames!umd5!purdue!gatech!hao!oddjob!gargoyle!ihnp4!ihlpg!bamford From: bamford@ihlpg.ATT.COM (Harold E. Bamford) Newsgroups: unix-pc.general,comp.sys.att Subject: Re: switching back from dial pulsing to touch tone Message-ID: <4586@ihlpg.ATT.COM> Date: 8 Jan 88 17:23:37 GMT References: <1061@wrcola.UUCP> Reply-To: bamford@ihlpg.UUCP (Harold E. Bamford) Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 57 Keywords: how to switch, dial pulse, touch tone In article <1061@wrcola.UUCP> kathy@wrcola.UUCP (Kathy Vincent) writes: >... How can this guy reset his computer so that it will >dial touch tones instead of pulses? I ran into this problem and put "phone2tone" into /etc/rc. Here is the source. Please don't offer a lot of criticism on style or flexibility; this is offered as is with no warranty of any sort. But it worked for me... /********************************************************************** * EMACS_MODES: c !fill tabstop=4 * * This program sets the modem to tone dialing rather than the power-up * default of pulse dialing. **********************************************************************/ #include #include #include #include main(argc,argv) int argc; char *argv[]; /* needed for program name in error messages */ { int fd; /* file descriptor from open() */ struct updata data; /* defined in sys/phone.h */ /* Open up the modem, so that ioctl() can be called */ if((fd = open("/dev/ph1",O_RDWR|O_NDELAY)) <= 0) { fprintf(stderr,"%s: open failed, fd=%d errno=%d\n", argv[0],fd,errno); exit(errno); } /* Get the current parameters */ if(ioctl(fd,PIOCGETP,&data) < 0) { fprintf(stderr,"%s: ioctl(PIOCGETP) failed, errno=%d\n", argv[0],errno); exit(errno); } data.c_lineparam &= ~(PULSE); /* turn off pulse dialing */ data.c_lineparam |= DTMF; /* turn on tone dialing */ if(ioctl(fd,PIOCSETP,&data) < 0) { fprintf(stderr,"%s: ioctl(PIOCSETP) failed, errno=%d\n", argv[0],errno); exit(errno); } close(fd); exit(0); } -- Harold Bamford, AT&T Bell Labs IHP 2F-524 (312) 416-7397 ihnp4!ihlpg!bamford