[Asterisk-code-review] pjsip: Test sending an unsolicited MWI NOTIFY after REGISTER... (testsuite[master])

Joshua Colp asteriskteam at digium.com
Mon Jun 22 06:23:59 CDT 2015


Joshua Colp has uploaded a new change for review.

  https://gerrit.asterisk.org/675

Change subject: pjsip: Test sending an unsolicited MWI NOTIFY after REGISTER with realtime.
......................................................................

pjsip: Test sending an unsolicited MWI NOTIFY after REGISTER with realtime.

This test mirrors the notify_after_register test but stores both the
endpoint and AOR within realtime. This confirms that even if the endpoint
or AOR don't exist within memory that the REGISTER still causes the unsolicited
MWI to get set up and the NOTIFY to get sent.

ASTERISK-25180

Change-Id: Iad59032c2dd4d518c015600e4ddf3ecdae438dc4
---
A tests/channels/pjsip/subscriptions/mwi/unsolicited/notify_after_register_realtime/configs/ast1/extconfig.conf
A tests/channels/pjsip/subscriptions/mwi/unsolicited/notify_after_register_realtime/configs/ast1/pjsip.conf
A tests/channels/pjsip/subscriptions/mwi/unsolicited/notify_after_register_realtime/configs/ast1/sorcery.conf
A tests/channels/pjsip/subscriptions/mwi/unsolicited/notify_after_register_realtime/configs/ast1/voicemail.conf
A tests/channels/pjsip/subscriptions/mwi/unsolicited/notify_after_register_realtime/sipp/notify_after_register.xml
A tests/channels/pjsip/subscriptions/mwi/unsolicited/notify_after_register_realtime/test-config.yaml
M tests/channels/pjsip/subscriptions/mwi/unsolicited/tests.yaml
7 files changed, 112 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/75/675/1

diff --git a/tests/channels/pjsip/subscriptions/mwi/unsolicited/notify_after_register_realtime/configs/ast1/extconfig.conf b/tests/channels/pjsip/subscriptions/mwi/unsolicited/notify_after_register_realtime/configs/ast1/extconfig.conf
new file mode 100644
index 0000000..81156d1
--- /dev/null
+++ b/tests/channels/pjsip/subscriptions/mwi/unsolicited/notify_after_register_realtime/configs/ast1/extconfig.conf
@@ -0,0 +1,4 @@
+[settings]
+endpoints => curl,http://localhost:46821/endpoint
+aors => curl,http://localhost:46821/aor
+
diff --git a/tests/channels/pjsip/subscriptions/mwi/unsolicited/notify_after_register_realtime/configs/ast1/pjsip.conf b/tests/channels/pjsip/subscriptions/mwi/unsolicited/notify_after_register_realtime/configs/ast1/pjsip.conf
new file mode 100644
index 0000000..54ad494
--- /dev/null
+++ b/tests/channels/pjsip/subscriptions/mwi/unsolicited/notify_after_register_realtime/configs/ast1/pjsip.conf
@@ -0,0 +1,4 @@
+[local-transport]
+type=transport
+bind=127.0.0.1
+protocol=udp
diff --git a/tests/channels/pjsip/subscriptions/mwi/unsolicited/notify_after_register_realtime/configs/ast1/sorcery.conf b/tests/channels/pjsip/subscriptions/mwi/unsolicited/notify_after_register_realtime/configs/ast1/sorcery.conf
new file mode 100644
index 0000000..83ccb4a
--- /dev/null
+++ b/tests/channels/pjsip/subscriptions/mwi/unsolicited/notify_after_register_realtime/configs/ast1/sorcery.conf
@@ -0,0 +1,3 @@
+[res_pjsip]
+endpoint=realtime,endpoints
+aor=realtime,aors
diff --git a/tests/channels/pjsip/subscriptions/mwi/unsolicited/notify_after_register_realtime/configs/ast1/voicemail.conf b/tests/channels/pjsip/subscriptions/mwi/unsolicited/notify_after_register_realtime/configs/ast1/voicemail.conf
new file mode 100644
index 0000000..253c745
--- /dev/null
+++ b/tests/channels/pjsip/subscriptions/mwi/unsolicited/notify_after_register_realtime/configs/ast1/voicemail.conf
@@ -0,0 +1,2 @@
+[default]
+1000 => 4242,Example Mailbox
diff --git a/tests/channels/pjsip/subscriptions/mwi/unsolicited/notify_after_register_realtime/sipp/notify_after_register.xml b/tests/channels/pjsip/subscriptions/mwi/unsolicited/notify_after_register_realtime/sipp/notify_after_register.xml
new file mode 100644
index 0000000..afe0fe9
--- /dev/null
+++ b/tests/channels/pjsip/subscriptions/mwi/unsolicited/notify_after_register_realtime/sipp/notify_after_register.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="NOTIFY after REGISTER">
+  <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: "[service]" <sip:[service]@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+        To: "[service]" <sip:[service]@[remote_ip]:[remote_port]>
+        Call-ID: [call_id]
+        CSeq: 1 REGISTER
+        Max-Forwards: 70
+        Contact: <sip:[service]@[local_ip]:[local_port]>;transport=[transport]
+        Subject: Performance Test
+        Content-Length: 0
+
+        ]]>
+  </send>
+
+  <recv response="200">
+
+  <recv request="NOTIFY" crlf="true"/>
+
+  <send>
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+</scenario>
diff --git a/tests/channels/pjsip/subscriptions/mwi/unsolicited/notify_after_register_realtime/test-config.yaml b/tests/channels/pjsip/subscriptions/mwi/unsolicited/notify_after_register_realtime/test-config.yaml
new file mode 100644
index 0000000..13182e6
--- /dev/null
+++ b/tests/channels/pjsip/subscriptions/mwi/unsolicited/notify_after_register_realtime/test-config.yaml
@@ -0,0 +1,57 @@
+testinfo:
+    summary:     'Ensures an unsolicited MWI notification is sent upon endpoint registration'
+    description: |
+        "This test starts up Asterisk and sipp. The scenario given to sipp is configured to
+        register to an AOR and then expect a NOTIFY message from Asterisk. Upon registration
+        Asterisk should send a NOTIFY message with MWI to the endpoint if it is configured
+        with unsolicited MWI. If this NOTIFY is not received the test fails. Unlike the other
+        test for this scenario the endpoint and AOR here are stored within realtime to ensure
+        that they do not exist in memory at all."
+
+
+properties:
+    minversion: '13.5.0'
+    dependencies:
+        - sipp :
+            version : 'v3.0'
+        - python: 'twisted'
+        - python: 'starpy'
+        - asterisk: 'res_pjsip'
+        - asterisk: 'res_config_curl'
+        - asterisk: 'res_pjsip_mwi'
+        - asterisk: 'res_sorcery_realtime'
+    tags:
+        - pjsip
+        - realtime
+
+test-modules:
+    add-test-to-search-path: 'True'
+    test-object:
+        config-section: sipp-config
+        typename: 'sipp.SIPpTestCase'
+    modules:
+        -
+            config-section: 'realtime-config'
+            typename: 'realtime_test_module.RealtimeTestModule'
+
+sipp-config:
+    reactor-timeout: 30
+    fail-on-any: True
+    test-iterations:
+        -
+            scenarios:
+                - { 'key-args': {'scenario': 'notify_after_register.xml', '-p': '5061', '-s': 'alice'} }
+
+realtime-config:
+    data:
+        endpoint:
+            -
+                id: 'alice'
+                allow: 'g722,ulaw,alaw'
+                context: 'default'
+                aors: 'alice'
+                mailboxes: '1000 at default'
+        aor:
+            -
+                id: 'alice'
+                max_contacts: '5'
diff --git a/tests/channels/pjsip/subscriptions/mwi/unsolicited/tests.yaml b/tests/channels/pjsip/subscriptions/mwi/unsolicited/tests.yaml
index c4ec75e..29a156c 100644
--- a/tests/channels/pjsip/subscriptions/mwi/unsolicited/tests.yaml
+++ b/tests/channels/pjsip/subscriptions/mwi/unsolicited/tests.yaml
@@ -3,3 +3,4 @@
     - test: 'mailbox_count_changes'
     - test: 'initial_notify'
     - test: 'notify_after_register'
+    - test: 'notify_after_register_realtime'

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iad59032c2dd4d518c015600e4ddf3ecdae438dc4
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Joshua Colp <jcolp at digium.com>



More information about the asterisk-code-review mailing list