On Monday 22 August 2011, Alex Hermann wrote:
It seems kamailio 3 does not save message flags set in
branch route into
the transaction. In reply_route and failure_route the flag set in
branch_route is unset. In 1.4 this used to work. I would like to get that
behaviour back, is this possible?
This patch seems to restore old functionality. Would this be ok to commit?
diff --git a/modules/tm/t_fwd.c b/modules/tm/t_fwd.c
index 30558ab..756e4b4 100644
--- a/modules/tm/t_fwd.c
+++ b/modules/tm/t_fwd.c
@@ -1510,6 +1510,8 @@ int t_forward_nonack( struct cell *t, struct sip_msg*
p_msg ,
clear_branches();
setbflagsval(0, backup_bflags);
+ /* update flags, if changed in branch route */
+ t->uas.request->flags = p_msg->flags;
/* don't forget to clear all branches processed so far */
Testscenario:
route {
setflag(0);
t_on_branch("1");
t_on_reply("1");
t_on_failure("1");
xlog("L_NOTICE", "[$rm] Request before relay: $mF");
t_relay();
}
branch_route[1] {
xlog("L_NOTICE", "[$rm] Branch begin: $mF");
setflag(8);
xlog("L_NOTICE", "[$rm] Branch end: $mF");
}
onreply_route[1] {
xlog("L_NOTICE", "[$rm] Reply ($rs) begin: $mF");
setflag(4);
xlog("L_NOTICE", "[$rm] Reply end: $mF");
}
failure_route[1] {
xlog("L_NOTICE", "[$rm] Failure ($T_reply_code): $mF");
}
Log output on 3.x:
[INVITE] Request begin: 00000000
[INVITE] Request before relay: 00000001
[INVITE] Branch begin: 00000001
[INVITE] Branch end: 00000101
[INVITE] Reply (100) begin: 00000001
[INVITE] Reply end: 00000011
[INVITE] Failure (408): 00000011
Log output on 1.4:
[INVITE] Request begin: 00000000
[INVITE] Request before relay: 00000001
[INVITE] Branch begin: 00000001
[INVITE] Branch end: 00000101
[INVITE] Reply (100) begin: 00000101
[INVITE] Reply end: 00000111
[INVITE] Failure (408) begin: 00000111
--
Greetings,
Alex Hermann