-=> Quoting Isaac Grover to All <=-
-=> FidoMail to 1:163/215, please.-=<
IG> So would this work?
IG> main ()
IG> {
IG> int callinit=8;
IG> int cnt;
IG> int t1,current;
IG> str script[12];
IG> t1=track("RING");
IG> while (cnt < callinit)
IG> {
IG> terminal();
IG> stat=track_hit(0);
IG> if (current==t1) cnt=cnt+1;
IG> }
Yes - but it will activate the other script after 8 rings - not
necessarily the 8 rings _you_ caused. I.e. If I called and let the
phone ring 4 times your program would count 4 rings. If I did that
twice, it would count a total of 8, and would activate the other
script.
Also, keep in mind the "ring" you hear in the handset when you call
is electronically-generated and the telephone you're calling is
usually _not_ ringing at the same time. You may hear 8 rings in the
handset but the phone may actually ring only 7 times.
You need a timer of some sort in your program. I've found that my
telephone rings about every 6 seconds, so I'd build the timer around
that. I'd also get the first "RING" outside the main track loop to
start the process - get the first ring, start the timer, enter the
second loop. This can be a Waitfor that counts and re-starts,
_within_ the timer loop. If the loop "times out", you did not
receive 8 rings in the allowable time - reset the counters and go
back to the original Track. When you get 8 rings, exit the timer
loop.
Now you can accommodate the "ring count" problem. Wait for another
ring for 10 seconds or so, restarting if you get one. When you call,
you're going to let it ring _nine_ times to make sure you get 8.
This additional loop simply accomodates this. When that loop times
out, there have been no more rings, and you can now delay the 5
seconds and carry on with the other script.
Do you get the feeling I've done something like this before? :-)
TTFN. Rick.
Ottawa, ON 22 Mar 11:07
--- Blue Wave/DOS v2.20
---------------
* Origin: BitByters BBS, Rockland ON, Can. (613)446-7773 v34, (1:163/215)
|