pari: branch 2.0 r3678 - in /branches/2.0/config: ./ js/

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Tue Aug 19 12:01:25 CDT 2008


Author: pari
Date: Tue Aug 19 12:01:24 2008
New Revision: 3678

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

 Adding 'missing mISDN trunks intergration' in the new gui

 


Modified:
    branches/2.0/config/js/index.js
    branches/2.0/config/js/pbx.js
    branches/2.0/config/misdn.html
    branches/2.0/config/trunks_digital.html

Modified: branches/2.0/config/js/index.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/index.js?view=diff&rev=3678&r1=3677&r2=3678
==============================================================================
--- branches/2.0/config/js/index.js (original)
+++ branches/2.0/config/js/index.js Tue Aug 19 12:01:24 2008
@@ -253,6 +253,12 @@
 				ASTGUI.ErrorLog('Error in readcfg.UsersConf()');
 			}
 
+			try{
+				readcfg.MisdnConf();
+			}catch(er){
+				ASTGUI.ErrorLog('Error in readcfg.MisdnConf()');
+			}
+
 		}catch(err){
 			ASTGUI.ErrorLog('Error in onLogInFunctions.parseConfigFiles()');
 		}finally{

Modified: branches/2.0/config/js/pbx.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/pbx.js?view=diff&rev=3678&r1=3677&r2=3678
==============================================================================
--- branches/2.0/config/js/pbx.js (original)
+++ branches/2.0/config/js/pbx.js Tue Aug 19 12:01:24 2008
@@ -498,6 +498,7 @@
 		sessionData.pbxinfo['trunks']['sip'] = new ASTGUI.customObject;
 		sessionData.pbxinfo['trunks']['iax'] = new ASTGUI.customObject;
 		sessionData.pbxinfo['trunks']['pri'] = new ASTGUI.customObject;
+		sessionData.pbxinfo['trunks']['bri'] = new ASTGUI.customObject;
 		sessionData.pbxinfo['trunks']['providers'] = new ASTGUI.customObject;
 
 		for(var d in c){ if(c.hasOwnProperty(d)) {
@@ -556,6 +557,13 @@
 			}
 		}}
 	}, // end of readcfg.UsersConf();
+
+	MisdnConf: function(){ // readcfg.MisdnConf();
+		var c = config2json({filename:'misdn.conf', usf:1});
+		for(var d in c){ if( c.hasOwnProperty(d) && d.beginsWith('trunk_m') ) {
+			sessionData.pbxinfo['trunks']['bri'][d] = c[d] ;
+		}}
+	},
 
 	ztScanConf: function(){ // readcfg.ztScanConf();
 		// reads ztscan.conf and updates sessionData.FXO_PORTS_DETECTED and sessionData.FXS_PORTS_DETECTED
@@ -765,7 +773,7 @@
 
 	listofAllTrunks : function(){
 		var x = [];
-		return x.concat( this.listOfAnalogTrunks(), this.listOfSIPTrunks(), this.listOfIAXTrunks(), this.listOfPRITrunks(), this.listOfProviderTrunks() );
+		return x.concat( this.listOfAnalogTrunks(), this.listOfSIPTrunks(), this.listOfIAXTrunks(), this.listOfPRITrunks(), this.listOfProviderTrunks() , this.listOfBRITrunks() );
 	},
 
 	listOfProviderTrunks : function(){
@@ -782,6 +790,16 @@
 		var list =[];
 		try{
 			for(var item in sessionData.pbxinfo.trunks.analog){ if(sessionData.pbxinfo.trunks.analog.hasOwnProperty(item)){
+				list.push(item);
+			}}
+		} catch (err) { return []; }
+		return list;
+	},
+
+	listOfBRITrunks: function(){
+		var list =[];
+		try{
+			for(var item in sessionData.pbxinfo.trunks.bri){ if( sessionData.pbxinfo.trunks.bri.hasOwnProperty(item) ){
 				list.push(item);
 			}}
 		} catch (err) { return []; }
@@ -1060,6 +1078,7 @@
 			if ( sessionData.pbxinfo.trunks.iax[TRUNK] ) { return 'iax' ; }
 			if ( sessionData.pbxinfo.trunks.analog[TRUNK] ) { return 'analog' ; }
 			if ( sessionData.pbxinfo.trunks.pri[TRUNK] ) { return 'pri' ; }
+			if ( sessionData.pbxinfo.trunks.bri[TRUNK] ) { return 'bri' ; }
 			if ( sessionData.pbxinfo.trunks.providers[TRUNK] ) { return 'providers' ; }
 			return null;
 		},
@@ -1078,6 +1097,13 @@
 			if ( r.iax[TRUNK] ) { return r.iax[TRUNK]['trunkname'] || TRUNK ; }
 			if ( r.analog[TRUNK] ) { return r.analog[TRUNK]['trunkname'] || TRUNK ; }
 			if ( r.pri[TRUNK] ) { return r.pri[TRUNK]['trunkname'] || TRUNK ; }
+			if ( r.bri[TRUNK] ) {
+				if( r.bri[TRUNK]['trunkname'] ){
+					return 'BRI - ' + r.bri[TRUNK]['trunkname'] ;
+				}else{
+					return TRUNK ;
+				}
+			}
 			if ( r.providers[TRUNK] ) { return r.providers[TRUNK]['trunkname'] || TRUNK ; }
 			return '';
 		}

Modified: branches/2.0/config/misdn.html
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/misdn.html?view=diff&rev=3678&r1=3677&r2=3678
==============================================================================
--- branches/2.0/config/misdn.html (original)
+++ branches/2.0/config/misdn.html Tue Aug 19 12:01:24 2008
@@ -384,8 +384,7 @@
 		u.new_action('delcat', 'DID_' + k , "", "");
 		u.new_action('delete', 'globals', k, '', 'mISDN/g:' + k );
 		u.callActions();
-		delete mISDNTRUNKS[k];
-		showMisdnTrunksinTable();
+		top.window.location.reload();
 	})();
 };
 
@@ -431,7 +430,6 @@
 		x.callActions(function(){
 			var u = new listOfSynActions('extensions.conf') ;
 			u.new_action('newcat', "DID_"+newtrunkname, "", "");
-			u.new_action('append', "DID_"+newtrunkname, 'include', 'default');
 			u.new_action('update', 'globals', newtrunkname, 'mISDN/g:' + newtrunkname );
 			u.callActions();
 			try{
@@ -445,6 +443,8 @@
 
 			}finally{
 				_$('edit_trunk').style.display = "none";
+				alert('BRI trunk created. \n Click OK to reload');
+				top.window.location.reload();
 			}
 		});
 	}else{

Modified: branches/2.0/config/trunks_digital.html
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/trunks_digital.html?view=diff&rev=3678&r1=3677&r2=3678
==============================================================================
--- branches/2.0/config/trunks_digital.html (original)
+++ branches/2.0/config/trunks_digital.html Tue Aug 19 12:01:24 2008
@@ -75,6 +75,18 @@
 			addCell( newRow , { html: c[d]['zapchan'] });
 			addCell( newRow , { html:''} );
 		}}
+
+
+		var c = parent.sessionData.pbxinfo['trunks']['bri'] ;
+		for(var d in c){if(c.hasOwnProperty(d)){
+			var newRow = DOM_table_DigitalTrunks_list.insertRow(-1);
+			newRow.className = ((DOM_table_DigitalTrunks_list.rows.length)%2==1)?'odd':'even';
+			addCell( newRow , { html:'', width:'15px' });
+			addCell( newRow , { html: c[d]['trunkname'] });
+			addCell( newRow , { html: 'mISDN' });
+			addCell( newRow , { html: c[d]['ports'] });
+			addCell( newRow , { html:''} );
+		}}
 	})();
 
 	if( DOM_table_DigitalTrunks_list.rows.length == 1  ){




More information about the asterisk-gui-commits mailing list