Forráskód Böngészése

lookup introduced to exports

Jiri Kuthan 22 éve
szülő
commit
f2377e06fb
4 módosított fájl, 10 hozzáadás és 1 törlés
  1. 1 0
      modules/tm/t_lookup.h
  2. 2 0
      modules/tm/tm.c
  3. 4 1
      modules/tm/tm_load.c
  4. 3 0
      modules/tm/tm_load.h

+ 1 - 0
modules/tm/t_lookup.h

@@ -69,6 +69,7 @@ int t_unref( struct sip_msg *p_msg);
  */
 int t_check( struct sip_msg* , int *branch );
 
+typedef struct cell * (*tgett_f)(void);
 struct cell *get_t();
 
 /* use carefully or better not at all -- current transaction is 

+ 2 - 0
modules/tm/tm.c

@@ -211,6 +211,8 @@ static cmd_export_t cmds[]={
 	{"dlg_request_uas",    (cmd_function)dlg_request_uas,   NO_SCRIPT,     0, 0},
 	{"free_dlg",           (cmd_function)free_dlg,          NO_SCRIPT,     0, 0},
 	{"print_dlg",          (cmd_function)print_dlg,         NO_SCRIPT,     0, 0},
+
+	{T_GETT,				(cmd_function)get_t,			NO_SCRIPT,		0,0},
 	{0,0,0,0,0}
 };
 

+ 4 - 1
modules/tm/tm_load.c

@@ -131,6 +131,9 @@ int load_tm( struct tm_binds *tmb)
 		LOG( L_ERR, LOAD_ERROR "'print_dlg' not found\n");
 		return -1;
 	}
-
+	if (!(tmb->t_gett=(tgett_f)find_export(T_GETT,NO_SCRIPT,0))) {
+		LOG( L_ERR, LOAD_ERROR "'" T_GETT "' not found\n");
+		return -1;
+	}
 	return 1;
 }

+ 3 - 0
modules/tm/tm_load.h

@@ -68,6 +68,7 @@
 #define T_IS_LOCAL           "t_is_local"
 #define T_REQUEST_WITHIN     "request_within"
 #define T_REQUEST_OUTSIDE    "request_outside"
+#define T_GETT				 "t_gett"
 
 
 
@@ -94,6 +95,8 @@ struct tm_binds {
 	dlg_request_uas_f  dlg_request_uas;
 	free_dlg_f         free_dlg;
 	print_dlg_f        print_dlg;
+
+	tgett_f			t_gett;
 };