[comp.dcom.modems] Telix SALT lang and ring detection

Bob_Carpenter@mindlink.bc.ca (Bob Carpenter) (06/03/91)

> hunky@matt.ksu.ksu.edu writes:
> 
> I would like to write a Telix SALT script that would detect when my phone
> rang. If any of you know how or have ever done so, I would appreciate your
> advice/info. Also, is there any difference when detecting rings on the local
> phone versus the remote phone (when calling)?
> 


I wrote a quick script to detect not only when the phone rings, (the RING from
your modem) but to log it to a file.
//////////////////////////////////////////////////////////////////
//
//                         CALLER.SLT
//
//           A call counter SCRIPT for Telix 3.xx
//           This program waits for rings, counts them and
//           logs them in a file called CALLER.USE
//           Escape exits the program.
//
//           January 10, 1990
/////////////////////////////////////////////////////////////////

main ()
 {
  INT OLD_SCR_CHK_KEY;
  int t1, stat, rings, counter;
  int wait = 70;                     // 10ths of sec. to wait for next ring
  str call_string[5];
  /////////
  old_scr_chk_key = _scr_chk_key;
  _scr_chk_key = 0;                   // allow keyinw to work.
  t1 = track ("RING", 0);             // check for this string
  str file_name[12] = "CALLER.USE";   // file with calls data
  if (usage_stat())
   usagelog ("*CLOSE*");              // close userlog if left open
  usagelog (file_name);               // open caller log
  t1 = track ("RING");                // set tracking string
  update_term();                      // ensure that the display bar is current
  while (1)
   {
    if (inkey () == 27)               // if ESCape is pressed finish.
     break;
    terminal ();                      // check for input
    stat = track_hit (0);             // check if any hits
    if (stat == t1)
     {
      rings = 1;
      counter = timer_start (wait);   // string is here start counter
      while (1)
       {
        terminal ();
        stat = track_hit (0);
        if (stat == t1)               // check for another ring
         {
          ++rings;                    // yes phone rang increment counter
          timer_restart (counter, wait);  // reset counter
         }
        if (time_up (counter))        // no more rings.
         break;
       }
      timer_free (counter);
      ustamp ("Incoming call, with ", 1, 0); // write time and comment
      itos (rings, call_string);
      ustamp (call_string, 0, 0);     // write number of rings
      ustamp (" Rings.", 0, 1);
     }
   }
  usagelog ("*CLOSE*");               // close usagelog
  track_free (1);                     // stop checking for string
  _SCR_CHK_KEY = OLD_SCR_CHK_KEY;     // reset keycheck
 }

////////////////////////////////////////////////////////////////

Short and Sweet.

Bob Carpenter  [Check the return path...]

hunky@matt.ksu.ksu.edu (Dudley...Suave') (06/04/91)

I would like to write a Telix SALT script that would detect when my phone
rang. If any of you know how or have ever done so, I would appreciate your
advice/info. Also, is there any difference when detecting rings on the local
phone versus the remote phone (when calling)?

--
"I've seen the future of underwear...Get out while you can!" - Jerry Howard