Skip to end of metadata
Go to start of metadata

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. Git is installed.
  4. SVN is installed (only needed for the PJSUA Installation step).

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.

  1. Open a terminal and enter the following:

  2. This will typically install a large number of Asterisk prerequisites. When it is finished, you should see:

    Icon

    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:

  4. Verify that Asterisk starts. On the Asterisk CLI, enter:

    Icon

    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"

    As well since Asterisk is not being started as root it may not be able to create certain things. This is perfectly fine as the above is just to test that Asterisk is installed and can be started.

Third Party Libraries

Install spandsp

For fax support, you'll need spandsp.

  1. Install libtiff

  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):

Icon

spandsp installs itself into /usr/local/lib. If that isn't in your library include path, res_fax_spandsp will build but will not load, causing the fax tests to fail (typically with INIT failures).

Install libsrtp

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

Install Asterisk Test Suite Prereqs

Check out the Asterisk Test Suite by doing the following:

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

ASTTest Installation

  1. Enter the following:

  2. Verify that asttest was installed by doing the following:

  3. When finished, return to the Test Suite directory:

Third Party Libraries

The following needs to be installed:

  • lua-devel
  • lua
  • python-twisted
  • libpcap-devel
  • python-yaml
  • python-devel
  • python-construct

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.

  1. Perform the following:

  2. When finished, return to the testsuite directory:

SIPp Installation

For SIPp, we'll need to download the source and build it ourselves, as we'll want both pcap and openssl support.  The current minimum version required is 3.4.1.

  1. Enter the following:

    By default, sipp is installed in /usr/local/bin.  If you want it installed to /usr/bin, add '–prefix=/usr' to the configure command.

     

  2. Verify that sipp is installed and configured correctly:

  3. When finished, return to the testsuite directory

PJSUA Installation

Icon

This step isn't needed if Asterisk was configured with --with-pjproject-bundled

 

  1. Enter the following:

  2. in the vim console, hit i and insert the following:

  3. Hit Esc, then type :wq to save and exit vim
  4. Continue the pjsip build process:

  5. Copy the pjsua executable:

  6. Verify that pjsua executes:

  7. Enter q to exit
  8. Install pjsua Python bindings

  9. Return to the testsuite directory:

Verify the Test Suite

Icon

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:

  2. Verify that the tests are listed out, and that the required dependencies (that you care about, anyway) are true.
  • No labels

14 Comments

  1. When installing on CentOS 6, I had to install these additional packages:

    1. libpcap-devel
    2. gcc-objc
    3. python-devel
    4. python-twisted
  2. Most of those make sense, but gcc-objc? Where did that come from?

    1. When making pjproject for pjsua, it barfed on not having a cc1obj.  A quick yum whatprovides told me it was in gcc-objc, which I installed, then it was happy.

       

  3. I had to go into pjsip-apps/build to make the pjsua app.

    make -C pjsip-apps/build pjsua

    (Both for the svn checkout as mentioned above and the asterisk-git version from Installing pjproject.)

    (P.S. Copying to /usr/sbin seems wrong, no need for the s.)

  4. I had to install python-setuptools and python-requests for Fedora

    Also needed autobahn installed via pip.  There's no Fedora package.

     

  5. On Ubuntu server 12.04, using apt-get to install python-requests installs a really old version of the library (0.8.3) that leads to test failures for some tests. Use easy_install to install it instead.

  6. There are now tests that require sipp 3.4.1

  7. git should be added to the list of prerequisites.

    1. Yes. I added it to the list. I also inserted a caveat for the SVN prerequisite in that SVN is only needed to complete the PJSUA Installation steps (as documented on this page). It is worth noting that it is possible to obtain the PJSIP source code without using SVN.

  8. Shouldn't the git clone commands pull from the anonymous gerrit URLs ( https://gerrit.asterisk.org/asterisk and https://gerrit.asterisk.org/testsuite)? It should be possible to run the testsuite without having a gerrit login.

    1. Good point. I updated the text to reflect this.

  9. On CentOS 6, after the initial prereq install, I found that doing a "yum install epel-release" made a large number of packages installable.

    I had to hand install sqlite-devel and gmime-devel.

    I had to yum install python-requests... and autobahn... although that didn't help run that last command,

    sudo make -C pjsip-apps/src/python install
    wherein during the compile of _pjsua.c, I see complaints about Python.h  and  structmember.h not being found, and the rest swiftly goes south after that.
    Any suggestions?
    1. Aaarggg! Got it. I needed to do a "yum install python-devel" !

      After that install, I was able to run the make successfully; but runtests.py -l says: "No handlers could be found for logger "asterisk.version"".. which I guess is ignorable.

      Many thanks!

       

       

  10. The instruction not ever working for all cases

    $ sudo cp pjsip-apps/bin/pjsua-x86_64-unknown-linux-gnu /usr/sbin/pjsua

     

    maybe, can try with

    $ sudo cp pjsip-apps/bin/pjsua-$(grep "export TARGET_NAME" ./build.mak | cut -f 2 --delimiter="="|xargs) /usr/sbin/pjsua

    is not a clean command but its works