Author: mmichelson
Date: Fri Nov 21 11:22:56 2014
New Revision: 5985

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=5985
Log:
Add test for transfer retries option.

This adds a test that performs two scenarios:
1) The transferer attempts a transfer but dials the incorrect
extension. The transferer is then given another attempt to dial
the correct extension and dials the correct one this time. Ensure
the transfer succeeds.
2) The FEATURE() dialplan function sets the number of attempts
for the transfer to 1. The transferer attempts a transfer but dials
the incorrect extension. The transfer attempt should fail at this
point since no retries are permitted.


Added:
    asterisk/trunk/tests/bridge/atxfer_retries/
    asterisk/trunk/tests/bridge/atxfer_retries/configs/
    asterisk/trunk/tests/bridge/atxfer_retries/configs/ast1/
    asterisk/trunk/tests/bridge/atxfer_retries/configs/ast1/extensions.conf   
(with props)
    asterisk/trunk/tests/bridge/atxfer_retries/configs/ast1/features.conf   
(with props)
    asterisk/trunk/tests/bridge/atxfer_retries/test-config.yaml   (with props)
Modified:
    asterisk/trunk/tests/bridge/tests.yaml

Added: asterisk/trunk/tests/bridge/atxfer_retries/configs/ast1/extensions.conf
URL: 
http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/bridge/atxfer_retries/configs/ast1/extensions.conf?view=auto&rev=5985
==============================================================================
--- asterisk/trunk/tests/bridge/atxfer_retries/configs/ast1/extensions.conf 
(added)
+++ asterisk/trunk/tests/bridge/atxfer_retries/configs/ast1/extensions.conf Fri 
Nov 21 11:22:56 2014
@@ -1,0 +1,40 @@
+[default]
+
+exten => alice,1,NoOp()
+       same => n,Dial(Local/bob@default,,tT)
+
+exten => alice2,1,NoOp()
+       same => n,Set(FEATURE(transferdialattempts)=1)
+       same => n,Dial(Local/bob@default,,tT)
+
+exten => bob,1,NoOp()
+       same => n,Answer()
+       same => n,Echo()
+
+exten => 1234,1,NoOp()
+       same => n,Answer()
+       same => n,Echo()
+
+exten => sendDTMF,1,NoOp()
+       same => n,Verbose(1, Sending DTMF Signal ${DTMF_TO_SEND})
+       same => n,SendDTMF(${DTMF_TO_SEND})
+       same => n,Goto(default,wait,1)
+
+exten => sendAudio,1,NoOp()
+       same => n,Verbose(1, Sending audio file ${TALK_AUDIO})
+       same => n,Playback(${TALK_AUDIO})
+       same => n,Goto(default,wait,1)
+
+exten => sendAudioWithDTMF,1,NoOp()
+       same => n,Verbose(1, Sending audio file ${TALK_AUDIO})
+       same => n,Playback(${TALK_AUDIO})
+       same => n,Verbose(1, Sending DTMF Signal ${DTMF_TO_SEND})
+       same => n,SendDTMF(${DTMF_TO_SEND})
+       same => n,Goto(default,wait,1)
+
+exten => hangup,1,NoOp()
+       same => n,Verbose(1, Hanging up)
+       same => n,Hangup()
+
+exten => wait,1,NoOp()
+       same => n,Wait(10000)

Propchange: 
asterisk/trunk/tests/bridge/atxfer_retries/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
asterisk/trunk/tests/bridge/atxfer_retries/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = 'Author Date Id Revision'

Propchange: 
asterisk/trunk/tests/bridge/atxfer_retries/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/bridge/atxfer_retries/configs/ast1/features.conf
URL: 
http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/bridge/atxfer_retries/configs/ast1/features.conf?view=auto&rev=5985
==============================================================================
--- asterisk/trunk/tests/bridge/atxfer_retries/configs/ast1/features.conf 
(added)
+++ asterisk/trunk/tests/bridge/atxfer_retries/configs/ast1/features.conf Fri 
Nov 21 11:22:56 2014
@@ -1,0 +1,5 @@
+[general]
+transferdialattempts = 3
+
+[featuremap]
+atxfer = *2

Propchange: 
asterisk/trunk/tests/bridge/atxfer_retries/configs/ast1/features.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
asterisk/trunk/tests/bridge/atxfer_retries/configs/ast1/features.conf
------------------------------------------------------------------------------
    svn:keywords = 'Author Date Id Revision'

Propchange: 
asterisk/trunk/tests/bridge/atxfer_retries/configs/ast1/features.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/bridge/atxfer_retries/test-config.yaml
URL: 
http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/bridge/atxfer_retries/test-config.yaml?view=auto&rev=5985
==============================================================================
--- asterisk/trunk/tests/bridge/atxfer_retries/test-config.yaml (added)
+++ asterisk/trunk/tests/bridge/atxfer_retries/test-config.yaml Fri Nov 21 
11:22:56 2014
@@ -1,0 +1,193 @@
+testinfo:
+    summary: 'Ensure that dialing a transfer extension can be re-attempted.'
+    description: |
+        'This test consists of two separate calls:
+        On call #1: Alice calls Bob. Alice initiates an attended transfer. 
Alice dials
+        a non-existent extension. Alice should then be given another attempt 
to transfer.
+        Alice then dials a real extension. The transfer should succeed.
+
+        On call #2: The FEATURE() dialplan function is used to alter the 
number of transfer
+        attempts from the default to 1. Alice initiates an attended transfer. 
Alice dials
+        a non-existent extension. The transfer attempt should fail, and Alice 
and Bob should
+        be bridged with each other again.'
+
+test-modules:
+    test-object:
+        config-section: app-config
+        typename: 'apptest.AppTest'
+
+app-config:
+    app: 'Dial'
+    scenarios:
+        -
+            # Call 1. See testinfo description for details.
+            channels:
+                -
+                    channel-id: 'Alice'
+                    channel-name: 'Local/alice@default'
+                    context: 'default'
+                    exten: 'wait'
+                    start-on-create: True
+                    events:
+                        -
+                            type: 'headermatch'
+                            conditions:
+                                match:
+                                    Event: 'BridgeEnter'
+                            actions:
+                                -
+                                    action-type: 'set-expected-result'
+                                    expected-result: 'Alice is bridged'
+                                -
+                                    action-type: 'send-dtmf'
+                                    dtmf: '*2'
+                                    delay: 2
+                        -
+                            type: 'headermatch'
+                            conditions:
+                                match:
+                                    Event: 'TestEvent'
+                                    State: 'TRANSFER_BEGIN_DIAL'
+                                    Attempt: '1'
+                            actions:
+                                -
+                                    action-type: 'set-expected-result'
+                                    expected-result: 'Begin first extension 
dial'
+                                -
+                                    action-type: 'send-dtmf'
+                                    dtmf: '1235'
+                        -
+                            type: 'headermatch'
+                            conditions:
+                                match:
+                                    Event: 'TestEvent'
+                                    State: 'TRANSFER_DIALLED'
+                                    Attempt: '1'
+                                    Dialled: '1235'
+                                    Result: 'Failure'
+                            actions:
+                                -
+                                    action-type: 'set-expected-result'
+                                    expected-result: 'End first extension 
dial(failed)'
+                        -
+                            type: 'headermatch'
+                            conditions:
+                                match:
+                                    Event: 'TestEvent'
+                                    State: 'TRANSFER_BEGIN_DIAL'
+                                    Attempt: '2'
+                            actions:
+                                -
+                                    action-type: 'set-expected-result'
+                                    expected-result: 'Begin second extension 
dial'
+                                -
+                                    action-type: 'send-dtmf'
+                                    dtmf: '1234'
+                        -
+                            type: 'headermatch'
+                            conditions:
+                                match:
+                                    Event: 'TestEvent'
+                                    State: 'TRANSFER_DIALLED'
+                                    Attempt: '2'
+                                    Dialled: '1234'
+                                    Result: 'Success'
+                            actions:
+                                -
+                                    action-type: 'set-expected-result'
+                                    expected-result: 'End second extension 
dial(succeeded)'
+                        -
+                            type: 'headermatch'
+                            conditions:
+                                match:
+                                    Event: 'TestEvent'
+                                    State: 'TRANSFER_DIAL_FINAL'
+                                    Result: 'Success'
+                            actions:
+                                -
+                                    action-type: 'set-expected-result'
+                                    expected-result: 'Transfer succeeded'
+                                -
+                                    action-type: 'hangup'
+                                    delay: 2
+                                -
+                                    action-type: 'send-ami-message'
+                                    fields: {'Channel': '/.*/'}
+                                -
+                                    action-type: 'end-scenario'
+        -
+            # Call 2. See testinfo description for details.
+            channels:
+                -
+                    channel-id: 'Alice'
+                    channel-name: 'Local/alice2@default'
+                    context: 'default'
+                    exten: 'wait'
+                    start-on-create: True
+                    events:
+                        -
+                            type: 'headermatch'
+                            conditions:
+                                match:
+                                    Event: 'BridgeEnter'
+                            actions:
+                                -
+                                    action-type: 'set-expected-result'
+                                    expected-result: 'Alice is bridged'
+                                -
+                                    action-type: 'send-dtmf'
+                                    dtmf: '*2'
+                                    delay: 2
+                        -
+                            type: 'headermatch'
+                            conditions:
+                                match:
+                                    Event: 'TestEvent'
+                                    State: 'TRANSFER_BEGIN_DIAL'
+                                    Attempt: '1'
+                            actions:
+                                -
+                                    action-type: 'set-expected-result'
+                                    expected-result: 'Begin first extension 
dial'
+                                -
+                                    action-type: 'send-dtmf'
+                                    dtmf: '1235'
+                        -
+                            type: 'headermatch'
+                            conditions:
+                                match:
+                                    Event: 'TestEvent'
+                                    State: 'TRANSFER_DIALLED'
+                                    Attempt: '1'
+                                    Dialled: '1235'
+                                    Result: 'Failure'
+                            actions:
+                                -
+                                    action-type: 'set-expected-result'
+                                    expected-result: 'End first extension 
dial(failed)'
+                        -
+                            type: 'headermatch'
+                            conditions:
+                                match:
+                                    Event: 'TestEvent'
+                                    State: 'TRANSFER_DIAL_FINAL'
+                                    Result: 'Failure'
+                            actions:
+                                -
+                                    action-type: 'set-expected-result'
+                                    expected-result: 'Transfer Failed'
+                                -
+                                    action-type: 'hangup'
+                                    delay: 2
+                                -
+                                    action-type: 'end-scenario'
+
+
+properties:
+    minversion: '13.1.0'
+    dependencies:
+        - buildoption: 'TEST_FRAMEWORK'
+        - python : 'twisted'
+        - python : 'starpy'
+    tags:
+        - bridge

Propchange: asterisk/trunk/tests/bridge/atxfer_retries/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/bridge/atxfer_retries/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = 'Author Date Id Revision'

Propchange: asterisk/trunk/tests/bridge/atxfer_retries/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: asterisk/trunk/tests/bridge/tests.yaml
URL: 
http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/bridge/tests.yaml?view=diff&rev=5985&r1=5984&r2=5985
==============================================================================
--- asterisk/trunk/tests/bridge/tests.yaml (original)
+++ asterisk/trunk/tests/bridge/tests.yaml Fri Nov 21 11:22:56 2014
@@ -21,3 +21,4 @@
     - test: 'transfer_failure'
     - test: 'bridge_action'
     - test: 'atxfer_threeway_nominal'
+    - test: 'atxfer_retries'


-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits

Reply via email to