NAT后面的星号设置错误的联系人标题

我在静态configuration的NAT后面使用带星号13.1.0的SIP。 private_ip服务器与public_ip不同,我可以在这里find它。 我已经在sip.conf文件中设置了这些选项。

 externaddr=public_ip:5060 media_address=public_ip localnet=private_ip/24 

如果我现在尝试开始呼叫,则消息可能工作,直到服务器将OK消息发送到客户端。 在这个消息中,星号将Contact头部设置为其私有的而不是公共IP。

 SIP/2.0 200 OK From: "Test799" <sip:799@HOSTNAME>;tag=7ajcnltflq To: <sip:62@HOSTNAME;user=phone>;tag=as08a05471 Call-ID: 54b6479ed3e3-io8z54pk25ve CSeq: 2 INVITE Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE Supported: replaces, timer Session-Expires: 1800;refresher=uas Contact: <sip:62@PRIVATE_IP:5060> Content-Type: application/sdp Require: timer Content-Length: ... v=0 o=root 1234 1234 IN IP4 PUBLIC_IP c=IN IP4 PUBLIC_IP ... 

由于Contact头,UA现在将下面的ACK给PRIVATE_IP。

我的configuration有什么问题? 这是星号中的错误吗?

如果您将IPv4 externaddr与IPv6 bindaddr设置结合使用,则会出现此问题。

 ; c) Listen on the IPv4 wildcard. Example: bindaddr=0.0.0.0 ; d) Listen on the IPv4 and IPv6 wildcards. Example: bindaddr=:: ... ; (Note that using bindaddr=:: will show only a single IPv6 socket in netstat. ; IPv4 is supported at the same time using IPv4-mapped IPv6 addresses.) 

知道bindaddr = ::不绑定IPv4通配符很重要。 它绑定在IPv4映射的IPv6地址上!