Skip to content

Commit

Permalink
Fix changing proto via force_send_socket().
Browse files Browse the repository at this point in the history
If the RURI does not request any protocol, use the proto of the forced socket (if any).
Related to #420

(cherry picked from commit ac8c2e6)

Conflicts:
	modules/tm/uac.c
  • Loading branch information
bogdan-iancu committed Apr 2, 2015
1 parent 0bf58ab commit a4e884a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion modules/tm/t_funcs.c
Expand Up @@ -215,7 +215,9 @@ int t_relay_to( struct sip_msg *p_msg , struct proxy_l *proxy, int flags)
LM_DBG("forwarding ACK\n");
/* send it out */
if (proxy==0) {
proxy=uri2proxy(GET_NEXT_HOP(p_msg), PROTO_NONE);
proxy=uri2proxy(GET_NEXT_HOP(p_msg),
p_msg->force_send_socket ?
p_msg->force_send_socket->proto : PROTO_NONE );
if (proxy==0) {
ret=E_BAD_ADDRESS;
goto done;
Expand Down
4 changes: 3 additions & 1 deletion modules/tm/t_fwd.c
Expand Up @@ -413,7 +413,9 @@ static int add_uac( struct cell *t, struct sip_msg *request, str *uri,
do_free_proxy = 0;
}else {
proxy=uri2proxy( request->dst_uri.len ?
&request->dst_uri:&request->new_uri, PROTO_NONE );
&request->dst_uri:&request->new_uri,
request->force_send_socket ?
request->force_send_socket->proto : PROTO_NONE );
if (proxy==0) {
ret=E_BAD_ADDRESS;
goto error01;
Expand Down
2 changes: 1 addition & 1 deletion modules/tm/uac.c
Expand Up @@ -229,7 +229,7 @@ int t_uac(str* method, str* headers, str* body, dlg_t* dialog,

/* calculate the socket corresponding to next hop */
send_sock = uri2sock(0, dialog->hooks.next_hop, &to_su,
PROTO_NONE);
dialog->send_sock ? dialog->send_sock->proto : PROTO_NONE );
if (send_sock==0) {
ret=ser_error;
LM_ERR("no socket found\n");
Expand Down

0 comments on commit a4e884a

Please sign in to comment.