Module: sip-router
Branch: master
Commit: 9874877e47e7aec1c1a77696acb71cb94ad94228
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=9874877…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Fri May 1 12:35:01 2009 +0200
tm: exported more functions via TM API
- t_lookup_callid, generate_callid, generate_fromtag, t_lookup_request,
t_check are now available via API
---
modules/tm/callid.h | 2 ++
modules/tm/t_lookup.h | 7 ++++++-
modules/tm/tm_load.c | 5 +++++
modules/tm/tm_load.h | 6 ++++++
modules/tm/uac.h | 2 +-
5 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/modules/tm/callid.h b/modules/tm/callid.h
index 2363abb..e117686 100644
--- a/modules/tm/callid.h
+++ b/modules/tm/callid.h
@@ -49,6 +49,8 @@ int init_callid(void);
int child_init_callid(int rank);
+typedef void (*generate_callid_f)(str*);
+
/*
* Get a unique Call-ID
*/
diff --git a/modules/tm/t_lookup.h b/modules/tm/t_lookup.h
index 8994999..cb21048 100644
--- a/modules/tm/t_lookup.h
+++ b/modules/tm/t_lookup.h
@@ -55,7 +55,10 @@ void init_t();
int init_rb( struct retr_buf *rb, struct sip_msg *msg );
struct cell* t_lookupOriginalT( struct sip_msg* p_msg );
int t_reply_matching( struct sip_msg* , int* );
-int t_lookup_request( struct sip_msg* p_msg , int leave_new_locked,
+
+typedef int (*tlookup_request_f)(struct sip_msg*, int, int*);
+
+int t_lookup_request( struct sip_msg* p_msg, int leave_new_locked,
int* canceled);
int t_newtran( struct sip_msg* p_msg );
@@ -68,6 +71,7 @@ int add_branch_label( struct cell *trans,
int t_unref( struct sip_msg *p_msg);
typedef int (*tunref_f)( struct sip_msg *p_msg);
+typedef int (*tcheck_f)(struct sip_msg*, int*);
/* old t_check version (no e2eack support) */
int t_check(struct sip_msg* , int *branch );
@@ -91,6 +95,7 @@ typedef int (*tnewtran_f)(struct sip_msg*);
typedef int (*tget_ti_f)(struct sip_msg*, unsigned int*, unsigned int*);
typedef int (*tlookup_ident_f)(struct cell**, unsigned int, unsigned int);
typedef int (*trelease_f)(struct sip_msg*);
+typedef int (*tlookup_callid_f)(struct cell **, str, str);
int t_is_local(struct sip_msg*);
int t_get_trans_ident(struct sip_msg* p_msg, unsigned int* hash_index, unsigned int*
label);
diff --git a/modules/tm/tm_load.c b/modules/tm/tm_load.c
index ebdf0a8..6f8bba5 100644
--- a/modules/tm/tm_load.c
+++ b/modules/tm/tm_load.c
@@ -228,5 +228,10 @@ int load_tm( struct tm_binds *tmb)
tmb->t_get_reply_totag = t_get_reply_totag;
tmb->t_get_picked_branch = t_get_picked_branch;
+ tmb->t_lookup_callid = t_lookup_callid;
+ tmb->generate_callid = generate_callid;
+ tmb->generate_fromtag = generate_fromtag;
+ tmb->t_lookup_request = t_lookup_request;
+ tmb->t_check = t_check;
return 1;
}
diff --git a/modules/tm/tm_load.h b/modules/tm/tm_load.h
index bc99256..e3640b7 100644
--- a/modules/tm/tm_load.h
+++ b/modules/tm/tm_load.h
@@ -46,6 +46,7 @@
#include "t_lookup.h"
#include "t_reply.h"
#include "dlg.h"
+#include "callid.h"
#include "t_cancel.h"
#include "t_suspend.h"
@@ -134,6 +135,11 @@ struct tm_binds {
t_continue_f t_continue;
tget_reply_totag_f t_get_reply_totag;
tget_picked_f t_get_picked_branch;
+ tlookup_callid_f t_lookup_callid;
+ generate_callid_f generate_callid;
+ generate_fromtag_f generate_fromtag;
+ tlookup_request_f t_lookup_request;
+ tcheck_f t_check;
};
extern int tm_init;
diff --git a/modules/tm/uac.h b/modules/tm/uac.h
index f4c14e9..8106727 100644
--- a/modules/tm/uac.h
+++ b/modules/tm/uac.h
@@ -88,7 +88,7 @@ typedef int (*ack_local_uac_f)(struct cell *trans, str *hdrs, str
*body);
typedef int (*prepare_request_within_f)(uac_req_t *uac_r,
struct retr_buf **dst_req);
typedef void (*send_prepared_request_f)(struct retr_buf *request_dst);
-
+typedef void (*generate_fromtag_f)(str*, str*);
/*
* Generate a fromtag based on given Call-ID