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 23 Next »

Icon

This page is being updated!

Prerequisites

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...

/usr/src/asterisk/
	asterisk/		The asterisk repository cloned from https://gerrit/asterisk.org/asterisk
	testsuite/		The testsuite repository clones from https://gerrit/asterisk.org/testsuite 

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.

Icon

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

Install Support Packages

Icon

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

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

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

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

 

 

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.

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

  • No labels