bkruse: branch asterisknow r1699 - in /branches/asterisknow: config/ scripts/

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Wed Oct 17 14:44:44 CDT 2007


Author: bkruse
Date: Wed Oct 17 14:44:44 2007
New Revision: 1699

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=1699
Log:
Committing what I have so far. 
Updates:
It now reads /etc/misdn-init.conf to find the
number of ports and cards.
We will not need to try to get old options from
applymisdn.conf (just like applyzap.conf in digital)

Modified:
    branches/asterisknow/config/misdn.html
    branches/asterisknow/scripts/editzap.sh

Modified: branches/asterisknow/config/misdn.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/misdn.html?view=diff&rev=1699&r1=1698&r2=1699
==============================================================================
--- branches/asterisknow/config/misdn.html (original)
+++ branches/asterisknow/config/misdn.html Wed Oct 17 14:44:44 2007
@@ -70,6 +70,7 @@
 var oldSpanCount = 0; // we get this from previuos applyzap.conf
 var oldLoadZone;
 var menu ; // document.getElementById('mymenu');
+var tot_spans = 0;
 
 function hide_mymenu(){ menu.style.display="none"; }
 
@@ -284,30 +285,26 @@
 		}
 			for( var l in n ){ if(n.hasOwnProperty(l)){
 				if( l =='general') { 
-					if(n[l]['continue'] && n[l]['continue'] == "no") {
-						_$('errmsg').innerHTML = "No digital Cards detected (found 0 spans)! <BR> Error: " + n[l]['error'];
+					if(!n[l]['card']) {
+						_$('errmsg').innerHTML = "No mISDN Cards detected (found 0 spans)!";
 						_$('errmsg').style.display = '';
 						_$('div_digitalcardstable').style.display = 'none';
 						gui_feedback("No Cards/Spans found !!");
-						//_$('tablecontainer').style.display="none";
 						return false;
 					}
-					if(n[l]['continue'] && n[l]['continue'] == "yes") {
-						//var t = (n[l]['totalspans']) ? n[l]['totalspans'] : 'Unknown';
-						if(n[l]['isnew'] && n[l]['isnew'] == "yes") {
-							var uri = build_action('update', 0, 'general', 'isnew', 'no', '');
-							makerequest('u','ztscan.conf', uri, function(t){ return true;} );
-						}
+					if(n[l]['te_ptmp'] && n[l]['te_ptmp'] != "") {
+						var spans = n[l]['te_ptmp'].split(",")
+						tot_spans = spans.length
+						;
+					}
+					for(var z = 1; z <= spans.length; z++) {
+						SPANS[z] = {};
+						SPANS[z]['alarms'] = "Read from";
+						SPANS[z]['fac'] = "applymisdn.conf, or";
+						SPANS[z]['totchans'] = "set to nothing";
 					}
 					continue;
 				}
-				SPANS[l] = {};
-				for( var k in n[l] ){ if(n[l].hasOwnProperty(k)){ 
-					SPANS[l][k] = n[l][k];
-					if( k == 'totchans' ){
-						SPANS[l]['spantype'] = ( Number(n[l][k]) <= 24) ? "T1" : "E1";
-					}
-				}}
 			}}
 			loadConfigFiles.checkHardwareChanges();
 		};
@@ -321,14 +318,13 @@
 				_$('errmsg').style.display = '';
 				_$('div_digitalcardstable').style.display = 'none';
 				gui_feedback("No Users File found !!");
-				//_$('tablecontainer').style.display="none";
 				return false;
 			}
 			var abcd = function(){
 				var tmp;
 				for( var l in n ){ if(n.hasOwnProperty(l)){
-					if( l.beginsWith('span_')) {
-						tmp = l.split('span_')[1];
+					if( l.beginsWith('bri_')) {
+						tmp = l.split('bri_')[1];
 						if (!SPANS[tmp]){SPANS[tmp] = {};}
 						for( var k in n[l] ){ if(n[l].hasOwnProperty(k)){ SPANS[tmp][k] = n[l][k]; }}
 					}
@@ -370,7 +366,7 @@
 
 var applySettings = {
 	generate_zaptel: function(){
-		parent.astmanEngine.run_tool(asterisk_guiEditZap + " applysettings", function(t) {
+		parent.astmanEngine.run_tool(asterisk_guiEditZap + " applysettings misdn", function(t) {
 			/* anything we need to do here? */
 			// inform the user to restart
 			alert("You need to restart your machine for these settings to take effect");
@@ -473,7 +469,7 @@
 			uri += build_action('append', c, gen, 'echotraining', _$('echotraining').value); c++;
 			//uri += build_action('append', c, context, 'defaultzone', 'us'); c++;
 		}();
-		makerequest('u', "applyzap.conf", uri , function(t) { applySettings.updateUsersConf(); });
+		makerequest('u', "applymisdn.conf", uri , function(t) { applySettings.updateUsersConf(); });
 	}
 };
 
@@ -494,13 +490,13 @@
 	<span style="cursor: pointer; cursor: hand;" onclick="window.location.href=window.location.href;" >&nbsp;<img src="images/refresh.png" title=" Refresh " border=0 >&nbsp;</span>
 </div>
 
-<div class="pageheading">Digital Card Setup</div>
+<div class="pageheading">mISDN (b410p) Card Setup</div>
 
 <div style="overflow:auto;left:40" id="div_digitalcardstable">
 	<table class="taglist" id="digitalcardstable" cellpadding=5 cellspacing=1 border=0 align=center></table>
 	<table  cellpadding=5 cellspacing=1 align=center border=0>
-		<h2>General mISDN Settings</h2>
-		<tr>	<td align="right">Bridging :
+		<h2 align="center">General mISDN Settings</h2>
+		<tr align="center">	<td align="right">Bridging :
 				<select id="bridging">
 					<option value="yes">Yes</option>
 					<option value="no">No</option>
@@ -524,8 +520,8 @@
 		</tr>
 		<tr>
 			<td>
-				<input type="button" id="save_b" value="Apply Changes" onclick="applyDigitalSettings()"> &nbsp;&nbsp;
-				<input type="button" id="cancel_b" value="Cancel Changes" onclick="reloadpage()">
+				<input align="center" type="button" id="save_b" value="Apply Changes" onclick="applyDigitalSettings()"> &nbsp;&nbsp;
+				<input align="center" type="button" id="cancel_b" value="Cancel Changes" onclick="reloadpage()">
 			</td>
 		</tr>
 	</table>

Modified: branches/asterisknow/scripts/editzap.sh
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/scripts/editzap.sh?view=diff&rev=1699&r1=1698&r2=1699
==============================================================================
--- branches/asterisknow/scripts/editzap.sh (original)
+++ branches/asterisknow/scripts/editzap.sh Wed Oct 17 14:44:44 2007
@@ -9,6 +9,8 @@
 ZAPCONF="/etc/zaptel.conf"
 ZTCFG_OUTPUT="/var/lib/asterisk/static-http/config/ztcfg_output.html"
 FILENAME="/etc/asterisk/applyzap.conf"
+MISDNCONF="/etc/misdn-init.conf"
+MISDNFILE="/etc/asterisk/applymisdn.conf"
 
 case ${1} in
 	changemodes)
@@ -30,7 +32,12 @@
 		;;
 	applysettings)	
 		# Split based on ||| delimeter, and apply to zaptel.
-		grep -v "\[general\]" ${FILENAME} | grep -v "\;" > ${ZAPCONF} 
+		if [ "${2}" == "misdn" ]
+		then
+			grep -v "\[general\]" ${MISDNFILE} | grep -v "\;" > ${MISDNCONF}
+		else
+			grep -v "\[general\]" ${FILENAME} | grep -v "\;" > ${ZAPCONF} 
+		fi
 		;;
 	ztcfg)
 		ztcfg -vv 2> $ZTCFG_OUTPUT




More information about the asterisk-gui-commits mailing list