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

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Mon Mar 9 17:10:06 CDT 2009


Author: rbrindley
Date: Mon Mar  9 17:10:03 2009
New Revision: 4593

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

- copied astgui_manageConferences.loadMeetMeRooms to pbx.conferences.load
- copied astgui_manageConferences.getList to pbx.conferences.get


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=4593&r1=4592&r2=4593
==============================================================================
--- team/rbrindley/astman_revamp/config/js/pbx2.js (original)
+++ team/rbrindley/astman_revamp/config/js/pbx2.js Mon Mar  9 17:10:03 2009
@@ -35,10 +35,98 @@
  */
 pbx.calling_rules_out = {};
 
+/*---------------------------------------------------------------------------*/
 /**
  * Conferences object.
  */
 pbx.conferences = {};
+
+/**
+ * Get a list of rooms.
+ * @return array of conference rooms
+ */
+pbx.conferences.get = function() {
+	if (!sessionData.pbxinfo.hasOwnProperty('conferences')) {
+		return [];
+	}
+
+	var confs = [];
+	for (var conf in sessionData.pbxinfo.conferences) {
+		if (!sessionData.pbxinfo.conferences.hasOwnProperty(conf)) {
+			continue;
+		}
+
+		confs.push(conf);
+	}
+
+	return confs;
+};
+
+/**
+ * Load the Rooms.
+ */
+pbx.conferences.load = function() {
+	var cxt = context2json({ filename: 'extensions.conf', context: ASTGUI.contexts.CONFERENCES, usf: 0});
+
+	if (cxt === null) {
+		var actions = new listOfSynActions('extensions.conf');
+		actions.new_action('newcat', ASTGUI.contexts.CONFERENCES, '', '');
+		actions.callActions();
+		cxt = [];
+	}
+	cxt.each( function(line) {
+		if (!line.beginsWith('exten=')) {
+			return;
+		}
+
+		var exten = ASTGUI.parseContextLine.getExten(line);
+		var options = line.afterChar('=');
+		var params = options.betweenXY('|',')');
+		
+		if (params.contains('a') && params.contains('A')) [
+			exten = ASTGUI.parseContextLine.getArgs(line)[0];
+		}
+
+		if (!sessionData.pbxinfo.conferences.hasOwnProperty(exten)) {
+			sessionData.pbxinfo.conferences[exten] = new ASTGUI.customObject;
+			sessionData.pbxinfo.conferences[exten]['configOptions'] = '';
+			sessionData.pbxinfo.conferences[exten]['adminOptions'] = '';
+			sessionData.pbxinfo.conferences[exten]['pwdString'] = '';
+		}
+
+		if (params.contains('a') && params.contains('A')) {
+			sessionData.pbxinfo.conferences[exten]['adminOptions'] = options;
+		} else {
+			sessionData.pbxinfo.conferences[exten]['configOptions'] = options;
+		}
+	});
+
+	var pwds = context2json({ filename: 'meetme.conf', context: 'rooms', usf:0});
+
+	if (pwds === null) {
+		var actions = new listofSynActions('meetme.conf');
+		actions.new_action('newcat', 'rooms', '', '');
+		actions.callActions();
+		pwds = [];
+	}
+
+	pwds.each(function(line) {
+		if (!line.beginsWith('conf=')) {
+			return;
+		}
+
+		var name = line.betweenXY('=',',');
+		name = name.trim();
+
+		if(!sessionData.pbxinfo.hasOwnProperty(name)) {
+			sessionData.pbxinfo.conferences[name] = new ASTGUI.customObject;
+			sessionData.pbxinfo.conferences[name]['configOptions'] = '';
+		}
+
+		sessionData.pbxinfo.conferences[name]['pwdString'] = line.afterChar('=');
+	});
+};
+/*---------------------------------------------------------------------------*/
 
 /**
  * Dial Plans object.




More information about the asterisk-gui-commits mailing list