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@192.168.51.133), then the $ru of the INVITE and of the ACK is
exactly that: sip:test@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.
Andreas