[Asterisk-cvs] asterisk manager.c,1.37.2.4,1.37.2.5

citats at lists.digium.com citats at lists.digium.com
Mon Apr 5 15:40:32 CDT 2004


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/home/citats/cvs/asterisk-stable

Modified Files:
      Tag: v1-0_stable
	manager.c 
Log Message:
Allow manager.conf to use port and portno, but log that portno is deprecated.
(bug 1343)



Index: manager.c
===================================================================
RCS file: /usr/cvsroot/asterisk/manager.c,v
retrieving revision 1.37.2.4
retrieving revision 1.37.2.5
diff -u -d -r1.37.2.4 -r1.37.2.5
--- manager.c	9 Mar 2004 20:02:22 -0000	1.37.2.4
+++ manager.c	5 Apr 2004 19:40:40 -0000	1.37.2.5
@@ -976,11 +976,17 @@
 	if(val)
 		block_sockets = ast_true(val);
 
-	if ((val = ast_variable_retrieve(cfg, "general", "portno"))) {
+	if ((val = ast_variable_retrieve(cfg, "general", "port"))) {
+		if (sscanf(val, "%d", &portno) != 1) {
+			ast_log(LOG_WARNING, "Invalid port number '%s'\n", val);
+			portno = DEFAULT_MANAGER_PORT;
+		}
+	} else if ((val = ast_variable_retrieve(cfg, "general", "portno"))) {
 		if (sscanf(val, "%d", &portno) != 1) {
 			ast_log(LOG_WARNING, "Invalid port number '%s'\n", val);
 			portno = DEFAULT_MANAGER_PORT;
 		}
+		ast_log(LOG_NOTICE, "Use of portno in manager.conf deprecated.  Please use 'port=%s' instead.\n", val);
 	}
 	
 	ba.sin_family = AF_INET;




More information about the svn-commits mailing list