Solved

2 Network cards in asterisk server issue

Posted on 2011-09-14
17
470 Views
Last Modified: 2013-11-12
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
Comment
Question by:andybrooke
  • 8
  • 8
17 Comments
 
LVL 25

Expert Comment

by:Ron M
ID: 36538388
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
 

Author Comment

by:andybrooke
ID: 36539128
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
 
LVL 25

Expert Comment

by:Ron M
ID: 36539165
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
 
LVL 25

Expert Comment

by:Ron M
ID: 36539187
Are you dialing out of a SIP trunk?
0
 

Author Comment

by:andybrooke
ID: 36539204
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
 

Author Comment

by:andybrooke
ID: 36539213
we have a sip trunk but I'm simply dialling the extensions eg 1001 to 1002. etc....
0
 
LVL 25

Expert Comment

by:Ron M
ID: 36539255
Sorry, didn't realize you were on FreePbx

Please post...sip_general_custom.conf
0
 

Author Comment

by:andybrooke
ID: 36539270
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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 25

Expert Comment

by:Ron M
ID: 36539272
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
 
LVL 25

Accepted Solution

by:
Ron M earned 500 total points
ID: 36539290
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
 

Author Comment

by:andybrooke
ID: 36539295
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
 

Author Comment

by:andybrooke
ID: 36539352
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
 
LVL 25

Expert Comment

by:Ron M
ID: 36539684
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
 

Author Comment

by:andybrooke
ID: 36542795
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
 
LVL 25

Expert Comment

by:Ron M
ID: 36543270
That is really strange.

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

Any errors there?
0
 

Author Comment

by:andybrooke
ID: 36550179
no errors in there messages deosnt even exist only freepbx.log
0
 
LVL 19

Expert Comment

by:feptias
ID: 36557107
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever wanted to query Cisco Call Manager CDR records from MS SQL Server? Here's how! CUCM can be configured to upload a CDR file to a given FTP server every minute. This article will show you how to set this up, schedule the import of this data an…
There are no good configuration guides for HP-H3C router to LYNC on the web. :( Big statement, but we havent been able to find one yet. We did find the following document useful, but the information was not enough to use H3C router for use as a L…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
A simple description of email encryption using a secure portal service. This is one of the choices offered by The Email Laundry for email encryption. The other choices are pdf encryption which creates an encrypted pdf of your email and any attachmen…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now