SIP behind NAT

I’m new at this but I have done some searching and can’t find the answer I’m looking for.

I installed Asterisk behind a NAT box. I can make a SIP call from a softphone on the local subnet (not NAT’ed) to the Asterisk server and get the hello-world application to run.

However, I can’t get the application to run when I call from outside the NAT. I do have UDP 5060 forwarded. (I also have Asterisk in the DMZ, which should forward all traffic to Asterisk if it’s not handled by other rules.) When I call from outside, Asterisk sees an incoming connection but apparently replies aren’t getting back to the caller. The client reports ‘the server is not replying’ Here’s the debug spew:

[code]
2007-08-24 06:30:27 DEBUG[2220] chan_sip.c: Allocating new SIP dialog for 1187905305-3516-SNORKELWACKER@65.53.72.196 - INVITE (With RTP)
2007-08-24 06:30:27 DEBUG[2220] chan_sip.c: **** Received INVITE (5) - Command in SIP INVITE
2007-08-24 06:30:27 DEBUG[2220] chan_sip.c: * SIP extension value: 1 for call 1187905305-3516-SNORKELWACKER@65.53.72.196
2007-08-24 06:30:27 DEBUG[2220] chan_sip.c: Setting NAT on RTP to 0
2007-08-24 06:30:28 DEBUG[2220] chan_sip.c: = Found Their Call ID: 1187905305-3516-SNORKELWACKER@65.53.72.196 Their Tag 6664 Our tag: as10606b8f
2007-08-24 06:30:28 DEBUG[2220] chan_sip.c: **** Received INVITE (5) - Command in SIP INVITE
2007-08-24 06:30:28 DEBUG[2220] chan_sip.c: Ignoring SIP message because of retransmit (INVITE Seqno 688, ours 688)
2007-08-24 06:30:28 DEBUG[2220] chan_sip.c: = Found Their Call ID: 1187905305-3516-SNORKELWACKER@65.53.72.196 Their Tag 6664 Our tag: as10606b8f
2007-08-24 06:30:28 DEBUG[2220] chan_sip.c: **** Received INVITE (5) - Command in SIP INVITE
2007-08-24 06:30:28 DEBUG[2220] chan_sip.c: Ignoring SIP message because of retransmit (INVITE Seqno 688, ours 688)
2007-08-24 06:30:28 DEBUG[2220] chan_sip.c: ** SIP timers: Rescheduling retransmission 2 to 1000 ms (t1 500 ms (Retrans id #647))
2007-08-24 06:30:29 DEBUG[2220] chan_sip.c: = Found Their Call ID: 1187905305-3516-SNORKELWACKER@65.53.72.196 Their Tag 6664 Our tag: as10606b8f
2007-08-24 06:30:29 DEBUG[2220] chan_sip.c: **** Received INVITE (5) - Command in SIP INVITE
2007-08-24 06:30:29 DEBUG[2220] chan_sip.c: Ignoring SIP message because of retransmit (INVITE Seqno 688, ours 688)
2007-08-24 06:30:29 DEBUG[2220] chan_sip.c: = Found Their Call ID: 1187905305-3516-SNORKELWACKER@65.53.72.196 Their Tag 6664 Our tag: as10606b8f
2007-08-24 06:30:29 DEBUG[2220] chan_sip.c: **** Received INVITE (5) - Command in SIP INVITE
2007-08-24 06:30:29 DEBUG[2220] chan_sip.c: Ignoring SIP message because of retransmit (INVITE Seqno 688, ours 688)
2007-08-24 06:30:29 DEBUG[2220] chan_sip.c: ** SIP timers: Rescheduling retransmission 3 to 2000 ms (t1 500 ms (Retrans id #647))
2007-08-24 06:30:30 DEBUG[2220] chan_sip.c: = Found Their Call ID: 1187905305-3516-SNORKELWACKER@65.53.72.196 Their Tag 6664 Our tag: as10606b8f
2007-08-24 06:30:30 DEBUG[2220] chan_sip.c: **** Received INVITE (5) - Command in SIP INVITE
2007-08-24 06:30:30 DEBUG[2220] chan_sip.c: Ignoring SIP message because of retransmit (INVITE Seqno 688, ours 688)
2007-08-24 06:30:30 DEBUG[2220] chan_sip.c: = Found Their Call ID: 1187905305-3516-SNORKELWACKER@65.53.72.196 Their Tag 6664 Our tag: as10606b8f
2007-08-24 06:30:30 DEBUG[2220] chan_sip.c: **** Received INVITE (5) - Command in SIP INVITE
2007-08-24 06:30:30 DEBUG[2220] chan_sip.c: Ignoring SIP message because of retransmit (INVITE Seqno 688, ours 688)
2007-08-24 06:30:31 DEBUG[2220] chan_sip.c: = Found Their Call ID: 1187905305-3516-SNORKELWACKER@65.53.72.196 Their Tag 6664 Our tag: as10606b8f
2007-08-24 06:30:31 DEBUG[2220] chan_sip.c: **** Received INVITE (5) - Command in SIP INVITE
2007-08-24 06:30:31 DEBUG[2220] chan_sip.c: Ignoring SIP message because of retransmit (INVITE Seqno 688, ours 688)
2007-08-24 06:30:31 DEBUG[2220] chan_sip.c: = Found Their Call ID: 1187905305-3516-SNORKELWACKER@65.53.72.196 Their Tag 6664 Our tag: as10606b8f
2007-08-24 06:30:31 DEBUG[2220] chan_sip.c: **** Received INVITE (5) - Command in SIP INVITE
2007-08-24 06:30:31 DEBUG[2220] chan_sip.c: Ignoring SIP message because of retransmit (INVITE Seqno 688, ours 688)
2007-08-24 06:30:31 DEBUG[2220] chan_sip.c: ** SIP timers: Rescheduling retransmission 4 to 4000 ms (t1 500 ms (Retrans id #647))
2007-08-24 06:30:32 DEBUG[2220] chan_sip.c: = Found Their Call ID: 1187905305-3516-SNORKELWACKER@65.53.72.196 Their Tag 6664 Our tag: as10606b8f
2007-08-24 06:30:32 DEBUG[2220] chan_sip.c: **** Received INVITE (5) - Command in SIP INVITE
2007-08-24 06:30:32 DEBUG[2220] chan_sip.c: Ignoring SIP message because of retransmit (INVITE Seqno 688, ours 688)
2007-08-24 06:30:35 DEBUG[2220] chan_sip.c: ** SIP timers: Rescheduling retransmission 5 to 4000 ms (t1 500 ms (Retrans id #647))
2007-08-24 06:30:39 DEBUG[2220] chan_sip.c: ** SIP timers: Rescheduling retransmission 6 to 4000 ms (t1 500 ms (Retrans id #647))
2007-08-24 06:30:42 DEBUG[2220] chan_sip.c: Auto destroying call ‘1187905305-3516-SNORKELWACKER@65.53.72.196’

Here’s my sip.conf:

[general]
context=incoming
srvlookup=yes
allowguest=yes
nat=yes
localnet=192.168.0.0/255.255.255.0
externip=x.x.x.x

[someuser]
type=friend
secret=xxxx
qualify=no
nat=no
host=dynamic
canreinvite=no
context=internal