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

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Mon Mar 30 08:55:48 CDT 2009


Author: rbrindley
Date: Mon Mar 30 08:55:45 2009
New Revision: 4674

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

- added pbx.trunks.rules.remove


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

Modified: team/rbrindley/astman_revamp/config/js/pbx2.js
URL: http://svn.digium.com/svn-view/asterisk-gui/team/rbrindley/astman_revamp/config/js/pbx2.js?view=diff&rev=4674&r1=4673&r2=4674
==============================================================================
--- team/rbrindley/astman_revamp/config/js/pbx2.js (original)
+++ team/rbrindley/astman_revamp/config/js/pbx2.js Mon Mar 30 08:55:45 2009
@@ -1661,6 +1661,45 @@
 
 	return true;
 };
+
+/**
+ * Delete a Incoming Rule.
+ * @param cxt The rule context.
+ * @param line The actual line context.
+ * @return boolen of success.
+ */
+pbx.trunks.rules.remove = function(params) {
+	if (!params) {
+		top.log.error('pbx.trunks.rules.remove: params is empty.');
+		return false;
+	} else if (!params.cxt) {
+		top.log.error('pbx.trunks.rules.remove: params.cxt is empty.');
+		return false;
+	} else if (!params.line) {
+		top.log.error('pbx.trunks.rules.remove: params.line is empty.');
+		return false;
+	}
+
+	if (params.line.afterChar('=').beginsWith('s,')) {
+		ASTGUI.miscFunctions.delete_LinesLike({
+			beginsWithArr: ['exten=s,'],
+			context_name: params.cxt,
+			filename: 'extensions.conf',
+			cb: {}
+		});
+	} else {
+		var actions = listOfSynActions('extensions.conf');
+		actions.new_action('delete', params.cxt, params.line.beforeChar('='), '', params.line.afterChar('='));
+
+		var resp = actions.callActions();
+		if (!resp.contains('Response: Success')) {
+			top.log.error('pbx.trunks.rules.remove: Error removing from extensions.conf.');
+			return false;
+		}
+	}
+
+	return true;
+};
 /*---------------------------------------------------------------------------*/
 
 /*---------------------------------------------------------------------------*/




More information about the asterisk-gui-commits mailing list