[sr-dev] git:master:bc40eaa4: tm: execute TMCB_REQUEST_FWDED cb as BRANCH_ROUTE when necessary

Victor Seva linuxmaniac at torreviejawireless.org
Thu Nov 21 10:01:21 CET 2019


Module: kamailio
Branch: master
Commit: bc40eaa4fe446bffd9f41d5d6b21becd7b7fdc87
URL: https://github.com/kamailio/kamailio/commit/bc40eaa4fe446bffd9f41d5d6b21becd7b7fdc87

Author: Victor Seva <linuxmaniac at torreviejawireless.org>
Committer: Victor Seva <linuxmaniac at torreviejawireless.org>
Date: 2019-11-21T10:01:14+01:00

tm: execute TMCB_REQUEST_FWDED cb as BRANCH_ROUTE when necessary

---

Modified: src/modules/tm/t_fwd.c

---

Diff:  https://github.com/kamailio/kamailio/commit/bc40eaa4fe446bffd9f41d5d6b21becd7b7fdc87.diff
Patch: https://github.com/kamailio/kamailio/commit/bc40eaa4fe446bffd9f41d5d6b21becd7b7fdc87.patch

---

diff --git a/src/modules/tm/t_fwd.c b/src/modules/tm/t_fwd.c
index 33a50d7799..81a0f20841 100644
--- a/src/modules/tm/t_fwd.c
+++ b/src/modules/tm/t_fwd.c
@@ -374,15 +374,19 @@ static int prepare_new_uac( struct cell *t, struct sip_msg *i_req,
 					goto error03;
 				}
 			}
+			/* run the specific callbacks for this transaction */
+			if (unlikely(has_tran_tmcbs(t, TMCB_REQUEST_FWDED)))
+				run_trans_callbacks( TMCB_REQUEST_FWDED , t, i_req, 0,
+						-i_req->REQ_METHOD);
+
 			tm_ctx_set_branch_index(T_BR_UNDEFINED);
 			set_route_type(backup_route_type);
+		} else {
+			/* run the specific callbacks for this transaction */
+			if (unlikely(has_tran_tmcbs(t, TMCB_REQUEST_FWDED)))
+				run_trans_callbacks( TMCB_REQUEST_FWDED , t, i_req, 0,
+						-i_req->REQ_METHOD);
 		}
-
-		/* run the specific callbacks for this transaction */
-		if (unlikely(has_tran_tmcbs(t, TMCB_REQUEST_FWDED)))
-			run_trans_callbacks( TMCB_REQUEST_FWDED , t, i_req, 0,
-					-i_req->REQ_METHOD);
-
 		if (likely( !(flags & UAC_DNS_FAILOVER_F) && i_req->dst_uri.s &&
 					i_req->dst_uri.len)){
 			/* no dns failover and non-empty dst_uri => use it as dst




More information about the sr-dev mailing list