[asterisk-users] SIP Re-Invite behind a NAT

hugolivude
Thu, 08 Feb 2007 19:12:23 -0000

SetUp:
- Asterisk behind a NAT,
- Red Hat 9.0
- Asterisk 1.2.14

My Asterisk box is behind a NAT and I have a DiD from an ITSP.  I have
my dial plan set up so that when outside callers  dial the DiD, the
call is answered by my auto-attendant.  The caller can then select who
they'd like to speak to and the call is transferred to the  external
line associated with that person (usually a mobile phone) using a
Dial() command.

Because both parties are external, I don't want the media to pass
through my Asterisk box once the two parties connect. This is the
default behaviour for the Dial command if you avoid the tT options and
the codec is supported all the way through - this is true in my case.

I have this working great with IAX - I can even disconnect the
Ethernet cable from my Asterisk box once the call is established and
the call is not affected.  Unfortunately I cannot get it to work with
SIP and my ITSP is dropping support for IAX.

Can you help me?

I've attached the relevant bits from sip.conf.  I have canreinvite=yes
and I've tried with nat=yes and nat=no, but no luck either way - the
call goes through in each case but the media is passing through my
Asterisk box and i'd like to avoid that.

Anxiously awaiting a reply.

Thanks,
H


register => me: xxxx@my1.itsp.com:5060
register => me: xxxx@my2.itsp.com:5060


; This section is because i'm behind nat
;
externip=999.999.999.999 ;Outside address
localnet= 192.168.0.148/255.255.255.0 ;Inside Network
;
;===========================================================;
[voip-ITSP1]
context=incoming-sip
type=friend
host= my1.itsp.com
username=me
secret=xxxxxxx
nat=no
canreinvite=yes
insecure=port,invite ; do NOT remove this
qualify=yes ; do NOT remove this
dtmfmode=rfc2833 ; should match what is set on your account
disallow=all
allow=ulaw ; set in/out codec here
;
[voip-ITSP2]
context=incoming-sip
type=friend
host= my2.itsp.com
username=me
secret=xxxxxxx
nat=no
canreinvite=yes
insecure=port,invite ; do NOT remove this
qualify=yes ; do NOT remove this
dtmfmode=rfc2833 ; should match what is set on your account
disallow=all
allow=ulaw ; set in/out codec here