<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/testsuite/+/18759">View Change</a></p><div style="white-space:pre-wrap">Approvals:
George Joseph: Looks good to me, approved
Friendly Automation: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_ari_channels/res_pjsip: Added test for exposed protocol_id<br><br>This test checks whether the protocol_id is successfully exposed<br>and filled with a PJSIP style Call-ID.<br><br>ASTERISK-30027<br>Reported by: Moritz Fain<br><br>Change-Id: Ibc8a103b9e54d709aa39472fa2d77a969c1685ac<br>---<br>A tests/rest_api/channels/originate_to_pjsip_endpoint/configs/ast1/extensions.conf<br>A tests/rest_api/channels/originate_to_pjsip_endpoint/configs/ast1/pjsip.conf<br>A tests/rest_api/channels/originate_to_pjsip_endpoint/test-config.yaml<br>M tests/rest_api/channels/tests.yaml<br>4 files changed, 116 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/tests/rest_api/channels/originate_to_pjsip_endpoint/configs/ast1/extensions.conf b/tests/rest_api/channels/originate_to_pjsip_endpoint/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..3ba2826</span><br><span>--- /dev/null</span><br><span>+++ b/tests/rest_api/channels/originate_to_pjsip_endpoint/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,14 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exten => s,1,NoOp()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Stasis(testsuite)</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%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[default2]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exten => 1000,1,NoOp()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Wait(1)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Hangup()</span><br><span>diff --git a/tests/rest_api/channels/originate_to_pjsip_endpoint/configs/ast1/pjsip.conf b/tests/rest_api/channels/originate_to_pjsip_endpoint/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..f748994</span><br><span>--- /dev/null</span><br><span>+++ b/tests/rest_api/channels/originate_to_pjsip_endpoint/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,40 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[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%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[transport1]</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%);">+[endpoint1]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+transport=transport1</span><br><span style="color: hsl(120, 100%, 40%);">+allow=!all,ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+media_address=127.0.0.1</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+aors=endpoint1_aor</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[endpoint1_aor]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:127.0.0.2:5060</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[transport2]</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.2:5060</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[endpoint2]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+context=default2</span><br><span style="color: hsl(120, 100%, 40%);">+transport=transport2</span><br><span style="color: hsl(120, 100%, 40%);">+allow=!all,ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+media_address=127.0.0.2</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[endpoint2_identity]</span><br><span style="color: hsl(120, 100%, 40%);">+type=identify</span><br><span style="color: hsl(120, 100%, 40%);">+endpoint=endpoint2</span><br><span style="color: hsl(120, 100%, 40%);">+match=127.0.0.1</span><br><span>diff --git a/tests/rest_api/channels/originate_to_pjsip_endpoint/test-config.yaml b/tests/rest_api/channels/originate_to_pjsip_endpoint/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..5e0853c</span><br><span>--- /dev/null</span><br><span>+++ b/tests/rest_api/channels/originate_to_pjsip_endpoint/test-config.yaml</span><br><span>@@ -0,0 +1,61 @@</span><br><span style="color: hsl(120, 100%, 40%);">+testinfo:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: Test originating calls with PJSIP have a protocol_id set</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ Originate a call to a PJSIP endpoint using ARI and verify they have a protocol_id set (SIP Call-ID)</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 : autobahn.websocket</span><br><span style="color: hsl(120, 100%, 40%);">+ - python : requests</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 : res_ari_channels</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : chan_pjsip</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : res_pjsip</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - ARI</span><br><span style="color: hsl(120, 100%, 40%);">+ - pjsip</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: ari.AriOriginateTestObject</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: ari-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: ari.WebSocketEventModule</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: ari-test-stopper</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%);">+ stop-on-end: False</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%);">+ endpoint: 'PJSIP/1000@endpoint1'</span><br><span style="color: hsl(120, 100%, 40%);">+ channelId: 'MyCustomId'</span><br><span style="color: hsl(120, 100%, 40%);">+ otherChannelId: 'MyOtherCustomId'</span><br><span style="color: hsl(120, 100%, 40%);">+ app: 'testsuite'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ari-test-stopper:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ ari-events:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ type: ChannelDestroyed</span><br><span style="color: hsl(120, 100%, 40%);">+ application: testsuite</span><br><span style="color: hsl(120, 100%, 40%);">+ channel:</span><br><span style="color: hsl(120, 100%, 40%);">+ id: 'MyCustomId$'</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%);">+ari-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ apps: testsuite</span><br><span style="color: hsl(120, 100%, 40%);">+ events:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</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%);">+ type: StasisStart</span><br><span style="color: hsl(120, 100%, 40%);">+ application: testsuite</span><br><span style="color: hsl(120, 100%, 40%);">+ channel:</span><br><span style="color: hsl(120, 100%, 40%);">+ protocol_id: '^.{8}-.{4}-.{4}-.{4}-.{12}$'</span><br><span style="color: hsl(120, 100%, 40%);">+ id: 'MyCustomId'</span><br><span style="color: hsl(120, 100%, 40%);">+ count: 1</span><br><span>diff --git a/tests/rest_api/channels/tests.yaml b/tests/rest_api/channels/tests.yaml</span><br><span>index b585099..9f2b4fd 100644</span><br><span>--- a/tests/rest_api/channels/tests.yaml</span><br><span>+++ b/tests/rest_api/channels/tests.yaml</span><br><span>@@ -4,6 +4,7 @@</span><br><span> - test: 'originate_with_id'</span><br><span> - test: 'originate_with_linkedid'</span><br><span> - test: 'originate_then_continue'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'originate_to_pjsip_endpoint'</span><br><span> - test: 'snoop_whisper'</span><br><span> - test: 'snoop_spy'</span><br><span> - test: 'snoop_id'</span><br><span></span><br></pre><div style="white-space:pre-wrap"></div><p>To view, visit <a href="https://gerrit.asterisk.org/c/testsuite/+/18759">change 18759</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/+/18759"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: 19 </div>
<div style="display:none"> Gerrit-Change-Id: Ibc8a103b9e54d709aa39472fa2d77a969c1685ac </div>
<div style="display:none"> Gerrit-Change-Number: 18759 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-CC: Moritz Fain <moritz@fain.io> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>