<p>Maximilian Fridrich has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/testsuite/+/18894">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip: Add tests for security agreements<br><br>Adds tests that check the basic functionality of security agreement<br>mechanisms of outbound registrations. Passes if registrations succeed<br>after initial temporary rejection.<br><br>ASTERISK-30032<br><br>Change-Id: Iad40d0f1987d1de19b1fe1c5c53394853179ce61<br>---<br>A tests/channels/pjsip/registration/outbound/sec_agreement_required/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/registration/outbound/sec_agreement_required/sipp/uas-reg-401-scenario.xml<br>A tests/channels/pjsip/registration/outbound/sec_agreement_required/sipp/uas-reg-494-scenario.xml<br>A tests/channels/pjsip/registration/outbound/sec_agreement_required/test-config.yaml<br>M tests/channels/pjsip/registration/outbound/tests.yaml<br>5 files changed, 313 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/94/18894/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/tests/channels/pjsip/registration/outbound/sec_agreement_required/configs/ast1/pjsip.conf b/tests/channels/pjsip/registration/outbound/sec_agreement_required/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..131baf8</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/registration/outbound/sec_agreement_required/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,32 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[global]</span><br><span style="color: hsl(120, 100%, 40%);">+type = global</span><br><span style="color: hsl(120, 100%, 40%);">+debug = yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[trans]</span><br><span style="color: hsl(120, 100%, 40%);">+type = transport</span><br><span style="color: hsl(120, 100%, 40%);">+protocol = udp</span><br><span style="color: hsl(120, 100%, 40%);">+bind = 127.0.0.1:5060</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[outreg-1]</span><br><span style="color: hsl(120, 100%, 40%);">+type = registration</span><br><span style="color: hsl(120, 100%, 40%);">+security_negotiation = mediasec</span><br><span style="color: hsl(120, 100%, 40%);">+security_mechanisms = sdes-srtp\;mediasec</span><br><span style="color: hsl(120, 100%, 40%);">+server_uri = sip:them@127.0.0.1:5061</span><br><span style="color: hsl(120, 100%, 40%);">+client_uri = sip:us@127.0.0.1</span><br><span style="color: hsl(120, 100%, 40%);">+outbound_auth = regauth</span><br><span style="color: hsl(120, 100%, 40%);">+expiration=12</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[outreg-2]</span><br><span style="color: hsl(120, 100%, 40%);">+type = registration</span><br><span style="color: hsl(120, 100%, 40%);">+security_negotiation = mediasec</span><br><span style="color: hsl(120, 100%, 40%);">+security_mechanisms = sdes-srtp\;mediasec</span><br><span style="color: hsl(120, 100%, 40%);">+server_uri = sip:them@127.0.0.1:5062</span><br><span style="color: hsl(120, 100%, 40%);">+client_uri = sip:us@127.0.0.1</span><br><span style="color: hsl(120, 100%, 40%);">+outbound_auth = regauth</span><br><span style="color: hsl(120, 100%, 40%);">+expiration=12</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[regauth]</span><br><span style="color: hsl(120, 100%, 40%);">+type = auth</span><br><span style="color: hsl(120, 100%, 40%);">+auth_type = userpass</span><br><span style="color: hsl(120, 100%, 40%);">+username = myself</span><br><span style="color: hsl(120, 100%, 40%);">+password = me-me</span><br><span>diff --git a/tests/channels/pjsip/registration/outbound/sec_agreement_required/sipp/uas-reg-401-scenario.xml b/tests/channels/pjsip/registration/outbound/sec_agreement_required/sipp/uas-reg-401-scenario.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..96b0295</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/registration/outbound/sec_agreement_required/sipp/uas-reg-401-scenario.xml</span><br><span>@@ -0,0 +1,109 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+<!DOCTYPE scenario SYSTEM "sipp.dtd"></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="Security agreement scenario 2: 401 response received"></span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="REGISTER" crlf="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="sdes-srtp;mediasec"</span><br><span style="color: hsl(120, 100%, 40%);">+ search_in="hdr"</span><br><span style="color: hsl(120, 100%, 40%);">+ check_it="true"</span><br><span style="color: hsl(120, 100%, 40%);">+ header="Security-Client: "</span><br><span style="color: hsl(120, 100%, 40%);">+ assign_to="1" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="mediasec"</span><br><span style="color: hsl(120, 100%, 40%);">+ search_in="hdr"</span><br><span style="color: hsl(120, 100%, 40%);">+ check_it="true"</span><br><span style="color: hsl(120, 100%, 40%);">+ header="Require: "</span><br><span style="color: hsl(120, 100%, 40%);">+ assign_to="4" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="mediasec"</span><br><span style="color: hsl(120, 100%, 40%);">+ search_in="hdr"</span><br><span style="color: hsl(120, 100%, 40%);">+ check_it="true"</span><br><span style="color: hsl(120, 100%, 40%);">+ header="Proxy-Require: "</span><br><span style="color: hsl(120, 100%, 40%);">+ assign_to="4" /></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 401 Unauthorized</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[pid]SIPpTag01[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Security-Server: msrp-tls;mediasec</span><br><span style="color: hsl(120, 100%, 40%);">+ Security-Server: sdes-srtp;mediasec</span><br><span style="color: hsl(120, 100%, 40%);">+ Security-Server: dtls-srtp;mediasec</span><br><span style="color: hsl(120, 100%, 40%);">+ WWW-Authenticate: Digest realm="asterisk", nonce="47ebe028cda119c35d4877b383027d28da013815"</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="REGISTER"></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="msrp-tls;mediasec"</span><br><span style="color: hsl(120, 100%, 40%);">+ search_in="hdr"</span><br><span style="color: hsl(120, 100%, 40%);">+ check_it="true"</span><br><span style="color: hsl(120, 100%, 40%);">+ occurrence="1"</span><br><span style="color: hsl(120, 100%, 40%);">+ header="Security-Verify: "</span><br><span style="color: hsl(120, 100%, 40%);">+ assign_to="2" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="sdes-srtp;mediasec"</span><br><span style="color: hsl(120, 100%, 40%);">+ search_in="hdr"</span><br><span style="color: hsl(120, 100%, 40%);">+ check_it="true"</span><br><span style="color: hsl(120, 100%, 40%);">+ occurrence="2"</span><br><span style="color: hsl(120, 100%, 40%);">+ header="Security-Verify: "</span><br><span style="color: hsl(120, 100%, 40%);">+ assign_to="3" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="dtls-srtp;mediasec"</span><br><span style="color: hsl(120, 100%, 40%);">+ search_in="hdr"</span><br><span style="color: hsl(120, 100%, 40%);">+ check_it="true"</span><br><span style="color: hsl(120, 100%, 40%);">+ occurrence="3"</span><br><span style="color: hsl(120, 100%, 40%);">+ header="Security-Verify: "</span><br><span style="color: hsl(120, 100%, 40%);">+ assign_to="4" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="mediasec"</span><br><span style="color: hsl(120, 100%, 40%);">+ search_in="hdr"</span><br><span style="color: hsl(120, 100%, 40%);">+ check_it="true"</span><br><span style="color: hsl(120, 100%, 40%);">+ header="Require: "</span><br><span style="color: hsl(120, 100%, 40%);">+ assign_to="4" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="mediasec"</span><br><span style="color: hsl(120, 100%, 40%);">+ search_in="hdr"</span><br><span style="color: hsl(120, 100%, 40%);">+ check_it="true"</span><br><span style="color: hsl(120, 100%, 40%);">+ header="Proxy-Require: "</span><br><span style="color: hsl(120, 100%, 40%);">+ assign_to="4" /></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[pid]SIPpTag01[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Expires: 12</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- This could be a re- or un- register --></span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="REGISTER" crlf="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[pid]SIPpTag01[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Expires: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <Reference variables="1,2,3,4" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/registration/outbound/sec_agreement_required/sipp/uas-reg-494-scenario.xml b/tests/channels/pjsip/registration/outbound/sec_agreement_required/sipp/uas-reg-494-scenario.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..bac4e0c</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/registration/outbound/sec_agreement_required/sipp/uas-reg-494-scenario.xml</span><br><span>@@ -0,0 +1,109 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+<!DOCTYPE scenario SYSTEM "sipp.dtd"></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="Security agreement scenario 1: 494 response received"></span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="REGISTER" crlf="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="sdes-srtp;mediasec"</span><br><span style="color: hsl(120, 100%, 40%);">+ search_in="hdr"</span><br><span style="color: hsl(120, 100%, 40%);">+ check_it="true"</span><br><span style="color: hsl(120, 100%, 40%);">+ header="Security-Client: "</span><br><span style="color: hsl(120, 100%, 40%);">+ assign_to="1" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="mediasec"</span><br><span style="color: hsl(120, 100%, 40%);">+ search_in="hdr"</span><br><span style="color: hsl(120, 100%, 40%);">+ check_it="true"</span><br><span style="color: hsl(120, 100%, 40%);">+ header="Require: "</span><br><span style="color: hsl(120, 100%, 40%);">+ assign_to="4" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="mediasec"</span><br><span style="color: hsl(120, 100%, 40%);">+ search_in="hdr"</span><br><span style="color: hsl(120, 100%, 40%);">+ check_it="true"</span><br><span style="color: hsl(120, 100%, 40%);">+ header="Proxy-Require: "</span><br><span style="color: hsl(120, 100%, 40%);">+ assign_to="4" /></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 494 Security Agreement Required</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[pid]SIPpTag01[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Security-Server: msrp-tls;mediasec</span><br><span style="color: hsl(120, 100%, 40%);">+ Security-Server: sdes-srtp;mediasec</span><br><span style="color: hsl(120, 100%, 40%);">+ Security-Server: dtls-srtp;mediasec</span><br><span style="color: hsl(120, 100%, 40%);">+ WWW-Authenticate: Digest realm="asterisk", nonce="47ebe028cda119c35d4877b383027d28da013815"</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="REGISTER"></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="msrp-tls;mediasec"</span><br><span style="color: hsl(120, 100%, 40%);">+ search_in="hdr"</span><br><span style="color: hsl(120, 100%, 40%);">+ check_it="true"</span><br><span style="color: hsl(120, 100%, 40%);">+ occurrence="1"</span><br><span style="color: hsl(120, 100%, 40%);">+ header="Security-Verify: "</span><br><span style="color: hsl(120, 100%, 40%);">+ assign_to="2" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="sdes-srtp;mediasec"</span><br><span style="color: hsl(120, 100%, 40%);">+ search_in="hdr"</span><br><span style="color: hsl(120, 100%, 40%);">+ check_it="true"</span><br><span style="color: hsl(120, 100%, 40%);">+ occurrence="2"</span><br><span style="color: hsl(120, 100%, 40%);">+ header="Security-Verify: "</span><br><span style="color: hsl(120, 100%, 40%);">+ assign_to="3" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="dtls-srtp;mediasec"</span><br><span style="color: hsl(120, 100%, 40%);">+ search_in="hdr"</span><br><span style="color: hsl(120, 100%, 40%);">+ check_it="true"</span><br><span style="color: hsl(120, 100%, 40%);">+ occurrence="3"</span><br><span style="color: hsl(120, 100%, 40%);">+ header="Security-Verify: "</span><br><span style="color: hsl(120, 100%, 40%);">+ assign_to="4" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="mediasec"</span><br><span style="color: hsl(120, 100%, 40%);">+ search_in="hdr"</span><br><span style="color: hsl(120, 100%, 40%);">+ check_it="true"</span><br><span style="color: hsl(120, 100%, 40%);">+ header="Require: "</span><br><span style="color: hsl(120, 100%, 40%);">+ assign_to="4" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="mediasec"</span><br><span style="color: hsl(120, 100%, 40%);">+ search_in="hdr"</span><br><span style="color: hsl(120, 100%, 40%);">+ check_it="true"</span><br><span style="color: hsl(120, 100%, 40%);">+ header="Proxy-Require: "</span><br><span style="color: hsl(120, 100%, 40%);">+ assign_to="4" /></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[pid]SIPpTag01[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Expires: 12</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- This could be a re- or un- register --></span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="REGISTER" crlf="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[pid]SIPpTag01[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Expires: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <Reference variables="1,2,3,4" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/registration/outbound/sec_agreement_required/test-config.yaml b/tests/channels/pjsip/registration/outbound/sec_agreement_required/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..4486b78</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/registration/outbound/sec_agreement_required/test-config.yaml</span><br><span>@@ -0,0 +1,62 @@</span><br><span style="color: hsl(120, 100%, 40%);">+testinfo:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Check handling of security agreement mechanisms'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ 'Asterisk attempts to use the security agreement mechanisms as defined</span><br><span style="color: hsl(120, 100%, 40%);">+ in RFC 3329. The server rejects the initial registration with a 494</span><br><span style="color: hsl(120, 100%, 40%);">+ Security Agreement Required or some non-RFC compliant servers with 401</span><br><span style="color: hsl(120, 100%, 40%);">+ Unauthorized. Asterisk should then attempt to register with the correct</span><br><span style="color: hsl(120, 100%, 40%);">+ Security-Verify headers which have been obtained from the server's</span><br><span style="color: hsl(120, 100%, 40%);">+ response.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ There are two scenarios:</span><br><span style="color: hsl(120, 100%, 40%);">+ 1) The server responds with status code 494.</span><br><span style="color: hsl(120, 100%, 40%);">+ 2) The server responds with status code 401.'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: sipp-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'sipp.SIPpTestCase'</span><br><span style="color: hsl(120, 100%, 40%);">+ modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'ami.AMIEventModule'</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: ami-config</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+sipp-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ test-iterations:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ scenarios:</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario': 'uas-reg-494-scenario.xml', '-p': '5061'} }</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario': 'uas-reg-401-scenario.xml', '-p': '5062'} }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ami-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ type: 'headermatch'</span><br><span style="color: hsl(120, 100%, 40%);">+ conditions:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: 'Registry'</span><br><span style="color: hsl(120, 100%, 40%);">+ ChannelType: 'PJSIP'</span><br><span style="color: hsl(120, 100%, 40%);">+ Username: 'sip:us@127.0.0.1'</span><br><span style="color: hsl(120, 100%, 40%);">+ Domain: 'sip:them@127.0.0.1:5061'</span><br><span style="color: hsl(120, 100%, 40%);">+ Status: 'Registered'</span><br><span style="color: hsl(120, 100%, 40%);">+ count: '1'</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ type: 'headermatch'</span><br><span style="color: hsl(120, 100%, 40%);">+ conditions:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: 'Registry'</span><br><span style="color: hsl(120, 100%, 40%);">+ ChannelType: 'PJSIP'</span><br><span style="color: hsl(120, 100%, 40%);">+ Username: 'sip:us@127.0.0.1'</span><br><span style="color: hsl(120, 100%, 40%);">+ Domain: 'sip:them@127.0.0.1:5062'</span><br><span style="color: hsl(120, 100%, 40%);">+ Status: 'Registered'</span><br><span style="color: hsl(120, 100%, 40%);">+ count: '1'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - python: 'starpy'</span><br><span style="color: hsl(120, 100%, 40%);">+ - sipp:</span><br><span style="color: hsl(120, 100%, 40%);">+ version: 'v3.1'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk: 'res_pjsip'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk: 'res_pjsip_outbound_authenticator_digest'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk: 'res_pjsip_outbound_registration'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - pjsip</span><br><span>diff --git a/tests/channels/pjsip/registration/outbound/tests.yaml b/tests/channels/pjsip/registration/outbound/tests.yaml</span><br><span>index c0e9dd3..9128691 100644</span><br><span>--- a/tests/channels/pjsip/registration/outbound/tests.yaml</span><br><span>+++ b/tests/channels/pjsip/registration/outbound/tests.yaml</span><br><span>@@ -7,3 +7,4 @@</span><br><span> - test: 'forbidden_retry'</span><br><span> - test: 'interval_too_brief'</span><br><span> - test: 'line_parameter'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'sec_agreement_required'</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/testsuite/+/18894">change 18894</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/testsuite/+/18894"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: Iad40d0f1987d1de19b1fe1c5c53394853179ce61 </div>
<div style="display:none"> Gerrit-Change-Number: 18894 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Maximilian Fridrich <m.fridrich@commend.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>