File: button.c

package info (click to toggle)
mgetty 1.2.1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,880 kB
  • sloc: ansic: 42,728; sh: 6,487; perl: 6,262; makefile: 1,457; tcl: 756; lisp: 283
file content (32 lines) | stat: -rw-r--r-- 795 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
 * button.c
 *
 * Mgetty calls vgetty_button when it detects, that the Data/Voice button
 * on a ZyXEL modem was pressed.
 *
 * If the phone didn't ring, vgetty calls the button_program to play
 * the received voice messages. Otherwise vgetty leaves the voice mode
 * and tries a data or fax connection.
 *
 * $Id: button.c,v 1.4 1998/09/09 21:08:06 gert Exp $
 *
 */

#include "../include/voice.h"

void vgetty_button(int rings)
     {

     if ((rings == 0) && (strlen(cvd.button_program.d.p) != 0))
          {
          char file_name[VOICE_BUF_LEN];

          make_path(file_name, cvd.voice_dir.d.p,
           cvd.button_program.d.p);
          voice_mode_on();
          voice_execute_shell_script(file_name, NULL);
          voice_mode_off();
          exit(0);
          };

     }