Selaa lähdekoodia

tmx: restored t_flush_flags()

- function to sycn the msg flags back to transaction when the
  transaction was created before modifying the flags
- reported by Juha Heinanen
Daniel-Constantin Mierla 14 vuotta sitten
vanhempi
commit
83620cb7cd
1 muutettua tiedostoa jossa 21 lisäystä ja 0 poistoa
  1. 21 0
      modules_k/tmx/tmx_mod.c

+ 21 - 0
modules_k/tmx/tmx_mod.c

@@ -53,6 +53,8 @@ static int t_reply_callid(struct sip_msg* msg, char *cid, char *cseq,
 				char *rc, char *rs);
 				char *rc, char *rs);
 static int fixup_reply_callid(void** param, int param_no);
 static int fixup_reply_callid(void** param, int param_no);
 
 
+static int t_flush_flags(struct sip_msg* msg, char*, char* );
+
 /* statistic variables */
 /* statistic variables */
 stat_var *tm_rcv_rpls;
 stat_var *tm_rcv_rpls;
 stat_var *tm_rld_rpls;
 stat_var *tm_rld_rpls;
@@ -135,6 +137,8 @@ static cmd_export_t cmds[]={
 		fixup_cancel_callid, 0, ANY_ROUTE },
 		fixup_cancel_callid, 0, ANY_ROUTE },
 	{"t_reply_callid", (cmd_function)t_reply_callid,  4,
 	{"t_reply_callid", (cmd_function)t_reply_callid,  4,
 		fixup_reply_callid, 0, ANY_ROUTE },
 		fixup_reply_callid, 0, ANY_ROUTE },
+	{"t_flush_flags",   (cmd_function)t_flush_flags,    0, 0,
+			0, ANY_ROUTE  },
 	{0,0,0,0,0,0}
 	{0,0,0,0,0,0}
 };
 };
 
 
@@ -398,6 +402,23 @@ static int t_reply_callid(struct sip_msg* msg, char *cid, char *cseq,
 	return -1;
 	return -1;
 }
 }
 
 
+/**
+ *
+ */
+static int t_flush_flags(struct sip_msg* msg, char *foo, char *bar)
+{
+	struct cell *t;
+
+	t=_tmx_tmb.t_gett();
+	if ( t==0 || t==T_UNDEFINED) {
+		LM_ERR("failed to flush flags - no transaction found\n");
+		return -1;
+	}
+
+	t->uas.request->flags = msg->flags;
+	return 1;
+}
+
 #ifdef STATISTICS
 #ifdef STATISTICS
 
 
 /*** tm stats ***/
 /*** tm stats ***/