[zaptel-commits] tzafrir: trunk r2069 - in /trunk/xpp: ./
utils/genzaptelconf
zaptel-commits at lists.digium.com
zaptel-commits at lists.digium.com
Wed Jan 31 13:39:38 MST 2007
Author: tzafrir
Date: Wed Jan 31 14:39:37 2007
New Revision: 2069
URL: http://svn.digium.com/view/zaptel?view=rev&rev=2069
Log:
r2065 at boomtime: tzafrir | 2007-01-31 22:07:23 +0200
Merging 1.2 changes of genzaptelconf:
* -l (list) now works reliebly.
* Cleared some leftover writes to standard output.
* Fixed xpp spans sort order.
Modified:
trunk/xpp/ (props changed)
trunk/xpp/utils/genzaptelconf
Propchange: trunk/xpp/
------------------------------------------------------------------------------
--- svk:merge (original)
+++ svk:merge Wed Jan 31 14:39:37 2007
@@ -1,5 +1,5 @@
283159da-0705-0410-b60c-f2062b4bb6ad:/components/xpp-zaptel/branches/RELEASE-1.2.0/xpp:2933
283159da-0705-0410-b60c-f2062b4bb6ad:/components/xpp-zaptel/trunk/xpp:2830
f558416c-6c06-0410-9f27-dde2687782d0:/branches/1.2/xpp:1724
-f558416c-6c06-0410-9f27-dde2687782d0:/branches/1.4/xpp:1921
+f558416c-6c06-0410-9f27-dde2687782d0:/branches/1.4/xpp:2065
f558416c-6c06-0410-9f27-dde2687782d0:/team/tzafrir/xpp_1.2/xpp:1554
Modified: trunk/xpp/utils/genzaptelconf
URL: http://svn.digium.com/view/zaptel/trunk/xpp/utils/genzaptelconf?view=diff&rev=2069&r1=2068&r2=2069
==============================================================================
--- trunk/xpp/utils/genzaptelconf (original)
+++ trunk/xpp/utils/genzaptelconf Wed Jan 31 14:39:37 2007
@@ -215,7 +215,9 @@
# 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}'`
+ xbusses=`sed -e '/STATUS=connected/!d' -e 's/ *STATUS=.*//' -e 's/ *CONNECTOR=//' /proc/xpp/xbuses | sort -t: -k 2 | cut -d: -f1`
+ say "Zaptel registration order:"
+ say "$xbusses"
# 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
@@ -290,7 +292,12 @@
;;
esac
case "$mode" in
- list) echo $chan $sig $astbanktype;;
+ list)
+ case "$sig" in
+ fxs) sig_name=FXO;;
+ fxo) sig_name=FXS;;
+ esac
+ echo $chan $sig_name $astbank_type;;
files)
# sadly, both input ports and output ports go into the same span as
# the FXS ports. Thus we need to separate between them. See also
@@ -670,10 +677,15 @@
# the second line is empty
title=`head -n 1 $procfile`
# stuff that needs to be remembered accross lines (for PRI/BRI support)
- echo "" >>$zaptel_file
- echo "# $title" >>$zaptel_file
- echo "" >>$zapata_file
- echo "; $title" >>$zapata_file
+ case "$mode" in
+ list) echo "### $title";;
+ files)
+ echo "" >>$zaptel_file
+ echo "# $title" >>$zaptel_file
+ echo "" >>$zapata_file
+ echo "; $title" >>$zapata_file
+ ;;
+ esac
echo '-1' >$tmp_dir/span_begin
echo '-1' >$tmp_dir/span_end
echo '0' >$tmp_dir/span_timing
@@ -890,7 +902,7 @@
echo "context=$context_phones" >> $zapata_file
fi
else # we have may have set it. So reset it:
- echo "callerid=asreceived"
+ echo "callerid=asreceived" >> $zapata_file
reset_values="$reset_values callerid"
#echo "mailbox="
if [ "$group_manual" != "yes" ]
@@ -911,7 +923,10 @@
reset_zapata_entry $zapata_file $reset_values
;;
list)
- echo BRI/PRI: chans: $bchans, control: $dchan
+ echo "### BRI/PRI: $span_termtype"
+ echo "$bchans Data"
+ echo "$dchan Control"
+ #echo BRI/PRI: chans: $bchans, control: $dchan
;;
esac
fi
@@ -928,12 +943,12 @@
EOF
fi
- mv ${ZAPCONF_FILE} ${ZAPCONF_FILE}.bak
- mv $zaptel_file ${ZAPCONF_FILE}
- mv ${ZAPATA_FILE} ${ZAPATA_FILE}.bak
- mv $zapata_file ${ZAPATA_FILE}
- # cleaning up the temp dir
- if [ -d "$tmp_dir" ]; then rm -rf "$tmp_dir"; fi
+ if [ "$mode" = 'files' ]; then
+ mv ${ZAPCONF_FILE} ${ZAPCONF_FILE}.bak
+ mv $zaptel_file ${ZAPCONF_FILE}
+ mv ${ZAPATA_FILE} ${ZAPATA_FILE}.bak
+ mv $zapata_file ${ZAPATA_FILE}
+ fi
}
while getopts 'c:de:Fhlm:MRsuv' arg
More information about the zaptel-commits
mailing list