Index: extensions/app_diameap/diameap.c
===================================================================
--- extensions/app_diameap/diameap.c	(revision 732)
+++ extensions/app_diameap/diameap.c	(revision 1120)
@@ -60,5 +60,5 @@
 	CHECK_FCT(fd_disp_app_support(dataobj_diameap_app, dataobj_diameap_ven, 1, 0));
 
-	TRACE_DEBUG(INFO,"%sDiameter EAP Application Extension started successfully.",DIAMEAP_EXTENSION);
+	LOG_D("%sDiameter EAP Application Extension started successfully.",DIAMEAP_EXTENSION);
 
 	return 0;
Index: extensions/app_diameap/diameap_server.c
===================================================================
--- extensions/app_diameap/diameap_server.c	(revision 1088)
+++ extensions/app_diameap/diameap_server.c	(revision 1120)
@@ -3284,4 +3284,6 @@
 			;
 
+			LOG_N("%s Auth FAIL: %.*s",DIAMEAP_EXTENSION, diameap_sm->eap_sm.user.useridLength, diameap_sm->eap_sm.user.userid);
+			
 			CHECK_FCT_DO( diameap_send(rmsg),
 					goto s_end)
@@ -3323,4 +3325,7 @@
 					{	TRACE_DEBUG(INFO,"%s Adding accounting AVP failed",DIAMEAP_EXTENSION); goto s_end;})
 			;
+			
+			LOG_N("%s Auth Success: %.*s",DIAMEAP_EXTENSION, diameap_sm->eap_sm.user.useridLength, diameap_sm->eap_sm.user.userid);
+			
 			CHECK_FCT_DO( diameap_send(rmsg),
 					goto s_end)
Index: extensions/dbg_monitor/dbg_monitor.c
===================================================================
--- extensions/dbg_monitor/dbg_monitor.c	(revision 1113)
+++ extensions/dbg_monitor/dbg_monitor.c	(revision 1120)
@@ -143,5 +143,5 @@
 	TRACE_DEBUG(INFO, "%s", fd_conf_dump(&buf, &len, NULL));
 	TRACE_DEBUG(INFO, "[dbg_monitor] Dumping extensions information");
-	TRACE_DEBUG(INFO, "%s", fd_ext_dump(&buf, &len, NULL));
+	TRACE_DEBUG(INFO, "%s", fd_ext_dump(&buf, &len, NULL, 0));
 	TRACE_DEBUG(INFO, "[dbg_monitor] Dumping dictionary information");
 	TRACE_DEBUG(INFO, "%s", fd_dict_dump(&buf, &len, NULL, fd_g_config->cnf_dict));
Index: extensions/dict_dcca/dict_dcca.c
===================================================================
--- extensions/dict_dcca/dict_dcca.c	(revision 885)
+++ extensions/dict_dcca/dict_dcca.c	(revision 1120)
@@ -1465,5 +1465,5 @@
 	}
     }
-    TRACE_DEBUG(INFO, "Extension 'Dictionary definitions for DCCA (rfc4006)' initialized");
+    LOG_D( "Extension 'Dictionary definitions for DCCA (rfc4006)' initialized");
     return 0;
 }
Index: extensions/dict_dcca_3gpp/dict_dcca_3gpp.c
===================================================================
--- extensions/dict_dcca_3gpp/dict_dcca_3gpp.c	(revision 1086)
+++ extensions/dict_dcca_3gpp/dict_dcca_3gpp.c	(revision 1120)
@@ -10757,5 +10757,5 @@
         }
 	
-	TRACE_DEBUG(INFO, "Extension 'Dictionary definitions for DCCA 3GPP' initialized");
+	LOG_D( "Extension 'Dictionary definitions for DCCA 3GPP' initialized");
 	return 0;
 }
Index: extensions/dict_dcca_starent/dict_dcca_starent.c
===================================================================
--- extensions/dict_dcca_starent/dict_dcca_starent.c	(revision 962)
+++ extensions/dict_dcca_starent/dict_dcca_starent.c	(revision 1120)
@@ -283,5 +283,5 @@
 
 
-	TRACE_DEBUG(INFO, "Extension 'Dictionary definitions for DCCA Starent' initialized");
+	LOG_D( "Extension 'Dictionary definitions for DCCA Starent' initialized");
 	return 0;
 }
Index: extensions/dict_eap/dict_eap.c
===================================================================
--- extensions/dict_eap/dict_eap.c	(revision 879)
+++ extensions/dict_eap/dict_eap.c	(revision 1120)
@@ -513,5 +513,5 @@
 	}
 	
-	TRACE_DEBUG(INFO, "Extension 'Dictionary definitions for EAP' initialized");
+	LOG_D( "Extension 'Dictionary definitions for EAP' initialized");
 	return 0;
 }
Index: extensions/dict_mip6a/dict_mip6a.c
===================================================================
--- extensions/dict_mip6a/dict_mip6a.c	(revision 776)
+++ extensions/dict_mip6a/dict_mip6a.c	(revision 1120)
@@ -1089,5 +1089,5 @@
 		}
 	}
-	TRACE_DEBUG(INFO, "Dictionary Extension 'Diameter Mobile IPv6 Auth (MIP6A)' initialized");
+	LOG_D( "Dictionary Extension 'Diameter Mobile IPv6 Auth (MIP6A)' initialized");
 	return 0;
 }
Index: extensions/dict_mip6i/dict_mip6i.c
===================================================================
--- extensions/dict_mip6i/dict_mip6i.c	(revision 777)
+++ extensions/dict_mip6i/dict_mip6i.c	(revision 1120)
@@ -1132,5 +1132,5 @@
 	}
 
-	TRACE_DEBUG(INFO, "Dictionary Extension 'Diameter Mobile IPv6 IKE (MIP6I)' initialized");
+	LOG_D( "Dictionary Extension 'Diameter Mobile IPv6 IKE (MIP6I)' initialized");
 	return 0;
 }
Index: extensions/dict_nas_mipv6/dict_nas_mipv6.c
===================================================================
--- extensions/dict_nas_mipv6/dict_nas_mipv6.c	(revision 614)
+++ extensions/dict_nas_mipv6/dict_nas_mipv6.c	(revision 1120)
@@ -253,5 +253,5 @@
 	}
 
-	TRACE_DEBUG(INFO, "Dictionary Extension 'MIPv6 NAS-to-HAAA Interaction' initialized");
+	LOG_D( "Dictionary Extension 'MIPv6 NAS-to-HAAA Interaction' initialized");
 	return 0;
 }
Index: extensions/dict_nasreq/dict_nasreq.c
===================================================================
--- extensions/dict_nasreq/dict_nasreq.c	(revision 750)
+++ extensions/dict_nasreq/dict_nasreq.c	(revision 1120)
@@ -3729,5 +3729,5 @@
 	}
 	
-	TRACE_DEBUG(INFO, "Extension 'Dictionary definitions for NASREQ' initialized");
+	LOG_D( "Extension 'Dictionary definitions for NASREQ' initialized");
 	return 0;
 }
Index: extensions/dict_rfc5777/dict_rfc5777.c
===================================================================
--- extensions/dict_rfc5777/dict_rfc5777.c	(revision 774)
+++ extensions/dict_rfc5777/dict_rfc5777.c	(revision 1120)
@@ -2136,5 +2136,5 @@
 	}
 
-	TRACE_DEBUG(INFO, "Dictionary Extension 'Traffic Classification and Quality of Service (QoS) Attributes for Diameter (RFC 5777)' initialized");
+	LOG_D( "Dictionary Extension 'Traffic Classification and Quality of Service (QoS) Attributes for Diameter (RFC 5777)' initialized");
 	return 0;
 }
Index: extensions/dict_sip/dict_sip.c
===================================================================
--- extensions/dict_sip/dict_sip.c	(revision 614)
+++ extensions/dict_sip/dict_sip.c	(revision 1120)
@@ -2947,5 +2947,5 @@
 	}
 	
-	TRACE_DEBUG(INFO, "Extension 'Dictionary definitions for SIP' initialized");
+	LOG_D( "Extension 'Dictionary definitions for SIP' initialized");
 	return 0;
 }
Index: extensions/test_netemul/tne_process.c
===================================================================
--- extensions/test_netemul/tne_process.c	(revision 972)
+++ extensions/test_netemul/tne_process.c	(revision 1120)
@@ -106,5 +106,5 @@
 				CHECK_FCT( fd_msg_bufferize(m, &buf, &len) );
 				CHECK_FCT( fd_msg_parse_buffer(&buf, len, &nm) );
-				CHECK_FCT( fd_msg_source_set(nm, src, srclen, 0, NULL) );
+				CHECK_FCT( fd_msg_source_set(nm, src, srclen) );
 				CHECK_FCT( fd_msg_hdr(nm, &nh) );
 				nh->msg_flags |= CMD_FLAG_RETRANSMIT; /* Add the 'T' flag */
Index: include/freeDiameter/libfdcore.h
===================================================================
--- include/freeDiameter/libfdcore.h	(revision 1113)
+++ include/freeDiameter/libfdcore.h	(revision 1120)
@@ -813,5 +813,5 @@
 /* The "old" FD_EV_DUMP_* events are replaced with direct calls to the following dump functions */
 DECLARE_FD_DUMP_PROTOTYPE(fd_conf_dump);
-DECLARE_FD_DUMP_PROTOTYPE(fd_ext_dump);
+DECLARE_FD_DUMP_PROTOTYPE(fd_ext_dump, int indent_next);
 DECLARE_FD_DUMP_PROTOTYPE(fd_servers_dump, int details);
 #endif /* SWIG */
Index: include/freeDiameter/libfdproto.h
===================================================================
--- include/freeDiameter/libfdproto.h	(revision 1119)
+++ include/freeDiameter/libfdproto.h	(revision 1120)
@@ -2500,6 +2500,5 @@
  *  msg		: A msg object.
  *  diamid,len	: The diameter id of the peer from which this message was received.
- *  add_rr	: if true, a Route-Record AVP is added to the message with content diamid. In that case, dict must be supplied.
- *  dict	: a dictionary with definition of Route-Record AVP (if add_rr is true)
+ *  dict	: a dictionary with definition of Route-Record AVP (for fd_msg_source_setrr)
  *
  * DESCRIPTION: 
@@ -2512,5 +2511,6 @@
  *  !0      	: an error occurred.
  */
-int fd_msg_source_set( struct msg * msg, DiamId_t diamid, size_t diamidlen, int add_rr, struct dictionary * dict );
+int fd_msg_source_set( struct msg * msg, DiamId_t diamid, size_t diamidlen );
+int fd_msg_source_setrr( struct msg * msg, DiamId_t diamid, size_t diamidlen, struct dictionary * dict );
 int fd_msg_source_get( struct msg * msg, DiamId_t *diamid, size_t * diamidlen );
 
Index: libfdcore/core.c
===================================================================
--- libfdcore/core.c	(revision 1119)
+++ libfdcore/core.c	(revision 1120)
@@ -257,4 +257,8 @@
 	LOG_N("%s", b ?: "Error during configuration dump...");
 	
+	/* Display extensions status */
+	b = fd_ext_dump(&buf, &len, NULL, 19);
+	LOG_N("Loaded extensions: %s", b ?: "Error during extensions dump...");
+	
 	/* Display registered triggers for FDEV_TRIGGER */
 	b = fd_event_trig_dump(&buf, &len, &offset);
Index: libfdcore/extensions.c
===================================================================
--- libfdcore/extensions.c	(revision 1113)
+++ libfdcore/extensions.c	(revision 1120)
@@ -78,5 +78,5 @@
 
 /* Dump the list */
-DECLARE_FD_DUMP_PROTOTYPE(fd_ext_dump)
+DECLARE_FD_DUMP_PROTOTYPE(fd_ext_dump, int indent_next)
 {
 	struct fd_list * li;
@@ -86,5 +86,8 @@
 	{
 		struct fd_ext_info * ext = (struct fd_ext_info *)li;
-		CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "{extension}(@%p): '%s'[%s], %sloaded%s", ext, ext->filename, ext->conffile?:"no conf", ext->handler ? "" : "not ", (li->next == &ext_list) ? "":"\n"), return NULL);
+		CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "%*s'%s'[%s], %sloaded%s", (li == ext_list.next) ? 0 : indent_next,"", 
+					ext->filename, 
+					ext->conffile?:"no conf", 
+					ext->handler ? "" : "not ", (li->next == &ext_list) ? "":"\n"), return NULL);
 	}
 	return *buf;
Index: libfdcore/hooks.c
===================================================================
--- libfdcore/hooks.c	(revision 1103)
+++ libfdcore/hooks.c	(revision 1120)
@@ -333,6 +333,5 @@
 				if (msg) {
 					DiamId_t id = NULL;
-					size_t idlen;
-					if (!fd_msg_source_get( msg, &id, &idlen ))
+					if (!fd_msg_source_get( msg, &id, NULL ))
 						id = (DiamId_t)"<error getting source>";
 					
@@ -353,6 +352,5 @@
 			case HOOK_MESSAGE_ROUTING_ERROR: {
 				DiamId_t id = NULL;
-				size_t idlen;
-				if (!fd_msg_source_get( msg, &id, &idlen ))
+				if (!fd_msg_source_get( msg, &id, NULL ))
 					id = (DiamId_t)"<error getting source>";
 
@@ -397,4 +395,8 @@
 			
 			case HOOK_PEER_CONNECT_SUCCESS: {
+				DiamId_t id = NULL;
+				if ((!fd_msg_source_get( msg, &id, NULL )) && (id == NULL)) { /* The CEA is locally issued */
+					fd_msg_answ_getq(msg, &msg); /* We dump the CER in that case */
+				}
 				CHECK_MALLOC_DO(fd_msg_dump_treeview(&buf, &len, NULL, msg, NULL, 0, 1), break);
 				LOG_N("Connected to '%s', remote capabilities: %s", peer ? peer->p_hdr.info.pi_diamid : "<unknown>", buf);
Index: libfdcore/messages.c
===================================================================
--- libfdcore/messages.c	(revision 1113)
+++ libfdcore/messages.c	(revision 1120)
@@ -318,5 +318,4 @@
 	struct msg_hdr *hdr;
 	DiamId_t diamid;
-	size_t diamidlen;
 	
 	/* Save the callback in the message, with the timeout */
@@ -326,5 +325,5 @@
 	if ( (fd_msg_hdr(*pmsg, &hdr) == 0)
 	 &&  (hdr->msg_flags & CMD_FLAG_REQUEST)
-	 &&  (fd_msg_source_get(*pmsg, &diamid, &diamidlen) == 0)
+	 &&  (fd_msg_source_get(*pmsg, &diamid, NULL) == 0)
 	 &&  (diamid == NULL)) {
 		fd_hook_call(HOOK_MESSAGE_LOCAL, *pmsg, NULL, NULL, fd_msg_pmdl_get(*pmsg));
Index: libfdcore/p_psm.c
===================================================================
--- libfdcore/p_psm.c	(revision 1118)
+++ libfdcore/p_psm.c	(revision 1120)
@@ -282,5 +282,5 @@
 		return 0;
 	
-	TRACE_DEBUG(((old == STATE_OPEN) || (new_state == STATE_OPEN)) ? INFO : FULL, "'%s'\t-> '%s'\t'%s'",
+	LOG(((old == STATE_OPEN) || (new_state == STATE_OPEN)) ? FD_LOG_NOTICE : FD_LOG_DEBUG, "'%s'\t-> '%s'\t'%s'",
 			STATE_STR(old),
 			STATE_STR(new_state),
@@ -500,4 +500,5 @@
 			
 		fd_hook_associate(msg, pmdl);
+		CHECK_FCT_DO( fd_msg_source_set( msg, peer->p_hdr.info.pi_diamid, peer->p_hdr.info.pi_diamidlen), goto psm_end);
 	
 		/* If the current state does not allow receiving messages, just drop it */
@@ -557,5 +558,5 @@
 
 					/* Set the message source and add the Route-Record */
-					CHECK_FCT_DO( fd_msg_source_set( msg, peer->p_hdr.info.pi_diamid, peer->p_hdr.info.pi_diamidlen, 1, fd_g_config->cnf_dict ), goto psm_end);
+					CHECK_FCT_DO( fd_msg_source_setrr( msg, peer->p_hdr.info.pi_diamid, peer->p_hdr.info.pi_diamidlen, fd_g_config->cnf_dict ), goto psm_end);
 
 					/* Requeue to the global incoming queue */
@@ -742,5 +743,5 @@
 			char * buf = NULL;
 			size_t len = 0;
-			LOG_D("New remote endpoint(s): %s",  fd_ep_dump(&buf, &len, NULL, 0, 0, &peer->p_hdr.info.pi_endpoints) ?: "error");
+			LOG_D("Got low layer notification (IGNORED): remote endpoint(s) changed: %s",  fd_ep_dump(&buf, &len, NULL, 0, 0, &peer->p_hdr.info.pi_endpoints) ?: "error");
 			free(buf);
 		}
Index: libfdcore/routing_dispatch.c
===================================================================
--- libfdcore/routing_dispatch.c	(revision 1119)
+++ libfdcore/routing_dispatch.c	(revision 1120)
@@ -551,5 +551,4 @@
 	int is_err = 0;
 	DiamId_t qry_src = NULL;
-	size_t   qry_src_len = 0;
 	struct msg *msgptr = msg;
 
@@ -751,5 +750,5 @@
 		/* Retrieve the corresponding query and its origin */
 		CHECK_FCT( fd_msg_answ_getq( msgptr, &qry ) );
-		CHECK_FCT( fd_msg_source_get( qry, &qry_src, &qry_src_len ) );
+		CHECK_FCT( fd_msg_source_get( qry, &qry_src, NULL ) );
 
 		if ((!qry_src) && (!is_err)) {
Index: libfdproto/messages.c
===================================================================
--- libfdproto/messages.c	(revision 1119)
+++ libfdproto/messages.c	(revision 1120)
@@ -804,6 +804,6 @@
 	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "  Command Code: %u\n", msg->msg_public.msg_code), return NULL);
 	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "  ApplicationId: %d\n", msg->msg_public.msg_appl), return NULL);
-	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "  Hop-by-Hop Identifier: 0x%8X\n", msg->msg_public.msg_hbhid), return NULL);
-	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "  End-to-End Identifier: 0x%8X\n", msg->msg_public.msg_eteid), return NULL);
+	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "  Hop-by-Hop Identifier: 0x%08X\n", msg->msg_public.msg_hbhid), return NULL);
+	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "  End-to-End Identifier: 0x%08X\n", msg->msg_public.msg_eteid), return NULL);
 	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "   {debug data}: src:%s(%zd) rwb:%p rt:%d cb:%p,%p(%p) qry:%p asso:%d sess:%p", msg->msg_src_id?:"(nil)", msg->msg_src_id_len, msg->msg_rawbuffer, msg->msg_routable, msg->msg_cb.anscb, msg->msg_cb.expirecb, msg->msg_cb.data, msg->msg_query, msg->msg_associated, msg->msg_sess), return NULL);
 	
@@ -1071,5 +1071,5 @@
 			CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " {"), return NULL);
 		} else {
-			CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "+"), return NULL);
+			CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, ","), return NULL);
 		}
 	}
@@ -1131,7 +1131,7 @@
 		/* For embedded AVPs, we only display (vendor,) code & length */
 		if (avp->avp_public.avp_flags & AVP_FLAG_VENDOR) {
-			CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "V=%u,", avp->avp_public.avp_vendor), return NULL);
-		}
-		CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "C=%u,L=%d", avp->avp_public.avp_code, avp->avp_public.avp_len), return NULL);
+			CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "V:%u/", avp->avp_public.avp_vendor), return NULL);
+		}
+		CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "C:%u/l:%d", avp->avp_public.avp_code, avp->avp_public.avp_len), return NULL);
 	}
 	
@@ -1342,10 +1342,10 @@
 
 /* Associate source peer */
-int fd_msg_source_set( struct msg * msg, DiamId_t diamid, size_t diamidlen, int add_rr, struct dictionary * dict )
-{
-	TRACE_ENTRY( "%p %p %zd %d %p", msg, diamid, diamidlen, add_rr, dict);
+int fd_msg_source_set( struct msg * msg, DiamId_t diamid, size_t diamidlen )
+{
+	TRACE_ENTRY( "%p %p %zd", msg, diamid, diamidlen);
 	
 	/* Check we received a valid message */
-	CHECK_PARAMS( CHECK_MSG(msg) && ( (! add_rr) || dict ) );
+	CHECK_PARAMS( CHECK_MSG(msg) );
 	
 	/* Cleanup any previous source */
@@ -1360,43 +1360,51 @@
 	CHECK_MALLOC( msg->msg_src_id = os0dup(diamid, diamidlen) );
 	msg->msg_src_id_len = diamidlen;
-	
-	
-	if (add_rr) {
-		struct dict_object 	*avp_rr_model = NULL;
-		avp_code_t 		 code = AC_ROUTE_RECORD;
-		struct avp 		*avp;
-		union avp_value		 val;
-		
-		/* Lock the cached values */
+	/* done */
+	return 0;
+}
+
+/* Associate source peer */
+int fd_msg_source_setrr( struct msg * msg, DiamId_t diamid, size_t diamidlen, struct dictionary * dict )
+{
+	struct dict_object 	*avp_rr_model = NULL;
+	avp_code_t 		 code = AC_ROUTE_RECORD;
+	struct avp 		*avp;
+	union avp_value		 val;
+
+	TRACE_ENTRY( "%p %p %zd %p", msg, diamid, diamidlen, dict);
+	
+	/* Check we received a valid message */
+	CHECK_PARAMS( CHECK_MSG(msg) && dict );
+	
+	/* Lock the cached values */
+	CHECK_POSIX( pthread_mutex_lock(&cached_avp_rr_lock) );
+	if (cached_avp_rr_dict == dict) {
+		avp_rr_model = cached_avp_rr_model;
+	}
+	CHECK_POSIX( pthread_mutex_unlock(&cached_avp_rr_lock) );
+
+	/* If it was not cached */
+	if (!avp_rr_model) {
+		/* Find the model for Route-Record in the dictionary */
+		CHECK_FCT( fd_dict_search ( dict, DICT_AVP, AVP_BY_CODE, &code, &avp_rr_model, ENOENT) );
+
+		/* Now cache this result */
 		CHECK_POSIX( pthread_mutex_lock(&cached_avp_rr_lock) );
-		if (cached_avp_rr_dict == dict) {
-			avp_rr_model = cached_avp_rr_model;
-		}
+		cached_avp_rr_dict  = dict;
+		cached_avp_rr_model = avp_rr_model;
 		CHECK_POSIX( pthread_mutex_unlock(&cached_avp_rr_lock) );
-		
-		/* If it was not cached */
-		if (!avp_rr_model) {
-			/* Find the model for Route-Record in the dictionary */
-			CHECK_FCT( fd_dict_search ( dict, DICT_AVP, AVP_BY_CODE, &code, &avp_rr_model, ENOENT) );
-			
-			/* Now cache this result */
-			CHECK_POSIX( pthread_mutex_lock(&cached_avp_rr_lock) );
-			cached_avp_rr_dict  = dict;
-			cached_avp_rr_model = avp_rr_model;
-			CHECK_POSIX( pthread_mutex_unlock(&cached_avp_rr_lock) );
-		}
-		
-		/* Create the AVP with this model */
-		CHECK_FCT( fd_msg_avp_new ( avp_rr_model, 0, &avp ) );
-		
-		/* Set the AVP value with the diameter id */
-		memset(&val, 0, sizeof(val));
-		val.os.data = (uint8_t *)diamid;
-		val.os.len  = diamidlen;
-		CHECK_FCT( fd_msg_avp_setvalue( avp, &val ) );
-
-		/* Add the AVP in the message */
-		CHECK_FCT( fd_msg_avp_add( msg, MSG_BRW_LAST_CHILD, avp ) );
-	}
+	}
+
+	/* Create the AVP with this model */
+	CHECK_FCT( fd_msg_avp_new ( avp_rr_model, 0, &avp ) );
+
+	/* Set the AVP value with the diameter id */
+	memset(&val, 0, sizeof(val));
+	val.os.data = (uint8_t *)diamid;
+	val.os.len  = diamidlen;
+	CHECK_FCT( fd_msg_avp_setvalue( avp, &val ) );
+
+	/* Add the AVP in the message */
+	CHECK_FCT( fd_msg_avp_add( msg, MSG_BRW_LAST_CHILD, avp ) );
 	
 	/* done */
Index: tests/testappacct.c
===================================================================
--- tests/testappacct.c	(revision 773)
+++ tests/testappacct.c	(revision 1120)
@@ -239,5 +239,6 @@
 		
 		/* Source */
-		CHECK( 0, fd_msg_source_set( msg, "peer3", CONSTSTRLEN("peer3"), 1, fd_g_config->cnf_dict ) );
+		CHECK( 0, fd_msg_source_set( msg, "peer3", CONSTSTRLEN("peer3") ) );
+		CHECK( 0, fd_msg_source_setrr( msg, "peer3", CONSTSTRLEN("peer3"), fd_g_config->cnf_dict ) );
 	}
 	
