Index: extensions/app_sip/app_sip.h
===================================================================
--- extensions/app_sip/app_sip.h	(revision 434)
+++ extensions/app_sip/app_sip.h	(revision 440)
@@ -66,5 +66,6 @@
 	char mysql_prefix[10]; //default: as_
 	uint16_t  mysql_port; //if 0, default port will be used
-	
+	uint16_t rtr_port;
+	uint16_t ppr_port;
 };
 extern struct as_conf * as_conf;
@@ -135,5 +136,5 @@
 int app_sip_RTR_cb(struct rtrsipaor structure);
 int app_sip_PPR_cb(struct pprsipaor structure);
-#define PORT 666 //TODO:put in conf file
+
 
 int ds_entry();
Index: extensions/app_sip/app_sip.l
===================================================================
--- extensions/app_sip/app_sip.l	(revision 433)
+++ extensions/app_sip/app_sip.l	(revision 440)
@@ -121,5 +121,10 @@
 				return ASMYSQL_PORT;
 			}
-			
+(?i:"rtr_port")		{
+				return RTR_PORT;
+			}
+(?i:"ppr_port")		{
+				return PPR_PORT;
+			}
 (?i:"mode")		{
 				return MODE;
Index: extensions/app_sip/app_sip.y
===================================================================
--- extensions/app_sip/app_sip.y	(revision 433)
+++ extensions/app_sip/app_sip.y	(revision 440)
@@ -124,4 +124,6 @@
 %token 		ASMYSQL_SERVER
 %token 		ASMYSQL_PORT
+%token 		RTR_PORT
+%token 		PPR_PORT
 
 /* Tokens and types for routing table definition */
@@ -146,4 +148,6 @@
 			| conffile mysql_server
 			| conffile mysql_port
+			| conffile rtr_port
+			| conffile ppr_port
 			;
 
@@ -193,2 +197,12 @@
 			}
 			;
+rtr_port:		RTR_PORT '=' INTEGER ';'
+			{
+				as_conf->rtr_port = (uint16_t)$3;
+			}
+			;
+ppr_port:		PPR_PORT '=' INTEGER ';'
+			{
+				as_conf->ppr_port = (uint16_t)$3;
+			}
+			;
Index: extensions/app_sip/pushprofile.c
===================================================================
--- extensions/app_sip/pushprofile.c	(revision 433)
+++ extensions/app_sip/pushprofile.c	(revision 440)
@@ -47,13 +47,13 @@
 void *ppr_socket(void *arg)
 {
-	/*
+	
 	SOCKET sock;
     SOCKADDR_IN sin, csin;
-    struct rtrsipaor rtrsip;
+    struct pprsipaor pprsip;
     int rcvbytes=0;
 	sock = socket(AF_INET, SOCK_STREAM, 0);
 	sin.sin_addr.s_addr = inet_addr("127.0.0.1");
     sin.sin_family = AF_INET;
-    sin.sin_port = htons(PORT);
+	sin.sin_port = htons(as_conf->ppr_port);
     socklen_t sinsize = sizeof(csin);
 	int accepted=0;
@@ -72,5 +72,5 @@
 			if(accepted>-1)
 			{
-				rcvbytes=recv(accepted, &rtrsip, sizeof(struct rtrsipaor),0);
+				rcvbytes=recv(accepted, &pprsip, sizeof(struct pprsipaor),0);
 				
 				if(rcvbytes>-1)
@@ -86,5 +86,5 @@
 	else
 		TRACE_DEBUG(INFO,"Can't create socket!");
-*/	
+
 	
 	pthread_exit(NULL);
Index: extensions/app_sip/registrationtermination.c
===================================================================
--- extensions/app_sip/registrationtermination.c	(revision 433)
+++ extensions/app_sip/registrationtermination.c	(revision 440)
@@ -54,5 +54,5 @@
 	sin.sin_addr.s_addr = inet_addr("127.0.0.1");
 	sin.sin_family = AF_INET;
-	sin.sin_port = htons(PORT);
+	sin.sin_port = htons(as_conf->rtr_port);
 	socklen_t sinsize = sizeof(csin);
 	int accepted=0;
@@ -251,5 +251,5 @@
 	
 	//TODO:remove for debug
-	fd_msg_dump_walk(INFO,message);
+	//fd_msg_dump_walk(INFO,message);
 	CHECK_FCT( fd_msg_send( &message, NULL, NULL ));
 	
Index: extensions/app_sip/tools/app_sip_ppr.c
===================================================================
--- extensions/app_sip/tools/app_sip_ppr.c	(revision 435)
+++ extensions/app_sip/tools/app_sip_ppr.c	(revision 440)
@@ -48,5 +48,5 @@
 #include <stdlib.h>
 #include <string.h>
-#define PORT 667
+
 #include <errno.h>
 
@@ -66,9 +66,10 @@
     struct pprsipaor pprsip;
     int numdatatype=0,i=0;
-    
+    int port=667;
+	
 	sock = socket(AF_INET, SOCK_STREAM, 0);
 	sin.sin_addr.s_addr = inet_addr("127.0.0.1");
     sin.sin_family = AF_INET;
-    sin.sin_port = htons(PORT);
+    
     
     //We initialize the structure
@@ -158,4 +159,16 @@
 				pprsip.accounting=1;
 				
+				
+			}
+			else if(strcmp(argv[i],"-p")==0)
+			{
+				
+				if(sscanf(argv[i+1],"%d", &port)!=1)
+				{
+					fprintf(stderr,"Incorrect port number!\n");
+					return 1;
+				}
+				
+				
 				i++;
 			}
@@ -170,4 +183,6 @@
 	}
 	
+	//We set the port number
+	sin.sin_port = htons(port);
 	
 	
@@ -180,5 +195,5 @@
 	
     
-    
+    fprintf(stderr,"%d!\n",port);
    
     /*
Index: extensions/app_sip/tools/app_sip_rtr.c
===================================================================
--- extensions/app_sip/tools/app_sip_rtr.c	(revision 433)
+++ extensions/app_sip/tools/app_sip_rtr.c	(revision 440)
@@ -48,5 +48,4 @@
 #include <stdlib.h>
 #include <string.h>
-#define PORT 666
 #include <errno.h>
 
@@ -68,9 +67,10 @@
     struct rtrsipaor rtrsip;
     int numaor=0,i=0;
-    
+	int port=666;
+	
 	sock = socket(AF_INET, SOCK_STREAM, 0);
 	sin.sin_addr.s_addr = inet_addr("127.0.0.1");
     sin.sin_family = AF_INET;
-    sin.sin_port = htons(PORT);
+    
     
     //We initialize the structure
@@ -215,4 +215,16 @@
 				rtrsip.reason=3;
 			}
+			else if(strcmp(argv[i],"-p")==0)
+			{
+				
+				if(sscanf(argv[i+1],"%d", &port)!=1)
+				{
+					fprintf(stderr,"Incorrect port number!\n");
+					return 1;
+				}
+				
+				
+				i++;
+			}
 			else
 			{
@@ -247,5 +259,6 @@
 	}
     
-    
+    //We set the port number
+    sin.sin_port = htons(port);
    
     
