[Freeswitch-svn] [commit] r10963 - freeswitch/trunk/libs/esl

FreeSWITCH SVN mikej at freeswitch.org
Fri Dec 26 13:10:40 PST 2008


Author: mikej
Date: Fri Dec 26 16:10:40 2008
New Revision: 10963

Log:
fix command line args when config file present

Modified:
   freeswitch/trunk/libs/esl/fs_cli.c

Modified: freeswitch/trunk/libs/esl/fs_cli.c
==============================================================================
--- freeswitch/trunk/libs/esl/fs_cli.c	(original)
+++ freeswitch/trunk/libs/esl/fs_cli.c	Fri Dec 26 16:10:40 2008
@@ -365,16 +365,6 @@
 		}
 		esl_config_close_file(&cfg);
 	}
-
-	if (argv_host) {
-		esl_set_string(profiles[cur].host, temp_host);
-	}
-	if (argv_port) {
-		profiles[cur].port = (esl_port_t)temp_port;
-	}
-	if (argv_pass) {
-		esl_set_string(profiles[cur].pass, temp_pass);
-	}
 	
 	if (optind < argc) {
 		if (get_profile(argv[optind], &profile)) {
@@ -388,10 +378,20 @@
 		}
 	}
 	
+	if (argv_host) {
+		esl_set_string(profile->host, temp_host);
+	}
+	if (argv_port) {
+		profile->port = (esl_port_t)temp_port;
+	}
+	if (argv_pass) {
+		esl_set_string(profile->pass, temp_pass);
+	}
+
 	esl_log(ESL_LOG_INFO, "Using profile %s [%s]\n", profile->name, profile->host);
 	
 	if (argv_host) {
-		snprintf(prompt_str, sizeof(prompt_str), "freeswitch@%s> ", profile->host);
+		snprintf(prompt_str, sizeof(prompt_str), "freeswitch@%s@%s> ", profile->host, profile->name);
 	} else {
 		snprintf(prompt_str, sizeof(prompt_str), "freeswitch@%s> ", profile->name);
 	}



More information about the Freeswitch-svn mailing list