[asterisk-commits] pjsip/qualify/call unreachable: Add test for calling unreach... (testsuite[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 7 10:30:00 CDT 2017


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/5755 )

Change subject: pjsip/qualify/call_unreachable: Add test for calling unreachable endpoint.
......................................................................


pjsip/qualify/call_unreachable: Add test for calling unreachable endpoint.

This change adds a test that attempts to place a call to an
unreachable endpoint. If no channel is created the test passes
while if a channel is created the test fails.

ASTERISK-26281

Change-Id: I486ae1297a4643e5b6e79778234affcf83eab5eb
---
A tests/channels/pjsip/qualify/call_unreachable/configs/ast1/extensions.conf
A tests/channels/pjsip/qualify/call_unreachable/configs/ast1/pjsip.conf
A tests/channels/pjsip/qualify/call_unreachable/test-config.yaml
M tests/channels/pjsip/qualify/tests.yaml
4 files changed, 96 insertions(+), 0 deletions(-)

Approvals:
  George Joseph: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/tests/channels/pjsip/qualify/call_unreachable/configs/ast1/extensions.conf b/tests/channels/pjsip/qualify/call_unreachable/configs/ast1/extensions.conf
new file mode 100644
index 0000000..5e3c353
--- /dev/null
+++ b/tests/channels/pjsip/qualify/call_unreachable/configs/ast1/extensions.conf
@@ -0,0 +1,16 @@
+
+[default]
+
+; -- Audio Source --
+
+exten => playback,1,NoOp()
+ same => n,Answer()
+ same => n,Playback(tt-monkeys)
+ same => n,Hangup()
+
+; -- Sender --
+
+exten => 1000,1,NoOp()
+ same => n,Dial(PJSIP/test)
+ same => n,ExecIf($[${DIALSTATUS}=CHANUNAVAIL]?UserEvent(TestResult,success)
+ same => n,Hangup()
diff --git a/tests/channels/pjsip/qualify/call_unreachable/configs/ast1/pjsip.conf b/tests/channels/pjsip/qualify/call_unreachable/configs/ast1/pjsip.conf
new file mode 100644
index 0000000..0059c9a
--- /dev/null
+++ b/tests/channels/pjsip/qualify/call_unreachable/configs/ast1/pjsip.conf
@@ -0,0 +1,19 @@
+[global]
+debug=yes
+
+[local-transport-udp]
+type=transport
+bind=127.0.0.1:5060
+protocol=udp
+
+[test]
+type=aor
+contact=sip:test at 127.0.0.2:5060
+qualify_frequency=1
+
+[test]
+type=endpoint
+aors=test
+context=default
+allow=!all,ulaw,alaw
+direct_media=no
diff --git a/tests/channels/pjsip/qualify/call_unreachable/test-config.yaml b/tests/channels/pjsip/qualify/call_unreachable/test-config.yaml
new file mode 100644
index 0000000..2f7a579
--- /dev/null
+++ b/tests/channels/pjsip/qualify/call_unreachable/test-config.yaml
@@ -0,0 +1,60 @@
+testinfo:
+    summary:     'Tests that calling an unreachable PJSIP endpoint does not result in a call'
+    description: |
+        This test sets up a PJSIP endpoint with an AOR that has qualify enabled to a contact
+        that is unreachable. A call is then placed from the Asterisk instance to the PJSIP
+        endpoint and it is confirmed that an outgoing channel is not created.
+
+test-modules:
+    test-object:
+        config-section: test-object-config
+        typename: 'test_case.TestCaseModule'
+    modules:
+        -
+            config-section: ami-config
+            typename: 'pluggable_modules.EventActionModule'
+        -
+            config-section: 'hangup-monitor'
+            typename: 'pluggable_modules.HangupMonitor'
+
+test-object-config:
+    asterisk-instances: 1
+    connect-ami: True
+
+ami-config:
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: 'ContactStatus'
+                    ContactStatus: 'Unreachable'
+                    AOR: 'test'
+            requirements:
+                match:
+                    EndpointName: 'test'
+            count: '1'
+        ami-actions:
+            action:
+                Action: 'Originate'
+                ActionID: '12345'
+                Channel: 'Local/1000 at default'
+                Exten: 'playback'
+                Context: 'default'
+                Priority: '1'
+    -
+        ami-events:
+            id: '0'
+            conditions:
+                match:
+                    Event: 'UserEvent'
+                    UserEvent: 'success'
+            count: 1
+
+hangup-monitor:
+    ids: '0'
+
+properties:
+    minversion: '13.17.0'
+    dependencies:
+        - asterisk : 'res_pjsip'
+
diff --git a/tests/channels/pjsip/qualify/tests.yaml b/tests/channels/pjsip/qualify/tests.yaml
index 930aa65..45f80e3 100644
--- a/tests/channels/pjsip/qualify/tests.yaml
+++ b/tests/channels/pjsip/qualify/tests.yaml
@@ -5,3 +5,4 @@
     - test: 'max_initial_qualify_time'
     - test: 'qualify_timeout'
     - test: 'no_qualify'
+    - test: 'call_unreachable'

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I486ae1297a4643e5b6e79778234affcf83eab5eb
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>



More information about the asterisk-commits mailing list