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

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Tue Jan 13 16:22:04 CST 2009


Author: pari
Date: Tue Jan 13 16:22:04 2009
New Revision: 4422

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

more progress on dahdi=>bri



Modified:
    team/pari/dahdi_support/config/js/hardware.js

Modified: team/pari/dahdi_support/config/js/hardware.js
URL: http://svn.digium.com/svn-view/asterisk-gui/team/pari/dahdi_support/config/js/hardware.js?view=diff&rev=4422&r1=4421&r2=4422
==============================================================================
--- team/pari/dahdi_support/config/js/hardware.js (original)
+++ team/pari/dahdi_support/config/js/hardware.js Tue Jan 13 16:22:04 2009
@@ -150,6 +150,7 @@
 	var l = String(CURRENT_SPAN);
 	if( !_$('editspan_signalling').value.beginsWith('pri')){ return true;}
 	var y = Number(_$('edit_DefinedChans').value);
+	if( Number(SPANS[l]['totchans'] ) ==3 ){return true;}
 	if( Number(SPANS[l]['totchans'] ) <= 24 && y ==24){return false;}//alert("You should leave atleast 1 channel for PRI signalling");
 	if( Number(SPANS[l]['totchans'] ) > 24 && y ==31){return false;}//alert("You should leave atleast 1 channel for PRI signalling");
 	return true;
@@ -157,6 +158,9 @@
 
 var calc_bchan_fxx = function(l){ // calculates the bchan,and fxx strings for a given span
 	var y = Number(SPANS[l]['min_ch']);
+	if( SPANS[l]['totchans'] == 3 ){
+		return y + "-" + String(y+1);
+	}
 	var z = Number(SPANS[l]['definedchans']);
 	if(z==1){return String(y);}
 
@@ -198,7 +202,7 @@
 	var ijkl = function(){
 		ASTGUI.selectbox.clear(w);
 		var f = Number( SPANS[l]['totchans'] ), g=0;
-		if(f == 31){ f = 30;} // always make sure that only a max of 30 ports are available on E1 
+		if(f == 31){ f = 30; } // always make sure that only a max of 30 ports are available on E1 
 		for(g=1; g <=f; g++){ ASTGUI.selectbox.append(w,g,g); }
 		ASTGUI.selectbox.selectOption(w,SPANS[l]['definedchans']);
 		_$('edit_labelReserved').innerHTML = SPANS[l]['reserved_ch'];
@@ -610,6 +614,13 @@
 };
 
 var disablEnable_sc = function(){
+	_$('edit_DefinedChans').disabled = false;
+	if( Number(SPANS[CURRENT_SPAN]['totchans']) == 3 ){
+		_$('edit_DefinedChans').selectedIndex = 1 ;
+		_$('edit_DefinedChans').disabled = true;
+		_$('edit_labelReserved').innerHTML = Number(SPANS[CURRENT_SPAN]['basechan']) + 2 ;
+		return true;
+	}
 
 	if( !_$('editspan_signalling').value.beginsWith('pri') ){
 		_$('editspan_switchtype').disabled =  true;
@@ -1144,9 +1155,13 @@
 			return true;
 		}
 
-		SPANS[b]['definedchans'] = y;
+		if(SPANS[b]['totchans'] == 3){
+			SPANS[b]['definedchans'] = y = 2;
+		}else{
+			SPANS[b]['definedchans'] = y;
+			_$('edit_labelZapchan').innerHTML = calc_bchan_fxx(b);
+		}
 		//_$('edit_labelReserved').innerHTML = SPANS[b]['reserved_ch'];
-		_$('edit_labelZapchan').innerHTML = calc_bchan_fxx(b);
 	};
 
 	ASTGUI.events.add( _$('edit_DefinedChans'), "change", edit_DefinedChans_changed );




More information about the asterisk-gui-commits mailing list