Allow manager.conf to use port and portno, but log that portno is deprecated.
authorJames Golovich <james@gnuinter.net>
Mon, 5 Apr 2004 19:40:30 +0000 (19:40 +0000)
committerJames Golovich <james@gnuinter.net>
Mon, 5 Apr 2004 19:40:30 +0000 (19:40 +0000)
(bug 1343)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2627 65c4cc65-6c06-0410-ace0-fbb531ad65f3

manager.c

index cbd641c..b46685e 100755 (executable)
--- a/manager.c
+++ b/manager.c
@@ -976,11 +976,17 @@ int init_manager(void)
        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;