Index: extensions/app_radgw/rgwx_acct.c
===================================================================
--- extensions/app_radgw/rgwx_acct.c	(revision 1027)
+++ extensions/app_radgw/rgwx_acct.c	(revision 1088)
@@ -160,4 +160,9 @@
 };
 
+static DECLARE_FD_DUMP_PROTOTYPE(acct_conf_session_state_dump, struct sess_state * st)
+{
+	return fd_dump_extend( FD_DUMP_STD_PARAMS, "[rgwx sess_state](@%p): aai:%x str:%d TC:%u", st, st->auth_appl, st->send_str, st->term_cause);
+}
+
 /* Initialize the plugin */
 static int acct_conf_parse(char * conffile, struct rgwp_config ** state)
@@ -172,5 +177,5 @@
 	memset(new, 0, sizeof(struct rgwp_config));
 	
-	CHECK_FCT( fd_sess_handler_create( &new->sess_hdl, free, NULL ) );
+	CHECK_FCT( fd_sess_handler_create( &new->sess_hdl, (void *)free, acct_conf_session_state_dump, NULL ) );
 	new->confstr = conffile;
 	
Index: extensions/app_radgw/rgwx_auth.c
===================================================================
--- extensions/app_radgw/rgwx_auth.c	(revision 1027)
+++ extensions/app_radgw/rgwx_auth.c	(revision 1088)
@@ -125,4 +125,9 @@
 };
 
+struct sess_state {
+	char req_auth[16];
+};
+
+
 /* Initialize the plugin */
 static int auth_conf_parse(char * confstr, struct rgwp_config ** state)
@@ -137,5 +142,5 @@
 	memset(new, 0, sizeof(struct rgwp_config));
 	
-	CHECK_FCT( fd_sess_handler_create( &new->sess_hdl, free, NULL ) );
+	CHECK_FCT( fd_sess_handler_create( &new->sess_hdl, (void *)free, NULL, NULL ) );
 	new->confstr = confstr;
 	
@@ -1057,9 +1062,9 @@
 	/* Store the request identifier in the session (if provided) */
 	{
-		unsigned char * req_auth;
-		CHECK_MALLOC(req_auth = malloc(16));
-		memcpy(req_auth, &rad_req->hdr->authenticator[0], 16);
+		struct sess_state  *st;
+		CHECK_MALLOC(st = malloc(sizeof(struct sess_state)));
+		memcpy(st->req_auth, &rad_req->hdr->authenticator[0], 16);
 		
-		CHECK_FCT( fd_sess_state_store( cs->sess_hdl, sess, &req_auth ) );
+		CHECK_FCT( fd_sess_state_store( cs->sess_hdl, sess, &st ) );
 	}
 	
@@ -1077,5 +1082,5 @@
 	int no_str = 0; /* indicate if an STR is required for this server */
 	uint8_t	tuntag = 0;
-	unsigned char * req_auth = NULL;
+	struct sess_state  *st;
 	int error_cause = 0;
 	struct session * sess;
@@ -1089,5 +1094,5 @@
 	CHECK_FCT( fd_msg_sess_get(fd_g_config->cnf_dict, *diam_ans, &sess, NULL) );
 	if (sess) {
-		CHECK_FCT( fd_sess_state_retrieve( cs->sess_hdl, sess, &req_auth ) );
+		CHECK_FCT( fd_sess_state_retrieve( cs->sess_hdl, sess, &st ) );
 		CHECK_FCT( fd_sess_getsid(sess, &sid, &sidlen) );
 	} /* else ? */
@@ -1759,5 +1764,5 @@
 											
 											/* We need the request authenticator */
-											CHECK_PARAMS(req_auth);
+											CHECK_PARAMS(st);
 
 											/* Retrieve the shared secret */
@@ -1778,5 +1783,5 @@
 											addr[0] = secret;
 											len[0] = secret_len;
-											addr[1] = req_auth;
+											addr[1] = st->req_auth;
 											len[1] = 16;
 											addr[2] = &buf[1];
@@ -1853,5 +1858,5 @@
 
 						/* We need the request authenticator */
-						CHECK_PARAMS(req_auth);
+						CHECK_PARAMS(st);
 
 						/* Retrieve the shared secret */
@@ -1866,5 +1871,5 @@
 						send_len = ahdr->avp_value->os.len - recv_len;
 						
-						if ( ! radius_msg_add_mppe_keys(*rad_fw, req_auth, secret, secret_len, 
+						if ( ! radius_msg_add_mppe_keys(*rad_fw, st->req_auth, secret, secret_len, 
 								ahdr->avp_value->os.data + recv_len, send_len,
 								ahdr->avp_value->os.data, recv_len) ) {
@@ -1925,5 +1930,5 @@
 	
 	CHECK_FCT( fd_msg_free( aoh ) );
-	free(req_auth);
+	free(st);
 	
 	if (error_cause) {
Index: extensions/app_radgw/rgwx_echodrop.c
===================================================================
--- extensions/app_radgw/rgwx_echodrop.c	(revision 996)
+++ extensions/app_radgw/rgwx_echodrop.c	(revision 1088)
@@ -38,18 +38,29 @@
 #include "rgwx_echodrop.h"
 
+struct sess_state {
+	struct fd_list sentinel;
+};
+
 /* If a session is destroyed, empty the list of ed_saved_attribute */
-static void state_delete(void * arg, char * sid, void * opaque) {
-	struct fd_list * list = (struct fd_list *)arg;
-	
-	CHECK_PARAMS_DO( list, return );
-	
-	while (!FD_IS_LIST_EMPTY(list)) {
-		struct ed_saved_attribute * esa = (struct ed_saved_attribute *)(list->next);
+static void state_delete(struct sess_state * arg, os0_t sid, void * opaque) {
+	while (!FD_IS_LIST_EMPTY(&arg->sentinel)) {
+		struct ed_saved_attribute * esa = (struct ed_saved_attribute *)(arg->sentinel.next);
 		fd_list_unlink(&esa->chain);
 		free(esa);
 	}
-	free(list);
-}
-
+	free(arg);
+}
+
+static DECLARE_FD_DUMP_PROTOTYPE(ed_session_state_dump, struct sess_state * st)
+{
+	struct fd_list * li;
+	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "[rgwx sess_state](@%p):\n", st), return NULL);	
+	for (li = st->sentinel.next; li != &st->sentinel; li = li->next) {
+		struct ed_saved_attribute * esa = (struct ed_saved_attribute *)(li);
+		CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "[rgwx sess_state {esa}] t:%2hhx l:%2hhx d:", esa->attr.type, esa->attr.length), return NULL);
+		CHECK_MALLOC_DO( fd_dump_extend_hexdump(FD_DUMP_STD_PARAMS, (&esa->attr.length) + 1, esa->attr.length - 2, 0,0), return NULL);
+		CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "\n"), return NULL);
+	}
+}
 
 /* Initialize the plugin and parse the configuration. */
@@ -69,5 +80,5 @@
 	
 	/* Create the session handler */
-	CHECK_FCT( fd_sess_handler_create( &new->sess_hdl, state_delete, NULL ) );
+	CHECK_FCT( fd_sess_handler_create( &new->sess_hdl, state_delete, ed_session_state_dump, NULL ) );
 	
 	/* Parse the configuration file */
@@ -217,4 +228,5 @@
 	if (!FD_IS_LIST_EMPTY(&echo_list)) {
 		struct session * sess;
+		struct sess_state * st;
 		
 		CHECK_FCT( fd_msg_sess_get(fd_g_config->cnf_dict, *diam_fw, &sess, NULL) );
@@ -229,10 +241,10 @@
 		
 		/* Move the values in a dynamically allocated list */
-		CHECK_MALLOC( li = malloc(sizeof(struct fd_list)) );
-		fd_list_init(li, NULL);
-		fd_list_move_end(li, &echo_list);
+		CHECK_MALLOC( st = malloc(sizeof(struct sess_state)) );
+		fd_list_init(&st->sentinel, NULL);
+		fd_list_move_end(&st->sentinel, &echo_list);
 		
 		/* Save the list in the session */
-		CHECK_FCT( fd_sess_state_store( cs->sess_hdl, sess, &li ) );
+		CHECK_FCT( fd_sess_state_store( cs->sess_hdl, sess, &st ) );
 	}
 	
@@ -243,6 +255,6 @@
 static int ed_diam_ans( struct rgwp_config * cs, struct msg ** diam_ans, struct radius_msg ** rad_fw, struct rgw_client * cli )
 {
-	struct fd_list * list = NULL;
 	struct session * sess;
+	struct sess_state * st;
 	
 	TRACE_ENTRY("%p %p %p %p", cs, diam_ans, rad_fw, cli);
@@ -258,6 +270,6 @@
 	
 	/* Now try and retrieve any data from the session */
-	CHECK_FCT( fd_sess_state_retrieve( cs->sess_hdl, sess, &list ) );
-	if (list == NULL) {
+	CHECK_FCT( fd_sess_state_retrieve( cs->sess_hdl, sess, &st ) );
+	if (st == NULL) {
 		/* No attribute saved in the session, just return */
 		return 0;
@@ -268,6 +280,6 @@
 	CHECK_PARAMS( rad_fw && *rad_fw);
 	
-	while (! FD_IS_LIST_EMPTY(list) ) {
-		struct ed_saved_attribute * esa = (struct ed_saved_attribute *)(list->next);
+	while (! FD_IS_LIST_EMPTY(&st->sentinel) ) {
+		struct ed_saved_attribute * esa = (struct ed_saved_attribute *)(st->sentinel.next);
 		
 		fd_list_unlink(&esa->chain);
@@ -280,5 +292,5 @@
 		free(esa);
 	}
-	free(list);
+	free(st);
 
 	return 0;
Index: extensions/app_radgw/rgwx_sip.c
===================================================================
--- extensions/app_radgw/rgwx_sip.c	(revision 1027)
+++ extensions/app_radgw/rgwx_sip.c	(revision 1088)
@@ -134,5 +134,4 @@
 		
 	} dict; /* cache of the dictionary objects we use */
-	struct session_handler * sess_hdl; /* We store RADIUS request authenticator information in the session */
 	char * confstr;
 	//Chained list of nonce
@@ -258,5 +257,4 @@
 	memset(new, 0, sizeof(struct rgwp_config));
 	
-	CHECK_FCT( fd_sess_handler_create( &new->sess_hdl, free, NULL ) );
 	new->confstr = conffile;
 	
@@ -312,6 +310,4 @@
 	CHECK_PARAMS_DO( state, return );
 	
-	CHECK_FCT_DO( fd_sess_handler_destroy( &state->sess_hdl, NULL ),  );
-	
 	nonce_deletelistnonce(state);
 	CHECK_POSIX_DO(pthread_mutex_destroy(&state->nonce_mutex), /*continue*/);
@@ -320,5 +316,4 @@
 	return;
 }
-
 
 /* Handle an incoming RADIUS request */
@@ -717,13 +712,4 @@
 	//fd_msg_dump_walk(1,*diam_fw);
 	
-	/* Store the request identifier in the session */
-	{
-		unsigned char * req_sip;
-		CHECK_MALLOC(req_sip = malloc(16));
-		memcpy(req_sip, &rad_req->hdr->authenticator[0], 16);
-		
-		CHECK_FCT( fd_sess_state_store( cs->sess_hdl, sess, &req_sip ) );
-	}
-	
 	
 	return 0;
@@ -857,7 +843,4 @@
 	}
 	
-	CHECK_FCT( fd_sess_state_retrieve( cs->sess_hdl, sess, &req_sip ) );
-	free(req_sip);
-	
 	return 0;
 }
