• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 490
  • Last Modified:

2 Network cards in asterisk server issue

Hi,

have on Asterisk 1.8.6.0 with Centos 6. Phone system was working fine. But we needed to add in another network card and link to our other network so that we can use softphones as well. Asterisk system network was changed to 192.168.2.210.

We added another network card with ip address of 192.168.1.210.

Softphones can register to 192.168.1.210 ok and also handsets can register to 192.168.2.210 ok.

The issue we have it that it takes 30 seconds plus sometimes to connect calls to extensions even those on the same network. Also when we try to hang up a call from the softphone it doesn't always allow it.

in sip_custom_conf we have added in the other network os it shows:


localnet = 192.168.2.0/255.255.255.0;
localnet = 192.168.1.0/255.255.255.0;
nat=yes

We think that the system doesnt know where to route calls so trys to find the correct routes which is making it take ages to call. Also affecting when we hang up from.....

Thanks
0
andybrooke
Asked:
andybrooke
  • 8
  • 8
1 Solution
 
Ron MalmsteadInformation Services ManagerCommented:
If it's on the same network why are you specifying it to use NAT ?

Try this...

localnet=192.168.0.0/255.255.0.0
nat = never
0
 
andybrookeAuthor Commented:
I thought nat needs to be yes if your firewall to the internet has a nat? So its enabled so we can make external calls?
0
 
Ron MalmsteadInformation Services ManagerCommented:
Remember you have a global setting...then you have granular setting per sip user/trunk... in sip.conf

So if you have    nat=yes   as a global parameter, then it will apply to any SIP account definition where you haven't specified it....

You can leave that nat=yes in globals...but under your sip client definitions you should have nat=never if they are on the same network.

Asterisk "should be" smart enough to know the difference but behaviours and logic sometimes changes from version to version with * o-source.

Nat should apply to any connection that has to come accross the internet then hit your router then Nat translation to get to Asterisk.  Internally it is not necessary.

Can you post your Sip.conf file excluding/changing any sensitive info?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Ron MalmsteadInformation Services ManagerCommented:
Are you dialing out of a SIP trunk?
0
 
andybrookeAuthor Commented:
here it is...
;--------------------------------------------------------------------------------;
; 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: http://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 (C) 2004 Coalescent Systems Inc (Canada)
; Copyright (C) 2006 Why Pay More 4 Less Pty Ltd (Australia)
; Copyright (C) 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

Open in new window

0
 
andybrookeAuthor Commented:
we have a sip trunk but I'm simply dialling the extensions eg 1001 to 1002. etc....
0
 
Ron MalmsteadInformation Services ManagerCommented:
Sorry, didn't realize you were on FreePbx

Please post...sip_general_custom.conf
0
 
andybrookeAuthor Commented:
here it is....
externip = 88.14.21.81;

localnet = 192.168.2.0/255.255.255.0;

localnet = 192.168.1.0/255.255.255.0;

nat=yes

Open in new window

0
 
Ron MalmsteadInformation Services ManagerCommented:
I can't see adding a network card as being the root cause of your problem.
I have * systems with 4 network cards and don't have this issue.

There must be some sort of config that was changed, other than the network card, that is causing this.

You're not seeing any errors on the CLI ?
....strange issue for sure.
0
 
Ron MalmsteadInformation Services ManagerCommented:
I don't think you can specify localnet twice.

localnet = 192.168.2.0/255.255.255.0;

localnet = 192.168.1.0/255.255.255.0;

...should be

localnet = 192.168.0.0/255.255.0.0;

Can you test this simple change ?

Also..do you have .. canreinvite=yes/no   on your sip peers?
0
 
andybrookeAuthor Commented:
no errors...

but when we make a call the cli shows no data while the call is connecting which can tak 30 seconds once it does the cli fills with data.

If you then call the extension again there maybe no delay.

Try it again and there may be a delay.....
0
 
andybrookeAuthor Commented:
online it shows u can but i will change. for example if u had a 10.. network u would need 2 localnet.

canreinvite = no on extensions

although system has been working fine without.....
0
 
Ron MalmsteadInformation Services ManagerCommented:
I'm not positive you can't use it twice...  i've just never seen it or done it that way myself.

What about    ...    qualify = yes    ??

http://www.voip-info.org/wiki/view/Asterisk+sip+qualify
If you turn on qualify in the configuration of a SIP device in sip.conf, Asterisk will send a SIP OPTIONS command regularly to check that the device is still online. If the device does not answer within the configured (or default) period (in ms) Asterisk considers the device off-line for future calls. This status can be checked by the SIPPEER function, and inversely this function will only provide status information for peers which have qualify=yes.

0
 
andybrookeAuthor Commented:
tried canreinvite = yes still same.

I deceided to strip this all back reset my test router as well. with 1 network card active all works fine. As soon as the other network card is active i get the routing issues. Now that I have disabled the other network card I still get issues even after restarting all equipment...
0
 
Ron MalmsteadInformation Services ManagerCommented:
That is really strange.

Please check...
/var/log/asterisk/messages

Any errors there?
0
 
andybrookeAuthor Commented:
no errors in there messages deosnt even exist only freepbx.log
0
 
feptiasCommented:
Can you login on the Linux console and type the following commands, then post back the output:
1. netstat -lunp
2. route

The first to show which interfaces Asterisk is binding to. (Can be explicitly specified using the bindaddr parameter in sip_general_custom.conf - see http://www.voip-info.org/wiki/view/Asterisk+config+sip.conf)

The second to show the routing table within Linux.

Can you capture the SIP packets for a call that takes 30 secs to connect?
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 8
  • 8
Tackle projects and never again get stuck behind a technical roadblock.
Join Now