Prerequisites
- A working knowledge of Linux, Subversion, and Asterisk.
- A Linux distribution. This guide does not assume a lot has been installed on the machine in question; however, some things may be needed on your distribution that were already installed for this guide. Use common sense here.
- SVN is installed
Install Asterisk Prereqs
In order to make sure that all of the current Asterisk prerequisites are installed and set up, we will first check-out Asterisk and make sure that we can build and run Asterisk outside of the control of Bamboo.
- Open a terminal and enter the following:
$ cd $ svn co http://svn.asterisk.org/svn/asterisk/trunk asterisk_trunk $ cd asterisk_trunk $ cd contrib $ cd scripts $ sudo ./install_prereq install
- This will typically install a large number of Asterisk prerequisites. When it is finished, you should see:
###################################### ## install completed successfully ######################################
- Perform the following:
$ cd ../../ $ ./configure --enable-dev-mode $ make $ sudo make install $ asterisk -cvvvg
- Verify that Asterisk starts. On the Asterisk CLI, enter:
CLI> core stop now
Third Party Libraries
Install spandsp
For fax support, you'll need spandsp.
- Install libtiff
$ sudo yum install libtiff-devel
- Download the spandsp source from http://soft-switch.org/downloads/spandsp. Pick a recent revision.
- Assuming that you downloaded it to Downloads (we'll assume that this is spandsp-0.0.6):
$ cd ~/Downloads/ $ tar -xzf spandsp-0.0.6 $ cd spandsp-0.0.6 $ ./configure $ make $ sudo make install
Install libsrtp
For SRTP, you'll need libsrtp. To obtain that library, perform the following:
$ wget http://srtp.sourceforge.net/srtp-1.4.2.tgz $ tar xvf srtp-1.4.2.tgz $ cd srtp $ ./configure CFLAGS=-fPIC --prefix=/usr $ make $ make runtest $ sudo make install
Install Asterisk Test Suite Prereqs
Check out the Asterisk Test Suite by doing the following:
$ cd $ cd asterisk_trunk $ svn co http://svn.asterisk.org/svn/testsuite/asterisk/trunk testsuite $ cd testsuite
With the Test Suite checked out, we can begin to install its various prerequisites.
ASTTest Installation
- Enter the following:
$ cd asttest $ make $ sudo make install
- Verify that asttest was installed by doing the following:
$ asttest asttest: missing arguments -- specify at least one test directory Usage: ....
- When finished, return to the Test Suite directory:
$ cd ..
Third Party Libraries
The following needs to be installed:
- lua-devel
- lua
- python-twisted
- libpcap-devel
- python-yaml
StarPY Installation
StarPY is used as a wrapper around AMI for a large number of tests. It depends on Python twisted, which a number of the tests use as well.
- Perform the following:
$ cd addons $ make update $ cd starpy $ sudo python setup.py install
- When finished, return to the testsuite directory:
$ cd ../..
SIPp Installation
For SIPp, we'll need to download the source and build it ourselves, as we'll want both pcap and openssl support.
- Enter the following:
$ mkdir sipp $ cd sipp $ wget http://sipp.sourceforge.net/snapshots/sipp.2009-07-29.tar.gz Resolving sipp.sourceforget.net... Connecting to sipp.sourceforget.net ... $ tar zxvf sipp.2009-07-29.tar.gz $ cd sipp.svn $ make pcapplay_ossl $ sudo cp sipp /usr/bin
- Verify that sipp is installed and configured correctly:
$ sipp -v SIPp v3.1-TLS-PCAP, version unknown, built ...
- When finished, return to the testsuite directory
$ cd ../..
PJSUA Installation
- Enter the following:
$ svn co http://svn.pjsip.org/repos/pjproject/trunk pjproject $ cd pjproject $ ./configure CFLAGS=-fPIC $ cp pjlib/include/pj/config_site_sample.h pjlib/include/pj/config_site.h $ vim pjlib/include/pj/config_site.h
- in the vim console, hit i and insert the following:
#define PJ_HAS_IPV6 1
- Hit Esc, then type :wq to save and exit vim
- Continue the pjsip build process:
$ make dep $ make
- Copy the pjsua executable:
$ sudo cp pjsip-apps/bin/pjsua-x86_64-unknown-linux-gnu /usr/sbin/pjsua
- Verify that pjsua executes:
$ pjsua ... You have 0 active call >>>
- Enter q to exit
- Install pjsua Python bindings
sudo make -C pjsip-apps/src/python install
- Return to the testsuite directory:
$ cd ~/asterisk_trunk/testsuite
Verify the Test Suite
- Enter the following:
$ ./runtests.py -l
- Verify that the tests are listed out, and that the required dependencies (that you care about, anyway) are true.