summaryrefslogtreecommitdiff
path: root/xpp
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2006-09-04 22:25:56 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2006-09-04 22:25:56 +0000
commit4ffddec27088284c2cfaf7ce8fa8d3fe06b2a7b4 (patch)
tree185c2b98701e31430c8898fc6da9ea63c5bfd209 /xpp
parentfa2e39e7130a75e0a446095ff0a55cd003a0c165 (diff)
genzaptelconf: handle the case of zap_autoreg=0
(FIXME: code copied from zaptel.init) git-svn-id: http://svn.digium.com/svn/zaptel/trunk@1384 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'xpp')
-rwxr-xr-xxpp/utils/genzaptelconf23
1 files changed, 23 insertions, 0 deletions
diff --git a/xpp/utils/genzaptelconf b/xpp/utils/genzaptelconf
index 52d42bc..8dbf78c 100755
--- a/xpp/utils/genzaptelconf
+++ b/xpp/utils/genzaptelconf
@@ -279,6 +279,28 @@ update_extensions_defs() {
if [ -d "$tmp_dir" ]; then rm -rf "$tmp_dir"; fi
}
+
+
+zap_reg_xpp() {
+ if [ ! -d /proc/xpp ]; then return; fi
+
+ # Get a list of connected Astribank devices, sorted by the name of
+ # the USB connector. That order is rather arbitrary, but will not
+ # change without changes to the cabling.
+ xbusses=`sort -k 2 /proc/xpp/xbuses | awk -F: '/STATUS=connected/ {print $1}'`
+
+ # get a list of XPDs that were not yet registered as zaptel spans.
+ # this will be the case if you set the parameter zap_autoreg=0 to
+ # the module xpp
+ # Append /dev/null to provide a valid file name in case of an empty pattern.
+ xbusses_pattern=`echo $xbusses| sed -e 's|XBUS-[0-9]*|/proc/xpp/&/XPD-*/zt_registration|g'`' /dev/null'
+ xpds_to_register=`grep -l 0 $xbusses_pattern`
+ for file in $xpds_to_register; do
+ echo 1 >$file
+ done
+}
+
+
check_for_astribank(){
if ! grep -q XPP_IN/ /proc/zaptel/* 2>/dev/null
then
@@ -986,6 +1008,7 @@ fi
if [ "$mode" = list ]; then
genconf list
else
+ zap_reg_xpp
check_for_astribank
get_rapid_extens
say "Generating '${ZAPCONF_FILE}'"