New upstream version 3.0.0
This commit is contained in:
parent
99e3c572d1
commit
b262662bf4
|
@ -12,6 +12,7 @@
|
||||||
.libs
|
.libs
|
||||||
.dirstamp
|
.dirstamp
|
||||||
.version
|
.version
|
||||||
|
/.pc
|
||||||
Makefile
|
Makefile
|
||||||
Makefile.in
|
Makefile.in
|
||||||
auxdir/
|
auxdir/
|
||||||
|
|
|
@ -86,7 +86,7 @@ install: all install-programs
|
||||||
@echo "### DAHDI tools installed successfully."
|
@echo "### DAHDI tools installed successfully."
|
||||||
@echo "### If you have not done so before, install init scripts with:"
|
@echo "### If you have not done so before, install init scripts with:"
|
||||||
@echo "###"
|
@echo "###"
|
||||||
@echo "### make config"
|
@echo "### make install-config"
|
||||||
@echo "###"
|
@echo "###"
|
||||||
@echo "###################################################"
|
@echo "###################################################"
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ __dahdi_span_types() {
|
||||||
has_cmd=0
|
has_cmd=0
|
||||||
for (( i=0; i < COMP_CWORD; i++)); do
|
for (( i=0; i < COMP_CWORD; i++)); do
|
||||||
case "${COMP_WORDS[$i]}" in
|
case "${COMP_WORDS[$i]}" in
|
||||||
dumpconfig | list | set)
|
dumpconfig | list | set | compare)
|
||||||
has_cmd=1
|
has_cmd=1
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
|
@ -69,7 +69,7 @@ __dahdi_span_types() {
|
||||||
grep -l '[EJT]1' /sys/devices/pci0000:00/0000:00:10.4/usb1/1-1/xbus-00/*/spantype 2>/dev/null | sed -e 's|/spantype||') )
|
grep -l '[EJT]1' /sys/devices/pci0000:00/0000:00:10.4/usb1/1-1/xbus-00/*/spantype 2>/dev/null | sed -e 's|/spantype||') )
|
||||||
else
|
else
|
||||||
COMPREPLY=( ${COMPREPLY[@]} $(compgen -W \
|
COMPREPLY=( ${COMPREPLY[@]} $(compgen -W \
|
||||||
'dumpconfig list set' -- $cur) )
|
'dumpconfig list set compare' -- $cur) )
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -66,6 +66,8 @@ usage() {
|
||||||
echo >&2 " add - assign spans, according to /etc/dahdi/assigned-spans.conf"
|
echo >&2 " add - assign spans, according to /etc/dahdi/assigned-spans.conf"
|
||||||
echo >&2 " remove - unassign spans"
|
echo >&2 " remove - unassign spans"
|
||||||
echo >&2 " list - human-readable list of all spans"
|
echo >&2 " list - human-readable list of all spans"
|
||||||
|
echo >&2 " matched - found spans matched in configuration"
|
||||||
|
echo >&2 " unmatched - found spans not matched in configuration"
|
||||||
echo >&2 " dumpconfig - dump current state as new configuration"
|
echo >&2 " dumpconfig - dump current state as new configuration"
|
||||||
echo >&2 ""
|
echo >&2 ""
|
||||||
echo >&2 " options:"
|
echo >&2 " options:"
|
||||||
|
@ -109,7 +111,7 @@ while true ; do
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Internal error!"
|
echo >&2 "Internal error!"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -215,10 +217,10 @@ unassign_all_spans() {
|
||||||
sort | while read spandir; do
|
sort | while read spandir; do
|
||||||
local_spanno=`cat "$spandir/local_spanno"`
|
local_spanno=`cat "$spandir/local_spanno"`
|
||||||
if [ "$dry_run" = true ]; then
|
if [ "$dry_run" = true ]; then
|
||||||
echo "(dry-run) unassign $device $local_spanno"
|
echo >&2 "(dry-run) unassign $device $local_spanno"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
echo "unassign $device $local_spanno"
|
echo >&2 "unassign $device $local_spanno"
|
||||||
if ! echo "$local_spanno" > "$device/unassign_span"; then
|
if ! echo "$local_spanno" > "$device/unassign_span"; then
|
||||||
echo >&2 "$0: failed unassigning '$local_spanno' in '$device'"
|
echo >&2 "$0: failed unassigning '$local_spanno' in '$device'"
|
||||||
fi
|
fi
|
||||||
|
@ -245,12 +247,12 @@ assign_device_spans() {
|
||||||
if [ -d "$span" ]; then
|
if [ -d "$span" ]; then
|
||||||
span_local_spanno=`cat "$span/local_spanno"`
|
span_local_spanno=`cat "$span/local_spanno"`
|
||||||
if [ "$span_local_spanno" != "$local_spanno" ]; then
|
if [ "$span_local_spanno" != "$local_spanno" ]; then
|
||||||
echo "WARNING: $span_local_spanno != $local_spanno"
|
echo >&2 "WARNING: $span_local_spanno != $local_spanno"
|
||||||
fi
|
fi
|
||||||
echo "$device [$local_spanno] already assigned to span $spanno. Skipping..."
|
echo >&2 "$device [$local_spanno] already assigned to span $spanno. Skipping..."
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
echo "assign $device: $s"
|
echo >&2 "assign $device: $s"
|
||||||
if ! echo "$s" > "$device/assign_span"; then
|
if ! echo "$s" > "$device/assign_span"; then
|
||||||
echo >&2 "$0: failed assigning '$s' to '$device'"
|
echo >&2 "$0: failed assigning '$s' to '$device'"
|
||||||
fi
|
fi
|
||||||
|
@ -267,21 +269,21 @@ match_device() {
|
||||||
# We use case to enable shell-style globbing in configuration
|
# We use case to enable shell-style globbing in configuration
|
||||||
case "$hardware_id" in
|
case "$hardware_id" in
|
||||||
$id)
|
$id)
|
||||||
[ "$verbose" = true ] && echo "match by hwid ($id ~ $hardware_id): $spanspecs"
|
[ "$verbose" = true ] && echo >&2 "match by hwid ($id ~ $hardware_id): $spanspecs"
|
||||||
assign_device_spans "$device"
|
assign_device_spans "$device"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
# We use case to enable shell-style globbing in configuration
|
# We use case to enable shell-style globbing in configuration
|
||||||
case "$location" in
|
case "$location" in
|
||||||
$id)
|
$id)
|
||||||
[ "$verbose" = true ] && echo "match by location ($id ~ $location): $spanspecs"
|
[ "$verbose" = true ] && echo >&2 "match by location ($id ~ $location): $spanspecs"
|
||||||
assign_device_spans "$device"
|
assign_device_spans "$device"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
# We use case to enable shell-style globbing in configuration
|
# We use case to enable shell-style globbing in configuration
|
||||||
case "$devpath" in
|
case "$devpath" in
|
||||||
$id)
|
$id)
|
||||||
[ "$verbose" = true ] && echo "match by devpath ($id ~ $devpath): $spanspecs"
|
[ "$verbose" = true ] && echo >&2 "match by devpath ($id ~ $devpath): $spanspecs"
|
||||||
assign_device_spans "$device"
|
assign_device_spans "$device"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -293,7 +295,7 @@ assign_devices() {
|
||||||
echo >&2 "$0: Missing '$DAHDISASSIGNEDSPANSCONF'"
|
echo >&2 "$0: Missing '$DAHDISASSIGNEDSPANSCONF'"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "using '$DAHDISASSIGNEDSPANSCONF'"
|
echo >&2 "using '$DAHDISASSIGNEDSPANSCONF'"
|
||||||
for device in $DEVICES
|
for device in $DEVICES
|
||||||
do
|
do
|
||||||
match_device "$device"
|
match_device "$device"
|
||||||
|
@ -303,13 +305,71 @@ assign_devices() {
|
||||||
auto_assign_devices() {
|
auto_assign_devices() {
|
||||||
for device in $DEVICES
|
for device in $DEVICES
|
||||||
do
|
do
|
||||||
echo "auto-assign $device"
|
echo >&2 "auto-assign $device"
|
||||||
if [ "$dry_run" != true ]; then
|
if [ "$dry_run" != true ]; then
|
||||||
echo 1 > "$device/auto_assign"
|
echo 1 > "$device/auto_assign"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dev_match_conf() {
|
||||||
|
local devpath="$1"
|
||||||
|
local location="$2"
|
||||||
|
local hardware_id="$3"
|
||||||
|
local local_spanno="$4"
|
||||||
|
filter_conf | while read id spanspecs
|
||||||
|
do
|
||||||
|
spanno=`echo "$spanspecs" | cut -d: -f1`
|
||||||
|
match_dev=no
|
||||||
|
# We use case to enable shell-style globbing in configuration
|
||||||
|
case "$hardware_id" in
|
||||||
|
$id)
|
||||||
|
match_dev=yes
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
# We use case to enable shell-style globbing in configuration
|
||||||
|
case "$location" in
|
||||||
|
$id)
|
||||||
|
match_dev=yes
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
# We use case to enable shell-style globbing in configuration
|
||||||
|
case "$devpath" in
|
||||||
|
$id)
|
||||||
|
match_dev=yes
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
if [ "$match_dev" = 'yes' -a "$local_spanno" = "$spanno" ]; then
|
||||||
|
#printf "%-8s (%s) %-14s %s %s\n" "$local_spanno" "$spanno" "[$hardware_id]" "$location" "$devpath"
|
||||||
|
echo "[$hardware_id]:$local_spanno"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
list_devices() {
|
||||||
|
wanted="$1"
|
||||||
|
if [ ! -f "$DAHDISASSIGNEDSPANSCONF" ]; then
|
||||||
|
echo >&2 "$0: Missing '$DAHDISASSIGNEDSPANSCONF'"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo >&2 "using '$DAHDISASSIGNEDSPANSCONF'"
|
||||||
|
for device in $DEVICES
|
||||||
|
do
|
||||||
|
devpath=`cd "$device" && pwd -P`
|
||||||
|
location='@'`attr_clean "$device/location"`
|
||||||
|
hardware_id=`attr_clean "$device/hardware_id"`
|
||||||
|
for local_spanno in `cut -d: -f1 "$device/spantype"`
|
||||||
|
do
|
||||||
|
found=`dev_match_conf "$devpath" "$location" "$hardware_id" "$local_spanno"`
|
||||||
|
if [ "$wanted" = "unmatched" ]; then
|
||||||
|
[ -z "$found" ] && echo "[$hardware_id]:$local_spanno"
|
||||||
|
else
|
||||||
|
[ -z "$found" ] || echo "[$hardware_id]:$local_spanno"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
case "$action" in
|
case "$action" in
|
||||||
auto)
|
auto)
|
||||||
auto_assign_devices
|
auto_assign_devices
|
||||||
|
@ -326,6 +386,12 @@ list)
|
||||||
dumpconfig)
|
dumpconfig)
|
||||||
dump_config
|
dump_config
|
||||||
;;
|
;;
|
||||||
|
matched)
|
||||||
|
list_devices "matched"
|
||||||
|
;;
|
||||||
|
unmatched)
|
||||||
|
list_devices "unmatched"
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo >&2 "Bad action='$action'"
|
echo >&2 "Bad action='$action'"
|
||||||
usage
|
usage
|
||||||
|
|
|
@ -69,6 +69,7 @@ usage() {
|
||||||
echo >&2 "Usage: $0 [options] action [devpath ...]"
|
echo >&2 "Usage: $0 [options] action [devpath ...]"
|
||||||
echo >&2 " action:"
|
echo >&2 " action:"
|
||||||
echo >&2 " set - set spans to E1/T1 according to /etc/dahdi/span-types.conf"
|
echo >&2 " set - set spans to E1/T1 according to /etc/dahdi/span-types.conf"
|
||||||
|
echo >&2 " compare - show config values that differ from system"
|
||||||
echo >&2 " list - human-readable list of all spans"
|
echo >&2 " list - human-readable list of all spans"
|
||||||
echo >&2 " dumpconfig - dump current state in /etc/dahdi/span-types.conf format"
|
echo >&2 " dumpconfig - dump current state in /etc/dahdi/span-types.conf format"
|
||||||
echo >&2 ""
|
echo >&2 ""
|
||||||
|
@ -88,6 +89,8 @@ if [ $? != 0 ]; then
|
||||||
usage
|
usage
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
compare=false
|
||||||
|
|
||||||
# Note the quotes around `$TEMP': they are essential!
|
# Note the quotes around `$TEMP': they are essential!
|
||||||
eval set -- "$TEMP"
|
eval set -- "$TEMP"
|
||||||
|
|
||||||
|
@ -321,13 +324,26 @@ handle_span() {
|
||||||
echo >&2 "Set $devname span $spanno = $val"
|
echo >&2 "Set $devname span $spanno = $val"
|
||||||
fi
|
fi
|
||||||
if [ "$dry_run" != 'true' ]; then
|
if [ "$dry_run" != 'true' ]; then
|
||||||
echo "$spanno:$val" > "$attr_file"
|
if [ "$compare" = 'true' ]; then
|
||||||
|
config="$spanno:$val"
|
||||||
|
system=`grep "$spanno:" "$attr_file"`
|
||||||
|
if [ "$config" != "$system" ]; then
|
||||||
|
|
||||||
|
active_val=`echo $system | cut -d: -f2`
|
||||||
|
echo "$devname $spanno $val $active_val" >>"$compare_results_file"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "$spanno:$val" > "$attr_file"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
set_all_devices() {
|
set_all_devices() {
|
||||||
|
span_differs='false'
|
||||||
|
SPANS_DIFFER='false'
|
||||||
|
|
||||||
if [ ! -f "$DAHDISPANTYPESCONF" ]; then
|
if [ ! -f "$DAHDISPANTYPESCONF" ]; then
|
||||||
echo >&2 "$0: Missing configuration '$DAHDISPANTYPESCONF'"
|
echo >&2 "$0: Missing configuration '$DAHDISPANTYPESCONF'"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -348,6 +364,16 @@ set_all_devices() {
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
if [ "$compare" = 'true' ]; then
|
||||||
|
if [ -s "$compare_results_file" ]; then
|
||||||
|
echo "# Device Unit Config Active"
|
||||||
|
cat "$compare_results_file"
|
||||||
|
rm -f "$compare_results_file"
|
||||||
|
exit 5
|
||||||
|
fi
|
||||||
|
rm -f "$compare_results_file"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$action" in
|
case "$action" in
|
||||||
|
@ -360,6 +386,11 @@ dumpconfig)
|
||||||
set)
|
set)
|
||||||
set_all_devices
|
set_all_devices
|
||||||
;;
|
;;
|
||||||
|
compare)
|
||||||
|
compare=true
|
||||||
|
compare_results_file=`mktemp`
|
||||||
|
set_all_devices
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
usage
|
usage
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -64,7 +64,7 @@ void hup_handler(int sig)
|
||||||
printf("\n--- Results after %d passes ---\n", pass);
|
printf("\n--- Results after %d passes ---\n", pass);
|
||||||
printf("Best: %.3f%% -- Worst: %.3f%% -- Average: %f%%\n",
|
printf("Best: %.3f%% -- Worst: %.3f%% -- Average: %f%%\n",
|
||||||
best, worst, pass ? total/pass : 100.00);
|
best, worst, pass ? total/pass : 100.00);
|
||||||
printf("Cummulative Accuracy (not per pass): %0.3f\n",
|
printf("Cumulative Accuracy (not per pass): %0.3f\n",
|
||||||
pass ? accuracy : 0.0);
|
pass ? accuracy : 0.0);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
dahdi_span_types \- set line modes of DAHDI spans before assignment
|
dahdi_span_types \- set line modes of DAHDI spans before assignment
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
|
||||||
.B dahdi_span_types [\fIoptions\fB] <list|dumpconfig|set> \fB[\fIdevpath \fB...]
|
.B dahdi_span_types [\fIoptions\fB] <list|dumpconfig|compare|set> \fB[\fIdevpath \fB...]
|
||||||
|
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
The span type (the line mode: E1/T1/J1) must be set to a span before
|
The span type (the line mode: E1/T1/J1) must be set to a span before
|
||||||
|
@ -58,6 +58,16 @@ device(s) specified in the command line (or all devices, if none
|
||||||
specified).
|
specified).
|
||||||
.RE
|
.RE
|
||||||
|
|
||||||
|
.B compare
|
||||||
|
.RS
|
||||||
|
Compare the settings on the system to those in the configuration file.
|
||||||
|
For each line that applies to a device on the system, print it if the
|
||||||
|
value to be set and the active value on the system differ.
|
||||||
|
|
||||||
|
The exit status is 0 if there is no difference and non-zero if a
|
||||||
|
difference was detected.
|
||||||
|
.RE
|
||||||
|
|
||||||
.B list
|
.B list
|
||||||
.RS
|
.RS
|
||||||
List line modes for all spans in the system which may be set with
|
List line modes for all spans in the system which may be set with
|
||||||
|
|
|
@ -7,7 +7,7 @@ dahdi_tool \- Shows status of DAHDI interfaces
|
||||||
.B dahdi_tool
|
.B dahdi_tool
|
||||||
|
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
dahdi_tool shows the current status the DAHDI inteface cards plugged
|
dahdi_tool shows the current status the DAHDI interface cards plugged
|
||||||
to the computer.
|
to the computer.
|
||||||
|
|
||||||
It displays values like Current Alarms, SyncSource, Tx/Rx
|
It displays values like Current Alarms, SyncSource, Tx/Rx
|
||||||
|
|
|
@ -33,7 +33,7 @@ is generated in the current directory.
|
||||||
fxotune just reads the settings from fxotune.conf into the FXO modules.
|
fxotune just reads the settings from fxotune.conf into the FXO modules.
|
||||||
|
|
||||||
You are advised to run fxotune on all FXO ports you have that support
|
You are advised to run fxotune on all FXO ports you have that support
|
||||||
it and that are connected. Note that the tunning is affected by e.g.
|
it and that are connected. Note that the tuning is affected by e.g.
|
||||||
the physical parameters of the connection, and thus if it has been
|
the physical parameters of the connection, and thus if it has been
|
||||||
radically changed, you may need to re-run fxotune.
|
radically changed, you may need to re-run fxotune.
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ cards and clones) do not have the hardware to support such tuning.
|
||||||
The tuning process needs a clear line to do the tuning. In order to do
|
The tuning process needs a clear line to do the tuning. In order to do
|
||||||
that, it runs in cycles of the following: sets the line off-hook, dials
|
that, it runs in cycles of the following: sets the line off-hook, dials
|
||||||
a dial string (which should set the PSTN provider waiting for the next
|
a dial string (which should set the PSTN provider waiting for the next
|
||||||
digit), and then starts tuning. It has a limited ammount of time for
|
digit), and then starts tuning. It has a limited amount of time for
|
||||||
tuning before the PSTN gives up and gives a busy tone. So after a while
|
tuning before the PSTN gives up and gives a busy tone. So after a while
|
||||||
it hangs up and starts a new cycle.
|
it hangs up and starts a new cycle.
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@ so if you stop it half-way, you may get a half-configured system. If you
|
||||||
have already tuned your FXO channels and wish to test-run fxotune again,
|
have already tuned your FXO channels and wish to test-run fxotune again,
|
||||||
you are advised to backup /etc/fxotune.conf .
|
you are advised to backup /etc/fxotune.conf .
|
||||||
|
|
||||||
The default for \-m is 18 seconds. This asusmes that you get a clear line
|
The default for \-m is 18 seconds. This assumes that you get a clear line
|
||||||
for at least 18 seconds. It is advised that you test that timeout earlier
|
for at least 18 seconds. It is advised that you test that timeout earlier
|
||||||
by connecting a phone to the FXO line, dialing 4 (or whatever dial string
|
by connecting a phone to the FXO line, dialing 4 (or whatever dial string
|
||||||
you put with \-n) and see how much time of silence you have.
|
you put with \-n) and see how much time of silence you have.
|
||||||
|
|
|
@ -22,4 +22,9 @@ devices_by_registration_time | \
|
||||||
done
|
done
|
||||||
|
|
||||||
# Now handle Astribanks
|
# Now handle Astribanks
|
||||||
LC_ALL=C dahdi_registration -Rv on
|
unmatched="`dahdi_span_assignments unmatched`"
|
||||||
|
if [ -n "$unmatched" ]; then
|
||||||
|
# Only if astribanks are not matched in span-assignments.conf
|
||||||
|
# TODO: have dahdi_registration run only on "$unmatched"
|
||||||
|
LC_ALL=C dahdi_registration -Rv on
|
||||||
|
fi
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
# Run xpp_sync whenever an Astribank is connected.
|
||||||
|
|
||||||
|
# May be set in /etc/dahdi/init.conf
|
||||||
|
XPP_SYNC=${XPP_SYNC:-auto}
|
||||||
|
|
||||||
|
case "$ACTION" in
|
||||||
|
add) ;;
|
||||||
|
*) exit 0 ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
case "${DEVPATH##*/}" in
|
||||||
|
astribanks:*) ;;
|
||||||
|
*) exit 0 ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
xpp_sync "$XPP_SYNC"
|
|
@ -0,0 +1,5 @@
|
||||||
|
# A dracut.conf(5) snippet
|
||||||
|
# Disable loading the Astribank (xpp_usb) drivers. This is because
|
||||||
|
# it relies on files in the root filesystem:
|
||||||
|
# See https://issues.asterisk.org/jira/browse/DAHLIN-352
|
||||||
|
omit_drivers+=" xpp_usb "
|
|
@ -62,6 +62,9 @@ dist_sbin_SCRIPTS = $(perl_scripts)
|
||||||
man_MANS += $(perl_mans)
|
man_MANS += $(perl_mans)
|
||||||
CLEANFILES = $(perl_checks) $(perl_mans)
|
CLEANFILES = $(perl_checks) $(perl_mans)
|
||||||
|
|
||||||
|
dracutconfdir = @prefix@/lib/dracut/dracut.conf.d
|
||||||
|
dracutconf_DATA = 50-dahdi.conf
|
||||||
|
|
||||||
if PBX_USB
|
if PBX_USB
|
||||||
|
|
||||||
SUBDIRS += oct612x xtalk
|
SUBDIRS += oct612x xtalk
|
||||||
|
|
|
@ -47,9 +47,9 @@ Apart from the standard DAHDI build requirements, you also need:
|
||||||
|
|
||||||
* *libusb development headers* to build the Astribank firmware tools
|
* *libusb development headers* to build the Astribank firmware tools
|
||||||
(astribank_tool, astribank_hexload, astribank_allow).
|
(astribank_tool, astribank_hexload, astribank_allow).
|
||||||
This is typically the package libusb-dev on Debian (and derivatives
|
This is typically the package libusb-1.0-0-dev on Debian (and
|
||||||
like Ubuntu) or libusb-devel on RedHat (and derivatives like
|
derivatives such as Ubuntu) or libusbx-devel on RedHat (and derivatives
|
||||||
CentOS/Trixbox).
|
such as CentOS).
|
||||||
* *Echo Canceller Module firmware*: If you have an Astribank with an
|
* *Echo Canceller Module firmware*: If you have an Astribank with an
|
||||||
echo canceller module, see the following section.
|
echo canceller module, see the following section.
|
||||||
|
|
||||||
|
@ -1257,8 +1257,8 @@ Astribanks Synchronization Source
|
||||||
If there is more than one Astribank on the system, all the Astribanks
|
If there is more than one Astribank on the system, all the Astribanks
|
||||||
keep their clock in sync. Optionally the Astribanks can synchronize
|
keep their clock in sync. Optionally the Astribanks can synchronize
|
||||||
their clock to the master DAHDI device (in case it is a different DAHDI
|
their clock to the master DAHDI device (in case it is a different DAHDI
|
||||||
device). Normally you just use the default init.d script or run
|
device). Normally it would be run automatically from the udev hooks
|
||||||
explicitly:
|
run on device plug (handle_device), but you can also run it explicitly:
|
||||||
|
|
||||||
xpp_sync auto
|
xpp_sync auto
|
||||||
|
|
||||||
|
@ -1488,6 +1488,9 @@ other side.
|
||||||
current. That is: which ones are connected to an active FXS on the
|
current. That is: which ones are connected to an active FXS on the
|
||||||
other side.
|
other side.
|
||||||
|
|
||||||
|
===== /sys/bus/astribanks/devices/xbus-NN/NN:M:P/hwid
|
||||||
|
Prints <module type>.<module subtype>. Both are small numbers.
|
||||||
|
|
||||||
===== /sys/bus/astribanks/devices/xbus-NN/NN:M:P/offhook
|
===== /sys/bus/astribanks/devices/xbus-NN/NN:M:P/offhook
|
||||||
Shows ports that are (1) or are not (0) off-hook. When a channel is
|
Shows ports that are (1) or are not (0) off-hook. When a channel is
|
||||||
not off-hook. For BRI and E1/T1 the value is 1 if the span is in use.
|
not off-hook. For BRI and E1/T1 the value is 1 if the span is in use.
|
||||||
|
|
|
@ -117,7 +117,7 @@ Examples:
|
||||||
1:T1,2:T1,*:E1 \- First and second ports are T1, the rest are E1.
|
1:T1,2:T1,*:E1 \- First and second ports are T1, the rest are E1.
|
||||||
.RE
|
.RE
|
||||||
|
|
||||||
If the \fB\-S\fR is not given, the PRI default is determined by the existance of the \fB\-A-fR option.
|
If the \fB\-S\fR is not given, the PRI default is determined by the existence of the \fB\-A-fR option.
|
||||||
.RE
|
.RE
|
||||||
|
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
|
|
|
@ -94,22 +94,27 @@ wait_for_udev() {
|
||||||
UDEV_SETTLE_MAX_TIME=10
|
UDEV_SETTLE_MAX_TIME=10
|
||||||
|
|
||||||
echo "Waiting for udev to settle down..."
|
echo "Waiting for udev to settle down..."
|
||||||
if [ -x /sbin/udevsettle ]; then
|
udevsettle_cmd=
|
||||||
# Old system, stand-alone udevsettle command
|
if [ -x /bin/udevadm ]; then
|
||||||
/sbin/udevsettle --timeout="$UDEV_SETTLE_MAX_TIME"
|
udevsettle_cmd="/bin/udevadm settle"
|
||||||
elif [ -x /sbin/udevadm ]; then
|
elif [ -x /sbin/udevadm ]; then
|
||||||
# Assume modern system, udevadm has settle parameter
|
udevsettle_cmd="/sbin/udevadm settle"
|
||||||
if ! /sbin/udevadm settle --timeout="$UDEV_SETTLE_MAX_TIME"
|
elif [ -x /sbin/udevsettle ]; then
|
||||||
then
|
udevsettle_cmd="/sbin/udevsettle"
|
||||||
echo "udevadm failed ($?)."
|
|
||||||
echo "Fallback to sleep $UDEV_SETTLE_MAX_TIME seconds."
|
|
||||||
sleep "$UDEV_SETTLE_MAX_TIME"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
echo "No udevsettle/udevadm."
|
echo "No udevsettle/udevadm."
|
||||||
echo "Fallback to sleep $UDEV_SETTLE_MAX_TIME seconds."
|
echo "Fallback to sleep $UDEV_SETTLE_MAX_TIME seconds."
|
||||||
sleep "$UDEV_SETTLE_MAX_TIME"
|
sleep "$UDEV_SETTLE_MAX_TIME"
|
||||||
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ! $udevsettle_cmd --timeout="$UDEV_SETTLE_MAX_TIME"
|
||||||
|
then
|
||||||
|
echo "udevadm failed ($?)."
|
||||||
|
echo "Fallback to sleep $UDEV_SETTLE_MAX_TIME seconds."
|
||||||
|
sleep "$UDEV_SETTLE_MAX_TIME"
|
||||||
|
fi
|
||||||
|
|
||||||
sleep 1 # Wait a bit more (races)
|
sleep 1 # Wait a bit more (races)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ Q: Why do you use a semaphore?
|
||||||
A: because, unlike the filesystem, it is writable at any given time.
|
A: because, unlike the filesystem, it is writable at any given time.
|
||||||
|
|
||||||
.SH BUGS
|
.SH BUGS
|
||||||
Option ordering matter. The \fB\-v\fR and \fB\-d\fR options should preceed
|
Option ordering matter. The \fB\-v\fR and \fB\-d\fR options should precede
|
||||||
the actions (\fB\-a\fR, \fB\-r\fR and \fB\-w\fR).
|
the actions (\fB\-a\fR, \fB\-r\fR and \fB\-w\fR).
|
||||||
The \fB\-t\fItimeout\fR option should preceed the \fB\-w\fR option.
|
The \fB\-t\fItimeout\fR option should preceed the \fB\-w\fR option.
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ static int reset_kind(const char *arg)
|
||||||
if(strcasecmp(reset_kinds[i].name, arg) == 0)
|
if(strcasecmp(reset_kinds[i].name, arg) == 0)
|
||||||
return reset_kinds[i].type_code;
|
return reset_kinds[i].type_code;
|
||||||
}
|
}
|
||||||
ERR("Uknown reset kind '%s'\n", arg);
|
ERR("Unknown reset kind '%s'\n", arg);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,9 +157,9 @@ int main(int argc, char *argv[])
|
||||||
ERR("Bad reset kind '%s'\n", opt_reset);
|
ERR("Bad reset kind '%s'\n", opt_reset);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
DBG("Reseting (%s)\n", opt_reset);
|
DBG("Resetting (%s)\n", opt_reset);
|
||||||
if((ret = mpp_reset(mpp, full_reset)) < 0) {
|
if((ret = mpp_reset(mpp, full_reset)) < 0) {
|
||||||
ERR("%s Reseting astribank failed: %d\n",
|
ERR("%s Resetting astribank failed: %d\n",
|
||||||
(full_reset) ? "Full" : "Half", ret);
|
(full_reset) ? "Full" : "Half", ret);
|
||||||
}
|
}
|
||||||
goto out;
|
goto out;
|
||||||
|
|
|
@ -109,9 +109,15 @@ foreach my $xbus (Dahdi::Xpp::xbuses($sorter)) {
|
||||||
system @cmd;
|
system @cmd;
|
||||||
warn "Failed '@cmd' (status=$?)\n" if $?;
|
warn "Failed '@cmd' (status=$?)\n" if $?;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (defined($on) && $on) {
|
||||||
|
if ($opts{'R'} || ! $default_auto_assign) {
|
||||||
# wait for UDEV to do its stuff
|
# wait for UDEV to do its stuff
|
||||||
system "dahdi_waitfor_span_assignments assigned";
|
system "dahdi_waitfor_span_assignments assigned";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
foreach my $xbus (Dahdi::Xpp::xbuses($sorter)) {
|
||||||
foreach my $xpd (Dahdi::Xpp::Xpd::telephony_devs($xbus->xpds())) {
|
foreach my $xpd (Dahdi::Xpp::Xpd::telephony_devs($xbus->xpds())) {
|
||||||
my $spanno = $xpd->xpd_getattr('span');
|
my $spanno = $xpd->xpd_getattr('span');
|
||||||
myprintf "\t%-10s: ", $xpd->fqn;
|
myprintf "\t%-10s: ", $xpd->fqn;
|
||||||
|
|
|
@ -349,7 +349,7 @@ load_fw_device() {
|
||||||
echo "WARNING: ECHO burning was skipped (no capabilities)"
|
echo "WARNING: ECHO burning was skipped (no capabilities)"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
pic_files=`echo "$FIRMWARE_DIR"/PIC_TYPE_[1-4].hex`
|
pic_files=`echo "$FIRMWARE_DIR"/PIC_TYPE_[1-46].hex`
|
||||||
debug "PIC burning into $dev: begin $pic_files"
|
debug "PIC burning into $dev: begin $pic_files"
|
||||||
run_astribank_hexload -D "$dev" -p $pic_files
|
run_astribank_hexload -D "$dev" -p $pic_files
|
||||||
debug "PIC burning into $dev: end $pic_files"
|
debug "PIC burning into $dev: end $pic_files"
|
||||||
|
@ -443,7 +443,7 @@ fpga_firmware_all_devices() {
|
||||||
reset_fpga() {
|
reset_fpga() {
|
||||||
devices=`filter_devs 'e4e4/11[3456][124]/*'`
|
devices=`filter_devs 'e4e4/11[3456][124]/*'`
|
||||||
totaldevs=`numdevs 'e4e4/11[3456][124]/*'`
|
totaldevs=`numdevs 'e4e4/11[3456][124]/*'`
|
||||||
echo >&2 -- "Reseting devices [$totaldevs devices]"
|
echo >&2 -- "Resetting devices [$totaldevs devices]"
|
||||||
echo "$devices" | grep -v '^$' | while read id_str dev
|
echo "$devices" | grep -v '^$' | while read id_str dev
|
||||||
do
|
do
|
||||||
(
|
(
|
||||||
|
|
|
@ -64,7 +64,7 @@ sub do_select(@) {
|
||||||
foreach my $xpd (@_) {
|
foreach my $xpd (@_) {
|
||||||
my $xbus = $xpd->xbus;
|
my $xbus = $xpd->xbus;
|
||||||
my $busnum = $xbus->name;
|
my $busnum = $xbus->name;
|
||||||
die "Uknown bus name" unless $busnum;
|
die "Unknown bus name" unless $busnum;
|
||||||
$busnum =~ s/XBUS-//;
|
$busnum =~ s/XBUS-//;
|
||||||
die "bad bus name" unless $busnum =~ /^\d+$/;
|
die "bad bus name" unless $busnum =~ /^\d+$/;
|
||||||
#printf "Setting sync: %-10s (%s)\n", $xpd->fqn, $xpd->type;
|
#printf "Setting sync: %-10s (%s)\n", $xpd->fqn, $xpd->type;
|
||||||
|
|
|
@ -21,8 +21,7 @@ USB_NAME = libusb
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
noinst_PROGRAMS = xlist_test xusb_test xusb_test_bypath xtalk_test xtalk_raw_test
|
noinst_PROGRAMS = xlist_test xusb_test xusb_test_bypath xtalk_test xtalk_raw_test xtalk_send
|
||||||
sbin_PROGRAMS = xtalk_send
|
|
||||||
noinst_LTLIBRARIES = libxtalk.la
|
noinst_LTLIBRARIES = libxtalk.la
|
||||||
dist_noinst_HEADERS = \
|
dist_noinst_HEADERS = \
|
||||||
xtalk_base.h \
|
xtalk_base.h \
|
||||||
|
@ -39,8 +38,6 @@ dist_noinst_HEADERS = \
|
||||||
include/xtalk/xtalk_iface.h \
|
include/xtalk/xtalk_iface.h \
|
||||||
#
|
#
|
||||||
|
|
||||||
man_MANS = xtalk_send.8
|
|
||||||
|
|
||||||
libxtalk_la_CFLAGS = \
|
libxtalk_la_CFLAGS = \
|
||||||
$(COMMON_CFLAGS) \
|
$(COMMON_CFLAGS) \
|
||||||
-I$(srcdir)/include \
|
-I$(srcdir)/include \
|
||||||
|
|
|
@ -183,7 +183,7 @@ int process_command(
|
||||||
}
|
}
|
||||||
DBG("REPLY OP: 0x%X [%s]\n", reply->header.op, reply_desc->name);
|
DBG("REPLY OP: 0x%X [%s]\n", reply->header.op, reply_desc->name);
|
||||||
if (reply->header.op == XTALK_ACK) {
|
if (reply->header.op == XTALK_ACK) {
|
||||||
int status = CMD_FIELD(reply, XTALK, ACK, stat);
|
uint8_t status = CMD_FIELD(reply, XTALK, ACK, stat);
|
||||||
|
|
||||||
if (expected) {
|
if (expected) {
|
||||||
ERR("Expected OP=0x%02X: Got ACK(%d): %s\n",
|
ERR("Expected OP=0x%02X: Got ACK(%d): %s\n",
|
||||||
|
|
|
@ -215,7 +215,7 @@ int xusb_filter_bypath(const struct xusb_device *xusb_device, void *data)
|
||||||
assert(path != NULL);
|
assert(path != NULL);
|
||||||
p = path_tail(path);
|
p = path_tail(path);
|
||||||
if (strcmp(xusb_device->devpath_tail, p) != 0) {
|
if (strcmp(xusb_device->devpath_tail, p) != 0) {
|
||||||
DBG("%s: device path missmatch (!= '%s')\n",
|
DBG("%s: device path mismatch (!= '%s')\n",
|
||||||
xusb_device->devpath_tail, p);
|
xusb_device->devpath_tail, p);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue