我已经设置了一个简单的 Ubuntu 14.04,只安装了 Asterisk(apt-get update && apt-get upgrade && apt-get install asterisk)。
当我尝试从我的客户端(OS X 的电话)登录时,我在服务器上收到以下信息:
[Dec 16 14:39:32] NOTICE[1415]: chan_sip.c:28104 handle_request_register: Registration from '"100" <sip:[email protected]>' failed for '10.0.83.202:51966' - Wrong password
这是启用调试的情况 (sip set debug on):
ubuntu*CLI> sip set debug on
SIP Debugging enabled
<--- SIP read from UDP:10.0.83.202:51966 --->
REGISTER sip:10.0.83.14 SIP/2.0
Via: SIP/2.0/UDP 10.0.83.202:51966;rport;branch=z9hG4bKPjBI0jx0tvcvCCI8OdXBS23CsjJZIZ44RY
Max-Forwards: 70
From: "100" <sip:[email protected]>;tag=plvX4lQlJaBENJG7pPpRFmUh.iTUjbEt
To: "100" <sip:[email protected]>
Call-ID: 8sl0kRj5umaTXWoaxmnoRelE-6OCi2sP
CSeq: 62639 REGISTER
User-Agent: Telephone 1.1.4
Contact: "100" <sip:[email protected]:51966;ob>
Expires: 300
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Content-Length: 0
<------------->
--- (12 headers 0 lines) ---
Sending to 10.0.83.202:51966 (no NAT)
Sending to 10.0.83.202:51966 (no NAT)
<--- Transmitting (no NAT) to 10.0.83.202:51966 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 10.0.83.202:51966;branch=z9hG4bKPjBI0jx0tvcvCCI8OdXBS23CsjJZIZ44RY;received=10.0.83.202;rport=51966
From: "100" <sip:[email protected]>;tag=plvX4lQlJaBENJG7pPpRFmUh.iTUjbEt
To: "100" <sip:[email protected]>;tag=as0d554a0f
Call-ID: 8sl0kRj5umaTXWoaxmnoRelE-6OCi2sP
CSeq: 62639 REGISTER
Server: Asterisk PBX 11.15.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="48750583"
Content-Length: 0
<------------>
Scheduling destruction of SIP dialog '8sl0kRj5umaTXWoaxmnoRelE-6OCi2sP' in 32000 ms (Method: REGISTER)
<--- SIP read from UDP:10.0.83.202:51966 --->
REGISTER sip:10.0.83.14 SIP/2.0
Via: SIP/2.0/UDP 10.0.83.202:51966;rport;branch=z9hG4bKPjWqjrVV68nMtX5cETs0hqsgp2t7uoyDOk
Max-Forwards: 70
From: "100" <sip:[email protected]>;tag=plvX4lQlJaBENJG7pPpRFmUh.iTUjbEt
To: "100" <sip:[email protected]>
Call-ID: 8sl0kRj5umaTXWoaxmnoRelE-6OCi2sP
CSeq: 62640 REGISTER
User-Agent: Telephone 1.1.4
Contact: "100" <sip:[email protected]:51966;ob>
Expires: 300
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Authorization: Digest username="100", realm="asterisk", nonce="48750583", uri="sip:10.0.83.14", response="14db540cd5f6dc5da883947cb9cac334", algorithm=MD5
Content-Length: 0
<------------->
--- (13 headers 0 lines) ---
Sending to 10.0.83.202:51966 (no NAT)
<--- Transmitting (no NAT) to 10.0.83.202:51966 --->
SIP/2.0 403 Forbidden
Via: SIP/2.0/UDP 10.0.83.202:51966;branch=z9hG4bKPjWqjrVV68nMtX5cETs0hqsgp2t7uoyDOk;received=10.0.83.202;rport=51966
From: "100" <sip:[email protected]>;tag=plvX4lQlJaBENJG7pPpRFmUh.iTUjbEt
To: "100" <sip:[email protected]>;tag=as0d554a0f
Call-ID: 8sl0kRj5umaTXWoaxmnoRelE-6OCi2sP
CSeq: 62640 REGISTER
Server: Asterisk PBX 11.15.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0
<------------>
[Dec 16 14:42:42] NOTICE[1415]: chan_sip.c:28104 handle_request_register: Registration from '"100" <sip:[email protected]>' failed for '10.0.83.202:51966' - Wrong password
Scheduling destruction of SIP dialog '8sl0kRj5umaTXWoaxmnoRelE-6OCi2sP' in 32000 ms (Method: REGISTER)
我的客户端是 10.0.83.202,我的服务器是 10.0.83.14,都在本地网络上。我目前不打算使用外部网络的 SIP 服务器。
我已经重新安装了 Asterisk 三次,但没有任何改善。密码总是错误,而我确信我输入的是正确的。
deadlock@ubuntu:~$ cat /etc/asterisk/sip.conf
[general]
udpbindaddr=10.0.83.14 ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
transport=udp ; Set the default transports. The order determines the primary default transport.
localnet=10.0.83.0/24
domain=10.0.83.14 ; Add IP address as local domain
externip=10.0.83.14
[100]
type=friend
host=dynamic
secret=MyPass123
context=internal
mailbox=100@default
callgroup=1
pickupgroup=1
dtmfmode=rfc2833
canreinvite=no
[200]
type=friend
host=dynamic
secret=MyPass123
context=internal
callgroup=1
pickupgroup=1
dtmfmode=rfc2833
canreinvite=no
deadlock@ubuntu:~$ cat /etc/asterisk/extensions.conf
[internal]
; Calls between employees (between extensions)
exten => _XXX,1,Dial(SIP/${EXTEN})
exten => 100,1,Dial(SIP/100,20)
exten => 100,n,VoiceMail(100,u)
exten => 100,n,Hangup
exten => 200,1,Dial(SIP/100,20)
exten => 200,n,Hangup
我做错了什么?这是一个错误吗?