bkruse: branch bkruse/dahdi_integration r3956 - in /team/bkruse/dahdi_integra...

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Tue Oct 7 16:00:22 CDT 2008


Author: bkruse
Date: Tue Oct  7 16:00:21 2008
New Revision: 3956

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=3956
Log:
That should be all the changes, we do not want to change hardware_aa50, as that will never be dahdi.
Updated welcome.html and pbx.js routines for both dahdi and zaptel (zapchan)

Modified:
    team/bkruse/dahdi_integration/config/js/pbx.js
    team/bkruse/dahdi_integration/config/welcome.html

Modified: team/bkruse/dahdi_integration/config/js/pbx.js
URL: http://svn.digium.com/view/asterisk-gui/team/bkruse/dahdi_integration/config/js/pbx.js?view=diff&rev=3956&r1=3955&r2=3956
==============================================================================
--- team/bkruse/dahdi_integration/config/js/pbx.js (original)
+++ team/bkruse/dahdi_integration/config/js/pbx.js Tue Oct  7 16:00:21 2008
@@ -152,7 +152,11 @@
 					var u = new listOfSynActions(tmp_file) ;
 					u.new_action('delcat', 'general', "", ""); 
 					u.new_action('newcat', 'general', "", ""); 
-					u.new_action('update', 'general', '#include "../zaptel.conf" ;', ' ;');
+					if (parent.sessionData.PLATFORM.isAST_1_6) {
+						u.new_action('update', 'general', '#include "../dahdi/system.conf" ;', ' ;');
+					} else {
+						u.new_action('update', 'general', '#include "../zaptel.conf" ;', ' ;');
+					}
 					u.callActions();
 				});
 				return;
@@ -438,7 +442,13 @@
 					sessionData.pbxinfo['trunks']['sip'][d] = c[d];
 					continue;
 				}
-				if( c[d]['zapchan'] && (!c[d]['hasiax'] || c[d]['hasiax'] =='no') && (!c[d]['hassip'] || c[d]['hassip'] =='no')){
+				var type = "";
+				if (parent.sessionData.PLATFORM.isAST_1_6) {
+					type = "dahdichan";
+				} else {
+					type = "zapchan";
+				}
+				if( c[d][type] && (!c[d]['hasiax'] || c[d]['hasiax'] =='no') && (!c[d]['hassip'] || c[d]['hassip'] =='no')){
 					// if is an analog trunk - note that here we are NOT expecting a 'FXO channel(FXS signalled) on a T1/E1'
 					// we assume that all the ports in zapchan are actual analog FXO ports
 					// a trunk for T1/E1 analog channels would begin with 'span_'
@@ -446,8 +456,14 @@
 					continue;
 				}
 			}
-
-			if( d.beginsWith('span_') && c[d]['zapchan'] ){ 
+			var type = "";
+			if (parent.sessionData.PLATFORM.isAST_1_6) {
+				type = "dahdichan";
+			} else {
+				type = "zapchan";
+			}
+
+			if( d.beginsWith('span_') && c[d][type] ){ 
 				sessionData.pbxinfo['trunks']['pri'][d] = c[d];
 				continue;
 			}
@@ -806,7 +822,11 @@
 	addAnalogTrunk: function(tr, cbf){ // creates a new analog trunk with the details metioned in tr object, cbf is callback function
 		// usage:: astgui_managetrunks.addAnalogTrunk({ 'zapchan':'2,3,4' , (optional) trunkname:'Ports 2,3,4'} , cbf) ;
 
-		if(! tr.hasOwnProperty('zapchan') ){return false;} // zapchan is a required parameter. 
+		if (parent.sessionData.PLATFORM.isAST_1_6) {
+			if(! tr.hasOwnProperty('dahdichan') ){return false;} // dahdichan is a required parameter. 
+		} else {
+			if(! tr.hasOwnProperty('zapchan') ){return false;} // zapchan is a required parameter. 
+		}
 
 		var trunk = astgui_managetrunks.misc.nextAvailableTrunk_x();
 		var group = astgui_managetrunks.misc.nextAvailableGroup();
@@ -822,10 +842,19 @@
 			sessionData.pbxinfo.trunks.analog[trunk] = new ASTGUI.customObject; // add new/reset analog trunk info in sessionData
 		x.new_action('append', trunk, 'group', group);
 			sessionData.pbxinfo.trunks.analog[trunk]['group'] = group;
-		x.new_action('append', trunk, 'zapchan', tr.zapchan);
+		if (parent.sessionData.PLATFORM.isAST_1_6) {
+			x.new_action('append', trunk, 'dahdichan', tr.dahdichan);
+			sessionData.pbxinfo.trunks.analog[trunk]['dahdichan'] = tr.dahdichan ;
+		} else {
+			x.new_action('append', trunk, 'zapchan', tr.zapchan);
 			sessionData.pbxinfo.trunks.analog[trunk]['zapchan'] = tr.zapchan ;
+		}
 		var zap_channels = ASTGUI.miscFunctions.chanStringToArray(tr.zapchan);
-		delete tr.zapchan ;
+		if (parent.sessionData.PLATFORM.isAST_1_6) {
+			delete tr.dahdichan ;
+		} else {
+			delete tr.zapchan ;
+		}
 
 		x.new_action('append', trunk, 'hasexten', 'no');
 			sessionData.pbxinfo.trunks.analog[trunk]['hasexten'] = 'no';

Modified: team/bkruse/dahdi_integration/config/welcome.html
URL: http://svn.digium.com/view/asterisk-gui/team/bkruse/dahdi_integration/config/welcome.html?view=diff&rev=3956&r1=3955&r2=3956
==============================================================================
--- team/bkruse/dahdi_integration/config/welcome.html (original)
+++ team/bkruse/dahdi_integration/config/welcome.html Tue Oct  7 16:00:21 2008
@@ -233,7 +233,11 @@
 			addCell( newRow , { html: parent.sessionData.pbxinfo['trunks']['analog'][item]['trunkname'] } );
 			addCell( newRow , { html:'Analog'} );
 			addCell( newRow , { html:''} );
-			addCell( newRow , { html:'Ports ' + parent.sessionData.pbxinfo['trunks']['analog'][item]['zapchan'] } );
+			if (parent.sessionData.PLATFORM.isAST_1_6) {
+				addCell( newRow , { html:'Ports ' + parent.sessionData.pbxinfo['trunks']['analog'][item]['dahdichan'] } );
+			} else {
+				addCell( newRow , { html:'Ports ' + parent.sessionData.pbxinfo['trunks']['analog'][item]['zapchan'] } );
+			}
 // 			try{
 // 				addCell( newRow , { html: default_IncomingRule_trunk(item) });
 // 			}catch(err){
@@ -271,7 +275,11 @@
 			addCell( newRow , { html:'' });
 			addCell( newRow , { html: c[d]['trunkname'] });
 			addCell( newRow , { html: 'Digital (' + c[d]['signalling'] + ')' }); // 
-			addCell( newRow , { html: 'Ports: ' + c[d]['zapchan'] });
+			if (parent.sessionData.PLATFORM.isAST_1_6) {
+				addCell( newRow , { html: 'Ports: ' + c[d]['dahdichan'] });
+			} else {
+				addCell( newRow , { html: 'Ports: ' + c[d]['zapchan'] });
+			}
 			addCell( newRow , { html:''} );
 		}}
 
@@ -313,8 +321,14 @@
 			if( ud.getProperty('hassip').isAstTrue() ){ tmp_usertype_a.push( ' SIP User' ) ; }
 			if( ud.getProperty('hasiax').isAstTrue() ){ tmp_usertype_a.push( ' IAX User' ) ; }
 			if( ud.getProperty('hassip').isAstTrue() && ud.getProperty('hasiax').isAstTrue() ){ tmp_usertype_a = [ 'SIP/IAX User' ] ; }
-			if( ud.getProperty('zapchan') ){
-				tmp_usertype_a.push( 'Analog User (Port ' + ud['zapchan'] + ')' ) ;
+			if (parent.sessionData.PLATFORM.isAST_1_6) {
+				if( ud.getProperty('dahdichan') ){
+					tmp_usertype_a.push( 'Analog User (Port ' + ud['dahdichan'] + ')' ) ;
+				}
+			} else {
+				if( ud.getProperty('zapchan') ){
+					tmp_usertype_a.push( 'Analog User (Port ' + ud['zapchan'] + ')' ) ;
+				}
 			}
 
 			var tmp_mails = ASTGUI.mailboxCount(user);




More information about the asterisk-gui-commits mailing list