Solved

2 Network cards in asterisk server issue

Posted on 2011-09-14
17
463 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Are you dialing out of a SIP trunk?
0
 

Author Comment

by:andybrooke
Comment Utility
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
Comment Utility
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
Comment Utility
Sorry, didn't realize you were on FreePbx

Please post...sip_general_custom.conf
0
 

Author Comment

by:andybrooke
Comment Utility
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 25

Expert Comment

by:Ron M
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
That is really strange.

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

Any errors there?
0
 

Author Comment

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

Expert Comment

by:feptias
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

So you think no one can listen in on your VOIP conversations, eh? Well... if you haven't setup Secure Real Time Transport (SRTP), your voice communications can be hacked into by just about anyone! First, let's talk about the intended audience for…
I recently purchased a Bluetooth headset called the Music Jogger (model BSH10). The control buttons on it look like this: One of my goals is to use it as the microphone and speakers for Skype calls. In that respect, it works well. However, I …
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

743 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

17 Experts available now in Live!

Get 1:1 Help Now