Explorar el Código

added wrapper function for C calls to w_t_reply (needed after changes done by TMa)

Vaclav Kubart hace 19 años
padre
commit
e306242f0e
Se han modificado 3 ficheros con 25 adiciones y 2 borrados
  1. 3 0
      modules/tm/t_reply.h
  2. 18 0
      modules/tm/tm.c
  3. 4 2
      modules/tm/tm_load.c

+ 3 - 0
modules/tm/t_reply.h

@@ -73,6 +73,9 @@ typedef int (*treply_wb_f)( struct cell* trans,
 	unsigned int code, char * text, char * body, 
 	char * new_header, char * to_tag);
 
+/* wrapper function needed after changes in w_t_reply */
+int w_t_reply_wrp(struct sip_msg *m, unsigned int code, char *txt);
+
 #define LOCK_REPLIES(_t) lock(&(_t)->reply_mutex )
 #define UNLOCK_REPLIES(_t) unlock(&(_t)->reply_mutex )
 

+ 18 - 0
modules/tm/tm.c

@@ -954,3 +954,21 @@ static rpc_export_t tm_rpc[] = {
 	{"tm.stats",  tm_rpc_stats, tm_rpc_stats_doc, 0},
 	{0, 0, 0, 0}
 };
+
+/* wrapper function needed after changes in w_t_reply */
+int w_t_reply_wrp(struct sip_msg *m, unsigned int code, char *txt)
+{
+	fparam_t c;
+	fparam_t r;
+	
+	c.type = FPARAM_INT;
+	c.orig = NULL; /* ? */
+	c.v.i = code;
+	
+	r.type = FPARAM_ASCIIZ;
+	r.orig = NULL; /* ? */
+	r.v.asciiz = txt;
+
+	return w_t_reply(m, (char *)&c, (char*)&r);
+}
+

+ 4 - 2
modules/tm/tm_load.c

@@ -71,10 +71,12 @@ int load_tm( struct tm_binds *tmb)
 		LOG(L_ERR, LOAD_ERROR "'t_relay' not found\n");
 		return -1;
 	}
-	if (!(tmb->t_reply=(treply_f)find_export(T_REPLY, 2, 0)) ) {
+/*	if (!(tmb->t_reply=(treply_f)find_export(T_REPLY, 2, 0)) ) {
 		LOG( L_ERR, LOAD_ERROR "'t_reply' not found\n");
 		return -1;
-	}
+	}*/
+	tmb->t_reply = w_t_reply_wrp;
+	
 	if (!(tmb->t_reply_with_body=(treply_wb_f)find_export
 	(T_REPLY_WB, NO_SCRIPT, 0)) ) {
 		LOG( L_ERR, LOAD_ERROR "'t_reply_with_body' not found\n");