Can't register SIP with voipuser.org

I’m running Asterisk 1.4.4 on a Pink Tie Linux release 9 system with kernel 2.4.20-43.

This is behind a NAT router.

I can’t get it to register with voipuser.org.

My sip.conf (stripped down to the bare essentials, and with username and passwords obscured) is:

[general]
context=default
allowoverlap=no
bindport=5060
bindaddr=0.0.0.0
srvlookup=yes

sipdebug=yes
recordhistory=yes
dumphistory=yes

register => user:password@voipuser_sip

externhost=xxx.xxx.org.uk
externrefresh=10
localnet=192.168.0.0/255.255.0.0; All RFC 1918 addresses are local networks

nat=yes

[voipuser_sip]
disallow=all
allow=ulaw
type=peer
context=voipuser_sip
username=user
fromuser=user
secret=password
host=voipuser.org
fromdomain=voipuser.org
insecure=port,invite
qualify=no
nat=yes
canreinvite=no

SIP debug and the -d option when starting asterisk gives me this (again, usernames, passwords, etc obscured)

[Apr 29 19:20:55] NOTICE[27030] chan_sip.c:    -- Re-registration for  user@voipuser_sip
[Apr 29 19:20:55] DEBUG[27030] chan_sip.c: Allocating new SIP dialog for xxx@aaa.bbb.ccc.ddd - REGISTER (No RTP)
[Apr 29 19:20:55] DEBUG[27030] acl.c: ##### Testing 216.127.66.119 with 192.168.0.0
[Apr 29 19:20:55] DEBUG[27030] chan_sip.c: Target address 216.127.66.119 is not local, substituting externip
[Apr 29 19:20:55] DEBUG[27030] chan_sip.c: Scheduled a registration timeout for voipuser_sip id  #27 
[Apr 29 19:20:55] VERBOSE[27030] logger.c: REGISTER 12 headers, 0 lines
[Apr 29 19:20:55] VERBOSE[27030] logger.c: Reliably Transmitting (NAT) to 216.127.66.119:5060:

REGISTER sip:voipuser.org SIP/2.0
Via: SIP/2.0/UDP 192.168.0.2:5060;branch=xxx;rport
From: <sip:user@voipuser.org>;tag=xxx
To: <sip:user@voipuser.org>
Call-ID: 1b7ab529434d5a3b31c32cec74507569@voipuser.org
CSeq: 102 REGISTER
User-Agent: Asterisk PBX
Max-Forwards: 70
Expires: 120
Contact: <sip:s@192.168.0.2>
Event: registration
Content-Length: 0


<------------->
[Apr 29 19:20:56] VERBOSE[27030] logger.c: 
<--- SIP read from 216.127.66.119:5060 --->
SIP/2.0 403 UA behind NAT not accepted here
Via: SIP/2.0/UDP 192.168.0.2:5060;branch=xxx;rport=5060;received=192.168.0.3
From: <sip:user@voipuser.org>;tag=xxx
To: <sip:user@voipuser.org>;tag=xxx.138c
Call-ID: xxx@voipuser.org
CSeq: 102 REGISTER
P-Behind-NAT: source
Server: OpenSER (1.2.0-notls/VoIPUser)
Content-Length: 0


<------------->
[Apr 29 19:20:56] VERBOSE[27030] logger.c: --- (9 headers 0 lines) ---
[Apr 29 19:20:56] DEBUG[27030] chan_sip.c: Stopping retransmission on 'xxx@voipuser.org' of Request 102: Match Not Found
[Apr 29 19:20:56] WARNING[27030] chan_sip.c: Forbidden - wrong password on authentication for REGISTER for 'user' to 'voipuser_sip'
[Apr 29 19:20:56] VERBOSE[27030] logger.c: Really destroying SIP dialog 'xxx@voipuser.org' Method: REGISTER
[Apr 29 19:20:56] DEBUG[27030] chan_sip.c: 
---------- SIP HISTORY for '1b7ab529434d5a3b31c32cec74507569@voipuser.org' 
[Apr 29 19:20:56] DEBUG[27030] chan_sip.c:   * SIP Call
[Apr 29 19:20:56] DEBUG[27030] chan_sip.c:   001. RegistryInit    Account: user@voipuser_sip
[Apr 29 19:20:56] DEBUG[27030] chan_sip.c:   002. TxReqRel        REGISTER / 102 REGISTER - -UNKNOWN-
[Apr 29 19:20:56] DEBUG[27030] chan_sip.c:   003. Rx              SIP/2.0 / 102 REGISTER / 403 UA behind NAT not accepted here
[Apr 29 19:20:56] DEBUG[27030] chan_sip.c: 
---------- END SIP HISTORY for 'xxx@voipuser.org' 

I think the problem is the “Contact: sip:s@192.168.0.2”. I don’t understand why it is 192.168.0.2 (the router is 192.168.0.1, and the asterisk server is 192.168.0.3), but I was expecting it to have the externip address in there.

What am I doing wrong?

I think I’ve had this working at some point in the past, but that was with a very much older version of asterisk (v1-0-09), and a long while ago so things might have changed at either end.

I think your registration string is incorrect.

Try: register=username@voipuser.org:password@sip.voipuser.org

My Asterisk registers using that string. You may also want to strip down some of your global & channel definitions. Not sure what you are doing, but it kinda looks like you are throwing the kitchen sink and all at the problem.

Peter