Browse code

tm: remove CANCEL_REASON_SUPPORT #define, activated as default since 2010

- remove CANCEL_REASON_SUPPORT #define from module
- remove now unneeded defs.h include file
- activated as default since commit bf5d1d6f1df303019ccf4 in 2010
- tm does not compile anymore if deactivated

Henning Westerholt authored on 02/08/2019 19:36:05
Showing 30 changed files
... ...
@@ -27,8 +27,6 @@
27 27
 #ifndef _TM_CONFIG_H
28 28
 #define _TM_CONFIG_H
29 29
 
30
-#include "defs.h"
31
-
32 30
 /* this is where table size is defined now -- sort of
33 31
    ugly, core should not be bothered by TM table size,
34 32
    but on the other, core's stateless forwarding should
35 33
deleted file mode 100644
... ...
@@ -1,38 +0,0 @@
1
-/*
2
- *
3
- * Copyright (C) 2001-2003 FhG Fokus
4
- *
5
- * This file is part of Kamailio, a free SIP server.
6
- *
7
- * Kamailio is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License as published by
9
- * the Free Software Foundation; either version 2 of the License, or
10
- * (at your option) any later version
11
- *
12
- * Kamailio is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
- * GNU General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU General Public License
18
- * along with this program; if not, write to the Free Software
19
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
20
- *
21
- */
22
-
23
-/*!
24
- * \file
25
- * \brief TM :: Definitions
26
- * \ingroup tm
27
- */
28
-
29
-
30
-#ifndef _TM_DEFS_H
31
-#define _TM_DEFS_H
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
-
38
-#endif
... ...
@@ -37,7 +37,6 @@
37 37
 #include "../../core/error.h"
38 38
 #include "../../core/char_msg_val.h"
39 39
 #include "../../core/rand/kam_rand.h"
40
-#include "defs.h"
41 40
 #include "t_reply.h"
42 41
 #include "t_cancel.h"
43 42
 #include "t_stats.h"
... ...
@@ -171,10 +170,8 @@ void free_cell_helper(
171 170
 		sip_msg_free_unsafe(dead_cell->uas.request);
172 171
 	if(dead_cell->uas.response.buffer)
173 172
 		shm_free_unsafe(dead_cell->uas.response.buffer);
174
-#ifdef CANCEL_REASON_SUPPORT
175 173
 	if(unlikely(dead_cell->uas.cancel_reas))
176 174
 		shm_free_unsafe(dead_cell->uas.cancel_reas);
177
-#endif /* CANCEL_REASON_SUPPORT */
178 175
 
179 176
 	/* callbacks */
180 177
 	for(cbs = (struct tm_callback *)dead_cell->tmcb_hl.first; cbs;) {
... ...
@@ -28,7 +28,6 @@
28 28
 #ifndef _H_TABLE_H
29 29
 #define _H_TABLE_H
30 30
 
31
-#include "defs.h"
32 31
 #include "t_stats.h"
33 32
 
34 33
 /* uncomment the next define if you wish to keep hash statistics*/
... ...
@@ -170,10 +169,8 @@ typedef struct ua_server
170 169
 	 * we need them for dialog-wise matching of ACKs;
171 170
 	 * the pointer shows to shmem-ed reply */
172 171
 	str local_totag;
173
-#ifdef CANCEL_REASON_SUPPORT
174 172
 	struct cancel_reason *cancel_reas; /* pointer to cancel reason, used
175 173
 										* for e2e cancels */
176
-#endif /* CANCEL_REASON_SUPPORT */
177 174
 	unsigned int status;
178 175
 } tm_ua_server_t;
179 176
 
... ...
@@ -284,9 +281,7 @@ typedef struct async_state
284 281
 
285 282
 #define T_DISABLE_6xx (1 << 8)		/* treat 6xx as a normal reply */
286 283
 #define T_DISABLE_FAILOVER (1 << 9) /* don't perform dns failover */
287
-#ifdef CANCEL_REASON_SUPPORT
288 284
 #define T_NO_E2E_CANCEL_REASON (1 << 10) /* don't propagate CANCEL Reason */
289
-#endif									 /* CANCEL_REASON_SUPPORT */
290 285
 #define T_DONT_FORK (T_CANCELED | T_6xx)
291 286
 
292 287
 #ifdef WITH_AS_SUPPORT
... ...
@@ -19,9 +19,6 @@
19 19
  */
20 20
 
21 21
 
22
-#include "defs.h"
23
-
24
-
25 22
 #include <errno.h>
26 23
 
27 24
 #include "lock.h"
... ...
@@ -18,8 +18,6 @@
18 18
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
19 19
  */
20 20
 
21
-#include "defs.h"
22
-
23 21
 
24 22
 #ifndef __lock_h
25 23
 #define __lock_h
... ...
@@ -41,8 +41,6 @@
41 41
  * @ingroup tm
42 42
  */
43 43
 
44
-#include "defs.h"
45
-
46 44
 
47 45
 #include "sip_msg.h"
48 46
 #include "../../core/dprint.h"
... ...
@@ -43,8 +43,6 @@
43 43
 #ifndef _SIP_MSG_H
44 44
 #define _SIP_MSG_H
45 45
 
46
-#include "defs.h"
47
-
48 46
 
49 47
 #include "../../core/parser/msg_parser.h"
50 48
 #include "../../core/mem/shm_mem.h"
... ...
@@ -28,8 +28,6 @@
28 28
 #ifndef _T_APPEND_BRANCHES_H
29 29
 #define _T_APPEND_BRANCHES_H
30 30
 
31
-#include "defs.h"
32
-
33 31
 #include "../../core/proxy.h"
34 32
 #include "h_table.h"
35 33
 
... ...
@@ -24,7 +24,6 @@
24 24
 #include <assert.h>
25 25
 #endif /* EXTRA_DEBUG */
26 26
 
27
-#include "defs.h"
28 27
 #include "config.h"
29 28
 
30 29
 #include "t_funcs.h"
... ...
@@ -126,9 +125,7 @@ int cancel_uacs( struct cell *t, struct cancel_info* cancel_data, int flags)
126 125
 			r=cancel_branch(
127 126
 				t,
128 127
 				i,
129
-#ifdef CANCEL_REASON_SUPPORT
130 128
 				&cancel_data->reason,
131
-#endif /* CANCEL_REASON_SUPPORT */
132 129
 				flags | ((t->uac[i].request.buffer==NULL)?
133 130
 					F_CANCEL_B_FAKE_REPLY:0) /* blind UAC? */
134 131
 			);
... ...
@@ -207,9 +204,7 @@ int cancel_all_uacs(struct cell *trans, int how)
207 204
  *           atomic_cmpxhcg or atomic_get_and_set _must_ be used.
208 205
  */
209 206
 int cancel_branch( struct cell *t, int branch,
210
-	#ifdef CANCEL_REASON_SUPPORT
211 207
 					struct cancel_reason* reason,
212
-	#endif /* CANCEL_REASON_SUPPORT */
213 208
 					int flags )
214 209
 {
215 210
 	char *cancel;
... ...
@@ -287,16 +282,12 @@ int cancel_branch( struct cell *t, int branch,
287 282
 		/* build the CANCEL from the INVITE which was sent out */
288 283
 		cancel = build_local_reparse(t, branch, &len, CANCEL, CANCEL_LEN,
289 284
 									 (t->uas.request && t->uas.request->msg_flags&FL_USE_UAC_TO)?0:&t->to
290
-	#ifdef CANCEL_REASON_SUPPORT
291 285
 									 , reason
292
-	#endif /* CANCEL_REASON_SUPPORT */
293 286
 									 );
294 287
 	} else {
295 288
 		/* build the CANCEL from the received INVITE */
296 289
 		cancel = build_local(t, branch, &len, CANCEL, CANCEL_LEN, &t->to
297
-	#ifdef CANCEL_REASON_SUPPORT
298 290
 								, reason
299
-	#endif /* CANCEL_REASON_SUPPORT */
300 291
 								);
301 292
 	}
302 293
 	if (!cancel) {
... ...
@@ -26,7 +26,6 @@
26 26
 #include <stdio.h> /* just for FILE* for fifo_uac_cancel */
27 27
 #include "../../core/rpc.h"
28 28
 #include "../../core/atomic_ops.h"
29
-#include "defs.h"
30 29
 #include "h_table.h"
31 30
 #include "t_reply.h"
32 31
 
... ...
@@ -65,9 +64,7 @@ void prepare_to_cancel(struct cell *t, branch_bm_t *cancel_bm, branch_bm_t s);
65 64
 int cancel_uacs( struct cell *t, struct cancel_info* cancel_data, int flags );
66 65
 int cancel_all_uacs(struct cell *trans, int how);
67 66
 int cancel_branch( struct cell *t, int branch,
68
-#ifdef CANCEL_REASON_SUPPORT
69 67
 					struct cancel_reason* reason,
70
-#endif /* CANCEL_REASON_SUPPORT */
71 68
 					int flags );
72 69
 
73 70
 typedef int(*cancel_uacs_f)(struct cell *t, struct cancel_info* cancel_data,
... ...
@@ -32,7 +32,6 @@
32 32
 #include "../../core/mem/mem.h"
33 33
 #include "../../core/sr_compat.h"
34 34
 #include "../../core/pvar.h"
35
-#include "defs.h"
36 35
 #include "t_funcs.h"
37 36
 #include "t_fwd.h"
38 37
 #include "t_lookup.h"
... ...
@@ -23,8 +23,6 @@
23 23
 #ifndef _T_FUNCS_H
24 24
 #define _T_FUNCS_H
25 25
 
26
-#include "defs.h"
27
-
28 26
 
29 27
 #include <errno.h>
30 28
 #include <netdb.h>
... ...
@@ -18,8 +18,6 @@
18 18
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
19 19
  */
20 20
 
21
-#include "defs.h"
22
-
23 21
 
24 22
 #include "../../core/dprint.h"
25 23
 #include "../../core/config.h"
... ...
@@ -1105,9 +1103,7 @@ int e2e_cancel_branch( struct sip_msg *cancel_msg, struct cell *t_cancel,
1105 1103
 		}
1106 1104
 		shbuf=build_local_reparse( t_invite, branch, &len, CANCEL,
1107 1105
 				CANCEL_LEN, &t_invite->to
1108
-#ifdef CANCEL_REASON_SUPPORT
1109 1106
 				, 0
1110
-#endif /* CANCEL_REASON_SUPPORT */
1111 1107
 				);
1112 1108
 		if (unlikely(!shbuf)) {
1113 1109
 			LM_ERR("printing e2e cancel failed\n");
... ...
@@ -1142,7 +1138,6 @@ error:
1142 1138
 
1143 1139
 
1144 1140
 
1145
-#ifdef CANCEL_REASON_SUPPORT
1146 1141
 /** create a cancel reason structure packed into a single shm. block.
1147 1142
  * From a cause and a pointer to a str or cancel_msg, build a
1148 1143
  * packed cancel reason structure (CANCEL_REAS_PACKED_HDRS), using a
... ...
@@ -1242,7 +1237,6 @@ static struct cancel_reason* cancel_reason_pack(short cause, void* data,
1242 1237
 error:
1243 1238
 	return 0;
1244 1239
 }
1245
-#endif /* CANCEL_REASON_SUPPORT */
1246 1240
 
1247 1241
 
1248 1242
 
... ...
@@ -1252,10 +1246,9 @@ void e2e_cancel( struct sip_msg *cancel_msg,
1252 1246
 	branch_bm_t cancel_bm;
1253 1247
 #ifndef E2E_CANCEL_HOP_BY_HOP
1254 1248
 	branch_bm_t tmp_bm;
1255
-#elif defined (CANCEL_REASON_SUPPORT)
1249
+#endif /* E2E_CANCEL_HOP_BY_HOP */
1256 1250
 	struct cancel_reason* reason;
1257 1251
 	int free_reason;
1258
-#endif /* E2E_CANCEL_HOP_BY_HOP */
1259 1252
 	int i;
1260 1253
 	int lowest_error;
1261 1254
 	int ret;
... ...
@@ -1310,7 +1303,6 @@ void e2e_cancel( struct sip_msg *cancel_msg,
1310 1303
 	 * have 0 branches and we check for the branch number in
1311 1304
 	 * t_reply_matching() ).
1312 1305
 	 */
1313
-#ifdef CANCEL_REASON_SUPPORT
1314 1306
 	free_reason = 0;
1315 1307
 	reason = 0;
1316 1308
 	if (likely(t_invite->uas.cancel_reas == 0)){
... ...
@@ -1324,7 +1316,6 @@ void e2e_cancel( struct sip_msg *cancel_msg,
1324 1316
 			free_reason = 1;
1325 1317
 		}
1326 1318
 	}
1327
-#endif /* CANCEL_REASON_SUPPORT */
1328 1319
 	for (i=0; i<t_invite->nr_of_outgoings; i++) {
1329 1320
 		if (cancel_bm & (1<<i)) {
1330 1321
 			/* it's safe to get the reply lock since e2e_cancel is
... ...
@@ -1334,9 +1325,7 @@ void e2e_cancel( struct sip_msg *cancel_msg,
1334 1325
 			ret=cancel_branch(
1335 1326
 					t_invite,
1336 1327
 					i,
1337
-#ifdef CANCEL_REASON_SUPPORT
1338 1328
 					reason,
1339
-#endif /* CANCEL_REASON_SUPPORT */
1340 1329
 					cfg_get(tm,tm_cfg, cancel_b_flags)
1341 1330
 					| ((t_invite->uac[i].request.buffer==NULL)?
1342 1331
 						F_CANCEL_B_FAKE_REPLY:0) /* blind UAC? */
... ...
@@ -1345,12 +1334,10 @@ void e2e_cancel( struct sip_msg *cancel_msg,
1345 1334
 			if (ret<lowest_error) lowest_error=ret;
1346 1335
 		}
1347 1336
 	}
1348
-#ifdef CANCEL_REASON_SUPPORT
1349 1337
 	if (unlikely(free_reason)) {
1350 1338
 		/* reason was not set as the global reason => free it */
1351 1339
 		shm_free(reason);
1352 1340
 	}
1353
-#endif /* CANCEL_REASON_SUPPORT */
1354 1341
 #else /* ! E2E_CANCEL_HOP_BY_HOP */
1355 1342
 	/* fix label -- it must be same for reply matching (the label is part of
1356 1343
 	 * the generated via branch for the cancels sent upstream and if it
... ...
@@ -21,8 +21,6 @@
21 21
 #ifndef _T_FWD_H
22 22
 #define _T_FWD_H
23 23
 
24
-#include "defs.h"
25
-
26 24
 #include "../../core/proxy.h"
27 25
 #include "h_table.h"
28 26
 
... ...
@@ -18,8 +18,6 @@
18 18
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
19 19
  */
20 20
 
21
-#include "defs.h"
22
-
23 21
 
24 22
 #include "stdlib.h"
25 23
 #include "../../core/dprint.h"
... ...
@@ -23,8 +23,6 @@
23 23
 #ifndef _HOOKS_H
24 24
 #define _HOOKS_H
25 25
 
26
-#include "defs.h"
27
-
28 26
 /* TMCB_ONSEND used to enable certain callback-related features when
29 27
  * ONSEND was set, these days it's always enabled. For compatibility
30 28
  * reasons with modules that check ONSEND, continue to set it
... ...
@@ -37,8 +37,6 @@
37 37
  *
38 38
  */
39 39
 
40
-#include "defs.h"
41
-
42 40
 
43 41
 #include "../../core/comp_defs.h"
44 42
 #include "../../core/compiler_opt.h"
... ...
@@ -1216,10 +1214,8 @@ static inline void init_new_t(struct cell *new_cell, struct sip_msg *p_msg)
1216 1214
 			(!cfg_get(tm, tm_cfg, tm_auto_inv_100) -1);
1217 1215
 		new_cell->flags|=T_DISABLE_6xx &
1218 1216
 			(!cfg_get(tm, tm_cfg, disable_6xx) -1);
1219
-#ifdef CANCEL_REASON_SUPPORT
1220 1217
 		new_cell->flags|=T_NO_E2E_CANCEL_REASON &
1221 1218
 			(!!cfg_get(tm, tm_cfg, e2e_cancel_reason) -1);
1222
-#endif /* CANCEL_REASON_SUPPORT */
1223 1219
 		/* reset flags */
1224 1220
 		new_cell->flags &=
1225 1221
 			(~ get_msgid_val(user_cell_reset_flags, p_msg->id, int));
... ...
@@ -23,8 +23,6 @@
23 23
 #ifndef _T_LOOKUP_H
24 24
 #define _T_LOOKUP_H
25 25
 
26
-#include "defs.h"
27
-
28 26
 
29 27
 #include "config.h"
30 28
 #include "t_funcs.h"
... ...
@@ -21,7 +21,6 @@
21 21
  *
22 22
  */
23 23
 
24
-#include "defs.h"
25 24
 
26 25
 #ifdef EXTRA_DEBUG
27 26
 #include <assert.h>
... ...
@@ -60,9 +59,7 @@
60 59
  */
61 60
 char *build_local(struct cell *Trans,unsigned int branch,
62 61
 	unsigned int *len, char *method, int method_len, str *to
63
-#ifdef CANCEL_REASON_SUPPORT
64 62
 	, struct cancel_reason* reason
65
-#endif /* CANCEL_REASON_SUPPORT */
66 63
 	)
67 64
 {
68 65
 	char                *cancel_buf, *p, *via;
... ...
@@ -73,10 +70,8 @@ char *build_local(struct cell *Trans,unsigned int branch,
73 70
 	str branch_str;
74 71
 	str via_id;
75 72
 	struct hostport hp;
76
-#ifdef CANCEL_REASON_SUPPORT
77 73
 	int reason_len, code_len;
78 74
 	struct hdr_field *reas1, *reas_last;
79
-#endif /* CANCEL_REASON_SUPPORT */
80 75
 
81 76
 	/* init */
82 77
 	via_id.s=0;
... ...
@@ -139,7 +134,6 @@ char *build_local(struct cell *Trans,unsigned int branch,
139 134
 	}
140 135
 	/* Content Length, EoM */
141 136
 	*len+=CONTENT_LENGTH_LEN+1 + CRLF_LEN;
142
-#ifdef CANCEL_REASON_SUPPORT
143 137
 	reason_len = 0;
144 138
 	reas1 = 0;
145 139
 	reas_last = 0;
... ...
@@ -172,7 +166,6 @@ char *build_local(struct cell *Trans,unsigned int branch,
172 166
 			LM_BUG("unhandled reason cause %d\n", reason->cause);
173 167
 	}
174 168
 	*len+= reason_len;
175
-#endif /* CANCEL_REASON_SUPPORT */
176 169
 	*len+= CRLF_LEN; /* end of msg. */
177 170
 
178 171
 	cancel_buf=shm_malloc( *len+1 );
... ...
@@ -215,7 +208,6 @@ char *build_local(struct cell *Trans,unsigned int branch,
215 208
 	}
216 209
 	/* Content Length */
217 210
 	append_str(p, CONTENT_LENGTH "0" CRLF, CONTENT_LENGTH_LEN + 1 + CRLF_LEN);
218
-#ifdef CANCEL_REASON_SUPPORT
219 211
 	/* add reason if needed */
220 212
 	if (reason_len) {
221 213
 		if (likely(reason->cause > 0)) {
... ...
@@ -243,7 +235,6 @@ char *build_local(struct cell *Trans,unsigned int branch,
243 235
 			}
244 236
 		}
245 237
 	}
246
-#endif /* CANCEL_REASON_SUPPORT */
247 238
 	append_str(p, CRLF, CRLF_LEN); /* msg. end */
248 239
 	*p=0;
249 240
 
... ...
@@ -263,9 +254,7 @@ error:
263 254
  */
264 255
 char *build_local_reparse(struct cell *Trans,unsigned int branch,
265 256
 	unsigned int *len, char *method, int method_len, str *to
266
-#ifdef CANCEL_REASON_SUPPORT
267 257
 	, struct cancel_reason *reason
268
-#endif /* CANCEL_REASON_SUPPORT */
269 258
 	)
270 259
 {
271 260
 	char	*invite_buf, *invite_buf_end;
... ...
@@ -275,10 +264,8 @@ char *build_local_reparse(struct cell *Trans,unsigned int branch,
275 264
 	enum _hdr_types_t	hf_type;
276 265
 	int	first_via, to_len;
277 266
 	int cancel_buf_len;
278
-#ifdef CANCEL_REASON_SUPPORT
279 267
 	int reason_len, code_len;
280 268
 	struct hdr_field *reas1, *reas_last, *hdr;
281
-#endif /* CANCEL_REASON_SUPPORT */
282 269
 	int hadded = 0;
283 270
 	sr_cfgenv_t *cenv = NULL;
284 271
 
... ...
@@ -295,7 +282,6 @@ char *build_local_reparse(struct cell *Trans,unsigned int branch,
295 282
 		goto error;
296 283
 	}
297 284
 
298
-#ifdef CANCEL_REASON_SUPPORT
299 285
 	reason_len = 0;
300 286
 	reas1 = 0;
301 287
 	reas_last = 0;
... ...
@@ -327,7 +313,6 @@ char *build_local_reparse(struct cell *Trans,unsigned int branch,
327 313
 		} else if (unlikely(reason->cause < CANCEL_REAS_MIN))
328 314
 			LM_BUG("unhandled reason cause %d\n", reason->cause);
329 315
 	}
330
-#endif /* CANCEL_REASON_SUPPORT */
331 316
 
332 317
 	invite_buf_end = invite_buf + invite_len;
333 318
 	s = invite_buf;
... ...
@@ -337,11 +322,8 @@ char *build_local_reparse(struct cell *Trans,unsigned int branch,
337 322
 	I just extend it with the length of new To HF to be sure.
338 323
 	Ugly, but we avoid lots of checks and memory allocations this way */
339 324
 	to_len = to ? to->len : 0;
340
-#ifdef CANCEL_REASON_SUPPORT
341 325
 	cancel_buf_len = invite_len + to_len + reason_len;
342
-#else
343
-	cancel_buf_len = invite_len + to_len;
344
-#endif /* CANCEL_REASON_SUPPORT */
326
+
345 327
 	cancel_buf = shm_malloc(sizeof(char)*cancel_buf_len);
346 328
 	if (!cancel_buf)
347 329
 	{
... ...
@@ -437,7 +419,6 @@ char *build_local_reparse(struct cell *Trans,unsigned int branch,
437 419
 
438 420
 			case HDR_EOH_T:
439 421
 				/* end of SIP message found */
440
-#ifdef CANCEL_REASON_SUPPORT
441 422
 				/* add reason if needed */
442 423
 				if (reason_len) {
443 424
 					/* if reason_len !=0, no need for any reason enabled
... ...
@@ -470,7 +451,6 @@ char *build_local_reparse(struct cell *Trans,unsigned int branch,
470 451
 						}
471 452
 					}
472 453
 				}
473
-#endif /* CANCEL_REASON_SUPPORT */
474 454
 				/* final (end-of-headers) CRLF */
475 455
 				append_str(d, CRLF, CRLF_LEN);
476 456
 				*len = d - cancel_buf;
... ...
@@ -24,7 +24,6 @@
24 24
 #define _MSGBUILDER_H
25 25
 
26 26
 #include "../../core/ip_addr.h"
27
-#include "defs.h"
28 27
 #include "dlg.h"
29 28
 #include "h_table.h"
30 29
 #include "t_reply.h"
... ...
@@ -49,16 +48,12 @@
49 48
 
50 49
 char *build_local(struct cell *Trans, unsigned int branch,
51 50
 	unsigned int *len, char *method, int method_len, str *to
52
-#ifdef CANCEL_REASON_SUPPORT
53 51
 	, struct cancel_reason* reason
54
-#endif /* CANCEL_REASON_SUPPORT */
55 52
 	);
56 53
 
57 54
 char *build_local_reparse(struct cell *Trans, unsigned int branch,
58 55
 	unsigned int *len, char *method, int method_len, str *to
59
-#ifdef CANCEL_REASON_SUPPORT
60 56
 	, struct cancel_reason* reason
61
-#endif /* CANCEL_REASON_SUPPORT */
62 57
 	);
63 58
 
64 59
 char *build_uac_request(  str msg_type, str dst, str from,
... ...
@@ -57,7 +57,6 @@
57 57
 #include "../../core/cfg_core.h" /* cfg_get(core, core_cfg, use_dns_failover) */
58 58
 #endif
59 59
 
60
-#include "defs.h"
61 60
 #include "config.h"
62 61
 #include "h_table.h"
63 62
 #include "t_hooks.h"
... ...
@@ -353,17 +352,13 @@ static char *build_ack(struct sip_msg* rpl,struct cell *trans,int branch,
353 352
 		/* build the ACK from the INVITE which was sent out */
354 353
 		return build_local_reparse( trans, branch, ret_len,
355 354
 					ACK, ACK_LEN, &to
356
-	#ifdef CANCEL_REASON_SUPPORT
357 355
 					, 0
358
-	#endif /* CANCEL_REASON_SUPPORT */
359 356
 					);
360 357
 	} else {
361 358
 		/* build the ACK from the reveived INVITE */
362 359
 		return build_local( trans, branch, ret_len,
363 360
 					ACK, ACK_LEN, &to
364
-	#ifdef CANCEL_REASON_SUPPORT
365 361
 					, 0
366
-	#endif /* CANCEL_REASON_SUPPORT */
367 362
 					);
368 363
 	}
369 364
 }
... ...
@@ -522,9 +517,7 @@ static int _reply_light( struct cell *trans, char* buf, unsigned int len,
522 517
 		cleanup_uac_timers( trans );
523 518
 		if (is_invite(trans)){
524 519
 			prepare_to_cancel(trans, &cancel_data.cancel_bitmap, 0);
525
-#ifdef CANCEL_REASON_SUPPORT
526 520
 			cancel_data.reason.cause=code;
527
-#endif /* CANCEL_REASON_SUPPORT */
528 521
 			cancel_uacs( trans, &cancel_data, F_CANCEL_B_KILL );
529 522
 		}
530 523
 		start_final_repl_retr(  trans );
... ...
@@ -1339,9 +1332,7 @@ static enum rps t_should_relay_response( struct cell *Trans , int new_code,
1339 1332
 					 * if the 6xx handling is not disabled */
1340 1333
 					prepare_to_cancel(Trans, &cancel_data->cancel_bitmap, 0);
1341 1334
 					Trans->flags|=T_6xx;
1342
-#ifdef CANCEL_REASON_SUPPORT
1343 1335
 					cancel_data->reason.cause=new_code;
1344
-#endif /* CANCEL_REASON_SUPPORT */
1345 1336
 				}
1346 1337
 			}
1347 1338
 			LM_DBG("store - other branches still active\n");
... ...
@@ -1506,9 +1497,7 @@ static enum rps t_should_relay_response( struct cell *Trans , int new_code,
1506 1497
 		*should_relay= (new_code==100 && !cfg_get(tm, tm_cfg, relay_100)) ? -1 : branch;
1507 1498
 		if (new_code>=200 ) {
1508 1499
 			prepare_to_cancel( Trans, &cancel_data->cancel_bitmap, 0);
1509
-#ifdef CANCEL_REASON_SUPPORT
1510 1500
 			cancel_data->reason.cause=new_code;
1511
-#endif /* CANCEL_REASON_SUPPORT */
1512 1501
 			LM_DBG("rps completed - uas status: %d\n", Trans->uas.status);
1513 1502
 			return RPS_COMPLETED;
1514 1503
 		} else {
... ...
@@ -2335,7 +2324,6 @@ int reply_received( struct sip_msg  *p_msg )
2335 2324
 				 * if BUSY or set just exit, a cancel will be (or was) sent
2336 2325
 				 * shortly on this branch */
2337 2326
 				LM_DBG("branch CANCEL created\n");
2338
-#ifdef CANCEL_REASON_SUPPORT
2339 2327
 				if (t->uas.cancel_reas) {
2340 2328
 					/* cancel reason was saved, use it */
2341 2329
 					cancel_branch(t, branch, t->uas.cancel_reas,
... ...
@@ -2350,9 +2338,6 @@ int reply_received( struct sip_msg  *p_msg )
2350 2338
 					cancel_branch(t, branch, &cancel_data.reason,
2351 2339
 														F_CANCEL_B_FORCE_C);
2352 2340
 				}
2353
-#else /* CANCEL_REASON_SUPPORT */
2354
-				cancel_branch(t, branch, F_CANCEL_B_FORCE_C);
2355
-#endif /* CANCEL_REASON_SUPPORT */
2356 2341
 			}
2357 2342
 			goto done; /* nothing to do */
2358 2343
 		}
... ...
@@ -23,7 +23,6 @@
23 23
 #ifndef _T_REPLY_H
24 24
 #define _T_REPLY_H
25 25
 
26
-#include "defs.h"
27 26
 #include "../../core/rpc.h"
28 27
 #include "../../core/tags.h"
29 28
 
... ...
@@ -63,8 +62,6 @@ int unmatched_totag(struct cell *t, struct sip_msg *ack);
63 62
 /* branch bitmap type */
64 63
 typedef unsigned int branch_bm_t;
65 64
 
66
-#ifdef CANCEL_REASON_SUPPORT
67
-
68 65
 /* reason building blocks (see rfc3326) */
69 66
 #define REASON_PREFIX "Reason: SIP;cause="
70 67
 #define REASON_PREFIX_LEN (sizeof(REASON_PREFIX)-1)
... ...
@@ -106,19 +103,6 @@ struct cancel_info {
106 103
 		init_cancel_reason(&(ci)->reason); \
107 104
 	}while (0);
108 105
 
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 106
 
123 107
 /* reply export types */
124 108
 typedef int (*treply_f)(struct sip_msg * , unsigned int , char * );
... ...
@@ -20,8 +20,6 @@
20 20
  */
21 21
 
22 22
 
23
-#include "defs.h"
24
-
25 23
 
26 24
 #include <stdio.h>
27 25
 #include "t_stats.h"
... ...
@@ -25,8 +25,6 @@
25 25
 /* if defined even more stats are produced */
26 26
 #define TM_MORE_STATS
27 27
 
28
-#include "defs.h"
29
-
30 28
 #include "../../core/rpc.h"
31 29
 #include "../../core/pt.h"
32 30
 
... ...
@@ -88,8 +88,6 @@
88 88
  */
89 89
 
90 90
 
91
-#include "defs.h"
92
-
93 91
 
94 92
 #include "config.h"
95 93
 #include "h_table.h"
... ...
@@ -297,13 +295,8 @@ static void fake_reply(struct cell *t, int branch, int code)
297 295
 				relay_reply(t, FAKED_REPLY, branch, code, &cancel_data, 0);
298 296
 	}
299 297
 /* now when out-of-lock do the cancel I/O */
300
-#ifdef CANCEL_REASON_SUPPORT
301 298
 	if(do_cancel_branch)
302 299
 		cancel_branch(t, branch, &cancel_data.reason, 0);
303
-#else /* CANCEL_REASON_SUPPORT */
304
-	if(do_cancel_branch)
305
-		cancel_branch(t, branch, 0);
306
-#endif /* CANCEL_REASON_SUPPORT */
307 300
 	/* it's cleaned up on error; if no error occurred and transaction
308 301
 	   completed regularly, I have to clean-up myself
309 302
 	*/
... ...
@@ -91,8 +91,6 @@
91 91
 #ifndef _TM_TIMER_H
92 92
 #define _TM_TIMER_H
93 93
 
94
-#include "defs.h"
95
-
96 94
 #include "../../core/compiler_opt.h"
97 95
 #include "lock.h"
98 96
 
... ...
@@ -46,8 +46,6 @@
46 46
  */
47 47
 
48 48
 
49
-#include "defs.h"
50
-
51 49
 
52 50
 #include <stdio.h>
53 51
 #include <string.h>
... ...
@@ -189,10 +187,8 @@ static int w_t_reset_max_lifetime(struct sip_msg* msg, char* foo, char* bar);
189 187
 static int w_t_set_auto_inv_100(struct sip_msg* msg, char* on_off, char* foo);
190 188
 static int w_t_set_disable_6xx(struct sip_msg* msg, char* on_off, char* foo);
191 189
 static int w_t_set_disable_failover(struct sip_msg* msg, char* on_off, char* f);
192
-#ifdef CANCEL_REASON_SUPPORT
193 190
 static int w_t_set_no_e2e_cancel_reason(struct sip_msg* msg, char* on_off,
194 191
 		char* f);
195
-#endif /* CANCEL_REASON_SUPPORT */
196 192
 static int w_t_set_disable_internal_reply(struct sip_msg* msg, char* on_off,
197 193
 		char* f);
198 194
 static int w_t_branch_timeout(struct sip_msg* msg, char*, char*);
... ...
@@ -363,7 +359,6 @@ static cmd_export_t cmds[]={
363 359
 		REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE },
364 360
 	{"t_set_disable_failover", w_t_set_disable_failover, 1, fixup_var_int_1, 0,
365 361
 		REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE },
366
-#ifdef CANCEL_REASON_SUPPORT
367 362
 	{"t_set_no_e2e_cancel_reason", w_t_set_no_e2e_cancel_reason, 1,
368 363
 		fixup_var_int_1, 0,
369 364
 		REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE },
... ...
@@ -371,7 +366,6 @@ static cmd_export_t cmds[]={
371 366
 	{"t_disable_e2e_cancel_reason", w_t_set_no_e2e_cancel_reason, 1,
372 367
 		fixup_var_int_1, 0,
373 368
 		REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE },
374
-#endif /* CANCEL_REASON_SUPPORT */
375 369
 	{"t_set_disable_internal_reply", w_t_set_disable_internal_reply, 1,
376 370
 		fixup_var_int_1, 0,
377 371
 		REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE },
... ...
@@ -470,10 +464,8 @@ static param_export_t params[]={
470 464
 	{"remap_503_500",       PARAM_INT, &tm_remap_503_500                     },
471 465
 	{"failure_exec_mode",   PARAM_INT, &tm_failure_exec_mode                 },
472 466
 	{"dns_reuse_rcv_socket",PARAM_INT, &tm_dns_reuse_rcv_socket              },
473
-#ifdef CANCEL_REASON_SUPPORT
474 467
 	{"local_cancel_reason", PARAM_INT, &default_tm_cfg.local_cancel_reason   },
475 468
 	{"e2e_cancel_reason",   PARAM_INT, &default_tm_cfg.e2e_cancel_reason     },
476
-#endif /* CANCEL_REASON_SUPPORT */
477 469
 	{"xavp_contact",        PARAM_STR, &ulattrs_xavp_name                    },
478 470
 	{"event_callback",      PARAM_STR, &tm_event_callback                    },
479 471
 	{"relay_100",           PARAM_INT, &default_tm_cfg.relay_100             },
... ...
@@ -2093,12 +2085,10 @@ T_SET_FLAG_GEN_FUNC(t_set_disable_failover, T_DISABLE_FAILOVER)
2093 2085
 W_T_SET_FLAG_GEN_FUNC(t_set_disable_failover, T_DISABLE_FAILOVER)
2094 2086
 
2095 2087
 
2096
-#ifdef CANCEL_REASON_SUPPORT
2097 2088
 /* disable/enable e2e cancel reason copy for the current transaction */
2098 2089
 T_SET_FLAG_GEN_FUNC(t_set_no_e2e_cancel_reason, T_NO_E2E_CANCEL_REASON)
2099 2090
 
2100 2091
 W_T_SET_FLAG_GEN_FUNC(t_set_no_e2e_cancel_reason, T_NO_E2E_CANCEL_REASON)
2101
-#endif /* CANCEL_REASON_SUPPORT */
2102 2092
 
2103 2093
 
2104 2094
 /* disable internal negative reply for the current transaction */
... ...
@@ -19,8 +19,6 @@
19 19
  *
20 20
  */
21 21
 
22
-#include "defs.h"
23
-
24 22
 
25 23
 #include "tm_load.h"
26 24
 #include "uac.h"
... ...
@@ -24,8 +24,6 @@
24 24
 #ifndef _TM_BIND_H
25 25
 #define _TM_BIND_H
26 26
 
27
-#include "defs.h"
28
-
29 27
 
30 28
 #include "../../core/sr_module.h"
31 29
 #include "t_hooks.h"