Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 24 Next »


This page is being updated!


Most developers create an Asterisk work directory like ~/source/asterisk or /usr/src/asterisk then in that directory, clone the Asterisk, Testsuite and support repositories.  I'll assume /usr/src/asterisk in the rest of these instructions and that your tree looks (or will look) like...

	asterisk/		The asterisk repository cloned from https://gerrit/
	testsuite/		The testsuite repository clones from https://gerrit/ 

If you don't already have the Asterisk source tree checked out and all of its prerequisites installed, please visit Installing Asterisk From Source.

Make sure you're using a supported version of libsrtp.  See "Installing libsrtp" for more information.

Install Asterisk

 Make sure you can actually build and install Asterisk at least once before proceeding.  Once you can, you'll need to follow a few more steps to configure Asterisk and rebuild it for testing:

  • Add --enable-dev-mode and optionally, --disable-binary-modules to your ./configure command line.  Disabling the binary modules just prevents the need to download the external codecs and res_digium_phone.
  • In menuselect...
    • Under Compiler Flags - Development,  enable DONT_OPTIMIZE, MALLOC_DEBUGDO_CRASH and TEST_FRAMEWORK and disable COMPILE_DOUBLE
    • Make sure all modules are enabled.  You don't need the Test Modules though.  If you enter Test Modules and press F7, you can quickly disable all modules.
  • Build and install Asterisk and the development header files.
    • make
    • sudo make install
    • sudo make install-headers

The testsuite needs the sample configuration files installed but before you do that, make sure you've saved the contents of /etc/asterisk if you've customized any files.  Once you're sure you don't need anything in /etc/asterisk...

  • sudo make samples

Do NOT start Asterisk at this time.  The Testsuite will start and stop it for each test.


If you want to see how the Jenkins CI process configures Asterisk for testing, check out tests/CI/ in the Asterisk source tree.

Install Support Packages


The Testsuite is Python based but not yet fully compatible with Python 3. If you have Python 3 installed, make sure you also have a working Python 2 installation before proceeding. I'll assume you do and the executable is called python2.

The Testsuite needs several support packages to be installed:


yappcap is a Python library that allows the Testsuite to capture packets on an interface.  Only a few tests actually use but it should be installed nonetheless:

yappcap Installation


sipp is a SIP simulation tool that is relied on heavily by the Testsuite.  Most distributions have up to date versions of the tool available.  If it's version 3.5.0 or greater, simple use your distro's package manager to install it and skip the rest of the sipp instructions.  Otherwise download, build and install it yourself.  You'll need to install openssl, libsrtp (or libsrtp2), libpcap, gsl (or libgsl), lksctp-tools (or libsctp1), and their associated development packages (-devel or -dev).

sipp Installation

When the build completes, check the version:

Check sipp version

If everything's OK, install it:


StarPy is a Python + Twisted protocol that provides access to the Asterisk PBX's Manager Interface (AMI).  It's actually bundled as part of the Testsuite but it's easier to install it separately.

StarPy Installation

Install the Testsuite

Testsuite Installation

Install Prerequisites

There's a contrib/scripts/install_prereq script but it assumes that the python executable runs Python 2.  If you're running on a system where Python 3 is the default (most are nowadays), you'll need to install the prerequisites yourself.

If your distribution doesn't provide packages for python2, you'll need to install them using pip.  



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


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


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.

StarPy is a Python + Twisted protocol that provides access to the Asterisk PBX's Manager Interface (AMI)

  • No labels