码迷,mamicode.com
首页 > 其他好文 > 详细

SIPP常用脚本之register注册(一)

时间:2017-08-14 23:47:08      阅读:502      评论:0      收藏:0      [点我收藏+]

标签:log   bin   time   sof   tran   文件   tab   gnu   seq   

SIPP,VOIP并发测试、性能测试的神器。

本文记录一下常用的脚本文件。

一、reg.xml

此文件是sipp的执行的脚本流程。

<!-- -->
<!-- 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 -->
<!-- -->
<!-- Sipp default branchc scenario. -->
<!-- -->
<scenario name="branch_client">
<send retrans="500">
<![CDATA[
REGISTER sip:[remote_ip] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: [field0] <sip:[field0]@[remote_ip]:[remote_port]>;tag=[call_number]
To: [field0] <sip:[field0]@[remote_ip]:[remote_port]>
Call-ID: [call_id]
CSeq: 1 REGISTER
Contact: sip:[field0]@[local_ip]:[local_port]
Content-Length: 0
Expires: 3600
]]>
</send>


<recv response="401" auth="true" next="1">
</recv>

<!-- send invite with authentication messages -->
<label id="1"/>
<send retrans="500">
<![CDATA[
REGISTER sip:[field0]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port]
From: [field0] <sip:[field0]@[remote_ip]:[remote_port]>;tag=[call_number]
To: [field0] <sip:[field0]@[remote_ip]:[remote_port]>
Call-ID: [call_id]
CSeq: 2 REGISTER
Contact: sip:[field0]@[local_ip]:[local_port]
[field1]
Content-Length: [len]
Expires: 3600
]]>
</send>

<recv response="200" >
</recv>
<pause milliseconds="1000"/>

<!-- definition of the response time repartition table (unit is ms) -->
<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
<!-- definition of the call length repartition table (unit is ms) -->
<CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
</scenario>

 

二、reg.csv

此文件是模拟注册的号码信息文件。

SEQUENTIAL
1001;[authentication username=1001 password=1234]
1002;[authentication username=1002 password=1234]
1003;[authentication username=1003 password=1234]
1004;[authentication username=1004 password=1234]
1005;[authentication username=1005 password=1234]
1006;[authentication username=1006 password=1234]
1007;[authentication username=1007 password=1234]
1008;[authentication username=1008 password=1234]
1009;[authentication username=1009 password=1234]
1010;[authentication username=1010 password=1234]
1011;[authentication username=1011 password=1234]
1012;[authentication username=1012 password=1234]
1013;[authentication username=1013 password=1234]
1014;[authentication username=1014 password=1234]
1015;[authentication username=1015 password=1234]
1016;[authentication username=1016 password=1234]
1017;[authentication username=1017 password=1234]
1018;[authentication username=1018 password=1234]
1019;[authentication username=1019 password=1234]
1020;[authentication username=1020 password=1234]

 

三、reg.sh

这是linux下的执行sipp的脚本文件。

./sipp -i 本地服务器地址 -sf reg.xml -inf reg.csv 注册服务器地址:端口 -l 10 -trace_msg -trace_screen -trace_err -p 本地服务器端口 -m 10 -aa

 

附、批量注册信息文件生成脚本

reg.csv的生成脚本
#!/bin/bash
i=1000
while [ $i != 1020 ]
do
i=$(($i+1))
#echo “SEQUENTIAL” >test.csv
echo "$i;[authentication username=$i password=1234]" >>reg.csv
done

 

SIPP常用脚本之register注册(一)

标签:log   bin   time   sof   tran   文件   tab   gnu   seq   

原文地址:http://www.cnblogs.com/yoyotl/p/7359430.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!