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

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Fri Mar 13 23:04:14 CDT 2009


Author: rbrindley
Date: Fri Mar 13 23:04:09 2009
New Revision: 4639

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

- copied astgui_manageRingGroups.deleteRg to pbx.ring_groups.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=4639&r1=4638&r2=4639
==============================================================================
--- team/rbrindley/astman_revamp/config/js/pbx2.js (original)
+++ team/rbrindley/astman_revamp/config/js/pbx2.js Fri Mar 13 23:04:09 2009
@@ -484,6 +484,34 @@
 	}
 
 	return ASTGUI.contexts.RingGroupPrefix + x.firstAvailable();
+};
+
+/**
+ * Delete a ring group.
+ * @param name Name of Ring Group.
+ * @return boolean on success.
+ */
+pbx.ring_groups.remove = function(name) {
+	var actions = new listOfSynActions('extensions.conf');
+	actions.new_action('delcat', name, '', '');
+
+	if (sessionData.pbxinfo.ringgroups[name].extension) {
+		var exten = sessionData.pbxinfo.ringgroups[name].extension;
+		actions.new_action('delete', ASTGUI.contexts.RingGroupExtensions, 'exten', '', exten + ',1,Goto(' + name + ',s,1)');
+
+		if (sessionData.pbxinfo.ringgroups[name].hasOwnProperty('isOLDRG') && sessionData.pbxinfo.ringgroups[name].isOLDRG === true) {
+			actions.new_action('delete', 'default', 'exten', '', exten + ',1,Goto(' + name + '|s|1)');
+		}
+	}
+
+	var resp = actions.callActions();
+	if (!resp.contains('Response: Success')) {
+		top.log.error('pbx.ring_groups.remove: error updating extensions.conf');
+		return false;
+	}
+
+	delete sessionData.pbxinfo.ringgroups[name];
+	return true;
 };
 /*---------------------------------------------------------------------------*/
 




More information about the asterisk-gui-commits mailing list