Skip to main content

Installation on OS X 10.6 Snow Leopard

Archived Page

Archived Obsolete - No Longer Maintained

As of September 30, 2015, the OS X 10.6 page is no longer maintained by the original author and is marked as archived. The reasons are:

  • The FreeSWITCH web pages and normal download sites are now protected by TLS 1.2. OS X 10.6 does not support TLS 1.2 so cannot access the wiki and other pages. The download instructions also do not work as they now require TLS 1.2. If you absolutely need to download FreeSWITCH using OS X 10.6 you should search the mailing list for using ssh, tarballs, etc.
  • FreeSWITCH generation cannot use the last Xcode version supported on OS X 10.6. Xcode must be used to build a clang compiler than can be used. The instructions below describe the steps but there is no telling when the old clang compiler will become incompatible with FreeSWITCH.
  • There is no prerequisite support for FreeSWITCH versions beyond 1.4.

Although it's probably technically possible to generate FreeSWITCH on OS X 10.6 it's not worth the effort and time.

About

OS X 10.6 Limited to FreeSwitch 1.4

June 30 2015: FreeSWITCH 1.4 is the last release that will compile on OS X 10.6. Later versions cannot be created on OS X 10.6 due to new extensive prerequisite requirements.

This is part of the Installation and Setup on OS X guide for installing and running FreeSWITCH™. This page describes the installation of FreeSWITCH™ using the following components Installed and tested September 9, 2015:

  • OS X Snow Leopard 10.6.8 (10.6 built clean, not upgraded from a prior OS X release)
  • Xcode 4.2 Command Line Tools or the GCC 4.2 Compiler
  • LLVM-Clang 3.3 Compiler
  • Homebrew and other prerequisites
  • FreeSWITCH™ 1.4.21b+git~20150909 production version

Note that two compilers are used. FreeSWITCH™ installation requires a compiler newer than GCC 4.2. However, newer compilers are not available in binary for OS X 10.6.8 so GCC 4.2 is used to build a newer compiler.

Some information on this page is for people who want a little more than others. If you're not too technical don't let the explanations intimidate you. Just follow the steps and FreeSWITCH™ should be installed in about an hour.

As of January 9 2015 A clean installation of OS X 10.6.8 was used to test these instructions without Xcode. Installing prerequisites using methods other than Homebrew were unsuccessful.

Getting Help

If you encounter problems search the web, if you can't find an answer join and post to the FreeSWITCH-users mailing list.

OS X System Security

It is not recommended to perform this procedure while logged on as root. The administrator password is required minimally, resulting in a couple of extra prompts and a safer system.


Preparation

Backup

Even though it's easy to remove FreeSWITCH™ and it's prerequisites, removing the Apple Command Line Tools is difficult at this time. Although there is no problem leaving the CLT installed, If you want to remove them it's best to backup before starting this procedure.

Terminal Application Preferences

We'll use the Terminal application extensively during installation and to start FreeSWITCH™ initially. You should make the following changes to save time during this procedure:

  1. Copy Terminal in the Applications/Utilities folder into the Dock for quick access.
  2. Start the Terminal application by clicking it in the dock. Then open its preferences panel.
  3. In Settings–>Window change the Window Size to larger values such as 140x48 to reduce having to resize the window often.
  4. In Settings–>Window change Scrollback to Limit to Unlimited or a larger number. A lot of messages are produced that you may need to view.
  5. In Settings–>Shell change Prompt before closing to "Only if there are processes other than:". This prevents the Terminal window from closing when FreeSWITCH™ is shutdown if it started automatically, which would result in the loss of all messages in the window. This is useful during debugging. If FreeSWITCH™ started manually the window does not close.

OS X Developer Tools

The OS X Developer Tools are composed of two parts, the Xcode OS X Software Developer Kit used to develop and test OS X GUI applications, and the Command Line Tools that provide LLVM, Clang, Git and other tools required to generate non-GUI applications such as FreeSWITCH™ and its prerequisites. However....

Xcode 4.2 for OS X 10.6 is no longer available!

Xcode 4.2 Command Line Tools for OS X 10.6 are no longer available from Apple. Fortunately it is not required for FreeSwitch installation on OSX 10.6.

Determine Xcode Status

If Xcode AND the Command Lines Tools are already installed skip to Create /usr Subdirectories.
If Xcode is NOT installed continue with Install the OS X GCC Compiler.
If Xcode is installed but the Command Lines Tools are NOT inistalled remove Xcode first then continue with Install the OS X GCC Compiler.

Install the OS X GCC Compiler

Although Xcode 4.2 is no longer available, an old GCC compiler for OS X 10.6 is available in binary form GitHub that can be used to generate a newer compiler. A version for OS X 10.6 can be downloaded from GitHub to provide the compiler and additional tools required to generate FreeSWITCH™ and its prerequisites. Scroll down to the prebuilt binaries for OS X 10.6, download and install the package.


Setup Installation Directories

OS X provides the /usr directory which contains subdirectories. This procedure adds the directory local to /usr as /usr/local where FreeSWITCH™ and its prerequisite source and runtime files are placed. These files are kept out of OS X supplied directories to allow easy removal of FreeSWITCH™ and its prerequisites.

Show Invisible Files and Directories in the Finder

OS X hides many Unix directories and files from the Finder including the directories created by this procedure. These files and directories can be unhidden so they appear on the desktop, Finder windows and file dialogs. Additional information and scripts for showing invisible files are in the Installation and Setup on OS X guide. View hidden files by running the lines below in Terminal:

  defaults write com.apple.finder AppleShowAllFiles YES
killall Finder

Create /usr Subdirectories

The user name (owner) and group name of /usr/local and it's subdirectories must match the user and group FreeSWITCH™ will run under. This is typically the main user name of the Mac. View this information (yourname and yourgroup) by running the following command in Terminal:

  ls -l ~/

The user name and group appear in the third and fourth columns. Now create the /usr/local and /usr/local/src directories, replace yourname and yourgroup with the ones obtained from the previous command:

  cd /usr                                   # Change to the /usr directory
sudo mkdir local # Create the /usr/local directory
sudo chown -R yourname:yourgroup local # Modify the owner of the /usr/local directory to yours
mkdir local/src # Create the /usr/local/src directory FreeSWITCH™ source will be downloaded into

Prerequisites

Prerequisite Installation Options

Additional programs are required to generate and run FreeSWITCH™. Thisprocedureusesthe Homebrew package manager and its repository of products for OS X. Homebrew saves time since there is no need to locate packages and determine the version required for each OS X release. Homebrew's Git repository is maintained by volunteers.

Install Package Manager and Prerequisites

Using the commands below the package manager and prerequisites install in under 10 minutes.

Install Homebrew

Homebrew installation is simple, the command can be run from any directory:

  1. Go to the bottom of the Homebrew page and copy the ruby command.
  2. Open terminal if not already opened, paste and run the command
  3. Run the command "brew doctor" to verify homebrew works, this command could take a couple of minutes. Note that if Xcode is not installed there is a warning which can be ignored.

Install LLVM Clang

The Command Line Tools and the GCC compiler are too out-of-date to build FreeSWITCH™ so they are used to build Clang and LLVM that provide the compiler and tools required to generate FreeSWITCH™ and its prerequisites. These are installed by running the following commands in Terminal from any directory:

 brew tap homebrew/versions
brew install llvm33 --with-clang <- This can take 30-60 minutes
brew link -force llvm33 <- See warning below
cd /usr/local/bin
ln -s clang-3.3 cc <- Creates aliases
ln -s clang-3.3 gcc
ln -s clang-3.3 c++
ln -s clang-3.3 g++
ln -s clang-3.3 clang

If LLVM is updated to a newer release, delete the aliases in /usr/local/bin, run "brew link -force llvm", and recreate the aliases above!

Place New Tools in Path

Set OS X to find the brew installed packages by default instead of the old OS X versions:

  1. Open the top level directory which is the partition/drive OS X is installed on and locate the "etc" directory.
  2. Drag the /etc/paths file to the desktop
  3. Double click the paths file on the desktop to open and edit it.
  4. Move the /usr/local/bin line (usually the last) to the top so it is first.
  5. Drag the paths file back to the /etc directory, it will request authentication.
  6. Reboot or logoff and back on for the new paths take effect.
  7. In Terminal, type "echo $PATH" to verify it's changed.
  8. OPTIONAL: From Terminal run "sudo chown -R 0:wheel /private/etc/paths to reset owner to the original state before the change,

Install Required Packages

The basic FreeSWITCH™ prerequisite packages are installed by running the following command in Terminal from any directory:

  brew install git autoconf automake curl jpeg ldns libtool openssl pcre pkg-config speex sqlite

The following packages were provided in OS X 10.6 and must be linked into /usr/local/bin, the brew install log indicated they were keg-only. To link them run the following command:

brew link --force autoconf automake curl libtool openssl readline sqlite

If the prerequisites that were force linked are upgraded by "brew upgrade", they must be link forced again.

Homebrew has never failed in all tests but if any prerequisite fails to install it must be resolved before continuing


Download FreeSWITCH™

OS X is now ready to download and install FreeSWITCH™. This takes about 20 minutes.

Selecting a Version

There are two versions of FreeSWITCH™ to choose from: the current r elease version recommended for production systems, and master containing the latest fixes and features used duringdevelopment. The current release version is recommended unless you need newer features or patches added since the current release of FreeSWITCH™. Additional Information is located at Source Options.

This documentation is tested with the master version to keep it as recent as possible and to provide feedback to the developers. If there are problems the developers may request that you install the master version for diagnosis.

Download Using Git Clone

Download FreeSWITCH™ by switching to the src directory and invoking one of the "git clone" commands below. The git command will create the freeswitch directory in src (/usr/local/src/freeswitch) and download the FreeSWITCH™ source files.

cd /usr/local/src
git clone -b v1.4 https://stash.freeswitch.org/scm/fs/freeswitch.git # The current release version
or
git clone https://stash.freeswitch.org/scm/fs/freeswitch.git # The master/development version

Install FreeSWITCH™

Generate Installation and Configuration Files

This step creates installation files based on the operating system and installed packages. ./bootstrap.sh creates many files such as modules.conf used to add optional functionality to FreeSWITCH™, while ./configure sets compilation options. Enter the following commands (each will run several minutes):

  cd freeswitch    # <- the new freeswitch directory created by the git clone process
./bootstrap.sh
./configure CPPFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib"

Add Text To Speech Module

Optional functions are added to FreeSWITCH™ by editing the modules.conf file, this may be required as your FreeSWITCH™ configuration becomes more complex. Although not required, adding FLITE Text To Speech functionality is recommended. The easiest way to add the FLITE module is to paste and run the following line into Terminal:

   perl -pi -e 's{#asr_tts/mod_flite}{asr_tts/mod_flite}' /usr/local/src/freeswitch/modules.conf

If you prefer to manually edit the modules.conf file use this procedure:

  1. Use the Finder to navigate to the /usr/local/src/freeswitch directory.
  2. Scroll to and double-click modules.conf in the freeswitch directory, the first time requires application selection, Textedit should be used.
  3. Search for "flite" and remove the # to uncomment.
  4. Save the file.

If this is your first FreeSWITCH™ don't add more than the FLITE module. Some modules may have prerequisites in addition to what is listed in this procedure.

Compile, Create Additional Source Directories and Check for Errors

_The mod_v8 module which provides Javascript support does not compile on OSX 10.6.8, if make below fails in mod_v8 edit modules.conf, locate the line containing "mod_v8" and insert "#" as the first character on the line then save the file and run make again.

This step compiles the programs and creates additional directories and files based on modules.conf. It can run longer than 10 minutes. While still in /usr/local/src/freeswitch compile FreeSWITCH™ with the following command:

  make

If there are no errors proceed, otherwise seek assistance from the FreeSWITCH-users mailing list

Generate FreeSWITCH™ Runtime

This creates the /usr/local/freeswitch runtime library and executable programs.

  make install

Download and Install Sounds

There are mandatory sound prompts and optional music on hold files. All must be compiled to run the sample IVR. There are four versions available:

  • sounds-install moh-install (8 kHz)
  • hd-sounds-install hd-moh-install (16 kHz)
  • uhd-sounds-install uhd-moh-install (32 kHz)
  • cd-sounds-install cd-moh-install (48 kHz)

The cd sounds are recommended since all the sampling rates are provided resulting in fewer problems. Invoke the following command:

  make cd-sounds-install cd-moh-install

Cleanup

This optional step can be performed to save space by removing the temporary files created by make:

  make clean

Installation is Complete!

Continue at Installation and Setup on OS X - Installation is Complete.


Updating

Updating FreeSWITCH™

FreeSWITCH™ may occasionally require updating due to new features, fixes, etc. To download the latest updates, compile FreeSWITCH™ and create updated runtime binaries, run the following two commands:

  cd /usr/local/src/freeswitch
git pull && make current

Updating Prerequisites

To update Homebrew and its formulas run "brew update" in Terminal, this should be run prior to upgrading packages. To upgrade all packages, run "brew upgrade", or to upgrade a single package run "brew upgrade package-name" command.


Removal

Remove Everything

If the /usr/local directory existed prior to using this procedure it has to be examined to determine if the contents are deletable. If the instructions on this page were followed, and the /usr/local directory was created during this procedure, everything can be removed to roll back the system prior to using this procedure by performing these steps:

  1. Move the Xcode application to the trash and empty the Trash
  2. Drag directories /usr/local and /Library/Caches/Homebrew to the trash. Or delete them in Terminal (OS X prompts for the administrator password):
  sudo rm -r /usr/local  
sudo rm -r /Library/Caches/Homebrew

Removing FreeSWITCH™

Consider backing up modified or new configuration files you created! FreeSWITCH™ is completely removed by deleting the /usr/local/freeswitch and /usr/local/src/freeswitch directories using the Finder (drag to trash) or in Terminal:

  rm -r /usr/local/freeswitch
rm -r /usr/local/src/freeswitch

Remove Prerequisites

Packages installed by Homebrew are listed using the "brew list" command. They are removed using the "brew uninstall package-name" command.

Hide Invisible Files and Directories in the Finder

To reverse the show hidden files step, open the Terminal application and run each line below. All hidden files will disappear from the desktop, Finder and file dialogs.

  defaults write com.apple.finder AppleShowAllFiles NO
killall Finder

Known Problems

Javascript module mod_v8 not supported

As of April 9 2014 the FreeSWITCH™ Javascript module mod_v8 does not compile on, and will not be supported on OS X 10.6.8. If _Javascript support in FreeSWITCH™ is required upgrade to OS X _10.9 or later.

At FreeSWITCH™ startup the message below is displayed, it can be ignored:

[CRIT] switch_loadable_module.c:1447 Error Loading module /usr/local/freeswitch/mod/mod_v8.so
**dlopen(/usr/local/freeswitch/mod/mod_v8.so, 6): image not found**