rbrindley: branch 2.0 r4951 - in /branches/2.0/config/js: pbx.js pbx2.js

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Mon Jun 29 18:48:13 CDT 2009


Author: rbrindley
Date: Mon Jun 29 18:48:10 2009
New Revision: 4951

URL: http://svn.asterisk.org/svn-view/asterisk-gui?view=rev&rev=4951
Log:

- 'type=peer' now added to pbx.users.{add|edit}
- added an onload checker if a user doesn't have a type attribute, it gives it
  one


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

Modified: branches/2.0/config/js/pbx.js
URL: http://svn.asterisk.org/svn-view/asterisk-gui/branches/2.0/config/js/pbx.js?view=diff&rev=4951&r1=4950&r2=4951
==============================================================================
--- branches/2.0/config/js/pbx.js (original)
+++ branches/2.0/config/js/pbx.js Mon Jun 29 18:48:10 2009
@@ -569,6 +569,9 @@
 					users_conf.new_action('delete', d, 'zapchan', '');
 					users_conf.new_action('append', d, 'dahdichan', c[d]['zapchan']);
 				}
+				if (!c[d].hasOwnProperty('type')) {
+					users_conf.new_action('append', d, 'type', 'peer');
+				}
 				sessionData.pbxinfo['users'][d] = c[d];
 				continue;
 			}

Modified: branches/2.0/config/js/pbx2.js
URL: http://svn.asterisk.org/svn-view/asterisk-gui/branches/2.0/config/js/pbx2.js?view=diff&rev=4951&r1=4950&r2=4951
==============================================================================
--- branches/2.0/config/js/pbx2.js (original)
+++ branches/2.0/config/js/pbx2.js Mon Jun 29 18:48:10 2009
@@ -1836,6 +1836,7 @@
 	sessionData.pbxinfo['users'][exten]['allow'] = allow;
 	sessionData.pbxinfo['users'][exten]['mailbox'] = info.mailbox || exten;
 	sessionData.pbxinfo['users'][exten]['call-limit'] = '100';
+	sessionData.pbxinfo['users'][exten]['type'] = 'peer';
 
 	delete info.disallow;
 	delete info.allow;
@@ -1850,6 +1851,7 @@
 	x.new_action('append', exten, 'allow', allow);
 	x.new_action('append', exten, 'mailbox', info.mailbox || exten);
 	x.new_action('append', exten, 'call-limit', '100');
+	x.new_action('append', exten, 'type', 'peer');
 
 	if (info.mailbox) {
 		delete info.mailbox;
@@ -1878,6 +1880,9 @@
 		top.log.debug('pbx.users.edit: User not found, exiting.');
 		return false;
 	}
+
+	/* ast 1.6.1 now requires type=peer, there should be no harm in adding it to all vers of ast */
+	info.type = 'peer';
 
 	for (var prop in info) {
 		if (info.hasOwnProperty(prop)) {




More information about the asterisk-gui-commits mailing list