在安装sipp之后,把自己写的xml文件及其相应的csv文件与sipp这个可执行文件放在一起,运行如下命令即可:
./sipp -sf test.xml -inf test.csv -p 6077 -i <local-ip> -m 4 <ip address of registrar>:5060
-sf 读取场景文件
-inf 读取csv文件
-p 本机采用端口
-i 本机IP
-m 要进行压力测试的次数
Ip address of registrar 要进行压力测试的IP地址
xml文件其实描述了一个测试环境,其实最详细的还是sipp官网上的文档
http://sipp.sourceforge.net/doc3.0/reference.html
1.关于xml文件
下面放两个网上找的xml文件的例子,出处不明,原创不知:
例1:
模拟若干个注册包到AST,AST回 407 authentication,SIPp发送invite带auth验证消息到AST,AST回100 tring 和200 ok。SIPp回Bye消息,AST回200 ok。
Register----------->AST
401<----------------AST
Register----------->AST
100<----------------AST
200<----------------AST
编写该SIP得发包流程得场景xml文件内容如下
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">
<!-- This program is free software; you can redistribute it and/or -->
<!-- modify it under the terms of the GNU General Public License as -->
<!-- published by the Free Software Foundation; either version 2 of the -->
<!-- License, or (at your option) any later version. -->
<!-- -->
<!-- This program is distributed in the hope that it will be useful, -->
<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
<!-- GNU General Public License for more details. -->
<!-- -->
<!-- You should have received a copy of the GNU General Public License -->
<!-- along with this program; if not, write to the -->
<!-- Free Software Foundation, Inc., -->
<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->
<!--