Custom Search


Using sipP as a Call Generator to load test Asterisk on Ubuntu Server

Note: this requires you to have access to more than one Asterisk server within a network! You also need access to the superuser account.

Preparation and Existing Configuration Backup

  1. Log in to your Asterisk server and become superuser with
    sudo -s
  2. Change to the superuser's home with
    cd ~
  3. Backup the current Asterisk configs with
    tar czvf asterisk-configs.tgz /etc/asterisk
  4. Ensure sipP is installed with
    apt-get install sip-tester

Test Configuration

Map out the scenario you plan to test.
+--------+ call => +--------+
|Server  |---------|Server  |
+--------+ <= call +--------+

Set up your Asterisk extensions to answer and hangup in each server

extensions.conf example


  exten => service,1,Answer()
  exten => service,n,Dial(SIP/1234@remote-peer)

  exten => t,1,Hangup()


  exten => 1234,1,Answer()
  exten => 1234,n,Milliwatt() ; this provides the media for rtp loopback

sip.conf example


Connect to each server and set up some background sipP sessions.

From each Asterisk server (with Asterisk running)

NOTE: Escapes (\) have been added to keep wiki formatting from running off the right margin. You will probably need to edit this to match your environment...
sipp `ifconfig eth0|\ 
grep "inet addr"|\
cut -d: -f2|awk '{ print $1}'` -i `ifconfig eth1|grep "inet addr"|\
cut -d: -f2|awk '{ print $1}'` -d 1s -l 100 -aa -mi `ifconfig eth1|\
grep "inet addr"|\
cut -d: -f2|\
awk '{ print $1}'` -rtp_echo -nd -r 12 -bg

This generates about 12cps with a call duration of one second. You can use the
flag to keep the calls running in the background.

Start tshark on a system that can see the entire network

tshark -i *capture eth* -r "sip" -w *name of file*.cap

Wait while test completes

killall sipp
on any server where you had it running and ctrl-c the tshark session

Save data and view as needed.