[svn-commits] rmudgett: branch rmudgett/cel_accountcode r5283 - in /asterisk/team/rmudgett/...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sat Jul 19 18:28:11 CDT 2014


Author: rmudgett
Date: Sat Jul 19 18:28:07 2014
New Revision: 5283

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=5283
Log:
testsuite: Fix tests/cdr/sqlite3 to work with the new accountcode propagation rules.

* Made pluggable_modules.py Originator class and test_case.py
SimpleTestCase class call origination allow specifying the accountcode.

Modified:
    asterisk/team/rmudgett/cel_accountcode/lib/python/asterisk/pluggable_modules.py
    asterisk/team/rmudgett/cel_accountcode/lib/python/asterisk/test_case.py
    asterisk/team/rmudgett/cel_accountcode/tests/cdr/sqlite3/test-config.yaml

Modified: asterisk/team/rmudgett/cel_accountcode/lib/python/asterisk/pluggable_modules.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/rmudgett/cel_accountcode/lib/python/asterisk/pluggable_modules.py?view=diff&rev=5283&r1=5282&r2=5283
==============================================================================
--- asterisk/team/rmudgett/cel_accountcode/lib/python/asterisk/pluggable_modules.py (original)
+++ asterisk/team/rmudgett/cel_accountcode/lib/python/asterisk/pluggable_modules.py Sat Jul 19 18:28:07 2014
@@ -42,6 +42,7 @@
             'scenario-trigger-after': None,
             'scenario-name': None,
             'id': '0',
+            'account': None,
             'async': 'False',
             'event': None,
             'timeout': None,
@@ -111,12 +112,14 @@
                                exten=self.config['exten'],
                                priority=self.config['priority'],
                                timeout=self.config['timeout'],
+                               account=self.config['account'],
                                async=self.config['async'])
         else:
             deferred = self.ami.originate(channel=self.config['channel'],
                                application=self.config['application'],
                                data=self.config['data'],
                                timeout=self.config['timeout'],
+                               account=self.config['account'],
                                async=self.config['async'])
         deferred.addErrback(self.failure)
 

Modified: asterisk/team/rmudgett/cel_accountcode/lib/python/asterisk/test_case.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/rmudgett/cel_accountcode/lib/python/asterisk/test_case.py?view=diff&rev=5283&r1=5282&r2=5283
==============================================================================
--- asterisk/team/rmudgett/cel_accountcode/lib/python/asterisk/test_case.py (original)
+++ asterisk/team/rmudgett/cel_accountcode/lib/python/asterisk/test_case.py Sat Jul 19 18:28:07 2014
@@ -728,6 +728,8 @@
         # unique ID we've assigned, allowing us to associate the Asterisk
         # channel name with the channel we originated
         msg = "Originating call to %s" % call_details['channel']
+        if 'account' not in call_details:
+            call_details['account'] = None
         if 'async' not in call_details:
             call_details['async'] = False
         if 'channelid' not in call_details:
@@ -739,6 +741,7 @@
             deferred = ami.originate(channel=call_details['channel'],
                                      application=call_details['application'],
                                      variable=call_details['variable'],
+                                     account=call_details['account'],
                                      async=call_details['async'],
                                      channelid=call_details['channelid'],
                                      otherchannelid=call_details['otherchannelid'])
@@ -751,6 +754,7 @@
                                      exten=call_details['exten'],
                                      priority=call_details['priority'],
                                      variable=call_details['variable'],
+                                     account=call_details['account'],
                                      async=call_details['async'],
                                      channelid=call_details['channelid'],
                                      otherchannelid=call_details['otherchannelid'])

Modified: asterisk/team/rmudgett/cel_accountcode/tests/cdr/sqlite3/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/rmudgett/cel_accountcode/tests/cdr/sqlite3/test-config.yaml?view=diff&rev=5283&r1=5282&r2=5283
==============================================================================
--- asterisk/team/rmudgett/cel_accountcode/tests/cdr/sqlite3/test-config.yaml (original)
+++ asterisk/team/rmudgett/cel_accountcode/tests/cdr/sqlite3/test-config.yaml Sat Jul 19 18:28:07 2014
@@ -22,7 +22,12 @@
     modules:
         -
             minversion: '12.0.0'
+            maxversion: '12'
             config-section: 'cdr-config-12'
+            typename: 'cdr_sqlite3.CDRSQLite3Verifier'
+        -
+            minversion: '13.0.0'
+            config-section: 'cdr-config-13'
             typename: 'cdr_sqlite3.CDRSQLite3Verifier'
         -
             config-section: 'hangup-monitor'
@@ -33,6 +38,7 @@
     test-iterations:
         -
             channel: 'Local/1000 at default'
+            account: 'orig_foo'
             application: 'Echo'
             async: True
 
@@ -83,6 +89,50 @@
                 test_caller: ''
                 test_callee: ''
 
+cdr-config-13:
+    -
+        asterisk-instance: 0
+        lines:
+            -
+                clid: '"Alice" <555-5555>'
+                dcontext: 'default'
+                channel: 'Local/1000 at default-.{8};2'
+                dstchannel: 'Local/target at default-.{7}1;'
+                lastapp: 'Dial'
+                lastdata: 'Local/target.*'
+                disposition: 'ANSWERED'
+                amaflags: 'BILLING'
+                accountcode: 'foobar'
+                userfield: 'caller_userfield;callee_userfield'
+                test_caller: 'caller_value'
+                test_callee: 'callee_value'
+            -
+                clid: '"" <>'
+                dcontext: 'default'
+                channel: 'Local/1000 at default-.{8};1'
+                dstchannel: ''
+                lastapp: 'Echo'
+                lastdata: ''
+                disposition: 'ANSWERED'
+                amaflags: 'BILLING'
+                accountcode: 'orig_foo'
+                userfield: ''
+                test_caller: ''
+                test_callee: ''
+            -
+                clid: '"Alice" <555-5555>'
+                dcontext: 'default'
+                channel: 'Local/target at default-.{8};2'
+                dstchannel: ''
+                lastapp: 'Echo'
+                lastdata: ''
+                disposition: 'ANSWERED'
+                amaflags: 'OMIT'
+                accountcode: 'foobar'
+                userfield: ''
+                test_caller: ''
+                test_callee: ''
+
 properties:
     minversion: '12.0.0'
     dependencies:




More information about the svn-commits mailing list