pari: branch pari/dahdi_support r4339 - /team/pari/dahdi_support/config/js/

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Wed Dec 10 17:43:58 CST 2008


Author: pari
Date: Wed Dec 10 17:43:57 2008
New Revision: 4339

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=4339
Log:

 Some more progress on DAHDI support



Modified:
    team/pari/dahdi_support/config/js/astman.js
    team/pari/dahdi_support/config/js/hardware.js
    team/pari/dahdi_support/config/js/jquery.js
    team/pari/dahdi_support/config/js/pbx.js

Modified: team/pari/dahdi_support/config/js/astman.js
URL: http://svn.digium.com/view/asterisk-gui/team/pari/dahdi_support/config/js/astman.js?view=diff&rev=4339&r1=4338&r2=4339
==============================================================================
--- team/pari/dahdi_support/config/js/astman.js (original)
+++ team/pari/dahdi_support/config/js/astman.js Wed Dec 10 17:43:57 2008
@@ -331,7 +331,7 @@
 		configfile : 'guipreferences.conf', // will be created if the file does not exist , ASTGUI.globals.configfile
 		g729RegInfo: 'g729reginfo.conf', // ASTGUI.globals.g729RegInfo, the sessionData.directories.script_Registerg729 script will read this file to generate tab delimited file
 		hwcfgFile: 'gui_confighw.conf', // file to store configured hardware information, to detect hardware changes
-		dahdiIncludeFile: 'dahdi_guiread.conf', // file that will be used to read zapte.conf, ASTGUI.globals.zaptelIncludeFile
+		dahdiIncludeFile: 'dahdi_guiread.conf', // file that will be used to read zaptel.conf or dahdi/system.conf , ASTGUI.globals.dahdiIncludeFile
 		dahdiScanOutput: 'dahdi_scan.conf', // file that will be used to read output from ztscan or dahdi_scan, ASTGUI.globals.dahdiScanOutput
 		pingInterval : 5000,
 		app_factoryReset : '/bin/reset_config', // ASTGUI.globals.app_factoryReset
@@ -2735,6 +2735,10 @@
 		return (catfound)?cat : null ;
 	};
 
+	if( params.hasOwnProperty('configFile_output') ){
+		return toJSO( params.configFile_output );
+	};
+
 	ASTGUI.Log.Ajax("AJAX Request : reading '" +  params.filename + "'");
 
 	if( top.sessionData.FileCache.hasOwnProperty(params.filename) &&  top.sessionData.FileCache[params.filename].modified == false){ // if file is in cache and is not modified since

Modified: team/pari/dahdi_support/config/js/hardware.js
URL: http://svn.digium.com/view/asterisk-gui/team/pari/dahdi_support/config/js/hardware.js?view=diff&rev=4339&r1=4338&r2=4339
==============================================================================
--- team/pari/dahdi_support/config/js/hardware.js (original)
+++ team/pari/dahdi_support/config/js/hardware.js Wed Dec 10 17:43:57 2008
@@ -525,7 +525,7 @@
 	load_zaptel_conf: function(){
 		ASTGUI.Log.Debug("start function: loadConfigFiles.load_zaptel_conf()");
 		// we parse zaptel.conf to get the loadzone and syncsrc for each span
-		var tmp_file = ASTGUI.globals.zaptelIncludeFile;
+		var tmp_file = ASTGUI.globals.dahdiIncludeFile ;
 		var parseZaptelconf = function(zp){
 			(function (){
 				var t = (zp.hasOwnProperty('general')) ? zp['general'] : [] ; // t is an array
@@ -560,16 +560,9 @@
 		};
 
 		var s = $.ajax({ url: ASTGUI.paths.rawman+'?action=getconfig&filename=' + tmp_file , async: false }).responseText;
+
 		if( s.contains('Response: Error') && s.contains('Message: Config file not found') ){
-			ASTGUI.miscFunctions.createConfig( tmp_file, function(){
-				var u = new listOfSynActions(tmp_file) ;
-				u.new_action('delcat', 'general', "", ""); 
-				u.new_action('newcat', 'general', "", ""); 
-				u.new_action('update', 'general', '#include "../zaptel.conf" ;', ' ;');
-				u.callActions();
-				var q = config2json({filename:tmp_file, usf:0});
-				parseZaptelconf(q);
-			});
+			top.window.location.reload(); // ASTGUI.globals.dahdiIncludeFile is created by onLogInFunctions.run_detectdahdi()
 			return;
 		}else{
 			var q = config2json({ configFile_output:s , usf:0 });
@@ -851,7 +844,7 @@
 			pri_trunk['group'] = NEWGROUPNUMBER ;
 
 			if( !EX_CF['globals'].hasOwnProperty(d) ){
-				y.new_action('update', 'globals', d,'Zap/g'+String(NEWGROUPNUMBER));
+				y.new_action( 'update', 'globals', d, parent.sessionData.DahdiDeviceString + '/g' + String(NEWGROUPNUMBER) );
 			}
 
 			if( !EX_CF.hasOwnProperty(e) ){

Modified: team/pari/dahdi_support/config/js/jquery.js
URL: http://svn.digium.com/view/asterisk-gui/team/pari/dahdi_support/config/js/jquery.js?view=diff&rev=4339&r1=4338&r2=4339
==============================================================================
--- team/pari/dahdi_support/config/js/jquery.js (original)
+++ team/pari/dahdi_support/config/js/jquery.js Wed Dec 10 17:43:57 2008
@@ -2697,7 +2697,7 @@
 						if( !top.sessionData.FileCache.hasOwnProperty(tmp_filename) ){ top.sessionData.FileCache[tmp_filename] = {}; }
 						top.sessionData.FileCache[tmp_filename].modified = true;
 
-					if( s.url.contains('&srcfilename=http.conf&') || s.url.contains( '&srcfilename=' + ASTGUI.globals.zaptelIncludeFile + '&') ){
+					if( s.url.contains('&srcfilename=http.conf&') ){
 
 					}else{
 						ASTGUI.cookies.setCookie( 'configFilesChanged' , 'yes' );

Modified: team/pari/dahdi_support/config/js/pbx.js
URL: http://svn.digium.com/view/asterisk-gui/team/pari/dahdi_support/config/js/pbx.js?view=diff&rev=4339&r1=4338&r2=4339
==============================================================================
--- team/pari/dahdi_support/config/js/pbx.js (original)
+++ team/pari/dahdi_support/config/js/pbx.js Wed Dec 10 17:43:57 2008
@@ -176,32 +176,42 @@
 		}
 
 		(function(){
-			var tmp_file = ASTGUI.globals.zaptelIncludeFile;
-			var s = $.ajax({ url: ASTGUI.paths.rawman+'?action=getconfig&filename=' + tmp_file , async: false }).responseText;
+			var runScript_detectdahdi = function(){
+				ASTGUI.systemCmd( sessionData.directories.script_detectdahdi , function(){
+					setTimeout( function(){
+						if( sessionData.DEBUG_MODE ){
+							alert(ASTGUI.globals.dahdiIncludeFile + 'not found, ran script ' + sessionData.directories.script_detectdahdi + ' \n Click OK to Reload');
+						}
+						window.location.reload();
+					} , 500 );
+				});
+			};
+
+			var s = $.ajax({ url: ASTGUI.paths.rawman+'?action=getconfig&filename=' + ASTGUI.globals.dahdiIncludeFile , async: false }).responseText;
 			if( s.contains('Response: Error') && s.contains('Message: Config file not found') ){
-				ASTGUI.miscFunctions.createConfig( tmp_file , function(){
-					var u = new listOfSynActions(tmp_file) ;
-					u.new_action('delcat', 'general', "", ""); 
-					u.new_action('newcat', 'general', "", ""); 
-					u.new_action('update', 'general', '#include "../zaptel.conf" ;', ' ;');
-					u.callActions();
-				});
+				sessionData.continueParsing = false ;
+				runScript_detectdahdi();
 				return;
 			}else{
-				var q = config2json({ configFile_output:s , usf:0 });
-				if( q.hasOwnProperty('general') ){
-					q.general.each(function(line){
-						if ( !line.beginsWith('fx') ){ return ;}
-						if( line.beginsWith('fxoks=') || line.beginsWith('fxsks=') ){
-							var ksports = ASTGUI.miscFunctions.chanStringToArray( line.afterChar('=') );
-							sessionData.PORTS_SIGNALLING.ks = sessionData.PORTS_SIGNALLING.ks.concat(ksports);
-						}
-						if( line.beginsWith('fxols=') || line.beginsWith('fxsls=') ){
-							var lsports = ASTGUI.miscFunctions.chanStringToArray( line.afterChar('=') );
-							sessionData.PORTS_SIGNALLING.ls = sessionData.PORTS_SIGNALLING.ls.concat(lsports);
-						}
+				var q = context2json({ configFile_output:s, context: 'general', usf:0 });
+				if( q === null ){ // if context 'general' is not found
+					ASTGUI.systemCmd( sessionData.directories.script_detectdahdi , function(){
+						sessionData.continueParsing = false ;
+						runScript_detectdahdi();
+						return;
 					});
 				}
+				q.each(function(line){
+					if ( !line.beginsWith('fx') ){ return ;}
+					if( line.beginsWith('fxoks=') || line.beginsWith('fxsks=') ){
+						var ksports = ASTGUI.miscFunctions.chanStringToArray( line.afterChar('=') );
+						sessionData.PORTS_SIGNALLING.ks = sessionData.PORTS_SIGNALLING.ks.concat(ksports);
+					}
+					if( line.beginsWith('fxols=') || line.beginsWith('fxsls=') ){
+						var lsports = ASTGUI.miscFunctions.chanStringToArray( line.afterChar('=') );
+						sessionData.PORTS_SIGNALLING.ls = sessionData.PORTS_SIGNALLING.ls.concat(lsports);
+					}
+				});
 			}
 		})();
 




More information about the asterisk-gui-commits mailing list