فهرست منبع

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 16 سال پیش
والد
کامیت
9874877e47
5فایلهای تغییر یافته به همراه20 افزوده شده و 2 حذف شده
  1. 2 0
      modules/tm/callid.h
  2. 6 1
      modules/tm/t_lookup.h
  3. 5 0
      modules/tm/tm_load.c
  4. 6 0
      modules/tm/tm_load.h
  5. 1 1
      modules/tm/uac.h

+ 2 - 0
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
  */

+ 6 - 1
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);

+ 5 - 0
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;
 }

+ 6 - 0
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;

+ 1 - 1
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