[asterisk-commits] pabelanger: testsuite/asterisk/trunk r2998 - in /asterisk/trunk: lib/python/a...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jan 19 16:33:54 CST 2012


Author: pabelanger
Date: Thu Jan 19 16:33:51 2012
New Revision: 2998

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=2998
Log:
Fix CDR test under 1.4 and 1.6.2

It seems when asterisk detect a 482 Loop on a SIP channel with these versions
the call will be forwarded via a Local channel. So, we must expect a different
result.


Modified:
    asterisk/trunk/lib/python/asterisk/TestCase.py
    asterisk/trunk/tests/cdr/console_dial_sip_answer/configs/ast1/branch-1.4/sip.conf
    asterisk/trunk/tests/cdr/console_dial_sip_answer/configs/ast1/extensions.conf
    asterisk/trunk/tests/cdr/console_dial_sip_answer/configs/ast1/sip.conf
    asterisk/trunk/tests/cdr/console_dial_sip_answer/run-test

Modified: asterisk/trunk/lib/python/asterisk/TestCase.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/lib/python/asterisk/TestCase.py?view=diff&rev=2998&r1=2997&r2=2998
==============================================================================
--- asterisk/trunk/lib/python/asterisk/TestCase.py (original)
+++ asterisk/trunk/lib/python/asterisk/TestCase.py Thu Jan 19 16:33:51 2012
@@ -20,6 +20,8 @@
 from TestConfig import TestConfig
 from TestConditions import TestConditionController, TestCondition
 from ThreadTestCondition import ThreadPreTestCondition, ThreadPostTestCondition
+from version import AsteriskVersion
+
 
 try:
     from pcap_listener import PcapListener
@@ -58,6 +60,7 @@
         self.pcap = None
         self.pcapfilename = None
         self.testlogdir = os.path.join(Asterisk.test_suite_root, self.base, str(os.getpid()))
+        self.ast_version = AsteriskVersion()
 
         os.makedirs(self.testlogdir)
 

Modified: asterisk/trunk/tests/cdr/console_dial_sip_answer/configs/ast1/branch-1.4/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/cdr/console_dial_sip_answer/configs/ast1/branch-1.4/sip.conf?view=diff&rev=2998&r1=2997&r2=2998
==============================================================================
--- asterisk/trunk/tests/cdr/console_dial_sip_answer/configs/ast1/branch-1.4/sip.conf (original)
+++ asterisk/trunk/tests/cdr/console_dial_sip_answer/configs/ast1/branch-1.4/sip.conf Thu Jan 19 16:33:51 2012
@@ -7,3 +7,4 @@
 type=peer
 host=127.0.0.1
 accountcode=cdrtest_sip
+context=test

Modified: asterisk/trunk/tests/cdr/console_dial_sip_answer/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/cdr/console_dial_sip_answer/configs/ast1/extensions.conf?view=diff&rev=2998&r1=2997&r2=2998
==============================================================================
--- asterisk/trunk/tests/cdr/console_dial_sip_answer/configs/ast1/extensions.conf (original)
+++ asterisk/trunk/tests/cdr/console_dial_sip_answer/configs/ast1/extensions.conf Thu Jan 19 16:33:51 2012
@@ -7,8 +7,10 @@
 [default]
 exten => 1,1,NoOp()
 exten => 1,n,Set(CDR(accountcode)=cdrtest_local)
-exten => 1,n,Dial(SIP/2 at test)
+exten => 1,n,Dial(SIP/test/2)
 
+[test]
 exten => 2,1,NoOp()
+exten => 2,n,Set(CDR(accountcode)=cdrtest_sip)
 exten => 2,n,Answer()
 exten => 2,n,HangUp()

Modified: asterisk/trunk/tests/cdr/console_dial_sip_answer/configs/ast1/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/cdr/console_dial_sip_answer/configs/ast1/sip.conf?view=diff&rev=2998&r1=2997&r2=2998
==============================================================================
--- asterisk/trunk/tests/cdr/console_dial_sip_answer/configs/ast1/sip.conf (original)
+++ asterisk/trunk/tests/cdr/console_dial_sip_answer/configs/ast1/sip.conf Thu Jan 19 16:33:51 2012
@@ -7,3 +7,4 @@
 type=peer
 host=127.0.0.1
 accountcode=cdrtest_sip
+context=test

Modified: asterisk/trunk/tests/cdr/console_dial_sip_answer/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/cdr/console_dial_sip_answer/run-test?view=diff&rev=2998&r1=2997&r2=2998
==============================================================================
--- asterisk/trunk/tests/cdr/console_dial_sip_answer/run-test (original)
+++ asterisk/trunk/tests/cdr/console_dial_sip_answer/run-test Thu Jan 19 16:33:51 2012
@@ -17,11 +17,12 @@
 from asterisk.TestCase import TestCase
 from asterisk.CDRTestCase import CDRTestCase
 from twisted.internet import reactor
-
+from asterisk.version import AsteriskVersion
 
 class SIP_Dial_Answer_Test(CDRTestCase):
     def __init__(self):
         CDRTestCase.__init__(self)
+        cdr2channel = "SIP/test-.*"
 
         self.add_expectation('cdrtest_local', AsteriskCSVCDRLine(
             destination="1",
@@ -29,10 +30,14 @@
             channel="Local/1 at default-.*",
             disposition="ANSWERED",
             amaflags="DOCUMENTATION"))
+
+        if self.ast_version < AsteriskVersion("1.8"):
+                cdr2channel = "Local/2 at test-.*"
+
         self.add_expectation('cdrtest_sip', AsteriskCSVCDRLine(
             destination="2",
-            dcontext="default",
-            channel="SIP/test-.*",
+            dcontext="test",
+            channel=cdr2channel,
             disposition="ANSWERED",
             amaflags="DOCUMENTATION"))
 




More information about the asterisk-commits mailing list