[Asterisk-code-review] channels/pjsip/ami/pjsip notify/channel: 3PCC patch for AMI ... (testsuite[13])

Richard Mudgett asteriskteam at digium.com
Wed Apr 11 18:19:05 CDT 2018


Richard Mudgett has uploaded this change for review. ( https://gerrit.asterisk.org/8771


Change subject: channels/pjsip/ami/pjsip_notify/channel: 3PCC patch for AMI "PJSIPNotify"
......................................................................

channels/pjsip/ami/pjsip_notify/channel: 3PCC patch for AMI "PJSIPNotify"

ASTERISK-27697

Change-Id: I2047ca031c3c00b17b2ea06f1008fb17f84846d0
---
A tests/channels/pjsip/ami/pjsip_notify/channel/configs/ast1/extensions.conf
A tests/channels/pjsip/ami/pjsip_notify/channel/configs/ast1/pjsip.conf
A tests/channels/pjsip/ami/pjsip_notify/channel/sipp/callee.xml
A tests/channels/pjsip/ami/pjsip_notify/channel/sipp/caller.xml
A tests/channels/pjsip/ami/pjsip_notify/channel/test-config.yaml
M tests/channels/pjsip/ami/pjsip_notify/tests.yaml
6 files changed, 278 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/71/8771/1

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

-- 
To view, visit https://gerrit.asterisk.org/8771
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: testsuite
Gerrit-Branch: 13
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2047ca031c3c00b17b2ea06f1008fb17f84846d0
Gerrit-Change-Number: 8771
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: lvl <digium at lvlconsultancy.nl>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180411/e5ac8709/attachment-0001.html>


More information about the asterisk-code-review mailing list