<p>N A has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/testsuite/+/18832">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_session: Add test for outgoing URI parameters.<br><br>Adds a test suite case for ensuring that outgoing URI<br>parameters get set properly.<br><br>ASTERISK_30150<br><br>Change-Id: Ic897797c6f0abf92bf5c7ce1fe26ebc45b10a064<br>---<br>A tests/channels/pjsip/parameters/outgoing_uri/configs/ast1/extensions.conf<br>A tests/channels/pjsip/parameters/outgoing_uri/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/parameters/outgoing_uri/test-config.yaml<br>A tests/channels/pjsip/parameters/tests.yaml<br>M tests/channels/pjsip/tests.yaml<br>5 files changed, 105 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/32/18832/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/tests/channels/pjsip/parameters/outgoing_uri/configs/ast1/extensions.conf b/tests/channels/pjsip/parameters/outgoing_uri/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..360f490</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/parameters/outgoing_uri/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,22 @@</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+exten => s,1,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,NoOp(From header: ${PJSIP_HEADER(read,From,1)})</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,GotoIf($["${CUT(PJSIP_HEADER(read,From,1),\;,2)}"="isup-oli=27>"]?good,1:bad,1) ; We should read the isup-oli parameter into the ANI2.</span><br><span style="color: hsl(120, 100%, 40%);">+exten => bad,1,UserEvent(TestFail,Result: Fail)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Hangup()</span><br><span style="color: hsl(120, 100%, 40%);">+exten => good,1,UserEvent(TestSuccess,Result: Pass)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Hangup()</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[dial]</span><br><span style="color: hsl(120, 100%, 40%);">+exten => s,1,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Set(CALLERID(num)=5552368)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Set(_SIPURIPARAMETERS=isup-oli=27) ; Manually set the ANI2 for the outgoing call</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Dial(PJSIP/loopback/sip:s@127.0.0.1) ; loop a call back to ourself to test.</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,UserEvent(TestFail,Result: Fail) ; If we fall through, it didn't work.</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Hangup()</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[nothing]</span><br><span style="color: hsl(120, 100%, 40%);">+exten => s,1,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Wait(10)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Hangup()</span><br><span>diff --git a/tests/channels/pjsip/parameters/outgoing_uri/configs/ast1/pjsip.conf b/tests/channels/pjsip/parameters/outgoing_uri/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..88d5e7e</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/parameters/outgoing_uri/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,20 @@</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%);">+endpoint_identifier_order = ip,username,anonymous</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[local-transport-udp]</span><br><span style="color: hsl(120, 100%, 40%);">+type=transport</span><br><span style="color: hsl(120, 100%, 40%);">+bind=127.0.0.1</span><br><span style="color: hsl(120, 100%, 40%);">+protocol=udp</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[loopback]</span><br><span style="color: hsl(120, 100%, 40%);">+type=identify</span><br><span style="color: hsl(120, 100%, 40%);">+match=127.0.0.1</span><br><span style="color: hsl(120, 100%, 40%);">+endpoint=loopback</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[loopback]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+identify_by=ip</span><br><span style="color: hsl(120, 100%, 40%);">+disallow=all</span><br><span style="color: hsl(120, 100%, 40%);">+allow=ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span>diff --git a/tests/channels/pjsip/parameters/outgoing_uri/test-config.yaml b/tests/channels/pjsip/parameters/outgoing_uri/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..ae963d9</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/parameters/outgoing_uri/test-config.yaml</span><br><span>@@ -0,0 +1,59 @@</span><br><span style="color: hsl(120, 100%, 40%);">+testinfo:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Ensure that outgoing URI parameters in PJSIP can be set properly.'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ 'This tests that outgoing parameters can be set in the PJSIP From</span><br><span style="color: hsl(120, 100%, 40%);">+ header by setting a custom header and ensuring it exists in a</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP INVITE.'</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: test-object-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'test_case.TestCaseModule'</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%);">+ config-section: caller-originator</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'pluggable_modules.Originator'</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: hangup-monitor</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'pluggable_modules.HangupMonitor'</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: ami-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'pluggable_modules.EventActionModule'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-object-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ connect-ami: True</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+caller-originator:</span><br><span style="color: hsl(120, 100%, 40%);">+ channel: 'Local/s@dial'</span><br><span style="color: hsl(120, 100%, 40%);">+ context: 'nothing'</span><br><span style="color: hsl(120, 100%, 40%);">+ exten: 's'</span><br><span style="color: hsl(120, 100%, 40%);">+ priority: '1'</span><br><span style="color: hsl(120, 100%, 40%);">+ trigger: 'ami_connect'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+hangup-monitor:</span><br><span style="color: hsl(120, 100%, 40%);">+ ids: '0'</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%);">+ ami-events:</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: 'UserEvent'</span><br><span style="color: hsl(120, 100%, 40%);">+ UserEvent: 'TestSuccess'</span><br><span style="color: hsl(120, 100%, 40%);">+ requirements:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Result: 'Pass'</span><br><span style="color: hsl(120, 100%, 40%);">+ count: 1</span><br><span style="color: hsl(120, 100%, 40%);">+ stop_test:</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%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - dial</span><br><span style="color: hsl(120, 100%, 40%);">+ - channels</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - python: 'twisted'</span><br><span style="color: hsl(120, 100%, 40%);">+ - python: 'starpy'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk: 'app_dial'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk: 'app_userevent'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk: 'chan_pjsip'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk: 'pbx_config'</span><br><span>diff --git a/tests/channels/pjsip/parameters/tests.yaml b/tests/channels/pjsip/parameters/tests.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..51602fb</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/parameters/tests.yaml</span><br><span>@@ -0,0 +1,3 @@</span><br><span style="color: hsl(120, 100%, 40%);">+# Enter tests here in the order they should be considered for execution:</span><br><span style="color: hsl(120, 100%, 40%);">+tests:</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'outgoing_uri'</span><br><span>diff --git a/tests/channels/pjsip/tests.yaml b/tests/channels/pjsip/tests.yaml</span><br><span>index e585356..081a883 100644</span><br><span>--- a/tests/channels/pjsip/tests.yaml</span><br><span>+++ b/tests/channels/pjsip/tests.yaml</span><br><span>@@ -14,6 +14,7 @@</span><br><span> - dir: 'message'</span><br><span> - dir: 'nat'</span><br><span> - dir: 'one_touch_recording'</span><br><span style="color: hsl(120, 100%, 40%);">+ - dir: 'parameters'</span><br><span> - dir: 'publish'</span><br><span> - dir: 'qualify'</span><br><span> - dir: 'registration'</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/testsuite/+/18832">change 18832</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/+/18832"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ic897797c6f0abf92bf5c7ce1fe26ebc45b10a064 </div>
<div style="display:none"> Gerrit-Change-Number: 18832 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>