Using sipp to stress test your asterisk 1.4 pbx system

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:

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! :)

你可能感兴趣的:(command,Integer,extension,Comments,output,Sockets)