Index: extensions/CMakeLists.txt
===================================================================
--- extensions/CMakeLists.txt	(revision 1103)
+++ extensions/CMakeLists.txt	(revision 1126)
@@ -85,7 +85,8 @@
 # Debug & test extensions
 
-FD_EXTENSION_SUBDIR(dbg_monitor "Outputs periodical status information"              OFF)
-FD_EXTENSION_SUBDIR(dbg_msg_timings "Show some timing information for messages"      OFF)
-FD_EXTENSION_SUBDIR(dbg_rt      "Routing extension for debugging the routing module" OFF)
+FD_EXTENSION_SUBDIR(dbg_monitor "Outputs periodical status information"              ON)
+FD_EXTENSION_SUBDIR(dbg_msg_timings "Show some timing information for messages"      ON)
+FD_EXTENSION_SUBDIR(dbg_msg_dumps "Show human-readable content of the received & sent messages"      ON)
+FD_EXTENSION_SUBDIR(dbg_rt      "Routing extension for debugging the routing module" ON)
 FD_EXTENSION_SUBDIR(test_app    "Testing application to send dummy message to another peer, like a Diameter 'ping'" OFF)
 FD_EXTENSION_SUBDIR(test_sip    "Testing application to simulate Diameter-SIP client (RFC4740)" OFF)
Index: extensions/dbg_msg_dumps/CMakeLists.txt
===================================================================
--- extensions/dbg_msg_dumps/CMakeLists.txt	(revision 1126)
+++ extensions/dbg_msg_dumps/CMakeLists.txt	(revision 1126)
@@ -0,0 +1,11 @@
+PROJECT("Messages dump extension" C)
+FD_ADD_EXTENSION(dbg_msg_dumps dbg_msg_dumps.c)
+
+
+####
+## INSTALL section ##
+
+INSTALL(TARGETS dbg_msg_dumps
+	LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX}
+	COMPONENT freeDiameter-debug-tools)
+
Index: extensions/dbg_msg_dumps/dbg_msg_dumps.c
===================================================================
--- extensions/dbg_msg_dumps/dbg_msg_dumps.c	(revision 1126)
+++ extensions/dbg_msg_dumps/dbg_msg_dumps.c	(revision 1126)
@@ -0,0 +1,80 @@
+/*********************************************************************************************************
+* Software License Agreement (BSD License)                                                               *
+* Author: Sebastien Decugis <sdecugis@freediameter.net>							 *
+*													 *
+* Copyright (c) 2013, WIDE Project and NICT								 *
+* All rights reserved.											 *
+* 													 *
+* Redistribution and use of this software in source and binary forms, with or without modification, are  *
+* permitted provided that the following conditions are met:						 *
+* 													 *
+* * Redistributions of source code must retain the above 						 *
+*   copyright notice, this list of conditions and the 							 *
+*   following disclaimer.										 *
+*    													 *
+* * Redistributions in binary form must reproduce the above 						 *
+*   copyright notice, this list of conditions and the 							 *
+*   following disclaimer in the documentation and/or other						 *
+*   materials provided with the distribution.								 *
+* 													 *
+* * Neither the name of the WIDE Project or NICT nor the 						 *
+*   names of its contributors may be used to endorse or 						 *
+*   promote products derived from this software without 						 *
+*   specific prior written permission of WIDE Project and 						 *
+*   NICT.												 *
+* 													 *
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED *
+* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
+* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
+* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 	 *
+* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 	 *
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR *
+* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF   *
+* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.								 *
+*********************************************************************************************************/
+
+/* This extension uses the hooks mechanism to display the full content of received and sent messages, for
+   learning & debugging purpose.
+   Do NOT use this extension in production environment because it will slow down all operation. */
+
+#include <freeDiameter/extension.h>
+
+static struct fd_hook_hdl *md_hdl = NULL;
+
+/* The callback called when messages are received and sent */
+static void md_hook_cb(enum fd_hook_type type, struct msg * msg, struct peer_hdr * peer, void * other, struct fd_hook_permsgdata *pmd, void * regdata)
+{
+	char * buf = NULL;
+	size_t len;
+	
+	CHECK_MALLOC_DO( fd_msg_dump_treeview(&buf, &len, NULL, msg, fd_g_config->cnf_dict, 1, 1), 
+		{ LOG_E("Error while dumping a message"); return; } );
+	
+	LOG_N("%s %s: %s",
+		(type == HOOK_MESSAGE_RECEIVED) ? "RCV FROM" : "SENT TO",
+		peer ? peer->info.pi_diamid:"<unknown>", 
+		buf);
+
+	free(buf);
+}
+
+/* Entry point */
+static int md_main(char * conffile)
+{
+	TRACE_ENTRY("%p", conffile);
+	
+	CHECK_FCT( fd_hook_register( ((1 << HOOK_MESSAGE_RECEIVED) | (1 << HOOK_MESSAGE_SENT)), 
+					md_hook_cb, NULL, NULL, &md_hdl) );
+	
+	return 0;
+}
+
+/* Cleanup */
+void fd_ext_fini(void)
+{
+	TRACE_ENTRY();
+	CHECK_FCT_DO( fd_hook_unregister( md_hdl ), );
+	return ;
+}
+
+EXTENSION_ENTRY("dbg_msg_dumps", md_main);
