Using sipp to stress test your asterisk 1.4 pbx system

本文介绍如何使用SIPp工具进行Asterisk PBX系统的集成测试,包括配置文件设置、运行测试脚本及查看结果等步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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:
All Graphs during the tests

The Sip Channel Zoomed In:

Closeup of the SIP channels

And that's it. Let me know if you have any questions or comments, oddly enough, in the comments section! :)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值