本文主要是介绍sipp单机压测freeswitch第4篇压测点对点呼叫,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
SIPp压测点对点呼叫,主要是使用官方提供的g711a.pcap模拟语音发起,在呼叫成功后Freeswitch播放一个音频文件可以是wav,SIPp后续开启Rtp回显功能,模拟双方相互发言
audioCall脚本xml
脚本大概意思是:发起成功后执行5分钟后自己挂断
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd"><scenario name="Loop Audio 10"><send retrans="500"><![CDATA[INVITE sip:00001234@[remote_ip]:[remote_port] SIP/2.0Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]From: <sip:[field0]@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]To: <sip:00001234@[remote_ip]:[remote_port]>Call-ID: [call_id]CSeq: 1 INVITEContact: sip:[field0]@[local_ip]:[local_port]Max-Forwards: 70Subject: Performance TestContent-Type: application/sdpContent-Length: [len]v=0o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]s=-c=IN IP[media_ip_type] [media_ip]t=0 0m=audio [media_port] RTP/AVP 0a=rtpmap:0 PCMU/8000]]></send><recv response="100"optional="true"></recv><recv response="180" optional="true"></recv><recv response="183" optional="true"></recv><!-- By adding rrs="true" (Record Route Sets), the route sets --><!-- are saved and used for following messages sent. Useful to test --><!-- against stateful SIP proxies/B2BUAs. --><recv response="200" rtd="true"></recv><!-- Packet lost can be simulated in any send/recv message by --><!-- by adding the 'lost = "10"'. Value can be [1-100] percent. --><send><![CDATA[ACK sip:00001234@[remote_ip]:[remote_port] SIP/2.0Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]From: <sip:[field0]@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]To: <sip:00001234@[remote_ip]:[remote_port]>[peer_tag_param]Call-ID: [call_id]CSeq: 1 ACKContact: sip:[field0]@[local_ip]:[local_port]Max-Forwards: 70Subject: Performance TestContent-Length: 0]]></send><!-- 最好Freeswitch设置播放视频,SIPp回显,注释掉这段代码 --> <!--<nop><action><exec play_pcap_audio="/root/sip_test/pcap/g711a.pcap"/></action></nop>
--><pause milliseconds="300000"/><send retrans="500"><![CDATA[BYE sip:00001234@[remote_ip]:[remote_port] SIP/2.0Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]From: <sip:[field0]@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]To: <sip:00001234@[remote_ip]:[remote_port]>[peer_tag_param]Call-ID: [call_id]CSeq: 2 BYEContact: sip:[field0]@[local_ip]:[local_port]Max-Forwards: 70Subject: Performance TestContent-Length: 0]]></send><recv response="200" crlf="true"></recv><!-- 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>
账号csv
SEQUENTIAL
yyh0001;[authentication username=yyh0001 password=123456]
yyh0002;[authentication username=yyh0002 password=123456]
压测指令解析
# -t tn: 每个呼叫是一个tcp(建议开启,这样模拟起来相对真实)
# -rtp_echo: 启用 RTP 回显
# -r 20 -rp 1000: 每秒注册20个账号
# -m 5000: 注册到达5000后停止脚本
# -trace_msg: 开启后打印所有过程中的消息(如果有错误建议开启,只能看到交互的消息,无法看到rtp传输)
# -trace_screen: 结束后吧结果打印到屏幕上
# -trace_err: 开启后打印错误消息
# remote_ip: 被压测Fs地址
# remote_port: 被压测Fs端口
sipp [remote_ip]:[remote_port] -inf [csv] -sf [xml] -m [Number] -r [Number] -rp [Number] -t tn -rtp_echo -trace_screen -trace_err
使用
# 使用account.csv,按照每秒20个并发发起呼叫,呼叫执行40次
sipp 102.95.28:5060 -inf account.csv -sf audioCall.xml -m 40 -r 20 -rp 1000 -t tn -rtp_echo -trace_screen -trace_err
这篇关于sipp单机压测freeswitch第4篇压测点对点呼叫的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!