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,448 +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 _HOOKS_H
24
-#define _HOOKS_H
25
-
26
-#include "defs.h"
27
-
28
-/* TMCB_ONSEND used to enable certain callback-related features when
29
- * ONSEND was set, these days it's always enabled. For compatibility
30
- * reasons with modules that check ONSEND, continue to set it
31
- * unconditionally*/
32
-#define TMCB_ONSEND
33
-#include "../../ip_addr.h" /* dest_info */
34
-
35
-struct sip_msg;
36
-struct cell;
37
-
38
-#define TMCB_REQUEST_IN_N       0
39
-#define TMCB_RESPONSE_IN_N      1
40
-#define TMCB_E2EACK_IN_N        2
41
-#define TMCB_REQUEST_PENDING_N  3
42
-#define TMCB_REQUEST_FWDED_N    4
43
-#define TMCB_RESPONSE_FWDED_N   5
44
-#define TMCB_ON_FAILURE_RO_N    6
45
-#define TMCB_ON_FAILURE_N       7
46
-#define TMCB_REQUEST_OUT_N      8
47
-#define TMCB_RESPONSE_OUT_N     9
48
-#define TMCB_LOCAL_COMPLETED_N  10
49
-#define TMCB_LOCAL_RESPONSE_OUT_N 11
50
-#define TMCB_ACK_NEG_IN_N       12
51
-#define TMCB_REQ_RETR_IN_N      13
52
-#define TMCB_LOCAL_RESPONSE_IN_N 14
53
-#define TMCB_LOCAL_REQUEST_IN_N  15
54
-#define TMCB_DLG_N              16
55
-#define TMCB_DESTROY_N          17  /* called on transaction destroy */
56
-#define TMCB_E2ECANCEL_IN_N     18
57
-#define TMCB_E2EACK_RETR_IN_N   19
58
-#define TMCB_RESPONSE_READY_N	20
59
-#ifdef WITH_AS_SUPPORT
60
-#define TMCB_DONT_ACK_N         21 /* TM shoudn't ACK a local UAC  */
61
-#endif
62
-#define TMCB_REQUEST_SENT_N     22
63
-#define TMCB_RESPONSE_SENT_N    23
64
-#define TMCB_ON_BRANCH_FAILURE_RO_N 24
65
-#define TMCB_ON_BRANCH_FAILURE_N 25
66
-#define TMCB_MAX_N              25
67
-
68
-
69
-#define TMCB_REQUEST_IN       (1<<TMCB_REQUEST_IN_N)
70
-#define TMCB_RESPONSE_IN      (1<<TMCB_RESPONSE_IN_N)
71
-#define TMCB_E2EACK_IN        (1<<TMCB_E2EACK_IN_N)
72
-#define TMCB_REQUEST_PENDING  (1<<TMCB_REQUEST_PENDING_N)
73
-#define TMCB_REQUEST_FWDED    (1<<TMCB_REQUEST_FWDED_N)
74
-#define TMCB_RESPONSE_FWDED   (1<<TMCB_RESPONSE_FWDED_N)
75
-#define TMCB_ON_FAILURE_RO    (1<<TMCB_ON_FAILURE_RO_N)
76
-#define TMCB_ON_FAILURE       (1<<TMCB_ON_FAILURE_N)
77
-#define TMCB_REQUEST_OUT      (1<<TMCB_REQUEST_OUT_N)
78
-#define TMCB_RESPONSE_OUT     (1<<TMCB_RESPONSE_OUT_N)
79
-#define TMCB_LOCAL_COMPLETED  (1<<TMCB_LOCAL_COMPLETED_N)
80
-#define TMCB_LOCAL_RESPONSE_OUT (1<<TMCB_LOCAL_RESPONSE_OUT_N)
81
-#define TMCB_ACK_NEG_IN       (1<<TMCB_ACK_NEG_IN_N)
82
-#define TMCB_REQ_RETR_IN      (1<<TMCB_REQ_RETR_IN_N)
83
-#define TMCB_LOCAL_RESPONSE_IN (1<<TMCB_LOCAL_RESPONSE_IN_N)
84
-#define TMCB_LOCAL_REQUEST_IN (1<<TMCB_LOCAL_REQUEST_IN_N)
85
-#define TMCB_DLG              (1<<TMCB_DLG_N)
86
-#define TMCB_DESTROY          (1<<TMCB_DESTROY_N)
87
-#define TMCB_E2ECANCEL_IN     (1<<TMCB_E2ECANCEL_IN_N)
88
-#define TMCB_E2EACK_RETR_IN   (1<<TMCB_E2EACK_RETR_IN_N)
89
-#define TMCB_RESPONSE_READY   (1<<TMCB_RESPONSE_READY_N)
90
-#ifdef WITH_AS_SUPPORT
91
-#define TMCB_DONT_ACK         (1<<TMCB_DONT_ACK_N)
92
-#endif
93
-#define TMCB_REQUEST_SENT      (1<<TMCB_REQUEST_SENT_N)
94
-#define TMCB_RESPONSE_SENT     (1<<TMCB_RESPONSE_SENT_N)
95
-#define TMCB_ON_BRANCH_FAILURE (1<<TMCB_ON_BRANCH_FAILURE_N)
96
-#define TMCB_ON_BRANCH_FAILURE_RO (1<<TMCB_ON_BRANCH_FAILURE_RO_N)
97
-#define TMCB_MAX              ((1<<(TMCB_MAX_N+1))-1)
98
-
99
-
100
-/*
101
- *  Caution: most of the callbacks work with shmem-ized messages
102
- *  which you can no more change (e.g., lumps are fixed). Most
103
- *  reply-processing callbacks are also called from a mutex,
104
- *  which may cause deadlock if you are not careful. Also, reply
105
- *  callbacks may pass the value of FAKED_REPLY messages, which
106
- *  is a non-dereferencable pointer indicating that no message
107
- *  was received and a timer hit instead.
108
- *
109
- *  All callbacks excepting the TMCB_REQUEST_IN are associates to a
110
- *  transaction. It means they will be run only when the event will hint
111
- *  the transaction the callbacks were register for.
112
- *  TMCB_REQUEST_IN is a global callback - it means it will be run for
113
- *  all transactions.
114
- *
115
- *
116
- *  Callback description:
117
- *  ---------------------
118
- *
119
- * TMCB_REQUEST_IN -- a brand-new request was received and is
120
- * about to establish transaction; it is not yet cloned and
121
- * lives in pkg mem -- your last chance to mangle it before
122
- * it gets shmem-ized (then, it's read-only); it's called from
123
- * HASH_LOCK, so be careful. It is guaranteed not to be
124
- * a retransmission. The transactional context is mostly
125
- * incomplete -- this callback is called in very early stage
126
- * before the message is shmem-ized (so that you can work
127
- * with it).
128
- * Note: this callback MUST be installed before forking
129
- * (the req_in_tmcb_hl callback list does not live in shmem and has no access
130
- * protection), i.e., at best from mod_init functions.
131
- *
132
- * Note: All the other callbacks can be safely installed when the
133
- * transaction already exists, it does not need to be locked.
134
- * 
135
- * TMCB_RESPONSE_IN -- a brand-new reply was received which matches
136
- * an existing non-local transaction. It may or may not be a retransmission.
137
- * No lock is held here (yet).
138
- * Note: for an invite transaction this callback will also catch the reply
139
- *  to local cancels (e.g. branch canceled due to fr_inv_timeout). To
140
- *  distinguish between the two, one would need to look at the method in
141
- *  Cseq (look at t_reply.c:1630 (reply_received()) for an example).
142
- *
143
- *  TMCB_RESPONSE_OUT -- a final or provisional reply was sent out
144
- *  successfully (either a local reply  or a proxied one).
145
- *  For final replies is called only for the first one (it's not called
146
- *  for retransmissions).
147
- *  For non-local replies (proxied) is called also for provisional responses
148
- *  (NOTE: this might change and in the future it might be called only
149
- *  for final replies --andrei).
150
- *  For local replies is called _only_ for the final reply.
151
- *  There is nothing more you can change from the callback, it is good for 
152
- *  accounting-like uses. No lock is held.
153
- *  Known oddities: it's called for provisional replies for relayed replies,
154
- *  but not for local responses (see NOTE above).
155
- *  Note: if the send fails or via cannot be resolved, this callback is 
156
- *  _not_ called.
157
- *  Note: local reply means locally generated reply (via t_reply() & friends)
158
- *  and not local transaction.
159
- *
160
- *    Note: the message passed to the callback may also have
161
- *    value FAKED_REPLY (like other reply callbacks) which
162
- *    indicates a local reply caused by a timer, calling t_reply() a.s.o.
163
-*     Check for this value before deferring -- you will cause a segfault
164
- *    otherwise. Check for t->uas.request validity too if you
165
- *    need it ... locally initiated UAC transactions set it to 0.
166
- *
167
- *    Also note, that reply callbacks are not called if a transaction
168
- *    is dropped silently. That's the case when noisy_ctimer is
169
- *    disabled (by default) and C-timer hits. The proxy server then
170
- *    drops state silently, doesn't use callbacks and expects the
171
- *    transaction to complete statelessly.
172
- *
173
- *  TMCB_ON_FAILURE_RO -- called on receipt of a reply or timer;
174
- *  it means all branches completed with a failure; the callback
175
- *  function MUST not change anything in the transaction (READONLY)
176
- *  that's a chance for doing ACC or stuff like this
177
- *
178
- *  TMCB_ON_FAILURE -- called on receipt of a reply or timer;
179
- *  it means all branches completed with a failure; that's
180
- *  a chance for example to add new transaction branches.
181
- *  WARNING: the REPLY lock is held.
182
- *  It is safe to add more callbacks from here.
183
- *
184
- *  TMCB_RESPONSE_FWDED -- called when a reply is about to be
185
- *  forwarded; it is called after a message is received but before
186
- *  a message is sent out: it is called when the decision is
187
- *  made to forward a reply; it is parametrized by pkg message
188
- *  which caused the transaction to complete (which is not
189
- *  necessarily the same which will be forwarded). As forwarding
190
- *  has not been executed and may fail, there is no guarantee
191
- *  a reply will be successfully sent out at this point of time.
192
- *
193
- *     Note: TMCB_ON_FAILURE and TMCB_REPLY_FWDED are
194
- *     called from reply mutex which is used to deterministically
195
- *     process multiple replies received in parallel. A failure
196
- *     to set the mutex again or stay too long in the callback
197
- *     may result in deadlock.
198
- *
199
- *     Note: the reply callbacks will not be evoked if "silent
200
- *     C-timer hits". That's a feature to clean transactional
201
- *     state from a proxy quickly -- transactions will then
202
- *     complete statelessly. If you wish to disable this
203
- *     feature, either set the global option "noisy_ctimer"
204
- *     to 1, or set t->noisy_ctimer for selected transaction.
205
- *
206
- *  TMCB_E2EACK_IN -- called when an ACK belonging to a proxied
207
- *  INVITE transaction completed with 200 arrived. Note that
208
- *  because it can be only dialog-wise matched, only the first
209
- *  transaction occurrence will be matched with spirals. If
210
- *  record-routing is not enabled, you will never receive the
211
- *  ACK and the callback will be never triggered. In general it's called only
212
- *   for the first ACK but it can be also called multiple times 
213
- *   quasi-simultaneously if multiple ACK copies arrive in parallel or if
214
- *   ACKs with different (never seen before) to-tags are received.
215
- *
216
- *   TMCB_E2EACK_RETR_IN -- like TMCB_E2EACK_IN, but matches retransmissions
217
- *   and it's called for every retransmission (but not for the "first" ACK).
218
- *
219
- *  TMCB_E2ECANCEL_IN -- called when a CANCEL for the INVITE transaction
220
- *  for which the callback was registered arrives.
221
- *   The transaction parameter will point to the invite transaction (and 
222
- *   not the cancel) and the request parameter to the CANCEL sip msg.
223
- *   Note: the callback should be registered for an INVITE transaction.
224
- *
225
- *  TMCB_REQUEST_FWDED -- request is being forwarded out. It is
226
- *  called before a message is forwarded, when the corresponding branch
227
- *   is created (it's called for each branch) and it is your last
228
- *  chance to change its shape. It can also be called from the failure
229
- *   router (via t_relay/t_forward_nonack) and in this case the REPLY lock 
230
- *   will be held.
231
- *
232
- *  TMCB_REQUEST_OUT -- request was sent out successfully.
233
- *  There is nothing more you can change from the callback, it is good for
234
- *  accounting-like uses.
235
- *  Note: if the send fails or via cannot be resolved, this callback is
236
- *  _not_ called.
237
- *
238
- *  TMCB_LOCAL_COMPLETED -- final reply for localy initiated
239
- *  transaction arrived. Message may be FAKED_REPLY. Can be called multiple
240
- *  times, no lock is held.
241
- *
242
- *  TMCB_LOCAL_RESPONSE_OUT -- provisional reply for localy initiated 
243
- *  transaction. The message may be a FAKED_REPLY and the callback might be 
244
- *  called multiple time quasi-simultaneously. No lock is held.
245
- *  Note: depends on tm.pass_provisional_replies.
246
- *  Note: the name is very unfortunate and it will probably be changed
247
- *   (e.g. TMCB_LOCAL_PROVISIONAL).
248
- *
249
- *  TMCB_NEG_ACK_IN -- an ACK to a negative reply was received, thus ending
250
- *  the transaction (this happens only when the final reply sent by tm is 
251
- *  negative). The callback might be called simultaneously. No lock is held.
252
- *
253
- *  TMCB_REQ_RETR_IN -- a retransmitted request was received. This callback
254
- *   might be called simultaneously. No lock is held.
255
- *
256
- * TMCB_LOCAL_RESPONSE_IN -- a brand-new reply was received which matches
257
- * an existing local transaction (like TMCB_RESPONSE_IN but for local 
258
- * transactions). It may or may not be a retransmission.
259
- *
260
- * TMCB_LOCAL_REQUEST_IN -- like TMCB_REQUEST_IN but for locally generated 
261
- * request (e.g. via fifo/rpc):  a brand-new local request was 
262
- * received/generated and a transaction for it is about to be created.
263
- * It's called from HASH_LOCK, so be careful. It is guaranteed not to be
264
- * a retransmission. The transactional context is mostly
265
- * incomplete -- this callback is called in very early stage
266
- * before the message is shmem-ized (so that you can work
267
- * with it).
268
- * It's safe to install other TMCB callbacks from here.
269
- * Note: this callback MUST be installed before forking
270
- * (the local_req_in_tmcb_hl callback list does not live in shmem and has no 
271
- * access protection), i.e., at best from mod_init functions.
272
- *
273
- *
274
- *  All of the following callbacks are called immediately after or before 
275
- *  sending a message. All of them are read-only (no change can be made to
276
- * the message). These callbacks use the t_rbuf, send_buf, dst, is_retr
277
- *  and the code members of the tmcb_params structure.
278
- *  For a request code is <=0. code values can be TYPE_LOCAL_ACK for an ACK 
279
- *  generated by ser, TYPE_LOCAL_CANCEL for a CANCEL generated by ser 
280
- *  and TYPE_REQUEST for all the other requests or requests generated via 
281
- *  t_uac.
282
- *   For a reply the code is the response status (which is always >0, e.g. 200,
283
- *   408, a.s.o).
284
- *        - the callbacks will be called sometimes with the REPLY lock held
285
- *          and sometimes without it, so trying to acquire the REPLY lock
286
- *          from these callbacks could lead to deadlocks (avoid it unless
287
- *           you really know what you're doing).
288
- *
289
- *  TMCB_REQUEST_SENT -- called each time a request was sent (even for
290
- *  retransmissions), it includes local and forwarded request, ser generated
291
- *  CANCELs and ACKs. The tmcb_params structure will have the t_rbuf, dst,
292
- *  send_buf and is_retr members filled.
293
- *  This callback is "read-only", the message was already sent and no changes
294
- *  are allowed.
295
- *  Note: send_buf can be different from t_rbuf->buffer for ACKs (in this
296
- *   case t_rbuf->buf will contain the last request sent on the branch and
297
- *   its destination). The same goes for t_rbuf->dst and tmcb->dst for local 
298
- *   transactions ACKs to 2xxs.
299
- *
300
- *  TMCB_RESPONSE_SENT -- called each time a response was sent (even for
301
- *  retransmissions). The tmcb_params structure will have t_rbuf set to the
302
- *  reply retransmission buffer and send_buf set to the data sent (in this case
303
- *  it will always be the same with t_rbuf->buf). is_retr will also be set if
304
- *  the reply is retransmitted
305
- *   by ser.
306
- *  This callback is "read-only", the message was already sent and no changes
307
- *  are allowed.
308
- *
309
- *  TMCB_DESTROY -- called when the transaction is destroyed. Everything but
310
- *  the cell* parameter (t) and the tmcb are set to 0. Only the param is
311
- *  is filled inside TMCB. For dialogs callbacks t is also 0.
312
- *
313
- * TMCB_RESPONSE_READY -- a reply is ready to be sent out. Callback is
314
- *  is executed just before writing the reply content to network.
315
- *
316
- * TMCB_DONT_ACK (requires AS support) -- for localy generated INVITEs, TM 
317
- * automatically generates an ACK for the received 2xx replies. But, if this 
318
- * flag is passed to TM when creating the initial UAC request, this won't
319
- * happen anymore: the ACK generation must be triggered from outside, using
320
- * TM's interface.
321
- * While this isn't exactly a callback type, it is used as part of the flags
322
- * mask when registering callbacks.
323
-
324
-	the callback's param MUST be in shared memory and will
325
-	NOT be freed by TM; you must do it yourself from the
326
-	callback function if necessary (for example register it also for 
327
-	 TMCB_DESTROY and when called with TMCB_DESTROY just free the param
328
-	).
329
-*/
330
-
331
-#define TMCB_RETR_F 1
332
-#define TMCB_LOCAL_F 2
333
-
334
-/* pack structure with all params passed to callback function */
335
-struct tmcb_params {
336
-	struct sip_msg* req;
337
-	struct sip_msg* rpl;
338
-	void **param;
339
-	int code;
340
-	unsigned short flags; /* set to a combination of:
341
-							 TMCB_RETR_F if this is a _ser_ retransmission
342
-							 (but not if if it's a "forwarded" retr., like a 
343
-							 retr. 200 Ok for example)
344
-							 TMCB_LOCAL_F if this is a local generated message
345
-							  (and not forwarded) */
346
-	unsigned short branch;
347
-	/* could also be: send_buf, dst, branch */
348
-	struct retr_buf* t_rbuf; /* transaction retr. buf., all the information
349
-								 regarding destination, data that is/was
350
-								 actually sent on the net, branch a.s.o is
351
-								 inside */
352
-	struct dest_info* dst; /* destination */
353
-	str send_buf; /* what was/will be sent on the net, used for ACKs
354
-					(which don't have a retr_buf). */
355
-};
356
-
357
-#define INIT_TMCB_PARAMS(tmcb, request, reply, r_code)\
358
-do{\
359
-	memset(&(tmcb), 0, sizeof((tmcb))); \
360
-	(tmcb).req=(request); (tmcb).rpl=(reply);  \
361
-	(tmcb).code=(r_code); \
362
-}while(0)
363
-
364
-#define INIT_TMCB_ONSEND_PARAMS(tmcb, req, repl, rbuf, dest, buf, buf_len, \
365
-								onsend_flags, t_branch, code) \
366
-do{ \
367
-	INIT_TMCB_PARAMS(tmcb, req, repl, code); \
368
-	tmcb.t_rbuf=(rbuf); tmcb.dst=(dest); \
369
-	tmcb.send_buf.s=(buf); tmcb.send_buf.len=(buf_len); \
370
-	tmcb.flags=(onsend_flags); tmcb.branch=(t_branch); \
371
-}while(0)
372
-
373
-/* callback function prototype */
374
-typedef void (transaction_cb) (struct cell* t, int type, struct tmcb_params*);
375
-/*! \brief function to release the callback param */
376
-typedef void (release_tmcb_param) (void* param);
377
-/* register callback function prototype */
378
-typedef int (*register_tmcb_f)(struct sip_msg* p_msg, struct cell *t,
379
-							   int cb_types, transaction_cb f, void *param,
380
-							   release_tmcb_param func);
381
-
382
-
383
-struct tm_callback {
384
-	int id;                      /* id of this callback - useless */
385
-	int types;                   /* types of events that trigger the callback*/
386
-	transaction_cb* callback;    /* callback function */
387
-	void *param;                 /* param to be passed to callback function */
388
-	release_tmcb_param* release; /**< Function to release the callback param
389
-								  * when the callback is deleted */
390
-	struct tm_callback* next;
391
-};
392
-
393
-struct tmcb_head_list {
394
-	struct tm_callback volatile *first;
395
-	int reg_types;
396
-};
397
-
398
-
399
-extern struct tmcb_head_list*  req_in_tmcb_hl;
400
-extern struct tmcb_head_list*  local_req_in_tmcb_hl;
401
-
402
-void set_early_tmcb_list(struct sip_msg *msg,
403
-		struct cell *t);
404
-
405
-#define has_tran_tmcbs(_T_, _types_) \
406
-	( ((_T_)->tmcb_hl.reg_types)&(_types_) )
407
-#define has_reqin_tmcbs() \
408
-	( req_in_tmcb_hl->first!=0 )
409
-#define has_local_reqin_tmcbs() \
410
-	( local_req_in_tmcb_hl->first!=0 )
411
-
412
-
413
-int init_tmcb_lists(void);
414
-
415
-void destroy_tmcb_lists(void);
416
-
417
-
418
-/* register a callback for several types of events */
419
-int register_tmcb( struct sip_msg* p_msg, struct cell *t, int types,
420
-				   transaction_cb f, void *param,
421
-				   release_tmcb_param rel_func);
422
-
423
-/* inserts a callback into the a callback list */
424
-int insert_tmcb(struct tmcb_head_list *cb_list, int types,
425
-				transaction_cb f, void *param,
426
-				release_tmcb_param rel_func);
427
-
428
-/* run all transaction callbacks for an event type */
429
-void run_trans_callbacks( int type , struct cell *trans,
430
-						struct sip_msg *req, struct sip_msg *rpl, int code );
431
-/* helper function */
432
-void run_trans_callbacks_internal(struct tmcb_head_list* cb_lst, int type,
433
-									struct cell *trans, 
434
-									struct tmcb_params *params);
435
-/* run all REQUEST_IN callbacks */
436
-void run_reqin_callbacks( struct cell *trans, struct sip_msg *req, int code );
437
-void run_local_reqin_callbacks( struct cell *trans, struct sip_msg *req, 
438
-		int code );
439
-
440
-/* like run_trans_callbacks but provide outgoing buffer (i.e., the
441
- * processed message) to callback */
442
-void run_trans_callbacks_with_buf(int type, struct retr_buf* rbuf, struct sip_msg* req,
443
-								  struct sip_msg* repl, short flags);
444
-
445
-/* like run_trans_callbacks but tmcb_params assumed to contain data already */
446
-void run_trans_callbacks_off_params(int type, struct cell* t, struct tmcb_params* p);
447
-
448
-#endif
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.
... ...
@@ -24,20 +17,6 @@
24 17
  * along with this program; if not, write to the Free Software
25 18
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
26 19
  *
27
- * History:
28
- * --------
29
- * 2003-03-16 : backwards-compatibility callback names introduced (jiri)
30
- * 2003-03-06 : old callbacks renamed, new one introduced (jiri)
31
- * 2003-12-04 : global callbacks moved into transaction callbacks;
32
- *              multiple events per callback added; single list per
33
- *              transaction for all its callbacks (bogdan)
34
- * 2007-03-14   added *_SENT callbacks (andrei)
35
- * 2007-03-17   added TMCB_NEG_ACK_IN, TMCB_REQ_RETR_IN & 
36
- *               TMCB_LOCAL_RESPONSE_IN (andrei)
37
- * 2007-03-23   added TMCB_LOCAL_REQUEST_IN (andrei)
38
- * 2007-05-16   added TMCB_DESTROY (andrei)
39
- * 2007-05-24   fixed has_tran_tmcbs() & added TMCB_E2ECANCEL_IN (andrei)
40
- * 2007-11-12   added TMCB_E2EACK_RETR_IN (andrei)
41 20
  */
42 21
 
43 22
 
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
  * History:
28 28
  * --------
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
... ...
@@ -82,7 +82,9 @@ struct cell;
82 82
 #endif
83 83
 #define TMCB_REQUEST_SENT_N     22
84 84
 #define TMCB_RESPONSE_SENT_N    23
85
-#define TMCB_MAX_N              23
85
+#define TMCB_ON_BRANCH_FAILURE_RO_N 24
86
+#define TMCB_ON_BRANCH_FAILURE_N 25
87
+#define TMCB_MAX_N              25
86 88
 
87 89
 
88 90
 #define TMCB_REQUEST_IN       (1<<TMCB_REQUEST_IN_N)
... ...
@@ -111,6 +113,8 @@ struct cell;
111 113
 #endif
112 114
 #define TMCB_REQUEST_SENT      (1<<TMCB_REQUEST_SENT_N)
113 115
 #define TMCB_RESPONSE_SENT     (1<<TMCB_RESPONSE_SENT_N)
116
+#define TMCB_ON_BRANCH_FAILURE (1<<TMCB_ON_BRANCH_FAILURE_N)
117
+#define TMCB_ON_BRANCH_FAILURE_RO (1<<TMCB_ON_BRANCH_FAILURE_RO_N)
114 118
 #define TMCB_MAX              ((1<<(TMCB_MAX_N+1))-1)
115 119
 
116 120
 
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
... ...
@@ -427,9 +427,9 @@ void set_early_tmcb_list(struct sip_msg *msg,
427 427
 	( local_req_in_tmcb_hl->first!=0 )
428 428
 
429 429
 
430
-int init_tmcb_lists();
430
+int init_tmcb_lists(void);
431 431
 
432
-void destroy_tmcb_lists();
432
+void destroy_tmcb_lists(void);
433 433
 
434 434
 
435 435
 /* register a callback for several types of events */
Browse code

tm: Add tm callback TMCB_REQUEST_PENDING, triggered when a 100/Trying is sent out.

Timo Reimann authored on 05/10/2011 16:39:59
Showing 1 changed files
... ...
@@ -59,34 +59,36 @@ struct cell;
59 59
 #define TMCB_REQUEST_IN_N       0
60 60
 #define TMCB_RESPONSE_IN_N      1
61 61
 #define TMCB_E2EACK_IN_N        2
62
-#define TMCB_REQUEST_FWDED_N    3
63
-#define TMCB_RESPONSE_FWDED_N   4
64
-#define TMCB_ON_FAILURE_RO_N    5
65
-#define TMCB_ON_FAILURE_N       6
66
-#define TMCB_REQUEST_OUT_N      7
67
-#define TMCB_RESPONSE_OUT_N     8
68
-#define TMCB_LOCAL_COMPLETED_N  9
69
-#define TMCB_LOCAL_RESPONSE_OUT_N 10
70
-#define TMCB_ACK_NEG_IN_N       11
71
-#define TMCB_REQ_RETR_IN_N      12
72
-#define TMCB_LOCAL_RESPONSE_IN_N 13
73
-#define TMCB_LOCAL_REQUEST_IN_N  14
74
-#define TMCB_DLG_N              15
75
-#define TMCB_DESTROY_N          16  /* called on transaction destroy */
76
-#define TMCB_E2ECANCEL_IN_N     17
77
-#define TMCB_E2EACK_RETR_IN_N   18
78
-#define TMCB_RESPONSE_READY_N	19
62
+#define TMCB_REQUEST_PENDING_N  3
63
+#define TMCB_REQUEST_FWDED_N    4
64
+#define TMCB_RESPONSE_FWDED_N   5
65
+#define TMCB_ON_FAILURE_RO_N    6
66
+#define TMCB_ON_FAILURE_N       7
67
+#define TMCB_REQUEST_OUT_N      8
68
+#define TMCB_RESPONSE_OUT_N     9
69
+#define TMCB_LOCAL_COMPLETED_N  10
70
+#define TMCB_LOCAL_RESPONSE_OUT_N 11
71
+#define TMCB_ACK_NEG_IN_N       12
72
+#define TMCB_REQ_RETR_IN_N      13
73
+#define TMCB_LOCAL_RESPONSE_IN_N 14
74
+#define TMCB_LOCAL_REQUEST_IN_N  15
75
+#define TMCB_DLG_N              16
76
+#define TMCB_DESTROY_N          17  /* called on transaction destroy */
77
+#define TMCB_E2ECANCEL_IN_N     18
78
+#define TMCB_E2EACK_RETR_IN_N   19
79
+#define TMCB_RESPONSE_READY_N	20
79 80
 #ifdef WITH_AS_SUPPORT
80
-#define TMCB_DONT_ACK_N         20 /* TM shoudn't ACK a local UAC  */
81
+#define TMCB_DONT_ACK_N         21 /* TM shoudn't ACK a local UAC  */
81 82
 #endif
82
-#define TMCB_REQUEST_SENT_N     21
83
-#define TMCB_RESPONSE_SENT_N    22
84
-#define TMCB_MAX_N              22
83
+#define TMCB_REQUEST_SENT_N     22
84
+#define TMCB_RESPONSE_SENT_N    23
85
+#define TMCB_MAX_N              23
85 86
 
86 87
 
87 88
 #define TMCB_REQUEST_IN       (1<<TMCB_REQUEST_IN_N)
88 89
 #define TMCB_RESPONSE_IN      (1<<TMCB_RESPONSE_IN_N)
89 90
 #define TMCB_E2EACK_IN        (1<<TMCB_E2EACK_IN_N)
91
+#define TMCB_REQUEST_PENDING  (1<<TMCB_REQUEST_PENDING_N)
90 92
 #define TMCB_REQUEST_FWDED    (1<<TMCB_REQUEST_FWDED_N)
91 93
 #define TMCB_RESPONSE_FWDED   (1<<TMCB_RESPONSE_FWDED_N)
92 94
 #define TMCB_ON_FAILURE_RO    (1<<TMCB_ON_FAILURE_RO_N)
Browse code

tm: Add tm callback TMCB_RESPONSE_OUT, triggered when a non-retransmitted response is sent out.

Timo Reimann authored on 05/10/2011 16:39:59
Showing 1 changed files
... ...
@@ -63,24 +63,25 @@ struct cell;
63 63
 #define TMCB_RESPONSE_FWDED_N   4
64 64
 #define TMCB_ON_FAILURE_RO_N    5
65 65
 #define TMCB_ON_FAILURE_N       6
66
-#define TMCB_RESPONSE_OUT_N     7
67
-#define TMCB_LOCAL_COMPLETED_N  8
68
-#define TMCB_LOCAL_RESPONSE_OUT_N 9
69
-#define TMCB_ACK_NEG_IN_N       10
70
-#define TMCB_REQ_RETR_IN_N      11
71
-#define TMCB_LOCAL_RESPONSE_IN_N 12
72
-#define TMCB_LOCAL_REQUEST_IN_N  13
73
-#define TMCB_DLG_N              14
74
-#define TMCB_DESTROY_N          15  /* called on transaction destroy */
75
-#define TMCB_E2ECANCEL_IN_N     16
76
-#define TMCB_E2EACK_RETR_IN_N   17
77
-#define TMCB_RESPONSE_READY_N	18
66
+#define TMCB_REQUEST_OUT_N      7
67
+#define TMCB_RESPONSE_OUT_N     8
68
+#define TMCB_LOCAL_COMPLETED_N  9
69
+#define TMCB_LOCAL_RESPONSE_OUT_N 10
70
+#define TMCB_ACK_NEG_IN_N       11
71
+#define TMCB_REQ_RETR_IN_N      12
72
+#define TMCB_LOCAL_RESPONSE_IN_N 13
73
+#define TMCB_LOCAL_REQUEST_IN_N  14
74
+#define TMCB_DLG_N              15
75
+#define TMCB_DESTROY_N          16  /* called on transaction destroy */
76
+#define TMCB_E2ECANCEL_IN_N     17
77
+#define TMCB_E2EACK_RETR_IN_N   18
78
+#define TMCB_RESPONSE_READY_N	19
78 79
 #ifdef WITH_AS_SUPPORT
79
-#define TMCB_DONT_ACK_N         19 /* TM shoudn't ACK a local UAC  */
80
+#define TMCB_DONT_ACK_N         20 /* TM shoudn't ACK a local UAC  */
80 81
 #endif
81
-#define TMCB_REQUEST_SENT_N     20
82
-#define TMCB_RESPONSE_SENT_N    21
83
-#define TMCB_MAX_N              21
82
+#define TMCB_REQUEST_SENT_N     21
83
+#define TMCB_RESPONSE_SENT_N    22
84
+#define TMCB_MAX_N              22
84 85
 
85 86
 
86 87
 #define TMCB_REQUEST_IN       (1<<TMCB_REQUEST_IN_N)
... ...
@@ -90,6 +91,7 @@ struct cell;
90 91
 #define TMCB_RESPONSE_FWDED   (1<<TMCB_RESPONSE_FWDED_N)
91 92
 #define TMCB_ON_FAILURE_RO    (1<<TMCB_ON_FAILURE_RO_N)
92 93
 #define TMCB_ON_FAILURE       (1<<TMCB_ON_FAILURE_N)
94
+#define TMCB_REQUEST_OUT      (1<<TMCB_REQUEST_OUT_N)
93 95
 #define TMCB_RESPONSE_OUT     (1<<TMCB_RESPONSE_OUT_N)
94 96
 #define TMCB_LOCAL_COMPLETED  (1<<TMCB_LOCAL_COMPLETED_N)
95 97
 #define TMCB_LOCAL_RESPONSE_OUT (1<<TMCB_LOCAL_RESPONSE_OUT_N)
... ...
@@ -242,6 +244,12 @@ struct cell;
242 244
  *   router (via t_relay/t_forward_nonack) and in this case the REPLY lock 
243 245
  *   will be held.
244 246
  *
247
+ *  TMCB_REQUEST_OUT -- request was sent out successfully.
248
+ *  There is nothing more you can change from the callback, it is good for
249
+ *  accounting-like uses.
250
+ *  Note: if the send fails or via cannot be resolved, this callback is
251
+ *  _not_ called.
252
+ *
245 253
  *  TMCB_LOCAL_COMPLETED -- final reply for localy initiated
246 254
  *  transaction arrived. Message may be FAKED_REPLY. Can be called multiple
247 255
  *  times, no lock is held.
Browse code

tm: Rename run_onsend_callbacks[2]; update, and extend documentation.

- run_onsend_callbacks -> run_trans_callbacks_with_buf.
- run_onsend_callbacks2 -> run_trans_callbacks_off_params.

Timo Reimann authored on 05/10/2011 08:57:13
Showing 1 changed files
... ...
@@ -294,7 +294,7 @@ struct cell;
294 294
  *           you really know what you're doing).
295 295
  *
296 296
  *  TMCB_REQUEST_SENT -- called each time a request was sent (even for
297
- *  retransmissions), it includes *  local and forwarded request, ser generated
297
+ *  retransmissions), it includes local and forwarded request, ser generated
298 298
  *  CANCELs and ACKs. The tmcb_params structure will have the t_rbuf, dst,
299 299
  *  send_buf and is_retr members filled.
300 300
  *  This callback is "read-only", the message was already sent and no changes
... ...
@@ -444,9 +444,12 @@ void run_reqin_callbacks( struct cell *trans, struct sip_msg *req, int code );
444 444
 void run_local_reqin_callbacks( struct cell *trans, struct sip_msg *req, 
445 445
 		int code );
446 446
 
447
-/* TBD: explanation */
448
-void run_onsend_callbacks(int type, struct retr_buf* rbuf, struct sip_msg* req,
449
-									struct sip_msg* repl, short flags);
450
-void run_onsend_callbacks2(int type, struct cell* t, struct tmcb_params* p);
447
+/* like run_trans_callbacks but provide outgoing buffer (i.e., the
448
+ * processed message) to callback */
449
+void run_trans_callbacks_with_buf(int type, struct retr_buf* rbuf, struct sip_msg* req,
450
+								  struct sip_msg* repl, short flags);
451
+
452
+/* like run_trans_callbacks but tmcb_params assumed to contain data already */
453
+void run_trans_callbacks_off_params(int type, struct cell* t, struct tmcb_params* p);
451 454
 
452 455
 #endif
Browse code

tm: Always compile TMCB_ONSEND code, it was used unconditionally anyway.

Timo Reimann authored on 05/10/2011 08:14:21
Showing 1 changed files
... ...
@@ -46,12 +46,12 @@
46 46
 
47 47
 #include "defs.h"
48 48
 
49
-/* if defined support for ONSEND callbacks will be added and
50
- * the tmcb_params structure will get some additional members */
49
+/* TMCB_ONSEND used to enable certain callback-related features when
50
+ * ONSEND was set, these days it's always enabled. For compatibility
51
+ * reasons with modules that check ONSEND, continue to set it
52
+ * unconditionally*/
51 53
 #define TMCB_ONSEND
52
-#ifdef TMCB_ONSEND
53 54
 #include "../../ip_addr.h" /* dest_info */
54
-#endif
55 55
 
56 56
 struct sip_msg;
57 57
 struct cell;
... ...
@@ -78,13 +78,9 @@ struct cell;
78 78
 #ifdef WITH_AS_SUPPORT
79 79
 #define TMCB_DONT_ACK_N         19 /* TM shoudn't ACK a local UAC  */
80 80
 #endif
81
-#ifdef TMCB_ONSEND
82 81
 #define TMCB_REQUEST_SENT_N     20
83 82
 #define TMCB_RESPONSE_SENT_N    21
84 83
 #define TMCB_MAX_N              21
85
-#else
86
-#define TMCB_MAX_N              19
87
-#endif
88 84
 
89 85
 
90 86
 #define TMCB_REQUEST_IN       (1<<TMCB_REQUEST_IN_N)
... ...
@@ -109,10 +105,8 @@ struct cell;
109 105
 #ifdef WITH_AS_SUPPORT
110 106
 #define TMCB_DONT_ACK         (1<<TMCB_DONT_ACK_N)
111 107
 #endif
112
-#ifdef TMCB_ONSEND
113 108
 #define TMCB_REQUEST_SENT      (1<<TMCB_REQUEST_SENT_N)
114 109
 #define TMCB_RESPONSE_SENT     (1<<TMCB_RESPONSE_SENT_N)
115
-#endif
116 110
 #define TMCB_MAX              ((1<<(TMCB_MAX_N+1))-1)
117 111
 
118 112
 
... ...
@@ -294,17 +288,15 @@ struct cell;
294 288
  *  t_uac.
295 289
  *   For a reply the code is the response status (which is always >0, e.g. 200,
296 290
  *   408, a.s.o).
297
- *  Note: - these callbacks can be used only if TMCB_ONSEND is defined.
298 291
  *        - the callbacks will be called sometimes with the REPLY lock held
299 292
  *          and sometimes without it, so trying to acquire the REPLY lock
300 293
  *          from these callbacks could lead to deadlocks (avoid it unless
301 294
  *           you really know what you're doing).
302 295
  *
303
- *  TMCB_REQUEST_SENT (present only if TMCB_ONSEND is defined) -- called 
304
- *  each time a request was sent (even for retransmissions), it includes 
305
- *  local and forwarded request, ser generated CANCELs and ACKs. The 
306
- *  tmcb_params structure will have the t_rbuf, dst, send_buf and is_retr
307
- *  members  filled.
296
+ *  TMCB_REQUEST_SENT -- called each time a request was sent (even for
297
+ *  retransmissions), it includes *  local and forwarded request, ser generated
298
+ *  CANCELs and ACKs. The tmcb_params structure will have the t_rbuf, dst,
299
+ *  send_buf and is_retr members filled.
308 300
  *  This callback is "read-only", the message was already sent and no changes
309 301
  *  are allowed.
310 302
  *  Note: send_buf can be different from t_rbuf->buffer for ACKs (in this
... ...
@@ -312,11 +304,11 @@ struct cell;
312 304
  *   its destination). The same goes for t_rbuf->dst and tmcb->dst for local 
313 305
  *   transactions ACKs to 2xxs.
314 306
  *
315
- *  TMCB_RESPONSE_SENT  (present only if TMCB_ONSEND is defined) -- called 
316
- *  each time a response was sent (even for retransmissions). The tmcb_params
317
- *   structure will have t_rbuf set to the reply retransmission buffer and
318
- *   send_buf set to the data sent (in this case it will always be the same 
319
- *   with t_rbuf->buf). is_retr will also be set if the reply is retransmitted
307
+ *  TMCB_RESPONSE_SENT -- called each time a response was sent (even for
308
+ *  retransmissions). The tmcb_params structure will have t_rbuf set to the
309
+ *  reply retransmission buffer and send_buf set to the data sent (in this case
310
+ *  it will always be the same with t_rbuf->buf). is_retr will also be set if
311
+ *  the reply is retransmitted
320 312
  *   by ser.
321 313
  *  This callback is "read-only", the message was already sent and no changes
322 314
  *  are allowed.
... ...
@@ -343,10 +335,8 @@ struct cell;
343 335
 	).
344 336
 */
345 337
 
346
-#ifdef TMCB_ONSEND
347 338
 #define TMCB_RETR_F 1
348 339
 #define TMCB_LOCAL_F 2
349
-#endif
350 340
 
351 341
 /* pack structure with all params passed to callback function */
352 342
 struct tmcb_params {
... ...
@@ -354,7 +344,6 @@ struct tmcb_params {
354 344
 	struct sip_msg* rpl;
355 345
 	void **param;
356 346
 	int code;
357
-#ifdef TMCB_ONSEND
358 347
 	unsigned short flags; /* set to a combination of:
359 348
 							 TMCB_RETR_F if this is a _ser_ retransmission
360 349
 							 (but not if if it's a "forwarded" retr., like a 
... ...
@@ -370,7 +359,6 @@ struct tmcb_params {
370 359
 	struct dest_info* dst; /* destination */
371 360
 	str send_buf; /* what was/will be sent on the net, used for ACKs
372 361
 					(which don't have a retr_buf). */
373
-#endif
374 362
 };
375 363
 
376 364
 #define INIT_TMCB_PARAMS(tmcb, request, reply, r_code)\
... ...
@@ -380,7 +368,6 @@ do{\
380 368
 	(tmcb).code=(r_code); \
381 369
 }while(0)
382 370
 
383
-#ifdef TMCB_ONSEND
384 371
 #define INIT_TMCB_ONSEND_PARAMS(tmcb, req, repl, rbuf, dest, buf, buf_len, \
385 372
 								onsend_flags, t_branch, code) \
386 373
 do{ \
... ...
@@ -389,7 +376,6 @@ do{ \
389 376
 	tmcb.send_buf.s=(buf); tmcb.send_buf.len=(buf_len); \
390 377
 	tmcb.flags=(onsend_flags); tmcb.branch=(t_branch); \
391 378
 }while(0)
392
-#endif
393 379
 
394 380
 /* callback function prototype */
395 381
 typedef void (transaction_cb) (struct cell* t, int type, struct tmcb_params*);
... ...
@@ -458,11 +444,9 @@ void run_reqin_callbacks( struct cell *trans, struct sip_msg *req, int code );
458 444
 void run_local_reqin_callbacks( struct cell *trans, struct sip_msg *req, 
459 445
 		int code );
460 446
 
461
-#ifdef TMCB_ONSEND
462
-
447
+/* TBD: explanation */
463 448
 void run_onsend_callbacks(int type, struct retr_buf* rbuf, struct sip_msg* req,
464 449
 									struct sip_msg* repl, short flags);
465 450
 void run_onsend_callbacks2(int type, struct cell* t, struct tmcb_params* p);
466
-#endif
467 451
 
468 452
 #endif
Browse code

tm: TMCB_RESPONSE_READY executes by its own

- removed the define of it to TMCB_RESPONSE_OUT
- now this callback is executed before writing reply to network

Daniel-Constantin Mierla authored on 02/07/2010 16:21:10
Showing 1 changed files
... ...
@@ -74,15 +74,16 @@ struct cell;
74 74
 #define TMCB_DESTROY_N          15  /* called on transaction destroy */
75 75
 #define TMCB_E2ECANCEL_IN_N     16
76 76
 #define TMCB_E2EACK_RETR_IN_N   17
77
+#define TMCB_RESPONSE_READY_N	18
77 78
 #ifdef WITH_AS_SUPPORT
78
-#define TMCB_DONT_ACK_N         18 /* TM shoudn't ACK a local UAC  */
79
+#define TMCB_DONT_ACK_N         19 /* TM shoudn't ACK a local UAC  */
79 80
 #endif
80 81
 #ifdef TMCB_ONSEND
81
-#define TMCB_REQUEST_SENT_N     19
82
-#define TMCB_RESPONSE_SENT_N    20
83
-#define TMCB_MAX_N              20
82
+#define TMCB_REQUEST_SENT_N     20
83
+#define TMCB_RESPONSE_SENT_N    21
84
+#define TMCB_MAX_N              21
84 85
 #else
85
-#define TMCB_MAX_N              18
86
+#define TMCB_MAX_N              19
86 87
 #endif
87 88
 
88 89
 
... ...
@@ -104,6 +105,7 @@ struct cell;
104 105
 #define TMCB_DESTROY          (1<<TMCB_DESTROY_N)
105 106
 #define TMCB_E2ECANCEL_IN     (1<<TMCB_E2ECANCEL_IN_N)
106 107
 #define TMCB_E2EACK_RETR_IN   (1<<TMCB_E2EACK_RETR_IN_N)
108
+#define TMCB_RESPONSE_READY   (1<<TMCB_RESPONSE_READY_N)
107 109
 #ifdef WITH_AS_SUPPORT
108 110
 #define TMCB_DONT_ACK         (1<<TMCB_DONT_ACK_N)
109 111
 #endif
... ...
@@ -113,8 +115,6 @@ struct cell;
113 115
 #endif
114 116
 #define TMCB_MAX              ((1<<(TMCB_MAX_N+1))-1)
115 117
 
116
-/* response ready - might need to be executed before sending reply out */
117
-#define TMCB_RESPONSE_READY		TMCB_RESPONSE_OUT
118 118
 
119 119
 /*
120 120
  *  Caution: most of the callbacks work with shmem-ized messages
... ...
@@ -325,6 +325,8 @@ struct cell;
325 325
  *  the cell* parameter (t) and the tmcb are set to 0. Only the param is
326 326
  *  is filled inside TMCB. For dialogs callbacks t is also 0.
327 327
  *
328
+ * TMCB_RESPONSE_READY -- a reply is ready to be sent out. Callback is
329
+ *  is executed just before writing the reply content to network.
328 330
  *
329 331
  * TMCB_DONT_ACK (requires AS support) -- for localy generated INVITEs, TM 
330 332
  * automatically generates an ACK for the received 2xx replies. But, if this 
Browse code

tm: run release function for tmcb parameters

- allow early registration of tm cb (in use by k uac module for example,
reported by Vulpyne)
- release function calling was missing
(cherry picked from commit 68d63835c6ec1a3fa4984aa3eb3fcc081a4f1f86)

Daniel-Constantin Mierla authored on 15/01/2010 21:09:01 • Andrei Pelinescu-Onciul committed on 01/02/2010 11:22:11
Showing 1 changed files
... ...
@@ -418,6 +418,8 @@ struct tmcb_head_list {
418 418
 extern struct tmcb_head_list*  req_in_tmcb_hl;
419 419
 extern struct tmcb_head_list*  local_req_in_tmcb_hl;
420 420
 
421
+void set_early_tmcb_list(struct sip_msg *msg,
422
+		struct cell *t);
421 423
 
422 424
 #define has_tran_tmcbs(_T_, _types_) \
423 425
 	( ((_T_)->tmcb_hl.reg_types)&(_types_) )
Browse code

tm: enabbled TMCB_ONSEND

- used by siptrace module

Daniel-Constantin Mierla authored on 09/07/2009 22:17:54
Showing 1 changed files
... ...
@@ -48,9 +48,7 @@
48 48
 
49 49
 /* if defined support for ONSEND callbacks will be added and
50 50
  * the tmcb_params structure will get some additional members */
51
-/*
52 51
 #define TMCB_ONSEND
53
-*/
54 52
 #ifdef TMCB_ONSEND
55 53
 #include "../../ip_addr.h" /* dest_info */
56 54
 #endif
Browse code

tm: callbacks: obsolate description is removed.

The description about the callback insertion was
confusing because no locking is necessary to insert
new callbacks.

Miklos Tirpak authored on 11/06/2009 14:53:59
Showing 1 changed files
... ...
@@ -146,21 +146,13 @@ struct cell;
146 146
  * incomplete -- this callback is called in very early stage
147 147
  * before the message is shmem-ized (so that you can work
148