-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
288 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
tests/channels/pjsip/dialplan_functions/pjsip_hangup/configs/ast1/extensions.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
[default] | ||
|
||
exten = expect_437_1,1,NoOp() | ||
same = n,Wait(1) | ||
same = n,Progress() | ||
same = n,Wait(1) | ||
same = n,PJSIPHangup(437) | ||
|
||
exten = expect_437_2,1,NoOp() | ||
same = n,Wait(1) | ||
same = n,Progress() | ||
same = n,Wait(1) | ||
same = n,PJSIPHangup(UNSUPPORTED_CERTIFICATE) | ||
|
||
exten = expect_200,1,NoOp() | ||
same = n,Wait(1) | ||
same = n,Progress() | ||
same = n,Wait(1) | ||
same = n,Answer() | ||
same = n,PJSIPHangup(437) | ||
|
||
exten = expect_603_1,1,NoOp() | ||
same = n,Wait(1) | ||
same = n,Progress() | ||
same = n,Wait(1) | ||
same = n,PJSIPHangup(999) | ||
|
||
exten = expect_603_2,1,NoOp() | ||
same = n,Wait(1) | ||
same = n,Progress() | ||
same = n,Wait(1) | ||
same = n,PJSIPHangup(SOMETHINGOROTHER) | ||
|
||
|
||
|
28 changes: 28 additions & 0 deletions
28
tests/channels/pjsip/dialplan_functions/pjsip_hangup/configs/ast1/pjsip.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[system] | ||
type=system | ||
timer_t1=100 | ||
timer_b=6400 | ||
|
||
[local] | ||
type=transport | ||
protocol=udp | ||
bind=0.0.0.0 | ||
|
||
[endpoint_t](!) | ||
type=endpoint | ||
context=default | ||
transport=local | ||
direct_media=no | ||
disallow=all | ||
allow=ulaw | ||
|
||
[aor_t](!) | ||
type=aor | ||
max_contacts=1 | ||
|
||
[alice](endpoint_t) | ||
aors=alice | ||
|
||
[alice](aor_t) | ||
contact=sip:[email protected]:5061 | ||
|
70 changes: 70 additions & 0 deletions
70
tests/channels/pjsip/dialplan_functions/pjsip_hangup/sipp/invite-expects-200-then-bye.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<?xml version="1.0" encoding="ISO-8859-1" ?> | ||
<!DOCTYPE scenario SYSTEM "sipp.dtd"> | ||
|
||
<scenario name="Send INVITE from an inbound channel"> | ||
<send retrans="500"> | ||
<![CDATA[ | ||
INVITE sip:[dest]@[remote_ip]:[remote_port] SIP/2.0 | ||
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] | ||
From: sipp <sip:[service]@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number] | ||
To: sut <sip:[dest]@[remote_ip]:[remote_port]> | ||
Call-ID: [call_id] | ||
CSeq: 1 INVITE | ||
Contact: sip:sipp@[local_ip]:[local_port] | ||
Max-Forwards: 70 | ||
Subject: Test | ||
Content-Type: application/sdp | ||
Content-Length: [len] | ||
v=0 | ||
o=phoneA 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="183" optional="true"> | ||
</recv> | ||
|
||
<recv response="200" rtd="true"> | ||
</recv> | ||
|
||
<send> | ||
<![CDATA[ | ||
ACK sip:[dest]@[remote_ip]:[remote_port] SIP/2.0 | ||
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] | ||
From: sipp <sip:[service]@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number] | ||
To: sut <sip:[dest]@[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: Test | ||
Content-Length: 0 | ||
]]> | ||
</send> | ||
|
||
<recv request="BYE" crlf="true" /> | ||
|
||
<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:sipp@[local_ip]:[local_port];transport=[transport]> | ||
Allow: INVITE, ACK, MESSAGE, BYE | ||
Content-Lnegth: 0 | ||
]]> | ||
</send> | ||
|
||
|
||
</scenario> |
53 changes: 53 additions & 0 deletions
53
tests/channels/pjsip/dialplan_functions/pjsip_hangup/sipp/invite-expects-437.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?xml version="1.0" encoding="ISO-8859-1" ?> | ||
<!DOCTYPE scenario SYSTEM "sipp.dtd"> | ||
|
||
<scenario name="Send INVITE from an inbound channel"> | ||
<send retrans="500"> | ||
<![CDATA[ | ||
INVITE sip:[dest]@[remote_ip]:[remote_port] SIP/2.0 | ||
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] | ||
From: sipp <sip:[service]@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number] | ||
To: sut <sip:[dest]@[remote_ip]:[remote_port]> | ||
Call-ID: [call_id] | ||
CSeq: 1 INVITE | ||
Contact: sip:sipp@[local_ip]:[local_port] | ||
Max-Forwards: 70 | ||
Subject: Test | ||
Content-Type: application/sdp | ||
Content-Length: [len] | ||
v=0 | ||
o=phoneA 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"> | ||
</recv> | ||
|
||
<recv response="183"> | ||
</recv> | ||
|
||
<recv response="437"> | ||
</recv> | ||
|
||
<send> | ||
<![CDATA[ | ||
ACK sip:[dest]@[remote_ip]:[remote_port] SIP/2.0 | ||
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] | ||
From: sipp <sip:[service]@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number] | ||
To: sut <sip:[dest]@[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: Test | ||
Content-Length: 0 | ||
]]> | ||
</send> | ||
|
||
</scenario> |
53 changes: 53 additions & 0 deletions
53
tests/channels/pjsip/dialplan_functions/pjsip_hangup/sipp/invite-expects-603.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?xml version="1.0" encoding="ISO-8859-1" ?> | ||
<!DOCTYPE scenario SYSTEM "sipp.dtd"> | ||
|
||
<scenario name="Send INVITE from an inbound channel"> | ||
<send retrans="500"> | ||
<![CDATA[ | ||
INVITE sip:[dest]@[remote_ip]:[remote_port] SIP/2.0 | ||
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] | ||
From: sipp <sip:[service]@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number] | ||
To: sut <sip:[dest]@[remote_ip]:[remote_port]> | ||
Call-ID: [call_id] | ||
CSeq: 1 INVITE | ||
Contact: sip:sipp@[local_ip]:[local_port] | ||
Max-Forwards: 70 | ||
Subject: Test | ||
Content-Type: application/sdp | ||
Content-Length: [len] | ||
v=0 | ||
o=phoneA 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"> | ||
</recv> | ||
|
||
<recv response="183"> | ||
</recv> | ||
|
||
<recv response="603"> | ||
</recv> | ||
|
||
<send> | ||
<![CDATA[ | ||
ACK sip:[dest]@[remote_ip]:[remote_port] SIP/2.0 | ||
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] | ||
From: sipp <sip:[service]@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number] | ||
To: sut <sip:[dest]@[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: Test | ||
Content-Length: 0 | ||
]]> | ||
</send> | ||
|
||
</scenario> |
47 changes: 47 additions & 0 deletions
47
tests/channels/pjsip/dialplan_functions/pjsip_hangup/test-config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
testinfo: | ||
summary: 'Tests PJSIPHangup' | ||
description: | ||
'Checks PJSIPHangup with good parameters (437 and UNSUPPORTED_CERTIFICATE) | ||
which should return 437, and with bad parameters (999 and SOMETHINGOROTHER), | ||
which should return 603. Also test PJSIPHangup after an Answer() which should | ||
be ignored and return a 200, then a BYE.' | ||
|
||
test-modules: | ||
test-object: | ||
config-section: test-object-config | ||
typename: 'sipp.SIPpTestCase' | ||
|
||
test-object-config: | ||
memcheck-delay-stop: 7 | ||
fail-on-any: True | ||
test-iterations: | ||
- | ||
scenarios: | ||
- { 'key-args': { 'scenario':'invite-expects-200-then-bye.xml', '-i':'127.0.0.1', | ||
'-p':'5061', '-s':'alice' }, | ||
'ordered-args': [ '-bind_local', '-key', 'dest', 'expect_200']} | ||
|
||
- { 'key-args': { 'scenario':'invite-expects-437.xml', '-i':'127.0.0.1', | ||
'-p':'5062', '-s':'alice' }, | ||
'ordered-args': [ '-bind_local', '-key', 'dest', 'expect_437_1']} | ||
|
||
- { 'key-args': { 'scenario':'invite-expects-437.xml', '-i':'127.0.0.1', | ||
'-p':'5063', '-s':'alice' }, | ||
'ordered-args': [ '-bind_local', '-key', 'dest', 'expect_437_2']} | ||
|
||
- { 'key-args': { 'scenario':'invite-expects-603.xml', '-i':'127.0.0.1', | ||
'-p':'5064', '-s':'alice' }, | ||
'ordered-args': [ '-bind_local', '-key', 'dest', 'expect_603_1']} | ||
|
||
- { 'key-args': { 'scenario':'invite-expects-603.xml', '-i':'127.0.0.1', | ||
'-p':'5065', '-s':'alice' }, | ||
'ordered-args': [ '-bind_local', '-key', 'dest', 'expect_603_2']} | ||
|
||
|
||
properties: | ||
dependencies: | ||
- app : 'sipp' | ||
- asterisk : 'chan_pjsip' | ||
- asterisk : 'res_pjsip' | ||
tags: | ||
- pjsip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,5 @@ tests: | |
- test: 'pjsip_header' | ||
- test: 'pjsip_parse_uri' | ||
- test: 'pjsip_session_refresh' | ||
- test: 'pjsip_hangup' | ||
|