Browse code

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

- allows to backup and restore pointers to T and branch

(cherry picked from commit 777dd5e28ff6b4fcc3b1c44e841eb415c974075f)
(cherry picked from commit 09fb0aae62761ce4f251ab22c6ab9cde55e2c663)

Daniel-Constantin Mierla authored on 24/11/2013 15:05:49
Showing 3 changed files
... ...
@@ -86,10 +86,13 @@ int t_check_msg(struct sip_msg* , int *branch );
86 86
 
87 87
 typedef struct cell * (*tgett_f)(void);
88 88
 struct cell *get_t(void);
89
+
90
+typedef int (*tgett_branch_f)(void);
89 91
 int get_t_branch(void);
90 92
 
91 93
 /* use carefully or better not at all -- current transaction is 
92 94
  * primarily set by lookup functions */
95
+typedef void (*tsett_f)(struct cell *t, int branch);
93 96
 void set_t(struct cell *t, int branch);
94 97
 
95 98
 
... ...
@@ -105,6 +105,8 @@ int load_tm( struct tm_binds *tmb)
105 105
 	tmb->free_dlg = free_dlg;
106 106
 	tmb->print_dlg = print_dlg;
107 107
 	tmb->t_gett = get_t;
108
+	tmb->t_gett_branch = get_t_branch;
109
+	tmb->t_sett = set_t;
108 110
 	tmb->calculate_hooks = w_calculate_hooks;
109 111
 	tmb->t_uac = t_uac;
110 112
 	tmb->t_uac_with_ids = t_uac_with_ids;
... ...
@@ -82,6 +82,8 @@ struct tm_binds {
82 82
 	free_dlg_f         free_dlg;
83 83
 	print_dlg_f        print_dlg;
84 84
 	tgett_f            t_gett;
85
+	tgett_branch_f     t_gett_branch;
86
+	tsett_f            t_sett;
85 87
 	calculate_hooks_f  calculate_hooks;
86 88
 	t_uac_t            t_uac;
87 89
 	t_uac_with_ids_t   t_uac_with_ids;