Skip to content

Commit

Permalink
Fix recalculation of sending socket after local route
Browse files Browse the repository at this point in the history
Take into consideration the "force_send_socket" setting in local route.

(cherry picked from commit d37ae66)
  • Loading branch information
bogdan-iancu committed Mar 28, 2014
1 parent 51c1518 commit 30654e5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions modules/tm/uac.c
Expand Up @@ -182,6 +182,7 @@ int t_uac(str* method, str* headers, str* body, dlg_t* dialog,
struct socket_info *send_sock, *new_send_sock;
str h_to, h_from, h_cseq, h_callid;
struct proxy_l *proxy, *new_proxy;
unsigned short dst_changed;

ret=-1;

Expand Down Expand Up @@ -306,13 +307,15 @@ int t_uac(str* method, str* headers, str* body, dlg_t* dialog,
set_avp_list( backup );

/* check for changes - if none, do not regenerate the buffer */
if (req->new_uri.s || req->add_rm || req->body_lumps ||
dst_changed = 1;
if (req->new_uri.s || req->force_send_socket!=dialog->send_sock ||
req->dst_uri.len != dialog->hooks.next_hop->len ||
memcmp(req->dst_uri.s,dialog->hooks.next_hop->s,req->dst_uri.len)){
memcmp(req->dst_uri.s,dialog->hooks.next_hop->s,req->dst_uri.len) ||
(dst_changed=0)==0 || req->add_rm || req->body_lumps){

new_send_sock = NULL;
/* do we also need to change the destination? */
if (req->dst_uri.s || req->new_uri.s) {
if (dst_changed) {
/* calculate the socket corresponding to next hop */
new_proxy = uri2proxy(
req->dst_uri.s ? &(req->dst_uri) : &req->new_uri,
Expand Down

0 comments on commit 30654e5

Please sign in to comment.