Browse code

- 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 authored on 26/09/2003 16:23:08
Showing 3 changed files
... ...
@@ -67,6 +67,8 @@
67 67
  *  2003-07-07  added t_relay_to_tls, t_replicate_tls, t_forward_nonack_tls
68 68
  *              added #ifdef USE_TCP, USE_TLS
69 69
  *              removed t_relay_{udp,tcp,tls} (andrei)
70
+ *  2003-09-26  added t_forward_nonack_uri() - same as t_forward_nonack() but
71
+ *              takes no parameters -> forwards to uri (bogdan)
70 72
  */
71 73
 
72 74
 
... ...
@@ -137,6 +139,7 @@ inline static int w_t_replicate_tls( struct sip_msg  *p_msg ,
137 139
 				     char *_foo       /* nothing expected */ );
138 140
 #endif
139 141
 inline static int w_t_forward_nonack(struct sip_msg* msg, char* str, char* );
142
+inline static int w_t_forward_nonack_uri(struct sip_msg* msg, char* str,char*);
140 143
 inline static int w_t_forward_nonack_udp(struct sip_msg* msg, char* str,char*);
141 144
 #ifdef USE_TCP
142 145
 inline static int w_t_forward_nonack_tcp(struct sip_msg* msg, char* str,char*);
... ...
@@ -179,6 +182,7 @@ static cmd_export_t cmds[]={
179 182
 	{T_RELAY,              w_t_relay,               0, 0,                    
180 183
 			REQUEST_ROUTE | FAILURE_ROUTE },
181 184
 	{T_FORWARD_NONACK,     w_t_forward_nonack,      2, fixup_hostport2proxy, REQUEST_ROUTE},
185
+	{T_FORWARD_NONACK_URI, w_t_forward_nonack_uri,  0, 0,                    REQUEST_ROUTE},
182 186
 	{T_FORWARD_NONACK_UDP, w_t_forward_nonack_udp,  2, fixup_hostport2proxy, REQUEST_ROUTE},
183 187
 #ifdef USE_TCP
184 188
 	{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)
451 455
 
452 456
 
453 457
 inline static int _w_t_forward_nonack(struct sip_msg* msg, char* proxy,
454
-									 char* _foo, int proto)
458
+																	int proto)
455 459
 {
456 460
 	struct cell *t;
457 461
 	if (t_check( msg , 0 )==-1) {
... ...
@@ -476,20 +480,26 @@ inline static int _w_t_forward_nonack(struct sip_msg* msg, char* proxy,
476 480
 inline static int w_t_forward_nonack( struct sip_msg* msg, char* proxy,
477 481
 										char* foo)
478 482
 {
479
-	return _w_t_forward_nonack(msg, proxy, foo, PROTO_NONE);
483
+	return _w_t_forward_nonack(msg, proxy, PROTO_NONE);
484
+}
485
+
486
+inline static int w_t_forward_nonack_uri(struct sip_msg* msg, char *foo,
487
+																	char *bar)
488
+{
489
+	return _w_t_forward_nonack(msg, 0, PROTO_NONE);
480 490
 }
481 491
 
482 492
 inline static int w_t_forward_nonack_udp( struct sip_msg* msg, char* proxy,
483 493
 										char* foo)
484 494
 {
485
-	return _w_t_forward_nonack(msg, proxy, foo, PROTO_UDP);
495
+	return _w_t_forward_nonack(msg, proxy, PROTO_UDP);
486 496
 }
487 497
 
488 498
 #ifdef USE_TCP
489 499
 inline static int w_t_forward_nonack_tcp( struct sip_msg* msg, char* proxy,
490 500
 										char* foo)
491 501
 {
492
-	return _w_t_forward_nonack(msg, proxy, foo, PROTO_TCP);
502
+	return _w_t_forward_nonack(msg, proxy, PROTO_TCP);
493 503
 }
494 504
 #endif
495 505
 
... ...
@@ -497,7 +507,7 @@ inline static int w_t_forward_nonack_tcp( struct sip_msg* msg, char* proxy,
497 507
 inline static int w_t_forward_nonack_tls( struct sip_msg* msg, char* proxy,
498 508
 										char* foo)
499 509
 {
500
-	return _w_t_forward_nonack(msg, proxy, foo, PROTO_TLS);
510
+	return _w_t_forward_nonack(msg, proxy, PROTO_TLS);
501 511
 }
502 512
 #endif
503 513
 
... ...
@@ -62,35 +62,40 @@ int load_tm( struct tm_binds *tmb)
62 62
 		LOG( L_ERR, LOAD_ERROR "'t_reply' not found\n");
63 63
 		return -1;
64 64
 	}
65
-	if (!(tmb->t_reply_with_body=(treply_wb_f)find_export(T_REPLY_WB, NO_SCRIPT, 0)) ) {
66
-	        LOG( L_ERR, LOAD_ERROR "'t_reply' not found\n");
65
+	if (!(tmb->t_reply_with_body=(treply_wb_f)find_export
66
+	(T_REPLY_WB, NO_SCRIPT, 0)) ) {
67
+		LOG( L_ERR, LOAD_ERROR "'t_reply_with_body' not found\n");
67 68
 		return -1;
68 69
 	}
69
-	if (!(tmb->t_is_local=(tislocal_f)find_export(T_IS_LOCAL, NO_SCRIPT, 0)) ) {
70
-	        LOG( L_ERR, LOAD_ERROR "'t_get_trans_ident' not found\n");
70
+	if (!(tmb->t_is_local=(tislocal_f)find_export(T_IS_LOCAL,NO_SCRIPT,0)) ) {
71
+		LOG( L_ERR, LOAD_ERROR "'t_get_trans_ident' not found\n");
71 72
 		return -1;
72 73
 	}
73
-	if (!(tmb->t_get_trans_ident=(tget_ti_f)find_export(T_GET_TI, NO_SCRIPT, 0)) ) {
74
-	        LOG( L_ERR, LOAD_ERROR "'t_get_trans_ident' not found\n");
74
+	if (!(tmb->t_get_trans_ident=(tget_ti_f)find_export
75
+	(T_GET_TI, NO_SCRIPT, 0)) ) {
76
+		LOG( L_ERR, LOAD_ERROR "'t_get_trans_ident' not found\n");
75 77
 		return -1;
76 78
 	}
77
-	if (!(tmb->t_lookup_ident=(tlookup_ident_f)find_export(T_LOOKUP_IDENT, NO_SCRIPT, 0)) ) {
78
-	        LOG( L_ERR, LOAD_ERROR "'t_lookup_ident' not found\n");
79
+	if (!(tmb->t_lookup_ident=(tlookup_ident_f)find_export
80
+	(T_LOOKUP_IDENT, NO_SCRIPT, 0)) ) {
81
+		LOG( L_ERR, LOAD_ERROR "'t_lookup_ident' not found\n");
79 82
 		return -1;
80 83
 	}
81
-	if (!(tmb->t_addblind=(taddblind_f)find_export(T_ADDBLIND, NO_SCRIPT, 0)) ) {
82
-	        LOG( L_ERR, LOAD_ERROR "'addblind' not found\n");
84
+	if (!(tmb->t_addblind=(taddblind_f)find_export(T_ADDBLIND,NO_SCRIPT,0))) {
85
+		LOG( L_ERR, LOAD_ERROR "'addblind' not found\n");
83 86
 		return -1;
84 87
 	}
85
-	if (!(tmb->t_forward_nonack=(tfwd_f)find_export(T_FORWARD_NONACK , 2, 0)) ) {
88
+	if (!(tmb->t_forward_nonack=(tfwd_f)find_export(T_FORWARD_NONACK,2,0))) {
86 89
 		LOG( L_ERR, LOAD_ERROR "'t_forward_nonack' not found\n");
87 90
 		return -1;
88 91
 	}
89
-	if (!(tmb->t_request_within=(reqwith_t)find_export("t_request_within", NO_SCRIPT, 0)) ) {
92
+	if (!(tmb->t_request_within=(reqwith_t)find_export
93
+	("t_request_within", NO_SCRIPT, 0)) ) {
90 94
 		LOG( L_ERR, LOAD_ERROR "'t_request_within' not found\n");
91 95
 		return -1;
92 96
 	}
93
-	if (!(tmb->t_request_outside=(reqout_t)find_export("t_request_outside", NO_SCRIPT, 0)) ) {
97
+	if (!(tmb->t_request_outside=(reqout_t)find_export
98
+	("t_request_outside", NO_SCRIPT, 0)) ) {
94 99
 		LOG( L_ERR, LOAD_ERROR "'t_request_outside' not found\n");
95 100
 		return -1;
96 101
 	}
... ...
@@ -98,19 +103,23 @@ int load_tm( struct tm_binds *tmb)
98 103
 		LOG( L_ERR, LOAD_ERROR "'t_request' not found\n");
99 104
 		return -1;
100 105
 	}
101
-	if (!(tmb->new_dlg_uac=(new_dlg_uac_f)find_export("new_dlg_uac", NO_SCRIPT, 0)) ) {
106
+	if (!(tmb->new_dlg_uac=(new_dlg_uac_f)find_export
107
+	("new_dlg_uac", NO_SCRIPT, 0)) ) {
102 108
 		LOG( L_ERR, LOAD_ERROR "'new_dlg_uac' not found\n");
103 109
 		return -1;
104 110
 	}
105
-        if (!(tmb->dlg_response_uac=(dlg_response_uac_f)find_export("dlg_response_uac", NO_SCRIPT, 0)) ) {
111
+	if (!(tmb->dlg_response_uac=(dlg_response_uac_f)find_export
112
+	("dlg_response_uac", NO_SCRIPT, 0)) ) {
106 113
 		LOG( L_ERR, LOAD_ERROR "'dlg_response_uac' not found\n");
107 114
 		return -1;
108
-        }
109
-        if (!(tmb->new_dlg_uas=(new_dlg_uas_f)find_export("new_dlg_uas", NO_SCRIPT, 0)) ) {
115
+	}
116
+	if (!(tmb->new_dlg_uas=(new_dlg_uas_f)find_export
117
+	("new_dlg_uas", NO_SCRIPT, 0)) ) {
110 118
 		LOG( L_ERR, LOAD_ERROR "'new_dlg_uas' not found\n");
111 119
 		return -1;
112 120
 	}
113
-        if (!(tmb->dlg_request_uas=(dlg_request_uas_f)find_export("dlg_request_uas", NO_SCRIPT, 0)) ) {
121
+	if (!(tmb->dlg_request_uas=(dlg_request_uas_f)find_export
122
+	("dlg_request_uas", NO_SCRIPT, 0)) ) {
114 123
 		LOG( L_ERR, LOAD_ERROR "'dlg_request_uas' not found\n");
115 124
 		return -1;
116 125
 	}
... ...
@@ -118,10 +127,10 @@ int load_tm( struct tm_binds *tmb)
118 127
 		LOG( L_ERR, LOAD_ERROR "'free_dlg' not found\n");
119 128
 		return -1;
120 129
 	}
121
-	if (!(tmb->print_dlg=(print_dlg_f)find_export("print_dlg", NO_SCRIPT, 0)) ) {
130
+	if (!(tmb->print_dlg=(print_dlg_f)find_export("print_dlg",NO_SCRIPT,0))) {
122 131
 		LOG( L_ERR, LOAD_ERROR "'print_dlg' not found\n");
123 132
 		return -1;
124 133
 	}
125
-	
134
+
126 135
 	return 1;
127 136
 }
... ...
@@ -59,6 +59,7 @@
59 59
 #define T_ADDBLIND           "t_add_blind"
60 60
 #define T_REPLY_UNSAFE       "t_reply_unsafe"
61 61
 #define T_FORWARD_NONACK     "t_forward_nonack"
62
+#define T_FORWARD_NONACK_URI "t_forward_nonack_uri"
62 63
 #define T_FORWARD_NONACK_UDP "t_forward_nonack_udp"
63 64
 #define T_FORWARD_NONACK_TCP "t_forward_nonack_tcp"
64 65
 #define T_FORWARD_NONACK_TLS "t_forward_nonack_tls"