[Serusers] [Serdev] loose_route behaviour, detecting single Route with myself
Klaus Darilion
klaus.mailinglists at pernau.at
Thu Jul 12 09:03:39 CEST 2007
Martin Hoffmann wrote:
> In most cases this is what you want, because the presence of Routes
> indicates an in-dialog message which you want to treat differently (In
Here we see the root problem of the loose_route function: it's naming
and it's usage.
To identify in-dialog messages the only thing to worry about is the
to-tag. Nothing more, nothing less.
> practice, most UAs just forward the message to the outgoing proxy
> without adding a Route header, which is perfectly legal as well). The
> proper test for this, of course, is to check for the presence of a To
> tag. But it seems to be common to all SER configs I have seen to misuse
> loose_route() in this way.
Yes.
> Changing the behaviour of loose_route() yet again would mess up a lot of
> configs as the earlier change messed up a lot of configs (it certainly
> cost me a couple of hours debugging). Having another function would
> probably be a better approach. Especially, since loose_route() is
> actually the wrong name. The function does both loose and static record
> routing.
I totally agree with you, e.g:
if (in_dialog()) { # probably an alias to has_totag()
process_routes(); # may have different return values
# -1: no routes found
# -2: only a single route pointing to "myself"
# 1: loose routing done
# 2: strict routing done
... NAT traversal, security checks, ....
t_relay();
exit;
}
process_routes();
# here proceed according to policy, e.g.
# -1, -2: handle now incoming request
# 1, 2: reject out-of-dialog loose/strict-route request
...
regards
klaus
>
> Regards,
> Martin
> _______________________________________________
> Serdev mailing list
> Serdev at lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serdev
More information about the sr-users
mailing list