pari: branch 2.0 r4279 - /branches/2.0/config/js/astman.js

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Wed Dec 3 18:47:52 CST 2008


Author: pari
Date: Wed Dec  3 18:47:52 2008
New Revision: 4279

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

 Array.removeLast() // == .pop()

 And Fix for AA50-2287 - AA50 fails to access GUI properly after upgrade to 1.2 firmware



Modified:
    branches/2.0/config/js/astman.js

Modified: branches/2.0/config/js/astman.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/astman.js?view=diff&rev=4279&r1=4278&r2=4279
==============================================================================
--- branches/2.0/config/js/astman.js (original)
+++ branches/2.0/config/js/astman.js Wed Dec  3 18:47:52 2008
@@ -94,6 +94,10 @@
 
 	Array.prototype.removeFirst = function(){ // opposite of push - removes the first element of the array
 		this.splice(0,1);
+	};
+
+	Array.prototype.removeLast = function(){ // removes the last element of the array
+		this.pop();
 	};
 	
 	if(!Array.indexOf){
@@ -1823,14 +1827,11 @@
 
 		parseTrunkDialArgument: function(y){ // usage ASTGUI.parseContextLine.parseTrunkDialArgument(y)
 			// expects y as  '${trunk_1}/XXX${EXTEN:X}' OR SIP/user/XXX${EXTEN:X}
-			if (typeof y != 'string') {
+			if( !y || typeof y != 'string') {
 				ASTGUI.Log.Error('ASTGUI.parseContextLine.parseTrunkDialArgument: expecting y as string');
-				return null;
+				return { name : '', channel : '', prepend : '', stripx : '' };
 			}
 			var WhatToDial = '';
-			if (!y) {
-				return null;
-			}
 			y = y.trim();
 			if( y.beginsWith('${') && y.afterChar('}').beginsWith('/') ) {
 				var trunkname = y.betweenXY('{' , '}');
@@ -1855,7 +1856,7 @@
 				if(!WhatToDial.contains('${EXTEN')){ // if WhatToDial is in some other format that the gui does not understand
 					// TODO : replace the above if condition with a regular expression to check for the acceptable formats
 					// TODO : THROW ERROR
-					return null;
+					return {name : trunkname, channel : channel, prepend : WhatToDial, stripx : ''};
 				}
 				var prepend = WhatToDial.beforeChar('$') ;
 				var extenString = WhatToDial.betweenXY('{','}') ;




More information about the asterisk-gui-commits mailing list