bkruse: branch asterisknow r1731 - /branches/asterisknow/config/users.html

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Wed Oct 24 16:20:03 CDT 2007


Author: bkruse
Date: Wed Oct 24 16:20:02 2007
New Revision: 1731

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=1731
Log:
Option to connect fxo signalled channels to user Extensions (merged from trunk development)

Modified:
    branches/asterisknow/config/users.html

Modified: branches/asterisknow/config/users.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/users.html?view=diff&rev=1731&r1=1730&r2=1731
==============================================================================
--- branches/asterisknow/config/users.html (original)
+++ branches/asterisknow/config/users.html Wed Oct 24 16:20:02 2007
@@ -77,6 +77,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){
@@ -93,6 +109,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;
 	}
 	
@@ -105,6 +124,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) {
@@ -237,11 +262,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);
@@ -489,7 +510,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