pari: trunk r1705 - in /trunk/config: digital.html users.html

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Fri Oct 19 14:44:36 CDT 2007


Author: pari
Date: Fri Oct 19 14:44:35 2007
New Revision: 1705

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=1705
Log:
Option to connect fxo signalled channels to user Extensions 

Modified:
    trunk/config/digital.html
    trunk/config/users.html

Modified: trunk/config/digital.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/digital.html?view=diff&rev=1705&r1=1704&r2=1705
==============================================================================
--- trunk/config/digital.html (original)
+++ trunk/config/digital.html Fri Oct 19 14:44:35 2007
@@ -87,7 +87,8 @@
 	var z = Number(SPANS[l]['definedchans']);
 	if(z==1){return String(y);}
 
-	if ( SPANS[l]['signalling'].beginsWith('fx') ){
+	if( SPANS[l]['signalling'] && SPANS[l]['signalling'].beginsWith('fx') ){
+
 		return y + "-" + String(y+z-1);
 	}else{
 		if(SPANS[l]['totchans'] <= 24){ // if T1
@@ -415,7 +416,7 @@
 						if (!SPANS[tmp]){SPANS[tmp] = {};}
 						for( var k in n[l] ){ if(n[l].hasOwnProperty(k)){ 
 							SPANS[tmp][k] = n[l][k];
-							if( k=='zapchan' ){ SPANS[tmp]['definedchans'] = efgh(n[l][k]); }
+							if( k=='zapchan' || k=='fxochannels'){ SPANS[tmp]['definedchans'] = efgh(n[l][k]); }
 						}}
 					}
 				}}
@@ -444,7 +445,19 @@
 
 function updateSpanInfo(){
 	if( !verify_priChLimit() ){
-		alert("You should leave atleast one channel for signalling");
+		alert("You should leave atleast one channel for signalling.");
+		return true;
+	}
+	if(!_$('editspan_fac').value){
+		alert("Please select a Framing/Coding !");
+		return true;
+	}
+	if(!_$('editspan_signalling').value){
+		alert("Please select a signalling !");
+		return true;
+	}
+	if(_$('editspan_signalling').value.beginsWith('pri') &&  !_$('editspan_switchtype').value ){
+		alert("Please select a Switch Type !");
 		return true;
 	}
 
@@ -488,11 +501,18 @@
 				uri += build_action('newcat', c, d , "", ""); c++;
 				uri += build_action('update', c, d , "switchtype", SPANS[k]['switchtype']); c++;
 				uri += build_action('update', c, d , "signalling", SPANS[k]['signalling']); c++;
-				uri += build_action('update', c, d , "context", e); c++;
-				uri += build_action('update', c, d , "group", String(k)); c++;
 				uri += build_action('update', c, d , "trunkname", 'Span '+String(k)); c++;
 				uri += build_action('update', c, d , "trunkstyle", 'digital'); c++;
-				uri += build_action('update', c, d , "zapchan", SPANS[k]['zapchanstring'] ); c++;
+				uri += build_action('update', c, d , "context", e); c++;
+
+				if ( !SPANS[k]['signalling'].beginsWith('fxo') ){
+					uri += build_action('update', c, d , "group", String(k)); c++;
+					uri += build_action('update', c, d , "zapchan", SPANS[k]['zapchanstring'] ); c++;
+				}else{ 
+					// if fxs signalling , donot add zapchan under span_x,
+					// we would want to define zapchan under the user extension to which we want the station to be assigned to
+					uri += build_action('update', c, d , "fxochannels", SPANS[k]['zapchanstring'] ); c++;
+				}
 
 				uri2 += build_action('delete', f, 'globals', d, "", ""); f++;
 				uri2 += build_action('update', f, 'globals', d,'Zap/g'+String(k)); f++;
@@ -642,9 +662,9 @@
 			<option value="pri_net">PRI - Net</option>
 			<option value="pri_cpe">PRI - CPE</option>
 			<option value="fxoks">FXOKS</option>
-			<option value="fxsks">FXSKS</option>
 			<option value="fxols">FXOLS</option>
-			<option value="fxsls">FXSLS</option>
+			<!--<option value="fxsks">FXSKS</option>
+			<option value="fxsls">FXSLS</option>-->
 			</select>
 		</TD>
 	</TR>

Modified: trunk/config/users.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/users.html?view=diff&rev=1705&r1=1704&r2=1705
==============================================================================
--- trunk/config/users.html (original)
+++ trunk/config/users.html Fri Oct 19 14:44:35 2007
@@ -48,6 +48,22 @@
 
 extencallbacks.eachline = true;
 
+var add_DigitalChannels = function(k){ // k could be 'x', 'x-y'
+	var n, _zapchan = _$('zapchan') ;
+
+	if( k.contains('-') ){
+		var l = Number(k.split('-')[0]);
+		var m = Number(k.split('-')[1]);
+		for( n = l ; n <= m; n++ ){
+			ASTGUI.selectbox.append(_zapchan,"Channel #" + n, n);
+		}
+	}else{
+		n = Number(k);
+		ASTGUI.selectbox.append(_zapchan,"Channel #" + n, n);
+	}
+}
+
+
 callbacks.format = function(t) {
 	if ((t.name == 'general')){
 		if (t.fieldbyname['localextenlength'] && t.fieldbyname['localextenlength'].length){
@@ -64,6 +80,9 @@
 	}
 	
 	if ( t.fieldbyname['context'] == asterisk_guiTDPrefix + t.name ) {
+		if(t.name.beginsWith('span_')){
+			if(t.fieldbyname['fxochannels']){ add_DigitalChannels( t.fieldbyname['fxochannels'] ); }
+		}
 		return null;
 	}
 	
@@ -76,6 +95,12 @@
 callbacks.loaded = function() {
 	_$('devices').contentEditable = 'true';
 	_$('devices').disabled = 0;
+
+	if( _$('zapchan').options.length == 0) {
+		_$('zapchan').style.display="none";
+		_$('noanaloglines').style.display="";
+	}
+
 	parent.astmanEngine.config2list("extensions.conf", _$('extensions'), new Array(), extencallbacks);
 }
 callbacks.sortfunc = function(a,b) {
@@ -208,11 +233,7 @@
 			ASTGUI.selectbox.append(_zapchan,"Analog Port #" + d, d);
 		}
 	}
-	
-	if( _zapchan.options.length == 0) {
-		_zapchan.style.display="none";
-		_$('noanaloglines').style.display="";
-	}
+
 	ASTGUI.selectbox.insert_before(_zapchan,"None", "", 0);
 	config2json('extensions.conf', 1, dialplans_loaded ) ;
 	//parent.astmanEngine.config2list("extensions.conf", _$('context'), new Array(), numcallbacks);
@@ -473,7 +494,7 @@
 				<tr><td class="field_text" tip="en,users,16">VM Password:</td><td><input size='5' id='vmsecret' pattern='^[0-9*]*$'  class="input8"></td></tr>
 				<tr><td class="field_text" tip="en,users,3">E-mail:</td><td><input size='20' id='email' pattern='^[0-9a-zA-Z\.\-\_\@]*$' class="input8"></td></tr>
 				<tr><td class="field_text" tip="en,users,4">Caller ID:</td><td><input size='12' id='cid_number'  pattern='^[\d\-]*$' class="input8"></td></tr>
-				<tr><td class="field_text" tip="en,users,5">Analog Phone:</td><td><select size="1" id='zapchan' style='width:120px' class="input8"></select>
+				<tr><td class="field_text" tip="en,users,5">Analog Phone:</td><td><select size="1" id='zapchan' style='width:140px' class="input8"></select>
 				<span id="noanaloglines" style="display:none" class="field_text"><I>&nbsp;No Analog lines detected.</I></span></td></tr>
 				<tr><td class="field_text" tip="en,users,6">Dial Plan:</td><td><select size='1' id='context' style='width:120px' class="input8"></select></td></tr>
 				<tr><td colspan='2' align='center'><input type='hidden' id='mailbox'><input type='hidden' id='group'><input type='checkbox' id='registersip' style="display:none"><input type='checkbox' id='registeriax' style="display:none"></td></tr>




More information about the asterisk-gui-commits mailing list