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

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


Author: rbrindley
Date: Wed Mar 11 08:07:08 2009
New Revision: 4599

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

- optimized by looping through trunk_types instead of coding if else for each


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=4599&r1=4598&r2=4599
==============================================================================
--- team/rbrindley/astman_revamp/config/js/pbx2.js (original)
+++ team/rbrindley/astman_revamp/config/js/pbx2.js Wed Mar 11 08:07:08 2009
@@ -525,18 +525,9 @@
 	actions.callActions();
 
 	try {
-		if (sessionData.pbxinfo['trunks']['analog'][trunk]) {
-			delete sessionData.pbxinfo['trunks']['analog'][trunk];
-		} else if (sessionData.pbxinfo['trunks']['sip'][trunk]) {
-			delete sessionData.pbxinfo['trunks']['sip'][trunk];
-		} else if (sessionData.pbxinfo['trunks']['iax'][trunk]) {
-			delete sessionData.pbxinfo['trunks']['iax'][trunk];
-		} else if (sessionData.pbxinfo['trunks']['pri'][trunk]) {
-			delete sessionData.pbxinfo['trunks']['pri'][trunk];
-		} else if (sessionData.pbxinfo['trunks']['providers'][trunk]) {
-			delete sessionData.pbxinfo['trunks']['providers'][trunk];
-		}
-
+		for (var i=0; i<this.trunk_types.length; i++) {
+			delete sessionData.pbxinfo.trunks[this.trunk_types[i]][trunk];
+		}
 	} catch(err) {
 		top.log.error(err);
 		return false;




More information about the asterisk-gui-commits mailing list