Browse code

tm: exported more functions via TM API

- t_lookup_callid, generate_callid, generate_fromtag, t_lookup_request,
t_check are now available via API

Daniel-Constantin Mierla authored on 01/05/2009 10:35:01
Showing 5 changed files
... ...
@@ -49,6 +49,8 @@ int init_callid(void);
49 49
 int child_init_callid(int rank);
50 50
 
51 51
 
52
+typedef void (*generate_callid_f)(str*);
53
+
52 54
 /*
53 55
  * Get a unique Call-ID
54 56
  */
... ...
@@ -55,7 +55,10 @@ void init_t();
55 55
 int init_rb( struct retr_buf *rb, struct sip_msg *msg );
56 56
 struct cell* t_lookupOriginalT( struct sip_msg* p_msg );
57 57
 int t_reply_matching( struct sip_msg* , int* );
58
-int t_lookup_request( struct sip_msg* p_msg , int leave_new_locked,
58
+
59
+typedef int (*tlookup_request_f)(struct sip_msg*, int, int*);
60
+
61
+int t_lookup_request( struct sip_msg* p_msg, int leave_new_locked,
59 62
 						int* canceled);
60 63
 int t_newtran( struct sip_msg* p_msg );
61 64
 
... ...
@@ -68,6 +71,7 @@ int add_branch_label( struct cell *trans,
68 71
 int t_unref( struct sip_msg *p_msg);
69 72
 typedef int (*tunref_f)( struct sip_msg *p_msg);
70 73
 
74
+typedef int (*tcheck_f)(struct sip_msg*, int*);
71 75
 
72 76
 /* old t_check version (no e2eack support) */
73 77
 int t_check(struct sip_msg* , int *branch );
... ...
@@ -91,6 +95,7 @@ typedef int (*tnewtran_f)(struct sip_msg*);
91 95
 typedef int (*tget_ti_f)(struct sip_msg*, unsigned int*, unsigned int*);
92 96
 typedef int (*tlookup_ident_f)(struct cell**, unsigned int, unsigned int);
93 97
 typedef int (*trelease_f)(struct sip_msg*);
98
+typedef int (*tlookup_callid_f)(struct cell **, str, str);
94 99
 
95 100
 int t_is_local(struct sip_msg*);
96 101
 int t_get_trans_ident(struct sip_msg* p_msg, unsigned int* hash_index, unsigned int* label);
... ...
@@ -228,5 +228,10 @@ int load_tm( struct tm_binds *tmb)
228 228
 
229 229
 	tmb->t_get_reply_totag = t_get_reply_totag;
230 230
 	tmb->t_get_picked_branch = t_get_picked_branch;
231
+	tmb->t_lookup_callid = t_lookup_callid;
232
+	tmb->generate_callid = generate_callid;
233
+	tmb->generate_fromtag = generate_fromtag;
234
+	tmb->t_lookup_request = t_lookup_request;
235
+	tmb->t_check = t_check;
231 236
 	return 1;
232 237
 }
... ...
@@ -46,6 +46,7 @@
46 46
 #include "t_lookup.h"
47 47
 #include "t_reply.h"
48 48
 #include "dlg.h"
49
+#include "callid.h"
49 50
 #include "t_cancel.h"
50 51
 #include "t_suspend.h"
51 52
 
... ...
@@ -134,6 +135,11 @@ struct tm_binds {
134 135
 	t_continue_f	t_continue;
135 136
 	tget_reply_totag_f t_get_reply_totag;
136 137
 	tget_picked_f t_get_picked_branch;
138
+	tlookup_callid_f t_lookup_callid;
139
+	generate_callid_f generate_callid;
140
+	generate_fromtag_f generate_fromtag;
141
+	tlookup_request_f t_lookup_request;
142
+	tcheck_f t_check;
137 143
 };
138 144
 
139 145
 extern int tm_init;
... ...
@@ -88,7 +88,7 @@ typedef int (*ack_local_uac_f)(struct cell *trans, str *hdrs, str *body);
88 88
 typedef int (*prepare_request_within_f)(uac_req_t *uac_r,
89 89
 		struct retr_buf **dst_req);
90 90
 typedef void (*send_prepared_request_f)(struct retr_buf *request_dst);
91
-
91
+typedef void (*generate_fromtag_f)(str*, str*);
92 92
 
93 93
 /*
94 94
  * Generate a fromtag based on given Call-ID