[asterisk-commits] mjordan: testsuite/asterisk/trunk r5542 - in /asterisk/trunk/tests: cdr/ cdr/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Sep 5 17:40:12 CDT 2014


Author: mjordan
Date: Fri Sep  5 17:40:08 2014
New Revision: 5542

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=5542
Log:
tests/cdr: Add a subroutines test

This patch adds a test that verifies CDRs when those records are "set" during
execution of a Macro or a GoSub subroutine. It verifies CDRs have the correct
fields (including extension/context) in the following scenarios:
* Dialing 'normally'
* Dialing in a GoSub subroutine
* Dialing in a Macro
* Dialing in a GoSub called from a Macro called from a GoSub

This patch also adds the CDR tag to hangup handlers, as they cover
endbeforehexten logic.

Review: https://reviewboard.asterisk.org/r/3963/

ASTERISK-24254

Added:
    asterisk/trunk/tests/cdr/cdr_dial_subroutines/
    asterisk/trunk/tests/cdr/cdr_dial_subroutines/configs/
    asterisk/trunk/tests/cdr/cdr_dial_subroutines/configs/ast1/
    asterisk/trunk/tests/cdr/cdr_dial_subroutines/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/cdr/cdr_dial_subroutines/test-config.yaml   (with props)
Modified:
    asterisk/trunk/tests/cdr/tests.yaml
    asterisk/trunk/tests/hangup/handlers/test-config.yaml
    asterisk/trunk/tests/hangup/handlers_endbeforehexten/test-config.yaml

Added: asterisk/trunk/tests/cdr/cdr_dial_subroutines/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/cdr/cdr_dial_subroutines/configs/ast1/extensions.conf?view=auto&rev=5542
==============================================================================
--- asterisk/trunk/tests/cdr/cdr_dial_subroutines/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/cdr/cdr_dial_subroutines/configs/ast1/extensions.conf Fri Sep  5 17:40:08 2014
@@ -1,0 +1,51 @@
+[default]
+
+; Dial directly to 2000
+exten => 1000,1,NoOp()
+ same => n,Dial(Local/2000 at default/n)
+ same => n,Hangup()
+
+; Use a subroutine to dial 3000
+exten => 2000,1,NoOp()
+ same => n,GoSub(subroutines,dialer_2000,1)
+ same => n,Hangup()
+
+; Use a macro to dial 4000
+exten => 3000,1,NoOp()
+ same => n,Macro(dialer_3000)
+ same => n,Hangup()
+
+; Use a subroutine => macro => subroutine to dial 5000
+exten => 4000,1,NoOp()
+ same => n,GoSub(subroutines,dialer_4000,1)
+ same => n,Hangup()
+
+; Answer this silly chain
+exten => 5000,1,NoOp()
+ same => n,Answer()
+ same => n,Playback(beep)
+ same => n,Hangup()
+
+[subroutines]
+
+exten => dialer_2000,1,NoOp()
+ same => n,Dial(Local/3000 at default/n)
+ same => n,Return()
+
+exten => dialer_4000,1,NoOp()
+ same => n,Macro(dialer_4000)
+ same => n,Return()
+
+exten => dialer_4000_bounce_back,1,NoOp()
+ same => n,Dial(Local/5000 at default/n)
+ same => n,Return()
+
+[macro-dialer_3000]
+
+exten => s,1,NoOp()
+ same => n,Dial(Local/4000 at default/n)
+
+[macro-dialer_4000]
+
+exten => s,1,NoOp()
+ same => n,GoSub(subroutines,dialer_4000_bounce_back,1)

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

Propchange: asterisk/trunk/tests/cdr/cdr_dial_subroutines/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

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

Added: asterisk/trunk/tests/cdr/cdr_dial_subroutines/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/cdr/cdr_dial_subroutines/test-config.yaml?view=auto&rev=5542
==============================================================================
--- asterisk/trunk/tests/cdr/cdr_dial_subroutines/test-config.yaml (added)
+++ asterisk/trunk/tests/cdr/cdr_dial_subroutines/test-config.yaml Fri Sep  5 17:40:08 2014
@@ -1,0 +1,109 @@
+testinfo:
+    summary: 'Test that the destination/context is preserved in subroutines'
+    description: |
+        'Test that CDRs preserve the dialplan context/extension when they
+        are generated from within GoSub and Macro applications.'
+
+test-modules:
+    test-object:
+        config-section: test-object-config
+        typename: 'test_case.SimpleTestCase'
+    modules:
+        -
+            config-section: 'cdr-config'
+            typename: 'cdr.CDRModule'
+
+test-object-config:
+    spawn-after-hangup: True
+    end-test-delay: 2
+    test-iterations:
+        -
+            channel: 'Local/1000 at default'
+            application: 'Echo'
+            async: True
+
+cdr-config:
+    -
+        file: 'Master'
+        lines:
+            -
+            # 5000 at default -> (answer)
+                destination: '5000'
+                dcontext: 'default'
+                callerid: '"" <>'
+                channel: 'Local/5000 at default-.*'
+                dchannel: ''
+                lastapp: 'Hangup'
+                lastarg: ''
+                disposition: 'ANSWERED'
+                amaflags: 'DOCUMENTATION'
+            -
+            # 4000 at default -> 5000 at default
+                destination: '4000'
+                dcontext: 'default'
+                callerid: '"" <>'
+                channel: 'Local/4000 at default-.*'
+                dchannel: 'Local/5000 at default-.*'
+                lastapp: 'Dial'
+                lastarg: 'Local/5000 at default/n'
+                disposition: 'ANSWERED'
+                amaflags: 'DOCUMENTATION'
+            -
+            # 3000 at default -> 4000 at default
+                destination: '3000'
+                dcontext: 'default'
+                callerid: '"" <>'
+                channel: 'Local/3000 at default-.*'
+                dchannel: 'Local/4000 at default-.*'
+                lastapp: 'Dial'
+                lastarg: 'Local/4000 at default/n'
+                disposition: 'ANSWERED'
+                amaflags: 'DOCUMENTATION'
+            -
+            # 2000 at default -> 3000 at default
+                destination: '2000'
+                dcontext: 'default'
+                callerid: '"" <>'
+                channel: 'Local/2000 at default-.*'
+                dchannel: 'Local/3000 at default-.*'
+                lastapp: 'Dial'
+                lastarg: 'Local/3000 at default/n'
+                disposition: 'ANSWERED'
+                amaflags: 'DOCUMENTATION'
+            -
+            # 1000 at default -> 2000 at default
+                destination: '1000'
+                dcontext: 'default'
+                callerid: '"" <>'
+                channel: 'Local/1000 at default-.*'
+                dchannel: 'Local/2000 at default-.*'
+                lastapp: 'Dial'
+                lastarg: 'Local/2000 at default/n'
+                disposition: 'ANSWERED'
+                amaflags: 'DOCUMENTATION'
+            -
+            # caller with Echo app
+                destination: '1000'
+                dcontext: 'default'
+                callerid: '"" <>'
+                channel: 'Local/1000 at default-.*'
+                dchannel: ''
+                lastapp: 'Echo'
+                lastarg: ''
+                disposition: 'ANSWERED'
+                amaflags: 'DOCUMENTATION'
+
+properties:
+    minversion: '12.0.0'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'
+        - asterisk : 'cdr_csv'
+        - asterisk : 'app_dial'
+        - asterisk : 'app_echo'
+        - asterisk : 'app_macro'
+        - asterisk : 'app_playback'
+        - asterisk : 'app_stack'
+    tags:
+        - CDR
+        - chan_local

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

Propchange: asterisk/trunk/tests/cdr/cdr_dial_subroutines/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

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

Modified: asterisk/trunk/tests/cdr/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/cdr/tests.yaml?view=diff&rev=5542&r1=5541&r2=5542
==============================================================================
--- asterisk/trunk/tests/cdr/tests.yaml (original)
+++ asterisk/trunk/tests/cdr/tests.yaml Fri Sep  5 17:40:08 2014
@@ -15,4 +15,4 @@
     - dir: 'cdr_manipulation'
     - dir: 'cdr_properties'
     - test: 'sqlite3'
-
+    - test: 'cdr_dial_subroutines'

Modified: asterisk/trunk/tests/hangup/handlers/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/hangup/handlers/test-config.yaml?view=diff&rev=5542&r1=5541&r2=5542
==============================================================================
--- asterisk/trunk/tests/hangup/handlers/test-config.yaml (original)
+++ asterisk/trunk/tests/hangup/handlers/test-config.yaml Fri Sep  5 17:40:08 2014
@@ -12,3 +12,4 @@
         - asterisk: 'app_dial'
     tags:
         - hangup
+        - CDR

Modified: asterisk/trunk/tests/hangup/handlers_endbeforehexten/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/hangup/handlers_endbeforehexten/test-config.yaml?view=diff&rev=5542&r1=5541&r2=5542
==============================================================================
--- asterisk/trunk/tests/hangup/handlers_endbeforehexten/test-config.yaml (original)
+++ asterisk/trunk/tests/hangup/handlers_endbeforehexten/test-config.yaml Fri Sep  5 17:40:08 2014
@@ -12,3 +12,4 @@
         - asterisk: 'app_dial'
     tags:
         - hangup
+        - CDR




More information about the asterisk-commits mailing list