加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
sipp_uac_invite-401-invite.xml 6.51 KB
一键复制 编辑 原始数据 按行查看 历史
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">
<!-- 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 scenario for INVITE -> 401Unauthorized -> INVITE call flow:
INVITE - - - - - >
401 < - - - - -
ACK - - - - - >
INVITE - - - - - >
100 < - - - - -
180 < - - - - -
200 < - - - - -
ACK - - - - - >
Pause [ __._s]
BYE - - - - - >
200 < - - - - -
-->
<scenario name="invite-401-invite">
<!-- We just want to use seconds since Epoch as an SDP <session id> -->
<!-- and microseconds' part as an SDP <version> in "o=" field. -->
<nop>
<action>
<gettimeofday assign_to="secs,usecs" />
<assignstr assign_to="secs_str" value="[$secs]" />
<assignstr assign_to="usecs_str" value="[$usecs]" />
<ereg regexp="([0-9]+)\." search_in="var" variable="secs_str" check_it="true" assign_to="dummy,secs_int"/>
<ereg regexp="([0-9]+)\." search_in="var" variable="usecs_str" check_it="true" assign_to="dummy,usecs_int"/>
</action>
</nop>
<!-- Send the first INVITE (with no SDP, it will be rejected anyway) -->
<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: "[field0]" <sip:[field0]@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
To: "[service]" <sip:[service]@[remote_ip]:[remote_port]>
Call-ID: [call_id]
CSeq: [cseq] INVITE
Contact: sip:[field0]@[local_ip]:[local_port]
Max-Forwards: 70
Subject: Performance Test
Content-Type: application/sdp
Content-Length: 0
]]>
</send>
<!-- We should receive "401 Unauthorized" -->
<recv response="401" auth="true">
</recv>
<!-- Send ACK back -->
<send>
<![CDATA[
ACK sip:[service]@[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=[pid]SIPpTag00[call_number]
To: "[service]" <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
Call-ID: [call_id]
CSeq: [cseq] ACK
Contact: sip:[field0]@[local_ip]:[local_port]
Max-Forwards: 70
Subject: Performance Test
Content-Length: 0
]]>
</send>
<!-- Send the next INVITE, with SDP -->
<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: "[field0]" <sip:[field0]@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
To: "[service]" <sip:[service]@[remote_ip]:[remote_port]>
Call-ID: [call_id]
CSeq: [cseq] INVITE
Contact: sip:[field0]@[local_ip]:[local_port]
[field2]
Max-Forwards: 70
Subject: Performance Test
Content-Type: application/sdp
Content-Length: [len]
v=0
s=Performance Test Stream [call_number]
o=[field0] [$secs_int] [$usecs_int] IN IP[local_ip_type] [local_ip]
c=IN IP[media_ip_type] [media_ip]
t=0 0
m=audio [media_port] RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=sendrecv
a=ptime:40
]]>
</send>
<!-- We may get "Trying" -->
<recv response="100" optional="true">
</recv>
<!-- We may get "Ringing" -->
<recv response="180" optional="true">
</recv>
<!-- We should get "OK" -->
<recv response="200">
</recv>
<!-- Send ACK back -->
<send>
<![CDATA[
ACK sip:[service]@[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=[pid]SIPpTag00[call_number]
To: "[service]" <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
Call-ID: [call_id]
CSeq: [cseq] ACK
Contact: sip:[field0]@[local_ip]:[local_port]
Max-Forwards: 70
Subject: Performance Test
Content-Length: 0
]]>
</send>
<!-- This "pause" can be adusted with -d <milliseconds> in command line -->
<pause/>
<!-- Send goodBYE -->
<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: "[field0]" <sip:[field0]@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
To: "[service]" <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
Call-ID: [call_id]
CSeq: [cseq] BYE
Contact: sip:[field0]@[local_ip]:[local_port]
Max-Forwards: 70
Subject: Performance Test
Content-Length: 0
]]>
</send>
<!-- We should get "OK" -->
<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"/>
<Reference variables="dummy">
</scenario>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化