[zaptel-commits] tzafrir: branch 1.2 r2670 - /branches/1.2/zaptel.init
SVN commits to the Zaptel project
zaptel-commits at lists.digium.com
Tue Jun 26 15:05:05 CDT 2007
Author: tzafrir
Date: Tue Jun 26 15:05:05 2007
New Revision: 2670
URL: http://svn.digium.com/view/zaptel?view=rev&rev=2670
Log:
* Fix unloading of xpp modules.
* Add optional support for using the zaptel perl functions
Modified:
branches/1.2/zaptel.init
Modified: branches/1.2/zaptel.init
URL: http://svn.digium.com/view/zaptel/branches/1.2/zaptel.init?view=diff&rev=2670&r1=2669&r2=2670
==============================================================================
--- branches/1.2/zaptel.init (original)
+++ branches/1.2/zaptel.init Tue Jun 26 15:05:05 2007
@@ -51,6 +51,9 @@
set -- $line
# $1: the original module, $2: size, $3: refcount, $4: deps list
mods=`echo $4 | tr , ' '`
+ # xpp_usb keeps the xpds below busy if an xpp hardware is
+ # connected. Hence must be removed before them:
+ case "$module" in xpd_*) mods="xpp_usb $mods";; esac
for mod in $mods; do
# run in a subshell, so it won't step over our vars:
(unload_module $mod)
@@ -59,6 +62,26 @@
done
rmmod $module
}
+
+# Initialize the Xorcom Astribank (xpp/) using perl utiliites:
+# intended to replace all the the three functions below if user has
+# installed the zaptel-perl utilities.
+xpp_startup() {
+ # do nothing if the module xpp was not loaded
+ if [ ! -d /proc/xpp ]; then return 0; fi
+
+ echo "Waiting for Astribank devices to initialize:"
+ cat /proc/xpp/XBUS-[0-9]*/waitfor_xpds 2>/dev/null || true
+
+ # overriding locales for the above two, as perl can be noisy
+ # when locales are missing.
+ # No register all the devices if they didn't auto-register:
+ LC_ALL=C zt_registration on
+
+ # this one could actually be run after ztcfg:
+ LC_ALL=C xpp_sync "$XPP_SYNC"
+}
+
# Wait for Astribank to initialize registers:
wait_for_xpp() {
@@ -212,6 +235,8 @@
done
sleep 3 # TODO: remove it
+ # If you have zaptel-perl, the three below can be replaced with:
+ #xpp_startup
wait_for_xpp
zap_reg_xpp
fix_asterisbank_sync # can actually be run after ztcfg
More information about the zaptel-commits
mailing list