[sr-dev] git:kamailio_3.0: tm: fix drop reply behavior

Daniel-Constantin Mierla miconda at gmail.com
Wed Dec 23 17:34:47 CET 2009


Module: sip-router
Branch: kamailio_3.0
Commit: a883a0b2501ba2b25ca87994d4c211f75a556ebe
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a883a0b2501ba2b25ca87994d4c211f75a556ebe

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Wed Dec 23 17:24:30 2009 +0100

tm: fix drop reply behavior

- Kamailio default behavior after failure route was to drop previous
  received replies. However, if the failure_route didn't add a new
  branch, resulted in a 500 TM reply error
- thanks to Ricardo Martinez for reporting
- credits to Andrei Pelinescu-Onciul for troubleshooting and prviding
  the fix: a new default mode for Kamailio (3) which does not drop
  previous replies if no new branch was added

---

 modules/tm/t_reply.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/tm/t_reply.c b/modules/tm/t_reply.c
index 24fad6f..4f25059 100644
--- a/modules/tm/t_reply.c
+++ b/modules/tm/t_reply.c
@@ -1128,7 +1128,7 @@ static enum rps t_should_relay_response( struct cell *Trans , int new_code,
 								 allow new branches from the failure route */
 
 		if(sr_cfg_compat==SR_COMPAT_KAMAILIO)
-			drop_replies = 1;
+			drop_replies = 3;
 		else
 			drop_replies = 0;
 		/* run ON_FAILURE handlers ( route and callbacks) */
@@ -1141,7 +1141,9 @@ static enum rps t_should_relay_response( struct cell *Trans , int new_code,
 						 	FL_REPLIED:0);
 			run_failure_handlers( Trans, Trans->uac[picked_branch].reply,
 									picked_code, extra_flags);
-			if (unlikely(drop_replies)) {
+			if (unlikely((drop_replies==3 && branch_cnt<Trans->nr_of_outgoings) ||
+						         (drop_replies!=0 && drop_replies!=3))
+					) {
 				/* drop all the replies that we have already saved */
 				i = 0;
 				if(drop_replies==2)




More information about the sr-dev mailing list