[Kamailio-Devel] [ openser-Bugs-1950569 ] path: add_path_received() does not add transport
SourceForge.net
noreply at sourceforge.net
Thu Aug 7 07:44:26 CEST 2008
Bugs item #1950569, was opened at 2008-04-24 13:35
Message generated for change (Comment added) made by miconda
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=1950569&group_id=139143
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: ver 1.2.x
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: axlh (axlh)
>Assigned to: Daniel-Constantin Mierla (miconda)
Summary: path: add_path_received() does not add transport
Initial Comment:
I use add_path_received() in a load-balancer in front of a registrar. When a request comes in via TCP, this is not reflected in the received parameter of the Path header added with the function add_path_received().
The problem is when the registrar sends an invite via the balancer to the ua. On the balancer, the value in the received parameter of the uri is set to the destination uri, but it is sent out via udp instead of tcp because of the missing ';transport=tcp'.
Suggested fix: add the transport over which the request came in tot the received paramater in the Path header when the transport is not UDP.
----------------------------------------------------------------------
>Comment By: Daniel-Constantin Mierla (miconda)
Date: 2008-08-07 08:44
Message:
Logged In: YES
user_id=1246013
Originator: NO
Patch applied.
----------------------------------------------------------------------
Comment By: Daniel-Constantin Mierla (miconda)
Date: 2008-08-06 18:30
Message:
Logged In: YES
user_id=1246013
Originator: NO
Patch looks ok to me. It is simple, don't know if Andreas wants a last
review.
There are options to allow lumps where the buffer should not be freed, but
let's play with that for the next release. I see comments Andreas wants
some optimizations there as well.
----------------------------------------------------------------------
Comment By: Klaus Darilion (klaus_darilion)
Date: 2008-08-06 17:24
Message:
Logged In: YES
user_id=1318360
Originator: NO
File Added: path-receveid-patch.txt
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2008-08-06 17:22
Message:
Logged In: NO
Hi! I think this is correct and easy to solve. Adding the transport to the
received parameter should work fine.
I have attached a small patch, please review and apply. Another approach
would be to use a static buffer as in pv_get_source_uri() in
nat_traversal/nat_traversal.c but I do not know if it is save to add a
static buffer to a lump.
klaus
----------------------------------------------------------------------
Comment By: axlh (axlh)
Date: 2008-05-15 14:42
Message:
Logged In: YES
user_id=1212856
Originator: YES
Bogdan,
Is that the only solution? By adding the received parameter, the switch
from tcp to/from udp is handled. I have this working perfectly well for the
simple balancer/registrar situation. In contrary to the Record-Route/Route,
the Path information is used in only 1 direction.
I have this in the 'path' field in the 'location' table:
<sip:xx.xx.xx.xx;lr;received="sip:yy.yy.yy.yy:5075;transport=tcp";nat>
where xx.xx.xx.xx is the ip of the balancer (no transport parameter, thus
defaulting to udp) and yy.yy.yy.yy the public ip of the client (with
transport parameter tcp).
The registrar correctly puts the entire uri into a Route: header and send
it off to xx.xx.xx.xx over UDP. The balancer uses loose_route() and
forwards to yy.yy.yy.yy over TCP.
Alex.
----------------------------------------------------------------------
Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2008-05-15 12:39
Message:
Logged In: YES
user_id=1275325
Originator: NO
Hi Alex,
I think the fix is not the simple - as Path is very similar to RR, in case
of changing the interface/port/proto, there should be 2 headers added - one
for the inbound interface and one for the outbound interface. This is the
correct way to do it (and RR module is doing it).
You need two headers as one tells to proxy how to send the request to your
LB and second says to LB how to sent the request out (to change the
interface/transport).
Regards,
Bogdan
----------------------------------------------------------------------
Comment By: axlh (axlh)
Date: 2008-05-15 12:04
Message:
Logged In: YES
user_id=1212856
Originator: YES
Bogdan,
That is the case, the balancer speaks both udp and tcp, the registrar only
udp.
I already tested by adding the parameter manually in the 'location' table
for a registered (tcp) contact. Then the request is send over tcp from the
balancer on. So the only thing missing is the addition of the transport to
the Path header.
Thanks,
Alex.
----------------------------------------------------------------------
Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2008-05-14 15:09
Message:
Logged In: YES
user_id=1275325
Originator: NO
Hi Axel,
On the LB, is there a protocol change? I mean you receive TCP and forward
to registrar via UDP?
Regards,
Bogdan
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=1950569&group_id=139143
More information about the Devel
mailing list