asterisk not connecting to sipgate / NAT related issue?

Home » Asterisk Users » asterisk not connecting to sipgate / NAT related issue?
Asterisk Users No Comments

Hello,

I configured asterisk in sip.conf like that:

=====

register => username:secret@sipgate.de:5060/number

[sipgate-out]
port=5060
type=friend
insecure=invite
nat=yes
username=username
fromuser=username
fromdomain=sipgate.de
secret=secret
host=sipgate.de
qualify=5000
canreinvite=no

=====

But all I get on CLI is:

[Jan 19 15:59:55] NOTICE[1928]: chan_sip.c:12104 sip_reg_timeout: —
Registration for ‘username@sipgate.de’ timed out, trying again (Attempt #1)

My first impression was that there must be a NAT related issue, so I
captured some SIP debug packets and got:

=====

Retransmitting #6 (NAT) to 217.10.79.9:5060:
OPTIONS sip:sipgate.de SIP/2.0
Via: SIP/2.0/UDP 192.168.23.30:5060;branch=z9hG4bK4c5e9a7f;rport
Max-Forwards: 70
From: “asterisk” ;tag=as669e138a
To:
Contact:
Call-ID: 383e3671142f9ec4312d5a263b225629@192.168.23.30
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX 1.6.2.21
Date: Thu, 19 Jan 2012 15:00:55 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Content-Length: 0

=====

As you can see, asterisk writes the local ip address in the VIA header.
Is this the supposed behaviour?

As far as my understanding of the NAT problem goes, this is exactly what
I don’t want to be happening.

I’m familiar with the general NAT problem with layer 7 protocols relying
on ip addresses in the content of a layer 3 packet, but I thought,
asterisk would replace the local ip with the WAN ip.

Even setting “externip=xx.xx.xx.xx” does not change anything.

Anyone can give me advice?

kind regards,
Ruben