[SR-Users] loose_route() with pre-loaded Route in ACK

Klaus Darilion klaus.mailinglists at pernau.at
Wed Feb 29 21:34:32 CET 2012



Am 29.02.2012 19:12, schrieb Andreas Granig:
> On 02/29/2012 06:35 PM, Andreas Granig wrote:
>>> If tm is used, it will take care of this by consuming the ACK and
>>> generating a new one. It seems that we need some fixes for stateless
>>> routing.
>> I already switched back to transaction stateful routing for now until I
>> get a better idea about what's going on on my test machine.
> I'm slowly getting the problem :)
>
> When you use the IP address of your kamailio as the domain part (e.g.
> sip:test at 192.168.51.133), then the $ru of the INVITE and of the ACK is
> exactly that: sip:test at 192.168.51.133. What happens in loose_route() is
> that there is a check called is_preloaded(), which simply checks if
> there's a To-tag, and if so, returns false back to the config file.
> However if there IS a To-tag like in the ACK, then is_preloaded()
> returns false, and it starts checking if $rd:$rp matches one of your
> sockets, which in this case returns true. Because of this, it assumes
> that the previous hop was a strict-router, and it sees that the next hop
> (actually itself) is a loose-router, and because of that it does a
> rewrite_uri() using the $du to "recover" from that scenario.
>
> So it's actually a bit of a special case (using a pre-loaded route and
> an IP as $rd and a stateless logic), but a quite nasty and still valid one.

Maybe we should add a module parameter to disable strict-router support.

Maybe you can catch the ACK before loose_route check with
if (ACK && has_totag() && uri=myself) {
   # use load-balancer logic ...
}

klaus

regards
Klaus



More information about the sr-users mailing list