[asterisk-commits] mnick: branch mnick/gsoc2010 r461 - in /asterisk/team/mnick/gsoc2010/trunk/te...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 6 11:29:07 CDT 2010


Author: mnick
Date: Tue Jul  6 11:29:03 2010
New Revision: 461

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=461
Log:
committed the first version of "blind-transfer-parkingtimeout" attempt 3 :-)


Added:
    asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/
    asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/
    asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/extensions.conf   (with props)
    asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/features.conf   (with props)
    asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/iax.conf   (with props)
    asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/logger.conf   (with props)
    asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs2/
    asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs2/extensions.conf   (with props)
    asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs2/iax.conf   (with props)
    asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs2/logger.conf   (with props)
    asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/run-test   (with props)
    asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/test-config.yaml   (with props)

Added: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/extensions.conf?view=auto&rev=461
==============================================================================
--- asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/extensions.conf (added)
+++ asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/extensions.conf Tue Jul  6 11:29:03 2010
@@ -1,0 +1,39 @@
+
+[general]
+
+static=yes
+;
+; if static=yes and writeprotect=no, you can save dialplan by
+; CLI command "dialplan save" too
+;
+writeprotect=no
+
+[parking]
+exten => a_dials,1,Answer()
+exten => a_dials,n,NOOP(calling userA and bridge them to userB!)
+exten => a_dials,n,Dial(IAX2/userA at 127.0.0.1:4570/a_exten,10,tT)
+exten => a_dials,n,NOOP(Okay, userA should be parked now!)
+
+exten => a_exten,1,Answer()
+exten => a_exten,n,NOOP(Hey, incoming call from userB)
+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, 5sek timeout
+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()
+
+
+include => parkedcalls

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/features.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/features.conf?view=auto&rev=461
==============================================================================
--- asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/features.conf (added)
+++ asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/features.conf Tue Jul  6 11:29:03 2010
@@ -1,0 +1,13 @@
+;
+; Sample Call Features (parking, transfer, etc) configuration
+;
+
+[general]
+parkext => 700			; What extension to dial to park	(all parking lots)
+parkpos => 701-720		; What extensions to park calls on. (defafult parking lot)
+context => parkedcalls		; Which context parked calls are in (default parking lot)
+parkingtime => 5		; Number of seconds a call can be parked for
+
+[featuremap]
+blindxfer => #		; Blind transfer  (default is #) -- Make sure to set the T and/or t option in the Dial() or Queue() app call!
+

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/features.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/features.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/features.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/iax.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/iax.conf?view=auto&rev=461
==============================================================================
--- asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/iax.conf (added)
+++ asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/iax.conf Tue Jul  6 11:29:03 2010
@@ -1,0 +1,28 @@
+[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
+requirecalltoken=no
+
+[userB]
+type=friend
+host=127.0.0.1
+port=4571
+context=parking
+requirecalltoken=no
+
+
+
+
+

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/iax.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/iax.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/iax.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/logger.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/logger.conf?view=auto&rev=461
==============================================================================
--- asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/logger.conf (added)
+++ asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/logger.conf Tue Jul  6 11:29:03 2010
@@ -1,0 +1,100 @@
+;
+; Logging Configuration
+;
+; In this file, you configure logging to files or to
+; the syslog system.
+;
+; "logger reload" at the CLI will reload configuration
+; of the logging system.
+
+[general]
+;
+; Customize the display of debug message time stamps
+; this example is the ISO 8601 date format (yyyy-mm-dd HH:MM:SS)
+;
+; see strftime(3) Linux manual for format specifiers.  Note that there is also
+; a fractional second parameter which may be used in this field.  Use %1q
+; for tenths, %2q for hundredths, etc.
+; 
+;dateformat=%F %T       ; ISO 8601 date format
+;dateformat=%F %T.%3q   ; with milliseconds
+;
+; This appends the hostname to the name of the log files.
+;appendhostname = yes
+;
+; This determines whether or not we log queue events to a file
+; (defaults to yes).
+;queue_log = no
+;
+; Set the queue_log filename
+; (defaults to queue_log)
+;queue_log_name = queue_log
+;
+; Log rotation strategy:
+; sequential:  Rename archived logs in order, such that the newest
+;              has the highest sequence number [default].
+; rotate:  Rotate all the old files, such that the oldest has the
+;          highest sequence number [this is the expected behavior
+;          for Unix administrators].
+; timestamp:  Rename the logfiles using a timestamp instead of a
+;             sequence number when "logger rotate" is executed.
+;rotatestrategy = rotate
+;
+; Run a system command after rotating the files.  This is mainly
+; useful for rotatestrategy=rotate. The example allows the last
+; two archive files to remain uncompressed, but after that point,
+; they are compressed on disk.
+;
+; exec_after_rotate=gzip -9 ${filename}.2
+;
+; This determines whether or not we log generic events to a file
+; (defaults to yes).
+;event_log = no
+;
+;
+; For each file, specify what to log.
+;
+; For console logging, you set options at start of
+; Asterisk with -v for verbose and -d for debug
+; See 'asterisk -h' for more information.
+;
+; Directory for log files is configures in asterisk.conf
+; option astlogdir
+;
+[logfiles]
+;
+; Format is "filename" and then "levels" of debugging to be included:
+;    debug
+;    notice
+;    warning
+;    error
+;    verbose
+;    dtmf
+;
+; Special filename "console" represents the system console
+;
+; Filenames can either be relative to the standard Asterisk log directory
+; (see 'astlogdir' in asterisk.conf), or absolute paths that begin with
+; '/'.
+;
+; We highly recommend that you DO NOT turn on debug mode if you are simply
+; running a production system.  Debug mode turns on a LOT of extra messages,
+; most of which you are unlikely to understand without an understanding of
+; the underlying code.  Do NOT report debug messages as code issues, unless
+; you have a specific issue that you are attempting to debug.  They are
+; messages for just that -- debugging -- and do not rise to the level of
+; something that merit your attention as an Asterisk administrator.  Debug
+; messages are also very verbose and can and do fill up logfiles quickly;
+; this is another reason not to have debug mode on a production system unless
+; you are in the process of debugging a specific issue.
+;
+;debug => debug
+console => notice,warning,error,verbose
+;console => notice,warning,error,debug
+messages => notice,warning,error,verbose
+;full => notice,warning,error,debug,verbose
+
+;syslog keyword : This special keyword logs to syslog facility 
+;
+;syslog.local0 => notice,warning,error
+;

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/logger.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/logger.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs/logger.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs2/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs2/extensions.conf?view=auto&rev=461
==============================================================================
--- asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs2/extensions.conf (added)
+++ asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs2/extensions.conf Tue Jul  6 11:29:03 2010
@@ -1,0 +1,37 @@
+
+[general]
+static=yes
+writeprotect=no
+
+[parking]
+exten => b_exten,1,Answer()
+exten => b_exten,n,NOOP(incoming call from userA)
+exten => b_exten,n,Wait(1)
+exten => b_exten,n,SendDTMF(1w1w0)
+exten => b_exten,n,Wait(5)
+exten => b_exten,n,NOOP(trying to park the call)
+exten => b_exten,n,SendDTMF(#)
+exten => b_exten,n,Wait(2)
+exten => b_exten,n,SendDTMF(700)
+exten => b_exten,n,NOOP(waiting for hangup!)
+exten => b_exten,n,Wait(200)
+
+
+exten => s,1,Answer()
+exten => s,n,NOOP(userA got bored and returned due to parkingtimeout!)
+
+exten => s,n,NOOP(waiting for DTMF '999' from userA)
+exten => s,n(sync),Wait(1)
+exten => s,n,Read(sync,,3,,,8) ;wait more than 5 but less than 10 seconds
+exten => s,n,GotoIf($["${sync}"="999"]?DTMFpass:DTMFfail)
+
+exten => s,n(DTMFpass),NOOP(read '${sync}' and expected '999' - OK)
+exten => s,n,NOOP(TEST PASSED!)
+exten => s,n,AGI(agi://127.0.0.1:4574) ; tell the script - passed
+exten => s,n,Hangup()
+
+exten => s,n(DTMFfail),NOOP(read '${sync}' and exptected '999' - FAILURE)
+exten => s,n,NOOP(trying to sync again!)
+exten => s,n,Goto(sync)
+
+

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs2/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs2/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs2/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs2/iax.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs2/iax.conf?view=auto&rev=461
==============================================================================
--- asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs2/iax.conf (added)
+++ asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs2/iax.conf Tue Jul  6 11:29:03 2010
@@ -1,0 +1,29 @@
+[general]
+
+bindport=4571
+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
+requirecalltoken=no
+
+[userB]
+type=friend
+host=127.0.0.1
+port=4571
+context=parking
+requirecalltoken=no
+
+
+
+

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs2/iax.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs2/iax.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs2/iax.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs2/logger.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs2/logger.conf?view=auto&rev=461
==============================================================================
--- asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs2/logger.conf (added)
+++ asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs2/logger.conf Tue Jul  6 11:29:03 2010
@@ -1,0 +1,100 @@
+;
+; Logging Configuration
+;
+; In this file, you configure logging to files or to
+; the syslog system.
+;
+; "logger reload" at the CLI will reload configuration
+; of the logging system.
+
+[general]
+;
+; Customize the display of debug message time stamps
+; this example is the ISO 8601 date format (yyyy-mm-dd HH:MM:SS)
+;
+; see strftime(3) Linux manual for format specifiers.  Note that there is also
+; a fractional second parameter which may be used in this field.  Use %1q
+; for tenths, %2q for hundredths, etc.
+; 
+;dateformat=%F %T       ; ISO 8601 date format
+;dateformat=%F %T.%3q   ; with milliseconds
+;
+; This appends the hostname to the name of the log files.
+;appendhostname = yes
+;
+; This determines whether or not we log queue events to a file
+; (defaults to yes).
+;queue_log = no
+;
+; Set the queue_log filename
+; (defaults to queue_log)
+;queue_log_name = queue_log
+;
+; Log rotation strategy:
+; sequential:  Rename archived logs in order, such that the newest
+;              has the highest sequence number [default].
+; rotate:  Rotate all the old files, such that the oldest has the
+;          highest sequence number [this is the expected behavior
+;          for Unix administrators].
+; timestamp:  Rename the logfiles using a timestamp instead of a
+;             sequence number when "logger rotate" is executed.
+;rotatestrategy = rotate
+;
+; Run a system command after rotating the files.  This is mainly
+; useful for rotatestrategy=rotate. The example allows the last
+; two archive files to remain uncompressed, but after that point,
+; they are compressed on disk.
+;
+; exec_after_rotate=gzip -9 ${filename}.2
+;
+; This determines whether or not we log generic events to a file
+; (defaults to yes).
+;event_log = no
+;
+;
+; For each file, specify what to log.
+;
+; For console logging, you set options at start of
+; Asterisk with -v for verbose and -d for debug
+; See 'asterisk -h' for more information.
+;
+; Directory for log files is configures in asterisk.conf
+; option astlogdir
+;
+[logfiles]
+;
+; Format is "filename" and then "levels" of debugging to be included:
+;    debug
+;    notice
+;    warning
+;    error
+;    verbose
+;    dtmf
+;
+; Special filename "console" represents the system console
+;
+; Filenames can either be relative to the standard Asterisk log directory
+; (see 'astlogdir' in asterisk.conf), or absolute paths that begin with
+; '/'.
+;
+; We highly recommend that you DO NOT turn on debug mode if you are simply
+; running a production system.  Debug mode turns on a LOT of extra messages,
+; most of which you are unlikely to understand without an understanding of
+; the underlying code.  Do NOT report debug messages as code issues, unless
+; you have a specific issue that you are attempting to debug.  They are
+; messages for just that -- debugging -- and do not rise to the level of
+; something that merit your attention as an Asterisk administrator.  Debug
+; messages are also very verbose and can and do fill up logfiles quickly;
+; this is another reason not to have debug mode on a production system unless
+; you are in the process of debugging a specific issue.
+;
+;debug => debug
+console => notice,warning,error,verbose
+;console => notice,warning,error,debug
+messages => notice,warning,error,verbose
+;full => notice,warning,error,debug,verbose
+
+;syslog keyword : This special keyword logs to syslog facility 
+;
+;syslog.local0 => notice,warning,error
+;

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs2/logger.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs2/logger.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/configs2/logger.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/run-test?view=auto&rev=461
==============================================================================
--- asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/run-test (added)
+++ asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/run-test Tue Jul  6 11:29:03 2010
@@ -1,0 +1,132 @@
+#!/usr/bin/env python
+'''
+Copyright (C) 2010, Digium, Inc.
+Matthias Nick <mnick86 at gmail.com>
+
+This program is free software, distributed under the terms of
+the GNU General Public License Version 2.
+'''
+
+import sys
+import os
+import math
+from optparse import OptionParser
+from twisted.application import service, internet
+from twisted.internet import reactor
+from starpy import fastagi
+
+sys.path.append("lib/python")
+from asterisk.asterisk import Asterisk
+from asterisk.version import AsteriskVersion
+
+class BlindTransferTest:
+    def __init__(self, argv):
+        self.passed = False
+
+        # Test timeout in seconds
+        self.timeout = 60
+        self.last_step = ""
+
+        # get version info
+        parser = OptionParser()
+        parser.add_option("-v", "--version", dest="ast_version", help="Asterisk version string")
+        (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')
+
+        reactor.callWhenRunning(self.run)
+
+        print self.ast_version
+        self.asterisk1 = Asterisk(base=os.path.join(os.getcwd(), "/tmp/asterisk-testsuite/blind-transfer-parkingtimeout/asterisk1"))
+        self.asterisk1.install_config("tests/blind-transfer-parkingtimeout/configs/extensions.conf")
+        self.asterisk1.install_config("tests/blind-transfer-parkingtimeout/configs/iax.conf")
+        self.asterisk1.install_config("tests/blind-transfer-parkingtimeout/configs/features.conf")
+        self.asterisk1.install_config("tests/blind-transfer-parkingtimeout/configs/logger.conf")
+
+        self.asterisk2 = Asterisk(base=os.path.join(os.getcwd(), "/tmp/asterisk-testsuite/blind-transfer-parkingtimeout/asterisk2"))
+        self.asterisk2.install_config("tests/blind-transfer-parkingtimeout/configs2/extensions.conf")
+        self.asterisk2.install_config("tests/blind-transfer-parkingtimeout/configs2/iax.conf")
+        self.asterisk2.install_config("tests/blind-transfer-parkingtimeout/configs2/logger.conf")
+
+
+   # This gets invoked by the dialplan when test succeeds.
+    def get_result_b(self, agi):
+        self.log_last_step("got AGI connection from userB -> test successful")
+        self.passed = True
+        self.read_result();
+
+    def read_result(self):
+        self.log_last_step("Reading results")
+        self.asterisk1.cli_exec("core show locks")   # get lock output in case of deadlock before tearing down.
+        self.asterisk2.cli_exec("core show locks")   # get lock output in case of deadlock before tearing down.
+
+        self.asterisk1.cli_exec("core show channels")# if channels are still up for some reason, we want to know that as well
+        self.asterisk2.cli_exec("core show channels")# if channels are still up for some reason, we want to know that as well
+
+        self.stop_asterisk()
+
+        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.")
+
+        if reactor.running:
+            print "Stopping Reactor ..."
+            reactor.stop()
+
+
+    # This is a blind transfer test with parkingtimeout.
+    # 1.  A calls B
+    # 2.  B dials # -> 700, to park A.
+    # 3.  A gets parkingtimeout and returns to B
+    # 4.  B reports results to FastAGI and hangup
+    def launch_test(self):
+        self.asterisk2.cli_exec("core set verbose 10")
+        self.asterisk1.cli_exec("core set verbose 10")
+
+        self.log_last_step("Originating call to begin test")
+        if self.ast_version < AsteriskVersion("1.6.2"):
+            self.asterisk1.cli_exec("originate IAX2/userA at 127.0.0.1:4571/b_exten extension a_dials at parking")
+        else:
+            self.asterisk1.cli_exec("channel originate IAX2/userA at 127.0.0.1:4571/b_exten extension a_dials at parking")
+
+    def start_asterisk(self):
+        self.log_last_step("Starting Asterisk")
+        self.asterisk1.start()
+        self.asterisk2.start()
+
+    def stop_asterisk(self):
+        self.asterisk1.stop()
+        self.asterisk2.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)
+
+        # stop and read results after timeout
+        reactor.callLater(self.timeout, self.read_result)
+
+def main(argv=None):
+    if argv is None:
+        argv = sys.argv
+
+    # Run Blind Transfer Test
+    blind_transfer_test = BlindTransferTest(argv)
+    reactor.run()
+    blind_transfer_test.stop_asterisk()
+    if blind_transfer_test.passed != True:
+        return 1
+    return 0
+
+if __name__ == "__main__":
+    sys.exit(main() or 0)
+

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/run-test
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/run-test
------------------------------------------------------------------------------
    svn:executable = *

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/run-test
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/run-test
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/test-config.yaml?view=auto&rev=461
==============================================================================
--- asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/test-config.yaml (added)
+++ asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/test-config.yaml Tue Jul  6 11:29:03 2010
@@ -1,0 +1,10 @@
+testinfo:
+    summary:     'Test Blind Transfer with parkingtimeout'
+    description: |
+        'This test verifies the Blind Transfer routine with parkingtimeout used in the feature code.'
+
+properties:
+    minversion: '1.4'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/blind-transfer-parkingtimeout/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain




More information about the asterisk-commits mailing list