Asterisk With NAT

We currently have an Asterisk server behind a firewall. We are trying to register to a public ip for our SIP trunk connection. We are able to make outbound calls but cannot receive inbound calls. We believe what is happening is that somewhere along the way we are sending our internal 192.168.XXX.XXX to the public provider who is in turn trying to send the incoming calls to this address. This results in a fast busy signal for inbound calls. Please let me know if there are any parts which need further clarification on this issue. Thanks again guys!

The use of sip set debug on will tell you for certain if and where you are sending the local address.

How are externip, externhost, localnet and stunaddr set?

Thank you David as usual you are quick on response :smile: We will collect the information and strip out our companies “magic sauce” and get a pastebin ready.

SIP DEBUG: (
<— SIP read from UDP:74.54.54.178:5060 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.169.112:5060;branch=z9hG4bK40bc5bfe;received=192.168.169.112
From: “6012” sip:124477_ams@192.168.169.112;tag=as12e49c8f
To: sip:“myphonenumber”@voipms@dallas.voip.ms
Call-ID: 47c35d01568a49d2653005750a2638af@192.168.169.112:5060
CSeq: 103 INVITE
User-Agent: VoIPMS SERAST
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces
Contact: sip:“myphonenumber”@74.54.54.178
Content-Length: 0

<------------->
— (11 headers 0 lines) — )

The additional config information was commented in the sip.conf so I’m thinking Asterisk will not use these or assume some default value.

ExternIP:
Not Defined

ExternHost:
Not Defined

Localnet:
Not Defined

Stunaddr:
Not Defined

You are sending a local address. You need at least one of externip, externhost and stunaddr, and you may need localnet.

Thank you david you’re the best we finally got this working using an externip + a localnet all of the other networks which were internal to our company and it’s working like a charm. I just wanted to mention one thing to anyone reading this that you can specify as many localnet address ranges as you need to Asterisk will use them all! Thanks guys!