![](http://www.ctiforum.com/uploadfile/2019/0627/20190627100753931.jpg)
但是,因为SIPp使用过程中,测试人员需要根据不同的场景来编写自己的XML文件,测试人员需要首先学习这些XML语法,所以,通常在测试过程中,编写XML文件耗费很多的精力。今天,我们帮助SIP软交换/媒体服务器开发和测试人员快速了解SIPp的压力测试,笔者推荐一个比较完整全面的网站,这个网站汇集了很多SIP的功能测试场景的XML和其语法。
![](http://www.ctiforum.com/uploadfile/2019/0627/20190627100825744.jpg)
说明:笔者不再这里进一步介绍关于SIPp的安装和使用语法,笔者不再这里介绍如何安装服务器端的应用和其呼叫规则。用户可以安装Asterisk/FreeSWITCH,添加相应的分机进行测试。具体安装文档,网络有很多资料。笔者这里仅分享官方使用场景,命令和其测试项目说明。
测试示例1- OPTIONS
对目的地地址发送5次 OPTIONS 消息-30@192.168.1.211。
sipp 192.168.1.211 -sf OPTIONS.xml -m 5 -s 30
Send OPTIONS message 30 times to 30@192.168.1.211 waiting 200 ms for 200/OK reply each time.
![](http://www.ctiforum.com/uploadfile/2019/0627/20190627100915680.jpg)
sipp 192.168.1.211 -sf OPTIONS_recv_200.xml -m 30 -s 30
- <scenario name="Options">
- <send>
- <![CDATA[
- OPTIONS sip:[service]@[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] Max-Forwards: 70 To: <sip:[service]@[remote_ip]> From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] Call-ID: [call_id] CSeq: 1 OPTIONS Contact: <sip:sipp@[local_ip]:[local_port]> Accept: application/sdp Content-Length: 0
- ]]>
- </send>
- <recv response="200" timeout="200"> </recv>
- </scenario>
测试示例2-REGISTER
通过CVS的配置账号对服务器进行注册 192.168.1.106。用户可以在CVS文件中添加多个文件,通过 -I 选项增加呼叫限制。
命令:
sipp 192.168.1.106 -sf REGISTER_client.xml-inf REGISTER_client.csv -m 1 -l 1 -trace_msg -trace_err
XML配置文件:
- <!--
- Use with CSV file struct like: 3000;192.168.1.106;[authentication username=3000 password=3000];
- (user part of uri, server address, auth tag in each line)
- -->
- <scenario name="register_client">
- <send retrans="500">
- <![CDATA[
- REGISTER sip:[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number] To: <sip:[field0]@[field1]> Call-ID: [call_id] CSeq: [cseq] REGISTER Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 10 Expires: 120 User-Agent: SIPp/Win32 Content-Length: 0
- ]]>
- </send>
- <!-- asterisk -->
- <recv response="100" optional="true"> </recv>
- <recv response="401" auth="true"> </recv>
- <send retrans="500">
- <![CDATA[
- REGISTER sip:[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number] To: <sip:[field0]@[field1]> Call-ID: [call_id] CSeq: [cseq] REGISTER Contact: sip:[field0]@[local_ip]:[local_port] [field2] Max-Forwards: 10 Expires: 120 User-Agent: SIPp/Win32 Content-Length: 0
- ]]>
- </send>
- <!-- asterisk -->
- <recv response="100" optional="true"> </recv>
- <recv response="200"> </recv>
- <!-- response time repartition table (ms) -->
- <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
- <!-- call length repartition table (ms) -->
- <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
- </scenario>
CVS文件:
![](http://www.ctiforum.com/uploadfile/2019/0627/20190627102206959.jpg)
测试示例3- REGISTER + SUBSCRIBE application/dialog-info+xml (BLF)
注册到192.168.1.211地址,同时在CVS文件中的参数支持了dialog-info subscription (RFC4235)订阅。
![](http://www.ctiforum.com/uploadfile/2019/0627/20190627102918450.jpg)
XML配置文件:
- <scenario name="UAC REGISTER + SUBSCRIBE dialog-info">
- <!--
- Use with CSV file struct like: 32;192.168.1.211;[authentication username=32 password=32];21;
- (user part of uri, server address, auth tag, subscribed user in each line)
- -->
- <send retrans="500">
- <![CDATA[
- REGISTER sip:[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number] To: <sip:[field0]@[field1]> Call-ID: [call_id] CSeq: [cseq] REGISTER Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 10 Expires: 120 User-Agent: SIPp/Win32 Content-Length: 0
- ]]>
- </send>
- <!-- asterisk -->
- <recv response="100" optional="true"> </recv>
- <recv response="401" auth="true"> </recv>
- <send retrans="500">
- <![CDATA[
- REGISTER sip:[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number] To: <sip:[field0]@[field1]> Call-ID: [call_id] CSeq: [cseq] REGISTER Contact: sip:[field0]@[local_ip]:[local_port] [field2] Max-Forwards: 10 Expires: 120 User-Agent: SIPp/Win32 Content-Length: 0
- ]]>
- </send>
- <!-- asterisk -->
- <recv response="100" optional="true"> </recv>
- <recv response="200"> </recv>
- <send retrans="500">
- <![CDATA[
- SUBSCRIBE sip:[field3]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: sipp <sip:[field0]@[field1]>;tag=[call_number] To: <sip:[field3]@[field1]:[remote_port]> Call-ID: [call_id] CSeq: [cseq] SUBSCRIBE Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 10 Event: dialog Expires: 120 User-Agent: SIPp/Win32 Accept: application/dialog-info+xml, multipart/related, application/rlmi+xml Content-Length: 0
- ]]>
- </send>
- <recv response="200" rtd="true"> </recv>
- <recv request="NOTIFY" crlf="true"> </recv>
- <send>
- <![CDATA[
- SIP/2.0 200 OK [last_Via:] [last_From:] [last_To:] [last_Call-ID:] [last_CSeq:] Content-Length: 0
- ]]>
- </send>
- <!--
- 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>
CVS文件:
![](http://www.ctiforum.com/uploadfile/2019/0627/20190627102717635.jpg)
测试示例4-REGISTER + INVITE
SIPp 模拟3个UACs, 每个UAC执行呼出流程。对方进行应答,然后进行语音播放(single pjsua instance with 3 accounts)。注意,这里的被呼叫方是PJSUA终端。
![](http://www.ctiforum.com/uploadfile/2019/0627/20190627102621956.jpg)
命令:
pjsua_vc6d --local-port=5068
--id sip:33@192.168.1.211 --registrar sip:192.168.1.211
--proxy sip:192.168.1.211 --realm * --username 33 --password 33
--next-account --id sip:34@192.168.1.211 --registrar sip:192.168.1.211
--proxy sip:192.168.1.211 --realm * --username 34 --password 34
--next-account --id sip:35@192.168.1.211 --registrar sip:192.168.1.211
--proxy sip:192.168.1.211 --realm * --username 35 --password 35
--play-file file.wav --auto-answer 200 --auto-play
配置文件:
- <scenario name="UAC REGISTER + INVITE + call">
- <!--
- Use with CSV file struct like: 32;192.168.1.211;[authentication username=32 password=32];21;
- (user part of uri, server address, auth tag, call target)
- ->
- <send retrans="500">
- <![CDATA[
- REGISTER sip:[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number] To: <sip:[field0]@[field1]> Call-ID: [call_id] CSeq: [cseq] REGISTER Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 10 Expires: 120 User-Agent: SIPp/Win32 Content-Length: 0
- ]]>
- </send>
- <!-- asterisk -->
- <recv response="100" optional="true"> </recv>
- <recv response="401" auth="true"> </recv>
- <send retrans="500">
- <![CDATA[
- REGISTER sip:[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number] To: <sip:[field0]@[field1]> Call-ID: [call_id] CSeq: [cseq] REGISTER Contact: sip:[field0]@[local_ip]:[local_port] [field2] Max-Forwards: 10 Expires: 120 User-Agent: SIPp/Win32 Content-Length: 0
- ]]>
- </send>
- <!-- asterisk -->
- <recv response="100" optional="true"> </recv>
- <recv response="200"> </recv>
- <send retrans="500">
- <![CDATA[
- INVITE sip:[field3]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: sipp <sip:[field0]@[field1]>;tag=[call_number] To: <sip:[field3]@[field1]:[remote_port]> Call-ID: [call_id] CSeq: [cseq] INVITE Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 10 Content-Type: application/sdp Content-Length: [len] v=0 o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] s=- c=IN IP[media_ip_type] [media_ip] t=0 0 m=audio [media_port] RTP/AVP 0 a=rtpmap:0 PCMU/8000
- ]]>
- </send>
- <recv response="100" optional="true"> </recv>
- <recv response="180" optional="true"> </recv>
- <recv response="183" optional="true"> </recv>
- <recv response="200"> </recv>
- <send>
- <![CDATA[
- ACK sip:[field3]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number] [last_To:] Call-ID: [call_id] CSeq: [cseq] ACK Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 10 Content-Length: 0
- ]]>
- </send>
- <pause milliseconds="30000"/>
- <send retrans="500">
- <![CDATA[
- BYE sip:[field3]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number] [last_To:] Call-ID: [call_id] CSeq: [cseq] BYE Contact: sip:sipp@[local_ip]:[local_port] Max-Forwards: 10 Content-Length: 0
- ]]>
- </send>
- <!--
- The 'crlf' option inserts a blank line in the statistics report.
- -->
- <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>
CVS文件:
![](http://www.ctiforum.com/uploadfile/2019/0627/20190627103421138.jpg)
测试示例5-REGISTER + INVITE (2)
1)INVITE以后,首先处理。
2) 使用rrs="true" 和 [routes] 保存 Record-Route header 头。
3) 在ACK和BYE消息中使用 [next_url] 。
命令:
sipp 192.168.1.211 -sf REGISTER_INVITE_client2.xml
-inf REGISTER_INVITE_client.csv -recv_timeout 10000 -m 1 -l 1
XML文件:
- <scenario name="UAC REGISTER + INVITE + call">
- <!--
- Use with CSV file struct like: 32;192.168.1.211;[authentication username=32 password=32];21;
- (user part of uri, server address, auth tag, call target)
- -->
- <send retrans="500">
- <![CDATA[
- REGISTER sip:[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number] To: <sip:[field0]@[field1]> Call-ID: [call_id] CSeq: [cseq] REGISTER Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 100 Expires: 120 User-Agent: SIPp/Win32 Content-Length: 0
- ]]>
- </send>
- <!-- asterisk -->
- <recv response="100" optional="true"> </recv>
- <recv response="401" auth="true"> </recv>
- <send retrans="500">
- <![CDATA[
- REGISTER sip:[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number] To: <sip:[field0]@[field1]> Call-ID: [call_id] CSeq: [cseq] REGISTER Contact: sip:[field0]@[local_ip]:[local_port] [field2] Max-Forwards: 100 Expires: 120 User-Agent: SIPp/Win32 Content-Length: 0
- ]]>
- </send>
- <!-- asterisk -->
- <recv response="100" optional="true"> </recv>
- <recv response="200"> </recv>
- <send retrans="500">
- <![CDATA[
- INVITE sip:[field3]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: sipp <sip:[field0]@[field1]>;tag=[call_number] To: <sip:[field3]@[field1]:[remote_port]> Call-ID: [call_id] CSeq: [cseq] INVITE Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 100 Content-Type: application/sdp Content-Length: [len] v=0 o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] s=- c=IN IP[media_ip_type] [media_ip] t=0 0 m=audio [media_port] RTP/AVP 8 a=rtpmap:8 PCMA/8000
- ]]>
- </send>
- <recv response="100" optional="true"> </recv>
- <recv response="407" auth="true"> </recv>
- <send>
- <![CDATA[
- ACK sip:[field3]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number] [last_To:] Call-ID: [call_id] CSeq: [cseq] ACK Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 100 Content-Length: 0
- ]]>
- </send>
- <send retrans="500">
- <![CDATA[
- INVITE sip:[field3]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: sipp <sip:[field0]@[field1]>;tag=[call_number] To: <sip:[field3]@[field1]:[remote_port]> Call-ID: [call_id] CSeq: [cseq] INVITE Contact: sip:[field0]@[local_ip]:[local_port] [field2] Max-Forwards: 100 Content-Type: application/sdp Content-Length: [len] v=0 o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] s=- c=IN IP[media_ip_type] [media_ip] t=0 0 m=audio [media_port] RTP/AVP 8 a=rtpmap:8 PCMA/8000
- ]]>
- </send>
- <recv response="100" optional="true"> </recv>
- <recv response="180" optional="true"> </recv>
- <recv response="183" optional="true"> </recv>
- <recv response="200" rrs="true"> </recv>
- <send>
- <![CDATA[
- ACK [next_url] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number] [last_To:] [routes] Call-ID: [call_id] CSeq: [cseq] ACK Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 100 Content-Length: 0
- ]]>
- </send>
- <!-- Play a pre-recorded PCAP file (RTP stream) -->
- <nop>
- <action>
- <exec play_pcap_audio="pcap/g711a.pcap"/>
- </action>
- </nop>
- <!--
- Pause 60 seconds, which is less than the duration of the
- -->
- <pause milliseconds="60000"/>
- <send retrans="500">
- <![CDATA[
- BYE [next_url] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number] [last_To:] [routes] Call-ID: [call_id] CSeq: [cseq] BYE Contact: sip:sipp@[local_ip]:[local_port] Max-Forwards: 100 Content-Length: 0
- ]]>
- </send>
- <!--
- The 'crlf' option inserts a blank line in the statistics report.
- -->
- <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>
CVS文件:
![](http://www.ctiforum.com/uploadfile/2019/0627/20190627111004595.jpg)
测试示例6-INVITE + CANCEL immediately after SIP/100
命令:
sipp 192.168.1.211 -sf INVITE_CANCEL.xml -recv_timeout 10000 -m 1 -l 1- <scenario name="UAC INVITE + call">
- <!--
- Use with CSV file struct like: 32;192.168.1.211;[authentication username=32 password=32];21;
- (user part of uri, server address, auth tag, call target)
- -->
- <send retrans="500">
- <![CDATA[
- INVITE sip:[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: "98765432" <sip:32@[local_ip]>;tag=[call_number] To: <sip:[remote_ip]:[remote_port]> Call-ID: [call_id] CSeq: [cseq] INVITE Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 Content-Type: application/sdp Content-Length: [len] v=0 o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] s=- c=IN IP[media_ip_type] [media_ip] t=0 0 m=audio [media_port] RTP/AVP 0 8 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000
- ]]>
- </send>
- <recv response="100">
- <action>
- <ereg regexp=";branch=[^;]*" search_in="hdr" header="Via" check_it="false" assign_to="1"/>
- </action>
- </recv>
- <send retrans="500">
- <![CDATA[
- CANCEL sip:[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port][$1] [last_From:] [last_To:] Call-ID: [call_id] CSeq: [cseq] CANCEL Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 Content-Length: 0
- ]]>
- </send>
- <recv response="200"/>
- <recv response="487"/>
- <send>
- <![CDATA[
- ACK sip:[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port][$1] [last_From:] [last_To:] Call-ID: [call_id] CSeq: [cseq] ACK Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 Content-Length: 0
- ]]>
- </send>
- <pause milliseconds="3000"/>
- <!--
- 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>
命令:
sipp 192.168.1.211 -sf INVITE_SDP_video.xml -recv_timeout 30000 -m 1 -l 1
XML文件:
- <scenario name="UAC INVITE with video SDP + call">
- <send retrans="500">
- <![CDATA[
- INVITE sip:[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: "98765432" <sip:32@[local_ip]>;tag=[call_number] To: <sip:[remote_ip]:[remote_port]> Call-ID: [call_id] CSeq: [cseq] INVITE Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 Content-Type: application/sdp Content-Length: [len] v=0 o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] s=- c=IN IP[media_ip_type] [media_ip] b=AS:352 t=0 0 m=audio [media_port] RTP/AVP 0 8 b=TIAS:64000 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 m=video 40012 RTP/AVP 97 96 c=IN IP4 [media_ip] b=TIAS:128000 a=rtcp:40013 IN IP4 [media_ip] a=sendrecv a=rtpmap:97 H264/90000 a=fmtp:97 profile-level-id=42e01e; packetization-mode=1 a=rtpmap:96 H263-1998/90000 a=fmtp:96 CIF=1;QCIF=1
- ]]>
- </send>
- <recv response="100" optional="true"> </recv>
- <recv response="180" optional="true"> </recv>
- <recv response="183" optional="true"> </recv>
- <recv response="200"> </recv>
- <send>
- <![CDATA[
- ACK sip:[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[local_ip]>;tag=[call_number] [last_To:] Call-ID: [call_id] CSeq: [cseq] ACK Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 Content-Length: 0
- ]]>
- </send>
- <pause milliseconds="30000"/>
- <send retrans="500">
- <![CDATA[
- BYE sip:[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[local_ip]>;tag=[call_number] [last_To:] Call-ID: [call_id] CSeq: [cseq] BYE Contact: sip:sipp@[local_ip]:[local_port] Max-Forwards: 10 Content-Length: 0
- ]]>
- </send>
- <!--
- The 'crlf' option inserts a blank line in the statistics report.
- -->
- <recv response="200" crlf="true"> </recv>
- <pause milliseconds="1500"/>
- <!--
- 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>
但检测到传真音时,第一个终端发送re-INVITE携带T38/image offer。第二个终端拒绝了这个re-INVITE, 并且回复了488/Not Acceptable。但是,呼叫不能挂机。
命令:
sipp 192.168.0.192 -sf INVITE_T38_reINVITE.xml -s 30 -r 1 -l 12 -m 1
XML文件:
- <scenario name="UAC INVITE + call">
- <!--
- sipp 192.168.1.211 -sf invite_T38_reINVITE.xml -s 30 -r 1 -l 12 -m 1
- -->
- <send retrans="500">
- <![CDATA[
- INVITE sip:[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: "98765432" <sip:98765432@[local_ip]>;tag=[call_number] To: <sip:[remote_ip]:[remote_port]> Call-ID: [call_id] CSeq: 1 INVITE Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 Content-Type: application/sdp Content-Length: [len] v=0 o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] s=- c=IN IP[media_ip_type] [media_ip] t=0 0 m=audio [media_port] RTP/AVP 0 8 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000
- ]]>
- </send>
- <recv response="100" optional="true"> </recv>
- <recv response="180" optional="true"> </recv>
- <recv response="183" optional="true"> </recv>
- <recv response="200"> </recv>
- <send>
- <![CDATA[
- ACK sip:[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[local_ip]>;tag=[call_number] [last_To:] Call-ID: [call_id] CSeq: 1 ACK Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 Content-Length: 0
- ]]>
- </send>
- <pause milliseconds="5000"/>
- <send retrans="500">
- <![CDATA[
- INVITE sip:[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: "98765432" <sip:98765432@[local_ip]>;tag=[call_number] To: <sip:[remote_ip]:[remote_port]>[peer_tag_param] Call-ID: [call_id] CSeq: 2 INVITE Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 Content-Type: application/sdp Content-Length: [len] v=0 o=BroadWorks 65527945 2 IN IP4 78.8.190.36 s=- c=IN IP4 78.8.190.36 t=0 0 m=image 27914 udptl t38 a=sendrecv a=T38FaxVersion:0 a=T38MaxBitRate:9600 a=T38FaxRateManagement:transferredTCF a=T38FaxMaxBuffer:1000 a=T38FaxMaxDatagram:200 a=T38FaxUdpEC:t38UDPRedundancy
- ]]>
- </send>
- <recv response="488"> </recv>
- <send>
- <![CDATA[
- ACK sip:[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[local_ip]>;tag=[call_number] [last_To:] Call-ID: [call_id] CSeq: [cseq] ACK Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 Content-Length: 0
- ]]>
- </send>
- <pause milliseconds="5000"/>
- <!--
- <send retrans="500">
- <![CDATA[
- BYE sip:[remote_ip]:[remote_port] SIP/2.0
- Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
- From: <sip:[local_ip]>;tag=[call_number]
- [last_To:]
- Call-ID: [call_id]
- CSeq: [cseq] BYE
- Contact: sip:sipp@[local_ip]:[local_port]
- Max-Forwards: 10
- Content-Length: 0
- ]]>
- </send>
- -->
- <!--
- The 'crlf' option inserts a blank line in the statistics report.
- -->
- <recv response="200" crlf="true"> </recv>
- <pause milliseconds="1500"/>
- <!--
- 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>
测试示例9- REGISTER UAS + SUBSCRIBE application/dialog-info+xml (BLF) UAS
这里要求两个实际的处理流程来模拟此环境。SIPp同时发送注册信息和BLF订阅消息,对方快速回复结束订阅的响应,回复结果携带 reason=noresource。
1) 首先进行注册: 30@your_pc_ip_address,无密码,创建dialog-info+xml subscription支持108@your_pc_ip_address。
2) 然后执行UAS REGISTER scenario ,等待电话登录。
3)使用热键组合打断注册流程Ctrl+C,然后运行UAS SUBSCRIBE 流程。
命令:
sipp -sf uas_register.xmlsipp -sf uas_subscribe.xml
XML配置文件(uas_register):
- <scenario name="UAS REGISTER + SUBSCRIBE/noresource">
- <!--
- 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 request="REGISTER" crlf="true"> </recv>
- <!--
- The '[last_*]' keyword is replaced automatically by the
- -->
- <!--
- specified header if it was present in the last message received
- -->
- <!--
- (except if it was a retransmission). If the header was not
- -->
- <!--
- present or if no message has been received, the '[last_*]'
- -->
- <!--
- keyword is discarded, and all bytes until the end of the line
- -->
- <!-- are also discarded. -->
- <!-- -->
- <!--
- If the specified header was present several times in the
- -->
- <!--
- message, all occurences are concatenated (CRLF seperated)
- -->
- <!-- to be used in place of the '[last_*]' keyword. -->
- <send>
- <![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-Length: 0
- ]]>
- </send>
- </scenario>
- <scenario name="UAS SUBSCRIBE/noresource">
- <recv request="SUBSCRIBE" crlf="true"> </recv>
- <send>
- <![CDATA[
- SIP/2.0 200 OK [last_Via:] [last_Call-ID:] [last_From:] [last_To:];tag=[call_number] [last_CSeq:] Expires: 120 Contact: <sip:30@[local_ip]:[local_port];transport=[transport]> Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, REFER, MESSAGE, OPTIONS Supported: 100rel, norefersub Content-Length: 0
- ]]>
- </send>
- <send>
- <![CDATA[
- NOTIFY sip:30@prima SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] Max-Forwards: 70 From: <sip:108@[local_ip]:[local_port]>;tag=[call_number] To: "30" <sip:30@[local_ip]>;tag=1 Contact: <sip:30@[local_ip]:[local_port];transport=[transport]> [last_Call-ID:] CSeq: 15540 NOTIFY Event: dialog Subscription-State: terminated;reason=noresource Allow-Events: dialog, refer User-Agent: Prima 2.00.00 Content-Length: 0
- ]]>
- </send>
- <recv response="200" rtd="true"> </recv>
- </scenario>
测试示例10-REGISTER UAS 发送 unsolicited MWI NOTIFY 信息
对已注册的终端发送unsolicited message-summary 事件,终端为 (31@192.168.0.228)。MWI是终端经常使用的功能,简单来说,就是对终端发送提示指示,例如有语音影响留言,BLF等。用户可以测试很多品牌的SIP终端话机。
命令:
sipp 192.168.0.228 -s 31
-sf NOTIFY_MWI_unsolicited.xml -m 1 -l 1 -r 1 -rp 1000
XML配置文件:
- <scenario name="Unsolicited NOTIFY with MWI (message-summary Event)">
- <!--
- Respond to registration request. Tested phone seems to do not
- react to NOTIFY sent from other host than registration server
- -->
- <recv request="REGISTER" crlf="true"> </recv>
- <send>
- <![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]> Expires: 120 Content-Length: 0
- ]]>
- </send>
- <!--
- Send unsolicited NOTIFY with MWI info (2 new/8 old messages, 0 new urgent/ 2 old urgent )
- -->
- <send retrans="500">
- <![CDATA[
- NOTIFY sip:[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[service]@[local_ip]>;tag=[call_number] To: <sip:[service]@[local_ip]> Call-ID: [call_id] CSeq: [cseq] NOTIFY Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 Expires: 120 User-Agent: SIPp/Win32 Event: message-summary Subscription-State: active Content-Type: application/simple-message-summary Content-Length: [len] Messages-Waiting: yes Message-Account: sip:[service]@[local_ip] Voice-Message: 2/8 (0/2)
- ]]>
- </send>
- <recv response="200"> </recv>
- <pause milliseconds="10000"/>
- <!-- Send unsolicited NOTIFY with MWI info: no messages -->
- <send retrans="500">
- <![CDATA[
- NOTIFY sip:[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[service]@[local_ip]>;tag=[call_number] To: <sip:[service]@[local_ip]> Call-ID: [call_id] CSeq: [cseq] NOTIFY Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 Expires: 120 User-Agent: SIPp/Win32 Event: message-summary Subscription-State: active Content-Type: application/simple-message-summary Content-Length: [len] Messages-Waiting: no Message-Account: sip:[service]@[local_ip] Voice-Message: 0/0 (0/0)
- ]]>
- </send>
- <recv response="200"> </recv>
- <pause milliseconds="10000"/>
- <!--
- Send unsolicited NOTIFY with MWI info (3 new/9 old messages, 1 new urgent/ 1 old urgent )
- -->
- <send retrans="500">
- <![CDATA[
- NOTIFY sip:[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[service]@[local_ip]>;tag=[call_number] To: <sip:[service]@[local_ip]> Call-ID: [call_id] CSeq: [cseq] NOTIFY Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 Expires: 120 User-Agent: SIPp/Win32 Event: message-summary Subscription-State: active Content-Type: application/simple-message-summary Content-Length: [len] Messages-Waiting: yes Message-Account: sip:[service]@[local_ip] Voice-Message: 3/9 (1/1)
- ]]>
- </send>
- <recv response="200"> </recv>
- <pause milliseconds="10000"/>
- <!-- Send unsolicited NOTIFY with MWI info: no messages -->
- <send retrans="500">
- <![CDATA[
- NOTIFY sip:[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[service]@[local_ip]>;tag=[call_number] To: <sip:[service]@[local_ip]> Call-ID: [call_id] CSeq: [cseq] NOTIFY Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 Expires: 120 User-Agent: SIPp/Win32 Event: message-summary Subscription-State: active Content-Type: application/simple-message-summary Content-Length: [len] Messages-Waiting: no Message-Account: sip:[service]@[local_ip] Voice-Message: 0/0 (0/0)
- ]]>
- </send>
- <recv response="200"> </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>
测试示例11-Unsolicited NOTIFY with Event: talk
发送Unsolicited talk event (如果支持的话,终端可呼叫应答-31@192.168.0.228。
命令:
sipp 192.168.0.228 -s 31
-sf NOTIFY_talk_unsolicited.xml -m 1 -l 1 -r 1 -rp 1000
XML配置文件:
- <!--
- NOTIFY with Event: talk can trigger accepting incoming call on supporting phone
- (e.g. Yealink, Polycom).
- Note: this scenario does not handle authentification.
- -->
- <scenario name="Unsolicited NOTIFY with Event: talk">
- <send retrans="500">
- <![CDATA[
- NOTIFY sip:[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[service]@[local_ip]>;tag=[call_number] To: <sip:[service]@[local_ip]> Call-ID: [call_id] CSeq: [cseq] NOTIFY Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 Expires: 120 User-Agent: SIPp/Win32 Event: talk Subscription-State: terminated Content-Length: [len]
- ]]>
- </send>
- <recv response="200"> </recv>
- </scenario>
测试示例12-Session audit using UPDATE message
终端发送200/OK携带一个SDP offer,但是没有修改会话参数。
命令:
sipp 192.168.0.228
-sf INVITE_UPDATE_session_audit.xml -m 1 -l 1
XML配置:
- <!--
- Testing: device response to UPDATE message with no body
- (aka session audit).
- Usage: sipp-win32 ip_address -sf invite_update.xml -m 1
- -->
- <scenario name="UAC INVITE + call">
- <send retrans="500">
- <![CDATA[
- INVITE sip:[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: "9876" <sip:1234@[local_ip]>;tag=[call_number] To: <sip:[remote_ip]:[remote_port]> Call-ID: [call_id] CSeq: [cseq] INVITE Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 Content-Type: application/sdp Content-Length: [len] v=0 o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] s=- c=IN IP[media_ip_type] [media_ip] t=0 0 m=audio [media_port] RTP/AVP 0 8 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000
- ]]>
- </send>
- <recv response="100" optional="true"> </recv>
- <recv response="180" optional="true"> </recv>
- <recv response="183" optional="true"> </recv>
- <recv response="200"> </recv>
- <send>
- <![CDATA[
- ACK sip:[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[local_ip]>;tag=[call_number] [last_To:] Call-ID: [call_id] CSeq: [cseq] ACK Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 Content-Length: 0
- ]]>
- </send>
- <pause milliseconds="5000"/>
- <send retrans="500">
- <![CDATA[
- UPDATE sip:[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/UDP [local_ip]:[local_port];branch=z9hG4bK1489807744192936848 [last_From:] [last_To:] [last_Call-ID:] CSeq: [cseq] UPDATE Contact: <sip:[local_ip]:[local_port];transport=[transport]> Max-Forwards: 70 User-Agent: SIPp/WinXP Content-Type: application/sdp Content-Length: 0
- ]]>
- </send>
- <recv response="200"> </recv>
- <send retrans="500">
- <![CDATA[
- BYE sip:[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[local_ip]>;tag=[call_number] [last_To:] Call-ID: [call_id] CSeq: [cseq] BYE Contact: sip:sipp@[local_ip]:[local_port] Max-Forwards: 10 Content-Length: 0
- ]]>
- </send>
- <!--
- The 'crlf' option inserts a blank line in the statistics report.
- -->
- <recv response="200" crlf="true"> </recv>
- <pause milliseconds="1500"/>
- <!--
- 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>
测试示例13-REGISTER UAC + INVITE + DTMF INFO
1) SIP 注册和认证。
2) 呼叫110. 这里的测试110是一个FXS分机,然后通过FXS再呼叫到FXO端口,呼叫通过DISA应答。这种方式可以通过Asterisk加语音板卡(FXS/FXO实现)。
3) 呼叫其他的3位数号码,使用的是SIP INFO DTMF (Content-Type: application/dtmf-relay in this scenario)。呼叫没有被应答。
4) 挂机流程。
注意,"application/dtmf" Content-Type 的DTMF“*”解析为10,#解析为11.
命令:
sipp 192.168.1.211 -sf REGC_INVITE_INFO.xml
-inf REGC_INVITE_INFO.csv -m 5 -l 1 -r 1 -rp 10000
XML配置文件:
- <scenario name="UAC REGISTER + INVITE + INFO">
- <!--
- Use with CSV file struct like: 32;192.168.1.211;[authentication username=32 password=32];21;1;0;9
- (user part of uri, server address, auth tag, call target | dtmf digit1, digit2, digit3).
- In my test call target is actually FXS routed back to FXO that picks calls
- automatically and switches them to DISA. Caller dials then another subscriber
- number using SIP INFO messages.
- -->
- <send retrans="500">
- <![CDATA[
- REGISTER sip:[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number] To: <sip:[field0]@[field1]> Call-ID: [call_id] CSeq: [cseq] REGISTER Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 10 Expires: 120 User-Agent: SIPp/Win32 Content-Length: 0
- ]]>
- </send>
- <!-- asterisk -->
- <recv response="100" optional="true"> </recv>
- <recv response="401" auth="true"> </recv>
- <send retrans="500">
- <![CDATA[
- REGISTER sip:[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number] To: <sip:[field0]@[field1]> Call-ID: [call_id] CSeq: [cseq] REGISTER Contact: sip:[field0]@[local_ip]:[local_port] [field2] Max-Forwards: 10 Expires: 120 User-Agent: SIPp/Win32 Content-Length: 0
- ]]>
- </send>
- <!-- asterisk -->
- <recv response="100" optional="true"> </recv>
- <recv response="200"> </recv>
- <send retrans="500">
- <![CDATA[
- INVITE sip:[field3]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: sipp <sip:[field0]@[field1]>;tag=[call_number] To: <sip:[field3]@[field1]:[remote_port]> Call-ID: [call_id] CSeq: [cseq] INVITE Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 10 Content-Type: application/sdp Content-Length: [len] v=0 o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] s=- c=IN IP[media_ip_type] [media_ip] t=0 0 m=audio [media_port] RTP/AVP 0 a=rtpmap:0 PCMU/8000
- ]]>
- </send>
- <recv response="100" optional="true"> </recv>
- <recv response="180" optional="true"> </recv>
- <recv response="183" optional="true"> </recv>
- <recv response="200"> </recv>
- <send>
- <![CDATA[
- ACK sip:[field3]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number] [last_To:] Call-ID: [call_id] CSeq: [cseq] ACK Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 10 Content-Length: 0
- ]]>
- </send>
- <!-- "Listening to DISA announcement" -->
- <!-- <pause milliseconds="3000" /> -->
- <pause distribution="uniform" min="1000" max="10000"/>
- <!-- Dial first digit -->
- <send retrans="500">
- <![CDATA[
- INFO sip:[remote_ip]:[remote_port];[transport] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: sipp <sip:[field0]@[field1]>;tag=[call_number] [last_To:] Call-ID: [call_id] CSeq: [cseq] INFO Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 10 Content-Type: application/dtmf-relay Content-Length: [len] Signal=[field4] Duration=300
- ]]>
- </send>
- <recv response="200"> </recv>
- <!-- Dial second digit -->
- <send retrans="500">
- <![CDATA[
- INFO sip:[remote_ip]:[remote_port];[transport] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: sipp <sip:[field0]@[field1]>;tag=[call_number] [last_To:] Call-ID: [call_id] CSeq: [cseq] INFO Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 10 Content-Type: application/dtmf-relay Content-Length: [len] Signal=[field5] Duration=300
- ]]>
- </send>
- <recv response="200"> </recv>
- <!-- Dial third digit -->
- <send retrans="500">
- <![CDATA[
- INFO sip:[remote_ip]:[remote_port];[transport] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: sipp <sip:[field0]@[field1]>;tag=[call_number] [last_To:] Call-ID: [call_id] CSeq: [cseq] INFO Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 10 Content-Type: application/dtmf-relay Content-Length: [len] Signal=[field6] Duration=300
- ]]>
- </send>
- <recv response="200"> </recv>
- <!-- Number dialed, wait for a moment -->
- <pause distribution="uniform" min="1000" max="8000"/>
- <send retrans="500">
- <![CDATA[
- BYE sip:[field3]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number] [last_To:] Call-ID: [call_id] CSeq: [cseq] BYE Contact: sip:sipp@[local_ip]:[local_port] Max-Forwards: 10 Content-Length: 0
- ]]>
- </send>
- <!--
- The 'crlf' option inserts a blank line in the statistics report.
- -->
- <recv response="200" crlf="true"> </recv>
- <!--
- The purpose of this pause is to give some time for FXO/FXS lines to
- detect disconnection.
- -->
- <pause milliseconds="5000"/>
- <!--
- 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>
CVS配置文件:
![](http://www.ctiforum.com/uploadfile/2019/0627/20190627013632457.jpg)
测试示例14- SIP digest 漏洞测试
通过此命令检测IPPBX分机号码的漏洞。
命令:
sipp 192.168.1.211 -sf uac_digest_leak.xml -s 30 -m 1
XML配置:
- his XML file does not appear to have any style information associated with it. The document tree is shown below.
- <!-- SIP digest leak test scenario -->
- <!--
- Note: realm at WWW-Authenticate may have to be changed if phone realm configuration is not empty
- -->
- <!--
- (empty realm at phone configuration = auth against any realm)
- -->
- <!-- http://tomeko.net -->
- <scenario name="SIP digest leak test">
- <!--
- 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:[service]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] To: sut <sip:[service]@[remote_ip]:[remote_port]> Call-ID: [call_id] CSeq: 1 INVITE Contact: sip:sipp@[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[media_ip_type] [media_ip] t=0 0 m=audio [media_port] RTP/AVP 0 a=rtpmap:0 PCMU/8000
- ]]>
- </send>
- <recv response="100" optional="true"> </recv>
- <recv response="180" 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:[service]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] Call-ID: [call_id] CSeq: 1 ACK Contact: sip:sipp@[local_ip]:[local_port] Max-Forwards: 70 Subject: Performance Test Content-Length: 0
- ]]>
- </send>
- <!--
- At this moment second party is hanging up call (no audio there)
- -->
- <recv request="BYE"/>
- <!--
- Test with SIP hardware phone: must use WWW-Authenticate instead of Proxy-Authenticate.
- You could also try with SIP/2.0 401 Unauthorized.
- -->
- <send>
- <![CDATA[
- SIP/2.0 407 Proxy Authentication Required [last_Via:] [last_From:] [last_To:] [last_Call-ID:] [last_CSeq:] WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="69d327e5" Content-Length: 0
- ]]>
- </send>
- <recv request="BYE"/>
- </scenario>
测试示例15-生成带G.729 编码的呼叫
在很多呼叫中心的呼叫过程中,为了节省带宽资源,很多运营商可能提供带G.729的编码。
这里,我们可以通过SIPp测试携带G.729编码的呼叫。
当然,用户需要使用此默认配置文件 SIPp. Here is .pcap file,此配置文件携带了
2分钟的语音流支持了G.729 编码。配置时需要保存到默认路径。
命令:
sipp 192.168.1.211 -sf uac_pcap_G729.xml -l 1 -m 10
XML配置:
- <!--
- 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
- -->
- <!-- -->
- <!-- Sipp 'uac' scenario with pcap (rtp) play -->
- <!-- -->
- <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:[service]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] To: sut <sip:[service]@[remote_ip]:[remote_port]> Call-ID: [call_id] CSeq: 1 INVITE Contact: sip:sipp@[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 18 101 a=rtpmap:18 G729/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-11,16
- ]]>
- </send>
- <recv response="100" optional="true"> </recv>
- <recv response="180" 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:[service]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] Call-ID: [call_id] CSeq: 1 ACK Contact: sip:sipp@[local_ip]:[local_port] Max-Forwards: 70 Subject: Performance Test Content-Length: 0
- ]]>
- </send>
- <!-- Play a pre-recorded PCAP file (RTP stream) -->
- <nop>
- <action>
- <exec play_pcap_audio="pcap/g729.pcap"/> // 文件存放地址
- </action>
- </nop>
- <!--
- Pause 60 seconds, which is less than the duration of the
- -->
- <!-- PCAP file -->
- <pause milliseconds="60000"/>
- <!-- Play an out of band DTMF '1' -->
- <nop>
- <action>
- <exec play_pcap_audio="pcap/dtmf_2833_1.pcap"/>
- </action>
- </nop>
- <pause milliseconds="1000"/>
- <!--
- The 'crlf' option inserts a blank line in the statistics report.
- -->
- <send retrans="500">
- <![CDATA[
- BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] Call-ID: [call_id] CSeq: 2 BYE Contact: sip:sipp@[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>
测试示例16-视频呼叫支持的RTP (H.264)
命令:
sipp 127.0.0.1 -sf uac_pcap_H264.xml -l 1 -m 1
XML配置文件:
H264配置文件
http://tomeko.net/other/sipp/scenarios/uac_pcap_H264.xml
测试示例17-Blind transfer 电话盲转
![](http://www.ctiforum.com/uploadfile/2019/0627/20190627014209162.jpg)
注册分机,进行呼叫,然后执行电话盲转。
命令:
sipp 192.168.1.211 -sf REGISTER_INVITE_REFER.xml
-inf REGISTER_INVITE_REFER.csv -m 1 -l 1 -r 1 -rp 10000
XML配置文件:
配置文件
http://tomeko.net/other/sipp/scenarios/REGISTER_INVITE_REFER.xml
测试示例18-UAS with T38 reinvite
检测到传真音时,模拟UAS发送re-INVITE,携带image/t38。涉及测试需要根据官方文档
做进一步配置说明。
命令:
sipp -sf uas_T38_reinvite.xml
XML配置文件:
配置文件
http://tomeko.net/other/sipp/scenarios/uas_T38_reinvite.xml
模拟测试的话: 需要配置rtp_pcma_fax_cng.pcap -这是一个CNG 录音文件来检测CNG detection。
测试示例19-Sipsak 命令重新启动yealink 话机
用户首先需要下载Sipsak工具,配置执行文件,通过Sipsak对yealink 话机发送自定义的消息(NOTIFY Event: check-sync;reboot=true
重新启动Yealink话机。
命令:
sipsak -f reboot_yealink.sipfile -s sip:1234@192.168.0.195
配置文件:
配置文件
http://tomeko.net/other/sipp/sipsak/reboot_yealink.sipfile
总结:
以上19个SIPp测试示例是第三方测试人员的测试文档,笔者在前几年仅测试过几个示例,基本上都
可以工作。需要强调的是,用户需要安装自己的IPPBX,软交换或者其他媒体服务器,
并且需要有针对性的配置。然后根据XML配置文件和预设的默认支持文件来实现测试。
笔者仅是共享此文档,如果测试人员需要进一步获取完整的测试XML文件,到参考链接的官方获取。
参考资料:
http://tomeko.net/other/sipp/sipp_cheatsheet.php?lang=en
![](http://www.ctiforum.com/uploadfile/2019/0304/20190304034102652.jpg)
![](http://www.ctiforum.com/uploadfile/2019/0621/20190621050132251.jpg)
FreeSBC/ProSBC 免费边界会话控制器, 下载ISO:https://freesbc.telcobridges.com/
关注微信公众号:asterisk-cn,获得有价值的Asterisk行业分享
Asterisk freepbx 中文官方论坛:http://bbs.freepbx.cn/forum.php
Asterisk freepbx技术文档: www.freepbx.org.cn
融合通信商业解决方案,协同解决方案首选产品:www.hiastar.com
Asterisk/FreePBX中国合作伙伴,官方qq技术分享群(3000千人):589995817
Asterisk freepbx 中文官方论坛:http://bbs.freepbx.cn/forum.php
Asterisk freepbx技术文档: www.freepbx.org.cn
融合通信商业解决方案,协同解决方案首选产品:www.hiastar.com
Asterisk/FreePBX中国合作伙伴,官方qq技术分享群(3000千人):589995817