星号NAT SIP 2.0未经授权401奇怪的场景



首先我已经看了一下类似的问题,如:

https://serverfault.com/questions/392979/asterisk - sip - 2 - 0 - 401 -未经授权或https://serverfault.com/questions/574166/asterisk - 401 -未经授权时尝试-注册- sip客户

但它们并不适用于我的情况或解决方案不能解决我的问题。

我有一个星号1.8框坐在站点A站点A有一个公网静态IP和一个本地类c网络192.168.1。X,星号在NAT后面。部分话机在同一本地网络,部分话机在站点B站点B有另一个公共静态IP和一个本地c类网络 192.168.2.X。所以,B站点的手机也在后面。

奇怪的是,B站点上的一些手机可以注册,而另一些则不能。最有趣的例子是一台grandstream gxp 2100。该话机有3个帐号,配置如下:

[1000]
deny=0.0.0.0/0.0.0.0
secret=xxxxxx
dtmfmode=rfc2833
canreinvite=no
context=from-internal
host=dynamic
trustrpid=yes
sendrpid=no
type=friend
nat=yes
port=5060
qualify=3000
qualifyfreq=60
transport=udp
encryption=no
callgroup=
pickupgroup=
dial=SIP/1000
mailbox=1000@device
permit=0.0.0.0/0.0.0.0
callerid=TONY - Lab Line 1 <1000>
callcounter=yes
faxdetect=no
cc_monitor_policy=generic
[3000]
deny=0.0.0.0/0.0.0.0
secret=xxxxxxx
dtmfmode=rfc2833
canreinvite=no
context=from-internal
host=dynamic
trustrpid=yes
sendrpid=no
type=friend
nat=yes
port=5060
qualify=3000
qualifyfreq=60
transport=udp
encryption=no
callgroup=
pickupgroup=
dial=SIP/3000
mailbox=3000@device

[9000]
deny=0.0.0.0/0.0.0.0
secret=xxxxxxxxxxx
dtmfmode=rfc2833
canreinvite=no
context=from-internal
host=dynamic
trustrpid=yes
sendrpid=no
type=friend
nat=yes
port=5060
qualify=3000
qualifyfreq=60
transport=udp
encryption=no
callgroup=
pickupgroup=
dial=SIP/9000
mailbox=9000@device

只有账号1000和3000可以注册,账号9000出现以下错误:

<--- SIP read from UDP:95.254.61.X:5064 --->
REGISTER sip:95.231.94.6 SIP/2.0
Via: SIP/2.0/UDP 192.168.2.190:5064;branch=z9hG4bK1380984150;rport
From: <sip:9000@95.231.94.6>;tag=1294836145
To: <sip:9000@95.231.94.6>
Call-ID: 844020207-5064-1@BJC.BGI.C.BJA
CSeq: 2672 REGISTER
Contact: <sip:9000@192.168.2.190:5064>;reg-id=3;+sip.instance="<urn:uuid:00000000-0000-1000-8000-000B8251202A>"
X-Grandstream-PBX: true
Max-Forwards: 70
User-Agent: Grandstream GXP2100 1.0.5.23
Supported: path
Expires: 3600
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE, MESSAGE
Content-Length: 0
<------------->
--- (14 headers 0 lines) ---
Sending to 95.254.61.X:5064 (NAT)
<--- Transmitting (NAT) to 95.254.61.X:5064 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.2.190:5064;branch=z9hG4bK1380984150;received=95.254.61.248;rport=5064
From: <sip:9000@95.231.94.6>;tag=1294836145
To: <sip:9000@95.231.94.6>;tag=as54ceb003
Call-ID: 844020207-5064-1@BJC.BGI.C.BJA
CSeq: 2672 REGISTER
Server: FPBX-2.10.1(1.8.21.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="47737672"
Content-Length: 0

<------------>

你认为是什么导致了这个问题?提前感谢您的支持和帮助!

这是星号的正常行为

星号回答为unauthorized with NEW nonce数据包。在客户端用nonce计算md5sum后,再次得到答案。

在你的情况下,客户端很可能因为某些原因(不正确的nat设置,防火墙等)而没有收到数据包

相关内容

  • 没有找到相关文章

最新更新