Browse code

core, lib, modules: restructured source code tree

- new folder src/ to hold the source code for main project applications
- main.c is in src/
- all core files are subfolder are in src/core/
- modules are in src/modules/
- libs are in src/lib/
- application Makefiles are in src/
- application binary is built in src/ (src/kamailio)

Daniel-Constantin Mierla authored on 07/12/2016 11:03:51
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,241 +0,0 @@
1
-/*
2
- * Copyright (C) 2001-2003 FhG Fokus
3
- *
4
- * This file is part of Kamailio, a free SIP server.
5
- *
6
- * Kamailio is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License, or
9
- * (at your option) any later version
10
- *
11
- * Kamailio is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License 
17
- * along with this program; if not, write to the Free Software 
18
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
19
- */
20
-
21
-
22
-
23
-#ifndef _T_REPLY_H
24
-#define _T_REPLY_H
25
-
26
-#include "defs.h"
27
-#include "../../rpc.h"
28
-#include "../../tags.h"
29
-
30
-#include "h_table.h"
31
-
32
-
33
-/* reply processing status */
34
-enum rps {
35
-	/* something bad happened */
36
-	RPS_ERROR=0,	
37
-	/* transaction completed but we still accept the reply */
38
-	RPS_PUSHED_AFTER_COMPLETION,
39
-	/* reply discarded */
40
-	RPS_DISCARDED,
41
-	/* reply stored for later processing */
42
-	RPS_STORE,
43
-	/* transaction completed */
44
-	RPS_COMPLETED,
45
-	/* provisional reply not affecting transaction state */
46
-	RPS_PROVISIONAL
47
-};
48
-
49
-extern char tm_tags[TOTAG_VALUE_LEN];
50
-extern char *tm_tag_suffix;
51
-
52
-extern int goto_on_sl_reply;
53
-
54
-extern int failure_reply_mode;
55
-
56
-extern int faked_reply_prio;
57
-
58
-extern int tm_rich_redirect;
59
- 
60
-/* has this to-tag been never seen in previous 200/INVs? */
61
-int unmatched_totag(struct cell *t, struct sip_msg *ack);
62
-
63
-/* branch bitmap type */
64
-typedef unsigned int branch_bm_t;
65
-
66
-#ifdef CANCEL_REASON_SUPPORT
67
-
68
-/* reason building blocks (see rfc3326) */
69
-#define REASON_PREFIX "Reason: SIP;cause="
70
-#define REASON_PREFIX_LEN (sizeof(REASON_PREFIX)-1)
71
-#define REASON_TEXT ";text="
72
-#define REASON_TEXT_LEN (sizeof(REASON_TEXT)-1)
73
-
74
-#define CANCEL_REAS_UNKNOWN 0
75
-#define CANCEL_REAS_PACKED_HDRS -1
76
-#define CANCEL_REAS_RCVD_CANCEL -2
77
-#define CANCEL_REAS_FINAL_REPLY(x) (x)
78
-#define CANCEL_REAS_MIN CANCEL_REAS_RCVD_CANCEL
79
-
80
-
81
-/** cancel reason structure.*/
82
-struct cancel_reason {
83
-	short cause; /**< 0 = unknown, -1 =  cancel, > 0 final reply code. */
84
-	union{
85
-		str text; /**< reason text if reason is final reply .*/
86
-		struct sip_msg* e2e_cancel; /**< cancel msg if reason is cancel. */
87
-		str packed_hdrs; /**< complete reason headers. */
88
-	}u;
89
-};
90
-
91
-struct cancel_info {
92
-	branch_bm_t cancel_bitmap; /**< cancel branch bitmap */
93
-	struct cancel_reason reason;
94
-};
95
-
96
-
97
-#define init_cancel_reason(cr) \
98
-	do {\
99
-		(cr)->cause=0; \
100
-		(cr)->u.e2e_cancel=0; \
101
-	} while(0)
102
-
103
-#define init_cancel_info(ci) \
104
-	do {\
105
-		(ci)->cancel_bitmap=0; \
106
-		init_cancel_reason(&(ci)->reason); \
107
-	}while (0);
108
-
109
-#else /* ! CANCEL_REASON_SUPPORT */
110
-
111
-struct cancel_info {
112
-	branch_bm_t cancel_bitmap; /**< cancel branch bitmap */
113
-};
114
-
115
-#define init_cancel_info(ci) \
116
-	do {\
117
-		(ci)->cancel_bitmap=0; \
118
-	}while (0);
119
-
120
-#endif /* CANCEL_REASON_SUPPORT */
121
-
122
-
123
-/* reply export types */
124
-typedef int (*treply_f)(struct sip_msg * , unsigned int , char * );
125
-typedef int (*treply_wb_f)( struct cell* trans,
126
-	unsigned int code, str *text, str *body,
127
-	str *new_header, str *to_tag);
128
-typedef int (*treply_trans_f)(struct cell *t, struct sip_msg* p_msg, unsigned int code,
129
-	char * text);
130
-
131
-/* wrapper function needed after changes in w_t_reply */
132
-int w_t_reply_wrp(struct sip_msg *m, unsigned int code, char *txt);
133
-
134
-typedef int (*tget_reply_totag_f)(struct sip_msg *, str *);
135
-int t_get_reply_totag(struct sip_msg *msg, str *totag);
136
-
137
-void tm_reply_mutex_lock(tm_cell_t *t);
138
-void tm_reply_mutex_unlock(tm_cell_t *t);
139
-
140
-#define LOCK_REPLIES(_t) tm_reply_mutex_lock((_t))
141
-#define UNLOCK_REPLIES(_t) tm_reply_mutex_unlock((_t))
142
-
143
-/* This function is called whenever a reply for our module is received;
144
- * we need to register this function on module initialization;
145
- * Returns :   0 - core router stops
146
- *             1 - core router relay statelessly
147
- */
148
-int reply_received( struct sip_msg  *p_msg ) ;
149
-
150
-/* return 1 if a failure_route processes */
151
-int run_failure_handlers(struct cell *t, struct sip_msg *rpl,
152
-					int code, int extra_flags);
153
-typedef int (*run_failure_handlers_f)(struct cell*, struct sip_msg*, int, int);
154
-
155
-/* return 1 if a branch_failure_route processes */
156
-int run_branch_failure_handlers(struct cell *t, struct sip_msg *rpl,
157
-					int code, int extra_flags);
158
-typedef int (*run_branch_failure_handlers_f)(struct cell*, struct sip_msg*, int, int);
159
-
160
-
161
-/* Retransmits the last sent inbound reply.
162
- * Returns  -1 - error
163
- *           1 - OK
164
- 
165
- *int t_retransmit_reply(struct sip_msg *);
166
-*/
167
-
168
-/* send a UAS reply
169
- * Warning: 'buf' and 'len' should already have been build.
170
- * returns 1 if everything was OK or -1 for error
171
- */
172
-
173
-
174
-int t_reply_with_body(struct cell *trans, unsigned int code,
175
-		str *text, str *body, str *new_header, str *to_tag);
176
-
177
-
178
-/* send a UAS reply
179
- * returns 1 if everything was OK or -1 for error
180
- */
181
-int t_reply( struct cell *t, struct sip_msg * , unsigned int , char * );
182
-/* the same as t_reply, except it does not claim
183
-   REPLY_LOCK -- useful to be called within reply
184
-   processing
185
-*/
186
-int t_reply_unsafe( struct cell *t, struct sip_msg * , unsigned int , char * );
187
-
188
-
189
-enum rps relay_reply( struct cell *t, struct sip_msg *p_msg, int branch,
190
-	unsigned int msg_status, struct cancel_info *cancel_data,
191
-	int do_put_on_wait );
192
-
193
-enum rps local_reply( struct cell *t, struct sip_msg *p_msg, int branch,
194
-	unsigned int msg_status, struct cancel_info *cancel_data );
195
-
196
-void set_final_timer( /* struct s_table *h_table,*/ struct cell *t );
197
-
198
-void cleanup_uac_timers( struct cell *t );
199
-
200
-void on_failure_reply( struct cell* t, struct sip_msg* msg,
201
-	int code, void *param  );
202
-
203
-/* set which 'reply' structure to take if only negative
204
-   replies arrive 
205
-*/
206
-void t_on_failure( unsigned int go_to );
207
-unsigned int get_on_failure(void);
208
-void t_on_branch_failure( unsigned int go_to );
209
-unsigned int get_on_branch_failure(void);
210
-void t_on_reply( unsigned int go_to );
211
-unsigned int get_on_reply(void);
212
-
213
-int t_retransmit_reply( struct cell *t );
214
-
215
-void tm_init_tags(void);
216
-
217
-/* selects the branch for fwd-ing the reply */
218
-int t_pick_branch(int inc_branch, int inc_code, struct cell *t, int *res_code);
219
-/* checks the selected branch from failure_route */
220
-int t_pick_branch_blind(struct cell *t, int *res_code);
221
-
222
-/* drops all the replies to make sure
223
- * that none of them is picked up again
224
- */
225
-void t_drop_replies(int v);
226
-
227
-void rpc_reply(rpc_t* rpc, void* c);
228
-
229
-void faked_env( struct cell *t,struct sip_msg *msg, int is_async_env);
230
-int fake_req(struct sip_msg *faked_req,
231
-		struct sip_msg *shmem_msg, int extra_flags, struct ua_client *uac);
232
-
233
-void free_faked_req(struct sip_msg *faked_req, struct cell *t);
234
-
235
-typedef int (*tget_picked_f)(void);
236
-int t_get_picked_branch(void);
237
-
238
-int t_get_this_branch_instance(struct sip_msg *msg, str *instance);
239
-int t_get_this_branch_ruid(struct sip_msg *msg, str *ruid);
240
-
241
-#endif
Browse code

tm: reply_lock per transaction made re-entrant

- on a report by Jason Penton
- re-ordered some includes to get rid of cross dependencies in defines

Daniel-Constantin Mierla authored on 28/03/2015 13:31:59
Showing 1 changed files
... ...
@@ -23,11 +23,6 @@
23 23
 #ifndef _T_REPLY_H
24 24
 #define _T_REPLY_H
25 25
 
26
-/* CANCEL_REASON_SUPPORT on by default */
27
-#ifndef NO_CANCEL_REASON_SUPPORT
28
-#define CANCEL_REASON_SUPPORT
29
-#endif /* NO_CANCEL_REASON_SUPPORT */
30
-
31 26
 #include "defs.h"
32 27
 #include "../../rpc.h"
33 28
 #include "../../tags.h"
... ...
@@ -139,8 +134,11 @@ int w_t_reply_wrp(struct sip_msg *m, unsigned int code, char *txt);
139 134
 typedef int (*tget_reply_totag_f)(struct sip_msg *, str *);
140 135
 int t_get_reply_totag(struct sip_msg *msg, str *totag);
141 136
 
142
-#define LOCK_REPLIES(_t) lock(&(_t)->reply_mutex )
143
-#define UNLOCK_REPLIES(_t) unlock(&(_t)->reply_mutex )
137
+void tm_reply_mutex_lock(tm_cell_t *t);
138
+void tm_reply_mutex_unlock(tm_cell_t *t);
139
+
140
+#define LOCK_REPLIES(_t) tm_reply_mutex_lock((_t))
141
+#define UNLOCK_REPLIES(_t) tm_reply_mutex_unlock((_t))
144 142
 
145 143
 /* This function is called whenever a reply for our module is received;
146 144
  * we need to register this function on module initialization;
Browse code

tm Remove svn ID, remove history, rename "ser" to "kamailio"

Olle E. Johansson authored on 03/01/2015 15:48:29
Showing 1 changed files
... ...
@@ -1,21 +1,14 @@
1 1
 /*
2
- * $Id$
3
- *
4 2
  * Copyright (C) 2001-2003 FhG Fokus
5 3
  *
6
- * This file is part of ser, a free SIP server.
4
+ * This file is part of Kamailio, a free SIP server.
7 5
  *
8
- * ser is free software; you can redistribute it and/or modify
6
+ * Kamailio is free software; you can redistribute it and/or modify
9 7
  * it under the terms of the GNU General Public License as published by
10 8
  * the Free Software Foundation; either version 2 of the License, or
11 9
  * (at your option) any later version
12 10
  *
13
- * For a license to use the ser software under conditions
14
- * other than those described here, or to purchase support for this
15
- * software, please contact iptel.org by e-mail at the following addresses:
16
- *    info@iptel.org
17
- *
18
- * ser is distributed in the hope that it will be useful,
11
+ * Kamailio is distributed in the hope that it will be useful,
19 12
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 13
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 14
  * GNU General Public License for more details.
Browse code

all: updated FSF address in GPL text

Anthony Messina authored on 04/07/2014 09:36:37 • Daniel-Constantin Mierla committed on 04/07/2014 09:37:36
Showing 1 changed files
... ...
@@ -22,7 +22,7 @@
22 22
  *
23 23
  * You should have received a copy of the GNU General Public License 
24 24
  * along with this program; if not, write to the Free Software 
25
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
25
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
26 26
  */
27 27
 
28 28
 
Browse code

modules/tm: code cleanup removed unused method faked_resp and free_faked_resp

Richard Good authored on 30/10/2013 07:15:51
Showing 1 changed files
... ...
@@ -238,11 +238,8 @@ void rpc_reply(rpc_t* rpc, void* c);
238 238
 void faked_env( struct cell *t,struct sip_msg *msg, int is_async_env);
239 239
 int fake_req(struct sip_msg *faked_req,
240 240
 		struct sip_msg *shmem_msg, int extra_flags, struct ua_client *uac);
241
-int fake_resp(struct sip_msg *faked_req,
242
-		struct sip_msg *shmem_msg, int extra_flags, struct ua_client *uac);
243 241
 
244 242
 void free_faked_req(struct sip_msg *faked_req, struct cell *t);
245
-void free_faked_resp(struct sip_msg *faked_req, struct cell *t, int branch);
246 243
 
247 244
 typedef int (*tget_picked_f)(void);
248 245
 int t_get_picked_branch(void);
Browse code

modules/tm: extended tm async support to SIP responses -t_suspend and t_continue functions now work with SIP responses as well as requests

Richard Good authored on 17/10/2013 14:41:15
Showing 1 changed files
... ...
@@ -238,8 +238,11 @@ void rpc_reply(rpc_t* rpc, void* c);
238 238
 void faked_env( struct cell *t,struct sip_msg *msg, int is_async_env);
239 239
 int fake_req(struct sip_msg *faked_req,
240 240
 		struct sip_msg *shmem_msg, int extra_flags, struct ua_client *uac);
241
+int fake_resp(struct sip_msg *faked_req,
242
+		struct sip_msg *shmem_msg, int extra_flags, struct ua_client *uac);
241 243
 
242 244
 void free_faked_req(struct sip_msg *faked_req, struct cell *t);
245
+void free_faked_resp(struct sip_msg *faked_req, struct cell *t, int branch);
243 246
 
244 247
 typedef int (*tget_picked_f)(void);
245 248
 int t_get_picked_branch(void);
Browse code

modules/tm: extended async usage - enables resuming of tx in orginal route block tx was suspended, not only failure route - dedicated lock to prevent multiple invocations of suspend on tz (reply lock used to be used) - extra flag (T_ASYNC_CONTINUE) to mark a transaction that is being execute post suspend

Jason Penton authored on 30/09/2013 09:14:54
Showing 1 changed files
... ...
@@ -235,7 +235,7 @@ void t_drop_replies(int v);
235 235
 
236 236
 void rpc_reply(rpc_t* rpc, void* c);
237 237
 
238
-void faked_env( struct cell *t,struct sip_msg *msg);
238
+void faked_env( struct cell *t,struct sip_msg *msg, int is_async_env);
239 239
 int fake_req(struct sip_msg *faked_req,
240 240
 		struct sip_msg *shmem_msg, int extra_flags, struct ua_client *uac);
241 241
 
Browse code

modules/tm: Enable named branch_failure routes

- branch failure routes must be named with the format:
-- "tm:branch-failure:myroute"
- and enabled with the function:
-- t_on_branch_failure("myroute")

Hugh Waite authored on 10/04/2013 10:33:15
Showing 1 changed files
... ...
@@ -61,7 +61,6 @@ enum rps {
61 61
 extern char tm_tags[TOTAG_VALUE_LEN];
62 62
 extern char *tm_tag_suffix;
63 63
 
64
-extern int goto_on_branch_failure;
65 64
 extern int goto_on_sl_reply;
66 65
 
67 66
 extern int failure_reply_mode;
... ...
@@ -215,6 +214,8 @@ void on_failure_reply( struct cell* t, struct sip_msg* msg,
215 214
 */
216 215
 void t_on_failure( unsigned int go_to );
217 216
 unsigned int get_on_failure(void);
217
+void t_on_branch_failure( unsigned int go_to );
218
+unsigned int get_on_branch_failure(void);
218 219
 void t_on_reply( unsigned int go_to );
219 220
 unsigned int get_on_reply(void);
220 221
 
Browse code

modules/tm: Make ruid available in uac structure

- ruid is stored per uac
- ruid can be retrieved when a response to the branch is received

Hugh Waite authored on 03/04/2013 14:18:22
Showing 1 changed files
... ...
@@ -244,5 +244,6 @@ typedef int (*tget_picked_f)(void);
244 244
 int t_get_picked_branch(void);
245 245
 
246 246
 int t_get_this_branch_instance(struct sip_msg *msg, str *instance);
247
+int t_get_this_branch_ruid(struct sip_msg *msg, str *ruid);
247 248
 
248 249
 #endif
Browse code

modules/tm: Enable retrieving of branch instance id from uac structure

- Add instance to uac structure and populate when uac created
- Add get_this_branch_instance function to retrieve instance in a branch failure route

Hugh Waite authored on 27/03/2013 14:36:59
Showing 1 changed files
... ...
@@ -215,8 +215,6 @@ void on_failure_reply( struct cell* t, struct sip_msg* msg,
215 215
 */
216 216
 void t_on_failure( unsigned int go_to );
217 217
 unsigned int get_on_failure(void);
218
-void t_on_branch_failure( unsigned int go_to );
219
-unsigned int get_on_branch_failure(void);
220 218
 void t_on_reply( unsigned int go_to );
221 219
 unsigned int get_on_reply(void);
222 220
 
... ...
@@ -245,4 +243,6 @@ void free_faked_req(struct sip_msg *faked_req, struct cell *t);
245 243
 typedef int (*tget_picked_f)(void);
246 244
 int t_get_picked_branch(void);
247 245
 
246
+int t_get_this_branch_instance(struct sip_msg *msg, str *instance);
247
+
248 248
 #endif
Browse code

modules/tm: Create branch-failure event route

Hugh Waite authored on 26/03/2013 11:40:38
Showing 1 changed files
... ...
@@ -61,6 +61,7 @@ enum rps {
61 61
 extern char tm_tags[TOTAG_VALUE_LEN];
62 62
 extern char *tm_tag_suffix;
63 63
 
64
+extern int goto_on_branch_failure;
64 65
 extern int goto_on_sl_reply;
65 66
 
66 67
 extern int failure_reply_mode;
Browse code

modules/tm: Initial revision of branch_failure_route

- New branch_failure_route defined
- cfg route is called but xlog() causes segfault

Hugh Waite authored on 19/03/2013 15:41:55
Showing 1 changed files
... ...
@@ -161,6 +161,11 @@ int run_failure_handlers(struct cell *t, struct sip_msg *rpl,
161 161
 					int code, int extra_flags);
162 162
 typedef int (*run_failure_handlers_f)(struct cell*, struct sip_msg*, int, int);
163 163
 
164
+/* return 1 if a branch_failure_route processes */
165
+int run_branch_failure_handlers(struct cell *t, struct sip_msg *rpl,
166
+					int code, int extra_flags);
167
+typedef int (*run_branch_failure_handlers_f)(struct cell*, struct sip_msg*, int, int);
168
+
164 169
 
165 170
 /* Retransmits the last sent inbound reply.
166 171
  * Returns  -1 - error
... ...
@@ -209,6 +214,8 @@ void on_failure_reply( struct cell* t, struct sip_msg* msg,
209 214
 */
210 215
 void t_on_failure( unsigned int go_to );
211 216
 unsigned int get_on_failure(void);
217
+void t_on_branch_failure( unsigned int go_to );
218
+unsigned int get_on_branch_failure(void);
212 219
 void t_on_reply( unsigned int go_to );
213 220
 unsigned int get_on_reply(void);
214 221
 
Browse code

tm: added t_is_set("target") function

- returns true if the attribute specified by the target parameter is set
for current transaction (e.g., failure_route, branch_route,
onreply_route)
- on_negative was replaced with on_failure internally to be consistent
with config file naming

Daniel-Constantin Mierla authored on 29/06/2012 10:25:24
Showing 1 changed files
... ...
@@ -201,14 +201,14 @@ void set_final_timer( /* struct s_table *h_table,*/ struct cell *t );
201 201
 
202 202
 void cleanup_uac_timers( struct cell *t );
203 203
 
204
-void on_negative_reply( struct cell* t, struct sip_msg* msg,
204
+void on_failure_reply( struct cell* t, struct sip_msg* msg,
205 205
 	int code, void *param  );
206 206
 
207 207
 /* set which 'reply' structure to take if only negative
208 208
    replies arrive 
209 209
 */
210
-void t_on_negative( unsigned int go_to );
211
-unsigned int get_on_negative(void);
210
+void t_on_failure( unsigned int go_to );
211
+unsigned int get_on_failure(void);
212 212
 void t_on_reply( unsigned int go_to );
213 213
 unsigned int get_on_reply(void);
214 214
 
Browse code

modules:tm Other function declaration fixes

Functions in C musn't be declered with an empty parameter list, as (...) is assumed by compiler, resulting in poorly optimized calls

Marius Zbihlei authored on 09/04/2012 08:41:42
Showing 1 changed files
... ...
@@ -165,9 +165,9 @@ typedef int (*run_failure_handlers_f)(struct cell*, struct sip_msg*, int, int);
165 165
 /* Retransmits the last sent inbound reply.
166 166
  * Returns  -1 - error
167 167
  *           1 - OK
168
- */
169
-int t_retransmit_reply( /* struct sip_msg * */  );
170
-
168
+ 
169
+ *int t_retransmit_reply(struct sip_msg *);
170
+*/
171 171
 
172 172
 /* send a UAS reply
173 173
  * Warning: 'buf' and 'len' should already have been build.
... ...
@@ -208,13 +208,13 @@ void on_negative_reply( struct cell* t, struct sip_msg* msg,
208 208
    replies arrive 
209 209
 */
210 210
 void t_on_negative( unsigned int go_to );
211
-unsigned int get_on_negative();
211
+unsigned int get_on_negative(void);
212 212
 void t_on_reply( unsigned int go_to );
213
-unsigned int get_on_reply();
213
+unsigned int get_on_reply(void);
214 214
 
215 215
 int t_retransmit_reply( struct cell *t );
216 216
 
217
-void tm_init_tags();
217
+void tm_init_tags(void);
218 218
 
219 219
 /* selects the branch for fwd-ing the reply */
220 220
 int t_pick_branch(int inc_branch, int inc_code, struct cell *t, int *res_code);
Browse code

modules/tm: add faked_reply_prio parameter to be able to punish faked replies

Thi should fix FS#54.

Alex Hermann authored on 05/08/2011 15:30:57
Showing 1 changed files
... ...
@@ -65,6 +65,10 @@ extern int goto_on_sl_reply;
65 65
 
66 66
 extern int failure_reply_mode;
67 67
 
68
+extern int faked_reply_prio;
69
+
70
+extern int tm_rich_redirect;
71
+ 
68 72
 /* has this to-tag been never seen in previous 200/INVs? */
69 73
 int unmatched_totag(struct cell *t, struct sip_msg *ack);
70 74
 
Browse code

tm: update to make seas module work

- worked from patch provided by Elias Baixas
- new function to build uac cancel exported via API
- several parameters for reply functions converted from char* to str*
as lenght was available or needed anyhow
- updated cancel_uacs() type definition

Daniel-Constantin Mierla authored on 16/08/2010 16:32:48
Showing 1 changed files
... ...
@@ -131,8 +131,8 @@ struct cancel_info {
131 131
 /* reply export types */
132 132
 typedef int (*treply_f)(struct sip_msg * , unsigned int , char * );
133 133
 typedef int (*treply_wb_f)( struct cell* trans,
134
-	unsigned int code, char * text, char * body, 
135
-	char * new_header, char * to_tag);
134
+	unsigned int code, str *text, str *body,
135
+	str *new_header, str *to_tag);
136 136
 typedef int (*treply_trans_f)(struct cell *t, struct sip_msg* p_msg, unsigned int code,
137 137
 	char * text);
138 138
 
... ...
@@ -171,8 +171,8 @@ int t_retransmit_reply( /* struct sip_msg * */  );
171 171
  */
172 172
 
173 173
 
174
-int t_reply_with_body( struct cell *trans, unsigned int code, 
175
-		       char * text, char * body, char * new_header, char * to_tag );
174
+int t_reply_with_body(struct cell *trans, unsigned int code,
175
+		str *text, str *body, str *new_header, str *to_tag);
176 176
 
177 177
 
178 178
 /* send a UAS reply
Browse code

Merge remote branch 'origin/andrei/cancel_reason'

CANCEL Reason support, according to RFC 3326.
The Reason headers are added both for CANCELs generated due to a
received final reply and hop by hop CANCELs generated because of
a received CANCEL. Both cases can be turned on/off individually.

* origin/andrei/cancel_reason:
tm: no reason modparams if compiled with no cancelr. support
tm: option to compile without reason support
tm: docs: reason header modparams and script function
tm: improved Reason support for E2E CANCELs
tm: fix Reason generation for on-the-fly branch CANCELs
tm: CANCEL reason header on/off switches
tm: Reason header copy for received CANCELs
tm: Reason header generation for local CANCELs

Andrei Pelinescu-Onciul authored on 13/08/2010 19:44:36
Showing 0 changed files
Browse code

tm: option to compile without reason support

If compiled with -DNO_CANCEL_REASON_SUPPORT, the reason header
support will not be enabled.

Andrei Pelinescu-Onciul authored on 13/08/2010 15:20:26
Showing 1 changed files
... ...
@@ -30,6 +30,11 @@
30 30
 #ifndef _T_REPLY_H
31 31
 #define _T_REPLY_H
32 32
 
33
+/* CANCEL_REASON_SUPPORT on by default */
34
+#ifndef NO_CANCEL_REASON_SUPPORT
35
+#define CANCEL_REASON_SUPPORT
36
+#endif /* NO_CANCEL_REASON_SUPPORT */
37
+
33 38
 #include "defs.h"
34 39
 #include "../../rpc.h"
35 40
 #include "../../tags.h"
... ...
@@ -64,6 +69,7 @@ int unmatched_totag(struct cell *t, struct sip_msg *ack);
64 69
 /* branch bitmap type */
65 70
 typedef unsigned int branch_bm_t;
66 71
 
72
+#ifdef CANCEL_REASON_SUPPORT
67 73
 
68 74
 /* reason building blocks (see rfc3326) */
69 75
 #define REASON_PREFIX "Reason: SIP;cause="
... ...
@@ -106,6 +112,20 @@ struct cancel_info {
106 112
 		init_cancel_reason(&(ci)->reason); \
107 113
 	}while (0);
108 114
 
115
+#else /* ! CANCEL_REASON_SUPPORT */
116
+
117
+struct cancel_info {
118
+	branch_bm_t cancel_bitmap; /**< cancel branch bitmap */
119
+};
120
+
121
+#define init_cancel_info(ci) \
122
+	do {\
123
+		(ci)->cancel_bitmap=0; \
124
+	}while (0);
125
+
126
+#endif /* CANCEL_REASON_SUPPORT */
127
+
128
+
109 129
 /* reply export types */
110 130
 typedef int (*treply_f)(struct sip_msg * , unsigned int , char * );
111 131
 typedef int (*treply_wb_f)( struct cell* trans,
... ...
@@ -162,12 +182,12 @@ int t_reply( struct cell *t, struct sip_msg * , unsigned int , char * );
162 182
 int t_reply_unsafe( struct cell *t, struct sip_msg * , unsigned int , char * );
163 183
 
164 184
 
165
-enum rps relay_reply( struct cell *t, struct sip_msg *p_msg, int branch, 
185
+enum rps relay_reply( struct cell *t, struct sip_msg *p_msg, int branch,
166 186
 	unsigned int msg_status, struct cancel_info *cancel_data,
167 187
 	int do_put_on_wait );
168 188
 
169 189
 enum rps local_reply( struct cell *t, struct sip_msg *p_msg, int branch,
170
-    unsigned int msg_status, struct cancel_info *cancel_data );
190
+	unsigned int msg_status, struct cancel_info *cancel_data );
171 191
 
172 192
 void set_final_timer( /* struct s_table *h_table,*/ struct cell *t );
173 193
 
Browse code

tm: internal t_reply exported via API

- internal t_reply exported as t_reply_trans - it takes transaction
pointer as parameter
- removed duplicate include of t_reply.h

Daniel-Constantin Mierla authored on 11/05/2010 13:00:42
Showing 1 changed files
... ...
@@ -71,6 +71,8 @@ typedef int (*treply_f)(struct sip_msg * , unsigned int , char * );
71 71
 typedef int (*treply_wb_f)( struct cell* trans,
72 72
 	unsigned int code, char * text, char * body, 
73 73
 	char * new_header, char * to_tag);
74
+typedef int (*treply_trans_f)(struct cell *t, struct sip_msg* p_msg, unsigned int code,
75
+	char * text);
74 76
 
75 77
 /* wrapper function needed after changes in w_t_reply */
76 78
 int w_t_reply_wrp(struct sip_msg *m, unsigned int code, char *txt);
Browse code

tm: branch selection for failure_route controlled by param

- replaced cfg compat mode controlling of branch reply selection for
failure_ route with a parameter: failure_reply_mode
- default value: 0 - keep all branches, use t_drop_replies() for
controlling per transaction in failure_route (default behavior of ser
2.1.x)
1 - drop all branches
2 - drop branches of last serial forking step
3 - automatically drop old branches when a new serial forking step is
initiated (default kamailio 1.5.x behaviour)

Daniel-Constantin Mierla authored on 17/04/2010 11:06:13
Showing 1 changed files
... ...
@@ -58,6 +58,8 @@ extern char *tm_tag_suffix;
58 58
 
59 59
 extern int goto_on_sl_reply;
60 60
 
61
+extern int failure_reply_mode;
62
+
61 63
 /* has this to-tag been never seen in previous 200/INVs? */
62 64
 int unmatched_totag(struct cell *t, struct sip_msg *ack);
63 65
 
Browse code

tm: improved Reason support for E2E CANCELs

When generating CANCELs on-the-fly as response to a received
provisional reply on a branch of an E2E CANCELed transaction,
remember the Reason(s) from the original E2E CANCEL.
Up until now, the Reason was not remembered for branches where no
provisional replies were received (on these branches no CANCEL is
sent, unless cancel_b_method is set to 2 or at a later point a
provisional reply arrives).
Now each time an E2E CANCEL is received the Reason headers are
saved inside the INVITE transaction, for possible use in later
branch CANCEL generation (triggered by receiving a provisional
reply).

Andrei Pelinescu-Onciul authored on 13/03/2010 13:13:40
Showing 1 changed files
... ...
@@ -65,9 +65,18 @@ int unmatched_totag(struct cell *t, struct sip_msg *ack);
65 65
 typedef unsigned int branch_bm_t;
66 66
 
67 67
 
68
+/* reason building blocks (see rfc3326) */
69
+#define REASON_PREFIX "Reason: SIP;cause="
70
+#define REASON_PREFIX_LEN (sizeof(REASON_PREFIX)-1)
71
+#define REASON_TEXT ";text="
72
+#define REASON_TEXT_LEN (sizeof(REASON_TEXT)-1)
73
+
68 74
 #define CANCEL_REAS_UNKNOWN 0
69
-#define CANCEL_REAS_RCVD_CANCEL -1
75
+#define CANCEL_REAS_PACKED_HDRS -1
76
+#define CANCEL_REAS_RCVD_CANCEL -2
70 77
 #define CANCEL_REAS_FINAL_REPLY(x) (x)
78
+#define CANCEL_REAS_MIN CANCEL_REAS_RCVD_CANCEL
79
+
71 80
 
72 81
 /** cancel reason structure.*/
73 82
 struct cancel_reason {
... ...
@@ -75,6 +84,7 @@ struct cancel_reason {
75 84
 	union{
76 85
 		str text; /**< reason text if reason is final reply .*/
77 86
 		struct sip_msg* e2e_cancel; /**< cancel msg if reason is cancel. */
87
+		str packed_hdrs; /**< complete reason headers. */
78 88
 	}u;
79 89
 };
80 90
 
Browse code

tm: rpc doc strings moved to tm.c

Moved all the rpc doc strings into tm.c, close to the rpc exports
declaration. This will also allow automatic documentation
generation for the rpcs (the script that generates the rpc docs,
parses C code and cannot "resolve" symbols defined in other
files).

Andrei Pelinescu-Onciul authored on 07/03/2010 11:52:27
Showing 1 changed files
... ...
@@ -155,7 +155,6 @@ int t_pick_branch_blind(struct cell *t, int *res_code);
155 155
  */
156 156
 void t_drop_replies(int v);
157 157
 
158
-extern const char* rpc_reply_doc[2];
159 158
 void rpc_reply(rpc_t* rpc, void* c);
160 159
 
161 160
 void faked_env( struct cell *t,struct sip_msg *msg);
Browse code

tm: Reason header generation for local CANCELs

When cancel-ing branches due to final reply, 2xx or 6xx, add a
Reason header (according to RFC3326).

E.g.: Reason: SIP;cause=200

Internal implementation notes: the branch_bm_t/cancel_bitmap
parameter of many of the reply and cancel functions was replaced
with a bigger structure that contains all the information
associated with the cancel: the cancel branch bitmap, the reason
and reason text (optional) or the received cancel message (if
any).
Note that the current commit does not implement copying Reason
headers from a received CANCEL, it deals only with CANCEL
generated locally because of a final reply, 2xx or 6xx.

Andrei Pelinescu-Onciul authored on 01/03/2010 17:40:19
Showing 1 changed files
... ...
@@ -64,6 +64,38 @@ int unmatched_totag(struct cell *t, struct sip_msg *ack);
64 64
 /* branch bitmap type */
65 65
 typedef unsigned int branch_bm_t;
66 66
 
67
+
68
+#define CANCEL_REAS_UNKNOWN 0
69
+#define CANCEL_REAS_RCVD_CANCEL -1
70
+#define CANCEL_REAS_FINAL_REPLY(x) (x)
71
+
72
+/** cancel reason structure.*/
73
+struct cancel_reason {
74
+	short cause; /**< 0 = unknown, -1 =  cancel, > 0 final reply code. */
75
+	union{
76
+		str text; /**< reason text if reason is final reply .*/
77
+		struct sip_msg* e2e_cancel; /**< cancel msg if reason is cancel. */
78
+	}u;
79
+};
80
+
81
+struct cancel_info {
82
+	branch_bm_t cancel_bitmap; /**< cancel branch bitmap */
83
+	struct cancel_reason reason;
84
+};
85
+
86
+
87
+#define init_cancel_reason(cr) \
88
+	do {\
89
+		(cr)->cause=0; \
90
+		(cr)->u.e2e_cancel=0; \
91
+	} while(0)
92
+
93
+#define init_cancel_info(ci) \
94
+	do {\
95
+		(ci)->cancel_bitmap=0; \
96
+		init_cancel_reason(&(ci)->reason); \
97
+	}while (0);
98
+
67 99
 /* reply export types */
68 100
 typedef int (*treply_f)(struct sip_msg * , unsigned int , char * );
69 101
 typedef int (*treply_wb_f)( struct cell* trans,
... ...
@@ -121,10 +153,11 @@ int t_reply_unsafe( struct cell *t, struct sip_msg * , unsigned int , char * );
121 153
 
122 154
 
123 155
 enum rps relay_reply( struct cell *t, struct sip_msg *p_msg, int branch, 
124
-	unsigned int msg_status, branch_bm_t *cancel_bitmap, int do_put_on_wait );
156
+	unsigned int msg_status, struct cancel_info *cancel_data,
157
+	int do_put_on_wait );
125 158
 
126 159
 enum rps local_reply( struct cell *t, struct sip_msg *p_msg, int branch,
127
-    unsigned int msg_status, branch_bm_t *cancel_bitmap );
160
+    unsigned int msg_status, struct cancel_info *cancel_data );
128 161
 
129 162
 void set_final_timer( /* struct s_table *h_table,*/ struct cell *t );
130 163
 
Browse code

tm: drop replies behaviour based on cfg compat mode

- default behaviour for #!KAMAILIO is to drop replies after failure
route to avoid selecting same reply during the next failure event
- for the rest of cases all replies are kept and used to select the
code for new failure route (SER compat mode)
- t_drop_replies() can take one parameter
- 'n[one]' - do not drop any reply (good for #!KAMAILIO mode)
- 'l[ast]' - drop replies received during last serial forking step
- 'a[ll]' - drop all replies

- if the parameter is missing, then will drop all replies
(cherry picked from commit 3ed668500c9a0f0d2f864f5a56cf7fa886f8457c)

Daniel-Constantin Mierla authored on 02/12/2009 18:01:09 • Andrei Pelinescu-Onciul committed on 15/01/2010 12:09:21
Showing 1 changed files
... ...
@@ -153,7 +153,7 @@ int t_pick_branch_blind(struct cell *t, int *res_code);
153 153
 /* drops all the replies to make sure
154 154
  * that none of them is picked up again
155 155
  */
156
-void t_drop_replies(void);
156
+void t_drop_replies(int v);
157 157
 
158 158
 extern const char* rpc_reply_doc[2];
159 159
 void rpc_reply(rpc_t* rpc, void* c);
Browse code

tm: handling of branch flags

- save/restore branch upon execution of tm specific routes

Daniel-Constantin Mierla authored on 28/04/2009 18:40:26
Showing 1 changed files
... ...
@@ -160,7 +160,7 @@ void rpc_reply(rpc_t* rpc, void* c);
160 160
 
161 161
 void faked_env( struct cell *t,struct sip_msg *msg);
162 162
 int fake_req(struct sip_msg *faked_req,
163
-			struct sip_msg *shmem_msg, int extra_flags);
163
+		struct sip_msg *shmem_msg, int extra_flags, struct ua_client *uac);
164 164
 
165 165
 void free_faked_req(struct sip_msg *faked_req, struct cell *t);
166 166
 
Browse code

Export picked branch index via the tm module API.

This patch turns a function-local variable into a global variable in the
module and adds a new function to read the value of the variable. The
function is then exported via the tm module API.

Signed-off-by: Jan Janak <jan@iptel.org>

Daniel-Constantin Mierla authored on 28/03/2009 14:01:19 • Jan Janak committed on 28/03/2009 14:01:19
Showing 1 changed files
... ...
@@ -164,4 +164,7 @@ int fake_req(struct sip_msg *faked_req,
164 164
 
165 165
 void free_faked_req(struct sip_msg *faked_req, struct cell *t);
166 166
 
167
+typedef int (*tget_picked_f)(void);
168
+int t_get_picked_branch(void);
169
+
167 170
 #endif
Browse code

New function to return the To tag for local reply

Added t_get_reply_totag() to access the to-tag value for generated
replies. This is needed by sl to cope with presence modules

Signed-off-by: Jan Janak <jan@iptel.org>

Daniel-Constantin Mierla authored on 20/03/2009 16:42:53 • Jan Janak committed on 23/03/2009 10:14:49
Showing 1 changed files
... ...
@@ -73,6 +73,9 @@ typedef int (*treply_wb_f)( struct cell* trans,
73 73
 /* wrapper function needed after changes in w_t_reply */
74 74
 int w_t_reply_wrp(struct sip_msg *m, unsigned int code, char *txt);
75 75
 
76
+typedef int (*tget_reply_totag_f)(struct sip_msg *, str *);
77
+int t_get_reply_totag(struct sip_msg *msg, str *totag);
78
+
76 79
 #define LOCK_REPLIES(_t) lock(&(_t)->reply_mutex )
77 80
 #define UNLOCK_REPLIES(_t) unlock(&(_t)->reply_mutex )
78 81
 
Browse code

Update tm module to use and set the global route_type variable.

This patch removes the rmode variable from tm module and replaces it
with the global variable route_type defined in route.h. In addition to
that we replaced MODE_* constants with *_ROUTE (also defined in
route.h).

A variable that was once defined in the tm module is now better moved
to the core, because just the core itself without the tm module loaded
can execute two types of routes, the request route and the global
onreply route (if used).

Jan Janak authored on 07/03/2009 00:51:19
Showing 1 changed files
... ...
@@ -58,9 +58,6 @@ extern char *tm_tag_suffix;
58 58
 
59 59
 extern int goto_on_sl_reply;
60 60
 
61
-enum route_mode { MODE_REQUEST=1, MODE_ONREPLY, MODE_ONFAILURE };
62
-extern enum route_mode rmode;
63
-
64 61
 /* has this to-tag been never seen in previous 200/INVs? */
65 62
 int unmatched_totag(struct cell *t, struct sip_msg *ack);
66 63
 
Browse code

t_check_status() checks also the blind UACs if t_pick_branch() fails to determine the picked branch in failure_route. Closes SER-434.

Miklos Tirpak authored on 28/01/2009 14:49:55
Showing 1 changed files
... ...
@@ -147,6 +147,8 @@ void tm_init_tags();
147 147
 
148 148
 /* selects the branch for fwd-ing the reply */
149 149
 int t_pick_branch(int inc_branch, int inc_code, struct cell *t, int *res_code);
150
+/* checks the selected branch from failure_route */
151
+int t_pick_branch_blind(struct cell *t, int *res_code);
150 152
 
151 153
 /* drops all the replies to make sure
152 154
  * that none of them is picked up again
Browse code

t_suspend() and t_continue() functions are introduced.

These fuctions can be used by other modules to implement
asynchronous actions: t_suspend() saves the transaction, returns its
identifiers, and t_continue() continues the SIP request processing.
(The transaction processing does not continue from the same point
in the script, a separate route block defined by the parameter of
t_continue() is executed instead. The reply lock is held during the
route block execution.) FR timer is ticking while the
transaction is suspended, and the transaction's failure route is
executed if t_continue() is not called in time.

Missing: msg lumps are saved by t_suspend() and are not updated by
the subsequent t_relay(). This means that the modifications made
between them are lost.

Miklos Tirpak authored on 10/11/2008 12:47:02
Showing 1 changed files
... ...
@@ -156,4 +156,10 @@ void t_drop_replies(void);
156 156
 extern const char* rpc_reply_doc[2];
157 157
 void rpc_reply(rpc_t* rpc, void* c);
158 158
 
159
+void faked_env( struct cell *t,struct sip_msg *msg);
160
+int fake_req(struct sip_msg *faked_req,
161
+			struct sip_msg *shmem_msg, int extra_flags);
162
+
163
+void free_faked_req(struct sip_msg *faked_req, struct cell *t);
164
+
159 165
 #endif
Browse code

- fix: in some corner cases where send blocks for a long time or when final reply or on send callbacks take too much time to execute for a transaction for which the final reply timer just expired, it is possible that the wait handler would execute _before_ we are finished with t (e.g. before all the callbacks are called). Because presence on a timer list is not ref. counted and we optimize deletion by allowing unlink_timer() not to wait for the fr_timer to finish (timer_allow_del()) this would mean the transaction will be deleted while still in use. The fix makes sure the wait timer is always started after we're not looking at t anymore (an alternative would be to remove timer_allow_del() from retr_buf_hanlder(), but this could cause fast timer slowdowns).

Andrei Pelinescu-Onciul authored on 30/05/2008 21:10:53
Showing 1 changed files
... ...
@@ -121,7 +121,7 @@ int t_reply_unsafe( struct cell *t, struct sip_msg * , unsigned int , char * );
121 121
 
122 122
 
123 123
 enum rps relay_reply( struct cell *t, struct sip_msg *p_msg, int branch, 
124
-	unsigned int msg_status, branch_bm_t *cancel_bitmap );
124
+	unsigned int msg_status, branch_bm_t *cancel_bitmap, int do_put_on_wait );
125 125
 
126 126
 enum rps local_reply( struct cell *t, struct sip_msg *p_msg, int branch,
127 127
     unsigned int msg_status, branch_bm_t *cancel_bitmap );
Browse code

on_sl_reply module parameter is introduced: It defines the route block that is called if a reply with no associated transaction is received. Closes SER-330

Miklos Tirpak authored on 17/03/2008 11:16:19
Showing 1 changed files
... ...
@@ -56,6 +56,8 @@ enum rps {
56 56
 extern char tm_tags[TOTAG_VALUE_LEN];
57 57
 extern char *tm_tag_suffix;
58 58
 
59
+extern int goto_on_sl_reply;
60
+
59 61
 enum route_mode { MODE_REQUEST=1, MODE_ONREPLY, MODE_ONFAILURE };
60 62
 extern enum route_mode rmode;
61 63
 
Browse code

t_drop_replies() script function is introduced. It can be used to drop the received replies in failure_route block, and disable all the previous replies to be selected again. Closes SER-301

Miklos Tirpak authored on 17/03/2008 10:39:51
Showing 1 changed files
... ...
@@ -146,6 +146,11 @@ void tm_init_tags();
146 146
 /* selects the branch for fwd-ing the reply */
147 147
 int t_pick_branch(int inc_branch, int inc_code, struct cell *t, int *res_code);
148 148
 
149
+/* drops all the replies to make sure
150
+ * that none of them is picked up again
151
+ */
152
+void t_drop_replies(void);
153
+
149 154
 extern const char* rpc_reply_doc[2];
150 155
 void rpc_reply(rpc_t* rpc, void* c);
151 156
 
Browse code

tm module parameters are changed to use the configuration framework, that means the parameters are changeable on-the-fly. ("fr_timer_avp", "fr_inv_timer_avp", and "tw_append" are left untouched)

Miklos Tirpak authored on 15/02/2008 12:11:46
Showing 1 changed files
... ...
@@ -37,16 +37,6 @@
37 37
 #include "h_table.h"
38 38
 
39 39
 
40
-extern int restart_fr_on_each_reply;
41
-extern int tm_aggregate_auth; /* aggregate authorization header value */
42
-
43
-extern int tm_blst_503;
44
-extern int tm_blst_503_default;  /* in s */
45
-extern int tm_blst_503_min;      /* in s */
46
-extern int tm_blst_503_max;      /* in s */
47
-extern unsigned int tm_blst_methods_add;
48
-extern unsigned int tm_blst_methods_lookup;
49
-
50 40
 /* reply processing status */
51 41
 enum rps {
52 42
 	/* something bad happened */
Browse code

Fixing improper blacklisting of destinations because of non-INVITE timeouts. Two new module parameters are introduced:

- blst_methods_add:
bitmap of method types that can trigger blacklisting
(only INVITE by default)

- blst_methods_lookup:
bitmap of method types that are looked up in the blacklist
(everything except BYE by default)

closes SER-331

Miklos Tirpak authored on 14/11/2007 15:30:21
Showing 1 changed files
... ...
@@ -44,6 +44,8 @@ extern int tm_blst_503;
44 44
 extern int tm_blst_503_default;  /* in s */
45 45
 extern int tm_blst_503_min;      /* in s */
46 46
 extern int tm_blst_503_max;      /* in s */
47
+extern unsigned int tm_blst_methods_add;
48
+extern unsigned int tm_blst_methods_lookup;
47 49
 
48 50
 /* reply processing status */
49 51
 enum rps {
Browse code

- added support for automatically blacklist 503 replies sources in tm, using the Retry-After header value if present (off by default) - new tm params: blst_503 - turns 503 source blacklisting support on/off blst_503_def_timeout - default timeout used when now Retry-After header is found blst_503_min_timeout - minimum allowed timeout blst_503_max_timeout - maximum allowed timeout (see tm docs for more info)

Andrei Pelinescu-Onciul authored on 30/07/2007 19:57:39
Showing 1 changed files
... ...
@@ -40,6 +40,11 @@
40 40
 extern int restart_fr_on_each_reply;
41 41
 extern int tm_aggregate_auth; /* aggregate authorization header value */
42 42
 
43
+extern int tm_blst_503;
44
+extern int tm_blst_503_default;  /* in s */
45
+extern int tm_blst_503_min;      /* in s */
46
+extern int tm_blst_503_max;      /* in s */
47
+
43 48
 /* reply processing status */
44 49
 enum rps {
45 50
 	/* something bad happened */
Browse code

- patch from Miklos Tirpak <miklos@iptel.org>: - tm minor fixes - tm dialog improvements - tm_binds extended (more function exported)

Andrei Pelinescu-Onciul authored on 14/11/2006 18:11:06
Showing 1 changed files
... ...
@@ -87,6 +87,11 @@ int w_t_reply_wrp(struct sip_msg *m, unsigned int code, char *txt);
87 87
  */
88 88
 int reply_received( struct sip_msg  *p_msg ) ;
89 89
 
90
+/* return 1 if a failure_route processes */
91
+int run_failure_handlers(struct cell *t, struct sip_msg *rpl,
92
+					int code, int extra_flags);
93
+typedef int (*run_failure_handlers_f)(struct cell*, struct sip_msg*, int, int);
94
+
90 95
 
91 96
 /* Retransmits the last sent inbound reply.
92 97
  * Returns  -1 - error
Browse code

- tm: aggregate challenges (WWW/Proxy-Authenticate) from all the 401 & 407 if the final reply is a 401/407 (required by rfc3261). To turn this off and fall back to the old behaviour set tm aggregate_challenges parameter to 0 (see tm docs for more details) - core: header parse support for WWW-Authenticate and Proxy-Authenticate

Andrei Pelinescu-Onciul authored on 16/10/2006 18:44:01
Showing 1 changed files
... ...
@@ -38,6 +38,7 @@
38 38
 
39 39
 
40 40
 extern int restart_fr_on_each_reply;
41
+extern int tm_aggregate_auth; /* aggregate authorization header value */
41 42
 
42 43
 /* reply processing status */
43 44
 enum rps {
Browse code

added wrapper function for C calls to w_t_reply (needed after changes done by TMa)

Vaclav Kubart authored on 13/03/2006 08:48:45
Showing 1 changed files
... ...
@@ -73,6 +73,9 @@ typedef int (*treply_wb_f)( struct cell* trans,
73 73
 	unsigned int code, char * text, char * body, 
74 74
 	char * new_header, char * to_tag);
75 75
 
76
+/* wrapper function needed after changes in w_t_reply */
77
+int w_t_reply_wrp(struct sip_msg *m, unsigned int code, char *txt);
78
+
76 79
 #define LOCK_REPLIES(_t) lock(&(_t)->reply_mutex )
77 80
 #define UNLOCK_REPLIES(_t) unlock(&(_t)->reply_mutex )
78 81
 
Browse code

- updated to the new management interface (not complete yet)

Jan Janak authored on 21/12/2005 17:25:31
Showing 1 changed files
... ...
@@ -31,6 +31,7 @@
31 31
 #define _T_REPLY_H
32 32
 
33 33
 #include "defs.h"
34
+#include "../../rpc.h"
34 35
 #include "../../tags.h"
35 36
 
36 37
 #include "h_table.h"
... ...
@@ -139,8 +140,7 @@ void tm_init_tags();
139 140
 /* selects the branch for fwd-ing the reply */
140 141
 int t_pick_branch(int inc_branch, int inc_code, struct cell *t, int *res_code);
141 142
 
142
-int fifo_t_reply( FILE *stream, char *response_file );
143
-
144
-int unixsock_t_reply(str* msg);
143
+extern const char* rpc_reply_doc[2];
144
+void rpc_reply(rpc_t* rpc, void* c);
145 145
 
146 146
 #endif
Browse code

- obsolete code removed for the sake of clarity - CANCEL terminates retransmission timers properly

Jan Janak authored on 19/09/2005 16:27:33
Showing 1 changed files
... ...
@@ -95,11 +95,6 @@ int t_retransmit_reply( /* struct sip_msg * */  );
95 95
  * returns 1 if everything was OK or -1 for error
96 96
  */
97 97
 
98
-#ifdef _OBSO
99
-int t_reply_light( struct cell *trans, char* buf, unsigned int len,
100
-		   unsigned int code, char * text,
101
-		   char *to_tag, unsigned int to_tag_len);
102
-#endif
103 98
 
104 99
 int t_reply_with_body( struct cell *trans, unsigned int code, 
105 100
 		       char * text, char * body, char * new_header, char * to_tag );
... ...
@@ -149,4 +144,3 @@ int fifo_t_reply( FILE *stream, char *response_file );
149 144
 int unixsock_t_reply(str* msg);
150 145
 
151 146
 #endif
152
-
Browse code

- bad network addresses are now automatically fixed (e.g. 192.168.1.80/27 => 192.168.1.64/27) - tm has a new parameter: restart_fr_on_each_reply. If set (default) fr_inv timer will be restarted for each provisional reply, if not set it will be restarted only for the first reply and for replies >=180 (but only if increasing, eg.: 180, 181 ...). Usefull when dealing with bad UAs that re-transmit 180s.

Andrei Pelinescu-Onciul authored on 01/10/2004 17:19:19
Showing 1 changed files
... ...
@@ -35,6 +35,9 @@
35 35
 
36 36
 #include "h_table.h"
37 37
 
38
+
39
+extern int restart_fr_on_each_reply;
40
+
38 41
 /* reply processing status */
39 42
 enum rps {
40 43
 	/* something bad happened */