Solved

Putting 2nd asterisk server on same LAN

Posted on 2009-06-30
24
580 Views
Last Modified: 2013-11-12
I am going to be putting a second asterisk server on my LAN.  I will obviously be setting it to listen on an alternate port than the primary asterisk server, such as port 5062.

My question is, how to set the Linksys SPA942 phones, across the WAN, to look for the asterisk server at an alternate port than 5060?  There is an EXT SIP Port setting, in the phones, but not sure if that is it.  

Thanks!
0
Comment
Question by:jkockler
  • 11
  • 8
  • 4
  • +1
24 Comments
 
LVL 25

Expert Comment

by:Ron M
ID: 24751581
Why do you need it to listen on a different port ?

There's no reason you can't have both Asterisk servers on the same lan, using standard ports.... as long as they are on seperate IP addresses.
0
 
LVL 32

Expert Comment

by:Kamran Arshad
ID: 24752602
Hi,

As the above comment mentioned, you need only to have a different IP address for the 2nd asterisk server. No need to change the SIP port.
0
 
LVL 4

Author Comment

by:jkockler
ID: 24753766
Well for two reasons.

1.)  I can only forward 5060 to one LAN  ip address, in the firewall.  Plus, keeping each sip device on it's own port, usually works best for me.

2.) I am building the server, as a backup server.  While testing it, the same users are going to be listed in sip.conf.  I do not want the phones to start using the new server during testing, and having the server listening on 5060, would cause this to happen.  
0
 
LVL 3

Accepted Solution

by:
shaf81 earned 500 total points
ID: 24753842
When configuring the Linksys, to specify a separate port other than 5060, you'll have to mention the port along with the sip server address. For instance, if you new asterisk is asterisk2.mydomain.com listening on 5062, then you would enter the proxy address on your Linksys as-

asterisk2.mydomain.com:5062

If users are registering from the Wan and you have to do port forwarding on the router/firewall, you can forward port 5062 to the asterisk IP:5062, users will register to sip_server:5062 or sip_server_ip:5062.

Hope this helps.
0
 
LVL 4

Author Closing Comment

by:jkockler
ID: 31598550
Thanks!!
0
 
LVL 25

Expert Comment

by:Ron M
ID: 24755311
Simply listing users in sip.conf or the server listening on 5060 on a second server, will not reconfigure the phones.

Also, if you are NAT 'ing on your firewall/router, i'm not sure how you will get away with using two asterisk boxes concurrently over a wan....from a single external IP.  You must be forwarding other ports as well...(UDP 10001 - 20000).

confirm ?

I know the question is closed already, but I wanted to give you the info anyway.
0
 
LVL 4

Author Comment

by:jkockler
ID: 24755568
xuserx2000,  that is a good point on the rtp ports.  Since this is only a backup server, that I am going to test for functionality, and then take offline, it should not be an issue.  I guess when I do need an alternate asterisk server because of load issues on the primary, it will have to be at a different WAN IP, with it's own firewall.  Kind of a bummer, but what can you do if you want NAT control of the network.?

As for your point, "Simply listing users in sip.conf or the server listening on 5060 on a second server, will not reconfigure the phones."
- I would think that 2 asterisk servers, with the same users in sip.conf, listening on the same port, would "fight" for the registrations of the phones.  No?
0
 
LVL 25

Expert Comment

by:Ron M
ID: 24755618
"I would think that 2 asterisk servers, with the same users in sip.conf, listening on the same port, would "fight" for the registrations of the phones.  No? "

No...  the phones need to be configured to use the new asterisk server.... even if their configuration is handed down by a tftp server, they still need to be "pointed" to it.

The Sip.conf file tells Asterisk which devices can register under which extensions.... but it doesn't directly tell your phone to use that particular asterisk server.
0
 
LVL 4

Author Comment

by:jkockler
ID: 24755662
"No...  the phones need to be configured to use the new asterisk server.... even if their configuration is handed down by a tftp server, they still need to be "pointed" to it.
The Sip.conf file tells Asterisk which devices can register under which extensions.... but it doesn't directly tell your phone to use that particular asterisk server."

- I hear what you are saying, but in a situation with say, No Nat, as I think you originally thought was the case, you have 2 asterisk servers, both listening on port 5060, both behind the same WAN IP, I do not see how the phones will be prejudice as to which server they register with.  How will the phones even know the difference between the 2 servers?  All the phones have is a wan ip address, or a host name, to register to.  So say they are looking at 75.xx.xx.xxx for registration etc, and there are identical asterisk servers sitting at that ip address, both listening on port 5060, which server gets the registration??
0
 
LVL 3

Expert Comment

by:shaf81
ID: 24755723
jkockler - there is no need to be confused here. in case of a wan and sip phones registering from outside the network, then only 1 asterisk server would be valid - and that would be decided based on where the public IP:PORT pair is forwarded to in the LAN. If you need both Asterisk servers to work, and no have additional WAN IP, then next resort is to use a different port. Simple.
0
 
LVL 25

Expert Comment

by:Ron M
ID: 24755755
right except you are forgetting one thing...  both servers are on differnt INTERNAL ip addresses....
Since you only have ONE external address right now,..you can only forward to one of the servers regardless.  So simply setting up a box next to the other, even with the same sip.conf...or same port... is not enough to make phones register to the wrong server.

More simply...  you won't be able to use both boxes at the same time either way over the WAN if you only have one address.  You can setup the second box, test it internally... ..then when it's time to make the switch.... you either change the port forwarding to the new internal ip, or you flip flop the internal IP's of the asterisk servers.
0
 
LVL 25

Expert Comment

by:Ron M
ID: 24755778
fyi - my last message was to jkockler.... not shaf81
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 25

Expert Comment

by:Ron M
ID: 24755852
shaf81 -  using a different port forward from the WAN is not going to make a bit of difference...

We're either talking about a static IP mapping ...or a port mapping on the WAN... and in the case of port mapping, 5060 is not the only relevant port. ...(UDP 10001 - 20000) also would need to be forwarded for RTP traffic.... you can't forward that range to two different servers.

One IP address on the WAN = ONE asterisk server in use over the WAN.
BOTH Asterisk servers could still be used internally however.
0
 
LVL 3

Expert Comment

by:shaf81
ID: 24756116
xuserx2000 - Well, you're correct about the RTP ranges (UDP ports). I was not addressing that issue. I was just clearing jkockler's doubt. I am not an expert on Asterisk, but I've extensively worked on other SIP and IP telephony platforms. If there is a possibility to specify the RTP port range for each Asterisk box, then the port forwarding can be managed properly, if not, then the RTP traffic should be tunneled - anyway, that's a different context altogether.
0
 
LVL 4

Author Comment

by:jkockler
ID: 24756157
You actually can set the RTP port range of an asterisk box.

What do you think about that option XuserX?  Just for the sake of discussion.  

I probably will just use another WAN Static ip address, as I believe that even if I set asterisk rtp ports to say 30000-40000,  I believe the carrier on my back-end would still be sending RTP traffic to the standard 10000-20000...
0
 
LVL 25

Expert Comment

by:Ron M
ID: 24756194
Back to the original point of this question.... for this setup... changing the port to 5062 isn't going to work, so don't bother changing it on the phones or adding another forward on your router.  It simply won't work.
0
 
LVL 25

Expert Comment

by:Ron M
ID: 24756199
jkockler... that should work.  I didn't think of that.  If you change the RTP range, on the server and the router...then you should be good.   Never tried it myself.
0
 
LVL 25

Expert Comment

by:Ron M
ID: 24756210
I've always found it easier to just get another IP address.....
0
 
LVL 4

Author Comment

by:jkockler
ID: 24756221
It is worth a shot I guess, just to know the outcome.  Although I still think the back end carrier will continue to send traffic to rtp traffic to 10000-20000.
0
 
LVL 25

Expert Comment

by:Ron M
ID: 24756264
....i'm not sure on that one...  as I understand it though.., the RTP port to be used is "negotiated" with the peer by Asterisk.  I'm actually leaning toward it working, but since i've never done it myself i'm not sure... it would be a neat experiment though.  Let me know if you do it and if it works.
0
 
LVL 4

Author Comment

by:jkockler
ID: 24756377
will do.
0
 
LVL 3

Expert Comment

by:shaf81
ID: 24756435
Sure it can be done. I've done it myself on many boxes, but never on an asterisk. Most of my work has been on Carrier grade switches (Nextone etc). However, if you're talking about a carrier to carrier solution, then this type of setup is not ideally suited, and you'd be in-fact looking at dedicated WAN Ip's
0
 
LVL 4

Author Comment

by:jkockler
ID: 24759904
I setup the new server, on the same WAN IP, behind the firewall, and it seems to work fine with the alternate RTP ports registered in RTP.conf

I set a range of 30000-40000 ... Put the new server on 5062, and forwarded the ports to the second server -- set the phone to register at my host name w/port --- voip.hostname.com:5062 ---

I have only been able to test with a phone on the same LAN, but it is pointed to the external WAN IP, with the hostname and port.

I can also tell you that I forgot to reload asterisk after setting the new port range, and I did have a one way audio problem.. After the reload, the audio was perfect.  So I feel that even though the ip phone is on the same LAN, pointing outside, and coming back in, that it will still most likely work with an external phone.  

Additionally, my back-end carrier will have to change a port setting on their end as well.  The carrier must send calls to specified DIDs, to static the ip address w/ alternate port, 75.xxx.xx.xx:5062.  That is the only hurdle left to conquer.  Hopefully they will not have a problem with that.  Either way at least we know it works.

Hope this helps, have a good one, and thanks for the help!

0
 
LVL 25

Expert Comment

by:Ron M
ID: 24759976
Excellent.
Glad to help.
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Almost all Internet protocol telephones have built-in switches at the back that allow you to connect your personal computer to one port and use the other port to connect your phone to to a Cisco switch.   Why we need to connect the PC to the pho…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

706 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

18 Experts available now in Live!

Get 1:1 Help Now