pari: branch asterisknow r1920 - /branches/asterisknow/config/digital.html

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Thu Dec 6 12:42:56 CST 2007


Author: pari
Date: Thu Dec  6 12:42:55 2007
New Revision: 1920

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=1920
Log:
fixing URI too long when updating stuff in extensions.conf

Modified:
    branches/asterisknow/config/digital.html

Modified: branches/asterisknow/config/digital.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/digital.html?view=diff&rev=1920&r1=1919&r2=1920
==============================================================================
--- branches/asterisknow/config/digital.html (original)
+++ branches/asterisknow/config/digital.html Thu Dec  6 12:42:55 2007
@@ -610,12 +610,15 @@
 		/* update the users.conf to make sure there are corresponding [SPAN_x] contexts are updated */
 		
 		var uri1 = [];
-		var uri2 = '';
+		var uri2 = [];
 		var add_lines = function(){
 			// for each span update span with new values of 'switchtype', 'singalling'
-			var c = 0, d ='', e ='', f=0, uri = '';
+			var c = 0, d ='', e ='', f=0, uri = '', vri='';
 			for( var k in SPANS ){ if( SPANS.hasOwnProperty(k) ){ if(SPANS[k]['signalling']){
-				uri = '', c=0;
+				uri = ''; c = 0 ; vri = ''; f = 0 ;
+				NEWGROUPNUMBER = GROUPS.firstAvailable() ;
+				GROUPS.push(NEWGROUPNUMBER);
+
 				d = 'span_'+ String(k);
 				e = asterisk_guiTDPrefix + d ;
 				uri += build_action('delcat', c, d , "", ""); c++;
@@ -626,32 +629,39 @@
 				uri += build_action('update', c, d , "trunkstyle", 'digital'); c++;
 				uri += build_action('update', c, d , "hassip", 'no'); c++;
 				uri += build_action('update', c, d , "hasiax", 'no'); c++;
-				NEWGROUPNUMBER = GROUPS.firstAvailable() ;
 				uri += build_action('update', c, d , "group", NEWGROUPNUMBER ); c++;
-				GROUPS.push(NEWGROUPNUMBER);
-
 				if ( !SPANS[k]['signalling'].beginsWith('fxo') ){ // we donot want context to be set for user stations
 					uri += build_action('update', c, d , "context", e); c++;
 				}
-
 				uri += build_action('update', c, d , "zapchan", SPANS[k]['zapchanstring'] ); c++;
-				uri2 += build_action('delete', f, 'globals', d, "", ""); f++;
-				uri2 += build_action('update', f, 'globals', d,'Zap/g'+String(NEWGROUPNUMBER)); f++;
-				uri2 += build_action('delcat', f, e , "", ""); f++;
-				uri2 += build_action('newcat', f, e , "", ""); f++;
-				uri2 += build_action('update', f, e , 'include', 'default'); f++;
+
+				vri += build_action('delete', f, 'globals', d, "", ""); f++;
+				vri += build_action('update', f, 'globals', d,'Zap/g'+String(NEWGROUPNUMBER)); f++;
+				vri += build_action('delcat', f, e , "", ""); f++;
+				vri += build_action('newcat', f, e , "", ""); f++;
+				vri += build_action('update', f, e , 'include', 'default'); f++;
 
 				uri1.push(uri);
+				uri2.push(vri);
 			}}}
 		}();
+
+		var somethingelse = function(){
+			if(uri2.length){
+				makerequest('u', "extensions.conf", uri2.shift() , function(t){ somethingelse(); } );
+			}else{
+				applySettings.generate_zaptel();
+			}
+		};
 
 		var something = function(){
 			if(uri1.length){
 				makerequest('u', "users.conf", uri1.shift() , function(t) { something(); } );
 			}else{
-				makerequest('u', "extensions.conf", uri2 , function(t) { applySettings.generate_zaptel(); });
+				somethingelse();
 			}
 		};
+
 		something();
 	},
 




More information about the asterisk-gui-commits mailing list