-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pjsip/stir_shaken: Add test for invalid or missing callerid.
- Loading branch information
1 parent
6715e8a
commit 0631c83
Showing
10 changed files
with
208 additions
and
0 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
tests/channels/pjsip/stir_shaken/stir_shaken_anon_callerid/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,4 @@ | ||
[default] | ||
exten => _X.,1,Answer() | ||
same => n,UserEvent(TestResult, result: ${STIR_SHAKEN(0,verify_result)}) | ||
same => n,Hangup() |
29 changes: 29 additions & 0 deletions
29
tests/channels/pjsip/stir_shaken/stir_shaken_anon_callerid/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,29 @@ | ||
[system] | ||
type=system | ||
timer_t1=100 | ||
timer_b=6400 | ||
|
||
[transport-udp] | ||
type=transport | ||
protocol=udp | ||
bind=127.0.0.1:5060 | ||
|
||
[sipp] | ||
type=endpoint | ||
context=default | ||
allow=!all,ulaw | ||
send_pai = yes | ||
direct_media = no | ||
connected_line_method = update | ||
send_connected_line = no | ||
send_diversion = no | ||
trust_id_inbound = true | ||
trust_id_outbound = true | ||
identify_by = ip | ||
stir_shaken_profile=from-sipp | ||
|
||
[sipp] | ||
type = identify | ||
endpoint=sipp | ||
match=127.0.0.4 | ||
|
25 changes: 25 additions & 0 deletions
25
tests/channels/pjsip/stir_shaken/stir_shaken_anon_callerid/configs/ast1/stir_shaken.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,25 @@ | ||
|
||
[verification] | ||
load_system_certs = no | ||
ca_file=<<astetcdir>>/stir/astdev-ca.crt | ||
curl_timeout=2 | ||
max_iat_age=60 | ||
max_date_header_age=60 | ||
max_cache_entry_age = 300 | ||
max_cache_size=666 | ||
failure_action = continue | ||
x5u_deny=0.0.0.0/0.0.0.0 | ||
x5u_permit = 127.0.0.0/8 | ||
relax_x5u_path_restrictions = yes | ||
relax_x5u_port_scheme_restrictions = yes | ||
|
||
[attestation] | ||
global_disable = no | ||
check_tn_cert_public_url = no | ||
|
||
[from-sipp] | ||
type = profile | ||
endpoint_behavior = verify | ||
failure_action = continue_return_reason | ||
send_mky = no | ||
use_rfc9410_responses = no |
1 change: 1 addition & 0 deletions
1
...els/pjsip/stir_shaken/stir_shaken_anon_callerid/files/ast1/astetcdir/stir/SPAST1-cert.pem
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 @@ | ||
../../../../../keys/SPAST1/SPAST1-cert.pem |
1 change: 1 addition & 0 deletions
1
...nels/pjsip/stir_shaken/stir_shaken_anon_callerid/files/ast1/astetcdir/stir/SPAST1-key.pem
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 @@ | ||
../../../../../keys/SPAST1/SPAST1-key.pem |
1 change: 1 addition & 0 deletions
1
...nnels/pjsip/stir_shaken/stir_shaken_anon_callerid/files/ast1/astetcdir/stir/astdev-ca.crt
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 @@ | ||
../../../../../keys/astdev-ca.crt |
Empty file.
86 changes: 86 additions & 0 deletions
86
tests/channels/pjsip/stir_shaken/stir_shaken_anon_callerid/sipp/invite.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,86 @@ | ||
<?xml version="1.0" encoding="ISO-8859-1" ?> | ||
<!DOCTYPE scenario SYSTEM "sipp.dtd"> | ||
<scenario name="INVITE to echo with SDP in initial INVITE"> | ||
|
||
<send retrans="0"> | ||
<![CDATA[ | ||
INVITE sip:[dest]@[remote_ip]:[remote_port] SIP/2.0 | ||
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] | ||
From: <sip:Anonymous@anonymous.invalid:[local_port]>;tag=[call_number] | ||
To: <sip:[dest]@[remote_ip]:[remote_port]> | ||
Call-ID: [call_id] | ||
CSeq: 1 INVITE | ||
Max-Forwards: 70 | ||
Contact: <sip:[service]@[local_ip]:[local_port]> | ||
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, PRACK, REGISTER, REFER, MESSAGE | ||
User-Agent: Test | ||
Content-Type: application/sdp | ||
Content-Length: [len] | ||
v=0 | ||
o=- 20110306451 20110306451 IN IP[media_ip_type] [media_ip] | ||
s=- | ||
c=IN IP[media_ip_type] [media_ip] | ||
t=0 0 | ||
m=audio [media_port] RTP/AVP 18 0 8 101 | ||
a=rtpmap:0 PCMU/8000 | ||
a=rtpmap:8 PCMA/8000 | ||
a=rtpmap:101 telephone-event/8000 | ||
a=fmtp:18 annexb=no | ||
a=fmtp:101 0-16 | ||
a=ptime:20 | ||
a=sendrecv | ||
]]> | ||
</send> | ||
|
||
<recv response="100" | ||
optional="true"> | ||
</recv> | ||
|
||
<recv response="180" | ||
optional="true"> | ||
</recv> | ||
|
||
<recv response="183" | ||
optional="true"> | ||
</recv> | ||
|
||
<recv response="200" rtd="true"/> | ||
|
||
|
||
<send> | ||
<![CDATA[ | ||
ACK sip:[dest]@[remote_ip]:[remote_port] SIP/2.0 | ||
[last_Via:] | ||
[last_From:] | ||
[last_To:] | ||
[last_Call-ID:] | ||
CSeq: 1 ACK | ||
[last_Contact:] | ||
[last_Allow:] | ||
Content-Length: 0 | ||
]]> | ||
</send> | ||
|
||
|
||
<recv request="BYE"/> | ||
|
||
<send> | ||
<![CDATA[ | ||
SIP/2.0 200 OK | ||
[last_Via:] | ||
[last_From:] | ||
[last_To:] | ||
[last_Call-ID:] | ||
[last_CSeq:] | ||
Contact: <sip:test@[local_ip]:[local_port];transport=[transport]> | ||
Content-Length: 0 | ||
]]> | ||
</send> | ||
|
||
</scenario> |
60 changes: 60 additions & 0 deletions
60
tests/channels/pjsip/stir_shaken/stir_shaken_anon_callerid/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,60 @@ | ||
testinfo: | ||
summary: 'Tests invalid_or_no_callerid' | ||
description: | | ||
'Run a single instance of Asterisk and send an INVITE with | ||
no PAI or RPID and with an anonymized From header. | ||
Asterisk will test this with the STIR_SHAKEN dialplan | ||
function, ensuring that "invalid_or_no_callerid" is the result.' | ||
test-modules: | ||
test-object: | ||
config-section: test-object-config | ||
typename: sipp.SIPpTestCase | ||
modules: | ||
- | ||
config-section: 'ami-config' | ||
typename: 'ami.AMIEventModule' | ||
- | ||
config-section: 'http-server' | ||
typename: 'http_static_server.HTTPStaticServer' | ||
- | ||
config-section: 'hangup-monitor' | ||
typename: 'pluggable_modules.HangupMonitor' | ||
|
||
test-object-config: | ||
memcheck-delay-stop: 7 | ||
asterisk-instances: 1 | ||
test-iterations: | ||
- | ||
scenarios: | ||
- { 'key-args': {'scenario': 'invite.xml', '-p': '5060', '-i': '127.0.0.4', '-timeout': '20s', '-mi': '127.0.0.4', '-s': 'sipp'}, | ||
'ordered-args': ['-timeout_error', '-key', 'dest', '18005556666'] } | ||
|
||
hangup-monitor: | ||
ids: [ '1', ] | ||
|
||
http-server: | ||
port: 8087 | ||
root-directory: 'tests/channels/pjsip/stir_shaken/webroot' | ||
|
||
|
||
ami-config: | ||
- | ||
type: 'headermatch' | ||
id: '0' | ||
conditions: | ||
match: | ||
Event: 'UserEvent' | ||
UserEvent: 'TestResult' | ||
requirements: | ||
match: | ||
result: 'invalid_or_no_callerid' | ||
count: '1' | ||
|
||
properties: | ||
dependencies: | ||
- asterisk : 'res_pjsip' | ||
- asterisk : 'res_stir_shaken' | ||
tags: | ||
- pjsip | ||
- stir_shaken |
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