Asterisk problem when server sit behind firewall


#1

I had setup a Asterisk (Ver. 1.6.2.20) server sit behind firewall using 10.0.x.x network and havind public ip 211.x.x.x and FreePBX 2.9.0.7. At first we can make internal call within the same network but remote call like when we test at home, the sip phone or x-lite softphone ringing but no audio sound. Sometimes when sip info show “ok” but leave it for a while it turn to “unreachable”. So can anyone help to give some advices how the correct way to setup the asterisk server so that internal and external call also can work normally. We had test many way to figure it out but still failed and you help is much appreciate. Thank you


#2

1.6.x.x shouldn’t be used for new installs.

There is insufficient information to debug your problem. You need to provide your sip.conf and some information about the NAT device and the firewall rules.

If you can possibly borrow a real SIP phone, test with that. X-Lite has some subtle limitations.


#3

Here is the sip.conf configuration as showed below hope that you can help me to solve my problem.

;--------------------------------------------------------------------------------;

; Do NOT edit this file as it is auto-generated by FreePBX. All modifications to ;

; this file must be done via the web gui. There are alternative files to make ;

; custom modifications, details at: freepbx.org/configuration_files ;

;--------------------------------------------------------------------------------;

;

; This file is part of FreePBX.

;

; FreePBX is free software: you can redistribute it and/or modify

; it under the terms of the GNU General Public License as published by

; the Free Software Foundation, either version 2 of the License, or
; (at your option) any later version.

;

; FreePBX is distributed in the hope that it will be useful,

; but WITHOUT ANY WARRANTY; without even the implied warranty of

; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

; GNU General Public License for more details.

;

; You should have received a copy of the GNU General Public License

; along with FreePBX. If not, see http://www.gnu.org/licenses/.

;

; Copyright © 2004 Coalescent Systems Inc (Canada)

; Copyright © 2006 Why Pay More 4 Less Pty Ltd (Australia)

; Copyright © 2007 Astrogen LLC (USA)

[general]

; These files will all be included in the [general] context

;
#include sip_general_additional.conf

;sip_general_custom.conf is the proper file location for placing any sip general

;options that you might need set. For example: enable and force the sip jitterbuffer.

;If these settings are desired they should be set the sip_general_custom.conf file.

;

; jbenable=yes

; jbforce=yes

;

;It is also the proper place to add the lines needed for sip nat’ing when going

;through a firewall. For nat’ing you’d need to add the following lines:

; nat=yes , externip= , localhost= , and optionally fromdomain= .

;
#include sip_general_custom.conf

;sip_nat.conf is here for legacy support reasons and for those that upgrade

;from previous versions. If you have this file with lines in it please make
;sure they are not duplicated in sip_general_custom.conf, if so remove them

;from sip_nat.conf as sip_general_custom.conf will have precedence.
#include sip_nat.conf

;sip_registrations_custom.conf is for any customizations you might need to do to

;the automatically generated registrations that FreePBX makes.

;
#include sip_registrations_custom.conf
#include sip_registrations.conf

; These files should all be expected to come after the [general] context

;
#include sip_custom.conf
#include sip_additional.conf

;sip_custom_post.conf If you have extra parameters that are needed for a

;extension to work to for example, those go here. So you have extension

;1000 defined in your system you start by creating a line 1000 in this

;file. Then on the next line add the extra parameter that is needed.

;When the sip.conf is loaded it will append your additions to the end of

;that extension.

;
#include sip_custom_post.conf


#4

May this help jimmyysk

here is the link
http://www.voip-info.org/wiki/view/Asterisk+SIP+NAT+solutions

Regards
Ibrahim


#5

You only provided part of your sip.conf. Everything #included is also part of it. However, I would look at the wiki article first, as trying to debug GUI generated configurations can be a pain.

Also you didn’t provide your router configuration.