Linux FreeTDM API Installation
Introduction
This page describes how to install FreeTDM in Linux. You have two options. Install as standalone or as a part of FreeSWITCH. Most users really want to install it with FreeSWITCH unless they're creating custom applications in C.
If you want to install FreeTDM with FreeSWITCH, then just skip the "FreeTDM standalone" section. When you're done, be sure to get back to the main FreeTDM web page to learn how to configure FreeTDM.
Â
FreeTDM Linux Prerequisites
Recommended Linux distribution is CentOS, but is not strictly required.
GNU autotools: libtool, autoconf, automake, configure, gmake.
On Centos 5.X:
#>Â yum install autoconf bison flex make gcc gcc-c++ libtool automake ncurses-devel libtermcap-devel
On Debian or Ubuntu:
Install tools needed before packaging:Â
#>Â apt-get install devscripts pbuilder gcc make bison automake autoconf flex libtool ncurses-dev
 Let FreeTDM handle required dependencies from the source with pbuilder
Wanpipe Quick Install
Please download LATEST Wanpipe Release:Â Â
https://ftp.sangoma.com/linux/current_wanpipe/wanpipe-latest.tgzUntar wanpipe release in arbitrary directory (/usr/src/ is recommended).
#> tar xvfz wanpipe-latest.tgzAfter untarring wanpipe-latest.tgz, the wanpipe-<version> directory will be created. Â Â
#>Â cd wanpipe-<version>ÂRun make from the newly created wanpipe-<version> directory
   #> make freetdm      (To compile Wanpipe drivers and utils)   Â
  #> make install          (To install Wanpipe drivers and utils)  Â
Â
Confirm successful Wanpipe Installation
To confirm successful Wanpipe installation run:
#> wanrouter hwprobe
This command will load the wanpipe modules and will print out list of all Sangoma hardware installed on the system. Â
Â
FreeTDM with FreeSWITCH
To get the source of the latest development source, do the following:
Decide where you will place the sources (we use /usr/src/freeswitch)
Go to the parent directory of where you want to place the sources:Â
#cd /usr/srcDownload the latest nightly snapshot .tar.gz and untar it:
#Â wget http://files.freeswitch.org/freeswitch-snapshot.tar.gz
Now lets proceed to build freeswitch.
Install FreeSWITCH/FreeTDM from source
Change into the freeswitch build directory
#>Â cd freeswitch
Configure the buildsystem
#>Â ./bootstrap.sh
#>Â ./configureÂ
OR to install in /opt/freeswitchÂ
#>Â ./configure --prefix=/opt/freeswitchÂ
Select the modules to be build.Â
#>Â vi modules.conf
Uncomment the freetdm line :
Change ---> (#../../libs/freetdm/mod_freetdm)
To ---> (../../libs/freetdm/mod_freetdm)
Build
#>Â make all install
#>Â make samples
#> make sounds-install (to install the default sound files)
#> make moh-install (to install default music on hold files)
Configure freeswitch for freetdmÂ
In order to automatically load freetdm in freeswitch at runtime we need to enable it in modules.conf.xml
#>Â vi /usr/local/freeswitch/conf/conf/autoload_configs/modules.conf.xml
Â
Uncomment the mod_freetdm line :
Change ---> <!-- <load module="mod_freetdm"/>
To ---> <load module="mod_freetdm"/>
For more information on downloading Freeswitch, go to :Â
http://wiki.freeswitch.org/wiki/Download_FreeSWITCH
For more information on installing Freeswitch, goto:Â
http://wiki.freeswitch.org/wiki/Installation_Guide
Â
Â
Proceed to the Configuration Page
FreeTDMÂ standalone
You will need to download a full Freeswitch distribution in order to get the FreeTDM source.
#>git clone git://git.freeswitch.org/freeswitch.git freeswitch
For more information on downloading Freeswitch, go to:Â
http://wiki.freeswitch.org/wiki/Download_FreeSWITCH Â
Now lets proceed to build FreeTDM.
Install FreeTDM from source
Â
Change into the FreeTDM directory
#>Â cd freeswitch/libs/freetdm
Configure the buildsystem
#>Â ./bootstrap.sh
#>Â ./configure --prefix=/usr/local/freetdm
Build
#>Â make
#>Â make install
At this point the library and modules are installed. If you are using FreeTDM as an API, you have 2 options to configure the library, either you proceed to the Freetdm Configuration Page and use the API ftdm_global_configuration() which parses this file and creates the needed span and channels data structures out of it, or you create the structures manually using API's such as ftdm_span_create(). If you decide to use the pure API approach, have a look at sample/boost/ftdmstart.c for a sample program making use of such APIs.
For further documentation of the API you can take a look at the doxygen documentation at http://docs.sangoma.com/doxygen/freetdm or better yet, take a look at the comments in src/include/freetdm.h
Â