summaryrefslogtreecommitdiff
path: root/xpp/utils/genzaptelconf
diff options
context:
space:
mode:
Diffstat (limited to 'xpp/utils/genzaptelconf')
-rwxr-xr-xxpp/utils/genzaptelconf49
1 files changed, 30 insertions, 19 deletions
diff --git a/xpp/utils/genzaptelconf b/xpp/utils/genzaptelconf
index fe5c9e4..1763427 100755
--- a/xpp/utils/genzaptelconf
+++ b/xpp/utils/genzaptelconf
@@ -32,8 +32,11 @@
# Don't override variables here. Override them in /etc/default/zaptel
#
# 0.5.3:
-# * Experimental support for Sangoman analog cards (A20x)
-# * fixed timeout for Astribank load
+# * Experimental support for Sangoma analog cards (A20x)
+# * Support OpenVox A1200P (A TDM400P clone refactored)
+# * Fixed timeout for Astribank load
+# * Delete unsuccessfully-probe modules
+# * Pass callerid from trunks
# 0.5.2:
# * Now it should detect most PRI cards and even wcusb
# 0.5.1:
@@ -342,7 +345,7 @@ print_pattern() {
fi
else # this is an FXO (trunk/phone: FXO signalling)
# we have may have set it. So reset it:
- echo "callerid=\"\" <0>"
+ echo "callerid=asrecieved"
echo "mailbox="
if [ "$group_manual" != "yes" ]
then
@@ -410,22 +413,29 @@ count_proc_zap_lines() {
load_modules() {
say "Test Loading modules:"
- for i in zaptel $ALL_MODULES
+ for i in $ALL_MODULES
do
- if [ "$i" = ztdummy ]; then
- continue # No hardware to detect
- fi
lines_before=`count_proc_zap_lines`
args="${i}_args"
eval "args=\$$args"
# a module is worth listing if it:
# a. loaded successfully, and
# b. added channels lines under /proc/zaptel/*
- if /sbin/modprobe $i $args 2> /dev/null && \
- [ $lines_before -lt `count_proc_zap_lines` ]
+ if /sbin/modprobe $i $args 2> /dev/null
then
- probed_modules="$probed_modules $i"
- say " ok $i $args"
+ check=0
+ case "$i" in
+ xpp_usb) check=`grep 'STATUS=connected' 2>/dev/null /proc/xpp/xbuses | wc -l` ;;
+ *) if [ $lines_before -lt `count_proc_zap_lines` ]; then check=1; fi ;;
+ esac
+ if [ "$check" != 0 ]
+ then
+ probed_modules="$probed_modules $i"
+ say " ok $i $args"
+ else
+ say " - $i $args"
+ rmmod $i
+ fi
else
say " - $i $args"
fi
@@ -474,20 +484,21 @@ wait_for_xpp() {
if [ -d /proc/xpp ] && \
[ "`cat /sys/module/xpp/parameters/zap_autoreg`" = 'Y' ]
then
- out_on_timeout=0
# wait for the XPDs to register:
+ # TODO: replace this loop with 'cat /proc/xpp/XBUS-*/waitfor_xpds
+ success=0
for i in `seq 30`; do
- sleep 1
if ! grep -q 0 /proc/xpp/*/*/zt_registration 2>/dev/null
then
# There are either no XPDs or all of them are
# registered. Nothing to do
- out_on_timeout=1
+ success=1
break
fi
+ sleep 1
done
- if [ "$out_on_timeout" != 0 ]
- then echo >&2 "Warning: time out waiting for xpp init."
+ if [ "$success" = 0 ]; then
+ echo 1>&2 "$0: WARNING: some XPD's are not registered yet (timeout)"
fi
fi
}
@@ -643,7 +654,7 @@ EOF
# in case this is a real channel.
chan_num=`echo $line |awk '{print $1}'`
case "$line" in
- *WCTDM/*|*/WRTDM/*)
+ *WCTDM/*|*/WRTDM/*|*OPVXA1200/*)
# this can be either FXS or FXO
maybe_fxs=0
maybe_fxo=0
@@ -772,7 +783,7 @@ EOF
# NT is the same as FXS for us and TE is the same as FXO
if [ "$span_termtype" = 'nt' ]
then
- #echo "callerid=\"Channel $chan\" <$exten>"
+ echo "callerid=\"Channels $span_begin - $span_end\" <$span_begin>"
#echo "mailbox=$exten"
if [ "$group_manual" != "yes" ]
then
@@ -783,7 +794,7 @@ EOF
echo "context=$context_phones"
fi
else # we have may have set it. So reset it:
- #echo "callerid=\"\" <0>"
+ echo "callerid=asrecieved"
#echo "mailbox="
if [ "$group_manual" != "yes" ]
then