NAT / no NAT issue

Hi,

I’ve got a working asterisk configuration for a Grandstream HT503. At least, it works at home. At work it fails with, "Got SIP response 503 “Service Unavailable” back from "

Looking at the SIP debugs, the thing that stands out is:

Home:
Sending to (no NAT)
Transmitting (no NAT) to

Work:
Sending to (NAT)
Reliably Transmitting (NAT) to

But there shouldn’t be any NAT at work either.

What’s making this decision to use NAT?

Hope someone can help,
Tobin

What is your local network at your home, what ip the 503 and the asterisk have?
What is your local network at your office, what ip the 503 and the asterisk have?

Also the network in your office is setup by you or a sysadmin?

What is your local network at your home, what ip the 503 and the asterisk have?
255.255.255.0, 192.168.0.106, 92.168.0.105

What is your local network at your office, what ip the 503 and the asterisk have?
255.255.252.0, 192.168.1.189, 192.168.1.120

Also the network in your office is setup by you or a sysadmin?
Mainly by me.

What is it that is displaying NAT / no NAT? Is it how the asterisk server sees the network or how the HT503 sees the network?

Thanks,
Tobin

The office isn’t listed as a localnet.

So if I add the below to sip.conf, it’ll stop trying to NAT?

[general]
localnet=192.168.0.0/255.255.252.0

Thank-you,
Tobin

Finally got back into the office to test this and I still can’t get an outgoing call from the office.

Here’s the sip debug log:
pastebin.com/tymBw61z

Thoughts, anyone?

Thanks,
Tobin

The private IP is still the only advertised on your SDP.

Beside the localnet option, there are still a few parameters you need to tweak.

For example :

     nat = force_rport,comedia
     externaddr = 12.34.56.7 ;replace it with your public IP

    externhost=foo.dyndns.net       ; refreshed periodically
    externrefresh=180               ; change the refresh

Check the section called NAT Support on the sip.conf sample configuration.

svn.digium.com/svn/asterisk/trun … onf.sample

Thanks for that but I’m not doing anything externally. The soft-phone, SIP device and asterisk server are all on the same network.

Does asterisk need to know the external network?

If is internally you don’t need to specify the external address, rtp set debug on command would help to see the rtp media stream

Please find sip and rtp debug log at: pastebin.com/K7hJ6U6A

Your original problem’s description make reference to a 503 sip response, There is no such response on your sip trace. Beside that I see successfully established and media between

Got RTP packet from 192.168.1.120:5012 (type 00, seq 012433, ts 1663777460, len 000160)
Sent RTP packet to 192.168.1.47:7078 (type 00, seq 017204, ts 1663777456, len 000160)

Hmmm, the localnet option seems to have sorted the error out but there’s still no call being placed.

So that looks like a normal successful call to you? Any suggestions on how to debug further?

So irritating that it works from home. There must be another network difference somewhere.

Question For your!

Are you physically relocating the Asterisk System from Home to the Office and assigning a IP address to the asterisk system that is in the OFFICE Subnet 192.168.0.0/24? Or is it set to a static IP based on your Home Network Subnet 192.168.1.0/24?

As well if your IP address are correct for the network they are on make sure you are not binding asterisk to the wrong IP

ex: bindaddr=192.168.0.10
as well check your
localnet=
too make sure that it is on the correct network

I hope this helps

Apologies for the slow reply - I completely missed it.

I am physically relocating my asterisk system - it’s just a VM atm.

In both environments, the VM gets a reserved address from a DHCP server.

I don’t think it can be binding to the wrong address as we can see communication between the asterisk server and the HT503 in the sip log.

As was pointed out earlier, the original problem was effectively solved, so I’m trying to put together a new question - please don’t let that stop you posting any further thoughts here though.