bkruse: branch asterisknow r1737 - /branches/asterisknow/config/misdn.html

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Thu Oct 25 13:24:08 CDT 2007


Author: bkruse
Date: Thu Oct 25 13:24:07 2007
New Revision: 1737

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=1737
Log:
some more owning of b410p

Modified:
    branches/asterisknow/config/misdn.html

Modified: branches/asterisknow/config/misdn.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/misdn.html?view=diff&rev=1737&r1=1736&r2=1737
==============================================================================
--- branches/asterisknow/config/misdn.html (original)
+++ branches/asterisknow/config/misdn.html Thu Oct 25 13:24:07 2007
@@ -71,6 +71,7 @@
 var oldLoadZone;
 var menu ; // document.getElementById('mymenu');
 var tot_spans = 0;
+var CARDS = 0;
 
 function hide_mymenu(){ menu.style.display="none"; }
 
@@ -251,7 +252,6 @@
 		}
 		//	loadConfigFile.loadMisdnConf();
 			/* We are setting up mISDN for the first time. */
-			var CARDS = 0;
 			new Ajax.Request("/asterisk/static/scan.html", {
 				method : "get",
 				asynchronous : true,
@@ -262,7 +262,7 @@
 						if(records[mn].beginsWith('card=')) { 
 							/* We found a 4 port mISDN card */
 							CARDS++;
-							var ns = (span + 4);
+							var ns = (span + 3);
 							while(span <= ns) {
 								SPANS[span] = {};
 								SPANS[span]['card'] = records[mn];
@@ -279,13 +279,13 @@
 					}
 					_$('b410p_cards').innerHTML = "You Have <i>"+CARDS+"x</i> B410p Card(s)";
 					/* Here we would call something to setup a table for basic cards... (4 port BRI)*/
+					return true;
 				},
 				onFailure : function() {
 					gui_alert("For some reason, I could not grab scan.html, is the misdn-init tool installed?");
 					return false;
 				}
 			});
-		//}
 			for( var l in n ){ if(n.hasOwnProperty(l)){
 				if( l =='general') { 
 					if(!n[l]['card']) {
@@ -295,17 +295,15 @@
 						gui_feedback("No Cards/Spans found !!");
 						return false;
 					}
-					for(var z = 1; z <= CARDS; z++) {
-						SPANS[z] = {};
-						/* set spans from read files here. */
-					}
 					var parse_fields = ['te_ptp', 'te_ptmp', 'te_capi_ptp', 'te_capi_ptmp', 'nt_ptp', 'nt_ptmp']; 
 					for(var x=0; x < parse_fields.length; x++) {
 						if(n[l][parse_fields[x]]) {
 							var k = n[l][parse_fields[x]].split(",")
-							for(var i in k) {
-								SPANS[i]['portset'] = parse_fields[x];
-							}
+							for(var i in k){ if(k.hasOwnProperty(i)){
+								if(!SPANS[k[i]]) { SPANS[k[i]] = {} }
+								alert("setting span"+k[i]+" to "+parse_fields[x]);
+								SPANS[k[i]]['portset'] = parse_fields[x];
+							}}
 						}
 					}
 					continue;




More information about the asterisk-gui-commits mailing list