I've got an asterisk server that connects to an upstream provider over a WAN. The upstream provider supports both IPv4 and IPv6 connectivity, and the asterisk server is behind a NAT.
When asterisk connects to the upstream sip peer via IPv6, everything works perfectly.
The issue I have is that when I configure the asterisk server IPv6 address via DHCPv6, a race condition means that asterisk sometimes ends up attempting to contact the upstream peer via IPv4 (the SIP DNS name has both A and AAAA records). This is because asterisk starts up before the system has a valid IPv6 address. The connection does not work via IPv4 because of the NAT.
Is there a way of configuring the peer to specify that it should only be contactable over IPv6? I guess it might be possible to hack together a firewall rule to deny all IPv4 traffic to that IP, but it'd be easier to configure this within asterisk itself.