Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Prerequisites

  1. A working knowledge of Linux, Subversion, and Asterisk.
  2. 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.
  3. SVN is installed

...

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.

  1. Open a terminal and enter the following:

    Code Block
    bash
    bash
    
    $ cd
    $ svn co http://svn.asterisk.org/svn/asterisk/trunk asterisk_trunk
    $ cd asterisk_trunk
    $ cd contrib
    $ cd scripts
    $ sudo ./install_prereq install
    
  2. This will typically install a large number of Asterisk prerequisites. When it is finished, you should see:

    Code Block
    none
    none
    
    ######################################
    ## install completed successfully
    ######################################
    
    Info

    As of the time writing this, install_prereq does not install the SQLite3 package. If the Asterisk ./configure script fails, install sqlite-devel

  3. Perform the following:

    Code Block
    bash
    bash
    
    $ cd ../../
    $ ./configure --enable-dev-mode
    $ make
    $ sudo make install
    $ asterisk -cvvvg
    
  4. Verify that Asterisk starts. On the Asterisk CLI, enter:

    Code Block
    none
    none
    
    CLI> core stop now
    
    Note

    If installing Asterisk as a non-root user, Asterisk may not be able to find libasteriskssl.so.1. Verify that the shared library was built and in /usr/lib. If it is, activate the current library path by entering "sudo ldconfig"

...

For fax support, you'll need spandsp.

  1. Install libtiff

    Code Block
    bash
    bash
    
    $ sudo yum install libtiff-devel
    
  2. Download the spandsp source from http://soft-switch.org/downloads/spandsp. Pick a recent revision.
  3. Assuming that you downloaded it to Downloads (we'll assume that this is spandsp-0.0.6):

    Code Block
    bash
    bash
    
    $ cd ~/Downloads/
    $ tar -xzf spandsp-0.0.6
    $ cd spandsp-0.0.6
    $ ./configure
    $ make
    $ sudo make install
    

...

For SRTP, you'll need libsrtp. To obtain that library, perform the following:

Code Block
bash
bash

$ 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

...

Check out the Asterisk Test Suite by doing the following:

Code Block
bash
bash

$ cd
$ cd asterisk_trunk
$ svn co http://svn.asterisk.org/svn/testsuite/asterisk/trunk testsuite
$ cd testsuite
Note

Currently, the Asterisk Test Suite must reside in a sub-directory in Asterisk. Checking out the Test Suite into any other directory will cause it to not run.

With the Test Suite checked out, we can begin to install its various prerequisites.

ASTTest Installation

  1. Enter the following:

    Code Block
    bash
    bash
    
    $ cd asttest
    $ make
    $ sudo make install
    
  2. Verify that asttest was installed by doing the following:

    Code Block
    bash
    bash
    
    $ asttest
    asttest: missing arguments -- specify at least one test directory
    Usage:
     ....
    
  3. When finished, return to the Test Suite directory:

    Code Block
    bash
    bash
    
    $ cd ..
    

Third Party Libraries

...

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.

  1. Perform the following:

    Code Block
    bash
    bash
    
    $ cd addons
    $ make update
    $ cd starpy
    $ sudo python setup.py install
    
  2. When finished, return to the testsuite directory:

    Code Block
    bash
    bash
    
    $ 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.

  1. Enter the following:

    Code Block
    bash
    bash
    
    $ 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
    
  2. Verify that sipp is installed and configured correctly:

    Code Block
    bash
    bash
    
    $ sipp -v
    
    SIPp v3.1-TLS-PCAP, version unknown, built ...
    
  3. When finished, return to the testsuite directory

    Code Block
    bash
    bash
    
    $ cd ../..
    

PJSUA Installation

  1. Enter the following:

    Code Block
    bash
    bash
    
    $ 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
    
  2. in the vim console, hit i and insert the following:

    Code Block
    c
    c
    
    #define PJ_HAS_IPV6 1
    
  3. Hit Esc, then type :wq to save and exit vim
  4. Continue the pjsip build process:

    Code Block
    bash
    bash
    
    $ make dep
    $ make
    
  5. Copy the pjsua executable:

    Code Block
    bash
    bash
    
    $ sudo cp pjsip-apps/bin/pjsua-x86_64-unknown-linux-gnu /usr/sbin/pjsua
    
  6. Verify that pjsua executes:

    Code Block
    bash
    bash
    
    $ pjsua
    ...
    You have 0 active call
    >>>
    
  7. Enter q to exit
  8. Install pjsua Python bindings

    Code Block
    bash
    bash
    
    sudo make -C pjsip-apps/src/python install
    
  9. Return to the testsuite directory:

    Code Block
    bash
    bash
    
    $ cd ~/asterisk_trunk/testsuite
    

...

Note

If you haven't run make samples (which you shouldn't have, if you were following the instructions), you'll need to have an asterisk.conf file in /etc/asterisk before the Test Suite will work. Copy one over - it doesn't matter what is in it for now

  1. Enter the following:

    Code Block
    bash
    bash
    
    $ ./runtests.py -l
    
  2. Verify that the tests are listed out, and that the required dependencies (that you care about, anyway) are true.