Problem with SIP and NAT

Hi all,
i have a problem with SIP and NAT. I have an Asterisk server behind a NAT and i would talk with a SIP client ouside server’s NAT.
When i try to call a SIP client from another client (SIP or IAX anyway inside the server’s NAT), the softphone rings but we can’t talk each other in both directions.
I exactly followed what asteriskguru tutorial explains about it. Here it is my configuration in sip.conf:

[general]
context=default
allowoverlap=no
bindport=5060
binaddr=0.0.0.0
srvlookup=yes
externip= [my pubblic ip]
localnet=[subnet ip where the server is in]/[subnet mask]
nat=yes,true,y,t,1,on
qualify=yes

Then, in rtp.conf i set

[general]
rtpstart=5000
rtpend=20000

From the CLI i can see (while ringing):

SIP/601-081fd258 is ringing
Call on SIP/601-081fd258 left from hold
SIP/601-081fd258 answered SIP/602-081f92f0
Packet2Packet bridging SIP/602-081f92f0 and SIP/601-081fd258

And after hangup i can see:

== Spawn extension (macro-stdexten,s,1) exited non-zero on ‘SIP/602-081f92f0’ in macro ‘stdexten’
== Spawn extension (macro-stdexten,s,1) exited non-zero on ‘SIP/602-081f92f0’

set rtp range to be a reasonable number of ports- say 10000-10100
now forward those and udp port 5060 thru your firewall/router

also if client is behind a nat it will need STUN

hope that helps

Also check out this post, it will really help you; forums.digium.com/viewtopic.php? … ight=drwho

@IronHelix: i set the rtp ports range in this way now:
rtpstart=8000
rtpend=31000
but it doesn’t work anyway.