Ubuntu Quick Start

From FreeSWITCH Wiki

(Redirected from Quick Start)
Jump to: navigation, search

Contents

Introduction to Ubuntu and FreeSWITCH

This page was intended to help those who want to install FreeSWITCH, and not start learning how FreeSWITCH actually works. This will give you the basic setup so that you can at least start making calls.

Please also review the entries for Debian and Ubuntu under http://wiki.freeswitch.org/wiki/Download_%26_Installation_Guide#Debian for some more information before proceeding.

Initial Setup

The original author started with Ubuntu Hardy 8.04.1 Server 386. We are now up to Jaunty 9.04 and I have not found any problems with it running on my Laptop i686 32-bit test environment.

Note that in the command line examples, the editors Nano (command name "nano") or Vim (Vi Improved, command name "vim") are mentioned. Any text editor (gedit, emacs, etc.) should be able to be substituted. Often this command is in the EDITOR environment variable (referenced with $EDITOR).

Install the standard Ubuntu server system.

for 10+ (jaunty) you need to apt-get install pkg-config or otherwise you get configure errors for libs/iksemel

Install from Repo

There are both Hardy and Intrepid to Lucid packages in this repo.

Open a terminal window (if necessary) and then type these commands:

apt-get install python-software-properties
add-apt-repository ppa:freeswitch-drivers/freeswitch-nightly-drivers
apt-get update
apt-get install freeswitch freeswitch-lang-en freeswitch-sounds-en-us-callie-8000

Following the above will get you a basic installation of FreeSWITCH installed in /opt/freeswitch.

Install from Git

Get FreeSWITCH Source

Open a terminal window (if necessary) and then type these commands:

cd /usr/src
sudo apt-get install git-core subversion build-essential autoconf automake libtool libncurses5 libncurses5-dev make libjpeg-dev
# optional packages
# sudo apt-get install libcurl4-openssl-dev libexpat1-dev libgnutls-dev libtiff4-dev libx11-dev unixodbc-dev libssl-dev python2.6-dev \
                       zlib1g-dev libzrtpcpp-dev libasound2-dev libogg-dev libvorbis-dev libperl-dev libgdbm-dev libdb-dev python-dev \
                       uuid-dev
git clone git://git.freeswitch.org/freeswitch.git
cd freeswitch

The Debian / Ubuntu way

The proper thing to do now is make a package. This is Ubuntu and we love .deb files.

First check that you have all of the build dependencies.

dpkg-checkbuilddeps

Use your favorite APT utility to get the needed packages. Once that is done:

dpkg-buildpackage -b -rfakeroot

This will take a while. Once it is done:

cd /usr/src
ls freeswitch*.deb

Now let's install them.

dpkg -i freeswitch*.deb

NOTE: (as at 05-Jan-2010 - mb) If you follow the instructions above strictly, then you will not get all of the modules you may wish installed. (In particular I found that it didn't seem to package up mod_flite, mod_fax, mod_pocketsphinx etc. Perhaps this is a licensing and Debian purity thing?) The absence of modules might also be explained by them being commented out during compilation (?) but surely if we are to have Debian package niceness it would make sense to compile all and allow installation by selection/need? I thought I'd uncomment everything and dpkg build them all, but I couldn't find the freeswitch/modules.conf file when following the above explicit git clone recipe even though when I used the Quick and Dirty FreeSWITCH recipe (which involves downloading a Makefile and using that to bootstrap the git clone) I could find and edit the modules.conf file and then 'make' correctly downloaded necessary dependencies during compilation. I now have two FreeSWITCHes and will have to tidy up - one which nicely starts up with initrc.d but is located in opt and doesn't have all the modules, and one which is bleeding edge with all modules and doesn't integrate neatly with the system.

What I think needs doing is fixing of the Debian packaging properly so that it accounts for all modules and puts the lot in a sensible (non-/opt) location and then a tidying of all of the above. I don't really have time for that learning curve at this point and even if it wasn't too much would be worried to step in to the Debian packaging role if others are maintaining it. Martin

Directly from Git

./bootstrap.sh
./configure
make
sudo make install
sudo make uhd-sounds-install
sudo make uhd-moh-install
sudo make samples


on Ubuntu 10.04 on Toshiba M200 2003 Model by Peng Li May 19, 2010 (Need Expert of Ubuntu/FreeSWITCH to review!)

Referenced from this page and http://wiki.freeswitch.org/wiki/Quick_and_Dirty_Install, which puts everything under /usr/local/freeswitch.

sudo su
apt-get install git-core subversion build-essential autoconf automake libtool libncurses5 libncurses5-dev (**5 mins**)
apt-get install libjpeg62-dev #otherwise make fails with [mod_spandsp.la] Error 1
cd /usr/src 
wget http://www.freeswitch.org/eg/Makefile
make   ( **55 mins**) 
make install (**2 mins**)
cd freeswitch.git
make uhd-sounds-install (**2 mins**) 
make uhd-moh-install   (**2 mins**)

Then I have do the following to get it working. (If you want do Debian's way, then replace opt with usr/local in all files in /usr/src/freeswitch/debian)

cp freeswitch.init /etc/init.d/freeswitch

Following the above resulted in a default install in /usr/local/ not /opt

sed /usr/src/freeswitch.git/debian/freeswitch.init -e s,opt,usr/local, >/etc/init.d/freeswitch
chmod 755 /etc/init.d/freeswitch 
cp freeswitch.default /etc/default/freeswitch # (** change to "true" **)

make the init.d/freeswitch script start at boot

root@fs:# update-rc.d -f freeswitch defaults

Apply postinst script's content (except of mkdir)

/usr/src/freeswitch.git/debian/postinst # Script needs changing... defaults to /opt so permissions don't get set.

Add the freeswitch user:

 adduser --disabled-password  --quiet --system \
  --home /opt/freeswitch \
  --gecos "FreeSwitch Voice Platform" --ingroup daemon \
  freeswitch
 
 adduser freeswitch audio

Change freeswitch installation ownership (from root)

 chown -R freeswitch:daemon /usr/local/freeswitch/

Remove permissions for other

 chmod -R o-rwx /usr/local/freeswitch/

Add the fs_cli to your default path

 ln -s /usr/local/freeswitch/bin/fs_cli /usr/local/bin/


 sudo reboot # there you go!
or
 /etc/init.d/freeswitch start
# test its startup
 fs_cli

Ubuntu / Debian Method Items

For some reason the package maintainer has chosen to put FreeSWITCH in /opt. Michael, if you are reading this can you move FreeSWITCH's packages to use more Debian / Ubuntu standard locations? So in the instructions below replace /usr/local with /opt and you will be fine.

ANSWER: Since FreeSWITCH is not a Ubuntu/Debian project everything is supposed to stay where it is on all other platforms as well. Now guess where that would be? I leave that to your imagination. Michal

Maybe this would be better moved to the discussion page?

The important thing is to recognize that freeswitch could be installed at /opt/freeswitch or at /usr/local/freeswitch depending upon how you installed it. The files are organized the same in the folders below freeswitch.

Enabling FreeSWITCH

nano /etc/default/freeswitch

FREESWITCH_ENABLED="true"

Start it up!

invoke-rc.d freeswitch start

Updating to the Latest Version

Updating the Debian / Ubuntu way

From the command line just type:


sudo apt-get install freeswitch

This will try to install but also update the FreeSWITCH package to the most recent version. Follow the instructions on the screen.

Updating Directly from Git

After installing 'Directly from Git (aka Hard Way)' (see above), the following will update your freeswitch installation to the latest from trunk.

cd /usr/src/freeswitch
sudo make current

Todo

  • If you have any requests for clarification, place them here.



Minor problem installing with apt-get on Ubuntu Hardy

mvanlamz 2009-09-11

I used apt-get and the repo info above to install FreeSWITCH on Ubuntu Hardy, and got the following two errors:

adduser: Specify only one name in this mode.
chown: invalid user: `freeswitch:daemon'

I'm guessing that FreeSWITCH wants a user called 'freeswitch' in a group called 'daemon'? Is this right? Perhaps this could be changed to install more cleanly on Ubuntu Hardy?

---That is correct. chown can use the notation user:group to change both the user and group simultaneously. Since the adduser failed (probably if you used the "adduser freeswitch audio" command, it very likely didn't understand the "audio" part), "freeswitch" doesn't mean anything to the system (yet).


mvanlamz 2009-09-14

I got my FreeSWITCH installation on Ubuntu Hardy to work by:

  • creating a group called 'freeswitch'
  • creating a user called 'freeswitch'
  • added 'freeswitch' user to 'freeswitch' group
  • chmodded the FreeSWITCH folder

You can copy and paste this:

adduser freeswitch
chown -R freeswitch:freeswitch /opt/freeswitch


Problem info from the quick and dirty page

The quick and dirty page is now generic and this info was recent and for Ubuntu:

  # for Ubuntu 10.04/10.10, to get Dingaling working, you need to use the trick
  # mentioned here: http://lists.freeswitch.org/pipermail/freeswitch-users/2010-July/060357.html .
  # not sure whether this is FreeSWITCH configure issue or Ubuntu issue.**)

Using FreeTDM with the 'direct from git' method above

earthspike, 2011-06-05

The /dev/wan* are owned by root.root, so this needs to change for mod_freetdm to work correctly.

I got mine to work (on 10.04.2 LTS) by:

  • Create user and group freeswitch as described above. Command for adding the group is
    addgroup --system freeswitch
    .
  • Change the group ownership on the devices:
    chgrp freeswitch /dev/wan*
  • Restart freeswitch if already running:
    /etc/init.d/freeswitch restart
  • Use fs_cli to check that your TDM spans are showing:
    ftdm list
    .

Personal tools

Community
Support FreeSWITCH