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..
Compile SIPp from here
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
Create this in your sip.conf file
[sipp] type=friend context=sipp host=dynamic port=6000 user=sipp canreinvite=no disallow=all allow=ulaw
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
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
------------------------------ 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 -----
-- 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:
# snmpwalk -On -c YOUR.COMMUNITY.NAME -v 2c YOUR.IP.GOES.HERE .126.96.36.199.4.1.227188.8.131.52.0 .184.108.40.206.4.1.227220.127.116.11.0 = INTEGER: 30
Graph Output after running the script for 20 minutes:
All the Channels:
The Sip Channel Zoomed In:
And that’s it. Let me know if you have any questions or comments, oddly enough, in the comments section! 🙂
Comment by Shahrul on 2007-09-14 16:05:53 -0500
I can run the SIPp.. but . How you create the graph from the SIPp? can u show step by step..tq
Comment by Matt G on 2007-09-14 17:20:03 -0500
You can see my HOWTO on getting Cacti to work with Graphing over SNMP
Hope this helps!
Comment by Prabhakar on 2007-09-21 01:43:25 -0500
When run sipp I am getting following message in asterisk console
chan_sip.c:2171 retrans_pkt: Maximum retries exceeded on transmission email@example.com for seqno 1 (Critical Response)
following is the error message in sipp
Thanks in advance
Comment by Matt G on 2007-09-21 04:00:05 -0500
That’s a new one. Might you try this howto I found:
Hopefully that helps. Let me know.
Comment by Roger Gomez Olivares on 2007-09-27 12:48:20 -0500
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.
Comment by Matt G on 2007-09-27 13:55:49 -0500
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:
Hope this helps!
Comment by shahrul on 2007-11-14 16:17:53 -0500
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..
exten => 2005,1,Answer
exten => 2005,2,Background(gsm-sound)
exten => 2005,4,Hangup
i have no idea to solve it… ;-(
Comment by Matt Gibson on 2007-11-14 16:47:17 -0500
I have not tried GSM myself, however I did find this link on voip-info.org that may be of some help to you.
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!
Comment by shahrul on 2007-11-15 09:05:14 -0500
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
Comment by -ab- on 2008-04-04 09:31:26 -0500
You have to use sipp w/ an scenario where the SDP offers GSM.
Comment by Aurobindo on 2008-08-27 08:09:24 -0500
Hi Matt G,
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!!
Comment by Matt G on 2008-08-29 14:58:55 -0500
Thanks for the comments. I’ve updated the link for you at the top of the article – good catch. Hope this helps.
Comment by Little Helper on 2008-10-27 10:40:46 -0500
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”
Comment by Dago on 2009-11-18 10:27:51 -0500
Hi… let me know somthing. Did you run sipp command from the same machine that runs Asterisk?
Comment by Dago on 2009-11-23 10:15:48 -0500
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 firstname.lastname@example.org 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)
Comment by Bocah Ingusan on 2010-05-11 04:11:12 -0500
is SIPp must installed in VoIP server/ asterisk??
how do i setting extension.conf or sip.conf using freepbx?
Comment by Gopal on 2011-01-27 12:32:10 -0500
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.