bkruse: branch bkruse/dahdi_integration r4115 - in /team/bkruse/dahdi_integra...

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Fri Nov 14 18:00:06 CST 2008


Author: bkruse
Date: Fri Nov 14 18:00:05 2008
New Revision: 4115

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=4115
Log:
First phase of the dahdi conversion. Be able to detect what we are using, dahdi or zaptel.
Change the filename in the PARENT GLOBALS instead of locally in the scripts.

Modified:
    team/bkruse/dahdi_integration/config/hardware.html
    team/bkruse/dahdi_integration/config/index.html
    team/bkruse/dahdi_integration/config/js/astman.js
    team/bkruse/dahdi_integration/config/js/index.js

Modified: team/bkruse/dahdi_integration/config/hardware.html
URL: http://svn.digium.com/view/asterisk-gui/team/bkruse/dahdi_integration/config/hardware.html?view=diff&rev=4115&r1=4114&r2=4115
==============================================================================
--- team/bkruse/dahdi_integration/config/hardware.html (original)
+++ team/bkruse/dahdi_integration/config/hardware.html Fri Nov 14 18:00:05 2008
@@ -424,7 +424,7 @@
 		var n = config2json({filename:hwcfgfile, usf:1});
 		if( n.getOwnProperties().length == 0 ){ // if file not found or no previous hardware detected
 				hwchanged = -1;
-				loadConfigFiles.runZtscan();
+				loadConfigFiles.runscan();
 				return;
 		}else{
 			CONFIGUREDHARDWARE = {};
@@ -434,24 +434,24 @@
 				CONFIGUREDHARDWARE[l]['basechan'] = n[l]['basechan'];
 				CONFIGUREDHARDWARE[l]['type'] = n[l]['type'];
 			}}
-			loadConfigFiles.runZtscan();
+			loadConfigFiles.runscan();
 		}
 		ASTGUI.Log.Debug("end of function: loadConfigFiles.load_hwcfgfile()");
 	},
 
-	runZtscan: function(){
-		ASTGUI.Log.Debug("start function: loadConfigFiles.runZtscan()");
+	runscan: function(){
+		ASTGUI.Log.Debug("start function: loadConfigFiles.runscan()");
 
 		ASTGUI.miscFunctions.createConfig( 'applyzap.conf', function(){
-			parent.ASTGUI.systemCmd( ASTGUI.apps.Ztscan , function(){ // run ztscan and then try loading ztscan.conf
-				window.setTimeout( loadConfigFiles.readZtscanConf , 700 ); // leave some time for ztscan to generate ztscan.conf
+			parent.ASTGUI.systemCmd( ASTGUI.apps.scan , function(){ // run ztscan and then try loading ztscan.conf
+				window.setTimeout( loadConfigFiles.readscanConf , 700 ); // leave some time for ztscan to generate ztscan.conf
 			});
-			ASTGUI.Log.Debug("end of function: loadConfigFiles.runZtscan()");
+			ASTGUI.Log.Debug("end of function: loadConfigFiles.runscan()");
 		});
 	},
 
-	readZtscanConf: function(){
-		ASTGUI.Log.Debug("start function: loadConfigFiles.readZtscanConf()");
+	readscanConf: function(){
+		ASTGUI.Log.Debug("start function: loadConfigFiles.readscanConf()");
 		var ztsc = $.ajax({ url: ASTGUI.paths.rawman+'?action=getconfig&filename=ztscan.conf', async: false }).responseText;
 		var ztsc_Lower = ztsc.toLowerCase();
 		if( ztsc_Lower.contains('response: error') && ztsc_Lower.contains('message: config file not found') ){
@@ -516,7 +516,7 @@
 			}}
 		}}
 		if(hwchanged != -1){ hwchanged = detectHwChanges(); }
-		ASTGUI.Log.Debug("end of function: loadConfigFiles.readZtscanConf()");
+		ASTGUI.Log.Debug("end of function: loadConfigFiles.readscanConf()");
 		loadConfigFiles.readUsersConf(); // read span_x (where T1/E1 trunks are defined)
 	},
 

Modified: team/bkruse/dahdi_integration/config/index.html
URL: http://svn.digium.com/view/asterisk-gui/team/bkruse/dahdi_integration/config/index.html?view=diff&rev=4115&r1=4114&r2=4115
==============================================================================
--- team/bkruse/dahdi_integration/config/index.html (original)
+++ team/bkruse/dahdi_integration/config/index.html Fri Nov 14 18:00:05 2008
@@ -35,7 +35,9 @@
 		AA50_SKU : '', // sessionData.PLATFORM.AA50_SKU
 		isANOW : false, // Asterisk Now
 		isAST_1_4 : true, // we assume is Asterisk 1.4 by default, sessionData.PLATFORM.isAST_1_4
-		isAST_1_6 : false
+		isAST_1_6 : false,
+		isDahdi: false, // Both Dahdi and Zaptel are disabled, and will be enabled if the module is found.
+		isZaptel: false
 	},
 
 	AsteriskVersionString : '',

Modified: team/bkruse/dahdi_integration/config/js/astman.js
URL: http://svn.digium.com/view/asterisk-gui/team/bkruse/dahdi_integration/config/js/astman.js?view=diff&rev=4115&r1=4114&r2=4115
==============================================================================
--- team/bkruse/dahdi_integration/config/js/astman.js (original)
+++ team/bkruse/dahdi_integration/config/js/astman.js Fri Nov 14 18:00:05 2008
@@ -2615,7 +2615,12 @@
 ASTGUI.scripts['Registerg729'] = 'sh ' + ASTGUI.paths['scripts'] + 'registerg729.sh';
 
 ASTGUI.apps = {};
-ASTGUI.apps['Ztscan'] = 'ztscan > ' + ASTGUI.paths['asteriskConfig'] +'ztscan.conf' ;
+/* If we have dahdi, use dahdi scan. We can still use ztscan.conf, since it will hold the same kind of values, doesn't matter. */
+if (top.sessionData.PLATFORM.isDahdi) {
+	ASTGUI.apps['scan'] = 'dahdi_scan > ' + ASTGUI.paths['asteriskConfig'] +'ztscan.conf' ;
+}
+	ASTGUI.apps['scan'] = 'ztscan > ' + ASTGUI.paths['asteriskConfig'] +'ztscan.conf' ;
+}
 ASTGUI.apps['mISDNscan'] = 'misdn-init scan' ;
 ASTGUI.apps['flashupdate'] = 'flashupdate' ;
 

Modified: team/bkruse/dahdi_integration/config/js/index.js
URL: http://svn.digium.com/view/asterisk-gui/team/bkruse/dahdi_integration/config/js/index.js?view=diff&rev=4115&r1=4114&r2=4115
==============================================================================
--- team/bkruse/dahdi_integration/config/js/index.js (original)
+++ team/bkruse/dahdi_integration/config/js/index.js Fri Nov 14 18:00:05 2008
@@ -121,6 +121,25 @@
 				sessionData.PLATFORM.isAST_1_6 = false ;
 			}
 		}
+		/* Determine zaptel or dahdi. If it is 1.6, and we know it, don't bother we trying to detect it. It has to be dahdi */
+		if (sessionData.PLATFORM.isAST_1_6 == true && sessionData.PLATFORM.isAST_1_4 == true) { 
+			sessionData.PLATFORM.isDahdi = true;
+			return;
+		}
+		var mods = ASTGUI.cliCommand('module show');
+		if (mods.length > 1) {
+			mods = mods.split('\n');
+			mods.forEach(function(mod) {
+				if(mod.substr(0,8) == "chan_zap") {
+					sessionData.PLATFORM.isZaptel = true;
+					return;
+				}
+				if(mod.substr(0,10) == "chan_dahdi") {
+					sessionData.PLATFORM.isDahdi = true;
+				}
+			});	
+		}
+
 	},
 
 	check_ReadWritePermissions : function(){
@@ -225,7 +244,7 @@
 			}
 
 			ASTGUI.dialog.waitWhile('detecting Hardware ..');
-			onLogInFunctions.runZtscan();
+			onLogInFunctions.runscan();
 		});
 	},
 
@@ -366,18 +385,18 @@
 				miscFunctions.hide_panel('digital.html');
 				onLogInFunctions.updatePanels4Platform();
 			}else{
-				onLogInFunctions.runZtscan();
+				onLogInFunctions.runscan();
 			}
 		};
 		ASTGUI.systemCmdWithOutput( 's800iconfig' , after);
 	},
 
-	runZtscan : function(){ // onLogInFunctions.runZtscan()
+	runscan : function(){ // onLogInFunctions.runscan()
 		ASTGUI.dialog.waitWhile('detecting Hardware ..');
 		var cb = function(){
 			onLogInFunctions.updatePanels4Platform();
 		};
-		ASTGUI.systemCmd(ASTGUI.apps.Ztscan, cb);
+		ASTGUI.systemCmd(ASTGUI.apps.scan, cb);
 	},
 
 




More information about the asterisk-gui-commits mailing list