[zaptel-commits] tzafrir: trunk r1386 - /trunk/xpp/utils/genzaptelconf

zaptel-commits at lists.digium.com zaptel-commits at lists.digium.com
Mon Sep 4 15:32:03 MST 2006


Author: tzafrir
Date: Mon Sep  4 17:32:02 2006
New Revision: 1386

URL: http://svn.digium.com/view/zaptel?rev=1386&view=rev
Log:
Remove obsolete rapid configuration code.

Modified:
    trunk/xpp/utils/genzaptelconf

Modified: trunk/xpp/utils/genzaptelconf
URL: http://svn.digium.com/view/zaptel/trunk/xpp/utils/genzaptelconf?rev=1386&r1=1385&r2=1386&view=diff
==============================================================================
--- trunk/xpp/utils/genzaptelconf (original)
+++ trunk/xpp/utils/genzaptelconf Mon Sep  4 17:32:02 2006
@@ -115,11 +115,6 @@
 do_module_list=no
 verbose=no
 fxsdisable=no
-rapid_extens=''
-# global: current extension number in extensions list. Should only be 
-# changed in print_pattern:
-rapid_cur_exten=1 
-# set the TRUNK in extensidialplan dialplan defs file  rapid_conf_mode=no
 
 die() {
 	echo "$@" >&2
@@ -200,51 +195,7 @@
 }
 
 update_extensions_defs() {
-	if [ "$rapid_conf_mode" = 'yes' ]
-	then
-		say "DEBUG: Updating dialplan defs file $exten_defs_file"
-		if [ "`echo $tmp_dir/fxo_* | grep -v '*'`" != '' ]
-		then
-			trunk_nums=`cat $tmp_dir/fxo_* | sort -n | xargs`
-			say "Configuring TRUNK to be [first of] zaptel channels: $trunk_nums"
-			trunk_dev=`echo $trunk_nums| sed -e 's/ /\\\\\\&/g' -e 's/[0-9a-zA-Z]\+/Zap\\\\\\/&/g'`
-			echo >&2 sed -i "s/^TRUNK.*=>.*/TRUNK => $trunk_dev/" $exten_defs_file
-			sed -i "s/^TRUNK.*=>.*/TRUNK => $trunk_dev/" $exten_defs_file
-			if ! grep -q "^TRUNK =>" $exten_defs_file; then
-				trunk_dev=`echo $trunk_nums| sed -e 's/ /&/g' -e 's/[0-9a-zA-Z]*/Zap\\/&/g'`
-				echo "TRUNK => $trunk_dev" >> $exten_defs_file
-			fi
-		else
-			say "Warning: No FXO channel for trunk. Moving on."
-		fi
-		if [ "`echo $tmp_dir/fxs_* | grep -v '*'`" != '' ]
-		then
-			fxs_nums=`cat $tmp_dir/fxs_* | sort -n | xargs`
-			zap_nums=`grep '^[^;].*Zap/\${CHAN_ZAP_' $exten_base_dir/*.conf | \
-				sed -e 's/.*Zap\/\${CHAN_ZAP_\([0-9]*\)}.*/\1/' | sort -u | xargs`
-			say "Configuring channels: $fxs_nums as channel placeholders: $zap_nums"
-			j=1
-			for i in $zap_nums
-			do
-				chan=`echo $fxs_nums | awk "{print \\$$i}"`
-				if [ "$chan" = '' ]
-				then
-					# if the result is empty, we probably got past the last one.
-					# bail out.
-					say "Warning: No FXS channel for CHAN_ZAP_$i. Moving on"
-					break
-				fi
-				say "DEBUG: setting channel $chan to placeholder $i"
-				if grep -q "^CHAN_ZAP_$i " $exten_defs_file
-				then
-					sed -i -e "s/^CHAN_ZAP_$i .*/CHAN_ZAP_$i => Zap\/$chan/" $exten_defs_file
-				else
-					echo "CHAN_ZAP_$i => Zap/$chan" >> $exten_defs_file
-				fi
-			done
-		fi	
-		# cleaning up the temp dir
-	fi
+	# cleaning up the temp dir
 	if [ -d "$tmp_dir" ]; then rm -rf "$tmp_dir"; fi
 }
 
@@ -348,25 +299,6 @@
 			cfg_vmbox=`echo ${!var_name} | tr -d -c 0-9`
 		  var_name=`echo chan_${chan}_cntxt`
 			cfg_cntxt=`echo ${!var_name} | tr -d -c 0-9`
-			
-			# if option -E was given, get configuration from current extension
-			if [ "$rapid_conf_mode" = 'yes' ]
-			then
-				rap_exten=`echo $rapid_extens |awk "{print \\$$rapid_cur_exten}"`
-				if [ "$rap_exten" != '' ]
-				then
-					rap_cfgfile="$exten_base_dir/$rap_exten.conf"
-					if [ -r "$rap_exten" ]
-					then
-						cfg_exten=$rap_exten
-						# the vmbox is the third parameter to stdexten
-						rap_vmbox=`grep '^[^;].*Macro(stdexten' $rap_exten | cut -d, -f3 \
-							| cut -d')' -f1 | tr -d -c '0-9 at a-zA-Z'`
-						if [ "$rap_vmbox" ]!= '' ; then cfg_vmbox=$rap_vmbox; fi
-					fi
-				fi
-				rapid_cur_exten=$(($rapid_cur_exten + 1))
-			fi
 			
 			if [ "$cfg_exten" = '' ]
 			then # No extension number set for this channel
@@ -614,16 +546,6 @@
 	fi	
 }
 
-# output a list of extensions that need a channel
-get_rapid_extens() {
-	if [ "$rapid_conf_mode" = 'yes' ]
-	then
-		rapid_extens=`grep -l '^[^;].*Zap/\${CHAN_ZAP_' $exten_base_dir/*.conf 2>/dev/null | \
-			rev | cut -d/ -f1 | cut -d. -f2- | rev | xargs`
-		say "Need to configure extensions: $rapid_extens"
-	fi
-}
-
 genconf() {
 	local mode=$1
 	# reset FXO list (global)
@@ -979,7 +901,6 @@
 else
 	zap_reg_xpp
 	check_for_astribank
-	get_rapid_extens
 	say "Generating '${ZAPCONF_FILE}'"
 	mv "${ZAPCONF_FILE}" "${ZAPCONF_FILE}.bak"
 	wait_for_zapctl



More information about the zaptel-commits mailing list