Module: kamailio
Branch: master
Commit: 2846ef4271c4e539b3ffdfe8667a2894d7627af7
URL:
https://github.com/kamailio/kamailio/commit/2846ef4271c4e539b3ffdfe8667a289…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-03-31T10:04:05+02:00
tm: use outbound tcp connection id for relaying if FL_USE_OTCPID is set
---
Modified: src/modules/tm/t_funcs.c
Modified: src/modules/tm/t_fwd.c
---
Diff:
https://github.com/kamailio/kamailio/commit/2846ef4271c4e539b3ffdfe8667a289…
Patch:
https://github.com/kamailio/kamailio/commit/2846ef4271c4e539b3ffdfe8667a289…
---
diff --git a/src/modules/tm/t_funcs.c b/src/modules/tm/t_funcs.c
index ee06bedf43..97c0d2568b 100644
--- a/src/modules/tm/t_funcs.c
+++ b/src/modules/tm/t_funcs.c
@@ -285,6 +285,9 @@ int t_relay_to( struct sip_msg *p_msg , struct proxy_l *proxy, int
proto,
if ( p_msg->REQ_METHOD==METHOD_ACK) {
LM_DBG("forwarding ACK statelessly\n");
init_dest_info(&dst);
+ if(p_msg->msg_flags & FL_USE_OTCPID) {
+ dst.id = p_msg->otcpid;
+ }
if (proxy==0) {
dst.proto=proto;
if (get_uri_send_info(GET_NEXT_HOP(p_msg), &host, &port,
diff --git a/src/modules/tm/t_fwd.c b/src/modules/tm/t_fwd.c
index 83f22ebf0d..0a302c438b 100644
--- a/src/modules/tm/t_fwd.c
+++ b/src/modules/tm/t_fwd.c
@@ -1673,6 +1673,9 @@ int t_forward_nonack( struct cell *t, struct sip_msg* p_msg,
if (t->flags & T_CANCELED) goto canceled;
if (branch_ret>=0) {
added_branches |= 1<<branch_ret;
+ if(p_msg->msg_flags & FL_USE_OTCPID) {
+ t->uac[branch_ret].request.dst.id = p_msg->otcpid;
+ }
} else {
lowest_ret=MIN_int(lowest_ret, branch_ret);
}
@@ -1699,6 +1702,9 @@ int t_forward_nonack( struct cell *t, struct sip_msg* p_msg,
* branch result */
if (branch_ret>=0) {
added_branches |= 1<<branch_ret;
+ if(p_msg->msg_flags & FL_USE_OTCPID) {
+ t->uac[branch_ret].request.dst.id = p_msg->otcpid;
+ }
} else {
lowest_ret=MIN_int(lowest_ret, branch_ret);
}