[zaptel-commits] tzafrir: branch 1.4 r2711 - in /branches/1.4: ./ xpp/utils/

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Wed Jul 11 06:51:30 CDT 2007


Author: tzafrir
Date: Wed Jul 11 06:51:29 2007
New Revision: 2711

URL: http://svn.digium.com/view/zaptel?view=rev&rev=2711
Log:
* Enable zaptel-perl and use perl utilities for Astribank init (from 1.2 r2710)
* Update README accordingly.
* Continue documenting Zaptel, while we're updating the README.
* Ignore the generated README.html.

Modified:
    branches/1.4/   (props changed)
    branches/1.4/README
    branches/1.4/xpp/utils/Makefile
    branches/1.4/zaptel.init

Propchange: branches/1.4/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Jul 11 06:51:29 2007
@@ -35,3 +35,4 @@
 menuselect-tree
 Modules.symvers
 Module.symvers
+README.html

Modified: branches/1.4/README
URL: http://svn.digium.com/view/zaptel/branches/1.4/README?view=diff&rev=2711&r1=2710&r2=2711
==============================================================================
--- branches/1.4/README (original)
+++ branches/1.4/README Wed Jul 11 06:51:29 2007
@@ -148,15 +148,16 @@
 
 Installation
 ------------
-
-  ./configure
-  # optional step: select custom configuration:
-  #make menuconfig
-  # optional step: enable zaptel-perl
-  make
-  make install
-  # To install init scripts and config files:
-  #make config
+----------------------------------
+./configure
+# optional step: select custom configuration:
+#make menuconfig
+# optional step: enable zaptel-perl
+make
+make install
+# To install init scripts and config files:
+#make config
+----------------------------------
 
 
 Zaptel PERL modules
@@ -173,13 +174,6 @@
 directly from the zaptel source tree. For example:
 
   ./xpp/utils/zaptel_hardware
-
-The modules and utilities are not installed by default in this version
-of zaptel . In order to get them installed, you need do the following
-before running 'make install': remove the '#' in the line that sets 
-PERLLIBDIR in xpp/utils/Makefile . This can be done by e.g.:
-
-  sed -i -e 's/^#\(PERLLIBDIR\)/\1/' xpp/utils/Makefile
 
 To get usage information on a program, you can also use perldoc
 (sometimes provided in a package separate from perl itself). For
@@ -246,6 +240,39 @@
 verbose output.
 
 
+Spans and Channels
+------------------
+Zaptel provides telephony *channels* to the userspace applications. 
+Those channels are channels are incoreperated into logical units called
+*spans*.
+
+With digital telephony adapters (e.g: E1 or T1), a span normally 
+represents a single port. With analog telephony a span typically
+represents a PCI adapter or a similar logical unit.
+
+Both channels and spans are identified by enumerating numbers (beginning
+with 1). The number of the channel is the lowest unused one when it is
+generated, and ditto for spans.
+
+
+PROCFS Interface: /proc/zap
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+A simple way to get the current list of spans and channels each span
+contains is the files under /proc/zaptel . /proc/zaptel is generated by
+zaptel as it loads. As each span registers to Zaptel, a file under
+/proc/zaptel is created for it. The name of that file is the number of
+that span.
+
+Each file has a 1-line title for the span followed by an empty line and
+then a line for each channel of the span. 
+
+The title line shows the number of the span, its name and title, and 
+(potentially) the alarms in which it is.
+
+The channel line for each channel shows its channel number, name and the
+actual signalling assigned to it through ztcfg.
+
+
 What is the license for the zaptel driver?
 ------------------------------------------
 libpri is distributed under the terms of the GNU General Public License, 

Modified: branches/1.4/xpp/utils/Makefile
URL: http://svn.digium.com/view/zaptel/branches/1.4/xpp/utils/Makefile?view=diff&rev=2711&r1=2710&r2=2711
==============================================================================
--- branches/1.4/xpp/utils/Makefile (original)
+++ branches/1.4/xpp/utils/Makefile Wed Jul 11 06:51:29 2007
@@ -23,8 +23,7 @@
 MANDIR		= $(mandir)/man8
 HOTPLUG_USB_DIR	= /etc/hotplug/usb
 UDEV_RULES_DIR	= /etc/udev/rules.d
-# Perl disabled by default, until we see it is safe:
-#PERLLIBDIR	= $(shell eval `perl -V:sitelib`; echo "$$sitelib")
+PERLLIBDIR	= $(shell eval `perl -V:sitelib`; echo "$$sitelib")
 PERL_DIRS	:= Zaptel Zaptel/Hardware Zaptel/Xpp
 PERL_MODS_PAT	:= *.pm $(PERL_DIRS:%=%/*.pm)
 PERL_MODS	:= $(shell cd zconf; echo $(PERL_MODS_PAT))

Modified: branches/1.4/zaptel.init
URL: http://svn.digium.com/view/zaptel/branches/1.4/zaptel.init?view=diff&rev=2711&r1=2710&r2=2711
==============================================================================
--- branches/1.4/zaptel.init (original)
+++ branches/1.4/zaptel.init Wed Jul 11 06:51:29 2007
@@ -84,71 +84,6 @@
 }
 
 
-# Wait for Astribank to initialize registers:
-wait_for_xpp() {
-	if [ ! -d /proc/xpp ]; then return; fi
-
-	# reading from waitfor_xpds only returns when the device
-	# has finished initilizing its regiters and is available.
-	cat /proc/xpp/XBUS-*/waitfor_xpds 2>/dev/null >/dev/null  || true
-}
-
-# Register to zaptel Astribank spans that were not autoomatically registered
-# (useful when you have more than one Astribank)
-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 2>/dev/null` || true
-	for file in $xpds_to_register; do
-		echo 1 >$file
-	done
-}
-
-# If the system has an Astribank, select the right one as the sync source.
-# TODO: replace the sryptic awk code with 'xpp_sync auto' once it is in.
-fix_asterisbank_sync() {
-	# do nothing if module not present
-	if [ ! -d /proc/xpp ]; then return; fi
-	
-	#if ! grep -q '^HOST' /proc/xpp/sync 2>/dev/null; then return; fi
-
-	case "$XPP_SYNC" in
-	n*|N*) return;;
-	host|HOST) sync_value="HOST";;
-	[0-9]*)sync_value="$XPP_SYNC";;
-	*) 
-		# find the number of the first bus, and sync from it:
-		fxo_pat=`awk -F: '/STATUS=connected/{print $1}' /proc/xpp/xbuses | sed -e 's|.*|/proc/xpp/&/*/fxo_info|'`
-		# find the first FXO unit, and set it as the sync master
-		bus=`ls -1 $fxo_pat 2> /dev/null | head -n1 | cut -d- -f2 | cut -d/ -f1` 
-		
-		if [ "$bus" = '' ]; then
-			# no device with FXO found. Just get the first one
-			bus=`awk -F: '/STATUS=connected/{print $1}' /proc/xpp/xbuses | head -n 1 | cut -d- -f2`
-		fi
-
-		# do nothing if there is no bus:
-		case "$bus" in [0-9]*):;; *) return;; esac
-		sync_value="SYNC=$bus"
-		;;
-	esac
-	# the built-in echo of bash fails to print a proper error on failure
-	if ! /bin/echo "$sync_value" >/proc/xpp/sync
-	then 
-		echo >&2 "Updating XPP sync source failed (tried \"$sync_value\", XPP_SYNC='$XPP_SYNC')"
-	fi
-}
-
 hpec_start() {
 	# check for HPEC licenses
 	for f in /var/lib/digium/licenses/HPEC*.lic; do
@@ -249,10 +184,7 @@
 	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
+	xpp_startup
 	
 	if [ ! -e /proc/zaptel/1 ]; then
 		echo "No functioning zap hardware found in /proc/zaptel, loading ztdummy"




More information about the zaptel-commits mailing list