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

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Wed Mar 11 09:03:26 CDT 2009


Author: rbrindley
Date: Wed Mar 11 09:03:23 2009
New Revision: 4605

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

- copied astgui_manageQueues.loadQueues to pbx.queues.load


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=4605&r1=4604&r2=4605
==============================================================================
--- team/rbrindley/astman_revamp/config/js/pbx2.js (original)
+++ team/rbrindley/astman_revamp/config/js/pbx2.js Wed Mar 11 09:03:23 2009
@@ -278,10 +278,51 @@
  */
 pbx.paging = {};
 
+/*---------------------------------------------------------------------------*/
 /**
  * Queues object.
  */
 pbx.queues = {};
+
+/**
+ * Load Queues.
+ * @return boolean of success.
+ */
+pbx.queues.load = function() {
+	var cxt = context2json({ filename: 'extensions.conf', context: ASTGUI.contexts.QUEUES, usf:o});
+	if (cxt === null) {
+		top.log.info('pbx.queues.load: context not found, lets create it!');
+		var ext_conf = new listofSynActions('extensions.conf');
+		ext_conf.new_action('newcat', ASTGUI.contexts.QUEUES, '', '');
+
+		var resp = ext_conf.callActions();
+		if (!resp.contains('Response: Success')) {
+			top.log.error('pbx.queues.load: error updating extensions.conf');
+			return false;
+		}
+
+		cxt = [];
+		return true;
+	}
+
+	cxt.each(function(line) {
+		if (!line.beginsWith('exten=')) {
+			continue;
+		}
+
+		var exten = ASTGUI.parseContextLine.getExten(line);
+		var config = line.afterChar('=');
+
+		if (!sessionData.pbxinfo.queues.hasOwnProperty(exten)) {
+			sessionData.pbxinfo.queues[exten] = new ASTGUI.customObject;
+		}
+
+		sessionData.pbxinfo.queues[exten]['configLine'] = config;
+	});
+
+	return true;
+};
+/*---------------------------------------------------------------------------*/
 
 /**
  * Ring Groups object.




More information about the asterisk-gui-commits mailing list