Wednesday, July 27, 2011

Asterisk tip: ast_sip_ouraddrfor: Address remapping activated in sip.conf but we're using IPv6, which doesn't need it. Please remove "localnet" and/or "externaddr" settings.

Ever seen this "error" message from Asterisk?

"ast_sip_ouraddrfor: Address remapping activated in sip.conf but we're using IPv6, which doesn't need it. Please remove "localnet" and/or "externaddr" settings."

If you've enabled IPv6 with your Asterisk installation, but have also configured it to understand it's on a private network, accessing the outside world using port forwarding, then you've almost certainly come across the message above.

Well, I have some good news and bad news. The good news is that it's wrong. The code, as written, appears to assume that any incoming IPv6 connection is proof that the NAT hacks someone might have coded in their sip.conf are unnecessary. Of course, unless you live in an IPv6-only universe, that just isn't true.

The bad news is that until the Asterisk people fix it, you'll have to either live with it, or recompile Asterisk. If you plan to do the latter, edit chan/sip_chan.c, search for this bit of code:

ast_log(LOG_WARNING, "Address remapping activated in sip.conf "
                                "but we're using IPv6, which doesn't need it. Please "
                                "remove \"localnet\" and/or \"externaddr\" settings.\n");

Surround it with /* */ to disable that line, save, and recompile.

I'll submit a bug report one of these days. One did exist, once, but it appears to have been closed due to confusion about the validity of the message.