根据之前写的一篇微博关于sipp压测fresswitch之账号注册的后续
在用户注册完成后,此时uac和uas都有了自己账号,流程类似(uac是小明)(uas是小红),现在小明给小红拨打电话需要进行几个步骤
大概流程是这样,现在需要两个脚本(呼叫+接听)和两个csv文件(呼叫手机号+接听手机号)
例如:1000—2000是呼叫手机号,3000—4000是接听手机号,那么就是1000呼叫3000这么对应着来。
用上之前注册的csv对应上就可以了
uac.csv
SEQUENTIAL
1000;3000;[authentication username=1000 password=1000]
1001;3001;[authentication username=1001 password=1001]
1002;3002;[authentication username=1002 password=1002]
1003;3003;[authentication username=1003 password=1003]
uas.csv
SEQUENTIAL
3000;3000;[authentication username=3000 password=3000]
3001;3001;[authentication username=3001 password=3001]
3002;3002;[authentication username=3002 password=3002]
3003;3003;[authentication username=3003 password=3003]
呼叫call_uac.xml
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">
<scenario name="UAC with media">
<!-- In client mode (sipp placing calls), the Call-ID MUST be -->
<!-- generated by sipp. To do so, use [call_id] keyword. -->
<send retrans="500">
<![CDATA[
INVITE sip:[field1]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];received=192.168.149.47:7160;branch=[branch]
From: [field0] <sip:[field0]@[local_ip]:[local_port]>;tag=[call_number]
To: [field1] <sip:[field1]@[remote_ip]:[remote_port]>
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=FreeSWITCH 1574118064 1574118065 IN IP4 47.100.53.252
s=FreeSWITCH
c=IN IP4 47.100.53.252
t=0 0
m=audio 24714 RTP/AVP 18 101
7a=rtpmap:18 G729/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv
]]>
</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" crlf="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:[field1]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: [field0] <sip:[field0]@[local_ip]:[local_port]>;tag=[call_number]
To: [field1] <sip:[field1]@[remote_ip]:[remote_port]>[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
]]>
</send>
<!-- pause milliseconds="10000"/ -- >
<!-- The 'crlf' option inserts a blank line in the statistics report. -->
<pause milliseconds="60000"/>
<send retrans="500">
<![CDATA[
BYE sip:[field1]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: [field0] <sip:[field0]@[local_ip]:[local_port]>;tag=[call_number]
To: [field1] <sip:[field1]@[remote_ip]:[remote_port]>[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
]]>
</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>
接听:call_uas.xml
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">
<scenario name="Basic UAS responder">
<recv request="INVITE" crlf="true">
</recv>
<send>
<![CDATA[
SIP/2.0 180 Ringing
[last_Via:]
[last_From:]
[last_To:];tag=[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Length: 0
]]>
</send>
<send retrans="500">
<![CDATA[
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:];tag=[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Type: application/sdp
Content-Length: [len]
v=0
o=FreeSWITCH 1574118064 1574118065 IN IP4 47.100.53.252
s=FreeSWITCH
c=IN IP4 47.100.53.252
t=0 0
m=audio 24714 RTP/AVP 18 101
7a=rtpmap:18 G729/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv
]]>
</send>
<recv request="ACK" optional="true" rtd="true" crlf="true">
</recv>
<recv request="BYE">
</recv>
<send>
<![CDATA[
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Length: 0
]]>
</send>
<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
<CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
</scenario>
先启动uas
命令行:uas
sipp -sf call_uas.xml -inf uas_reg.csv 192.168.149**** -m 100000 -i 192.168.149.**** -aa -l 400
命令行:uac
sipp -sf call_uac.xml -inf uac_reg.csv 192.168.149.**** -m 100000 -i 192.168.149.**** -aa -l 400
前面的ip是fresswitch所在ip,后面-i的是本机sipp所在ip
注:如有错误不足地方还请指点修改。
2020/3/27