Skip to content

Commit

Permalink
app_dial: Add tests for new option "j" - preserve topology
Browse files Browse the repository at this point in the history
  • Loading branch information
maximilianfridrich authored and asterisk-org-access-app[bot] committed Jan 9, 2024
1 parent 09a501f commit d9b7d1d
Show file tree
Hide file tree
Showing 8 changed files with 687 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/apps/dial/preserve_top/configs/ast1/extensions.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[general]

[globals]

[calling]
exten => bob,1,NoOp()
same => n,Dial(PJSIP/bob,1,jg)
same => n,NoOp()
same => n,Dial(PJSIP/carol,,j)
same => n,Hangup()

exten => no_pres,1,NoOp()
same => n,Dial(PJSIP/bob,1,g)
same => n,NoOp()
same => n,Dial(PJSIP/carol)
same => n,Hangup()

exten => part_pres,1,NoOp()
same => n,Dial(PJSIP/bob,1,g)
same => n,NoOp()
same => n,Dial(PJSIP/carol,,j)
same => n,Hangup()

51 changes: 51 additions & 0 deletions tests/apps/dial/preserve_top/configs/ast1/pjsip.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[system]
type=system
timer_t1=100
timer_b=6400

[global]
type=global
debug=yes
allow_sending_180_after_183=yes

[local-transport]
type=transport
bind=127.0.0.1
protocol=udp

[alice]
type=endpoint
allow=g722,ulaw,alaw,h264,h263
context=calling
direct_media=no
inband_progress=yes
media_address=127.0.0.1
aors=alice

[bob]
type=endpoint
allow=g722,ulaw,alaw,h264,h263
context=calling
direct_media=no
inband_progress=yes
media_address=127.0.0.1
aors=bob

[bob]
type=aor
max_contacts=1
contact=sip:[email protected]:5060\;transport=udp

[carol]
type=endpoint
allow=g722,ulaw,alaw,h264,h263
context=calling
direct_media=no
inband_progress=yes
media_address=127.0.0.1
aors=carol

[carol]
type=aor
max_contacts=1
contact=sip:[email protected]:5060\;transport=udp
124 changes: 124 additions & 0 deletions tests/apps/dial/preserve_top/sipp/alice.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>

<scenario name="Send Call">

<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: <sip:alice@[local_ip]:[local_port]>;tag=[pid]SIPpTag[call_number]
To: <sip:[service]@[remote_ip]:[remote_port]>
Call-ID: [call_id]
CSeq: [cseq] INVITE
Contact: <sip:alice@[local_ip]:[local_port];transport=[transport]>
Max-Forwards: 70
Content-Type: application/sdp
Content-Length: [len]
v=0
o=- 53655765 2353687637 IN IP[local_ip_type] [local_ip]
s=-
c=IN IP[media_ip_type] [media_ip]
t=0 0
m=audio [custom_media_port] RTP/AVP 9 0 8
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:9 G722/8000
a=sendrecv
m=video 6000 RTP/AVP 99 34
a=rtpmap:99 H264/90000
a=rtpmap:34 H263/90000
a=sendrecv
]]>
</send>

<recv response="100" optional="true" />
<recv response="180" />

<recv response="183" rtd="true">
</recv>

<recv response="200" rtd="true">
<!-- Save the To tag. -->
<action>
<ereg regexp="(;tag=.*)"
header="To:"
search_in="hdr"
check_it="true"
assign_to="remote_tag"/>
</action>
</recv>

<send>
<![CDATA[
ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
[last_Via:]
[last_From:]
[last_To:]
Call-ID: [call_id]
CSeq: [cseq] ACK
Contact: <sip:alice@[local_ip]:[local_port];transport=[transport]>
Max-Forwards: 70
Content-Length: 0
]]>
</send>

<recv request="INVITE" crlf="true" />

<send retrans="500">
<![CDATA[
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:];tag=[pid]SIPpTag[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:bob@[local_ip]:[local_port];transport=[transport]>
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 [custom_media_port] RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=sendrecv
m=video 6000 RTP/AVP 99
a=rtpmap:99 H264/90000
a=sendonly
]]>
</send>

<recv request="ACK" crlf="true" />

<pause milliseconds="2000" />

<send retrans="500">
<![CDATA[
BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
[last_Via:]
From: <sip:alice@[local_ip]:[local_port]>;tag=[pid]SIPpTag[call_number]
To: <sip:[service]@[remote_ip]:[remote_port]>[$remote_tag]
Call-ID: [call_id]
CSeq: [cseq] BYE
Contact: sip:alice@[local_ip]:[local_port]
Max-Forwards: 70
Subject: Codec Negotiation Test
Content-Length: 0
]]>
</send>

<recv response="200" crlf="true">
</recv>

</scenario>
132 changes: 132 additions & 0 deletions tests/apps/dial/preserve_top/sipp/bob.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">

<scenario name="Basic UAS responder">

<recv request="INVITE" crlf="true">
<action>
<ereg regexp="sip:[^;&gt;]+"
header="Contact:"
search_in="hdr"
check_it="true"
assign_to="contact_h"/>
</action>
</recv>

<send>
<![CDATA[
SIP/2.0 180 Ringing
[last_Via:]
[last_From:]
[last_To:];tag=[pid]SIPpTag[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:bob@[local_ip]:[local_port];transport=[transport]>
Content-Length: 0
]]>
</send>

<pause milliseconds="200" />

<send>
<![CDATA[
SIP/2.0 183 Progress
[last_Via:]
[last_From:]
[last_To:];tag=[pid]SIPpTag[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:bob@[local_ip]:[local_port];transport=[transport]>
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 [custom_media_port] RTP/AVP 0
a=inactive
a=rtpmap:0 PCMU/8000
m=video 6000 RTP/AVP 99
a=rtpmap:99 H264/90000
a=recvonly
]]>
</send>

<pause milliseconds="200" />

<send>
<![CDATA[
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:];tag=[pid]SIPpTag[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:bob@[local_ip]:[local_port];transport=[transport]>
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 [custom_media_port] RTP/AVP 0
a=inactive
a=rtpmap:0 PCMU/8000
m=video 6000 RTP/AVP 99
a=rtpmap:99 H264/90000
a=recvonly
]]>
</send>

<recv request="ACK"
rtd="true"
crlf="true">
<action>
<ereg regexp="(.*)"
header="To:"
search_in="hdr"
check_it="true"
assign_to="to_h"/>
<ereg regexp="(.*)"
header="From:"
search_in="hdr"
check_it="true"
assign_to="from_h"/>
</action>
</recv>

<pause milliseconds="500" />

<send retrans="500">
<![CDATA[
BYE [$contact_h] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From:[$to_h]
To:[$from_h]
[last_Call-ID:]
CSeq: [cseq] BYE
Max-Forwards: 70
]]>
</send>

<recv response="200" crlf="true">
</recv>

<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>

<CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>

</scenario>

Loading

0 comments on commit d9b7d1d

Please sign in to comment.