Explorar el Código

- added t_forward_nonack_uri() - same as t_forward_nonack() but takes no
parameters -> forwards to uri
- not added in tm_load structure - no use for it for the moment

Bogdan-Andrei Iancu hace 22 años
padre
commit
6be7215628
Se han modificado 3 ficheros con 45 adiciones y 25 borrados
  1. 15 5
      modules/tm/tm.c
  2. 29 20
      modules/tm/tm_load.c
  3. 1 0
      modules/tm/tm_load.h

+ 15 - 5
modules/tm/tm.c

@@ -67,6 +67,8 @@
  *  2003-07-07  added t_relay_to_tls, t_replicate_tls, t_forward_nonack_tls
  *              added #ifdef USE_TCP, USE_TLS
  *              removed t_relay_{udp,tcp,tls} (andrei)
+ *  2003-09-26  added t_forward_nonack_uri() - same as t_forward_nonack() but
+ *              takes no parameters -> forwards to uri (bogdan)
  */
 
 
@@ -137,6 +139,7 @@ inline static int w_t_replicate_tls( struct sip_msg  *p_msg ,
 				     char *_foo       /* nothing expected */ );
 #endif
 inline static int w_t_forward_nonack(struct sip_msg* msg, char* str, char* );
+inline static int w_t_forward_nonack_uri(struct sip_msg* msg, char* str,char*);
 inline static int w_t_forward_nonack_udp(struct sip_msg* msg, char* str,char*);
 #ifdef USE_TCP
 inline static int w_t_forward_nonack_tcp(struct sip_msg* msg, char* str,char*);
@@ -179,6 +182,7 @@ static cmd_export_t cmds[]={
 	{T_RELAY,              w_t_relay,               0, 0,                    
 			REQUEST_ROUTE | FAILURE_ROUTE },
 	{T_FORWARD_NONACK,     w_t_forward_nonack,      2, fixup_hostport2proxy, REQUEST_ROUTE},
+	{T_FORWARD_NONACK_URI, w_t_forward_nonack_uri,  0, 0,                    REQUEST_ROUTE},
 	{T_FORWARD_NONACK_UDP, w_t_forward_nonack_udp,  2, fixup_hostport2proxy, REQUEST_ROUTE},
 #ifdef USE_TCP
 	{T_FORWARD_NONACK_TCP, w_t_forward_nonack_tcp,  2, fixup_hostport2proxy, REQUEST_ROUTE},
@@ -451,7 +455,7 @@ inline static int w_t_check(struct sip_msg* msg, char* str, char* str2)
 
 
 inline static int _w_t_forward_nonack(struct sip_msg* msg, char* proxy,
-									 char* _foo, int proto)
+																	int proto)
 {
 	struct cell *t;
 	if (t_check( msg , 0 )==-1) {
@@ -476,20 +480,26 @@ inline static int _w_t_forward_nonack(struct sip_msg* msg, char* proxy,
 inline static int w_t_forward_nonack( struct sip_msg* msg, char* proxy,
 										char* foo)
 {
-	return _w_t_forward_nonack(msg, proxy, foo, PROTO_NONE);
+	return _w_t_forward_nonack(msg, proxy, PROTO_NONE);
+}
+
+inline static int w_t_forward_nonack_uri(struct sip_msg* msg, char *foo,
+																	char *bar)
+{
+	return _w_t_forward_nonack(msg, 0, PROTO_NONE);
 }
 
 inline static int w_t_forward_nonack_udp( struct sip_msg* msg, char* proxy,
 										char* foo)
 {
-	return _w_t_forward_nonack(msg, proxy, foo, PROTO_UDP);
+	return _w_t_forward_nonack(msg, proxy, PROTO_UDP);
 }
 
 #ifdef USE_TCP
 inline static int w_t_forward_nonack_tcp( struct sip_msg* msg, char* proxy,
 										char* foo)
 {
-	return _w_t_forward_nonack(msg, proxy, foo, PROTO_TCP);
+	return _w_t_forward_nonack(msg, proxy, PROTO_TCP);
 }
 #endif
 
@@ -497,7 +507,7 @@ inline static int w_t_forward_nonack_tcp( struct sip_msg* msg, char* proxy,
 inline static int w_t_forward_nonack_tls( struct sip_msg* msg, char* proxy,
 										char* foo)
 {
-	return _w_t_forward_nonack(msg, proxy, foo, PROTO_TLS);
+	return _w_t_forward_nonack(msg, proxy, PROTO_TLS);
 }
 #endif
 

+ 29 - 20
modules/tm/tm_load.c

@@ -62,35 +62,40 @@ int load_tm( struct tm_binds *tmb)
 		LOG( L_ERR, LOAD_ERROR "'t_reply' not found\n");
 		return -1;
 	}
-	if (!(tmb->t_reply_with_body=(treply_wb_f)find_export(T_REPLY_WB, NO_SCRIPT, 0)) ) {
-	        LOG( L_ERR, LOAD_ERROR "'t_reply' not found\n");
+	if (!(tmb->t_reply_with_body=(treply_wb_f)find_export
+	(T_REPLY_WB, NO_SCRIPT, 0)) ) {
+		LOG( L_ERR, LOAD_ERROR "'t_reply_with_body' not found\n");
 		return -1;
 	}
-	if (!(tmb->t_is_local=(tislocal_f)find_export(T_IS_LOCAL, NO_SCRIPT, 0)) ) {
-	        LOG( L_ERR, LOAD_ERROR "'t_get_trans_ident' not found\n");
+	if (!(tmb->t_is_local=(tislocal_f)find_export(T_IS_LOCAL,NO_SCRIPT,0)) ) {
+		LOG( L_ERR, LOAD_ERROR "'t_get_trans_ident' not found\n");
 		return -1;
 	}
-	if (!(tmb->t_get_trans_ident=(tget_ti_f)find_export(T_GET_TI, NO_SCRIPT, 0)) ) {
-	        LOG( L_ERR, LOAD_ERROR "'t_get_trans_ident' not found\n");
+	if (!(tmb->t_get_trans_ident=(tget_ti_f)find_export
+	(T_GET_TI, NO_SCRIPT, 0)) ) {
+		LOG( L_ERR, LOAD_ERROR "'t_get_trans_ident' not found\n");
 		return -1;
 	}
-	if (!(tmb->t_lookup_ident=(tlookup_ident_f)find_export(T_LOOKUP_IDENT, NO_SCRIPT, 0)) ) {
-	        LOG( L_ERR, LOAD_ERROR "'t_lookup_ident' not found\n");
+	if (!(tmb->t_lookup_ident=(tlookup_ident_f)find_export
+	(T_LOOKUP_IDENT, NO_SCRIPT, 0)) ) {
+		LOG( L_ERR, LOAD_ERROR "'t_lookup_ident' not found\n");
 		return -1;
 	}
-	if (!(tmb->t_addblind=(taddblind_f)find_export(T_ADDBLIND, NO_SCRIPT, 0)) ) {
-	        LOG( L_ERR, LOAD_ERROR "'addblind' not found\n");
+	if (!(tmb->t_addblind=(taddblind_f)find_export(T_ADDBLIND,NO_SCRIPT,0))) {
+		LOG( L_ERR, LOAD_ERROR "'addblind' not found\n");
 		return -1;
 	}
-	if (!(tmb->t_forward_nonack=(tfwd_f)find_export(T_FORWARD_NONACK , 2, 0)) ) {
+	if (!(tmb->t_forward_nonack=(tfwd_f)find_export(T_FORWARD_NONACK,2,0))) {
 		LOG( L_ERR, LOAD_ERROR "'t_forward_nonack' not found\n");
 		return -1;
 	}
-	if (!(tmb->t_request_within=(reqwith_t)find_export("t_request_within", NO_SCRIPT, 0)) ) {
+	if (!(tmb->t_request_within=(reqwith_t)find_export
+	("t_request_within", NO_SCRIPT, 0)) ) {
 		LOG( L_ERR, LOAD_ERROR "'t_request_within' not found\n");
 		return -1;
 	}
-	if (!(tmb->t_request_outside=(reqout_t)find_export("t_request_outside", NO_SCRIPT, 0)) ) {
+	if (!(tmb->t_request_outside=(reqout_t)find_export
+	("t_request_outside", NO_SCRIPT, 0)) ) {
 		LOG( L_ERR, LOAD_ERROR "'t_request_outside' not found\n");
 		return -1;
 	}
@@ -98,19 +103,23 @@ int load_tm( struct tm_binds *tmb)
 		LOG( L_ERR, LOAD_ERROR "'t_request' not found\n");
 		return -1;
 	}
-	if (!(tmb->new_dlg_uac=(new_dlg_uac_f)find_export("new_dlg_uac", NO_SCRIPT, 0)) ) {
+	if (!(tmb->new_dlg_uac=(new_dlg_uac_f)find_export
+	("new_dlg_uac", NO_SCRIPT, 0)) ) {
 		LOG( L_ERR, LOAD_ERROR "'new_dlg_uac' not found\n");
 		return -1;
 	}
-        if (!(tmb->dlg_response_uac=(dlg_response_uac_f)find_export("dlg_response_uac", NO_SCRIPT, 0)) ) {
+	if (!(tmb->dlg_response_uac=(dlg_response_uac_f)find_export
+	("dlg_response_uac", NO_SCRIPT, 0)) ) {
 		LOG( L_ERR, LOAD_ERROR "'dlg_response_uac' not found\n");
 		return -1;
-        }
-        if (!(tmb->new_dlg_uas=(new_dlg_uas_f)find_export("new_dlg_uas", NO_SCRIPT, 0)) ) {
+	}
+	if (!(tmb->new_dlg_uas=(new_dlg_uas_f)find_export
+	("new_dlg_uas", NO_SCRIPT, 0)) ) {
 		LOG( L_ERR, LOAD_ERROR "'new_dlg_uas' not found\n");
 		return -1;
 	}
-        if (!(tmb->dlg_request_uas=(dlg_request_uas_f)find_export("dlg_request_uas", NO_SCRIPT, 0)) ) {
+	if (!(tmb->dlg_request_uas=(dlg_request_uas_f)find_export
+	("dlg_request_uas", NO_SCRIPT, 0)) ) {
 		LOG( L_ERR, LOAD_ERROR "'dlg_request_uas' not found\n");
 		return -1;
 	}
@@ -118,10 +127,10 @@ int load_tm( struct tm_binds *tmb)
 		LOG( L_ERR, LOAD_ERROR "'free_dlg' not found\n");
 		return -1;
 	}
-	if (!(tmb->print_dlg=(print_dlg_f)find_export("print_dlg", NO_SCRIPT, 0)) ) {
+	if (!(tmb->print_dlg=(print_dlg_f)find_export("print_dlg",NO_SCRIPT,0))) {
 		LOG( L_ERR, LOAD_ERROR "'print_dlg' not found\n");
 		return -1;
 	}
-	
+
 	return 1;
 }

+ 1 - 0
modules/tm/tm_load.h

@@ -59,6 +59,7 @@
 #define T_ADDBLIND           "t_add_blind"
 #define T_REPLY_UNSAFE       "t_reply_unsafe"
 #define T_FORWARD_NONACK     "t_forward_nonack"
+#define T_FORWARD_NONACK_URI "t_forward_nonack_uri"
 #define T_FORWARD_NONACK_UDP "t_forward_nonack_udp"
 #define T_FORWARD_NONACK_TCP "t_forward_nonack_tcp"
 #define T_FORWARD_NONACK_TLS "t_forward_nonack_tls"