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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
| #
# Sample voice configuration file
# -------------------------------
#
# $Id: voice.conf-dist,v 1.7 2000/06/11 16:14:51 marcs Exp $
#
# This file is read twice: First the program configuration is read and
# second the port configuration. This means that generic values at the
# beginning of the file will override program values on the second read.
# So if you want to make a generic value program dependant, remove it
# from the generic part of the config file.
#
# Watch out! Some options in this file are not yet implemented or only
# available with some modems.
#
#
# Generic default values
# ----------------------
#
part generic
#
# Possible log levels are:
#
# L_FATAL 0
# L_ERROR 1
# L_AUDIT 2
# L_WARN 3
# L_MESG 4
# L_NOISE 5
# L_JUNK 6
#
voice_log_level 6
# Where stderr of the voice shell script should go.
# %s will be replaced by the tty name (like for the vgetty/mgetty log).
# If not defined, stderr goes to the modem.
voice_shell_log "/var/log/vgetty_voice_shell.%s"
#
# Primary voice directory for vgetty.
#
voice_dir /var/spool/voice
#
# incoming messages are owned by "root.phone" and mode "rw-rw----" (0660)
#
phone_owner root
phone_group phone
phone_mode 0660
#
# Location of the flag file for new incoming messages relative to the
# primary voice directory.
#
message_flag_file .flag
#
# Location where vgetty stores the incoming voice messages relative to
# the primary voice directory.
#
receive_dir incoming
#
# Directory containing the messages for vgetty (greeting, handling the
# answering machine) relative to the primary voice directory.
#
message_dir messages
#
# Name of the file in MESSAGE_DIR that contains the names of
# the greeting message files (one per line, no white space).
#
message_list Index
#
# Filename of a backup greeting message in MESSAGE_DIR (used if
# the random selection fails to find a message).
#
backup_message standard.rmd
#
# Default port speed. The bps rate must be high enough for the compression
# mode used. Note that this is an integer, not one of the Bxxxx defines.
# Basically you should select the highest possible speed your modem and
# computer support. The default value is 38400.
#
port_speed 38400
#
# Default shell to invoke for shell scripts. Make sure this shell
# understands things like funtions, because the scripts rely on this.
# The default is "/bin/sh"
#
voice_shell /bin/bash
#
# Default port timeout in seconds for a read or write operation. The
# default value is 10 seconds.
#
port_timeout 10
#
# Default timeout for a dialout in seconds. The default value is 90 seconds.
#
dial_timeout 90
#
# Delay before sending a new voice command to the modem in milliseconds.
# The default is 100 milliseconds.
#
command_delay 100
#
# Minimum length of detected DTMF tones, in milliseconds. This is
# currently only supported by ZyXel modems with a ROM release of 6.12
# or above. The default is 30 milliseconds.
#
dtmf_len 30
#
# DTMF tone detection threshold in percent (0% to 100%). Increase this
# if the modem erroneously detects DTMF tones, decrease it if it fails to
# detect real ones. This is currently only supported by ZyXel modems
# with a ROM release of 6.12 or above. The default is 40%.
#
dtmf_threshold 40
#
# Time to wait for a DTMF tone to arrive when recording or waiting
# for DTMF input in seconds. The default is to wait for 7 seconds.
#
dtmf_wait 7
#
# In Australia the frequency of the busy signal is the same as the
# frequency of the fax calling tone. This causes problems on at least
# some modems. They report a fax calling tone, when there is a busy
# signal in reality. To help those user, vgetty will ignore any fax
# calling tone detected by the modem, when this option is set.
#
# The following companys suffer from this problem:
# - Telstra (formerly Telecom Australia)
# - Optus
# - Austel (regulatory authority)
#
# The default is of course off.
#
ignore_fax_dle false
#
# Output recorded voice samples without header and expect raw voice
# data on input for playback. This feature is turned off by default.
# Don't enable it unless you really know, what you are doing!
#
raw_data false
#
# This is the default compression mode for vgetty for incoming voice
# messages and for the recording option of vm. The mode 0 is a special
# mode, that will automatically choose a sane default value for every
# modem. The default is 0.
#
rec_compression 0
#
# This is the default recording speed for vgetty for incoming voice
# messages and for the recording option of vm. It is the number of samples
# per second. The speed 0 is a special speed, that will automatically
# choose a sane default value for every modem. The default is 0.
#
rec_speed 0
#
# Silence detection length in 0.1 seconds. If the modem detects silence
# for this time, it sends a silence detect to the host. Default is
# 7 seconds (70 * 0.1 seconds).
#
rec_silence_len 70
#
# Silence detection threshold in percent (0% to 100%). Increase this value
# if you have a noisy phone line and the silence detection doesn't work
# reliably. The default is 40%.
#
rec_silence_threshold 40
#
# If REC_REMOVE_SILENCE is enabled, the trailing silence of an incoming
# voice message as detected by the modem will be deleted. This might
# cause you to miss parts of a message if the silence threshold is
# high and the caller is talking very quietly. To be on the safe side,
# don't define this. This feature is turned off by default.
#
rec_remove_silence false
#
# Maximum recording length in seconds. Hang up if somebody talks
# longer than this. Default is 5 minutes (300 seconds).
# If this is set to zero, disables recording.
#
rec_max_len 300
#
# Minimum recording length in seconds. Some modems can not detect
# data or fax modems, so we use the recording time, to decide,
# what it is. This feature is by default disabled.
#
rec_min_len 0
#
# Enable hardware flow in record and playback mode if the modem
# supports it. This option is by default on.
#
do_hard_flow false
#
# Frequency for the beep command in Hz. The default is 933Hz.
#
beep_frequency 933
#
# Length for the beep command in msec. The default is 1.5 seconds
# (1500 * 0.001 seconds).
#
beep_length 1500
#
# Number of tries to open a voice modem device. The default is 3.
#
max_tries 3
#
# Delay between two tries to open a voice device in seconds. The default
# is 5 seconds.
#
retry_delay 5
#
# Default timeout for the voice watchdog. If this timer expires, the
# running program will be terminated. The default is 60 seconds.
#
watchdog_timeout 600
#
# Some modems support setting the receive gain. This value can be set in
# percent (0% to 100%). 0% is off, 100% is maximum. To use the modem
# default value set this to -1. The default is -1.
#
receive_gain -1
#
# Some modems support setting the transmit gain. This value can be set in
# percent (0% to 100%). 0% is off, 100% is maximum. To use the modem
# default value set this to -1. The default is -1.
#
transmit_gain -1
#
# Usually command echo from the modem should be enabled. Since some modems
# sometimes forget this echo, it is disabled by default. Turning this option
# off makes things more reliable, but bugs are much harder to trace. So
# don't ever think about mailing me a bug report with command echo turned
# off. I will simply ignore it. The default is to disable command echo.
#
enable_command_echo false
#
# Time in msec for the delay, when no new data are received from the modem. A higher value will decrease
# machine load by increasing vgettys reaction time. The default is 10 msec.
#
poll_interval 10
#
# Program specific initializations
# --------------------------------
#
#
# Default values for vgetty
# -------------------------
#
program vgetty
#
# Default number of rings to wait before picking up the phone.
#
# Instead of a number, you can also give a file name, that contains
# a single number with the desired number of rings. Vgetty will
# automatically append the name of the modem device to the file name.
# The file name must be an absolut path starting with a leading "/".
# E.g. "rings /etc/rings" and the modem device is ttyS0, will
# lead to the file name "/etc/rings.ttyS0". If this file doesn't
# exist, vgetty will check for a file without the modem device name
# appended. In this example, vgetty would check for /etc/rings.
#
# Please note, that vgetty forces the number of rings to be at least 2.
# This is, because the caller ID information (if available from your
# provider) is sent between the first and the second ring. Since we don't
# know in advance, if you get CID or not, we stay on the save side.
#
# The default is 3
#
rings 3
#
# Default answer mode when vgetty picks up the phone after incoming
# rings.
#
# Instead of an answer mode, you can also give a file name, that
# contains a single line with the desired answer mode. Vgetty will
# automatically append the name of the modem device to the file name.
# The file name must be an absolut path starting with a leading "/".
# E.g. "answer_mode /etc/answer" and the modem device is ttyS0, will
# lead to the file name "/etc/answer.ttyS0". If this file doesn't
# exist, vgetty will check for a file without the modem device name
# appended. In this example, vgetty would check for /etc/answer.
#
# The default is "voice:fax:data".
#
answer_mode voice
#
# When switching to data or fax mode, always switch to fax mode and
# enable autodetection of data/fax. Some modems report wrong DLE codes
# and so the predetection with DLE codes does not work.
#
force_autodetect false
#
# If vgetty knows that there are new messages (the flag file exists),
# it will turn on the AA lamp on an external modem and enable the toll
# saver - it will answer the phone TOLL_SAVER_RINGS earlier than the
# default. This feature is turned off by default.
#
toll_saver_rings 0
#
# Should the recorded voice message file be kept even if data, fax or
# DTMF codes were detected? If this is set, vgetty never deletes
# a recording, if it is not set it will delete the recording, if an
# incoming data or fax call is detected or if DTMF codes were send. Also
# this should work in nearly every situation, it makes you loose the
# recording, if the caller "plays" with DTMF codes to make the message
# even more beautiful. This feature is enabled by default.
#
rec_always_keep true
#
# The programs defined below get called by vgetty.
#
# Define an empty program name, if you want to disabled one of those
# programs.
#
#
# There are two separate uses for the Data/Voice button on a ZyXEL:
#
# - If a RING was detected recently, answer the phone with the
# answer mode set for this case.
# - Otherwise, call an external program to play back messages
#
# If you don't define button_prgogram, vgetty will always pick up
# the phone if Data/Voice is pressed.
#
# The default value is "".
#
button_program
#
# Program called when the phone is answered, this is instead
# of the normal behaviour. Don't define this unless you want
# to e.g. set up a voice mailbox where the normal answering
# machine behaviour would be inappropiate. The C code is probably
# more stable and uses less resources.
#
# The default value is "".
#
call_program
#
# Program called when a DTMF command in the form '*digits#' is received.
# The argument is the string of digits received (without '*' and '#').
# The default value is "dtmf.sh".
#
dtmf_program dtmf.sh
#
# Program called when a voice message has been received.
# The argument is the filename of the recorded message.
# The default value is "".
#
message_program
#
# Should vgetty use the AA LED on some modems to indicate that new
# messages have arrived? This is done by setting the modem register
# S0 to a value of 255. Some modems have a maximum number of rings
# allowed and autoanswer after this, so they can not use this feature.
# This option is by default off.
#
do_message_light false
#
# Default values for vm
# ---------------------
#
program vm
#
# Voice devices that vm can use e.g. "voice_devices ttyS0:ttyS1". Since
# I don't know to which ports your modems are connected, the default is ""
#
voice_devices ttyS0
#
# Timeout for a dialout operation in seconds. The default is 90 seconds.
#
dialout_timeout 90
#
# Timeout for deciding that a dialout call has been answered; if more
# than this many 1/10ths of a second have passed since the last ringback,
# the modem assumes the call has been answered. Default is 70 (7 sec).
#
ringback_goes_away 70
#
# Timeout for deciding that a dialout call has been answered; if more
# than this many 1/10ths of a second have passed without any ringback
# the modem assumes the call has been answered. Default is 100 (10 sec).
#
ringback_never_came 100
#
# Default values for the pvf tools
# --------------------------------
#
program pvf
#
# There are currently no defaults.
#
#
# Port specific configuration
# ---------------------------
#
#
# Here you can optionally set some of the previously set values to different
# ones for specific ports.
#
# E.g. we have a modem on port ttyS0
#
port ttyS0
#
# And we want it to answer after the first ring and only in data mode.
# So we would define:
#
# rings 1
# answer_mode data
#
# The commands are commented out, because I don't want to set some port
# specific defaults in this sample configuration file. I just want to
# show you how to do it.
#
# Now we set the values for the next port e.g. ttyS5
#
#port ttyS5
#
# And so on for all ports in the system, that need special treatment.
#
#
# Ring type specific configuration
# --------------------------------
#
#
# Here you can optionally set some of the previously set values to different
# ones for specific ring types. The following ring types are possible:
#
# ring - for a normal ring
# ring1 - for distinctive ring number 1
# ring2 - for distinctive ring number 2
# ring3 - for distinctive ring number 3
# ring4 - for distinctive ring number 4
# ring5 - for distinctive ring number 5
# virtual - for a virtual ring (kill -USR1 <mgetty pid>)
# button - if someone pressed the data/voice button on the modem
#
# Note: The current mgetty implementation maps the data/voice button
# event to a virtual ring event.
#
# Note: ISDN MSNs will be mapped to distinctive rings in the future.
#
# E.g. we want to answer the modem on a virtual ring with answer
# mode "fax:data".
#
#ring_type virtual
#answer_mode fax:data
#
# Or e.g. we have one modem and want to answer with voice on a normal
# ring and with fax:data on distinctive ring1.
#
ring_type ring
rings 3
answer_mode voice
#ring_type ring1
# rings 1
# answer_mode fax:data
#
# The commands are commented out, because I don't want to set some ring
# specific defaults in this sample configuration file. I just want to
# show you how to do it.
#
# Note: Setting the number of rings will have no effect until the mgetty
# to vgetty interface is changed.
#
# Note: If you have one modem and distinctive ring, you can simply define
# the answer mode directly in this file for the different rings. If you
# have more than one modem and you want them to react different on the same
# type of ring, you have to define rings and answer_mode as pointers to
# files. E.g.
#
# ring_type ring
#
# rings /etc/rings/ring
# answer_mode /etc/answer/ring
#
# ring_type ring1
#
# rings /etc/rings/ring1
# answer_mode /etc/answer/ring1
#
# and so on. Now you can set up a different number of rings and answer modes
# by creating the files:
#
# /etc/rings/ring - for the default value
# /etc/rings/ring.ttyS0 - for the value for device ttyS0
# /etc/rings/ring.ttyS1 - for the value for device ttyS1
#
# And the same way you can set the answer modes.
# |