[sr-dev] git:3.1: tm: be sure branch PV is set when t_check_trans() is used for reply

Daniel-Constantin Mierla miconda at gmail.com
Wed Jul 27 19:31:03 CEST 2011


Module: sip-router
Branch: 3.1
Commit: 8ebbed77f2be9277b6296c95952b17e5a4a5c9b7
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=8ebbed77f2be9277b6296c95952b17e5a4a5c9b7

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Tue Jul 19 19:41:20 2011 +0200

tm: be sure branch PV is set when t_check_trans() is used for reply

- reported by Alex Hermann, FS#117
(cherry picked from commit 2e426419ab2f3f15adc4a50de6efe3bb06dc77b8)

---

 modules/tm/tm.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/modules/tm/tm.c b/modules/tm/tm.c
index c4ac427..cf3e099 100644
--- a/modules/tm/tm.c
+++ b/modules/tm/tm.c
@@ -1940,12 +1940,17 @@ int w_t_reply_wrp(struct sip_msg *m, unsigned int code, char *txt)
 static int t_check_trans(struct sip_msg* msg, char* foo, char* bar)
 {
 	struct cell* t;
+	int branch;
+	int ret;
 	
-	if (msg->first_line.type==SIP_REPLY)
-		return w_t_check(msg, 0 ,0);
-	else if (msg->REQ_METHOD==METHOD_CANCEL)
+	if (msg->first_line.type==SIP_REPLY) {
+		branch = 0;
+		ret = (t_check_msg( msg , &branch)==1) ? 1 : -1;
+		tm_ctx_set_branch_index(branch);
+		return ret;
+	} else if (msg->REQ_METHOD==METHOD_CANCEL) {
 		return w_t_lookup_cancel(msg, 0, 0);
-	else{
+	} else {
 		switch(t_check_msg(msg, 0)){
 			case -2: /* possible e2e ack */
 				return 1;




More information about the sr-dev mailing list