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

Klaus Darilion klaus.mailinglists at pernau.at
Wed Feb 29 15:53:54 CET 2012



On 29.02.2012 14:34, Andreas Granig wrote:
> Hi,
>
> I ran into an interesting scenario when experimenting with kamailio 3.1
> as a stateless proxy (no tm module used):
>
> There is an initial INVITE without to-tag and with pre-loaded Route
> header pointing to the external address of the lb. When I call
> loose_route for that, it returns false and the Route header is removed.
> That's what I expected, and it's documented in
> http://www.kamailio.org/docs/modules/3.1.x/modules_k/rr.html#loose-route-id.
>
> However if a 407 is relayed back from the registrar via the lb to the
> UA, it sends an ACK, again with pre-loaded Route header like in the
> initial INVITE, this time with to-tag. In that case, loose_route()
> returns true, but the $du is $null and the R-URI is still the same.

What else should happen? $du will not be set as there is no more Route 
header. And R-URI is never changed (except with strict routers).

 > So
> the Route is consumed, but the URI is not used. Since it's a stateless
> proxy, this hop-by-hop ACK needs to be routed the same way as the
> initial INVITE, so what I'm doing is something like that:
>
> if(loose_route()) {
>    if($du == $null&&  $ru == $ou) {
>      # skip loose-routing for such a request
>    }
> }
>
> Is this how it's supposed to work? And is there some documentation of
> how loose_route() detects whether Route points to itself or not? I'm not
> using auto_aliases, nor do I set any aliases manually.

It uses the aliases to detect if the Route points to itself. The listen 
interfaces are automatically added to the aliases.

I think the problem is that the load balancer can not differentiate this 
ACK-after-407 from an ACK-after-200. In both cases the Route header 
points to the load-balancer and a to-tag is present.

Probably you need to add some additional functions which know how your 
environment looks like and knows to differ the ACKs. I guess $ru == $ou 
is always true, but for ACK-after-200 there is maybe a second Route 
header and thus $du is set.

regards
Klaus

 > Does it determine
> internally whether the Route points to its local ip and port? If not,
> how come the $du is not set although loose_route returns true?
>
> Andreas
>
>
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users



More information about the sr-users mailing list