Pārlūkot izejas kodu

tm: exported set_t() and get_t_branch() viam tm api

- allows to backup and restore pointers to T and branch
Daniel-Constantin Mierla 11 gadi atpakaļ
vecāks
revīzija
777dd5e28f
3 mainītis faili ar 7 papildinājumiem un 0 dzēšanām
  1. 3 0
      modules/tm/t_lookup.h
  2. 2 0
      modules/tm/tm_load.c
  3. 2 0
      modules/tm/tm_load.h

+ 3 - 0
modules/tm/t_lookup.h

@@ -86,10 +86,13 @@ int t_check_msg(struct sip_msg* , int *branch );
 
 typedef struct cell * (*tgett_f)(void);
 struct cell *get_t(void);
+
+typedef int (*tgett_branch_f)(void);
 int get_t_branch(void);
 
 /* use carefully or better not at all -- current transaction is 
  * primarily set by lookup functions */
+typedef void (*tsett_f)(struct cell *t, int branch);
 void set_t(struct cell *t, int branch);
 
 

+ 2 - 0
modules/tm/tm_load.c

@@ -105,6 +105,8 @@ int load_tm( struct tm_binds *tmb)
 	tmb->free_dlg = free_dlg;
 	tmb->print_dlg = print_dlg;
 	tmb->t_gett = get_t;
+	tmb->t_gett_branch = get_t_branch;
+	tmb->t_sett = set_t;
 	tmb->calculate_hooks = w_calculate_hooks;
 	tmb->t_uac = t_uac;
 	tmb->t_uac_with_ids = t_uac_with_ids;

+ 2 - 0
modules/tm/tm_load.h

@@ -82,6 +82,8 @@ struct tm_binds {
 	free_dlg_f         free_dlg;
 	print_dlg_f        print_dlg;
 	tgett_f            t_gett;
+	tgett_branch_f     t_gett_branch;
+	tsett_f            t_sett;
 	calculate_hooks_f  calculate_hooks;
 	t_uac_t            t_uac;
 	t_uac_with_ids_t   t_uac_with_ids;