[asterisk-commits] Add blind transfer DTMF feature test coverage for GOTO ON BL... (testsuite[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Dec 28 09:44:35 CST 2015


Matt Jordan has submitted this change and it was merged.

Change subject: Add blind transfer DTMF feature test coverage for GOTO_ON_BLINDXFR.
......................................................................


Add blind transfer DTMF feature test coverage for GOTO_ON_BLINDXFR.

Adds testsuite coverage to ensure that GOTO_ON_BLINDXFR continues to
function for the blind transfer DTMF feature in the future.

The test performs two blind transfer scenarios to test that
GOTO_ON_BLINDXFR works when either the caller or callee is the
transferrer.

1) Make alice call bob which bob then blind transfers alice.  Bob is sent
to wherever GOTO_ON_BLINDXFR specifies.

2) Make charlie call david which charlie then blind transfers david.
Charlie is sent to wherever GOTO_ON_BLINDXFR specifies.

* Linked in tests/channels/pjsip/transfers/blind_transfer/off_nominal
tests that somehow weren't linked before.

ASTERISK-25641
Reported by Dmitry Melekhov

Change-Id: I714c120b2885d49e9d37f1de1b46b8294a1b5800
---
A tests/channels/pjsip/transfers/blind_transfer/goto_on_blindxfr/configs/ast1/extensions.conf
A tests/channels/pjsip/transfers/blind_transfer/goto_on_blindxfr/configs/ast1/features.conf
A tests/channels/pjsip/transfers/blind_transfer/goto_on_blindxfr/configs/ast1/pjsip.conf
A tests/channels/pjsip/transfers/blind_transfer/goto_on_blindxfr/test-config.yaml
M tests/channels/pjsip/transfers/blind_transfer/tests.yaml
5 files changed, 220 insertions(+), 3 deletions(-)

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



diff --git a/tests/channels/pjsip/transfers/blind_transfer/goto_on_blindxfr/configs/ast1/extensions.conf b/tests/channels/pjsip/transfers/blind_transfer/goto_on_blindxfr/configs/ast1/extensions.conf
new file mode 100644
index 0000000..d8b9b19
--- /dev/null
+++ b/tests/channels/pjsip/transfers/blind_transfer/goto_on_blindxfr/configs/ast1/extensions.conf
@@ -0,0 +1,63 @@
+[testsuite]
+
+; alice calls bob
+exten => alice,1,NoOp()
+same => n,Dial(PJSIP/bob,30,tb(pre_dial))
+same => n,UserEvent(dial_failed)
+same => n,Hangup()
+
+same => n(pre_dial),Set(GOTO_ON_BLINDXFR=testsuite,callee_xfrer,1)
+same => n,Return()
+
+exten => xfer_bob,1,NoOp()
+same => n,Answer()
+same => n,Echo()
+same => n,Hangup()
+
+; when bob answers he blind transfers alice to exten '2'
+exten => bob,1,NoOp()
+same => n,Answer(500)
+same => n,SendDTMF(#1www2)
+same => n,Echo()
+same => n,Hangup()
+
+; alice is blind transferred here
+exten => 2,1,NoOp()
+same => n,UserEvent(target_caller)
+same => n,Hangup()
+
+; bob is sent here by GOTO_ON_BLINDXFR
+exten => callee_xfrer,1,NoOp()
+same => n,UserEvent(callee_goto)
+same => n,Hangup()
+
+
+; charlie calls david
+exten => charlie,1,NoOp()
+same => n,Set(GOTO_ON_BLINDXFR=testsuite,caller_xfrer,1)
+same => n,Dial(PJSIP/david,30,T)
+same => n,UserEvent(dial_failed)
+same => n,Hangup()
+
+exten => david,1,NoOp()
+same => n,Answer()
+same => n,Echo()
+same => n,Hangup()
+
+; when david answers then charlie blind transfers david to exten '3'
+exten => xfer_david,1,NoOp()
+same => n,Answer(500)
+same => n,SendDTMF(#1www3)
+same => n,Echo()
+same => n,Hangup()
+
+; david is blind transferred here
+exten => 3,1,NoOp()
+same => n,UserEvent(target_callee)
+same => n,Hangup()
+
+; charlie is sent here by GOTO_ON_BLINDXFR
+exten => caller_xfrer,1,NoOp()
+same => n,UserEvent(caller_goto)
+same => n,Hangup()
+
diff --git a/tests/channels/pjsip/transfers/blind_transfer/goto_on_blindxfr/configs/ast1/features.conf b/tests/channels/pjsip/transfers/blind_transfer/goto_on_blindxfr/configs/ast1/features.conf
new file mode 100644
index 0000000..ee1e938
--- /dev/null
+++ b/tests/channels/pjsip/transfers/blind_transfer/goto_on_blindxfr/configs/ast1/features.conf
@@ -0,0 +1,5 @@
+[general]
+
+[featuremap]
+blindxfer => #1
+
diff --git a/tests/channels/pjsip/transfers/blind_transfer/goto_on_blindxfr/configs/ast1/pjsip.conf b/tests/channels/pjsip/transfers/blind_transfer/goto_on_blindxfr/configs/ast1/pjsip.conf
new file mode 100644
index 0000000..908c127
--- /dev/null
+++ b/tests/channels/pjsip/transfers/blind_transfer/goto_on_blindxfr/configs/ast1/pjsip.conf
@@ -0,0 +1,47 @@
+[global]
+type=global
+;debug=yes
+
+[local-transport]
+type=transport
+bind=127.0.0.1
+protocol=udp
+
+[my_endpoint](!)
+type=endpoint
+context=testsuite
+allow=!all,ulaw
+direct_media=no
+
+[alice](my_endpoint)
+from_user=alice
+aors=alice
+
+[alice]
+type=aor
+contact=sip:alice at 127.0.0.1:5060\;transport=udp
+
+[bob](my_endpoint)
+from_user=bob
+aors=bob
+
+[bob]
+type=aor
+contact=sip:bob at 127.0.0.1:5060\;transport=udp
+
+[charlie](my_endpoint)
+from_user=charlie
+aors=charlie
+
+[charlie]
+type=aor
+contact=sip:charlie at 127.0.0.1:5060\;transport=udp
+
+[david](my_endpoint)
+from_user=david
+aors=david
+
+[david]
+type=aor
+contact=sip:david at 127.0.0.1:5060\;transport=udp
+
diff --git a/tests/channels/pjsip/transfers/blind_transfer/goto_on_blindxfr/test-config.yaml b/tests/channels/pjsip/transfers/blind_transfer/goto_on_blindxfr/test-config.yaml
new file mode 100644
index 0000000..3d8a8ea
--- /dev/null
+++ b/tests/channels/pjsip/transfers/blind_transfer/goto_on_blindxfr/test-config.yaml
@@ -0,0 +1,101 @@
+testinfo:
+    summary:     'Tests GOTO_ON_BLINDXFR on caller and callee sides of a blind transfer'
+    description: |
+        'The test performs two blind transfer scenarios to test that
+        GOTO_ON_BLINDXFR works when either the caller or callee is the
+        transferrer.
+
+        1) Make alice call bob which bob then blind transfers alice.  Bob is sent
+        to wherever GOTO_ON_BLINDXFR specifies.
+
+        2) Make charlie call david which charlie then blind transfers david.
+        Charlie is sent to wherever GOTO_ON_BLINDXFR specifies.'
+
+test-modules:
+    test-object:
+        config-section: test-object-config
+        typename: 'test_case.TestCaseModule'
+    modules:
+        -
+            config-section: originator-config-alice
+            typename: 'pluggable_modules.Originator'
+        -
+            config-section: originator-config-charlie
+            typename: 'pluggable_modules.Originator'
+        -
+            config-section: 'ami-config'
+            typename: 'ami.AMIEventModule'
+
+test-object-config:
+    asterisk-instances: 1
+    connect-ami: True
+
+originator-config-alice:
+    trigger: 'ami_connect'
+    ignore-originate-failure: 'no'
+    id: '0'
+    channel: 'PJSIP/alice'
+    context: 'testsuite'
+    exten: 'xfer_bob'
+    priority: '1'
+    async: 'True'
+
+originator-config-charlie:
+    trigger: 'ami_connect'
+    ignore-originate-failure: 'no'
+    id: '0'
+    channel: 'PJSIP/charlie'
+    context: 'testsuite'
+    exten: 'xfer_david'
+    priority: '1'
+    async: 'True'
+
+ami-config:
+    -
+        type: 'headermatch'
+        id: '0'
+        conditions:
+            match:
+                Event: 'UserEvent'
+                UserEvent: 'target_caller'
+        count: '1'
+    -
+        type: 'headermatch'
+        id: '0'
+        conditions:
+            match:
+                Event: 'UserEvent'
+                UserEvent: 'callee_goto'
+        count: '1'
+    -
+        type: 'headermatch'
+        id: '0'
+        conditions:
+            match:
+                Event: 'UserEvent'
+                UserEvent: 'target_callee'
+        count: '1'
+    -
+        type: 'headermatch'
+        id: '0'
+        conditions:
+            match:
+                Event: 'UserEvent'
+                UserEvent: 'caller_goto'
+        count: '1'
+
+properties:
+    minversion: '13.8.0'
+    dependencies:
+        - python : twisted
+        - python : starpy
+        - asterisk : app_dial
+        - asterisk : app_echo
+        - asterisk : app_senddtmf
+        - asterisk : app_stack
+        - asterisk : app_userevent
+        - asterisk : chan_pjsip
+        - asterisk : res_pjsip
+    tags:
+        - pjsip
+
diff --git a/tests/channels/pjsip/transfers/blind_transfer/tests.yaml b/tests/channels/pjsip/transfers/blind_transfer/tests.yaml
index 8f83a80..da9a1be 100644
--- a/tests/channels/pjsip/transfers/blind_transfer/tests.yaml
+++ b/tests/channels/pjsip/transfers/blind_transfer/tests.yaml
@@ -1,10 +1,11 @@
 # Enter tests here in the order they should be considered for execution:
 tests:
+    - dir: 'off_nominal'
+    - test: 'callee_direct_media'
     - test: 'callee_refer_only'
     - test: 'callee_with_hold'
-    - test: 'callee_direct_media'
+    - test: 'caller_direct_media'
     - test: 'caller_refer_only'
     - test: 'caller_with_hold'
-    - test: 'caller_direct_media'
-
+    - test: 'goto_on_blindxfr'
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I714c120b2885d49e9d37f1de1b46b8294a1b5800
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>



More information about the asterisk-commits mailing list