Skip to content

Commit

Permalink
tm: use outbound tcp connection id for relaying if FL_USE_OTCPID is set
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Mar 31, 2020
1 parent 2ec8e05 commit 2846ef4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/modules/tm/t_funcs.c
Expand Up @@ -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,
Expand Down
6 changes: 6 additions & 0 deletions src/modules/tm/t_fwd.c
Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down

0 comments on commit 2846ef4

Please sign in to comment.