Module: sip-router Branch: master Commit: 131139883c03f3851ad99e96c59dfe3c349ec011 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=13113988...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: Sun Sep 28 12:49:27 2014 +0200
tm: use advertised addr/port if set for socket in rm rpc uac commands
- reported by Juha Heinanen
---
modules/tm/rpc_uac.c | 11 ++++------- 1 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/modules/tm/rpc_uac.c b/modules/tm/rpc_uac.c index a305b63..507f4ae 100644 --- a/modules/tm/rpc_uac.c +++ b/modules/tm/rpc_uac.c @@ -156,12 +156,10 @@ static char *get_hfblock(str *uri, struct hdr_field *hf, int proto, total_len = 0; last = &sl; last->next = 0; + sock_name = 0; + portname = 0; if (ssock){ - sock_name = &ssock->address_str; - portname = &ssock->port_no_str; - }else{ - sock_name = 0; - portname = 0; + si_get_signaling_data(ssock, &sock_name, &portname); }
for (; hf; hf = hf->next) { @@ -197,8 +195,7 @@ static char *get_hfblock(str *uri, struct hdr_field *hf, int proto, " failed\n"); goto error; } - sock_name = &di.send_sock->address_str; - portname = &di.send_sock->port_no_str; + si_get_signaling_data(di.send_sock, &sock_name, &portname); } if (!append_str_list(sock_name->s, sock_name->len, &last, &total_len))
Yes, it was a bug, so it can be backported if you tested and all ok, then you can backport (or I will do it, once I get back to a computer with sources) -- you have to backport the patch to the core as well, as I added a helper function that could be use in some other parts of code.
Daniel
On 28/09/14 15:37, Juha Heinanen wrote:
Daniel-Constantin Mierla writes:
tm: use advertised addr/port if set for socket in rm rpc uac commands
daniel,
thanks for the fix. is it ok to backport it to 4.1, since it was there were i discovered the issue?
-- juha
sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
Daniel-Constantin Mierla writes:
Yes, it was a bug, so it can be backported if you tested and all ok, then you can backport (or I will do it, once I get back to a computer with sources) -- you have to backport the patch to the core as well, as I added a helper function that could be use in some other parts of code.
i tested and the patched worked so i went and cherry picked the commits to 4.1.
while testing, i noticed that if From URI already has tag attached to it, the whole header gets surrounded by <>, which does not seem right to me.
here is an example of the resulting subscribe when From header in the input looks like:
From: sip:jh@test.tutpro.com;tag=54284d3d4fcb0
SUBSCRIBE sip:foo@test.tutpro.com SIP/2.0. Via: SIP/2.0/TCP 192.98.102.30;branch=z9hG4bK7221.53689516000000000000000000000000.0. To: sip:foo@test.tutpro.com. From: <sip:jh@test.tutpro.com;tag=54284d3d4fcb0>.
-- juha