diff extensions/test_app/ta_serv.c @ 1214:c2fbaf2985f4

New options to test_app extension to generate long Diameter messages
author Sebastien Decugis <sdecugis@freediameter.net>
date Tue, 18 Jun 2013 16:27:45 +0800
parents 1af09cc156d6
children
line wrap: on
line diff
--- a/extensions/test_app/ta_serv.c	Tue Jun 18 12:44:30 2013 +0800
+++ b/extensions/test_app/ta_serv.c	Tue Jun 18 16:27:45 2013 +0800
@@ -94,6 +94,20 @@
 		CHECK_FCT( fd_msg_avp_add( ans, MSG_BRW_LAST_CHILD, avp ) );
 	}
 	
+	/* Set the Test-Payload-AVP AVP */
+	if (ta_conf->long_avp_id) {
+		struct avp * src = NULL;
+		struct avp_hdr * hdr = NULL;
+		
+		CHECK_FCT( fd_msg_search_avp ( qry, ta_avp_long, &src) );
+		CHECK_FCT( fd_msg_avp_hdr( src, &hdr )  );
+		
+		CHECK_FCT( fd_msg_avp_new ( ta_avp_long, 0, &avp ) );
+		CHECK_FCT( fd_msg_avp_setvalue( avp, hdr->avp_value ) );
+		CHECK_FCT( fd_msg_avp_add( ans, MSG_BRW_LAST_CHILD, avp ) );
+	}
+	
+	
 	/* Set the Origin-Host, Origin-Realm, Result-Code AVPs */
 	CHECK_FCT( fd_msg_rescode_set( ans, "DIAMETER_SUCCESS", NULL, NULL, 1 ) );
 	
"Welcome to our mercurial repository"