espiceland: branch 2.0 r5196 - in /branches/2.0: ./ config/ config/js/

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Wed May 4 12:14:14 CDT 2011


Author: espiceland
Date: Wed May  4 12:14:11 2011
New Revision: 5196

URL: http://svnview.digium.com/svn/asterisk-gui?view=rev&rev=5196
Log:
Get rid of isAST_X_X[_X] boolean global variables and use real version
comparision.

Modified:
    branches/2.0/   (props changed)
    branches/2.0/config/index.html
    branches/2.0/config/js/astman.js
    branches/2.0/config/js/backup.js
    branches/2.0/config/js/index.js
    branches/2.0/config/js/menuprompts_upload.js
    branches/2.0/config/js/mohfiles.js
    branches/2.0/config/js/pbx.js
    branches/2.0/config/js/preferences.js
    branches/2.0/config/welcome.html

Propchange: branches/2.0/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Wed May  4 12:14:11 2011
@@ -1,0 +1,2 @@
+/team/espiceland/private/file-cache:5173-5175
+/team/espiceland/private/version-handling:5176-5195

Modified: branches/2.0/config/index.html
URL: http://svnview.digium.com/svn/asterisk-gui/branches/2.0/config/index.html?view=diff&rev=5196&r1=5195&r2=5196
==============================================================================
--- branches/2.0/config/index.html (original)
+++ branches/2.0/config/index.html Wed May  4 12:14:11 2011
@@ -279,9 +279,6 @@
 			isAA50_OEM : false, // sessionData.PLATFORM.isAA50_OEM
 			AA50_SKU : '', // sessionData.PLATFORM.AA50_SKU
 			isANOW : false, // Asterisk Now
-			isAST_1_4 : true, // we assume is Asterisk 1.4 by default, sessionData.PLATFORM.isAST_1_4
-			isAST_1_6 : false,
-			isAST_1_6_1 : false
 		},
 
 		AsteriskVersionString : '',

Modified: branches/2.0/config/js/astman.js
URL: http://svnview.digium.com/svn/asterisk-gui/branches/2.0/config/js/astman.js?view=diff&rev=5196&r1=5195&r2=5196
==============================================================================
--- branches/2.0/config/js/astman.js (original)
+++ branches/2.0/config/js/astman.js Wed May  4 12:14:11 2011
@@ -1238,7 +1238,7 @@
 			}
 			if((line.beginsWith(host) || (this_IP && line.beginsWith(this_IP + ' ')))  && line.contains(' ' + uname_lc + ' ')) {
 				var vals = line_orig.split(/[ \t][ \t]*/); /* Host, Username, Refresh, State, Reg.Time */
-				var sip_index = parent.sessionData.PLATFORM.isAST_1_6_1 ? 4 : 3;
+				var sip_index = ASTGUI.version.gteq("1.6.1") ? 4 : 3;
 				var state = (ttype === 'sip') ? vals[sip_index] : vals[5];
 				switch(state) {
 				case 'registered':
@@ -1326,6 +1326,70 @@
 		}
 	},
 
+	version: {
+		/* other is greater than sessionData.AsteriskVersion */
+		gt: function (other) {
+			var res = ASTGUI.version.greater_than_equal_to(other);
+			return res != 'equal' && res;
+		},
+
+		/* other is less than sessionData.AsteriskVersion */
+		lt: function (other) {
+			return !ASTGUI.version.greater_than_equal_to(other);
+		},
+
+		/* other is less than or equal to sessionData.AsteriskVersion */
+		lteq: function (other) {
+			var res = ASTGUI.version.greater_than_equal_to(other);
+			return res == 'equal' || !res;
+		},
+
+		/* other is greater than or equal to sessionData.AsteriskVersion */
+		gteq: function (other) {
+			var res = ASTGUI.version.greater_than_equal_to(other);
+			return res == 'equal' || res;
+		},
+
+		/* other is equal to sessionData.AsteriskVersion */
+		eq: function (other) {
+			var res = ASTGUI.version.greater_than_equal_to(other);
+			return res == 'equal';
+		},
+
+		/* This is the meat of the version comparision.  Return false if other is
+		 * greater than sessionData.AsteriskVersion, true if other is less than 
+		 * sessionData.AsteriskVersion, and equal if they are equal. */
+		greater_than_equal_to: function (other) {
+			if (!top.sessionData.AsteriskVersion) { return false; }
+			if (top.sessionData.AsteriskBranch == 'trunk') { return true; }
+			var thisversion = top.sessionData.AsteriskVersion || top.sessionData.AsteriskBranch;
+			var thispieces = thisversion.split('.');
+			var otherpieces = other.split('.');
+			for (var i = 0; i < ((thispieces.length < otherpieces.length) ? thispieces.length : otherpieces.length); i++) {
+				if (thispieces[i] > otherpieces[i]) {
+					return true;
+				} else if (thispieces[i] < otherpieces[i]) {
+					return false;
+				}
+			}
+			while (thispieces[i] || otherpieces[i] || i < 10) {
+					if (thispieces[i] == undefined) {
+						if (otherpieces[i] == undefined) {
+							return "equal";
+						} else {
+							return false;
+						}
+					} else if (otherpieces[i] == undefined) {
+						return true;
+					} else if (thispieces[i] > otherpieces[i]) {
+						return true;
+					}
+				i++;
+			}
+			return "equal";
+		}
+	},
+
 	miscFunctions: {
 		getChunksFromManagerOutput : function( op , usf){
 			// ASTGUI.miscFunctions.getChunksFromManagerOutput( output_str ) ;
@@ -1366,12 +1430,12 @@
 		},
 
 		createConfig : function( fileName, callback){ // ASTGUI.miscFunctions.createConfig( 'filaName', function(){ } ) ;
-			if ( typeof fileName != 'string') callback() ;
-			if( parent.sessionData.PLATFORM.isAST_1_6 ){
+			if (typeof fileName != 'string') callback();
+			if (ASTGUI.version.gteq("1.6.0")) {
 				var s = $.ajax({ url: ASTGUI.paths.rawman+'?action=createconfig&filename='+ fileName , async: false }).responseText;
 				callback();
-			}else{
-				ASTGUI.systemCmd( 'touch ' + top.sessionData.directories.asteriskConfig + fileName, callback );
+			} else {
+				ASTGUI.systemCmd('touch ' + top.sessionData.directories.asteriskConfig + fileName, callback);
 			}
 		},
 
@@ -1434,7 +1498,7 @@
 
 		empty_context: function( ct ){ // ASTGUI.miscFunctions.empty_context({ filename:'somefile.conf', context : 'context_x', cb : fn })
 			try{
-			//if( parent.sessionData.PLATFORM.isAST_1_6 ){
+			//if (ASTGUI.version.gteq("1.6.0")) {
 			//	var u = new listOfSynActions(ct.filename);
 			//	u.new_action('emptycat', ct.context , '', '' ) ;
 			//	u.callActions();
@@ -2958,7 +3022,7 @@
 		var s = top.sessionData.FileCache[params.filename][params.context].content;
 	} else {
 		top.log.ajax("AJAX Request : reading '" +  params.filename + "'");
-		if (!parent.sessionData.PLATFORM.isAST_1_4) {
+		if (top.sessionData.AsteriskVersion && ASTGUI.version.gteq("1.6.0")) {
 			var s = $.ajax({ url: ASTGUI.paths.rawman+'?action=getconfig&filename='+params.filename+'&category='+params.context, async: false }).responseText;
 		} else {
 			var s = $.ajax({ url: ASTGUI.paths.rawman+'?action=getconfig&filename='+params.filename, async: false}).responseText;
@@ -3095,7 +3159,7 @@
 	this.params.action = 'updateconfig';
 	this.params.srcfilename = file;
 	this.params.dstfilename = file;
-	if( !parent.sessionData.PLATFORM.isAST_1_4 ){
+	if (ASTGUI.version.gteq("1.6.0")) {
 		this.FILE_CONTENT = config2json({ filename: file , usf:0 }) ;
 	}
 	this.actionCount = 0;
@@ -3104,7 +3168,7 @@
 listOfSynActions.prototype = {
 	new_action: function(action, cat, name, value, match){
 		var s="";
-		if( !parent.sessionData.PLATFORM.isAST_1_4 && this.FILE_CONTENT != null ){
+		if (ASTGUI.version.gteq("1.6.0") && this.FILE_CONTENT != null ) {
 			// the update/delete/delcat commands fail in Asterisk 1.6.X/trunk if the corresponding category/variables are not found
 			// In Asterisk 1.4 we do not have to do this check
 			switch( action ){
@@ -3146,7 +3210,7 @@
 		this.params = {} ;
 		this.params.action = 'updateconfig';
 		this.params.srcfilename = this.params.dstfilename = fn;
-		if( !parent.sessionData.PLATFORM.isAST_1_4 ){
+		if (ASTGUI.version.gteq("1.6.0")) {
 			this.FILE_CONTENT = config2json({ filename: fn , usf:0 }) ;
 		}
 	},
@@ -3183,7 +3247,7 @@
 	this.actions = {};
 	if(fn){ 
 		this.filename = fn;
-		if( !parent.sessionData.PLATFORM.isAST_1_4 ){
+		if (ASTGUI.version.gteq("1.6.0")) {
 			this.FILE_CONTENT = config2json({ filename: fn , usf:0 }) ;
 		}
 	}
@@ -3192,7 +3256,7 @@
 listOfActions.prototype = {
 	filename: function(fn){
 		this.filename = fn;
-		if( !parent.sessionData.PLATFORM.isAST_1_4 ){
+		if (ASTGUI.version.gteq("1.6.0")) {
 			this.FILE_CONTENT = config2json({ filename: fn , usf:0 }) ;
 		}
 	},
@@ -3201,7 +3265,7 @@
 	},
 	build_action: function(action, count, cat, name, value, match){
 		var s="";
-		if( !parent.sessionData.PLATFORM.isAST_1_4 && this.FILE_CONTENT != null ){
+		if (ASTGUI.version.gteq("1.6.0") && this.FILE_CONTENT != null ) {
 			// the update/delete/delcat commands fail in Asterisk 1.6.X/trunk if the corresponding category/variables are not found
 			// In Asterisk 1.4 we do not have to do this check
 			switch( action ){

Modified: branches/2.0/config/js/backup.js
URL: http://svnview.digium.com/svn/asterisk-gui/branches/2.0/config/js/backup.js?view=diff&rev=5196&r1=5195&r2=5196
==============================================================================
--- branches/2.0/config/js/backup.js (original)
+++ branches/2.0/config/js/backup.js Wed May  4 12:14:11 2011
@@ -3,9 +3,10 @@
  *
  * Backup functions
  *
- * Copyright (C) 2006-2008, Digium, Inc.
+ * Copyright (C) 2006-2011, Digium, Inc.
  *
  * Pari Nannapaneni <pari at digium.com>
+ * Erin Spiceland <espiceland at digium.com>
  *
  * See http://www.asterisk.org for more information about
  * the Asterisk project. Please do not directly contact
@@ -25,8 +26,8 @@
 var upload_Path; // path for 'uploads' as defined in http.conf - this variable will be automatically updated from http.conf
 
 onUploadForm_beforeUploading = function(){
-	if( !parent.sessionData.PLATFORM.isAA50 && !parent.sessionData.PLATFORM.isABE  && top.sessionData.PLATFORM.isAST_1_4 ){
-		alert("File Uploads are supported in Asterisk 1.6.0/trunk");
+	if (!parent.sessionData.PLATFORM.isAA50 && !parent.sessionData.PLATFORM.isABE && ASTGUI.version.lt("1.6.0")) {
+		alert("File Uploads are supported in Asterisk 1.6.0 and higher.");
 		return;
 	}
 	starteduploading = 1;

Modified: branches/2.0/config/js/index.js
URL: http://svnview.digium.com/svn/asterisk-gui/branches/2.0/config/js/index.js?view=diff&rev=5196&r1=5195&r2=5196
==============================================================================
--- branches/2.0/config/js/index.js (original)
+++ branches/2.0/config/js/index.js Wed May  4 12:14:11 2011
@@ -3,9 +3,10 @@
  *
  * Login functions and other misc functions for index.html
  *
- * Copyright (C) 2006-2008, Digium, Inc.
+ * Copyright (C) 2006-2011, Digium, Inc.
  *
  * Pari Nannapaneni <pari at digium.com>
+ * Erin Spiceland <espiceland at digium.com>
  *
  * See http://www.asterisk.org for more information about
  * the Asterisk project. Please do not directly contact
@@ -91,13 +92,12 @@
 
 	detectPlatform: function(resp){
 		sessionData.AsteriskVersionString = resp;
+		onLogInFunctions.parseVersion(resp);
 
 		// logic for platform detection, 
 		if( sessionData.PLATFORM.isAA50 || sessionData.PLATFORM.isABE ){
 			if( sessionData.PLATFORM.isAA50 ){
- 				sessionData.PLATFORM.isOSA = false ;
-				sessionData.PLATFORM.isAST_1_4 = false ;
-				sessionData.PLATFORM.isAST_1_6 = false ;
+				sessionData.PLATFORM.isOSA = false ;
 				sessionData.listOfCodecs = {
 					'ulaw' : 'u-law' ,
 					'alaw' : 'a-law' ,
@@ -113,12 +113,7 @@
 			$('div[page="cli.html"]').empty();
 		}else{
 			var resp_lower = resp.toLowerCase();
-			if ( resp_lower.contains("branches/1.6")  || resp_lower.contains("asterisk/1.6") ||  resp_lower.contains("svn-branch-1.6")
-					||  resp_lower.contains("svn-trunk-") || resp_lower.contains("branches/1.8")  || resp_lower.contains("asterisk/1.8") 
-					||  resp_lower.contains("svn-branch-1.8") ){
-				sessionData.PLATFORM.isAST_1_4 = false ;
-				sessionData.PLATFORM.isAST_1_6 = true ;
-				sessionData.PLATFORM.isAST_1_6_1 = resp_lower.contains('1.6.1') ? true : false;
+			if (ASTGUI.version.gteq("1.6.0")){
 				ASTGUI.globals.sbcid_1 = 's,1,ExecIf($[ "${CALLERID(num)}"="" ]?SetCallerPres(unavailable))';
 				ASTGUI.globals.sbcid_2 = 's,2,ExecIf($[ "${CALLERID(num)}"="" ]?Set(CALLERID(all)=unknown <0000000>))';
 				sessionData.listOfCodecs = { // sessionData.listOfCodecs
@@ -138,9 +133,34 @@
 				};
 
 				/* add video codecs for 1.6 platforms */
-			} else { /* if system is either 1.4 or unknown */
-				sessionData.PLATFORM.isAST_1_4 = true ;
-				sessionData.PLATFORM.isAST_1_6 = false ;
+			}
+		}
+	},
+
+	parseVersion: function(ver) {
+		sessionData.AsteriskVersion = '';
+		sessionData.AsteriskBranch = '';
+		sessionData.AsteriskSVNRevision = 0;
+		if (ver.match(/SVN-(.*)-r(\d+)/i)) {
+			sessionData.AsteriskBranch = RegExp.$1;
+			sessionData.AsteriskSVNRevision = RegExp.$2;
+		}
+		if (ver.match(/SVN-trunk/i)) {
+			sessionData.AsteriskVersion = '1.8';
+		}
+		if (ver.match(/SVN-.*-([\d\.]+)-/i) || (ver.match(/\./) && ver.match(/([\d\.]+)/i))) {
+			sessionData.AsteriskVersion = RegExp.$1;
+		}
+		if (!sessionData.AsteriskBranch && sessionData.AsteriskVersion) {
+			var p = sessionData.AsteriskVersion.split('.');
+			sessionData.AsteriskBranch = p[0];
+			if (p.length > 1){
+				sessionData.AsteriskBranch += '.' + p[1];
+				if (p[0] == 1 && p[1] == 6) {
+					if (p.length > 2){
+						sessionData.AsteriskBranch += '.' + p[2];
+					}
+				}
 			}
 		}
 	},
@@ -200,7 +220,7 @@
 			}
 		}
 
-		if( sessionData.PLATFORM.isAST_1_6 ){ // make sure all the required upload paths are there
+		if (ASTGUI.version.gteq("1.6.0")) { // make sure all the required upload paths are there
 			u.clearActions();
 			var pu = false;
 			if(!http_conf.hasOwnProperty('post_mappings') ){
@@ -231,7 +251,7 @@
 		u.callActions();
 		top.cookies.set( 'rwaccess' , 'yes' );
 
-		if( sessionData.PLATFORM.isAST_1_6 ){
+		if (ASTGUI.version.gteq("1.6.0")) {
 			// make sure originate privilege is defined in asterisk 1.6
 			// This was introduced in Asterisk 1.6 and users upgrading from 1.4 do not have this
 			var tmp_managerUser = top.cookies.get('username') ;
@@ -337,7 +357,7 @@
 				parent.ASTGUI.dialog.waitWhile(' reloading asterisk ... ');
 				var t = ASTGUI.cliCommand('reload') ;
 				setTimeout( function(){ 
-					if( sessionData.PLATFORM.isAST_1_6 ){
+					if (ASTGUI.version.gteq("1.6.0")) {
 						alert('                          Config files updated. '
 							+ '\n' + ' Please stop Asterisk and Start over for the changes to take effect' );
 					}
@@ -685,7 +705,7 @@
 			ASTGUI.updateaValue({ file: ASTGUI.globals.configfile , context :'general', variable :'config_gui_version', value : sessionData.gui_version });
 		}
 		var u = _$('applyChanges_Button');
-		if (sessionData.PLATFORM.isAST_1_4) {
+		if (ASTGUI.version.lt("1.6.0")) {
 			var t = ASTGUI.cliCommand('reload') ;
 		} else {
 			var t = ASTGUI.cliCommand('module reload');
@@ -1139,7 +1159,7 @@
 		 * both commas and pipes aren't supported, such as when
 		 * doing time intervals for includes :-/
 		 * */
-		if (!sessionData.PLATFORM.isAST_1_6) {
+		if (ASTGUI.version.lt("1.6.0")) {
 			top.session.delimiter = '|';
 		}
 	};

Modified: branches/2.0/config/js/menuprompts_upload.js
URL: http://svnview.digium.com/svn/asterisk-gui/branches/2.0/config/js/menuprompts_upload.js?view=diff&rev=5196&r1=5195&r2=5196
==============================================================================
--- branches/2.0/config/js/menuprompts_upload.js (original)
+++ branches/2.0/config/js/menuprompts_upload.js Wed May  4 12:14:11 2011
@@ -3,9 +3,10 @@
  *
  * menuprompts_upload functions
  *
- * Copyright (C) 2006-2008, Digium, Inc.
+ * Copyright (C) 2006-2011, Digium, Inc.
  *
  * Pari Nannapaneni <pari at digium.com>
+ * Erin Spiceland <espiceland at digium.com>
  *
  * See http://www.asterisk.org for more information about
  * the Asterisk project. Please do not directly contact
@@ -54,8 +55,8 @@
 
 
 onUploadForm_beforeUploading = function(){
-	if( !parent.sessionData.PLATFORM.isAA50 && !parent.sessionData.PLATFORM.isABE  && top.sessionData.PLATFORM.isAST_1_4 ){
-		alert("File Uploads are supported in Asterisk 1.6.0/trunk");
+	if(!parent.sessionData.PLATFORM.isAA50 && !parent.sessionData.PLATFORM.isABE && ASTGUI.version.lt("1.6.0")) {
+		alert("File Uploads are supported in Asterisk 1.6.0 and higher.");
 		return;
 	}
 	var tmp_fname = upload_Filename.toLowerCase();

Modified: branches/2.0/config/js/mohfiles.js
URL: http://svnview.digium.com/svn/asterisk-gui/branches/2.0/config/js/mohfiles.js?view=diff&rev=5196&r1=5195&r2=5196
==============================================================================
--- branches/2.0/config/js/mohfiles.js (original)
+++ branches/2.0/config/js/mohfiles.js Wed May  4 12:14:11 2011
@@ -3,9 +3,10 @@
  *
  * mohfiles.html functions
  *
- * Copyright (C) 2006-2008, Digium, Inc.
+ * Copyright (C) 2006-2011, Digium, Inc.
  *
  * Pari Nannapaneni <pari at digium.com>
+ * Erin Spiceland <espiceland at digium.com>
  *
  * See http://www.asterisk.org for more information about
  * the Asterisk project. Please do not directly contact
@@ -34,7 +35,7 @@
 };
 
 var onUploadForm_beforeUploading = function(){
-	if( !parent.sessionData.PLATFORM.isAA50 && !parent.sessionData.PLATFORM.isABE  && top.sessionData.PLATFORM.isAST_1_4 ){
+	if (!parent.sessionData.PLATFORM.isAA50 && !parent.sessionData.PLATFORM.isABE  && ASTGUI.version.lt("1.6.0")) {
 		alert("File Uploads are supported in Asterisk 1.6.0/trunk");
 		return;
 	}

Modified: branches/2.0/config/js/pbx.js
URL: http://svnview.digium.com/svn/asterisk-gui/branches/2.0/config/js/pbx.js?view=diff&rev=5196&r1=5195&r2=5196
==============================================================================
--- branches/2.0/config/js/pbx.js (original)
+++ branches/2.0/config/js/pbx.js Wed May  4 12:14:11 2011
@@ -3,7 +3,7 @@
  *
  * core parsing functions used in index.html
  *
- * Copyright (C) 2006-2010, Digium, Inc.
+ * Copyright (C) 2006-2011, Digium, Inc.
  *
  * Pari Nannapaneni <pari at digium.com>
  * Ryan Brindley <rbrindley at digium.com>
@@ -89,7 +89,7 @@
 					'exten=play_file,n,Playback(${var1})',
 					'exten=play_file,n,Hangup'
 				];
-				if (sessionData.PLATFORM.isAST_1_6) {
+				if (ASTGUI.version.gteq("1.6.0")) {
 					check_For_Contexts[ASTGUI.contexts.guitools][4] = 'exten=record_vmenu,n,Record(${var1},0,500,k)';
 				}
 		

Modified: branches/2.0/config/js/preferences.js
URL: http://svnview.digium.com/svn/asterisk-gui/branches/2.0/config/js/preferences.js?view=diff&rev=5196&r1=5195&r2=5196
==============================================================================
--- branches/2.0/config/js/preferences.js (original)
+++ branches/2.0/config/js/preferences.js Wed May  4 12:14:11 2011
@@ -3,9 +3,10 @@
  *
  * preferences.html functions
  *
- * Copyright (C) 2006-2008, Digium, Inc.
+ * Copyright (C) 2006-2011, Digium, Inc.
  *
  * Pari Nannapaneni <pari at digium.com>
+ * Erin Spiceland <espiceland at digium.com>
  *
  * See http://www.asterisk.org for more information about
  * the Asterisk project. Please do not directly contact
@@ -32,7 +33,7 @@
 
 function localajaxinit(){
 	top.document.title = "General Preferences" ;
-	if( (parent.sessionData.PLATFORM.isAST_1_6 || parent.sessionData.PLATFORM.isAA50 || parent.sessionData.PLATFORM.isABE) && !parent.sessionData.PLATFORM.isAA50_OEM ){
+	if ((ASTGUI.version.gteq("1.6.0") || parent.sessionData.PLATFORM.isAA50 || parent.sessionData.PLATFORM.isABE) && !parent.sessionData.PLATFORM.isAA50_OEM) {
 		$('.16_Only').show();
 		(function(){
 			var c = config2json( { filename: 'phoneprov.conf' , usf: 0 } );
@@ -238,7 +239,7 @@
 		}
 	u.callActions();
 
-	if( (parent.sessionData.PLATFORM.isAST_1_6 || parent.sessionData.PLATFORM.isAA50 || parent.sessionData.PLATFORM.isABE) && !parent.sessionData.PLATFORM.isAA50_OEM ){
+	if ((ASTGUI.version.gteq("1.6.0") || parent.sessionData.PLATFORM.isAA50 || parent.sessionData.PLATFORM.isABE) && !parent.sessionData.PLATFORM.isAA50_OEM) {
 		u.clearActions('phoneprov.conf');
 		u.new_action('delete', 'polycom', 'setvar','', 'IDLEIMAGE_ACTIVE=1' );
 		u.new_action('delete', 'polycom', 'setvar','', 'IDLEIMAGE_ACTIVE=0' );

Modified: branches/2.0/config/welcome.html
URL: http://svnview.digium.com/svn/asterisk-gui/branches/2.0/config/welcome.html?view=diff&rev=5196&r1=5195&r2=5196
==============================================================================
--- branches/2.0/config/welcome.html (original)
+++ branches/2.0/config/welcome.html Wed May  4 12:14:11 2011
@@ -3,9 +3,10 @@
  *
  * System status
  *
- * Copyright (C) 2008, Digium, Inc.
+ * Copyright (C) 2008-2011, Digium, Inc.
  *
  * Ryan Brindley <rbrindley at digium.com>
+ * Erin Spiceland <espiceland at digium.com>
  *
  * See http://www.asterisk.org for more information about
  * the Asterisk project. Please do not directly contact
@@ -572,11 +573,11 @@
 	
 	/* set vars that determine which name to use for manager events */
 	mgr.newchannel = {};
-	mgr.newchannel.channelstate = (top.sessionData.PLATFORM.isAST_1_6) ? 'channelstatedesc' : 'state';
+	mgr.newchannel.channelstate = ASTGUI.version.gteq("1.6.0") ? 'channelstatedesc' : 'state';
 	mgr.newcallerid = {};
-	mgr.newcallerid.calleridnum = (top.sessionData.PLATFORM.isAST_1_6) ? 'calleridnum' : 'callerid';
+	mgr.newcallerid.calleridnum = ASTGUI.version.gteq("1.6.0") ? 'calleridnum' : 'callerid';
 	mgr.newstate = {};
-	mgr.newstate.channelstate = (top.sessionData.PLATFORM.isAST_1_6) ? 'channelstatedesc' : 'state';
+	mgr.newstate.channelstate = ASTGUI.version.gteq("1.6.0") ? 'channelstatedesc' : 'state';
 
 	manager_events.watch();
 




More information about the asterisk-gui-commits mailing list