[svn-commits] oej: branch oej/rana-manager-debug-trunk r334743 - in /team/oej/rana-manager-...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Sep 7 09:41:46 CDT 2011


Author: oej
Date: Wed Sep  7 09:41:42 2011
New Revision: 334743

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=334743
Log:
For some reason, post-review did not include configs/manager.conf.sample.
Well, it's time to commit it anyway.
--Denna och nedanstående rader kommer inte med i loggmeddelandet--

_M   .
M    main/manager.c
M    configs/manager.conf.sample

Modified:
    team/oej/rana-manager-debug-trunk/   (props changed)
    team/oej/rana-manager-debug-trunk/configs/manager.conf.sample
    team/oej/rana-manager-debug-trunk/main/manager.c

Propchange: team/oej/rana-manager-debug-trunk/
------------------------------------------------------------------------------
--- automerge (original)
+++ automerge Wed Sep  7 09:41:42 2011
@@ -1,1 +1,1 @@
-*
+Is-there-life-off-net?

Modified: team/oej/rana-manager-debug-trunk/configs/manager.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/oej/rana-manager-debug-trunk/configs/manager.conf.sample?view=diff&rev=334743&r1=334742&r2=334743
==============================================================================
--- team/oej/rana-manager-debug-trunk/configs/manager.conf.sample (original)
+++ team/oej/rana-manager-debug-trunk/configs/manager.conf.sample Wed Sep  7 09:41:42 2011
@@ -45,7 +45,10 @@
 ;                               ; The default is yes.
 ;
 ;displayconnects = yes
-;
+
+; Show manager Actions received in the Asterisk CLI. Defaults to off.
+;debugactions = yes
+
 ; Add a Unix epoch timestamp to events (not action responses)
 ;
 ;timestampevents = yes

Modified: team/oej/rana-manager-debug-trunk/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/rana-manager-debug-trunk/main/manager.c?view=diff&rev=334743&r1=334742&r2=334743
==============================================================================
--- team/oej/rana-manager-debug-trunk/main/manager.c (original)
+++ team/oej/rana-manager-debug-trunk/main/manager.c Wed Sep  7 09:41:42 2011
@@ -924,6 +924,7 @@
 static int authtimeout;
 static int authlimit;
 static char *manager_channelvars;
+static int debug_actions = 0;
 
 #define DEFAULT_REALM		"asterisk"
 static char global_realm[MAXHOSTNAMELEN];	/*!< Default realm */
@@ -4605,6 +4606,20 @@
 	return 0;
 }
 
+/*! \brief Output manager actions to the CLI */
+static void manager_debug_action(struct mansession *s, const struct message *m)
+{
+	int x;
+
+	ast_verbose(VERBOSE_PREFIX_2 "%sManager '%s': Received action from IP(%s)\n", 
+			(s->session->sessiontimeout ? "HTTP " : ""), s->session->username, ast_inet_ntoa(s->session->sin.sin_addr));
+	for (x = 0; x < m->hdrcount; x++) {
+		ast_verbose("        %s\n", m->headers[x]);
+	}
+	ast_verbose("\n");
+}
+
+
 /*
  * Done with the action handlers here, we start with the code in charge
  * of accepting connections and serving them.
@@ -4671,6 +4686,9 @@
 	AST_RWLIST_UNLOCK(&actions);
 
 	if (tmp) {
+		if (debug_actions) {
+			manager_debug_action(s, m);
+		}
 		if (call_func) {
 			/* Call our AMI function after we unlock our actions lists */
 			ast_debug(1, "Running action '%s'\n", tmp->action);
@@ -6388,6 +6406,7 @@
 	struct sockaddr_in amis_desc_local_address_tmp = { 0, };
 
 	manager_enabled = 0;
+	debug_actions = 0;
 
 	if (!registered) {
 		/* Register default actions */
@@ -6495,6 +6514,8 @@
 			allowmultiplelogin = ast_true(val);
 		} else if (!strcasecmp(var->name, "displayconnects")) {
 			displayconnects = ast_true(val);
+		} else if (!strcasecmp(var->name, "debugactions")) {
+			debug_actions = ast_true(val);
 		} else if (!strcasecmp(var->name, "timestampevents")) {
 			timestampevents = ast_true(val);
 		} else if (!strcasecmp(var->name, "debug")) {




More information about the svn-commits mailing list