Module: kamailio
Branch: 5.3
Commit: 8b558ce9aa0625bdc2d3c66d795a450ce982a716
URL:
https://github.com/kamailio/kamailio/commit/8b558ce9aa0625bdc2d3c66d795a450…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2019-11-21T10:08:13+01:00
tm: execute TMCB_REQUEST_FWDED cb as BRANCH_ROUTE when necessary
(cherry picked from commit bc40eaa4fe446bffd9f41d5d6b21becd7b7fdc87)
---
Modified: src/modules/tm/t_fwd.c
---
Diff:
https://github.com/kamailio/kamailio/commit/8b558ce9aa0625bdc2d3c66d795a450…
Patch:
https://github.com/kamailio/kamailio/commit/8b558ce9aa0625bdc2d3c66d795a450…
---
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