pari: branch asterisknow r2040 - /branches/asterisknow/config/digital.html

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Wed Dec 26 15:30:36 CST 2007


Author: pari
Date: Wed Dec 26 15:30:36 2007
New Revision: 2040

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=2040
Log:
now that should detect if the card is switched between T1/E1 modes

Modified:
    branches/asterisknow/config/digital.html

Modified: branches/asterisknow/config/digital.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/digital.html?view=diff&rev=2040&r1=2039&r2=2040
==============================================================================
--- branches/asterisknow/config/digital.html (original)
+++ branches/asterisknow/config/digital.html Wed Dec 26 15:30:36 2007
@@ -146,11 +146,11 @@
 	var configured_devices = [];
 	var detected_devices = [];
 	for( var l in CONFIGUREDHARDWARE ){ if(CONFIGUREDHARDWARE.hasOwnProperty(l)){ 
-		configured_devices.push( CONFIGUREDHARDWARE[l]['device'] + '::' + CONFIGUREDHARDWARE[l]['basechan'] ); 
-		// this way we can check for whether both device and the basechan are matching in one go
+		configured_devices.push( CONFIGUREDHARDWARE[l]['device'] + '::' + CONFIGUREDHARDWARE[l]['basechan'] + '::' + CONFIGUREDHARDWARE[l]['type'] ); 
+		// this way we can check for whether 'device' and 'basechan' and 'type' all matched in one go
 	}}
 	for( var l in DETECTEDHARDWARE ){ if(DETECTEDHARDWARE.hasOwnProperty(l)){ 
-		detected_devices.push( DETECTEDHARDWARE[l]['device'] + '::' + DETECTEDHARDWARE[l]['basechan']  ); 
+		detected_devices.push( DETECTEDHARDWARE[l]['device'] + '::' + DETECTEDHARDWARE[l]['basechan'] + '::' + DETECTEDHARDWARE[l]['type']  ); 
 	}}
 	configured_devices.sort(); detected_devices.sort();
 	if( !configured_devices.length && !detected_devices.length){ return false; }
@@ -458,8 +458,10 @@
 					DETECTEDHARDWARE[ n[l]['location'] ] = {};
 					DETECTEDHARDWARE[ n[l]['location'] ]['device'] = n[l]['devicetype'];
 					DETECTEDHARDWARE[ n[l]['location'] ]['basechan'] = n[l]['basechan'];
+					DETECTEDHARDWARE[ n[l]['location'] ]['type'] = n[l]['type'] ;
 					continue;
-				} // in this page, we care only about digital spans
+				} // in this page, we care only about digital spans 
+				//  note: function detectHwChanges checks if there are any changes in analog ports detected
 				SPANS[l] = {};
 				for( var k in n[l] ){ if(n[l].hasOwnProperty(k)){ 
 					SPANS[l][k] = n[l][k]; // store all the other fields in spans[l]
@@ -467,6 +469,7 @@
 						DETECTEDHARDWARE[ n[l]['location'] ] = {};
 						DETECTEDHARDWARE[ n[l]['location'] ]['device'] = n[l]['devicetype'];
 						DETECTEDHARDWARE[ n[l]['location'] ]['basechan'] = n[l]['basechan'];
+						DETECTEDHARDWARE[ n[l]['location'] ]['type'] = n[l]['type'];
 					}
 					if( k == 'totchans' ){
 						SPANS[l]['spantype'] = n[l]['type'].split('-')[1]; // part after '-' in 'digital-T1' or 'digital-E1'
@@ -663,6 +666,7 @@
 				uri += build_action('newcat', c, g , "", ""); c++;
 				uri += build_action('update', c, g , "device", DETECTEDHARDWARE[g]['device'] ); c++;
 				uri += build_action('update', c, g , "basechan", DETECTEDHARDWARE[g]['basechan'] ); c++;
+				uri += build_action('update', c, g , "type", DETECTEDHARDWARE[g]['type'] ); c++;
 			}}
 
 			makerequest('u', hwcfgfile, uri , function(t) {




More information about the asterisk-gui-commits mailing list