chat(8)

Shane Wegner (shane@cm.nu)
Wed, 2 Sep 1998 12:02:26 +0200


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I put it in cnd-program.  It looks something like this.

// Returns nonzero if the specified phone number is unwanted.
int unwanted(const char *number) {
char *s;
FILE *badfile;
int c;
badfile = fopen(badfilename,"r");
if (badfile == NULL)
return 0;
s = malloc(64);
while (c != EOF) {
c = fscanf(badfile,"%s\n",s);
if (!strcmp(number,s)) {
free(s);
fclose(badfile);
return 1;
} // endif
} // end while
free(s);
fclose(badfile);
return 0;
}

That does a very basic scan.  When I figure out the chat(8) command, I'll
give it more flexability.  I hope that helps.

- -- 
Shane Wegner: mailto:shane@cm.nu
Sysadmin, Continuum Systems: http://www.cm.nu/
Vice President, W.A.P.V.I.
Personal website: http://www.cm.nu/~shane/
PGP key: finger:shane@cm.nu
ICQ UIN: 15706546

On Wed, 2 Sep 1998, Daniel D. Barber wrote:

> Shane Wegner wrote:
> > 
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> > 
> > Hi,
> > 
> > It was mentioned about a day ago that one could use a chatscript in
> > cnd-program inorder to hangup on an unwanted number.  I think this is what
> > I want to do because I get alot of telemarketers so it would be very
> > useful.  Anyways, I have the following chat command.
> > system("/usr/sbin/chat TIMEOUT 3 '' \rAT 'OK'  ATh1h0");
> > But chat works with stdin and stdout so I tried:
> > system("/usr/sbin/chat TIMEOUT 3 '' \rAT 'OK'  ATh1h0 </dev/ttyS3
> > >/dev/ttyS3");
> > 
> > How do I get it to use the modem instead of stdin/out?  My sinceer
> > appologies if this in in a manpage or the list archives but I looked
> > everywhere.  It's probably something pretty small though.
> > 
> Shane,
> 
> where are you putting those commands, in the dialin.config?  If not,
> where do you specify what numbers it should hang up on?  I am looking
> for any clue as to the chat script. I have no idea where to start.
> 
> I have been looking at the man page for voice.shell, but it looks like
> it would be pretty in-depth programming to get it to do what I want.
> 
> Dan
> 

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBNe0Xs8rVq/2G1RScEQIJfQCaA5ZPhXrJwzh1njiJOpLIfvzeRrEAoPuo
hpvQdpPNQLFnjjPBXX7BeNY3
=UXWv
-----END PGP SIGNATURE-----