撰写了基于SIP的meeting压力测试脚本。可以实现同时50个人同时进入meeting,然后说话,12秒后同时退出聊天室,系统等待8秒,再次重复50个人进入会议室,可以实现对meeting的压力测试。
压力测试流程图如下:
invite--------------->meeting
407<------------------meeting
invite with auth----->meeting
100<------------------meeting
user PIN<-------------meeting RTP
DTMF 1 and #---------->meeting RTP
RTP------------------->meeting
pause 18 sec
Bye------------------->meeting
200 ok<----------------meeting
xml文档如下:
INVITE sip:[field1]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: [field0] ;tag=[call_number]
To: [field1]
Call-ID: [call_id]
CSeq: 1 INVITE
Contact: sip:[field0]@[local_ip]:[local_port]
Max-Forwards: 70
Subject: Performance Test
Content-Type: application/sdp
Content-Length: [len]
v=0
o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
s=-
c=IN IP[local_ip_type] [local_ip]
t=0 0
m=audio [auto_media_port] RTP/AVP 8
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-11,16
]]>
ACK sip:[field1]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: [field0] ;tag=[call_number]
To: [field1] [peer_tag_param]
Call-ID: [call_id]
CSeq: 1 ACK
Contact: sip:[field0]@[local_ip]:[local_port]
Max-Forwards: 70
Subject: Performance Test
Content-Length: 0
]]>
INVITE sip:[field1]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port]
From: [field0] ;tag=[call_number]
To: [field1]
Call-ID: [call_id]
CSeq: 2 INVITE
Contact: sip:[field0]@[local_ip]:[local_port]
[field2]
Max-Forwards: 70
Subject: Performance Test
Content-Type: application/sdp
Content-Length: [len]
v=0
o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
s=-
t=0 0
c=IN IP[media_ip_type] [media_ip]
m=audio [auto_media_port] RTP/AVP 0
a=rtpmap:0 PCMU/8000
]]>
BYE sip:[field1]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: [field0] ;tag=[call_number]
To: [field1] [peer_tag_param]
Call-ID: [call_id]
CSeq: 2 BYE
Contact: sip:[field0]@[local_ip]:[local_port]
Max-Forwards: 70
Subject: Performance Test
Content-Length: 0
]]>
测试csv批量文件如下:
3001;904;[authentication username=3001 password=3001]
3002;904;[authentication username=3002 password=3002]
3003;904;[authentication username=3003 password=3003]
3004;904;[authentication username=3004 password=3004]
3005;904;[authentication username=3005 password=3005]
3006;904;[authentication username=3006 password=3006]
3007;904;[authentication username=3007 password=3007]
3008;904;[authentication username=3008 password=3008]
3009;904;[authentication username=3009 password=3009]
3010;904;[authentication username=3010 password=3010]
3011;904;[authentication username=3011 password=3011]
3012;904;[authentication username=3012 password=3012]
3013;904;[authentication username=3013 password=3013]
3014;904;[authentication username=3014 password=3014]
3015;904;[authentication username=3015 password=3015]
3016;904;[authentication username=3016 password=3016]
3017;904;[authentication username=3017 password=3017]
3018;904;[authentication username=3018 password=3018]
3019;904;[authentication username=3019 password=3019]
3020;904;[authentication username=3020 password=3020]
注意:这里的904号码为meeting接入号。这里我只写了20个,当然您可以写50,100都没关系。
测试方法与步骤:
(1):首先采用eyebeam呼入904号码,进入后根据密码PIN输入1#,进入会议室,然后听背景音乐
(2):采用sipp压力呼入904号码
./sipp -sf meeting.cml -sf meeting.csv -p 6718 -i 192.168.0.254 -m 100000 192.168.0.254 -l 50
(3):此时会听到一批号码登入会议室,然后可以听到一人说话,因为meeting的会议声音是采用叠加技术的,所以会出现很大的回声,之后陆续用户exit,完全退出后会继续听到音乐,因为只有你一个人在会议室了,这说明人已经全部走光了。然后会重复之前的动作
(4):注意 192.168.0.254是发起者呼叫机;192.168.0.194是被测试机。SIpp必须安装在254服务器上才能发起呼叫,另外我这里所指的meeting是指asterisk的conference功能,所以如果有其他软交换要测试会议的话,只需要稍微修改xml文件即可。
阅读(6214) | 评论(4) | 转发(1) |
给主人留下些什么吧!~~
andrewpoon2008-08-26 09:39:34
有没有办法让SIPP产生播放不同的PCAP格式文件的CALL呢?
chinaunix网友2008-05-05 12:47:19
谢谢 非常好