Using sipp to stress test your asterisk 1.4 pbx system
April 17, 2007
In addition to yesterday's post about SNMP and Asterisk 1.4, here is how I tested the graphs to ensure the calls were showing up as I expected. Here is what I did tonight to test mine. I used the information I found in this post to write most of this, but I changed it around slightly..
*NOTE* UPDATED VERSION OF THE SNMP HOWTO FOR ASTERISK 1.6 IS HERE IF YOU NEED IT *NOTE*
1. Compile SIPp from here
2. Create this in your asterisk extensions file
[sipp]
exten => 2005,1,Answer
exten => 2005,2,SetMusicOnHold(default)
exten => 2005,3,WaitMusicOnHold(20)
exten => 2005,4,Hangup
exten => 2002,1,Answer
exten => 2002,2,Goto(MENUCONTEXTORSIMILARCONTEXT,s,1)
exten => 2002,3,Hangup
3. Create this in your sip.conf file
[sipp]
type=friend
context=sipp
host=dynamic
port=6000
user=sipp
canreinvite=no
disallow=all
allow=ulaw
5. Reload Asterisk (in debug mode if you want to verify it's all working the first time around)
# /etc/init.d/asterisk stop
# /usr/sbin/asterisk -vvvvvvvvvvvvvvvvvvgc
6. Run this sipp command
# ./sipp -sn uac -d 20000 -s 2005 IP.OF.YOUR.BOX -l 30
This command will connect as a client, and give the duration of the call 20K miliseconds (or 20 seconds), will dial the server at ip IP.OF.YOUR.BOX, and try to reach the extension 2005, with a limit of 30 simultaneous calls.
If you want to instead test the actual calls per second isntead of just calling in waiting and hanging up, then make it do something more fasionable. Use this command instead.
# ./sipp -sn uac -d 10000 -s 2002 HOSTNAME.OF.YOUR.BOX -l 10 -mp 5606
OUTPUT:
SIPP:
------------------------------ Scenario Screen -------- [1-9]: Change Screen --
Call-rate(length) Port Total-time Total-calls Remote-host
10.0(20000 ms)/1.000s 5061 6.01 s 59 10.0.2.10:5060(UDP)
10 new calls during 1.000 s period 14 ms scheduler resolution
46 calls (limit 161) Peak was 47 calls, after 5 s
0 Running, 46 Paused, 0 Woken up
244 out-of-call msg (discarded)
1 open sockets
Messages Retrans Timeout Unexpected-Msg
INVITE ----------> 59 0 0
100 <---------- 57 0 2
180 <---------- 0 0 0
183 <---------- 0 0 0
200 <---------- E-RTD1 57 0 0
ACK ----------> 57 0
Pause [ 0ms] 57 11
BYE ----------> 0 0 0
200 <---------- 0 0 0
------ [+|-|*|/]: Adjust rate ---- [q]: Soft exit ---- [p]: Pause traffic -----
ASTERISK (DEBUG):
-- Executing [2005@sipp:1] Answer("SIP/sipp-085759b8", "") in new stack
-- Executing [2005@sipp:2] SetMusicOnHold("SIP/sipp-085759b8", "default") in new stack
-- Executing [2005@sipp:3] WaitMusicOnHold("SIP/sipp-085759b8", "20") in new stack
-- Started music on hold, class 'default', on channel 'SIP/sipp-085759b8'
-- Executing [2005@sipp:1] Answer("SIP/sipp-0858ff38", "") in new stack
-- Executing [2005@sipp:2] SetMusicOnHold("SIP/sipp-0858ff38", "default") in new stack
-- Executing [2005@sipp:3] WaitMusicOnHold("SIP/sipp-0858ff38", "20") in new stack
-- Started music on hold, class 'default', on channel 'SIP/sipp-0858ff38'
RAW SNMP DATA:
mythbox ~ # snmpwalk -On -c YOUR.COMMUNITY.NAME -v 2c YOUR.IP.GOES.HERE .1.3.6.1.4.1.22736.1.5.1.0
.1.3.6.1.4.1.22736.1.5.1.0 = INTEGER: 30
Graph Output after running the script for 20 minutes:
And that's it. Let me know if you have any questions or comments, oddly enough, in the comments section! :)
*NOTE* UPDATED VERSION OF THE SNMP HOWTO FOR ASTERISK 1.6 IS HERE IF YOU NEED IT *NOTE*




I can run the SIPp.. but . How you create the graph from the SIPp? can u show step by step..tq
Hi Shahrul,
You can see my HOWTO on getting Cacti to work with Graphing over SNMP at the following link:
http://www.voipphreak.ca/archives/382
Hope this helps!
Thanks,
Matt
Hi ,
When run sipp I am getting following message in asterisk console
chan_sip.c:2171 retrans_pkt: Maximum retries exceeded on transmission 30-3832@127.0.0.1 for seqno 1 (Critical Response)
following is the error message in sipp
2007-09-21 16:48:38: Aborting call with Call-Id ’1-3835@127.0.0.1′.
2007-09-21 16:48:38: Aborting call with Call-Id ’10-3835@127.0.0.1′.
Thanks in advance
Prabhakar
Hum,
That’s a new one. Might you try this howto I found:
http://sipp.sourceforge.net/wiki/index.php/Howto_test_an_Asterisk_server_using_SIPp
Hopefully that helps. Let me know.
Thanks,
VP
This is a great soft, finally I can test my server performance for asterisk.
What is the limits of simultaneous calls?
I try with 1000, but the peack was 224 calls, what’s that mean? When finish the test I get that:
sipp: There were more errors, enable -trace_err to log them.
Hi Roger,
Yeah, SIPP is pretty good for testing eh?
I am not sure what would happen with a limit of 1000 calls, but depending on your situation and setup, it’s quite possible that your server can only handle 224 calls simultaneously.
I am not sure what the enable -trace_err is, possibly a compile flag, or an option for SIPP. You’ll have to check the SIPP documentation for that, which is located here:
http://sipp.sourceforge.net/doc2.0/reference.html
Hope this helps!
Voip Phreak
Hello… i have successfully done asterisk stress test using alaw thriugh this tutorial. thanks alot. but the problem is to run the same test using gsm codec. it seem asterisk refuse to send gsm voice to sipp simulator..
below is my asterisk setting..
…> extension.conf
[sipp]
exten => 2005,1,Answer
exten => 2005,2,Background(gsm-sound)
exten => 2005,4,Hangup
—> sip.conf
[sipp]
type=friend
context=sipp
host=dynamic
port=6000
user=sipp
canreinvite=no
disallow=all
allow=gsm
i have no idea to solve it… ;-(
Hi Shahrul,
I have not tried GSM myself, however I did find this link on voip-info.org that may be of some help to you.
Try here:
http://www.voip-info.org/wiki/view/Asterisk+dimensioning
He specifically mentions using GSM.
I did also notice that you have 1,2,4 in your [sipp] context, put that as 1,2,3 and maybe some other issues will be resolved. Let me know how it works out!
Thanks,
Matt
thanks Matt for your help. but the links does not help me alot.
the 1,2,4 in the extension already corrected.. but the asterisk respond still the same.. no compatible codec.. but when i try use any GSM supported phone, it work well. it just asterisk refuse to acknowledge sipp through GSM codec..
maybe other visitors can solve this issue. tq
You have to use sipp w/ an scenario where the SDP offers GSM.
Hi Voip Phreak,
this is a nice article i must say. Nice piece of info. My problem is that can you please let me know how the graphs you have generated as the link you have given here is not working. please mail me in my above address so that i can find your site easily. Hope to get the answer soon. liked your name a lot!!
Thanks
Aurobindo
Hi Aurobindo,
Thanks for the comments. I’ve updated the link for you at the top of the article – good catch. Hope this helps.
Thanks,
VP
Mostly the upper limit of calls is set by the limit of open files.
Check it out by typing “ulimit -a”
Or just set it to 65000 by typing “ulimit -n 65000″
greetz
[...] let the poller do it’s work. Make some calls, or stress test your Asterisk system using our SIPP howto and watch the graphs come to life. Here’s some samples right after we created our [...]
Hi… let me know somthing. Did you run sipp command from the same machine that runs Asterisk?
Hi…. I’d like to add some knowledge to this article.
According to Prabhakar problem, where he get a Retransmission error…. after a lot of reading, I came to realize that enabling “nat=yes” in sip.conf file (asterisk box) would solve the problem….. and fortunately, I was right.
The explanation, not quite complete, but reasonable, is that I notice (enabling debuging for sip in Asterisk CLI and tracing Sipp errors logs), that no “100″ message (part of SIP protocol) was return form Asterisk, but that doesn’t mean that it doesn’t send it, as a matter of fact it does, but non of them reach Sipp, so…. as no 100 message is get, Sipp start restransmiting, and in some point it’ll reach the limit, so “chan_sip.c:2171 retrans_pkt: Maximum retries exceeded on transmission 30-3832@127.0.0.1 for seqno 1 (Critical Response)” message will be outputed.
By enabling NAT this problem is solved. A deep explanation can be found in the sample sip.conf file form Asterisk (if you ran “make samples” when asterisk was compiled)
is SIPp must installed in VoIP server/ asterisk??
how do i setting extension.conf or sip.conf using freepbx?
please
I tried to execute as per your tutorial. I created one extension 2001 in Asterisk and one VoIP trunk sipp and I executed as instructed,
./sipp -sn uac -d 20000 -s 2001 192.168.0.17 -l 30 -trace_err
but while end of the result, it results to this error,
Discarding message which can’t be mapped to a known SIPp call:
Please advice what was wrong. Thanks in advance.