Module: sip-router
Branch: master
Commit: 83620cb7cd14ee3b509eef72d99337567f53967f
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=83620cb…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Sat Mar 12 12:22:51 2011 +0100
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
---
modules_k/tmx/tmx_mod.c | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/modules_k/tmx/tmx_mod.c b/modules_k/tmx/tmx_mod.c
index 6e6f758..1da7fd3 100644
--- a/modules_k/tmx/tmx_mod.c
+++ b/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);
static int fixup_reply_callid(void** param, int param_no);
+static int t_flush_flags(struct sip_msg* msg, char*, char* );
+
/* statistic variables */
stat_var *tm_rcv_rpls;
stat_var *tm_rld_rpls;
@@ -135,6 +137,8 @@ static cmd_export_t cmds[]={
fixup_cancel_callid, 0, ANY_ROUTE },
{"t_reply_callid", (cmd_function)t_reply_callid, 4,
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}
};
@@ -398,6 +402,23 @@ static int t_reply_callid(struct sip_msg* msg, char *cid, char
*cseq,
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
/*** tm stats ***/