Page tree
Skip to end of metadata
Go to start of metadata

About 

This page covers how to install and configure FreeSWITCH on Amazon EC2

 

The FreeSWITCH™ team does not officially support most virtualized hosts because it is very difficult to determine if your instance is getting the resources to run properly.


 Click to expand Table of Contents

Opening Firewall Ports

SIP

RTP

The RTP port range given should match your configuration in switch.conf.xml.

Additional EC2 NAT Notes

For SIP, setup a security group with the following ports enabled (easiest to do with Elasticfox):

Make sure you make the security group, and apply it before you boot the instance. After this, the quick and dirty install guide worked just fine for me. You'll just need to tweak the default dialplan to your needs.

You may also need to make some of the following changes, particularly the external SIP and RTP IPs. The URLs in the commands below retrieves the external IP address of an instance (either the one mapped automatically at instance creation or the Elastic IP attached to the instance.)

conf/vars.xml

The alternative to the above commands is to hard code the external IP addresses. However, this will require you to customize the vars.xml file for each instance (i.e. each external IP address) to which it is deployed. It will also have to be changed if you map/unmap an Elastic IP to the instance.

conf/sip_profiles/internal.xml

conf/sip_profiles/external.xml

conf/autoload/switch.conf.xml

Sofia External IP Config

You shouldn't have to make any changes to the Sofia profile. The FreeSWITCH Auto NAT feature will take care of this automatically. However, if you want to do this manually, edit the sip_profiles/internal.xml file and replace auto-nat with the external IP address in the ext-rtp-ip and ext-sip-ip parameters.

Updating Kernel Timer to 1000Hz

 

Pre v3 Kernels

This kernel timer adjustment only applies to kernel versions prior to 3.x


If using Ubuntu on EC2 (and elsewhere) the kernel timer is by default set to 100HZ or 250HZ which will lead to worse call-quality. You can use the following steps to change this setting and recompile the kernel. (These were used on Ubuntu Lucid 10.04, but should work for newer versions too.)

Ubuntu 13.10 and newer

Apply this patch to /usr/sbin/update-grub-legacy-ec2:

Then install lowlatency kernel:

Older Ubuntu releases

If you need more help then the #ubuntu-kernel IRC channel is the best place to ask, also read these pages: [1] [2] [3] [4]

FAQ

Q: What distro should I use?

Its up to you! However, some recommend CentOS.

Q: Are there any public AMI images with FreeSWITCH pre-installed?

As of September 3, 2008, running

from the Amazon cloud command line utility yields:

NOTE: These are very old versions of FreeSWITCH. Your best bet will be to checkout the latest FS trunk and build a fresh copy on your EC2 instance.

There's a more updated AMI available on EU region: foneAPI-generic-32bit-freeswitch-v1 (works very good on High-CPU Medium Instance - c1.medium)

Q: Can I run this as a production switch?

A small instance is not recommended for running FreeSWITCH in production, however you should be happy with a High CPU Medium instance.

Experiences:

  • From Cfurmori in May 2009: I wouldn't recommend running FreeSWITCH in production on Amazon EC2. I purchased a 1 year instance of a small server setup and used a base CentOS 5.3 image 32-bit x86. Built FreeSWITCH from the latest snapshot and it worked great for dev and testing purposes but the call quality was pretty bad at times. I spent a fair amount of time tuning / testing / watching resource utilizations running a 4 person conference and I would see an average of 0.5 to 1.0 second audio delay. I tried with direct SIP phone registrations and through a SIP trunk provider, same results. EC2 is a great dev/test platform but I would say your best to run a realtime voice application on a physical server. You can virtualize voice systems but they need to be designed and engineered by someone that knows what they are doing.
  • A mailing list user said in March 2010: "We run FreeSWITCH on AWS' EC2. A medium EC2 instance is happily supporting 100 Polycom users, conference bridges etc. Been running for over a year. We also use FlowRoute as our PSTN->SIP Interface, and also Skype Business SIP. Our users are scattered across the globe - so having the box sitting on AWS' network infrastructure is key to avoiding issues with latency, jitter, packet loss (i.e. I don't think we could afford the connectivity AWS gives us if we had to provision this in-house)."

2 Comments

  1. Anonymous

    why is multiple-registrations required?

    1. Why not? In internal context all users are verified. You can comment this.