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

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Tue Oct 7 13:52:23 CDT 2008


Author: bkruse
Date: Tue Oct  7 13:52:22 2008
New Revision: 3946

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=3946
Log:
Going to get someone to test this, but this should
fix all our 1.6/Dahdi issues (thanks to kpfleming for
the hint on how to detect the current Asterisk version.)
(closes issue #13332)

Modified:
    team/bkruse/dahdi_integration/config/hardware.html
    team/bkruse/dahdi_integration/config/home.html
    team/bkruse/dahdi_integration/config/js/astman.js
    team/bkruse/dahdi_integration/scripts/editzap.sh

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=3946&r1=3945&r2=3946
==============================================================================
--- team/bkruse/dahdi_integration/config/hardware.html (original)
+++ team/bkruse/dahdi_integration/config/hardware.html Tue Oct  7 13:52:22 2008
@@ -442,8 +442,22 @@
 	runZtscan: function(){
 		ASTGUI.debugLog("start function: loadConfigFiles.runZtscan()" , 'parse');
 
-		ASTGUI.miscFunctions.createConfig( 'applyzap.conf', function(){
-			parent.ASTGUI.systemCmd( ASTGUI.apps.Ztscan , function(){ // run ztscan and then try loading ztscan.conf
+		var config_file = "";
+		if (parent.sessionData.PLATFORM.isAST_1_6) {
+			config_file = "applydahdi.conf";
+		} else {
+			config_file = "applyzap.conf";
+		}
+		ASTGUI.miscFunctions.createConfig( config_file, function(){
+
+			var path = "";
+			if (parent.sessionData.PLATFORM.isAST_1_6) {
+				path = ASTGUI.apps.Dahdiscan;
+			} else {
+				path = ASTGUI.apps.Ztscan;
+			} 
+
+			parent.ASTGUI.systemCmd( path , function(){ // run ztscan/dahdi_scan and then try loading ztscan.conf (both output to ztscan.conf)
 				window.setTimeout( loadConfigFiles.readZtscanConf , 700 ); // leave some time for ztscan to generate ztscan.conf
 			});
 			ASTGUI.debugLog("end of function: loadConfigFiles.runZtscan()" , 'parse');
@@ -637,7 +651,11 @@
 				var u = new listOfSynActions(tmp_file) ;
 				u.new_action('delcat', 'general', "", ""); 
 				u.new_action('newcat', 'general', "", ""); 
-				u.new_action('update', 'general', '#include "../zaptel.conf" ;', ' ;');
+				if (parent.sessionData.PLATFORM.isAST_1_6) {
+					u.new_action('update', 'general', '#include "../dahdi/system.conf" ;', ' ;');
+				} else {
+					u.new_action('update', 'general', '#include "../zaptel.conf" ;', ' ;');
+				}
 				u.callActions();
 				var q = config2json({filename:tmp_file, usf:0});
 				parseZaptelconf(q);
@@ -887,7 +905,13 @@
 	generate_zaptel: function(){
 		parent.ASTGUI.systemCmd( ASTGUI.scripts.generateZaptel + " applysettings" , function(){
 			parent.sessionData.REQUIRE_RESTART = (HAS_ANALOGHARDWARE || HAS_DIGITALHARDWARE)? true : false;
-			parent.ASTGUI.systemCmd( "ztcfg -vv" , function(){
+			var cmd = "";
+			if (parent.sessionData.PLATFORM.isAST_1_6) {
+				cmd = "dahdi_cfg -vv";
+			} else {
+				cmd = "ztcfg -vv";
+			}
+			parent.ASTGUI.systemCmd( cmd , function(){
 				applySettings.save_opermode_settings();
 				return true ;
 			});

Modified: team/bkruse/dahdi_integration/config/home.html
URL: http://svn.digium.com/view/asterisk-gui/team/bkruse/dahdi_integration/config/home.html?view=diff&rev=3946&r1=3945&r2=3946
==============================================================================
--- team/bkruse/dahdi_integration/config/home.html (original)
+++ team/bkruse/dahdi_integration/config/home.html Tue Oct  7 13:52:22 2008
@@ -49,6 +49,19 @@
 	}
 }
 
+function switchVersion() {
+	var f = makeSyncRequest({ action:'coresettings' });
+	f = f.toLowerCase();
+	/* I don't think that if it is 1.6, force 1.4 to be false.
+	This was mainly implemented for backwards compatibility, and
+	not to force options on users */
+	if(f.match('AMIversion: 1.1')) {
+		parent.sessionData.PLATFORM.isAst_1_6 = true;	
+	} else {
+		parent.sessionData.PLATFORM.isAst_1_6 = false;	
+	}
+}
+
 function doLogin(){
 	if( parent.sessionData.isLoggedIn == true ){
 		parent.miscFunctions.logoutFunction.confirmlogout();
@@ -75,6 +88,9 @@
 		}else{
 			parent.onLogInFunctions.checkifLoggedIn();
 		}
+
+		switchVersion();
+
 		return;
 	}else if(f.match('authentication failed') ) {
 		ASTGUI.debugLog("Login failure result: " + f , 'update');

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=3946&r1=3945&r2=3946
==============================================================================
--- team/bkruse/dahdi_integration/config/js/astman.js (original)
+++ team/bkruse/dahdi_integration/config/js/astman.js Tue Oct  7 13:52:22 2008
@@ -2687,6 +2687,7 @@
 
 ASTGUI.apps = {};
 ASTGUI.apps['Ztscan'] = 'ztscan > ' + ASTGUI.paths['asteriskConfig'] +'ztscan.conf' ;
+ASTGUI.apps['Dahdiscan'] = 'dahdi_scan > ' + ASTGUI.paths['asteriskConfig'] + 'ztscan.conf';
 ASTGUI.apps['mISDNscan'] = 'misdn-init scan' ;
 ASTGUI.apps['flashupdate'] = 'flashupdate' ;
 

Modified: team/bkruse/dahdi_integration/scripts/editzap.sh
URL: http://svn.digium.com/view/asterisk-gui/team/bkruse/dahdi_integration/scripts/editzap.sh?view=diff&rev=3946&r1=3945&r2=3946
==============================================================================
--- team/bkruse/dahdi_integration/scripts/editzap.sh (original)
+++ team/bkruse/dahdi_integration/scripts/editzap.sh Tue Oct  7 13:52:22 2008
@@ -6,8 +6,18 @@
 ####################################################################
 
 # Quick script for applying zaptel settings from the GUI.
+# Also applies to Dahdi (works for both)
 
 ZAPCONF="/etc/zaptel.conf"
-FILENAME="/etc/asterisk/applyzap.conf"
-grep -v '\;' ${FILENAME} | sed 's/\[general\]//g' > ${ZAPCONF}
+DAHDICONF="/etc/dahdi/system.conf"
+DAHDI_FILENAME="/etc/asterisk/applyzap.conf"
+ZAP_FILENAME="/etc/asterisk/applydahdi.conf"
 
+if [ -f ${DAHDI_FILENAME} ] ; then
+	grep -v '\;' ${DAHDI_FILENAME} | sed 's/\[general\]//g' > ${DAHDICONF}
+fi
+
+if [ -f ${ZAP_FILENAME} ] ; then
+	grep -v '\;' ${ZAP_FILENAME} | sed 's/\[general\]//g' > ${ZAPCONF}
+fi
+




More information about the asterisk-gui-commits mailing list