[asterisk-users] NAT-troubles with RTP

Florian Arthofer f.arthofer at lagis.at
Tue Sep 4 05:30:47 CDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

Because it seems my mail from 30th august didn't make it to the list i
send it again. If the mail _did_ get to the list and i didn't see it
please excuse the duplicate post

Below is the mail from the 30th:

I have a setup like this:
An asterisk-server with SIP-phones on the outside of a NAT.

For example:
asterisk with local IP-address (on the network interface) 1.2.3.4 and
the extern IP-address should be 2.3.4.5 (yes, i'm aware these are no
correct IP-addresses. It's only for describing my setup).
SIP communication works perfekt. The phones are able to register on
asterisk and to place calls on other SIP-phones. But when it comes to
speaking, nothing works.
A little bit of tcpdumping told me that the phones are trying to send
the RTP traffic to 1.2.3.4 instead of 2.3.4.5 because asterisk sends
1.2.3.4 as contact-address in the SIP-header.
I thought i enabled everything necessary but something must be still
missing. Here is my sip.conf (with changed IP-addresses of course):

[general]
port = 5060
bindaddr = 0.0.0.0
context = others
;nat specific stuff below
externip = 2.3.4.5
canreinvite = no
nat = yes
qualify = yes

;qos stuff
tos_sip = cs3
tos_audio = ef

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;template for voip-testing

[testphones](!)
context = voiptest
type = friend
host = dynamic
nat = yes
disallow = all ;disable all codecs except the ones defined below
allow = ulaw
allow = g723.1
allow = g729
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

[2000](testphones)
secret = foobar

[2001](testphones)
secret = foobar

[2002](testphones)
secret = foobar


Any hints on what i did wrong or forgot?
Ah, and asterisk is version 1.2 on a debian etch with kernel 2.6.18

regards
Florian

- --
Florian Arthofer
Technik Web- und Mailservices/Administrator Web- and Mailservices

lagis Internet Serviceprovider GmbH
Wiener Straße 151, 4021 Linz, Austria
Phone +43(0)732/3400-5636
Fax +43(0)732/3400-5644
E-Mail f.arthofer at lagis.at
URL http://www.lagis.at

FN 270805 w des Landesgerichtes Linz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG3TPXNAbU6R7INwcRAlRTAJ9RyzmD8FOL2cLBC9Fp1LSE/BUgmQCaA2xt
YUci7H9wuFGgDPBirAR3FHc=
=xmtz
-----END PGP SIGNATURE-----



More information about the asterisk-users mailing list