rbrindley: branch rbrindley/astman_revamp r4675 - /team/rbrindley/astman_reva...

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Mon Mar 30 09:03:45 CDT 2009


Author: rbrindley
Date: Mon Mar 30 09:03:42 2009
New Revision: 4675

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

- incoming.js now uss pbx.trunks.rules.remove


Modified:
    team/rbrindley/astman_revamp/config/js/incoming.js

Modified: team/rbrindley/astman_revamp/config/js/incoming.js
URL: http://svn.digium.com/svn-view/asterisk-gui/team/rbrindley/astman_revamp/config/js/incoming.js?view=diff&rev=4675&r1=4674&r2=4675
==============================================================================
--- team/rbrindley/astman_revamp/config/js/incoming.js (original)
+++ team/rbrindley/astman_revamp/config/js/incoming.js Mon Mar 30 09:03:42 2009
@@ -101,19 +101,24 @@
 		var TMP_CONTEXT = ALC.split(STRING_SEPERATOR)[1] ;
 		var TMP_LINE = ALC.split(STRING_SEPERATOR)[0] ;
 
-		if( TMP_LINE.afterChar('=').beginsWith('s,') ){
-			ASTGUI.miscFunctions.delete_LinesLike({ context_name : TMP_CONTEXT, beginsWithArr: ['exten=s,'] , filename: 'extensions.conf', cb: function(){
-				ASTGUI.feedback( { msg: 'deleted Incoming Rule !', showfor: 2 , color: 'blue', bgcolor: '#FFFFFF' } );
-				window.location.reload();
-			}});
-		}else{
-			var H = new listOfSynActions('extensions.conf') ;
-			H.new_action( 'delete', TMP_CONTEXT , TMP_LINE.beforeChar('=') , '' , TMP_LINE.afterChar('=') ) ;
-			H.callActions();
-			
-			ASTGUI.feedback( { msg: 'deleted Incoming Rule !', showfor: 2 , color: 'blue', bgcolor: '#FFFFFF' } );
-			window.location.reload();
-		}
+		var resp = top.pbx.trunks.rules.remove({cxt: TMP_CONTEXT, line: TMP_LINE});
+		if (!resp) {
+			ASTGUI.feedback({ 
+				color: 'red',
+				msg: 'Error removing Calling Rule.',
+				showfor: 2
+			});
+
+			return;
+		}
+
+		ASTGUI.feedback({ 
+			color: 'green',
+			msg: 'Deleted Incoming Rule.',
+			showfor: 2
+		});
+
+		return;
 	},
 
 	listAllRulesInTable : function(){ // incomingRules_MiscFunctions.listAllRulesInTable();




More information about the asterisk-gui-commits mailing list