summaryrefslogtreecommitdiff
path: root/xpp
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-01-31 20:39:37 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-01-31 20:39:37 +0000
commit0cb7a2afbb25db218d2f17035b5a7a4dc2ba2fdd (patch)
treebdde968b6da9b7debc539a721163e4b3567c6971 /xpp
parentab4e86a83136c458d388dd409cc89e72bd5a33cf (diff)
r2065@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. git-svn-id: http://svn.digium.com/svn/zaptel/trunk@2069 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'xpp')
-rwxr-xr-xxpp/utils/genzaptelconf43
1 files changed, 29 insertions, 14 deletions
diff --git a/xpp/utils/genzaptelconf b/xpp/utils/genzaptelconf
index 3e89915..03c28be 100755
--- a/xpp/utils/genzaptelconf
+++ b/xpp/utils/genzaptelconf
@@ -215,7 +215,9 @@ zap_reg_xpp() {
# 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 @@ print_pattern() {
;;
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 @@ EOF
# 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 @@ EOF
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 @@ EOF
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 @@ defaultzone = $defaultzone
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