Index: extensions/app_sip/diamsip.h
===================================================================
--- extensions/app_sip/diamsip.h	(revision 427)
+++ extensions/app_sip/diamsip.h	(revision 430)
@@ -97,4 +97,6 @@
 int set_real_sipserver_uri(const unsigned char  *username, const size_t usernamelen, const unsigned char *sipserver_uri,const size_t sipserverurilen);
 int set_sipserver_uri(const unsigned char  *username, const size_t usernamelen, const unsigned char *sipserver_uri,const size_t sipserverurilen);
+int get_sipserver_uri(const unsigned char *sip_aor, const size_t sipaorlen, unsigned char ** sipserver_uri, size_t *sipserverurilen);
+int allow_roaming(const unsigned char  *username, const size_t usernamelen, const char * network,const size_t networklen);
 
 //count functions
Index: extensions/app_sip/libdiamsip.c
===================================================================
--- extensions/app_sip/libdiamsip.c	(revision 427)
+++ extensions/app_sip/libdiamsip.c	(revision 430)
@@ -690,5 +690,5 @@
 	CHECK_PARAMS(username && usernamelen);
 	
-	int not_found=2;
+	
 	size_t querylen, usernamepurelen;
 	char *query, *username_pure;
@@ -726,5 +726,5 @@
 	CHECK_PARAMS(username && usernamelen);
 	
-	int not_found=2;
+	
 	size_t querylen, usernamepurelen;
 	char *query, *username_pure;
@@ -765,5 +765,5 @@
 	CHECK_PARAMS(username && usernamelen && sipserver_uri && sipserverurilen);
 	
-	int not_found=2;
+	
 	size_t querylen, usernamepurelen, sipserveruripurelen;
 	char *query, *username_pure, *sipserveruri_pure;
@@ -804,5 +804,5 @@
 	CHECK_PARAMS(sipserver_uri && sipserverurilen);
 	
-	int not_found=2;
+
 	size_t querylen, sipserveruripurelen;
 	char *query, *sipserveruri_pure;
@@ -838,5 +838,5 @@
 	CHECK_PARAMS(username && usernamelen && sipserver_uri && sipserverurilen);
 	
-	int not_found=2;
+	
 	size_t querylen, usernamepurelen, sipserveruripurelen;
 	char *query, *username_pure, *sipserveruri_pure;
@@ -874,5 +874,5 @@
 }
 
-int get_sipserver_uri(const unsigned char *sip_aor, const size_t sipaorlen, char ** sipserver_uri, size_t *sipserverurilen)
+int get_sipserver_uri(const unsigned char *sip_aor, const size_t sipaorlen, unsigned char ** sipserver_uri, size_t *sipserverurilen)
 {
 	CHECK_PARAMS(sip_aor && sipaorlen && sipserver_uri && sipserverurilen );
@@ -927,5 +927,5 @@
 				{
 					CHECK_MALLOC(*sipserver_uri=malloc(*sipserverurilen+1));
-					strcpy(*sipserver_uri,row[0]);
+					strcpy((char *)*sipserver_uri,row[0]);
 					not_found=0;
 					break;
@@ -1000,5 +1000,5 @@
 	return counter;
 }
-/*
+/* 
 void nonce_add_element(char * nonce)
 {
Index: extensions/app_sip/locationinfo.c
===================================================================
--- extensions/app_sip/locationinfo.c	(revision 427)
+++ extensions/app_sip/locationinfo.c	(revision 430)
@@ -115,6 +115,6 @@
 		
 		//If we arrive here, the user is known
-		int sipserverurilen;
-		char * sipserver_uri=NULL;
+		size_t sipserverurilen;
+		unsigned char * sipserver_uri=NULL;
 		
 		ret=get_sipserver_uri(avphdr->avp_value->os.data, avphdr->avp_value->os.len, &sipserver_uri, &sipserverurilen);
Index: extensions/app_sip/locationinfosl.c
===================================================================
--- extensions/app_sip/locationinfosl.c	(revision 427)
+++ extensions/app_sip/locationinfosl.c	(revision 430)
@@ -42,5 +42,5 @@
 	
 	struct msg *ans, *qry;
-	struct avp *avp, *groupedavp;
+	struct avp *avp;
 	struct avp_hdr *avphdr;
 	union avp_value value;
@@ -86,5 +86,5 @@
 		CHECK_FCT( fd_msg_search_avp ( qry, sip_dict.SIP_AOR, &avp) );
 		CHECK_FCT( fd_msg_avp_hdr( avp, &avphdr )  );
-		int diameterurilen;
+		size_t diameterurilen;
 		char * diameter_uri=NULL;
 		
@@ -105,5 +105,5 @@
 		  {
 		    CHECK_FCT( fd_msg_avp_new ( sip_dict.Redirect_Host, 0, &avp ) );
-		    value.os.data=diameter_uri;
+		    value.os.data=(unsigned char *)diameter_uri;
 		    value.os.len=diameterurilen;
 		    CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) );
Index: extensions/app_sip/multimediaauth.c
===================================================================
--- extensions/app_sip/multimediaauth.c	(revision 427)
+++ extensions/app_sip/multimediaauth.c	(revision 430)
@@ -50,6 +50,8 @@
 	int idx=0, number_of_auth_items=0,i=0, ret=0;
 	//Flags and variables for Database
-	int sipurinotstored=0, authenticationpending=0, querylen=0, usernamelen=0;
-	char *query=NULL,*username=NULL;
+	int sipurinotstored=0, authenticationpending=0; 
+	size_t querylen=0, usernamelen=0;
+	char *query=NULL;
+	unsigned char *username=NULL;
 	
 	//The nonce we will store and retrieve in session
@@ -152,5 +154,5 @@
 				username=malloc(avphdr->avp_value->os.len*2+1);
 				//We purify username not to have forbidden characters
-				usernamelen=mysql_real_escape_string(conn, username, (const char *)avphdr->avp_value->os.data, avphdr->avp_value->os.len);
+				usernamelen=mysql_real_escape_string(conn, (char *)username, (const char *)avphdr->avp_value->os.data, avphdr->avp_value->os.len);
 				
 				//Now that we know the user exist, we get the list of AOR owned by this user
@@ -200,5 +202,5 @@
 			if(avphdr!=NULL)
 			{
-				char *sipuri=NULL;
+				unsigned char *sipuri=NULL;
 				int sipurilen=0;
 
@@ -206,5 +208,5 @@
 				CHECK_MALLOC(sipuri=malloc(avphdr->avp_value->os.len*2+1));
 				//We purify SIP-URI not to have forbidden characters
-				sipurilen=mysql_real_escape_string(conn, sipuri, (const char *)avphdr->avp_value->os.data, avphdr->avp_value->os.len);
+				sipurilen=mysql_real_escape_string(conn, (char *)sipuri, (const char *)avphdr->avp_value->os.data, avphdr->avp_value->os.len);
 				
 				
Index: extensions/app_sip/serverassignment.c
===================================================================
--- extensions/app_sip/serverassignment.c	(revision 427)
+++ extensions/app_sip/serverassignment.c	(revision 430)
@@ -123,5 +123,5 @@
 				{
 					//We must check that this user can use this SIP-AOR
-					ret=check_sipaor(usernamehdr->avp_value->os.data, usernamehdr->avp_value->os.len, sipaorhdr->avp_value->os.data,sipaorhdr->avp_value->os.len);
+					ret=check_sipaor(usernamehdr->avp_value->os.data, usernamehdr->avp_value->os.len,(const char *) sipaorhdr->avp_value->os.data,sipaorhdr->avp_value->os.len);
 					
 					if(ret==0)
@@ -203,5 +203,5 @@
 					
 					CHECK_MALLOC(table_supporteddatatype[counter]=malloc(avphdr->avp_value->os.len+1));
-					strncpy(table_supporteddatatype[counter],avphdr->avp_value->os.data,avphdr->avp_value->os.len);
+					strncpy(table_supporteddatatype[counter],(const char *)avphdr->avp_value->os.data,avphdr->avp_value->os.len);
 					table_supporteddatatype[counter][avphdr->avp_value->os.len+1]='\0';
 					
Index: extensions/app_sip/userauthorization.c
===================================================================
--- extensions/app_sip/userauthorization.c	(revision 427)
+++ extensions/app_sip/userauthorization.c	(revision 430)
@@ -108,5 +108,5 @@
 				
 				//We must check that this user can use this SIP-AOR
-				ret=check_sipaor(usernamehdr->avp_value->os.data, usernamehdr->avp_value->os.len, sipaorhdr->avp_value->os.data,sipaorhdr->avp_value->os.len);
+				ret=check_sipaor(usernamehdr->avp_value->os.data, usernamehdr->avp_value->os.len, (const char *)sipaorhdr->avp_value->os.data,sipaorhdr->avp_value->os.len);
 				
 				if(ret==0)
@@ -167,5 +167,5 @@
 					DIAMETER_ERROR_ROAMING_NOT_ALLOWED.
 					*/
-					ret=allow_roaming(usernamehdr->avp_value->os.data, usernamehdr->avp_value->os.len, visitednethdr->avp_value->os.data,visitednethdr->avp_value->os.len);
+					ret=allow_roaming(usernamehdr->avp_value->os.data, usernamehdr->avp_value->os.len, (const char *)visitednethdr->avp_value->os.data,visitednethdr->avp_value->os.len);
 					
 					if(ret==0)
@@ -216,5 +216,5 @@
 		
 		//Let's look for the SIP_Server_URI'
-		char *sipserver_uri;
+		unsigned char *sipserver_uri;
 		size_t sipserverurilen;
 		
Index: extensions/test_sip/locationinfo.c
===================================================================
--- extensions/test_sip/locationinfo.c	(revision 427)
+++ extensions/test_sip/locationinfo.c	(revision 430)
@@ -46,5 +46,5 @@
 	
 	//Fake values START
-	unsigned char *sip_aor="sip:aw-lappy@tera.ics.keio.ac.jp";
+	char *sip_aor="sip:aw-lappy@tera.ics.keio.ac.jp";
 	size_t aor_len=strlen(sip_aor); 
 	char *destination_realm="tera.ics.keio.ac.jp";
@@ -112,5 +112,5 @@
 		
 		CHECK_FCT( fd_msg_avp_new ( sip_dict.SIP_AOR, 0, &avp ) );
-		value.os.data=sip_aor;
+		value.os.data=(unsigned char *)sip_aor;
 		value.os.len=aor_len;
 		CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) );
Index: extensions/test_sip/locationinfosl.c
===================================================================
--- extensions/test_sip/locationinfosl.c	(revision 427)
+++ extensions/test_sip/locationinfosl.c	(revision 430)
@@ -46,5 +46,5 @@
 	
 	//Fake values START
-	unsigned char *sip_aor="sip:aw-lappy@tera.ics.keio.ac.jp";
+	char *sip_aor="sip:aw-lappy@tera.ics.keio.ac.jp";
 	size_t aor_len=strlen(sip_aor); 
 	char *destination_realm="tera.ics.keio.ac.jp";
@@ -114,5 +114,5 @@
 		
 		CHECK_FCT( fd_msg_avp_new ( sip_dict.SIP_AOR, 0, &avp ) );
-		value.os.data=sip_aor;
+		value.os.data=(unsigned char *)sip_aor;
 		value.os.len=aor_len;
 		CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) );
Index: extensions/test_sip/serverassignment.c
===================================================================
--- extensions/test_sip/serverassignment.c	(revision 427)
+++ extensions/test_sip/serverassignment.c	(revision 430)
@@ -46,15 +46,15 @@
 	
 	//Fake values START
-	unsigned char *sip_aor="sip:aw-lappy@tera.ics.keio.ac.jp";
+	 char *sip_aor="sip:aw-lappy@tera.ics.keio.ac.jp";
 	size_t aor_len=strlen(sip_aor); 
-	unsigned char *destination_realm="tera.ics.keio.ac.jp";
+	 char *destination_realm="tera.ics.keio.ac.jp";
 	size_t destination_realmlen=strlen(destination_realm);
-	unsigned char *destination_host="suika.tera.ics.keio.ac.jp";
+	 char *destination_host="suika.tera.ics.keio.ac.jp";
 	size_t destination_hostlen=strlen(destination_host);
-	unsigned char *username="aw-lappy";
+	 char *username="aw-lappy";
 	size_t usernamelen=strlen(username);
-	unsigned char *visitednetwork="Pink";
-	size_t visitednetworklen=strlen(visitednetwork);
-	int registrationtype = 2;
+	// char *visitednetwork="Pink";
+	//size_t visitednetworklen=strlen(visitednetwork);
+	//int registrationtype = 2;
 	int data_already_available=0;
 	int assignment_type=0;
@@ -100,5 +100,5 @@
 	{
 		CHECK_FCT( fd_msg_avp_new ( sip_dict.Destination_Host, 0, &avp ) );
-		value.os.data=destination_host;
+		value.os.data=(unsigned char *)destination_host;
 		value.os.len=destination_hostlen;
 		CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) );
@@ -108,5 +108,5 @@
 	{
 		CHECK_FCT( fd_msg_avp_new ( sip_dict.Destination_Realm, 0, &avp ) );
-		value.os.data=destination_realm;
+		value.os.data=(unsigned char *)destination_realm;
 		value.os.len=destination_realmlen;
 		CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) );
@@ -118,5 +118,5 @@
 		
 		CHECK_FCT( fd_msg_avp_new ( sip_dict.SIP_AOR, 0, &avp ) );
-		value.os.data=sip_aor;
+		value.os.data=(unsigned char *)sip_aor;
 		value.os.len=aor_len;
 		CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) );
@@ -128,5 +128,5 @@
 		
 		CHECK_FCT( fd_msg_avp_new ( sip_dict.User_Name, 0, &avp ) );
-		value.os.data=username;
+		value.os.data=(unsigned char *)username;
 		value.os.len=usernamelen;
 		CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) );
Index: extensions/test_sip/test_sip.c
===================================================================
--- extensions/test_sip/test_sip.c	(revision 427)
+++ extensions/test_sip/test_sip.c	(revision 430)
@@ -101,4 +101,7 @@
 	struct disp_when data;
 	
+	
+	//TODO: activate again configuration file
+	CHECK_FCT( ts_conf_init() );
 	/* Initialize configuration 
 	//CHECK_FCT( ts_conf_init() );
Index: extensions/test_sip/userauthorization.c
===================================================================
--- extensions/test_sip/userauthorization.c	(revision 427)
+++ extensions/test_sip/userauthorization.c	(revision 430)
@@ -46,13 +46,13 @@
 	
 	//Fake values START
-	unsigned char *sip_aor="sip:aw-lappy@tera.ics.keio.ac.jp";
+	char *sip_aor="sip:aw-lappy@tera.ics.keio.ac.jp";
 	size_t aor_len=strlen(sip_aor); 
-	unsigned char *destination_realm="tera.ics.keio.ac.jp";
+	 char *destination_realm="tera.ics.keio.ac.jp";
 	size_t destination_realmlen=strlen(destination_realm);
-	unsigned char *destination_host="suika.tera.ics.keio.ac.jp";
+	 char *destination_host="suika.tera.ics.keio.ac.jp";
 	size_t destination_hostlen=strlen(destination_host);
-	unsigned char *username="aw-lappy";
+	 char *username="aw-lappy";
 	size_t usernamelen=strlen(username);
-	unsigned char *visitednetwork="Pink";
+	 char *visitednetwork="Pink";
 	size_t visitednetworklen=strlen(visitednetwork);
 	int registrationtype = 2;
@@ -99,5 +99,5 @@
 	{
 		CHECK_FCT( fd_msg_avp_new ( sip_dict.Destination_Host, 0, &avp ) );
-		value.os.data=destination_host;
+		value.os.data=(unsigned char *)destination_host;
 		value.os.len=destination_hostlen;
 		CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) );
@@ -107,5 +107,5 @@
 	{
 		CHECK_FCT( fd_msg_avp_new ( sip_dict.Destination_Realm, 0, &avp ) );
-		value.os.data=destination_realm;
+		value.os.data=(unsigned char *)destination_realm;
 		value.os.len=destination_realmlen;
 		CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) );
@@ -117,5 +117,5 @@
 		
 		CHECK_FCT( fd_msg_avp_new ( sip_dict.SIP_AOR, 0, &avp ) );
-		value.os.data=sip_aor;
+		value.os.data=(unsigned char *)sip_aor;
 		value.os.len=aor_len;
 		CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) );
@@ -127,5 +127,5 @@
 		
 		CHECK_FCT( fd_msg_avp_new ( sip_dict.User_Name, 0, &avp ) );
-		value.os.data=username;
+		value.os.data=(unsigned char *)username;
 		value.os.len=usernamelen;
 		CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) );
@@ -137,5 +137,5 @@
 		
 		CHECK_FCT( fd_msg_avp_new ( sip_dict.SIP_Visited_Network_Id, 0, &avp ) );
-		value.os.data=visitednetwork;
+		value.os.data=(unsigned char *)visitednetwork;
 		value.os.len=visitednetworklen;
 		CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) );
