Skip to content

Commit

Permalink
Fix extracting TO hdr.
Browse files Browse the repository at this point in the history
Do not add '@' if username is not present.
Reported by @DMOsipov on GITHUB.
Closes #818
  • Loading branch information
bogdan-iancu committed Mar 18, 2016
1 parent 847805e commit e74f665
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions modules/b2b_logic/logic.c
Original file line number Diff line number Diff line change
Expand Up @@ -2697,7 +2697,6 @@ str* create_top_hiding_entities(struct sip_msg* msg, b2bl_cback_f cbf,
goto error;
}
/* create new client */

memset(&ci, 0, sizeof(client_info_t));
ci.method = msg->first_line.u.request.method;
ci.req_uri = *(GET_RURI(msg));
Expand Down Expand Up @@ -2984,8 +2983,8 @@ int udh_to_uri(str user, str host, str port, str* uri)
return -1;
}

uri->len = sprintf(uri->s, "sip:%.*s@%.*s", user.len, user.s,
host.len, host.s);
uri->len = sprintf(uri->s, "sip:%.*s%.*s%.*s", user.len, user.s,
user.len?1:0,"@",host.len, host.s);
if(port.s)
{
uri->len += sprintf(uri->s+uri->len, ":%.*s", port.len, port.s);
Expand Down

0 comments on commit e74f665

Please sign in to comment.