401 Unauthorized when trying to register a SIP phone

3 posts / 0 new
Last post
rackm0unt
rackm0unt's picture
401 Unauthorized when trying to register a SIP phone

I'm trying to register an Avaya 9630 IP phone with my Asterisk box. Asterisk is replying to the phone's REGISTER request with a 401 Unauthorized message. I had successfully registered this phone, using the same phone configuration, with a previous install of Asterisk (AsteriskNOW 1.6 with FreePBX 2.5, upgraded to 2.6, 2.7, and finally to 2.8 using the Module Admin GUI) but decided to install a newer version of AsteriskNOW to see if it would resolve a problem with my Digium TDM800P (and it did).

I have included what I think is the pertinent information below. Please let me know if there is anything else I should include.

CentOS (not sure what version; `uname -a` gives kernel version 2.6.18-194.3.1.el5)
FreePBX 2.8.0.2
Asterisk 1.6.2.7

Version numbers of currently enabled modules:
Core 2.8.0.2
DAHDi Config 2.7.0
Feature Code Admin 2.8.0.0
FreePBX Framework 2.8.0.2
System Dashboard 2.8.0.3
Voicemail 2.8.0.0
Info Services 2.8.0.0
Music on Hold 2.8.0.2
Recordings 3.3.10.0
Custom Applications 2.8.0.0

Installation/configuration performed:
- booted from AsteriskNOW 64-bit version 1.7 ISO image downloaded from www.asterisk.org
- chose the "install with Asterisk 1.6 and FreePBX" option
- applied configuration changes
- updated all installed modules which had available online updates, using Module Admin
- applied configuration changes and rebooted
- installed 2.8 upgrade tool, upgraded to 2.8, applied configuration changes
- rebooted
- added SIP extension (6000) through GUI

SIP extension config from /etc/sip_additional.conf:
[6000]
deny=0.0.0.0/0.0.0.0
secret=secret01
dtmfmode=rfc2833
canreinvite=no
context=from-internal
host=dynamic
type=friend
nat=yes
port=5060
qualify=yes
callgroup=
pickupgroup=
dial=SIP/6000
accountcode=
mailbox=6000@default
permit=0.0.0.0/0.0.0.0
callerid=device <6000>
call-limit=50
faxdetect=no

Asterisk server is 192.168.2.10
Avaya 9630 IP phone is 192.168.2.11

SIP debug trace:

<------------>
Scheduling destruction of SIP dialog '1_84bbd688aeeb13875a47e_R@192.168.2.11' in 32000 ms (Method: REGISTER)
localhost*CLI>
<--- SIP read from UDP:192.168.2.11:1032 --->
REGISTER sip:192.168.2.10 SIP/2.0
From: sip:6000@192.168.2.10;tag=-53c37645386d58bc3875b4fc_F192.168.2.11
To: sip:6000@192.168.2.10
Call-ID:

CSeq: 1 REGISTER
Via: SIP/2.0/UDP 192.168.2.11;branch=z9hG4bK1_84bbe1ceb34653875a786_R
Content-Length: 0
Max-Forwards: 70
Contact: ;q=1;expires=900;reg-id=1;+sip.instance=""
Allow: INVITE,CANCEL,BYE,ACK,SUBSCRIBE,NOTIFY,INFO,REFER,UPDATE
User-Agent: Avaya one-X Deskphone
Supported: replaces

<------------->
--- (12 headers 0 lines) ---
Sending to 192.168.2.11 : 1032 (NAT)

<--- Transmitting (NAT) to 192.168.2.11:1032 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.2.11;branch=z9hG4bK1_84bbe1ceb34653875a786_R;received=192.168.2.11
From: sip:6000@192.168.2.10;tag=-53c37645386d58bc3875b4fc_F192.168.2.11
To: sip:6000@192.168.2.10;tag=as12704235
Call-ID:

CSeq: 1 REGISTER
Server: Asterisk PBX 1.6.2.7
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="34dd9dfd"
Content-Length: 0

<------------>
Scheduling destruction of SIP dialog '1_84bbd688aeeb13875a47e_R@192.168.2.11' in 32000 ms (Method: REGISTER)
localhost*CLI>
<--- SIP read from UDP:192.168.2.11:1032 --->
REGISTER sip:192.168.2.10 SIP/2.0
From: sip:6000@192.168.2.10;tag=-53c37645386d58bc3875b4fc_F192.168.2.11
To: sip:6000@192.168.2.10
Call-ID:

CSeq: 1 REGISTER
Via: SIP/2.0/UDP 192.168.2.11;branch=z9hG4bK1_84bbe1ceb34653875a786_R
Content-Length: 0
Max-Forwards: 70
Contact: ;q=1;expires=900;reg-id=1;+sip.instance=""
Allow: INVITE,CANCEL,BYE,ACK,SUBSCRIBE,NOTIFY,INFO,REFER,UPDATE
User-Agent: Avaya one-X Deskphone
Supported: replaces

<------------->
--- (12 headers 0 lines) ---
Sending to 192.168.2.11 : 1032 (NAT)
localhost*CLI>
<--- Transmitting (NAT) to 192.168.2.11:1032 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.2.11;branch=z9hG4bK1_84bbe1ceb34653875a786_R;received=192.168.2.11
From: sip:6000@192.168.2.10;tag=-53c37645386d58bc3875b4fc_F192.168.2.11
To: sip:6000@192.168.2.10;tag=as12704235
Call-ID:

CSeq: 1 REGISTER
Server: Asterisk PBX 1.6.2.7
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="34dd9dfd"
Content-Length: 0

It goes on like this until I cancel the login attempt on the phone. As I mentioned at the beginning of the message, I successfully registered this phone with a previous Asterisk install, so I don't think the problem is with the phone's configuration. I appreciate any help that can be provided in getting this to work.

Thanks!
Brian

rackm0unt
rackm0unt's picture
Found a fix

I tried setting 'nat' to 'no' and that appears to have fixed the problem.

roar1989
roar1989's picture
why not try resgistring users from freepbx?

using freepbx GUI, extensions can be automatically registered.
goto Extensions->Add extension->generic sip device
write extension number and give secret number, there are other options for other uses
submit it and apply configuration changes by clicking on the red bar that appears on top after you hit submit button.

Your extension will automatically be registered.