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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Aug 5 09:11:17 CDT 2010


Author: mnick
Date: Thu Aug  5 09:11:13 2010
New Revision: 706

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=706
Log:
added new test - callparking

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

Added: asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs/extensions.conf?view=auto&rev=706
==============================================================================
--- asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs/extensions.conf (added)
+++ asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs/extensions.conf Thu Aug  5 09:11:13 2010
@@ -1,0 +1,37 @@
+[general]
+static=yes
+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()
+
+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 => 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()
+
+include => parkedcalls

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

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

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

Added: asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs/iax.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs/iax.conf?view=auto&rev=706
==============================================================================
--- asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs/iax.conf (added)
+++ asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs/iax.conf Thu Aug  5 09:11:13 2010
@@ -1,0 +1,14 @@
+[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

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

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

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

Added: asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs/logger.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs/logger.conf?view=auto&rev=706
==============================================================================
--- asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs/logger.conf (added)
+++ asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs/logger.conf Thu Aug  5 09:11:13 2010
@@ -1,0 +1,96 @@
+;
+; 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
+;
+;
+; 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
+;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/callparking/configs/logger.conf
------------------------------------------------------------------------------
    svn:eol-style = native

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

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

Added: asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs2/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs2/extensions.conf?view=auto&rev=706
==============================================================================
--- asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs2/extensions.conf (added)
+++ asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs2/extensions.conf Thu Aug  5 09:11:13 2010
@@ -1,0 +1,40 @@
+[general]
+static=yes
+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 => 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()
+
+[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()

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

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

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

Added: asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs2/iax.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs2/iax.conf?view=auto&rev=706
==============================================================================
--- asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs2/iax.conf (added)
+++ asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs2/iax.conf Thu Aug  5 09:11:13 2010
@@ -1,0 +1,20 @@
+[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=parkingAB
+
+[userB]
+type=friend
+host=127.0.0.1
+port=4571
+context=parkingBC

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

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

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

Added: asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs2/logger.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs2/logger.conf?view=auto&rev=706
==============================================================================
--- asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs2/logger.conf (added)
+++ asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs2/logger.conf Thu Aug  5 09:11:13 2010
@@ -1,0 +1,96 @@
+;
+; 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
+;
+;
+; 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
+;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/callparking/configs2/logger.conf
------------------------------------------------------------------------------
    svn:eol-style = native

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

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

Added: asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs3/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs3/extensions.conf?view=auto&rev=706
==============================================================================
--- asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs3/extensions.conf (added)
+++ asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs3/extensions.conf Thu Aug  5 09:11:13 2010
@@ -1,0 +1,48 @@
+[general]
+static=yes
+writeprotect=no
+lastaction=""
+
+[parking]
+exten => c_exten,1,Answer()
+exten => c_exten,n,NOOP(userC answered the call)
+exten => c_exten,n,Wait(1)
+exten => c_exten,n,SendDTMF(1w1w0)
+exten => c_exten,n,Wait(1)
+exten => c_exten,n,NOOP(trying to park the call)
+exten => c_exten,n,SET(GLOBAL(lastaction)=parkedB)
+exten => c_exten,n,SendDTMF(#)
+exten => c_exten,n,Wait(1)
+exten => c_exten,n,SendDTMF(700)
+exten => c_exten,n,Hangup()
+
+exten => h,1,GotoIF($["${GLOBAL(lastaction)}"="parkedB"]?retrieveA)
+exten => h,n,Hangup()
+exten => h,n(retrieveA),NOOP(Got Hangup due to successfull parking of userB -> call 701 in order to retrieve userA)
+exten => h,n,AGI(agi://127.0.0.1:4575)
+exten => h,n,Hangup()
+
+exten => retrieve_A,1,NOOP(okay, I should now be connected to userA -> trying to sync)
+exten => retrieve_A,n(sync),Wait(1)
+exten => retrieve_A,n,Read(sync,,3,,,8) ;wait more than 5 but less than 10 seconds
+exten => retrieve_A,n,GotoIf($["${sync}"="999"]?DTMFpass:DTMFfail)
+exten => retrieve_A,n(DTMFpass),NOOP(read '${sync}' and expected '999' - OK)
+exten => retrieve_A,n,NOOP(synchronized to userA successfully - now retrieve userB!)
+exten => retrieve_A,n,Set(GLOBAL(lastaction)=successA)
+exten => retrieve_A,n,AGI(agi://127.0.0.1:4576)
+exten => retrieve_A,n,Hangup()
+exten => retrieve_A,n(DTMFfail),NOOP(read '${sync}' and exptected '999' - FAILURE)
+exten => retrieve_A,n,NOOP(trying to sync again!)
+exten => retrieve_A,n,Goto(sync)
+
+exten => retrieve_B,1,NOOP(okay, I should now be connected to userB -> trying to sync)
+exten => retrieve_B,n(sync),Wait(1)
+exten => retrieve_B,n,Read(sync,,3,,,8) ;wait more than 5 but less than 10 seconds
+exten => retrieve_B,n,GotoIf($["${sync}"="888"]?DTMFpass:DTMFfail)
+exten => retrieve_B,n(DTMFpass),NOOP(read '${sync}' and expected '888' - OK)
+exten => retrieve_B,n,NOOP(TEST PASSED!)
+exten => retrieve_B,n,Set(GLOBAL(lastaction)=success)
+exten => retrieve_B,n,AGI(agi://127.0.0.1:4577)
+exten => retrieve_B,n,Hangup()
+exten => retrieve_B,n(DTMFfail),NOOP(read '${sync}' and exptected '888' - FAILURE)
+exten => retrieve_B,n,NOOP(trying to sync again!)

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs3/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs3/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs3/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs3/iax.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs3/iax.conf?view=auto&rev=706
==============================================================================
--- asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs3/iax.conf (added)
+++ asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs3/iax.conf Thu Aug  5 09:11:13 2010
@@ -1,0 +1,14 @@
+[general]
+bindport=4572
+bindaddr=127.0.0.1
+transfer=yes
+disallow=all
+allow=ulaw
+jitterbuffer=no
+forcejitterbuffer=no
+
+[userB]
+type=friend
+host=127.0.0.1
+port=4571
+context=parking

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs3/iax.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs3/iax.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs3/iax.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs3/logger.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs3/logger.conf?view=auto&rev=706
==============================================================================
--- asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs3/logger.conf (added)
+++ asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs3/logger.conf Thu Aug  5 09:11:13 2010
@@ -1,0 +1,96 @@
+;
+; 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
+;
+;
+; 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
+;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/callparking/configs3/logger.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs3/logger.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/mnick/gsoc2010/trunk/tests/callparking/configs3/logger.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/mnick/gsoc2010/trunk/tests/callparking/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mnick/gsoc2010/trunk/tests/callparking/run-test?view=auto&rev=706
==============================================================================
--- asterisk/team/mnick/gsoc2010/trunk/tests/callparking/run-test (added)
+++ asterisk/team/mnick/gsoc2010/trunk/tests/callparking/run-test Thu Aug  5 09:11:13 2010
@@ -1,0 +1,178 @@
+#!/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 CallParkingTest:
+    def __init__(self, argv):
+        self.passed = False
+        self.done = 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)
+        print self.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.asterisk1 = Asterisk(base="/tmp/asterisk-testsuite/callparking/asterisk1")
+        self.asterisk1.install_config("tests/callparking/configs/extensions.conf")
+        self.asterisk1.install_config("tests/callparking/configs/iax.conf")
+        self.asterisk1.install_config("tests/callparking/configs/logger.conf")
+
+        self.asterisk2 = Asterisk(base="/tmp/asterisk-testsuite/callparking/asterisk2")
+        self.asterisk2.install_config("tests/callparking/configs2/extensions.conf")
+        self.asterisk2.install_config("tests/callparking/configs2/iax.conf")
+        self.asterisk2.install_config("tests/callparking/configs2/logger.conf")
+
+        self.asterisk3 = Asterisk(base="/tmp/asterisk-testsuite/callparking/asterisk3")
+        self.asterisk3.install_config("tests/callparking/configs3/extensions.conf")
+        self.asterisk3.install_config("tests/callparking/configs3/iax.conf")
+        self.asterisk3.install_config("tests/callparking/configs3/logger.conf")
+
+    # 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 <--> userC now")
+	self.asterisk1.cli_originate("IAX2/userB at 127.0.0.1:4572/c_exten extension bridge_to_B at parking")
+        return self.finish_agi(agi)
+
+    # 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.asterisk3.cli_originate("IAX2/userA at 127.0.0.1:4570/701 extension retrieve_A at parking")
+	return self.finish_agi(agi)
+
+    # This gets invoked by the dialplan when userC has retrieved userA successfully. 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.asterisk3.cli_originate("IAX2/userA at 127.0.0.1:4570/702 extension retrieve_B at parking")
+	return self.finish_agi(agi)
+
+    # This gets invoked by the dialplan when userC has retrieved userB successfully. 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 self.finish_agi(agi)
+
+    # Finish the AGI connection
+    def finish_agi(self, agi):
+        sequence = fastagi.InSequence()
+        sequence.append(agi.finish)
+        return sequence()
+
+    def read_result(self):
+        if self.done:
+            return
+        self.done = True
+
+        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")
+        self.asterisk3.cli_exec("core show locks")
+
+        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")
+        self.asterisk3.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.")
+
+        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 launch_test(self):
+        self.asterisk1.cli_exec("core set verbose 10")
+        self.asterisk2.cli_exec("core set verbose 10")
+        self.asterisk3.cli_exec("core set verbose 10")
+
+        self.log_last_step("Originating call to begin test")
+        self.asterisk1.cli_originate("IAX2/userA at 127.0.0.1:4571/b_exten extension bridge_to_A at parking")
+
+    def start_asterisk(self):
+        self.log_last_step("Starting Asterisk")
+        self.asterisk1.start()
+        self.asterisk2.start()
+        self.asterisk3.start()
+
+    def stop_asterisk(self):
+        self.asterisk1.stop()
+        self.asterisk2.stop()
+        self.asterisk3.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 CallParking Test
+    call_parking_test = CallParkingTest(argv)
+    reactor.run()
+    call_parking_test.stop_asterisk()
+    if call_parking_test.passed != True:
+        return 1
+    return 0
+
+if __name__ == "__main__":
+    sys.exit(main() or 0)
+
+# vim:sw=4:ts=4:expandtab:textwidth=79

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

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

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

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

Added: asterisk/team/mnick/gsoc2010/trunk/tests/callparking/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mnick/gsoc2010/trunk/tests/callparking/test-config.yaml?view=auto&rev=706
==============================================================================
--- asterisk/team/mnick/gsoc2010/trunk/tests/callparking/test-config.yaml (added)
+++ asterisk/team/mnick/gsoc2010/trunk/tests/callparking/test-config.yaml Thu Aug  5 09:11:13 2010
@@ -1,0 +1,10 @@
+testinfo:
+    summary:     'Test Call Parking'
+    description: |
+        'This test verifies the Call Parking routine used in the feature code.'
+
+properties:
+    minversion: '1.4'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'

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

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

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




More information about the asterisk-commits mailing list