bkruse: branch 1.4 r1637 - in /branches/1.4: config/ scripts/

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Fri Oct 5 12:35:14 CDT 2007


Author: bkruse
Date: Fri Oct  5 12:35:13 2007
New Revision: 1637

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=1637
Log:
Pari is rewriting the digital page, so I figured i would give him what I have so far...

Added:
    branches/1.4/scripts/editzap.sh
Modified:
    branches/1.4/config/digital.html

Modified: branches/1.4/config/digital.html
URL: http://svn.digium.com/view/asterisk-gui/branches/1.4/config/digital.html?view=diff&rev=1637&r1=1636&r2=1637
==============================================================================
--- branches/1.4/config/digital.html (original)
+++ branches/1.4/config/digital.html Fri Oct  5 12:35:13 2007
@@ -135,6 +135,7 @@
 var widgets = {};
 var zap_settings = [ 'switchtype', 'signalling', 'echocancel', 'echocancelwhenbridged', 'rxgain', 'txgain', 'group' ]; 
 var fieldnames_clickable = [ 'fac', 'lbo', 'syncsrc', 'totchans' ]; 
+var fieldnames_clickable_zap = [ 'fac', 'syncsrc', 'totchans' ]; 
 var fieldnames = [ 'alarms', 'syncsrc', 'description', 'totchans', 'fac', 'lbo' ]; 
 var fieldnames_proper = [ 'Alarms:', 'Sync Source:', 'Card Description:', 'Total Channels:', 'Framing/Coding:', 'Options:' ]; 
 var fieldnames_zap_opts = [ 'loadzone', 'defaultzone'];
@@ -409,10 +410,10 @@
 	for(var i=1; i <= total_spans; i++ ){
 		ZAPTEL[i] = new Object;
 		ZAPTEL[i].en = new Array;
-		for(var x=0; x < fieldnames_clickable.length; x++) {
-			var tmp_id = i+'-'+fieldnames_clickable[x]+'-sel';
+		for(var x=0; x < fieldnames_clickable_zap.length; x++) {
+			var tmp_id = i+'-'+fieldnames_clickable_zap[x]+'-sel';
 			var tmp_b = _$(tmp_id);
-			ZAPTEL[i].en[fieldnames_clickable[x]] = tmp_b.options[tmp_b.selectedIndex].value;
+			ZAPTEL[i].en[fieldnames_clickable_zap[x]] = tmp_b.options[tmp_b.selectedIndex].value;
 		//	alert("showing val for span " + i + " for val: " + fieldnames_clickable[x] + " is : " + ZAPTEL[i].en[fieldnames_clickable[x]]);
 		}
 		ZAPTEL[i].en['config'] = "span="+i+","+ZAPTEL[i].en['syncsrc']+","+ZAPTEL[i].en['lbo']+","+ZAPTEL[i].en['fac'];

Added: branches/1.4/scripts/editzap.sh
URL: http://svn.digium.com/view/asterisk-gui/branches/1.4/scripts/editzap.sh?view=auto&rev=1637
==============================================================================
--- branches/1.4/scripts/editzap.sh (added)
+++ branches/1.4/scripts/editzap.sh Fri Oct  5 12:35:13 2007
@@ -1,0 +1,47 @@
+#!/bin/bash
+
+####################################################################
+####	Copyright Brandon Kruse <bkruse at digium.com> && Digium	####
+####################################################################
+
+# Quick script for applying zaptel settings from the GUI.
+
+ZAPCONF="/etc/zaptel.conf"
+ZTCFG_OUTPUT="/var/lib/asterisk/static-http/config/ztcfg_output.html"
+
+# Note: Changing modules requires sed
+if [ $(which sed) == "" ] ; then
+	error_out("Sed not installed, needed to reload modules, you can do it manually by forcing the modules in via t1e1override")
+fi
+
+case ${1} in
+	changemodes)
+		type=${2}
+		$(for i in `lsmod | grep zap| sed 's/,/ /g'`; do rmmod $i >> /dev/null; done; rmmod zaptel) 
+		case ${type} in
+			e1)
+				t1e1override=0
+				$(modprobe zaptel; modprobe zttranscode; modprobe wct4xxp t1e1override=0; modprobe wcte11xp t1e1override=0; modprobe wct1xxp t1e1override=0; ztcfg)
+			;;
+			t1)
+				t1e1override=1		
+				$(modprobe zaptel; modprobe zttranscode; modprobe wct4xxp t1e1override=1; modprobe wcte11xp t1e1override=1; modprobe wct1xxp t1e1override=1; ztcfg)
+			;;
+			*)
+				error_out("No mode to change specified!")
+			;;
+		esac	
+		;;
+	applysettings)	
+		# Split based on ||| delimeter, and apply to zaptel.
+		blob=`echo ${2} | sed 's/|||/\n/g'`
+		mv ${ZAPCONF} ${ZAPCONF}.b4editzap
+		cmd=`zapscan`
+		echo "${blob}" >> /etc/zaptel.conf
+		ztcfg -vv 2> $ZTCFG_OUTPUT
+		;;
+esac
+
+function error_out() {
+	echo "${1}" > ${ZTCFG_OUTPUT}
+}




More information about the asterisk-gui-commits mailing list