pari: branch asterisknow r2136 - /branches/asterisknow/config/misdn.html

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Sat Jan 12 14:57:58 CST 2008


Author: pari
Date: Sat Jan 12 14:57:57 2008
New Revision: 2136

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=2136
Log:
Fixing the port options for misdn ports

Modified:
    branches/asterisknow/config/misdn.html

Modified: branches/asterisknow/config/misdn.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/misdn.html?view=diff&rev=2136&r1=2135&r2=2136
==============================================================================
--- branches/asterisknow/config/misdn.html (original)
+++ branches/asterisknow/config/misdn.html Sat Jan 12 14:57:57 2008
@@ -185,6 +185,13 @@
 						PORTS[b]['portType'] = a.strip(); // set port type of port d to a
 					}
 				}
+
+				if(records[t].beginsWith('option=')){ // 'option=1,master_clock' or 'option=2,ais,nocrc4'
+					var a = ASTGUI.parseContextLine.read(records[t]); // a[1] is '1,master_clock' or '2,ais,nocrc4'
+					var b = a[1].split(',')[0]; // b is is the misdn port numer
+					var c = records[t].split(',').slice(1).join(','); // 'master_clock' or 'ais,nocrc4'
+					PORTS[b]['option'] = c ;
+				}
 			}
 			// done parsing misdn-init.conf
 			// show table
@@ -251,11 +258,12 @@
 };
 
 function edit_port(p){
+	if( !PORTS[p].hasOwnProperty('option') ) { PORTS[p]['option'] = ''; }
+	ASTGUI.selectbox.selectOption( _$('editport_option'), PORTS[p]['option'] );
 	ASTGUI.selectbox.selectOption( _$('editport_type'), PORTS[p]['portType'] );
-	_$('editport_label').innerHTML = PORTS[p]['cardno'] + "/" + PORTS[p]['card_portno']
+	_$('editport_label').innerHTML = PORTS[p]['cardno'] + "/" + PORTS[p]['card_portno'] ;
 	_$('edit_port').style.display = "";
 	_$('edit_port')['port_editing'] = p;
-	
 }
 
 
@@ -266,6 +274,22 @@
 function updatePortInfo(){
 	var p = _$('edit_port')['port_editing'];
 	PORTS[p]['portType'] = _$('editport_type').value;
+	if(  _$('editport_option').value == 'master_clock' ){ // condition to make sure none of the other spans on this card is a master_clock
+		(function (){
+			var this_card = PORTS[p]['cardno'] ;
+			var other_ports_onThisCard = [];
+			for(var d in PORTS){if( PORTS.hasOwnProperty(d) && PORTS[d]['cardno'] == this_card && d != p ){	
+				other_ports_onThisCard.push(d);
+			}}
+
+			for(var y=0; y < other_ports_onThisCard.length ; y ++){
+				var k = other_ports_onThisCard[y];
+				if( PORTS[k].hasOwnProperty('option') && PORTS[k]['option'] == 'master_clock'){PORTS[k]['option'] = ''; }
+			}
+		})(); 
+	}
+
+	PORTS[p]['option'] = _$('editport_option').value ;
 	PORTS[p]['edited'] = true;
 	misdnConfig.showMisdnConfiginTable();
 	_$('edit_port').style.display = "none";
@@ -297,6 +321,12 @@
 		if(PORTS[k]['portType']){ pmode_ports[PORTS[k]['portType']].push(k); }
 	}}
 
+
+	for( var k in PORTS ){ if( PORTS.hasOwnProperty(k) ){ 
+		if( PORTS[k]['option'] ){
+			uri+= build_action('append', c, d , 'option',  k + ',' + PORTS[k]['option'] ); c++;
+		}
+	}}
 
 	for( var k in pmode_ports ){ if( pmode_ports.hasOwnProperty(k) && pmode_ports[k].length ){
 		uri += build_action('append' , c , d , k , pmode_ports[k].join(',') ) ; c++ ;
@@ -576,10 +606,12 @@
 			</select>
 		</TD>
 	</TR>
-	<TR>	<TD align="right">Sync/Clock Source:</TD>
-		<TD>	<select id="editport_mode">
-				<option value="0">Master (0) (Set Timing)</option>
-				<option value="1">Slave (1) (Take Timing)</option>
+	<TR>	<TD align="right">Port Options (Optional):</TD>
+		<TD>	<select id="editport_option">
+				<option value="master_clock">master_clock</option>
+				<option value="ais,nocrc4">ais,nocrc4</option>
+				<option value="optical,los,ais,slip">optical,los,ais,slip</option>
+				<option value=''>None</option>
 			</select>
 		</TD>
 	</TR>




More information about the asterisk-gui-commits mailing list