Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pjsip/rest_api: Introduce a test for ChannelTransfer event #77

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[default]

exten => s,1,NoOp()
same => n,Answer()
same => n,Stasis(testsuite)
same => n,Hangup()

exten => 1000,1,Answer
same => n,Stasis(testsuite,no_bridge)
same => n,Hangup

exten => stasis,1,NoOp()
same => n,Answer()
same => n,Stasis(testsuite,test)
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[local]
type=transport
protocol=udp
bind=127.0.0.1:5060

[bob]
type=endpoint
context=default
disallow=all
allow=ulaw
direct_media=no
set_var=PJSIP_TRANSFER_HANDLING=ari-only
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<?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 -->
<!-- -->

<scenario name="Referee Leg">

<recvCmd>
<action>
<ereg regexp="REMOTE(.*)"
search_in="hdr"
header="Call-ID:"
check_it="true"
assign_to="1,original_callid" />
</action>
</recvCmd>

<send retrans="500">
<![CDATA[

INVITE sip:1000@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: <sip:bob@[local_ip]:[local_port]>;tag=[call_number]
To: <sip:transfer@[remote_ip]:[remote_port]>
Call-ID: [call_id]
CSeq: [cseq] INVITE
Contact: <sip:bob@[local_ip]:[local_port]>
Max-Forwards: 70
Content-Type: application/sdp
Content-Length: [len]

v=0
o=- 1324901698 1324901698 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 101
a=sendrecv
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000

]]>
</send>

<recv response="100" optional="true" />
<recv response="101" optional="true" />
<recv response="180" optional="true" />
<recv response="200" rtd="true" crlf="true">
<action>
<ereg regexp="tag=([[:alnum:].\-]*)"
search_in="hdr"
header="To:"
check_it="true"
assign_to="2,to_tag" />
<ereg regexp="tag=([[:alnum:].\-]*)"
search_in="hdr"
header="From:"
check_it="true"
assign_to="3,from_tag" />
</action>
</recv>
<Reference variables="1,2,3" />

<send>
<![CDATA[

ACK sip:1000@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch]
[last_From:]
[last_To]
Call-ID: [call_id]
CSeq: [cseq] ACK
Contact: sip:bob@[local_ip]:[local_port]
Max-Forwards: 70
Content-Length: 0

]]>
</send>

<pause milliseconds="1000" />
<sendCmd>
<![CDATA[
Call-ID: [$original_callid]
Remote-To-Tag: [$to_tag]
Remote-From-Tag: [$from_tag]
Remote-URI: sip:1000@[remote_ip]:[remote_port]
]]>
</sendCmd>

<recv request="BYE" />
<send>
<![CDATA[

SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:bob@[local_ip]:[local_port]>
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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
<?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 -->
<!-- -->

<scenario name="Referer Leg">

<send retrans="500">
<![CDATA[

INVITE sip:stasis@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: <sip:bob@[local_ip]:[local_port]>;tag=[call_number]
To: <sip:transfer@[remote_ip]:[remote_port]>
Call-ID: [call_id]
CSeq: [cseq] INVITE
Contact: <sip:bob@[local_ip]:[local_port]>
Content-Type: application/sdp
Max-Forwards: 70
Content-Length: [len]

v=0
o=- 1324901698 1324901698 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 101
a=sendrecv
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000

]]>
</send>

<recv response="100" optional="true" />
<recv response="101" optional="true" />
<recv response="180" optional="true" />
<recv response="200" rtd="true" crlf="true" />

<send>
<![CDATA[

ACK sip:stasis@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch]
[last_From:]
[last_To]
Call-ID: [call_id]
CSeq: [cseq] ACK
Contact: sip:bob@[local_ip]:[local_port]
Max-Forwards: 70
Content-Length: 0

]]>
</send>

<sendCmd>
<![CDATA[
Call-ID: REMOTE[call_id]
Start the Echo Leg
]]>
</sendCmd>

<recvCmd>
<action>
<ereg regexp=" (.+)"
search_in="hdr"
header="Remote-URI:"
check_it="true"
assign_to="1,remote_contact" />
<ereg regexp=" (.+)"
search_in="hdr"
header="Remote-To-Tag:"
check_it="true"
assign_to="2,remote_to_tag" />
<ereg regexp=" (.+)"
search_in="hdr"
header="Remote-From-Tag:"
check_it="true"
assign_to="3,remote_from_tag" />
<ereg regexp=" (.+)@(.+)"
search_in="hdr"
header="Call-ID:"
check_it="true"
assign_to="4,callid_chunk_1,callid_chunk_2"/>
</action>
</recvCmd>
<Reference variables="1,2,3,4" />

<send>
<![CDATA[

REFER sip:stasis@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
[last_From:]
[last_To]
[last_Call-ID:]
CSeq: [cseq] REFER
Contact: <sip:bob@[local_ip]:[local_port]>
Max-Forwards: 70
Refer-to: <[$remote_contact]?Replaces=REMOTE[$callid_chunk_1]%40[$callid_chunk_2]%3Bto-tag%3D[$remote_to_tag]%3Bfrom-tag%3D[$remote_from_tag]>
Referred-By: sip:bob@[local_ip]
Content-Length: 0

]]>
</send>
<recv response="202" rtd="true" crlf="true" />

<recv request="NOTIFY" />
<send>
<![CDATA[

SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:bob@[local_ip]:[local_port]>
Content-Length:0

]]>
</send>

<recv request="NOTIFY" />
<send>
<![CDATA[

SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:bob@[local_ip]:[local_port]>
Content-Length:0

]]>
</send>

<send retrans="500">
<![CDATA[

BYE sip:stasis@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: <sip:bob@[local_ip]:[local_port]>;tag=[call_number]
To: <sip:transfer@[remote_ip]:[remote_port]>[peer_tag_param]
[last_Call-ID:]
CSeq: [cseq] BYE
Contact: sip:bob@[local_ip]:[local_port]
Max-Forwards: 70
Subject: Performance Test
Content-Length: 0

]]>
</send>
<recv response="200" />

<!-- 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>
Loading
Loading