[sr-dev] alias_contact()/handle_alias() ready for testing
Iñaki Baz Castillo
ibc at aliax.net
Mon Nov 9 11:54:59 CET 2009
El Lunes, 9 de Noviembre de 2009, Juha Heinanen escribió:
> Iñaki Baz Castillo writes:
> > Really great, it looks very simple, correct and doesn't break
> > original Contact URI.
>
> inaki,
>
> i went to walk and it occurred to me that alias_contact() should not be
> called if request comes from another proxy, because it is that proxy's
> job to do whatever it needs to to. so the condition on calling
> alias_contact() on initial requests is:
>
> route [OTHER_REQUESTS] { # handle other initial requests than REGISTER
>
> if (!is_present_hf("Record-Route") && !alias_contact()) {
> xlog("L_ERR", "Error in aliasing contact <$ct>\n");
> send_reply("400", "Bad request");
> exit;
> };
>
> same thing if reply to initial request comes from another proxy. the
> test could then be if the topmost rr header has been added by this
> proxy, but i haven't had time yet to think how to implement the test.
>
> and the same for in-dialog requests.
There is a problem here as Record-Route are not needed for in-dialog request
(the proxy can add it but the UAS should ignore it as RR just makes sense in
the initial request and response forming the dialog).
So if proxy A doesn't append RR for an in-dialog request (and it shouldn't do
it as per RFC 3261) then your "if" statement would fail (proxy B would apply
alias_contact).
> perhaps you have ideas here.
What about calling alias_contact() just in case nat_test() detects the
following two requeriments:
1) The IP in Contact is private.
2) There is no ";alias" param in Contact URI.
Of course a new nat_test flag would be needed for point 2.
I think it should fix the issue, opinions?
--
Iñaki Baz Castillo <ibc at aliax.net>
More information about the sr-dev
mailing list