[asterisk-commits] pjsip/ami: Add test for PJSIPShowRegistrationInboundContactS... (testsuite[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Dec 8 16:59:13 CST 2016


Anonymous Coward #1000019 has submitted this change and it was merged. ( https://gerrit.asterisk.org/4573 )

Change subject: pjsip/ami: Add test for PJSIPShowRegistrationInboundContactStatuses
......................................................................


pjsip/ami: Add test for PJSIPShowRegistrationInboundContactStatuses

ASTERISK-26644

Change-Id: I46b1bb328de6024dec925775cade5d9646729ec6
---
A tests/channels/pjsip/ami/show_registration_inbound_contact_statuses/configs/ast1/pjsip.conf
A tests/channels/pjsip/ami/show_registration_inbound_contact_statuses/sipp/register.xml
A tests/channels/pjsip/ami/show_registration_inbound_contact_statuses/test-config.yaml
M tests/channels/pjsip/ami/tests.yaml
4 files changed, 153 insertions(+), 0 deletions(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



diff --git a/tests/channels/pjsip/ami/show_registration_inbound_contact_statuses/configs/ast1/pjsip.conf b/tests/channels/pjsip/ami/show_registration_inbound_contact_statuses/configs/ast1/pjsip.conf
new file mode 100644
index 0000000..60d26ae
--- /dev/null
+++ b/tests/channels/pjsip/ami/show_registration_inbound_contact_statuses/configs/ast1/pjsip.conf
@@ -0,0 +1,32 @@
+[local]
+type=transport
+protocol=udp
+bind=0.0.0.0
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[endpoint_t](!)
+type=endpoint
+transport=local
+context=default
+aors=user1
+direct_media=no
+disallow=all
+allow=ulaw
+
+[aor_t](!)
+type=aor
+max_contacts=1
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[user1](aor_t)
+
+[user1](endpoint_t)
+aors=user1
+
+[user2](aor_t)
+contact=sip:user2 at 127.0.0.1:5062
+
+[user2](endpoint_t)
+aors=user2
diff --git a/tests/channels/pjsip/ami/show_registration_inbound_contact_statuses/sipp/register.xml b/tests/channels/pjsip/ami/show_registration_inbound_contact_statuses/sipp/register.xml
new file mode 100644
index 0000000..a336fcd
--- /dev/null
+++ b/tests/channels/pjsip/ami/show_registration_inbound_contact_statuses/sipp/register.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Registration">
+    <send retrans="500">
+        <![CDATA[
+
+        REGISTER sip:[remote_ip]:[remote_port] SIP/2.0
+        Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+        From: "user1" <sip:user1@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+        To: "user1" <sip:user1@[remote_ip]:[remote_port]>
+        Call-ID: [call_id]
+        CSeq: 1 REGISTER
+        Max-Forwards: 70
+        Contact: <sip:user1@[local_ip]:[local_port]>;transport=[transport]
+        Subject: Performance Test
+        User-Agent: SIPP-Test-Registration
+        Content-Length: 0
+
+        ]]>
+    </send>
+
+    <recv response="200" rtd="true" />
+</scenario>
diff --git a/tests/channels/pjsip/ami/show_registration_inbound_contact_statuses/test-config.yaml b/tests/channels/pjsip/ami/show_registration_inbound_contact_statuses/test-config.yaml
new file mode 100644
index 0000000..196aff5
--- /dev/null
+++ b/tests/channels/pjsip/ami/show_registration_inbound_contact_statuses/test-config.yaml
@@ -0,0 +1,96 @@
+testinfo:
+    summary: 'Test PJSIPShowRegistrationsInbound AMI command'
+    description: |
+        Tests the AMI command PJSIPShowRegistrationsInbound in order to make
+        sure the events are appropriately raised.
+
+properties:
+    minversion: ['13.14.0', '14.3.0']
+    dependencies:
+        - buildoption: 'TEST_FRAMEWORK'
+        - sipp :
+            version : 'v3.0'
+        - asterisk : 'res_pjsip'
+        - asterisk : 'res_pjsip_registrar'
+
+    tags:
+        - pjsip
+
+test-modules:
+    test-object:
+        config-section: sipp-config
+        typename: 'sipp.SIPpTestCase'
+    modules:
+        -
+            config-section: 'ami-config'
+            typename: 'pluggable_modules.EventActionModule'
+
+sipp-config:
+    connect-ami: True
+    reactor-timeout: 15
+    fail-on-any: True
+    test-iterations:
+        -
+            scenarios:
+                - { 'key-args': {'scenario': 'register.xml', '-p': '5061'} }
+
+ami-config:
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: 'ContactStatus'
+                    ContactStatus: 'Created'
+            requirements:
+                match:
+                    AOR: 'user1'
+            count: '>1'
+        ami-actions:
+            action:
+                Action: 'PJSIPShowRegistrationInboundContactStatuses'
+                ActionID: '12345'
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: 'ContactStatusDetail'
+                    URI: sip:user1 at 127.0.0.1:5061
+            requirements:
+                match:
+                    ActionID: '12345'
+                    AOR: 'user1'
+                    EndpointName: 'user1'
+                    UserAgent: 'SIPP-Test-Registration'
+                    RegExpire: '[0-9]+'
+                    ViaAddress: '127.0.0.1:5061'
+                    CallID: '.+'
+                    ID: 'user1;@.+'
+                    AuthenticateQualify: '0'
+            count: '>1'
+#
+#  We must NOT get this contact.  It's static.
+#
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: 'ContactStatusDetail'
+                    URI: sip:user2 at 127.0.0.1:5062
+            requirements:
+                match:
+                    ActionID: '12345'
+                    AOR: 'user2'
+                    EndpointName: 'user2'
+            count: '0'
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: 'ContactStatusDetailComplete'
+            requirements:
+                match:
+                    ActionID: '12345'
+                    EventList: 'Complete'
+                    ListItems: '1'
+            count: '>1'
+        stop_test:
diff --git a/tests/channels/pjsip/ami/tests.yaml b/tests/channels/pjsip/ami/tests.yaml
index 921b1ec..a31db94 100644
--- a/tests/channels/pjsip/ami/tests.yaml
+++ b/tests/channels/pjsip/ami/tests.yaml
@@ -5,5 +5,6 @@
     - test: 'show_endpoints'
     - test: 'show_endpoint'
     - test: 'show_registrations_inbound'
+    - test: 'show_registration_inbound_contact_statuses'
     - test: 'show_registrations_outbound'
     - test: 'show_subscriptions'

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I46b1bb328de6024dec925775cade5d9646729ec6
Gerrit-PatchSet: 2
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-commits mailing list