Bläddra i källkod

no SRL falg needed

Bogdan-Andrei Iancu 23 år sedan
förälder
incheckning
71b771faad
7 ändrade filer med 66 tillägg och 364 borttagningar
  1. 1 3
      Makefile.defs
  2. 1 1
      modules/tm/sip_msg.c
  3. 0 1
      modules/tm/t_funcs.c
  4. 42 46
      modules/tm/t_funcs.h
  5. 6 234
      modules/tm/t_reply.c
  6. 15 77
      modules/tm/tm.c
  7. 1 2
      msg_translator.c

+ 1 - 3
Makefile.defs

@@ -73,14 +73,12 @@ ARCH = $(shell uname -m |sed -e s/i.86/i386/ -e s/sun4u/sparc64/ )
 #       to become non-optional if stable
 # -DNEW_HNAME
 #		32-bit header name parsing; turn off for lower speed ;-) or debugging; to become non-optional if fast and stable
-# -DSRL Shortened Reply Lock -- moves more code, esp. "send" out
-#  of locks for greater speed; to become non-optional if fast and stable
 
 DEFS+= -DNAME='"$(NAME)"' -DVERSION='"$(RELEASE)"' -DARCH='"$(ARCH)"' \
 	 -DOS='"$(OS)"' -DCOMPILER='"$(CC_VER)"'\
 	 -DDNS_IP_HACK  -DPKG_MALLOC -DSHM_MEM  -DSHM_MMAP \
 	 -DF_MALLOC  -DUSE_SYNONIM\
-	 -DWAIT -DNEW_HNAME -DNOISY_REPLIES -DSRL -DBOGDAN_TRIFLE \
+	 -DWAIT -DNEW_HNAME -DNOISY_REPLIES -DBOGDAN_TRIFLE \
 	 #-DNO_DEBUG \
 	 #-DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=0 \
 	 #-DNOSMP \

+ 1 - 1
modules/tm/sip_msg.c

@@ -187,7 +187,7 @@ struct sip_msg*  sip_msg_cloner( struct sip_msg *org_msg )
 	p=(char *)sh_malloc(len);foo=p;
 	if (!p)
 	{
-		LOG(L_ERR , "ERROR: sip_msg_cloner_2: cannot allocate memory\n" );
+		LOG(L_ERR , "ERROR: sip_msg_cloner: cannot allocate memory\n" );
 		return 0;
 	}
 

+ 0 - 1
modules/tm/t_funcs.c

@@ -297,7 +297,6 @@ int t_should_relay_response( struct cell *Trans , int new_code,
 			return -1;
 		}
 	} else { /* no final response sent yet */
-
 		/* negative replies subject to fork picking */
 		if (new_code >=300 ) {
 			*should_store=1;

+ 42 - 46
modules/tm/t_funcs.h

@@ -180,36 +180,32 @@ int t_forward_uri( struct sip_msg* p_msg  );
 
 
 
-/*  This function is called whenever a reply for our module is received; we need to register
-  *  this function on module initialization;
-  *  Returns :   0 - core router stops
-  *                    1 - core router relay statelessly
-  */
+/* This function is called whenever a reply for our module is received;
+ * we need to register this function on module initialization;
+ * Returns :   0 - core router stops
+ *             1 - core router relay statelessly
+ */
 
-#ifdef SRL
 int t_on_reply( struct sip_msg  *p_msg ) ;
-#else
-int t_on_reply_received( struct sip_msg  *p_msg ) ;
-#endif
 
 
 
 
-/*  This function is called whenever a request for our module is received; we need to register
-  *  this function on module initialization;
-  *  Returns :   0 - core router stops
-  *                    1 - core router relay statelessly
-  */
+/* This function is called whenever a request for our module is received;
+ * we need to register this function on module initialization;
+ * Returns :   0 - core router stops
+ *             1 - core router relay statelessly
+ */
 int t_on_request_received( struct sip_msg  *p_msg , unsigned int ip, unsigned int port) ;
 
 
 
 
-/*  This function is called whenever a request for our module is received; we need to register
-  *  this function on module initialization;
-  *  Returns :   0 - core router stops
-  *                    1 - core router relay statelessly
-  */
+/* This function is called whenever a request for our module is received;
+ * we need to register this function on module initialization;
+ * Returns :   0 - core router stops
+ *             1 - core router relay statelessly
+ */
 int t_on_request_received_uri( struct sip_msg  *p_msg ) ;
 
 
@@ -223,9 +219,9 @@ int t_release_transaction( struct sip_msg* );
 
 
 /* Retransmits the last sent inbound reply.
-  * Returns  -1 -error
-  *                1 - OK
-  */
+ * Returns  -1 - error
+ *           1 - OK
+ */
 int t_retransmit_reply( /* struct sip_msg * */  );
 
 
@@ -237,45 +233,43 @@ int t_retransmit_reply( /* struct sip_msg * */  );
 int t_send_reply( struct sip_msg * , unsigned int , char *  );
 
 
+
+
 /* releases T-context */
 int t_unref( /* struct sip_msg* p_msg */ );
 
-int t_forward_nonack( struct sip_msg* p_msg , unsigned int dest_ip_param ,
-    unsigned int dest_port_param );
-int t_forward_ack( struct sip_msg* p_msg , unsigned int dest_ip_param ,
-    unsigned int dest_port_param );
-
 
 
 
-struct cell* t_lookupOriginalT(  struct s_table* hash_table , struct sip_msg* p_msg );
+int t_forward_nonack( struct sip_msg* p_msg , unsigned int dest_ip_param ,
+	unsigned int dest_port_param );
+int t_forward_ack( struct sip_msg* p_msg , unsigned int dest_ip_param ,
+	unsigned int dest_port_param );
+struct cell* t_lookupOriginalT(  struct s_table* hash_table,
+	struct sip_msg* p_msg );
 int t_reply_matching( struct sip_msg* , unsigned int* , unsigned int* );
 int t_store_incoming_reply( struct cell* , unsigned int , struct sip_msg* );
-int  t_lookup_request( struct sip_msg* p_msg , int leave_new_locked );
+int t_lookup_request( struct sip_msg* p_msg , int leave_new_locked );
 int t_all_final( struct cell * );
-int t_build_and_send_ACK( struct cell *Trans , unsigned int brach , struct sip_msg* rpl);
+int t_build_and_send_ACK( struct cell *Trans , unsigned int brach ,
+	struct sip_msg* rpl);
 int t_cancel_branch(unsigned int branch); //TO DO
-int t_should_relay_response( struct cell *Trans, int new_code, int branch, int *should_store );
+int t_should_relay_response( struct cell *Trans, int new_code, int branch,
+	int *should_store );
 int t_update_timers_after_sending_reply( struct retrans_buff *rb );
 int t_put_on_wait(  struct cell  *Trans  );
 int relay_lowest_reply_upstream( struct cell *Trans , struct sip_msg *p_msg );
-
-#ifdef SRL
-static int push_reply( struct cell* trans , unsigned int branch , 
-    char *buf, unsigned int len);
-#else
-static int push_reply_from_uac_to_uas( struct cell* Trans , unsigned int );
-#endif
-
+static int push_reply( struct cell* trans , unsigned int branch ,
+	char *buf, unsigned int len);
 int add_branch_label( struct cell *Trans, struct sip_msg *p_msg , int branch );
-int get_ip_and_port_from_uri( struct sip_msg* p_msg , unsigned int *param_ip, unsigned int *param_port);
-
+int get_ip_and_port_from_uri( struct sip_msg* p_msg , unsigned int *param_ip,
+	unsigned int *param_port);
+struct retrans_buff *build_ack( struct sip_msg* rpl, struct cell *trans,
+	int branch );
 enum addifnew_status t_addifnew( struct sip_msg* p_msg );
 
-void retransmission_handler( void *);
-void final_response_handler( void *);
-void wait_handler( void *);
-void delete_handler( void *);
+
+
 
 inline int static attach_ack(  struct cell *t, int branch,
     struct retrans_buff *srb )
@@ -292,6 +286,9 @@ inline int static attach_ack(  struct cell *t, int branch,
 	return 1;
 }
 
+
+
+
 inline int static relay_ack( struct cell *t, int branch, 
 	struct retrans_buff *srb, int len )
 {
@@ -306,6 +303,5 @@ inline int static relay_ack( struct cell *t, int branch,
 	return attach_ack( t, branch, srb );
 }
 
-struct retrans_buff *build_ack( struct sip_msg* rpl, struct cell *trans, int branch );
 
 #endif

+ 6 - 234
modules/tm/t_reply.c

@@ -12,125 +12,6 @@
 #include "../../ut.h"
 #include "../../timer.h"
 
-#ifndef SRL
-/*  This function is called whenever a reply for our module is received; 
-  * we need to register  this function on module initialization;
-  *  Returns :   0 - core router stops
-  *              1 - core router relay statelessly
-  */
-int t_on_reply_received( struct sip_msg  *p_msg )
-{
-	unsigned int  branch,len, msg_status, msg_class, save_clone;
-	unsigned int local_cancel;
-	struct sip_msg *clone, *backup;
-	int relay;
-	int start_fr;
-	int is_invite;
-	struct retrans_buff *rb;
-
-
-	/* make sure we know the assosociated tranaction ... */
-	if (t_check( p_msg  , &branch , &local_cancel)==-1) return 1;
-	/* ... if there is no such, tell the core router to forward statelessly */
-	if ( T<=0 ) return 1;
-
-	DBG("DEBUG: t_on_reply_received: Original status=%d (%d,%d)\n",
-		T->status,branch,local_cancel);
-
-	/* special cases (local cancel reply and another 100 reply!)*/
-	if (p_msg->REPLY_STATUS==100 && T->status==100)
-		return 0;
-	if (local_cancel==1)
-	{
-		reset_timer( hash_table, &(T_>outbound_cancel[branch]->retr_timer));
-		if ( p_msg->REPLY_STATUS>=200 )
-			reset_timer( hash_table, &(T_>outbound_cancel[branch]->fr_timer));
-		return 0;
-	}
-
-	/* it can take quite long -- better do it now than later 
-	   inside a reply_lock */
-	if (!(clone=sip_msg_cloner( p_msg ))) {
-		goto error;
-	}
-	msg_status=p_msg->REPLY_STATUS;
-	msg_class=REPLY_CLASS(p_msg);
-	is_invite= T->inbound_request->REQ_METHOD==METHOD_INVITE;
-
-	/* *** stop timers *** */
-	rb=T->outbound_request[branch];
-	/* stop retransmission */
-	reset_timer( hash_table, &(rb->retr_timer));
-	/* stop final response timer only if I got a final response */
-	if ( msg_class>1 )
-		reset_timer( hash_table, &(rb->fr_timer));
-
-	LOCK_REPLIES( T );
-   	/* if a got the first prov. response for an INVITE ->
-	   change FR_TIME_OUT to INV_FR_TIME_UT */
-	start_fr = !T->inbound_response[branch] && msg_class==1 && is_invite;
-
-	/* *** store and relay message as needed *** */
-	relay = t_should_relay_response( T , msg_status, branch, &save_clone );
-
-	if (save_clone) {
-		/* release previously hold message */
-		backup = T->inbound_response[branch];
-		T->inbound_response[branch] = clone;
-		T->tag=&(get_to(clone)->tag_value);
-	} else {
-		backup = NULL;
-		sip_msg_free( clone );
-	}
-
-	if (relay>=0 &&  
-	push_reply_from_uac_to_uas( T, relay  ) == -1 ) {
-		/* restore original state first */
-		if (save_clone) T->inbound_response[branch] = backup;
-		/* restart FR */
-		start_fr=1;
-		goto cleanup;
-	}
-
-
-	/* *** ACK handling *** */
-	if ( is_invite )
-	{
-		if ( T->outbound_ack[branch] )
-		{   /*retransmit*/
-			SEND_BUFFER( T->outbound_ack[branch] );
-		}else if (msg_class>2 ) {   
-			/*on a non-200 reply to INVITE*/
-			DBG("DEBUG: t_on_reply_received: >=3xx reply to INVITE:"
-				" send ACK\n");
-			if ( t_build_and_send_ACK( T , branch , p_msg )==-1)
-			{
-				LOG( L_ERR , "ERROR: t_on_reply_received:"
-					" unable to send ACK\n" );
-				/* restart FR */
-				start_fr=1;
-			}
-		}
-	}
-cleanup:
-	UNLOCK_REPLIES( T );
-	if (backup) sip_msg_free(backup);
-	if (start_fr) set_timer( hash_table, &(rb->fr_timer), FR_INV_TIMER_LIST );
-   	/* restart retransmission if a provisional response came for 
-	   a non_INVITE -> retrasmit at RT_T2*/
-	if ( msg_class==1 && !is_invite )
-	{
-		rb->retr_list = RT_T2;
-		set_timer( hash_table, &(rb->retr_timer), RT_T2 );
-	}
-error:
-	T_UNREF( T );
-	/* don't try to relay statelessly on error; on troubles, simply do nothing;
-           that will make the other party to retransmit; hopefuly, we'll then 
-           be better off */
-	return 0;
-}
-#endif
 
 
 
@@ -142,13 +23,10 @@ error:
 int t_retransmit_reply( /* struct sip_msg* p_msg    */ )
 {
 
-#ifdef SRL
 	void *b;
 	int len;
-#endif
-	LOCK_REPLIES( T );
 
-#ifdef SRL
+	LOCK_REPLIES( T );
 	len=T->outbound_response.bufflen;
 	b=pkg_malloc( len );
 	if (!b) {
@@ -156,15 +34,10 @@ int t_retransmit_reply( /* struct sip_msg* p_msg    */ )
 		return -1;
 	}
 	memcpy( b, T->outbound_response.retr_buffer, len );
-#else
-	SEND_BUFFER( & T->outbound_response );
-#endif
 	UNLOCK_REPLIES( T );
 
-#ifdef SRL
 	SEND_PR_BUFFER( & T->outbound_response, b, len );
 	pkg_free( b );
-#endif
 	return 1;
 }
 
@@ -226,18 +99,12 @@ int t_send_reply(  struct sip_msg* p_msg , unsigned int code , char * text )
 	rb->bufflen = len ;
 	memcpy( rb->retr_buffer , buf , len );
 	T->status = code;
-#ifndef SRL
-	SEND_BUFFER( rb );
-#endif
 	/* needs to be protected too because what timers are set depends
-	   on current transactions status
-	*/
+	   on current transactions status */
 	t_update_timers_after_sending_reply( rb );
 	UNLOCK_REPLIES( T );
 
-#ifdef SRL
 	SEND_PR_BUFFER( rb, buf, len );
-#endif
 
 	free( buf ) ;
 	/* start/stops the proper timers*/
@@ -256,20 +123,12 @@ error:
 
 
 /* Push a previously stored reply from UA Client to UA Server
-  * and send it out
-  */
-static int push_reply_from_uac_to_uas( struct cell* trans , unsigned int branch 
-#ifdef SRL
-	, char *buf, unsigned int len
-#endif
-	)
+ * and send it out */
+static int push_reply( struct cell* trans , unsigned int branch ,
+												char *buf, unsigned int len)
 {
 	unsigned int buf_len;
 	struct retrans_buff *rb;
-#ifndef SRL
-	char *buf;
-	unsigned int len;
-#endif
 
 	DBG("DEBUG: push_reply_from_uac_to_uas: start\n");
 	rb= & trans->outbound_response;
@@ -291,23 +150,7 @@ static int push_reply_from_uac_to_uas( struct cell* trans , unsigned int branch
 		rb->to.sin_family = AF_INET;
 		rb->my_T = trans;
 		rb->status = trans->inbound_response[branch]->REPLY_STATUS;
-
-	} else {
-#ifndef SRL
-		reset_timer( hash_table, &(rb->retr_timer));
-		reset_timer( hash_table, &(rb->fr_timer));
-#endif
-	}
-
-#ifndef SRL
-	/*  generate the retrans buffer */
-	buf = build_res_buf_from_sip_res ( trans->inbound_response[branch], &len);
-	if (!buf) {
-		LOG(L_ERR, "ERROR: push_reply_from_uac_to_uas: "
-			"no shmem for outbound reply buffer\n");
-		goto error;
-	}
-#endif
+	};
 
 	/* if this is a first reply (?100), longer replies will probably follow;
 	try avoiding shm_resize by higher buffer size */
@@ -319,9 +162,6 @@ static int push_reply_from_uac_to_uas( struct cell* trans , unsigned int branch
 	}
 	rb->bufflen = len ;
 	memcpy( rb->retr_buffer , buf , len );
-#ifndef SRL
-	free( buf ) ;
-#endif
 
 	/* update the status*/
 	trans->status = trans->inbound_response[branch]->REPLY_STATUS;
@@ -333,85 +173,18 @@ static int push_reply_from_uac_to_uas( struct cell* trans , unsigned int branch
 		trans->relaied_reply_branch = branch;
 	}
 
-#ifndef SRL
-	/* start/stops the proper timers*/
-	t_update_timers_after_sending_reply( rb );
-#endif
-
 	/*send the reply*/
 	SEND_BUFFER( rb );
 	return 1;
 
 error1:
-#ifndef SRL
-	free( buf );
-#endif
 error:
 	return -1;
 }
 
-/* Push a previously stored reply from UA Client to UA Server
-  * and send it out
-  */
-static int push_reply( struct cell* trans , unsigned int branch , 
-	char *buf, unsigned int len)
-{
-	unsigned int buf_len;
-	struct retrans_buff *rb;
-
-	DBG("DEBUG: push_reply_from_uac_to_uas: start\n");
-	rb= & trans->outbound_response;
-	/* if there is a reply, release the buffer (everything else stays same) */
-	if ( ! rb->retr_buffer ) {
-		/*init retrans buffer*/
-		memset( rb , 0 , sizeof (struct retrans_buff) );
-		if (update_sock_struct_from_via(  &(rb->to),
-			trans->inbound_response[branch]->via2 )==-1) {
-				LOG(L_ERR, "ERROR: push_reply_from_uac_to_uas: "
-					"cannot lookup reply dst: %s\n",
-				trans->inbound_response[branch]->via2->host.s );
-				goto error;
-		}
-		rb->retr_timer.tg=TG_RT;
-		rb->fr_timer.tg=TG_FR;
-		rb->retr_timer.payload = rb;
-		rb->fr_timer.payload =  rb;
-		rb->to.sin_family = AF_INET;
-		rb->my_T = trans;
-		rb->status = trans->inbound_response[branch]->REPLY_STATUS;
-	};
-
-	/* if this is a first reply (?100), longer replies will probably follow;
-	try avoiding shm_resize by higher buffer size */
-	buf_len = rb->retr_buffer ? len : len + REPLY_OVERBUFFER_LEN;
-	if (! (rb->retr_buffer = (char*)shm_resize( rb->retr_buffer, buf_len )))
-	{
-		LOG(L_ERR, "ERROR: t_push: cannot allocate shmem buffer\n");
-		goto error1;
-	}
-	rb->bufflen = len ;
-	memcpy( rb->retr_buffer , buf , len );
-
-	/* update the status*/
-	trans->status = trans->inbound_response[branch]->REPLY_STATUS;
-	if ( trans->inbound_response[branch]->REPLY_STATUS>=200 &&
-		trans->relaied_reply_branch==-1 ) {
-
-		memcpy( & trans->ack_to, & trans->outbound_request[ branch ]->to,
-			sizeof( struct sockaddr_in ) );
-		trans->relaied_reply_branch = branch;
-	}
 
-	/*send the reply*/
-	SEND_BUFFER( rb );
-	return 1;
 
-error1:
-error:
-	return -1;
-}
 
-#ifdef SRL
 /*  This function is called whenever a reply for our module is received; 
   * we need to register  this function on module initialization;
   *  Returns :   0 - core router stops
@@ -623,4 +396,3 @@ error:
 	return 0;
 }
 
-#endif

+ 15 - 77
modules/tm/tm.c

@@ -88,11 +88,7 @@ static struct module_exports nm_exports= {
 				fixup_t_forward 		/* t_forward_ack */
 		},
 	10,
-#ifdef SRL
 	(response_function) t_on_reply,
-#else
-	(response_function) t_on_reply_received,
-#endif
 	(destroy_function) tm_shutdown,
 	w_onbreak,
 	0  /* per-child init function */
@@ -308,17 +304,14 @@ static int t_relay_to( struct sip_msg  *p_msg , char *str_ip , char *str_port)
 		case AIN_ERROR:		/*  fatal error (e.g, parsing) occured */
 			ret = 0;
 			break;
-
 		case AIN_RETR:		/* it's a retransmission */
 			if ( !t_retransmit_reply( p_msg ) )
-			{
 				DBG( "SER: WARNING: bad t_retransmit_reply\n");
-			}
 			ret = 1;
 			break;
-
 		case AIN_NEW:		/* it's a new request */
-			if ( !t_forward_nonack( p_msg, (unsigned int) str_ip, (unsigned int) str_port ))
+			if (!t_forward_nonack(p_msg,(unsigned int)str_ip,
+			(unsigned int) str_port ))
 			{
 				DBG( "SER:ERROR: t_forward \n");
 				ret = 0;
@@ -330,36 +323,32 @@ static int t_relay_to( struct sip_msg  *p_msg , char *str_ip , char *str_port)
 						DBG( "SER:ERROR: t_send_reply\n");
 				} else {
 					DBG( "SER: new transaction\n");
-					if (!t_send_reply( p_msg , 100 , "trying -- your call is important to us"))
-					{
+					if (!t_send_reply( p_msg , 100 , 
+					"trying -- your call is important to us"))
 						DBG( "SER: ERROR: t_send_reply (100)\n");
-					}
 				}
 				ret = 1;
 			}
 			break;
-
 		case AIN_NEWACK:	/* it's an ACK for which no transaction exists */
 			DBG( "SER: forwarding ACK  statelessly\n");
 			forward_request( p_msg , mk_proxy_from_ip(
 				(unsigned int )str_ip, (unsigned int)str_port) ) ;
 			ret=1;
 			break;
-
 		case AIN_OLDACK:	/* it's an ACK for an existing transaction */
 			DBG( "SER: ACK received -> t_release\n");
 			if ( !t_release_transaction( p_msg ) )
 			{
 				DBG( "SER: WARNING: bad t_release\n");
 			}
-			/* t_forward decides whether to forward (2xx) or not (anything else) */
-			if ( !t_forward_ack( p_msg , (unsigned int) str_ip , (unsigned int) str_port ) )
-			{
+			/* t_forward decides whether to forward (2xx) 
+			   or not (anything else) */
+			if ( !t_forward_ack( p_msg , (unsigned int) str_ip ,
+			(unsigned int) str_port ) )
 				DBG( "SER: WARNING: bad ACK forward\n");
-			}
 			ret = 1;
 			break;
-
 		default:
 			LOG(L_CRIT, "ERROR: unexpected addifnew return value: %d\n", ret);
 			abort();
@@ -375,66 +364,15 @@ static int t_relay_to( struct sip_msg  *p_msg , char *str_ip , char *str_port)
 
 static int t_relay( struct sip_msg  *p_msg , char* foo, char* bar)
 {
-   unsigned int     ip, port;
-
-   if ( get_ip_and_port_from_uri( p_msg , &ip, &port)<0 )
-   {
-      LOG( L_ERR , "ERROR: t_on_request_received_uri: unable to extract ip and port from uri!\n" );
-      return -1;
-   }
-
-   return t_relay_to( p_msg , ( char *) ip , (char *) port );
-}
-
-
-
-static int t_relay_no_forward( struct sip_msg  *p_msg )
-{
-
-	enum addifnew_status status;
-	int ret;
-
-	status = t_addifnew( p_msg );
-
-	switch( status ) {
-		case AIN_ERROR:		/*  fatal error (e.g, parsing) occured */
-			ret = 0;
-			break;
-
-		case AIN_RETR:		/* it's a retransmission */
-			if ( !t_retransmit_reply( p_msg ) )
-			{
-				DBG( "SER: WARNING: bad t_retransmit_reply\n");
-			}
-			ret = 1;
-			break;
-
-		case AIN_NEW:		/* it's a new request */
-			ret = 1;
-			break;
-
-		case AIN_NEWACK:	/* it's an ACK for which no transaction exists */
-			ret=1;
-			break;
+	unsigned int     ip, port;
 
-		case AIN_OLDACK:	/* it's an ACK for an existing transaction */
-			DBG( "SER: ACK received -> t_release\n");
-			if ( !t_release_transaction( p_msg ) )
-			{
-				DBG( "SER: WARNING: bad t_release\n");
-			}
-			ret = 1;
-			break;
-
-		default:
-			LOG(L_CRIT, "ERROR: unexpected addifnew return value: %d\n", ret);
-			abort();
-	};
-	if (T) {
-		T_UNREF( T );
+	if ( get_ip_and_port_from_uri( p_msg , &ip, &port)<0 )
+	{
+		LOG( L_ERR , "ERROR: t_on_request_received_uri: unable"
+			" to extract ip and port from uri!\n" );
+		return -1;
 	}
-	return ret;
+	return t_relay_to( p_msg , ( char *) ip , (char *) port );
 }
 
 
-

+ 1 - 2
msg_translator.c

@@ -438,8 +438,7 @@ char * build_req_buf_from_sip_req(	struct sip_msg* msg,
 						default:
 							/* only ADD allowed for before/after */
 							LOG(L_CRIT, "BUG:build_req_buf_from_sip_req: "
-									"invalid op for data lump (%x)\n", r->op);
-
+									"invalid op for data lump (%x)\n",r->op);
 					}
 				}
 				/* process main (del only) */