<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/testsuite/+/15346">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;">rest_api/message: Add test mixing technology and endpoint subscriptions<br><br>ASTERISK-29229<br><br>Change-Id: I653b3ed9409906c3d6d7718dd0d853ca152d8b4c<br>---<br>A tests/rest_api/message/mixed_endpoint_technology_subscriptions/configs/ast1/pjsip.conf<br>A tests/rest_api/message/mixed_endpoint_technology_subscriptions/sipp/message.xml<br>A tests/rest_api/message/mixed_endpoint_technology_subscriptions/test-config.yaml<br>M tests/rest_api/message/tests.yaml<br>4 files changed, 124 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/tests/rest_api/message/mixed_endpoint_technology_subscriptions/configs/ast1/pjsip.conf b/tests/rest_api/message/mixed_endpoint_technology_subscriptions/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..57d5659</span><br><span>--- /dev/null</span><br><span>+++ b/tests/rest_api/message/mixed_endpoint_technology_subscriptions/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,20 @@</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%);">+[alice]</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%);">+allow=!all,ulaw,alaw</span><br><span style="color: hsl(120, 100%, 40%);">+transport=local-transport-udp</span><br><span style="color: hsl(120, 100%, 40%);">+aors=alice</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[alice]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:alice@127.0.0.1:5061\;transport=udp</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[alice-identify]</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:50601</span><br><span style="color: hsl(120, 100%, 40%);">+endpoint=alice</span><br><span>diff --git a/tests/rest_api/message/mixed_endpoint_technology_subscriptions/sipp/message.xml b/tests/rest_api/message/mixed_endpoint_technology_subscriptions/sipp/message.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..50a6256</span><br><span>--- /dev/null</span><br><span>+++ b/tests/rest_api/message/mixed_endpoint_technology_subscriptions/sipp/message.xml</span><br><span>@@ -0,0 +1,25 @@</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%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="Basic MESSAGE send and receive"></span><br><span style="color: hsl(120, 100%, 40%);">+  <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+    <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+      MESSAGE sip:alice@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+      From: alice <sip:alice@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+      To: <sip:asterisk@[remote_ip]:[remote_port]></span><br><span style="color: hsl(120, 100%, 40%);">+      Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+      CSeq: 1 MESSAGE</span><br><span style="color: hsl(120, 100%, 40%);">+      Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+      Expires: 3600</span><br><span style="color: hsl(120, 100%, 40%);">+      Content-Type: text/plain</span><br><span style="color: hsl(120, 100%, 40%);">+      Content-Length: 18</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+      Watson, come here.</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%);">+  </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  <recv response="202" rtd="true" /></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/rest_api/message/mixed_endpoint_technology_subscriptions/test-config.yaml b/tests/rest_api/message/mixed_endpoint_technology_subscriptions/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..965b399</span><br><span>--- /dev/null</span><br><span>+++ b/tests/rest_api/message/mixed_endpoint_technology_subscriptions/test-config.yaml</span><br><span>@@ -0,0 +1,78 @@</span><br><span style="color: hsl(120, 100%, 40%);">+testinfo:</span><br><span style="color: hsl(120, 100%, 40%);">+    summary: Test receiving a message from an endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+    description: |</span><br><span style="color: hsl(120, 100%, 40%);">+        This test covers mixed endpoint and technology subscriptions</span><br><span style="color: hsl(120, 100%, 40%);">+        to an endpoint and receiving a text message from said endpoint.</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%);">+    add-to-search-path:</span><br><span style="color: hsl(120, 100%, 40%);">+        - 'tests/rest_api/message'</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.AriTestObject</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: pluggable_modules.EventActionModule</span><br><span style="color: hsl(120, 100%, 40%);">+        -</span><br><span style="color: hsl(120, 100%, 40%);">+            config-section: message-sender</span><br><span style="color: hsl(120, 100%, 40%);">+            typename: 'message_modules.SIPMessageRunner'</span><br><span style="color: hsl(120, 100%, 40%);">+        -</span><br><span style="color: hsl(120, 100%, 40%);">+            config-section: message-subscriber</span><br><span style="color: hsl(120, 100%, 40%);">+            typename: 'message_modules.MessageSubscriber'</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%);">+    asterisk-instances: 1</span><br><span style="color: hsl(120, 100%, 40%);">+    test-iterations: None</span><br><span style="color: hsl(120, 100%, 40%);">+    apps: testsuite_technology,testsuite_endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+message-subscriber:</span><br><span style="color: hsl(120, 100%, 40%);">+    subscriptions:</span><br><span style="color: hsl(120, 100%, 40%);">+        - { event-source: 'endpoint:PJSIP/alice', app: 'testsuite_endpoint' }</span><br><span style="color: hsl(120, 100%, 40%);">+        - { event-source: 'endpoint:PJSIP', app: 'testsuite_technology' }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+message-sender:</span><br><span style="color: hsl(120, 100%, 40%);">+    sipp:</span><br><span style="color: hsl(120, 100%, 40%);">+        - { 'scenario':'message.xml', '-p':'5061' }</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%);">+    -   ari-events:</span><br><span style="color: hsl(120, 100%, 40%);">+            match:</span><br><span style="color: hsl(120, 100%, 40%);">+                type: TextMessageReceived</span><br><span style="color: hsl(120, 100%, 40%);">+                application: testsuite_technology</span><br><span style="color: hsl(120, 100%, 40%);">+                message:</span><br><span style="color: hsl(120, 100%, 40%);">+                    to: 'pjsip:asterisk@127.0.0.1'</span><br><span style="color: hsl(120, 100%, 40%);">+                    from: '"alice" <sip:alice@127.0.0.1>'</span><br><span style="color: hsl(120, 100%, 40%);">+                    body: 'Watson, come here.'</span><br><span style="color: hsl(120, 100%, 40%);">+                endpoint:</span><br><span style="color: hsl(120, 100%, 40%);">+                    technology: PJSIP</span><br><span style="color: hsl(120, 100%, 40%);">+                    resource: alice</span><br><span style="color: hsl(120, 100%, 40%);">+                    state: online</span><br><span style="color: hsl(120, 100%, 40%);">+            count: 1</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: TextMessageReceived</span><br><span style="color: hsl(120, 100%, 40%);">+                application: testsuite_endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+                message:</span><br><span style="color: hsl(120, 100%, 40%);">+                    to: 'pjsip:asterisk@127.0.0.1'</span><br><span style="color: hsl(120, 100%, 40%);">+                    from: '"alice" <sip:alice@127.0.0.1>'</span><br><span style="color: hsl(120, 100%, 40%);">+                    body: 'Watson, come here.'</span><br><span style="color: hsl(120, 100%, 40%);">+                endpoint:</span><br><span style="color: hsl(120, 100%, 40%);">+                    technology: PJSIP</span><br><span style="color: hsl(120, 100%, 40%);">+                    resource: alice</span><br><span style="color: hsl(120, 100%, 40%);">+                    state: online</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%);">+    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_endpoints</span><br><span style="color: hsl(120, 100%, 40%);">+        - asterisk : res_ari_applications</span><br><span style="color: hsl(120, 100%, 40%);">+        - asterisk : res_pjsip_messaging</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%);">+        - refleaks</span><br><span>diff --git a/tests/rest_api/message/tests.yaml b/tests/rest_api/message/tests.yaml</span><br><span>index f4164f7..ed1e566 100644</span><br><span>--- a/tests/rest_api/message/tests.yaml</span><br><span>+++ b/tests/rest_api/message/tests.yaml</span><br><span>@@ -1,3 +1,4 @@</span><br><span> tests:</span><br><span>     - dir: 'endpoint'</span><br><span>     - dir: 'technology'</span><br><span style="color: hsl(120, 100%, 40%);">+    - test: 'mixed_endpoint_technology_subscriptions'</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/testsuite/+/15346">change 15346</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/+/15346"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: 18 </div>
<div style="display:none"> Gerrit-Change-Id: I653b3ed9409906c3d6d7718dd0d853ca152d8b4c </div>
<div style="display:none"> Gerrit-Change-Number: 15346 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Jean Aunis - Prescom <jean.aunis@prescom.fr> </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-MessageType: merged </div>