pari: branch 2.0 r3820 - /branches/2.0/config/trunks_providers.html

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Mon Sep 15 15:06:12 CDT 2008


Author: pari
Date: Mon Sep 15 15:06:12 2008
New Revision: 3820

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

create providers.conf if file not found


Modified:
    branches/2.0/config/trunks_providers.html

Modified: branches/2.0/config/trunks_providers.html
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/trunks_providers.html?view=diff&rev=3820&r1=3819&r2=3820
==============================================================================
--- branches/2.0/config/trunks_providers.html (original)
+++ branches/2.0/config/trunks_providers.html Mon Sep 15 15:06:12 2008
@@ -69,12 +69,18 @@
 	})();
 
 	(function(){
-		PROVIDERS = config2json({ filename:'providers.conf', usf:1 });
-
-		for (var this_provider in PROVIDERS ){ if(PROVIDERS.hasOwnProperty(this_provider) ){
-			ASTGUI.selectbox.append('new_SP_Provider', PROVIDERS[this_provider].providername ||  this_provider , this_provider );
-		}}
+		var tmp_providers_conf = $.ajax({ url: ASTGUI.paths.rawman+'?action=getconfig&filename=providers.conf', async: false }).responseText;
+		var tmp_providers_conf_lower = tmp_providers_conf.toLowerCase();
+		if( tmp_providers_conf_lower.contains('response: error') && tmp_providers_conf_lower.contains('message: config file not found') ){
+			ASTGUI.miscFunctions.createConfig( 'providers.conf', function(){ window.location.reload(); } ) ;
+			return;
+		}
+		PROVIDERS = config2json({ configFile_output: tmp_providers_conf, usf : 1 });
 	})();
+
+	for (var this_provider in PROVIDERS ){ if(PROVIDERS.hasOwnProperty(this_provider) ){
+		ASTGUI.selectbox.append('new_SP_Provider', PROVIDERS[this_provider].providername ||  this_provider , this_provider );
+	}}
 
 	$('#new_SP_Provider').click( function(){
 		var selectedProvider = this.options[this.selectedIndex].value ;




More information about the asterisk-gui-commits mailing list