Index: modules/acc/acc_extra.c
===================================================================
--- modules/acc/acc_extra.c	(revision 2378)
+++ modules/acc/acc_extra.c	(working copy)
@@ -292,7 +292,7 @@
 int legs2strar( struct acc_extra *legs, struct sip_msg *rq, str *val_arr)
 {
 	static int start = 0;
-	static struct usr_avp *avp[MAX_ACC_EXTRA];
+	static struct usr_avp *avp[MAX_ACC_LEG];
 	unsigned short name_type;
 	int_str name;
 	int_str value;
@@ -303,14 +303,18 @@
 	found = 0;
 	r = 0;
 
+	LOG(L_ERR,"--++legs2strar: beginning with start=%d, msg->id=%d\n",
+		start,rq->id);
 	for( n=0 ; legs ; legs=legs->next,n++ ) {
 		/* search for the AVP */
 		if (start==0) {
 			if ( xl_get_avp_name( rq, &legs->spec, &name, &name_type)<0 )
 				goto exit;
 			avp[n] = search_first_avp( name_type, name, &value, 0);
+			LOG(L_ERR,"--++legs2strar: first for %d is %p\n",n,avp[n]);
 		} else {
 			avp[n] = search_next_avp( avp[n], &value);
+			LOG(L_ERR,"--++legs2strar: next for %d is %p\n",n,avp[n]);
 		}
 
 		/* set new leg record */

