<p>lvl has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/8515">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">channels/pjsip/ami/pjsip_notify/channel: 3PCC patch for AMI "PJSIPNotify"<br><br>ASTERISK-27697<br><br>Change-Id: I2047ca031c3c00b17b2ea06f1008fb17f84846d0<br>---<br>A tests/channels/pjsip/ami/pjsip_notify/channel/configs/ast1/extensions.conf<br>A tests/channels/pjsip/ami/pjsip_notify/channel/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/ami/pjsip_notify/channel/sipp/callee.xml<br>A tests/channels/pjsip/ami/pjsip_notify/channel/sipp/caller.xml<br>A tests/channels/pjsip/ami/pjsip_notify/channel/test-config.yaml<br>M tests/channels/pjsip/ami/pjsip_notify/tests.yaml<br>6 files changed, 278 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/15/8515/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/tests/channels/pjsip/ami/pjsip_notify/channel/configs/ast1/extensions.conf b/tests/channels/pjsip/ami/pjsip_notify/channel/configs/ast1/extensions.conf<br>new file mode 100644<br>index 0000000..35471e5<br>--- /dev/null<br>+++ b/tests/channels/pjsip/ami/pjsip_notify/channel/configs/ast1/extensions.conf<br>@@ -0,0 +1,3 @@<br>+[default]<br>+exten => callee,1,Dial(PJSIP/callee)<br>+<br>diff --git a/tests/channels/pjsip/ami/pjsip_notify/channel/configs/ast1/pjsip.conf b/tests/channels/pjsip/ami/pjsip_notify/channel/configs/ast1/pjsip.conf<br>new file mode 100644<br>index 0000000..3215e02<br>--- /dev/null<br>+++ b/tests/channels/pjsip/ami/pjsip_notify/channel/configs/ast1/pjsip.conf<br>@@ -0,0 +1,39 @@<br>+[system]<br>+type=system<br>+timer_t1=100<br>+timer_b=6400<br>+<br>+[local-transport-udp]<br>+type=transport<br>+bind=127.0.0.1<br>+protocol=udp<br>+<br>+[caller]<br>+type=endpoint<br>+aors=caller<br>+context=default<br>+allow=!all,ulaw<br>+rewrite_contact=yes<br>+direct_media=no<br>+<br>+[caller]<br>+type=aor<br>+max_contacts=1<br>+minimum_expiration=5<br>+default_expiration=30<br>+contact=sip:caller@127.0.0.1:5062<br>+<br>+[callee]<br>+type=endpoint<br>+aors=callee<br>+context=default<br>+allow=!all,ulaw<br>+rewrite_contact=yes<br>+direct_media=no<br>+<br>+[callee]<br>+type=aor<br>+max_contacts=1<br>+minimum_expiration=5<br>+default_expiration=30<br>+contact=sip:callee@127.0.0.1:5063<br>diff --git a/tests/channels/pjsip/ami/pjsip_notify/channel/sipp/callee.xml b/tests/channels/pjsip/ami/pjsip_notify/channel/sipp/callee.xml<br>new file mode 100644<br>index 0000000..0a7655b<br>--- /dev/null<br>+++ b/tests/channels/pjsip/ami/pjsip_notify/channel/sipp/callee.xml<br>@@ -0,0 +1,115 @@<br>+<?xml version="1.0" encoding="ISO-8859-1" ?><br>+<!DOCTYPE scenario SYSTEM "sipp.dtd"><br>+<br>+<scenario name="Notify Request with Call-ID"><br>+<br>+    <recv request="INVITE"><br>+        <action><br>+            <ereg regexp=": .*"<br>+                search_in="hdr"<br>+                header="Call-ID"<br>+                check_it="true"<br>+                assign_to="1"/><br>+            <ereg regexp=": .*"<br>+                search_in="hdr"<br>+                header="CSeq"<br>+                check_it="true"<br>+                assign_to="2"/><br>+            <log message="Received INVITE with Call-ID [$1] and CSeq [$2]." /><br>+        </action><br>+    </recv><br>+<br>+    <nop><br>+        <action><br>+            <assignstr assign_to="3" value="[last_Via:]" /><br>+        </action><br>+    </nop><br>+<br>+    <send><br>+      <![CDATA[<br>+<br>+      SIP/2.0 100 Trying<br>+      [last_Via:]<br>+      [last_From:]<br>+      [last_To:];tag=[pid]SIPpTag[call_number]<br>+      Call-ID: [call_id]<br>+      [last_CSeq:]<br>+      Contact: <sip:user1@[local_ip]:[local_port];transport=[transport]><br>+      Content-Length: 0<br>+      ]]><br>+    </send><br>+<br>+    <send><br>+      <![CDATA[<br>+<br>+      SIP/2.0 180 Ringing<br>+      [last_Via:]<br>+      [last_From:]<br>+      [last_To:];tag=[pid]SIPpTag[call_number]<br>+      Call-ID: [call_id]<br>+      [last_CSeq:]<br>+      Contact: <sip:user1@[local_ip]:[local_port];transport=[transport]><br>+      Content-Length: 0<br>+      ]]><br>+    </send><br>+<br>+    <recv request="NOTIFY"><br>+    </recv><br>+<br>+    <send><br>+      <![CDATA[<br>+<br>+      SIP/2.0 200 OK<br>+      [last_Via:]<br>+      [last_From:]<br>+      [last_To:]<br>+      Call-ID: [call_id]<br>+      [last_CSeq:]<br>+      Contact: <sip:user1@[local_ip]:[local_port];transport=[transport]><br>+      Content-Length: 0<br>+      ]]><br>+    </send><br>+<br>+    <send><br>+      <![CDATA[<br>+<br>+      SIP/2.0 200 OK<br>+      [$3]<br>+      [last_From:]<br>+      [last_To:]<br>+      Call-ID: [call_id]<br>+      CSeq[$2]<br>+      Contact: <sip:user1@[local_ip]:[local_port];transport=[transport]><br>+      Content-Type: application/sdp<br>+      Content-Length: [len]<br>+<br>+      v=0<br>+      o=user2 53655765 2353687637 IN IP[local_ip_type] [local_ip]<br>+      s=-<br>+      c=IN IP[local_ip_type] [local_ip]<br>+      t=0 0<br>+      m=audio 9000 RTP/AVP 0<br>+      a=rtpmap:8 PCMU/8000<br>+      ]]><br>+    </send><br>+<br>+    <recv request="ACK"><br>+    </recv><br>+<br>+    <recv request="BYE"><br>+    </recv><br>+<br>+    <send><br>+      <![CDATA[<br>+<br>+      SIP/2.0 200 OK<br>+      [last_Via:]<br>+      [last_From:]<br>+      [last_To:];tag=[pid]SIPpTag[call_number]<br>+      Call-ID: [call_id]<br>+      [last_CSeq:]<br>+      Contact: <sip:user1@[local_ip]:[local_port];transport=[transport]><br>+      Content-Length: 0<br>+      ]]><br>+    </send><br>+</scenario><br>diff --git a/tests/channels/pjsip/ami/pjsip_notify/channel/sipp/caller.xml b/tests/channels/pjsip/ami/pjsip_notify/channel/sipp/caller.xml<br>new file mode 100644<br>index 0000000..53d0781<br>--- /dev/null<br>+++ b/tests/channels/pjsip/ami/pjsip_notify/channel/sipp/caller.xml<br>@@ -0,0 +1,72 @@<br>+<?xml version="1.0" encoding="ISO-8859-1" ?><br>+<!DOCTYPE scenario SYSTEM "sipp.dtd"><br>+<br>+<scenario name="Notify Request with Call-ID"><br>+<br>+  <send retrans="500"><br>+    <![CDATA[<br>+      INVITE sip:callee@voxbone.com SIP/2.0<br>+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>+      From: caller <sip:caller@voxbone.com>;tag=[call_number]<br>+      To: callee <sip:callee@voxbone.com:[remote_port]><br>+      Call-ID: [call_id]<br>+      CSeq: 1 INVITE<br>+      Contact: sip:sipp@[local_ip]:[local_port]<br>+      Content-Type: application/sdp<br>+      Content-Length: [len]<br>+<br>+      v=0<br>+      o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]<br>+      s=-<br>+      c=IN IP[local_ip_type] [local_ip]<br>+      t=0 0<br>+      m=audio 9000 RTP/AVP 0<br>+      a=rtpmap:8 PCMU/8000<br>+    ]]><br>+  </send><br>+<br>+  <recv response="100" optional="true"><br>+  </recv><br>+<br>+  <recv response="180" optional="true"><br>+  </recv><br>+<br>+  <recv response="200"><br>+    <action><br>+      <ereg regexp=";tag=.*"<br>+        search_in="hdr"<br>+        header="To:"<br>+        check_it="true"<br>+        assign_to="1"/><br>+    </action><br>+  </recv><br>+<br>+  <send><br>+    <![CDATA[<br>+      ACK sip:callee@voxbone.com SIP/2.0<br>+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>+      From: caller <sip:caller@voxbone.com>;tag=[call_number]<br>+      To: callee <sip:callee@voxbone.com:[remote_port]>[$1]<br>+      Call-ID: [call_id]<br>+      CSeq: 2 ACK<br>+      Contact: sip:sipp@[local_ip]:[local_port]<br>+      Content-Length: 0<br>+    ]]><br>+  </send><br>+<br>+  <send><br>+    <![CDATA[<br>+      BYE sip:callee@voxbone.com SIP/2.0<br>+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>+      From: caller <sip:caller@voxbone.com>;tag=[call_number]<br>+      To: callee <sip:callee@voxbone.com:[remote_port]>[$1]<br>+      Call-ID: [call_id]<br>+      CSeq: 3 BYE<br>+      Contact: sip:sipp@[local_ip]:[local_port]<br>+      Content-Length: 0<br>+    ]]><br>+  </send><br>+<br>+  <recv response="200"><br>+  </recv><br>+</scenario><br>diff --git a/tests/channels/pjsip/ami/pjsip_notify/channel/test-config.yaml b/tests/channels/pjsip/ami/pjsip_notify/channel/test-config.yaml<br>new file mode 100644<br>index 0000000..cbf0853<br>--- /dev/null<br>+++ b/tests/channels/pjsip/ami/pjsip_notify/channel/test-config.yaml<br>@@ -0,0 +1,48 @@<br>+info:<br>+    summary: 'Test PJSIPNotify AMI Action for Channel'<br>+    description: |<br>+        This Tests the AMI Action PJSIPNotify with the<br>+        channel parameter given, generating an in-DIALOG<br>+        request.<br>+<br>+test-modules:<br>+    test-object:<br>+        config-section: test-object-config<br>+        typename: sipp.SIPpTestCase<br>+    modules:<br>+        -<br>+            config-section: ami-config<br>+            typename: 'pluggable_modules.EventActionModule'<br>+<br>+test-object-config:<br>+    fail-on-any: True<br>+    test-iterations:<br>+        -<br>+            scenarios:<br>+                - { 'key-args': { 'scenario': 'caller.xml', '-i': '127.0.0.1', '-p': '5062', '-trace_msg': '-pause_msg_ign' } }<br>+                - { 'key-args': { 'scenario': 'callee.xml', '-i': '127.0.0.1', '-p': '5063', '-trace_msg': '-pause_msg_ign' } }<br>+<br>+ami-config:<br>+    -<br>+        ami-events:<br>+            type: 'headermatch'<br>+            conditions:<br>+                match:<br>+                    Event: 'Newstate'<br>+                    Channel: 'PJSIP/callee-.*'<br>+                    ChannelStateDesc: 'Ringing'<br>+        ami-actions:<br>+            action:<br>+                Action: 'PJSIPNotify'<br>+                Channel: '{channel}'<br>+                Variable: 'Event=talk'<br>+<br>+properties:<br>+    minversion: [ '15.4.0' ]<br>+    dependencies:<br>+        - sipp :<br>+            version : 'v3.0'<br>+        - asterisk : 'chan_pjsip'<br>+    tags:<br>+        - PJSIP<br>+<br>diff --git a/tests/channels/pjsip/ami/pjsip_notify/tests.yaml b/tests/channels/pjsip/ami/pjsip_notify/tests.yaml<br>index acfccde..2bb7308 100644<br>--- a/tests/channels/pjsip/ami/pjsip_notify/tests.yaml<br>+++ b/tests/channels/pjsip/ami/pjsip_notify/tests.yaml<br>@@ -4,3 +4,4 @@<br>     - test: 'reserved_headers'<br>     - test: 'content'<br>     - test: 'to_uri'<br>+    - test: 'channel'<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8515">change 8515</a>. To unsubscribe, 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/8515"/><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-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I2047ca031c3c00b17b2ea06f1008fb17f84846d0 </div>
<div style="display:none"> Gerrit-Change-Number: 8515 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: lvl <digium@lvlconsultancy.nl> </div>