[asterisk-commits] bbryant: branch 1.4 r284777 - /branches/1.4/main/manager.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Sep 2 15:25:07 CDT 2010
Author: bbryant
Date: Thu Sep 2 15:25:03 2010
New Revision: 284777
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=284777
Log:
Fixes a bug in manager.c where the default configuration values weren't reset when the manager configuration was reloaded.
(closes issue #17917)
Reported by: lmadsen
Review: https://reviewboard.asterisk.org/r/883/
Modified:
branches/1.4/main/manager.c
Modified: branches/1.4/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/main/manager.c?view=diff&rev=284777&r1=284776&r2=284777
==============================================================================
--- branches/1.4/main/manager.c (original)
+++ branches/1.4/main/manager.c Thu Sep 2 15:25:03 2010
@@ -97,13 +97,22 @@
char eventdata[1];
};
+static const int DEFAULT_ENABLED = 0; /*!< Default setting for manager to be enabled */
+static const int DEFAULT_WEBENABLED = 0; /*!< Default setting for the web interface to be enabled */
+static const int DEFAULT_BLOCKSOCKETS = 0; /*!< Default setting for block-sockets */
+static const int DEFAULT_DISPLAYCONNECTS = 1; /*!< Default setting for displaying manager connections */
+static const int DEFAULT_TIMESTAMPEVENTS = 0; /*!< Default setting for timestampevents */
+static const int DEFAULT_HTTPTIMEOUT = 60; /*!< Default manager http timeout */
+static const int DEFAULT_BROKENEVENTSACTION = 0; /*!< Default setting for brokeneventsaction */
+
+
static int enabled;
static int portno = DEFAULT_MANAGER_PORT;
static int asock = -1;
-static int displayconnects = 1;
+static int displayconnects;
static int timestampevents;
-static int httptimeout = 60;
-static int broken_events_action = 0;
+static int httptimeout;
+static int broken_events_action;
static pthread_t t;
static int block_sockets;
@@ -3053,8 +3062,8 @@
static struct sockaddr_in ba;
int x = 1;
int flags;
- int webenabled = 0;
- int newhttptimeout = 60;
+ int webenabled = DEFAULT_WEBENABLED;
+ int newhttptimeout = DEFAULT_HTTPTIMEOUT;
struct ast_manager_user *user = NULL;
if (!registered) {
@@ -3085,9 +3094,14 @@
/* Append placeholder event so master_eventq never runs dry */
append_event("Event: Placeholder\r\n\r\n", 0);
}
+
portno = DEFAULT_MANAGER_PORT;
- displayconnects = 1;
- broken_events_action = 0;
+ displayconnects = DEFAULT_DISPLAYCONNECTS;
+ broken_events_action = DEFAULT_BROKENEVENTSACTION;
+ block_sockets = DEFAULT_BLOCKSOCKETS;
+ timestampevents = DEFAULT_TIMESTAMPEVENTS;
+ httptimeout = DEFAULT_HTTPTIMEOUT;
+
cfg = ast_config_load("manager.conf");
if (!cfg) {
ast_log(LOG_NOTICE, "Unable to open management configuration manager.conf. Call management disabled.\n");
More information about the asterisk-commits
mailing list