rbrindley: branch 2.0 r4661 - /branches/2.0/config/js/pbx2.js

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Wed Mar 25 12:25:33 CDT 2009


Author: rbrindley
Date: Wed Mar 25 12:25:30 2009
New Revision: 4661

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

- adding of the useful comments. kthxbai


Modified:
    branches/2.0/config/js/pbx2.js

Modified: branches/2.0/config/js/pbx2.js
URL: http://svn.digium.com/svn-view/asterisk-gui/branches/2.0/config/js/pbx2.js?view=diff&rev=4661&r1=4660&r2=4661
==============================================================================
--- branches/2.0/config/js/pbx2.js (original)
+++ branches/2.0/config/js/pbx2.js Wed Mar 25 12:25:30 2009
@@ -39,6 +39,7 @@
  * @return boolean of success
  */
 pbx.calling_rules.add = function(name, dp) {
+	/* lets make sure we get all the necessary args */
 	if (!name) {
 		top.log.warn('pbx.calling_rules.add: name is not defined');
 		return false;
@@ -47,29 +48,32 @@
 		return false;
 	}
 
+	/* lets make sure that the name begins with the prefix */
 	if (!name.beginsWith(ASTGUI.contexts.CallingRulePrefix)) {
 		name = ASTGUI.contexts.CallingRulePrefix + name;
 	}
 
+	/* chop chop! */
 	dp = dp.lChop('exten=');
 
+	/* add actions to update extensions.conf */
 	var ext_conf = new listOfSynActions('extensions.conf');
-
 	if (!sessionData.pbxinfo.callingRules.hasOwnProperty(name)) {
 		ext_conf.new_action('delcat', name, '', ''); /* for good measure :) */
 		ext_conf.new_action('newcat', name, '', '');
 		sessionData.pbxinfo.callingRules[name] = [];
 	}
-
 	ext_conf.new_action('append', name, 'exten', dp);
+	
+	/* update extensions.conf */
 	var resp = ext_conf.callActions();
-
 	if (!resp.contains('Response: Success')) {
 		top.log.error('pbx.calling_rules.add: error adding ' + name + ' to extensions.conf');
 		top.log.error(resp);
 		return false;
 	}
 
+	/* now update cache and go! */
 	sessionData.pbxinfo.callingRules[name].push('exten=' + dp);
 	return true;
 };




More information about the asterisk-gui-commits mailing list