Browse code

lookup introduced to exports

Jiri Kuthan authored on 30/10/2003 11:56:44
Showing 4 changed files
... ...
@@ -69,6 +69,7 @@ int t_unref( struct sip_msg *p_msg);
69 69
  */
70 70
 int t_check( struct sip_msg* , int *branch );
71 71
 
72
+typedef struct cell * (*tgett_f)(void);
72 73
 struct cell *get_t();
73 74
 
74 75
 /* use carefully or better not at all -- current transaction is 
... ...
@@ -211,6 +211,8 @@ static cmd_export_t cmds[]={
211 211
 	{"dlg_request_uas",    (cmd_function)dlg_request_uas,   NO_SCRIPT,     0, 0},
212 212
 	{"free_dlg",           (cmd_function)free_dlg,          NO_SCRIPT,     0, 0},
213 213
 	{"print_dlg",          (cmd_function)print_dlg,         NO_SCRIPT,     0, 0},
214
+
215
+	{T_GETT,				(cmd_function)get_t,			NO_SCRIPT,		0,0},
214 216
 	{0,0,0,0,0}
215 217
 };
216 218
 
... ...
@@ -131,6 +131,9 @@ int load_tm( struct tm_binds *tmb)
131 131
 		LOG( L_ERR, LOAD_ERROR "'print_dlg' not found\n");
132 132
 		return -1;
133 133
 	}
134
-
134
+	if (!(tmb->t_gett=(tgett_f)find_export(T_GETT,NO_SCRIPT,0))) {
135
+		LOG( L_ERR, LOAD_ERROR "'" T_GETT "' not found\n");
136
+		return -1;
137
+	}
135 138
 	return 1;
136 139
 }
... ...
@@ -68,6 +68,7 @@
68 68
 #define T_IS_LOCAL           "t_is_local"
69 69
 #define T_REQUEST_WITHIN     "request_within"
70 70
 #define T_REQUEST_OUTSIDE    "request_outside"
71
+#define T_GETT				 "t_gett"
71 72
 
72 73
 
73 74
 
... ...
@@ -94,6 +95,8 @@ struct tm_binds {
94 95
 	dlg_request_uas_f  dlg_request_uas;
95 96
 	free_dlg_f         free_dlg;
96 97
 	print_dlg_f        print_dlg;
98
+
99
+	tgett_f			t_gett;
97 100
 };
98 101
 
99 102