[asterisk-commits] russell: branch russell/messaging r1387 - in /asterisk/team/russell/messaging...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Mar 4 10:57:34 CST 2011


Author: russell
Date: Fri Mar  4 10:57:29 2011
New Revision: 1387

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=1387
Log:
Sync with trunk.

Added:
    asterisk/team/russell/messaging/configs/res_config_sqlite.conf
      - copied unchanged from r1380, asterisk/trunk/configs/res_config_sqlite.conf
    asterisk/team/russell/messaging/configs/res_pgsql.conf
      - copied unchanged from r1380, asterisk/trunk/configs/res_pgsql.conf
    asterisk/team/russell/messaging/configs/res_pktccops.conf
      - copied unchanged from r1380, asterisk/trunk/configs/res_pktccops.conf
    asterisk/team/russell/messaging/lib/python/sipp/
      - copied from r1380, asterisk/trunk/lib/python/sipp/
    asterisk/team/russell/messaging/lib/python/sipp/__init__.py
      - copied unchanged from r1380, asterisk/trunk/lib/python/sipp/__init__.py
    asterisk/team/russell/messaging/lib/python/sipp/version.py
      - copied unchanged from r1380, asterisk/trunk/lib/python/sipp/version.py
    asterisk/team/russell/messaging/tests/callparking/configs/ast1/features.conf
      - copied unchanged from r1380, asterisk/trunk/tests/callparking/configs/ast1/features.conf
    asterisk/team/russell/messaging/tests/callparking/configs/ast1/manager.conf
      - copied unchanged from r1380, asterisk/trunk/tests/callparking/configs/ast1/manager.conf
    asterisk/team/russell/messaging/tests/callparking/configs/ast2/manager.conf
      - copied unchanged from r1380, asterisk/trunk/tests/callparking/configs/ast2/manager.conf
    asterisk/team/russell/messaging/tests/mixmonitor/configs/ast1/manager.conf
      - copied unchanged from r1380, asterisk/trunk/tests/mixmonitor/configs/ast1/manager.conf
    asterisk/team/russell/messaging/tests/mixmonitor_audiohook_inherit/configs/ast1/manager.conf
      - copied unchanged from r1380, asterisk/trunk/tests/mixmonitor_audiohook_inherit/configs/ast1/manager.conf
    asterisk/team/russell/messaging/tests/sip/refer_replaces_to_self/
      - copied from r1380, asterisk/trunk/tests/sip/refer_replaces_to_self/
    asterisk/team/russell/messaging/tests/sip/refer_replaces_to_self/configs/
      - copied from r1380, asterisk/trunk/tests/sip/refer_replaces_to_self/configs/
    asterisk/team/russell/messaging/tests/sip/refer_replaces_to_self/configs/sip.conf
      - copied unchanged from r1380, asterisk/trunk/tests/sip/refer_replaces_to_self/configs/sip.conf
    asterisk/team/russell/messaging/tests/sip/refer_replaces_to_self/run-test
      - copied unchanged from r1380, asterisk/trunk/tests/sip/refer_replaces_to_self/run-test
    asterisk/team/russell/messaging/tests/sip/refer_replaces_to_self/test-config.yaml
      - copied unchanged from r1380, asterisk/trunk/tests/sip/refer_replaces_to_self/test-config.yaml
Removed:
    asterisk/team/russell/messaging/tests/callparking/configs/ast3/
    asterisk/team/russell/messaging/tests/feature_attended_transfer/sounds/
    asterisk/team/russell/messaging/tests/mixmonitor_audiohook_inherit/configs/ast1/features.conf
    asterisk/team/russell/messaging/tests/mixmonitor_audiohook_inherit/sounds/
Modified:
    asterisk/team/russell/messaging/   (props changed)
    asterisk/team/russell/messaging/README.txt
    asterisk/team/russell/messaging/lib/python/asterisk/asterisk.py
    asterisk/team/russell/messaging/lib/python/asterisk/sipp.py
    asterisk/team/russell/messaging/runtests.py
    asterisk/team/russell/messaging/tests/agi/exit_status/test-config.yaml
    asterisk/team/russell/messaging/tests/blind-transfer-parkingtimeout/test-config.yaml
    asterisk/team/russell/messaging/tests/callparking/configs/ast1/extensions.conf
    asterisk/team/russell/messaging/tests/callparking/configs/ast1/iax.conf
    asterisk/team/russell/messaging/tests/callparking/configs/ast2/extensions.conf
    asterisk/team/russell/messaging/tests/callparking/configs/ast2/iax.conf
    asterisk/team/russell/messaging/tests/callparking/run-test
    asterisk/team/russell/messaging/tests/callparking/test-config.yaml
    asterisk/team/russell/messaging/tests/callparking_retrieval/test-config.yaml
    asterisk/team/russell/messaging/tests/cdr/app_dial_G_flag/sipp/call.xml
    asterisk/team/russell/messaging/tests/cdr/app_dial_G_flag/sipp/wait-for-call.xml
    asterisk/team/russell/messaging/tests/cdr/app_dial_G_flag/test-config.yaml
    asterisk/team/russell/messaging/tests/cdr/app_queue/sipp/call-then-hangup.xml
    asterisk/team/russell/messaging/tests/cdr/app_queue/sipp/call.xml
    asterisk/team/russell/messaging/tests/cdr/app_queue/sipp/wait-for-call-hangup.xml
    asterisk/team/russell/messaging/tests/cdr/app_queue/test-config.yaml
    asterisk/team/russell/messaging/tests/cdr/blind-transfer-accountcode/sipp/call-then-blind-transfer.xml
    asterisk/team/russell/messaging/tests/cdr/blind-transfer-accountcode/sipp/register.xml
    asterisk/team/russell/messaging/tests/cdr/blind-transfer-accountcode/sipp/wait-for-call-do-hangup.xml
    asterisk/team/russell/messaging/tests/cdr/blind-transfer-accountcode/sipp/wait-for-call.xml
    asterisk/team/russell/messaging/tests/cdr/blind-transfer-accountcode/test-config.yaml
    asterisk/team/russell/messaging/tests/cdr/cdr_unanswered_yes/test-config.yaml
    asterisk/team/russell/messaging/tests/cdr/cdr_userfield/test-config.yaml
    asterisk/team/russell/messaging/tests/cdr/console_dial_sip_answer/test-config.yaml
    asterisk/team/russell/messaging/tests/cdr/console_dial_sip_busy/test-config.yaml
    asterisk/team/russell/messaging/tests/cdr/console_dial_sip_congestion/test-config.yaml
    asterisk/team/russell/messaging/tests/cdr/console_dial_sip_transfer/test-config.yaml
    asterisk/team/russell/messaging/tests/cdr/console_fork_after_busy_forward/test-config.yaml
    asterisk/team/russell/messaging/tests/cdr/console_fork_before_dial/test-config.yaml
    asterisk/team/russell/messaging/tests/cdr/nocdr/test-config.yaml
    asterisk/team/russell/messaging/tests/cdr/originate-cdr-disposition/sipp/wait-for-call-busy.xml
    asterisk/team/russell/messaging/tests/cdr/originate-cdr-disposition/sipp/wait-for-call-congestion.xml
    asterisk/team/russell/messaging/tests/cdr/originate-cdr-disposition/sipp/wait-for-call-timeout.xml
    asterisk/team/russell/messaging/tests/cdr/originate-cdr-disposition/sipp/wait-for-call.xml
    asterisk/team/russell/messaging/tests/cdr/originate-cdr-disposition/test-config.yaml
    asterisk/team/russell/messaging/tests/chanspy/chanspy_barge/run-test
    asterisk/team/russell/messaging/tests/chanspy/chanspy_barge/test-config.yaml
    asterisk/team/russell/messaging/tests/chanspy/chanspy_w_mixmonitor/configs/ast1/extensions.conf
    asterisk/team/russell/messaging/tests/chanspy/chanspy_w_mixmonitor/run-test
    asterisk/team/russell/messaging/tests/chanspy/chanspy_w_mixmonitor/test-config.yaml
    asterisk/team/russell/messaging/tests/chanspy/tests.yaml
    asterisk/team/russell/messaging/tests/directed_pickup/test-config.yaml
    asterisk/team/russell/messaging/tests/fax/local_channel_t38_queryoption/test-config.yaml
    asterisk/team/russell/messaging/tests/feature_attended_transfer/configs/ast1/extensions.conf
    asterisk/team/russell/messaging/tests/feature_attended_transfer/configs/ast1/iax.conf
    asterisk/team/russell/messaging/tests/feature_attended_transfer/configs/ast1/manager.conf
    asterisk/team/russell/messaging/tests/feature_attended_transfer/configs/ast2/extensions.conf
    asterisk/team/russell/messaging/tests/feature_attended_transfer/configs/ast2/iax.conf
    asterisk/team/russell/messaging/tests/feature_attended_transfer/configs/ast2/manager.conf
    asterisk/team/russell/messaging/tests/feature_attended_transfer/run-test
    asterisk/team/russell/messaging/tests/feature_blonde_transfer/configs/ast1/extensions.conf
    asterisk/team/russell/messaging/tests/feature_blonde_transfer/configs/ast1/iax.conf
    asterisk/team/russell/messaging/tests/feature_blonde_transfer/configs/ast1/manager.conf
    asterisk/team/russell/messaging/tests/feature_blonde_transfer/configs/ast2/extensions.conf
    asterisk/team/russell/messaging/tests/feature_blonde_transfer/configs/ast2/iax.conf
    asterisk/team/russell/messaging/tests/feature_blonde_transfer/configs/ast2/manager.conf
    asterisk/team/russell/messaging/tests/feature_blonde_transfer/run-test
    asterisk/team/russell/messaging/tests/feature_blonde_transfer/test-config.yaml
    asterisk/team/russell/messaging/tests/mixmonitor/configs/ast1/extensions.conf
    asterisk/team/russell/messaging/tests/mixmonitor/run-test
    asterisk/team/russell/messaging/tests/mixmonitor/test-config.yaml
    asterisk/team/russell/messaging/tests/mixmonitor_audiohook_inherit/configs/ast1/extensions.conf
    asterisk/team/russell/messaging/tests/mixmonitor_audiohook_inherit/run-test
    asterisk/team/russell/messaging/tests/mixmonitor_audiohook_inherit/test-config.yaml
    asterisk/team/russell/messaging/tests/queues/position_priority_maxlen/test-config.yaml
    asterisk/team/russell/messaging/tests/queues/ringinuse_and_pause/sipp/uas.xml
    asterisk/team/russell/messaging/tests/queues/ringinuse_and_pause/test-config.yaml
    asterisk/team/russell/messaging/tests/rfc2833_dtmf_detect/sipp/broken_dtmf.xml
    asterisk/team/russell/messaging/tests/rfc2833_dtmf_detect/sipp/dtmf_baseline.xml
    asterisk/team/russell/messaging/tests/rfc2833_dtmf_detect/sipp/dtmf_noend.xml
    asterisk/team/russell/messaging/tests/rfc2833_dtmf_detect/sipp/register.xml
    asterisk/team/russell/messaging/tests/rfc2833_dtmf_detect/test-config.yaml
    asterisk/team/russell/messaging/tests/sip/handle_response_refer/sipp/wait-refer-200-notify.xml
    asterisk/team/russell/messaging/tests/sip/handle_response_refer/sipp/wait-refer-202-error.xml
    asterisk/team/russell/messaging/tests/sip/handle_response_refer/sipp/wait-refer-202-notify-provisional.xml
    asterisk/team/russell/messaging/tests/sip/handle_response_refer/sipp/wait-refer-202-notify.xml
    asterisk/team/russell/messaging/tests/sip/handle_response_refer/sipp/wait-refer-400.xml
    asterisk/team/russell/messaging/tests/sip/handle_response_refer/sipp/wait-refer-500.xml
    asterisk/team/russell/messaging/tests/sip/handle_response_refer/sipp/wait-refer-603.xml
    asterisk/team/russell/messaging/tests/sip/handle_response_refer/test-config.yaml
    asterisk/team/russell/messaging/tests/sip/options/sipp/options.xml
    asterisk/team/russell/messaging/tests/sip/options/sipp/options2.xml
    asterisk/team/russell/messaging/tests/sip/options/test-config.yaml
    asterisk/team/russell/messaging/tests/sip/tests.yaml
    asterisk/team/russell/messaging/tests/sip_attended_transfer/test-config.yaml
    asterisk/team/russell/messaging/tests/sip_attended_transfer_tcp/test-config.yaml
    asterisk/team/russell/messaging/tests/sip_attended_transfer_v6/test-config.yaml
    asterisk/team/russell/messaging/tests/sip_channel_params/sipp/call.xml
    asterisk/team/russell/messaging/tests/sip_channel_params/sipp/register.xml
    asterisk/team/russell/messaging/tests/sip_channel_params/test-config.yaml
    asterisk/team/russell/messaging/tests/sip_one_legged_transfer/test-config.yaml
    asterisk/team/russell/messaging/tests/sip_one_legged_transfer_v6/test-config.yaml
    asterisk/team/russell/messaging/tests/sip_outbound_address/sipp/uas1.xml
    asterisk/team/russell/messaging/tests/sip_outbound_address/sipp/uas2.xml
    asterisk/team/russell/messaging/tests/sip_outbound_address/test-config.yaml
    asterisk/team/russell/messaging/tests/sip_register/run-test
    asterisk/team/russell/messaging/tests/sip_register/sipp/registerv4.xml
    asterisk/team/russell/messaging/tests/sip_register/sipp/registerv6.xml
    asterisk/team/russell/messaging/tests/sip_register/test-config.yaml
    asterisk/team/russell/messaging/tests/tests.yaml
    asterisk/team/russell/messaging/tests/udptl/configs/ast1/sip.conf
    asterisk/team/russell/messaging/tests/udptl/configs/ast2/sip.conf
    asterisk/team/russell/messaging/tests/udptl/run-test

Propchange: asterisk/team/russell/messaging/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Mar  4 10:57:29 2011
@@ -1,1 +1,1 @@
-/asterisk/trunk:1-1061
+/asterisk/trunk:1-1386

Modified: asterisk/team/russell/messaging/README.txt
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/russell/messaging/README.txt?view=diff&rev=1387&r1=1386&r2=1387
==============================================================================
--- asterisk/team/russell/messaging/README.txt (original)
+++ asterisk/team/russell/messaging/README.txt Fri Mar  4 10:57:29 2011
@@ -132,6 +132,9 @@
               #define PJ_HAS_IPV6 1
 
               before running the `make dep && make` command.
+        - pjsua python bindings
+            - Go to pjsip-apps/src/python directory
+            - Run 'sudo python ./setup.py install' or just 'sudo make'
 
 --------------------------------------------------------------------------------
 --------------------------------------------------------------------------------
@@ -281,6 +284,7 @@
 # The testinfo section contains information that describes the purpose of the
 # test.
 testinfo:
+    skip : 'Breif reason for skipping test' # OPTIONAL
     summary     : 'Put a short one liner summary of the test here'
     issues      : |
         # List of issue numbers associated with this test

Modified: asterisk/team/russell/messaging/lib/python/asterisk/asterisk.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/russell/messaging/lib/python/asterisk/asterisk.py?view=diff&rev=1387&r1=1386&r2=1387
==============================================================================
--- asterisk/team/russell/messaging/lib/python/asterisk/asterisk.py (original)
+++ asterisk/team/russell/messaging/lib/python/asterisk/asterisk.py Fri Mar  4 10:57:29 2011
@@ -323,7 +323,10 @@
                 output += l
         except IOError:
             pass
-        process.wait()
+        try:
+            process.wait()
+        except OSError:
+            pass
         return output
 
     def __gen_ast_conf(self, ast_conf, dir_cat, ast_conf_options):

Modified: asterisk/team/russell/messaging/lib/python/asterisk/sipp.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/russell/messaging/lib/python/asterisk/sipp.py?view=diff&rev=1387&r1=1386&r2=1387
==============================================================================
--- asterisk/team/russell/messaging/lib/python/asterisk/sipp.py (original)
+++ asterisk/team/russell/messaging/lib/python/asterisk/sipp.py Fri Mar  4 10:57:29 2011
@@ -113,8 +113,10 @@
             self.stdout.append(out)
             self.stderr.append(err)
             self.result.append(self.sipp[i].wait())
-            print "SIPp scenario #%d %s" % (i, "FAILED" if self.result[i] else
-                                               "Passed")
+            if self.result[i]:
+                print "SIPp scenario #%d FAILED" % i
+            else:
+                print "SIPp scenario #%d PASSED" % i
             if self.result[i]:
                 passed = False
                 #print self.stdout[i]
@@ -122,5 +124,8 @@
 
         self.ast1.stop()
 
-        return 0 if passed else 1
+        if passed:
+            return 0
+        else:
+            return 1
 

Modified: asterisk/team/russell/messaging/runtests.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/russell/messaging/runtests.py?view=diff&rev=1387&r1=1386&r2=1387
==============================================================================
--- asterisk/team/russell/messaging/runtests.py (original)
+++ asterisk/team/russell/messaging/runtests.py Fri Mar  4 10:57:29 2011
@@ -21,14 +21,19 @@
 from asterisk.version import AsteriskVersion
 from asterisk.asterisk import Asterisk
 from asterisk import utils
+from sipp.version import SIPpVersion
+
 
 TESTS_CONFIG = "tests.yaml"
 TEST_RESULTS = "asterisk-test-suite-report.xml"
+
 
 class Dependency:
     def __init__(self, dep):
         self.name = ""
+        self.version = ""
         self.met = False
+        self.sipp_version = SIPpVersion()
         if "app" in dep:
             self.name = dep["app"]
             self.met = utils.which(self.name) is not None
@@ -39,6 +44,22 @@
                 self.met = True
             except ImportError:
                 pass
+        elif "sipp" in dep:
+            self.name = "SIPp"
+            version = None
+            feature = None
+            if 'version' in dep['sipp']:
+                version = dep['sipp']['version']
+            if 'feature' in dep['sipp']:
+                feature = dep['sipp']['feature']
+            self.version = SIPpVersion(version, feature)
+            if self.sipp_version >= self.version:
+                self.met = True
+            if self.version.tls and not self.sipp_version.tls:
+                self.met = False
+            if self.version.pcap and not self.sipp_version.pcap:
+                self.met = False
+
         elif "custom" in dep:
             self.name = dep["custom"]
             method = "depend_%s" % self.name
@@ -52,6 +73,13 @@
         else:
             print "Unknown dependency type specified."
 
+    def depend_soundcard(self):
+        try:
+            f = open("/dev/dsp", "r")
+            f.close()
+            return True
+        except:
+            return False
     def depend_ipv6(self):
         try:
             s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
@@ -91,6 +119,7 @@
 
         return False
 
+
 class TestConfig:
     def __init__(self, test_name, ast_version):
         self.can_run = True
@@ -98,6 +127,7 @@
         self.time = 0.0
         self.test_name = test_name
         self.ast_version = ast_version
+        self.skip = None
         self.config = None
         self.summary = None
         self.maxversion = None
@@ -145,6 +175,9 @@
         if "testinfo" not in self.config:
             return
         testinfo = self.config["testinfo"]
+        if "skip" in testinfo:
+            self.skip = testinfo['skip']
+            self.can_run = False
         if "summary" in testinfo:
             self.summary = testinfo["summary"]
         if "description" in testinfo:
@@ -266,7 +299,12 @@
                 print "      --> Maximum Version: %s (%s)" % \
                              (str(t.maxversion), str(t.maxversion_check))
             for d in t.deps:
-                print "      --> Dependency: %s -- Met: %s" % (d.name,
+                if d.version:
+                    print "      --> Dependency: %s" % (d.name)
+                    print "        --> Version: %s -- Met: %s" % (d.version,
+                            str(d.met))
+                else:
+                    print "      --> Dependency: %s -- Met: %s" % (d.name,
                              str(d.met))
             i += 1
 
@@ -277,6 +315,10 @@
             if self.options.test and t.test_name != self.options.test:
                 continue
             if t.can_run is False:
+                if t.skip is not None:
+                    print "--> %s ... skipped '%s'" % (t.test_name, t.skip)
+                    continue
+
                 print "--> Cannot run test '%s'" % t.test_name
                 print "--- --> Minimum Version: %s (%s)" % \
                     (str(t.minversion), str(t.minversion_check))

Modified: asterisk/team/russell/messaging/tests/agi/exit_status/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/russell/messaging/tests/agi/exit_status/test-config.yaml?view=diff&rev=1387&r1=1386&r2=1387
==============================================================================
--- asterisk/team/russell/messaging/tests/agi/exit_status/test-config.yaml (original)
+++ asterisk/team/russell/messaging/tests/agi/exit_status/test-config.yaml Fri Mar  4 10:57:29 2011
@@ -1,4 +1,5 @@
 testinfo:
+    skip: 'Skip while failures are debugged'
     summary:     'Test AGI exit status'
     description: |
         'This test verifies that the AGI application returns the correct exit status for each of several scenarios'

Modified: asterisk/team/russell/messaging/tests/blind-transfer-parkingtimeout/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/russell/messaging/tests/blind-transfer-parkingtimeout/test-config.yaml?view=diff&rev=1387&r1=1386&r2=1387
==============================================================================
--- asterisk/team/russell/messaging/tests/blind-transfer-parkingtimeout/test-config.yaml (original)
+++ asterisk/team/russell/messaging/tests/blind-transfer-parkingtimeout/test-config.yaml Fri Mar  4 10:57:29 2011
@@ -1,4 +1,5 @@
 testinfo:
+    skip: 'Skip while failures are debugged'
     summary:     'Test Blind Transfer with parkingtimeout'
     description: |
         'This test verifies the Blind Transfer routine with parkingtimeout used in the feature code.'

Modified: asterisk/team/russell/messaging/tests/callparking/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/russell/messaging/tests/callparking/configs/ast1/extensions.conf?view=diff&rev=1387&r1=1386&r2=1387
==============================================================================
--- asterisk/team/russell/messaging/tests/callparking/configs/ast1/extensions.conf (original)
+++ asterisk/team/russell/messaging/tests/callparking/configs/ast1/extensions.conf Fri Mar  4 10:57:29 2011
@@ -3,35 +3,18 @@
 writeprotect=no
 lastaction=""
 
-[parking]
-exten => bridge_to_A,1,Answer()
-exten => bridge_to_A,n,NOOP(Bridge call to userA)
-exten => bridge_to_A,n,Dial(IAX2/userA at 127.0.0.1:4570/a_exten,120,rtT)
-exten => bridge_to_A,n,NOOP(END - Bridge call to userA)
-exten => bridge_to_A,n,Hangup()
+[ast2]
+exten => 9876,1,Dial(IAX2/ast2/${EXTEN},120,rtT)
+exten => 9876,n,Hangup()
 
-exten => bridge_to_B,1,Answer()
-exten => bridge_to_B,n,NOOP(Bridge call to userB)
-exten => bridge_to_B,n,Dial(IAX2/userB at 127.0.0.1:4571/b_exten,120,rtT)
-exten => bridge_to_B,n,NOOP(END - Bridge call to userB)
-exten => bridge_to_B,n,Hangup()
+exten => 101,1,Answer()
+exten => 101,n,SendDTMF(1w2w3w4w)
+exten => 101,n(restart),Background(demo-congrats)
+exten => 101,n,Goto(restart)
 
-exten => a_exten,1,Answer()
-exten => a_exten,n,NOOP(userA answerd the call!)
-exten => a_exten,n,Wait(1)
-exten => a_exten,n,NOOP(waiting for DTMF '110' from userB)
-exten => a_exten,n,Read(sync,,3,,,10) ;read 3 digits
-exten => a_exten,n,GotoIF($["${sync}"="110"]?DTMFpass:DTMFfail)
-exten => a_exten,n(DTMFpass),NOOP(read '${sync}' and expected '110' --> OK)
-exten => a_exten,n,NOOP(somewhere in the future I get parked!)
-exten => a_exten,n,NOOP(I will send DTMF '999' every 5 seconds in order to sync when I get reconnected)
-exten => a_exten,n,Set(count=1)
-exten => a_exten,n(sync),Wait(5)
-exten => a_exten,n,NOOP(Attempt ${count} to sync)
-exten => a_exten,n,Set(count=$[${count}+1])
-exten => a_exten,n,SendDTMF(999)
-exten => a_exten,n,Goto(sync)
-exten => a_exten,n(DTMFfail),NOOP(read '${sync}' and expected '110' --> FAILURE)
-exten => a_exten,n,Hangup()
+exten => 5432,1,SendDTMF(3w4w5w6w)
+exten => 5432,n,UserEvent(ast1, status: SUCCESS)
+exten => 5432,n,Playback(demo-congrats)
+exten => 5432,n,Hangup()
 
 include => parkedcalls

Modified: asterisk/team/russell/messaging/tests/callparking/configs/ast1/iax.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/russell/messaging/tests/callparking/configs/ast1/iax.conf?view=diff&rev=1387&r1=1386&r2=1387
==============================================================================
--- asterisk/team/russell/messaging/tests/callparking/configs/ast1/iax.conf (original)
+++ asterisk/team/russell/messaging/tests/callparking/configs/ast1/iax.conf Fri Mar  4 10:57:29 2011
@@ -1,14 +1,25 @@
 [general]
-bindport=4570
 bindaddr=127.0.0.1
-transfer=yes
-disallow=all
-allow=ulaw
 jitterbuffer=no
 forcejitterbuffer=no
 
-[userA]
-type=friend
-host=127.0.0.1
-port=4570
-context=parking
+[ast1]
+type=user
+host=127.0.0.2
+secret=p at ssw0rd
+context=parkedcalls
+deny=0.0.0.0/0.0.0.0
+permit=127.0.0.2/255.255.255.255
+disallow=all
+allow=gsm
+transfer=yes
+
+[ast2]
+type=peer
+host=127.0.0.2
+context=ast2
+username=ast2
+secret=pa$$word
+disallow=all
+allow=gsm
+transfers=yes

Modified: asterisk/team/russell/messaging/tests/callparking/configs/ast2/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/russell/messaging/tests/callparking/configs/ast2/extensions.conf?view=diff&rev=1387&r1=1386&r2=1387
==============================================================================
--- asterisk/team/russell/messaging/tests/callparking/configs/ast2/extensions.conf (original)
+++ asterisk/team/russell/messaging/tests/callparking/configs/ast2/extensions.conf Fri Mar  4 10:57:29 2011
@@ -3,38 +3,21 @@
 writeprotect=no
 
 [parkingAB]
-exten => b_exten,1,Answer()
-exten => b_exten,n,NOOP(userB answered the call)
-exten => b_exten,n,Wait(1)
-exten => b_exten,n,NOOP(sync to userA -> send  DTMF '110')
-exten => b_exten,n,SendDTMF(1w1w0)
-exten => b_exten,n,Wait(1)
-exten => b_exten,n,NOOP(trying to Park userA)
-exten => b_exten,n,Set(GLOBAL(lastaction)=parkedA)
-exten => b_exten,n,SendDTMF(#)
-exten => b_exten,n,Wait(1)
-exten => b_exten,n,SendDTMF(7w0w0)
-exten => b_exten,n,Hangup()
+exten => 9876,1,Answer()
+exten => 9876,n,Background(demo-congrats)
+exten => 9876,n,Hangup()
 
-exten => h,1,NOOP(got hangup due to successful parking of userA)
-exten => h,n,AGI(agi://127.0.0.1:4574)
-exten => h,n,Hangup()
+exten => 1234,1,SendDTMF(#)
+exten => 1234,n,SendDTMF(7w0w0)
+exten => 1234,n,Hangup()
 
-[parkingBC]
-exten => b_exten,1,Answer()
-exten => b_exten,n,NOOP(userB answered the call)
-exten => b_exten,n,Wait(1)
-exten => b_exten,n,NOOP(waiting for DTMF '110' from userB)
-exten => b_exten,n,Read(sync,,3,,,10) ;read 3 digits, 5sek timeout
-exten => b_exten,n,GotoIF($["${sync}"="110"]?DTMFpass:DTMFfail)
-exten => b_exten,n(DTMFpass),NOOP(read '${sync}' and expected '110' --> OK)
-exten => b_exten,n,NOOP(somewhere in the future I get parked!)
-exten => b_exten,n,NOOP(I will send DTMF '888' every 5 seconds in order to sync when I get reconnected)
-exten => b_exten,n,Set(count=1)
-exten => b_exten,n(sync),Wait(5)
-exten => b_exten,n,NOOP(Attempt ${count} to sync)
-exten => b_exten,n,Set(count=$[${count}+1])
-exten => b_exten,n,SendDTMF(888)
-exten => b_exten,n,Goto(sync)
-exten => b_exten,n(DTMFfail),NOOP(read '${sync}' and expected '110' --> FAILURE)
-exten => b_exten,n,Hangup()
+[ast1]
+exten => s,1,Answer()
+exten => s,n,SendDTMF(5w4w3w2)
+exten => s,n,Background(demo-congrats)
+exten => s,n,UserEvent(ast2, status: FAILURE)
+exten => s,n,Hangup()
+
+exten => 3456,1,UserEvent(ast2, status: SUCCESS)
+exten => 3456,n,Playback(demo-congrats)
+exten => 3456,n,Hangup()

Modified: asterisk/team/russell/messaging/tests/callparking/configs/ast2/iax.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/russell/messaging/tests/callparking/configs/ast2/iax.conf?view=diff&rev=1387&r1=1386&r2=1387
==============================================================================
--- asterisk/team/russell/messaging/tests/callparking/configs/ast2/iax.conf (original)
+++ asterisk/team/russell/messaging/tests/callparking/configs/ast2/iax.conf Fri Mar  4 10:57:29 2011
@@ -1,20 +1,25 @@
 [general]
-bindport=4571
-bindaddr=127.0.0.1
-transfer=yes
-disallow=all
-allow=ulaw
+bindaddr=127.0.0.2
 jitterbuffer=no
 forcejitterbuffer=no
 
-[userA]
-type=friend
+[ast1]
+type=peer
 host=127.0.0.1
-port=4570
+context=ast1
+username=ast1
+secret=p at ssw0rd
+disallow=all
+allow=gsm
+transfers=yes
+
+[ast2]
+type=user
+host=127.0.0.1
+secret=pa$$word
 context=parkingAB
-
-[userB]
-type=friend
-host=127.0.0.1
-port=4571
-context=parkingBC
+deny=0.0.0.0/0.0.0.0
+permit=127.0.0.1/255.255.255.255
+disallow=all
+allow=gsm
+transfer=yes

Modified: asterisk/team/russell/messaging/tests/callparking/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/russell/messaging/tests/callparking/run-test?view=diff&rev=1387&r1=1386&r2=1387
==============================================================================
--- asterisk/team/russell/messaging/tests/callparking/run-test (original)
+++ asterisk/team/russell/messaging/tests/callparking/run-test Fri Mar  4 10:57:29 2011
@@ -13,7 +13,7 @@
 from optparse import OptionParser
 from twisted.application import service, internet
 from twisted.internet import reactor
-from starpy import fastagi
+from starpy import manager
 
 sys.path.append("lib/python")
 from asterisk.asterisk import Asterisk
@@ -26,10 +26,11 @@
 class CallParkingTest:
     def __init__(self, argv):
         self.passed = False
-        self.done = False
+        self.ast1_event = False
+        self.ast2_event = False
 
         # Test timeout in seconds
-        self.timeout = 60
+        self.timeout = 30
         self.last_step = ""
 
         # get version info
@@ -39,21 +40,6 @@
         (options, args) = parser.parse_args(argv)
         self.ast_version = AsteriskVersion(options.ast_version)
 
-        # FastAGI, listen for results from dialplan
-        self.agi_b = fastagi.FastAGIFactory(self.get_result_b)
-        reactor.listenTCP(4574, self.agi_b, self.timeout, '127.0.0.1')
-
-        self.agi_c = fastagi.FastAGIFactory(self.get_result_c)
-        reactor.listenTCP(4575, self.agi_c, self.timeout, '127.0.0.1')
-
-        self.agi_retrieve_A = fastagi.FastAGIFactory(
-            self.get_result_retrieve_A)
-        reactor.listenTCP(4576, self.agi_retrieve_A, self.timeout, '127.0.0.1')
-
-        self.agi_retrieve_B = fastagi.FastAGIFactory(
-            self.get_result_retrieve_B)
-        reactor.listenTCP(4577, self.agi_retrieve_B, self.timeout, '127.0.0.1')
-
         reactor.callWhenRunning(self.run)
 
         self.ast1 = Asterisk(base=workingdir)
@@ -62,108 +48,100 @@
         self.ast2 = Asterisk(base=workingdir)
         self.ast2.install_configs("%s/configs/ast2" % (testdir))
 
-        self.ast3 = Asterisk(base=workingdir)
-        self.ast3.install_configs("%s/configs/ast3" % (testdir))
-
-    # This gets invoked by the dialplan when userB has parked userA to 701.
-    # Initiate new call userB <--> userC now.
-    def get_result_b(self, agi):
-        self.log_last_step("got AGI connection from userB. "
-         "Initiate new call between userB and userC now")
-        self.ast1.cli_originate(
-         "IAX2/userB at 127.0.0.1:4572/c_exten extension bridge_to_B at parking")
-        return agi.finish()
-
-    # This gets invoked by the dialplan when userC has parked userB to 702.
-    # Initiate new call between userC and parked userA (@701) now.
-    def get_result_c(self, agi):
-        self.log_last_step("got AGI connection from userC. "
-         "Now retrieve userA -> call 701")
-        self.ast3.cli_originate(
-         "IAX2/userA at 127.0.0.1:4570/701 extension retrieve_A at parking")
-        return agi.finish()
-
-    # This gets invoked by the dialplan when userC has retrieved userA.
-    # Initiate new call between userC and parked userB (@702) now.
-    def get_result_retrieve_A(self, agi):
-        self.log_last_step("got AGI connection from userC. "
-         "userA retrieved successfully, now retrieve userB")
-        self.ast3.cli_originate(
-         "IAX2/userA at 127.0.0.1:4570/702 extension retrieve_B at parking")
-        return agi.finish()
-
-    # This gets invoked by the dialplan when userC has retrieved userB.
-    # Test successful!
-    def get_result_retrieve_B(self, agi):
-        self.log_last_step("got AGI connection from userC. "
-         "userB retrieved successfully -> Test successful")
-        self.passed = True
-        reactor.callLater(2, self.read_result)
-        return agi.finish()
-
-    def read_result(self):
-        if self.done:
-            return
-        self.done = True
-
-        self.log_last_step("Reading results")
-
-        # get lock output in case of deadlock before tearing down.
-        self.ast1.cli_exec("core show locks")
-        self.ast2.cli_exec("core show locks")
-        self.ast3.cli_exec("core show locks")
-
-        # if channels are still up for some reason, we want to know that
-        self.ast1.cli_exec("core show channels")
-        self.ast2.cli_exec("core show channels")
-        self.ast3.cli_exec("core show channels")
-
-        if (self.passed):
-            self.log_last_step("Test Passed...")
-        else:
-            self.log_last_step("Test Failed... view result of "
-             "'core show globals' in log for more detailed failure results.")
-
+    def stop_reactor(self):
+        print "Stopping Reactor ..."
         if reactor.running:
-            print "Stopping Reactor ..."
             reactor.stop()
 
-    # This is a callparking test.
-    # 1.  userA calls userB
-    # 2.  userB dials # -> 700, to park userA (701).
-    # 3.  userB calls userC
-    # 4.  userC dials # -> 700, to park userB (702).
-    # 5.  userC dials 701 and retrieves userA
-    # 6.  userC dials 702 and retrieves userB
+    def check_result(self):
+        self.log_last_step("Checking results...")
+        if self.ast1_event is True and self.ast2_event is True:
+            self.stop_reactor()
+            self.passed = True
+
+    def get_parkedcall(self):
+        self.ast2.cli_originate("IAX2/ast1/701 extension s at ast1")
 
     def launch_test(self):
-        self.log_last_step("Originating call to begin test")
-        self.ast1.cli_originate(
-         "IAX2/userA at 127.0.0.1:4571/b_exten extension bridge_to_A at parking")
+        self.ast1.cli_originate("Local/9876 at ast2 extension 101 at ast2")
+
+    def ast1_unparkedcall(self, ami, event):
+        self.log_last_step("UnParkedCall event on ast1 ...")
+        if event.get("exten").lower() != "701":
+            return
+        self.log_last_step("... Success")
+
+    def ast1_parkedcall(self, ami, event):
+        self.log_last_step("ParkedCall event on ast1 ...")
+        if event.get("exten").lower() != "701":
+            return
+        self.log_last_step("... Success")
+        self.get_parkedcall()
+
+    def ast2_userevent(self, ami, event):
+        self.log_last_step("UserEvent on ast2 ... ")
+        status = event.get("status")
+        print ("... %s" % (status))
+        if status != "SUCCESS":
+            self.stop_reactor()
+            return
+
+        self.ast2_event = True
+        self.check_result()
+
+    def ast1_userevent(self, ami, event):
+        self.log_last_step("UserEvent on ast1 ... ")
+        status = event.get("status")
+        print ("... %s" % (status))
+        if status != "SUCCESS":
+            self.stop_reactor()
+            return
+
+        self.ast1_event = True
+        self.check_result()
+
+    def ami_on_connect2(self, ami):
+        self.log_last_step("Connected to AMI 2")
+        self.ami2 = ami
+        self.ami2.registerEvent("UserEvent", self.ast2_userevent)
+
+    def ami_on_connect1(self, ami):
+        self.log_last_step("Connected to AMI 1")
+        self.ami1 = ami
+        self.ami1.registerEvent("ParkedCall", self.ast1_parkedcall)
+        self.ami1.registerEvent("UnParkedCall", self.ast1_unparkedcall)
+        self.ami1.registerEvent("UserEvent", self.ast1_userevent)
+
+    def ami_login_error(self, ami):
+        self.log_last_step("AMI login failed")
+        self.stop_reactor()
+
+    def ami_login(self):
+        self.log_last_step("Logging in to the AMI")
+        self.ami_factory1 = manager.AMIFactory("user", "mysecret")
+        self.ami_factory2 = manager.AMIFactory("user", "mysecret")
+        self.ami_factory1.login('127.0.0.1', 5038).addCallbacks(self.ami_on_connect1, self.ami_login_error)
+        self.ami_factory2.login('127.0.0.2', 5038).addCallbacks(self.ami_on_connect2, self.ami_login_error)
 
     def start_asterisk(self):
         self.log_last_step("Starting Asterisk")
         self.ast1.start()
         self.ast2.start()
-        self.ast3.start()
 
     def stop_asterisk(self):
         self.ast1.stop()
         self.ast2.stop()
-        self.ast3.stop()
 
     def log_last_step(self, step):
         print step
         self.last_step = step
 
     def run(self):
-        self.start_asterisk()
-
-        # start test in 5 seconds
-        reactor.callLater(5, self.launch_test)
+        self.ami_login()
+        self.launch_test()
 
         # stop and read results after timeout
-        reactor.callLater(self.timeout, self.read_result)
+        reactor.callLater(self.timeout, self.stop_reactor)
 
 
 def main(argv=None):
@@ -171,10 +149,11 @@
         argv = sys.argv
 
     # Run CallParking Test
-    call_parking_test = CallParkingTest(argv)
+    test = CallParkingTest(argv)
+    test.start_asterisk()
     reactor.run()
-    call_parking_test.stop_asterisk()
-    if call_parking_test.passed != True:
+    test.stop_asterisk()
+    if test.passed != True:
         return 1
     return 0
 

Modified: asterisk/team/russell/messaging/tests/callparking/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/russell/messaging/tests/callparking/test-config.yaml?view=diff&rev=1387&r1=1386&r2=1387
==============================================================================
--- asterisk/team/russell/messaging/tests/callparking/test-config.yaml (original)
+++ asterisk/team/russell/messaging/tests/callparking/test-config.yaml Fri Mar  4 10:57:29 2011
@@ -4,7 +4,7 @@
         'This test verifies the Call Parking routine used in the feature code.'
 
 properties:
-    minversion: '1.4'
+    minversion: '1.6.2'
     dependencies:
         - python : 'twisted'
         - python : 'starpy'

Modified: asterisk/team/russell/messaging/tests/callparking_retrieval/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/russell/messaging/tests/callparking_retrieval/test-config.yaml?view=diff&rev=1387&r1=1386&r2=1387
==============================================================================
--- asterisk/team/russell/messaging/tests/callparking_retrieval/test-config.yaml (original)
+++ asterisk/team/russell/messaging/tests/callparking_retrieval/test-config.yaml Fri Mar  4 10:57:29 2011
@@ -1,4 +1,5 @@
 testinfo:
+    skip: 'Skip while failures are debugged'
     summary:     'Test Call Parking'
     description: |
         'This test verifies that retrieving a parked call does not hamper the ability to park it once again.'

Modified: asterisk/team/russell/messaging/tests/cdr/app_dial_G_flag/sipp/call.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/russell/messaging/tests/cdr/app_dial_G_flag/sipp/call.xml?view=diff&rev=1387&r1=1386&r2=1387
==============================================================================
--- asterisk/team/russell/messaging/tests/cdr/app_dial_G_flag/sipp/call.xml (original)
+++ asterisk/team/russell/messaging/tests/cdr/app_dial_G_flag/sipp/call.xml Fri Mar  4 10:57:29 2011
@@ -1,77 +1,74 @@
 <?xml version="1.0" encoding="ISO-8859-1" ?>
 
 <scenario name="send a call then wait for a hangup">
-	<Global variables="file,user"/>
-	<nop>
-		<action>
-			<lookup assign_to="line" file="[$file]" key="[$user]"/>
-		</action>
-	</nop>
-	<Reference variables="file,user"/>
+    <Global variables="file,user" />
+    <nop>
+        <action>
+            <lookup assign_to="line" file="[$file]" key="[$user]" />
+        </action>
+    </nop>
+    <Reference variables="file,user" />
 
-	<send retrans="500">
-		<![CDATA[
+    <send retrans="500">
+        <![CDATA[
 
-		INVITE sip:[field1 line="[$line]"]@[remote_ip]:[remote_port] SIP/2.0
-		Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
-		From: [field0 line="[$line]"] <sip:[field0 line="[$line]"]@[local_ip]:[local_port]>;tag=[call_number]
-		To: [field1 line="[$line]"] <sip:[field1 line="[$line]"]@[remote_ip]:[remote_port]>
-		Call-ID: [call_id]
-		CSeq: 1 INVITE
-		Contact: sip:[field0 line="[$line]"]@[local_ip]:[local_port]

[... 7052 lines stripped ...]



More information about the asterisk-commits mailing list