Compare commits

...

3 Commits

Author SHA1 Message Date
Tzafrir Cohen
e553ffde2b README: udev hooks run scripts from directories
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2014-01-28 11:42:33 +02:00
Tzafrir Cohen
d1fb614ac8 hotplug: document asterisk scriptlet
A well-behaving distribution may choose not to install
span_config.d/50-asterisk as part of dahdi-tools, as it belongs in
asterisk. Still, it would be nice to be able to keep it as a documented
usage example. So just writ where this file needs to go and what it
does.

No other change: it is still installed by default.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2014-01-28 11:32:31 +02:00
Tzafrir Cohen
98ecc272d1 hyphen/minus fixes in man pages
in groff '-' creates a hyphen and for a minus (path, option, or similar)
you need '\-'.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2014-01-27 20:29:04 +02:00
7 changed files with 41 additions and 33 deletions

7
README
View File

@@ -264,7 +264,8 @@ to user space. Those events are normally handled by udevd. Configurations
for udevd ("udev rules") may be placed in /etc/udev/rules.d or
/lib/udev/rules.d. This package installs rules that instruct udevd to
run the script `/usr/share/dahdi/dahdi_handle_device` on each new
device. This script will:
device, which runs all the scripts in `/usr/share/dahdi/handle_device.d`.
Those scripts will:
* If `/etc/dahdi/span-types.conf` exists, apply it to the device. It is
used for E1/T1/J1 settings. See
@@ -298,12 +299,14 @@ listed under its device. As a new kernel object was created, an event is
sent to udev.
The standard DAHDI udev rules instruct udevd to run the script
`/usr/share/dahdi/dahdi_span_config`. This script configures the new
`/usr/share/dahdi/dahdi_span_config` which runs all the scripts in
`/usr/share/dahdi/span_config.d`. Those script configures the new
span:
* If system.conf does not exist, generates a temporary configuration
for the span using link:doc/dahdi_genconf.8.html[dahdi_genconf
system].
* Runs link:doc/dahdi_cfg.8.html[dahdi_cfg] on the new span (using `-S`
and -C`).

View File

@@ -4,7 +4,7 @@
dahdi_cfg \- configures DAHDI kernel modules from /etc/dahdi/system.conf
.SH SYNOPSIS
.B dahdi_cfg [\-c \fICFG_FILE\fB] [\-S\fINUM\fB [-S\fICHANS\fB]] [\-s] [\-f] [\-t] [\-v [\-v ... ] ]
.B dahdi_cfg [\-c \fICFG_FILE\fB] [\-S\fINUM\fB [\-S\fICHANS\fB]] [\-s] [\-f] [\-t] [\-v [\-v ... ] ]
.B dahdi_cfg \-h

View File

@@ -43,11 +43,11 @@ Insert an error of a specific type
.SH EXAMPLES
Enable network line loopback on span 1:
dahdi_maint -s 1 --loopback networkline
dahdi_maint \-s 1 \-\-loopback networkline
Disable network line loopback on span 1:
dahdi_maint -s 1 --loopback off
dahdi_maint \-s 1 \-\-loopback off
.SH SEE ALSO

View File

@@ -35,7 +35,7 @@ Normally there's a different option that you need that implies it.
.B \-o
.RS
Plays the output to OSS (/dev/dsp). Requires -m not to be used.
Plays the output to OSS (/dev/dsp). Requires \-m not to be used.
.RE
.B \-v
@@ -44,7 +44,7 @@ Display Visual audio levels. With two v-s, Verbose mode is enabled, that
shows the actual levels as numbers. Note that this requires a terminal
wider than 80 columns to be properly displayed.
Implies -m.
Implies \-m.
.RE
.B \-f \fIFILE
@@ -62,14 +62,14 @@ to a file.
.RS
Record the content of the Rx channel to a file.
Implies -m.
Implies \-m.
.RE
.B \-R \fIFILE
.RS
Record the content of the R channel before the echo canceler to a file.
Implies -m.
Implies \-m.
.RE
.B \-s \fIFILE
@@ -87,47 +87,47 @@ canceler to a file.
.RS
Record the content of the Tx channel to a file.
Implies -m.
Implies \-m.
.RE
.B \-T \fIFILE
.RS
Record the content of the Tx channel before the echo canceler to a file.
Implies -m.
Implies \-m.
.RE
.SH EXAMPLES
Visualize audio levels on DAHDI channel 2:
dahdi_monitor 2 -v
dahdi_monitor 2 \-v
Record channel 3 to a file:
dahdi_monitor 3 -f output.raw
dahdi_monitor 3 \-f output.raw
This will create a raw PCM file (signed-linear, 8kHz, mono, 16 bits per
sample). Both the Tx and Rx will be multiplexed in a single channel.
It can be converted to a WAV file using e.g.:
sox -s -c1 -2 -r8000 output.raw output.wav
sox \-s \-c1 \-2 \-r8000 output.raw output.wav
Record Tx and Rx of channel 5 to separate files. This time directly to
WAV files:
dahdi_monitor 5 -r output_rx.wav -t output_tx.wav
dahdi_monitor 5 \-r output_rx.wav \-t output_tx.wav
Record channel 8 to a stereo file (Tx and Rx on its two channels):
dahdi_monitor 8 -s output.raw
dahdi_monitor 8 \-s output.raw
Converting it to a WAV file:
sox -s -c2 -2 -r8000 output.raw output.wav
sox \-s \-c2 \-2 \-r8000 output.raw output.wav

View File

@@ -28,7 +28,7 @@ at all).
.B dahdi_span_assignments
is used to assign those spans or to help creating the configuration
file used in their assignment:
.B /etc/dahdi/assigned-spans.conf .
.B /etc/dahdi/assigned\-spans.conf .
.SH SUB-COMMANDS
@@ -46,14 +46,14 @@ Parameters are paths (in SysFS) to DAHDI devices with unassigned
spans.
The command will assign spans with DAHDI according to
configuration in \fBassigned-spans.conf\fR.
configuration in \fBassigned\-spans.conf\fR.
If no line matches the span, or if the assignment for it fails (it is
not available) it will remain unassigned.
If any of the span settings fails (the span number or range of channels
is already in use), the program will print a message, but continue
applying the others. In such a case you should fix assigned-spans.conf
applying the others. In such a case you should fix assigned\-spans.conf
and re-run \fBadd\fR (or run \fBauto\fR to give those channels the
first available range and regenerate the file with 'dahdi_genconf
assignedspans').
@@ -161,7 +161,7 @@ The value in this field is matched (when the commands \fBadd\fR and
See above for their descriptions. The value may include shell wildcards:
*, ? and [], which are used in the match. The values to be matched are
first cleaned up: '!' is replaced with '/' and any character beyond
"a-zA-Z0-9/:.-" is removed.
"a\-zA\-Z0\-9/:.\-" is removed.
.SS Span Specification
@@ -197,13 +197,13 @@ space must be available.
.B DAHDICONFDIR
.RS
The directory in which assigned-spans.conf resides. /etc/dahdi if not
The directory in which assigned\-spans.conf resides. /etc/dahdi if not
overridden from the environment.
.RE
.B DAHDISASSIGNEDSPANSCONF
.RS
The path to assigned-spans.conf resides. /etc/dahdi/assigned-spans.conf if
The path to assigned-spans.conf resides. /etc/dahdi/assigned\-spans.conf if
not overridden from the environment.
.RE
@@ -216,7 +216,7 @@ environment.
.SH FILES
.B /etc/dahdi/assigned-spans.conf
.B /etc/dahdi/assigned\-spans.conf
.RS
The default location for the configuration file.
.RE

View File

@@ -24,18 +24,18 @@ The device is marked as a path in the SysFS tree.
.SH OPTIONS
.B -h|--help
.B \-h|\-\-help
.RS
Output usage message and exit
.RE
.B -n|--dry-run
.B \-n|\-\-dry\-run
.RS
During \fB"set"\fR operation, only show what would be done, without actually
changing anything.
.RE
.B -v|--verbose
.B \-v|\-\-verbose
.RS
During \fB"set"\fR operation, show the actions that are being performed.
.RE
@@ -53,7 +53,7 @@ to override the "wildcard".
.SH SUB-COMMANDS
.B set
.RS
Reads settings from \fBspan-types.conf\fR and applies them to the
Reads settings from \fBspan\-types.conf\fR and applies them to the
device(s) specified in the command line (or all devices, if none
specified).
.RE
@@ -67,7 +67,7 @@ dahdi_span_types (E1/T1/J1 spans).
.B dumpconfig
.RS
List types for the spans in a format fit to be used in
\fBspan-types.conf\fR. Use this to generate a configuration file after
\fBspan\-types.conf\fR. Use this to generate a configuration file after
you have (perhaps manually) set all existing spans.
.B dahdi_genconf spantypes
@@ -76,7 +76,7 @@ uses this command internally.
.SH CONFIGURATION
.SS General structure
.B span-types.conf
.B span\-types.conf
is a file with lines specifying line modes of spans.
Empty lines or lines beginning with '#' are ignored.
@@ -106,7 +106,7 @@ used) to the following values:
See above for their descriptions. The value may include shell wildcards:
*, ? and [], which are used in the match. The values to be matched are
first cleaned up: '!' is replaced with '/' and any character not in
"a-zA-Z0-9/:.-" is replaced by "_".
"a\-zA\-Z0\-9/:.\-" is replaced by "_".
Note that while span\-types.conf allows an arbitrarily-complex
combination of E1, J1 and T1 ports, it would normally have just a single
@@ -154,13 +154,13 @@ usb:X1234567 [34]:E1 # Except spans 3,4 on the device which will be E1
.B DAHDICONFDIR
.RS
The directory in which span-types.conf resides. /etc/dahdi if not
The directory in which span\-types.conf resides. /etc/dahdi if not
overridden from the environment.
.RE
.B DAHDISPANTYPESCONF
.RS
The path to span-types.conf resides. /etc/dahdi/span\-types.conf if
The path to span\-types.conf resides. /etc/dahdi/span\-types.conf if
not overridden from the environment.
.RE

View File

@@ -1,5 +1,10 @@
#! /bin/sh
# This file, if installed under /usr/share/dahdi/span_config.d/ , will
# attempt to add a newly-generated span to a running copy of Asterisk.
# Asterisk has to be running (if not: it will pick the span on its
# startup), and has to have the channels already configured.
if [ "$ACTION" != 'add' ]; then
# Nothing to do here
exit 0