1) I guess the initial author know there is no nat in ipv6, so he didn't
bother with. I just pushed a patch for it in master (814c08f3), if
tested and reported to work ok, it can be backported
2) the contact uri example in the first email is perhaps not properly
reflecting the contact uri that was generated, because it should have
been with the ip address and the port. It seems to be only the ip
address. If there was an omission, that's ok, because I expect the uri
parsing error is due to hostpart having the port following the ipv6
address -- that requires the ipv6 between []. If the port was missing,
that can be another issue, but the code shows the port is always added
and it wouldn't worked at all so far without it.
3) use set_contact_alias() if use modules that need the new contact
(like dialog, presence, ...) for later usage. The *contact_alias()
function don't change the host/port part, they just add a new parameter,
so it would have been safe with or without []. Anyhow, the code adds []
if the address is ipv6