[asterisk-commits] tilghman: branch tilghman/callparking_retrieval r812 - in /asterisk/team/tilg...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Oct 25 17:38:04 CDT 2010


Author: tilghman
Date: Mon Oct 25 17:37:59 2010
New Revision: 812

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=812
Log:
Another external test, to verify lack of dumb warning messages

Added:
    asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/
    asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/run-test   (with props)
    asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/test-config.yaml   (with props)
    asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/userA/
    asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/userA/extensions.conf
      - copied, changed from r811, asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userA/extensions.conf
    asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/userA/iax.conf
      - copied, changed from r811, asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userA/iax.conf
    asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/userB/
    asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/userB/extensions.conf
      - copied, changed from r811, asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userC/extensions.conf
    asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/userB/iax.conf
      - copied, changed from r811, asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userC/iax.conf

Added: asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/run-test?view=auto&rev=812
==============================================================================
--- asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/run-test (added)
+++ asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/run-test Mon Oct 25 17:37:59 2010
@@ -1,0 +1,141 @@
+#!/bin/bash
+
+set +e
+
+echo " >>> Starting spoolfile test"
+
+testdir=${0%%run-test}
+ASTERISK=/usr/sbin/asterisk
+
+case `uname -s` in
+	solaris*|sunos*)
+		PS="ps -ef"
+		KILLALL="pkill"
+		;;
+	*)
+		PS="ps auxwww"
+		KILLALL="killall"
+		;;
+esac
+
+case $2 in
+	*-1.4*)
+		ORIGINATE='originate'
+		CSC_HEADERS=3
+		;;
+	*-1.6.2*|*-1.4*)
+		ORIGINATE='originate'
+		CSC_HEADERS=4
+		;;
+	*)
+		ORIGINATE='channel originate'
+		CSC_HEADERS=4
+		;;
+esac
+
+cleanup() {
+	if test "x$userA_tmpdir" = "x"; then : ; else
+		$ASTERISK -C $userA_tmpdir/asterisk.conf -rx "core stop now" >/dev/null 2>&1
+	fi
+	if test "x$userB_tmpdir" = "x"; then : ; else
+		$ASTERISK -C $userB_tmpdir/asterisk.conf -rx "core stop now" >/dev/null 2>&1
+	fi
+	sleep 2
+	$KILLALL asterisk
+	sleep 1
+	$KILLALL -9 asterisk
+	rm -rf $userA_tmpdir $userB_tmpdir
+	set -e
+}
+
+create_spool() {
+	( echo "Channel: $1"
+	  echo "Context: spoolfile"
+	  echo "Extension: $2"
+	  echo "Priority: 1"
+	  echo "Retry: 3"
+	  echo "WaitTime: 2"
+	  echo "RetryTime: 2"
+	)
+}
+
+verify_call() {
+	# Verify that the call is up
+	local count=`$ASTERISK -C $1/asterisk.conf -rx "core show channels" | wc -l`
+	if test $count != $(($CSC_HEADERS+$2)); then
+		echo " *** Call generation failed: $count"
+		cleanup
+		exit 1
+	fi
+}
+
+for user in userA userB; do
+	echo " >>> Creating configuration directory for $user"
+	eval "${user}_tmpdir=`mktemp --tmpdir=/var/tmp -t -d spoolfile_$user.XXXXXX`"
+	# Shortcut for referral within this loop only
+	eval "conf=\${${user}_tmpdir}"
+
+	if test "$conf" = ""; then
+		echo " *** Unable to create temporary directory for $user"
+		cleanup
+		exit 1
+	fi
+
+	echo " >>> Creating files in configuration directory"
+	for i in ../configs/*.sample; do
+		dst=$conf/`basename $i .sample`
+		install -m 644 $i $dst
+	done
+	for i in $testdir$user/*.conf; do
+		dst=$conf/`basename $i`
+		install -m 644 $i $dst
+	done
+	( echo "[directories]"; echo "astetcdir => $conf"; echo "astrundir => $conf"; echo "astlogdir => $testdir/$user"; echo "[options]"; echo "verbose = 10"; echo "documentation_language = en_US" ) > $conf/asterisk.conf
+
+	# Verify that files got created properly
+	if test -s $conf/asterisk.conf ; then : ; else
+		echo " *** Unable to create test configuration files in $conf"
+		cleanup
+		exit 1
+	fi
+	echo "Starting Asterisk for $user"
+	$ASTERISK -g -C $conf/asterisk.conf
+	sleep 1
+	# Asterisk is running, right?
+	if test `$PS | grep $conf[/] | wc -l` = "0"; then
+		echo " *** Unable to start asterisk for $user"
+		cleanup
+		exit 1
+	fi
+done
+
+echo " >>> Spooling first file"
+create_spool("Local/noanswer at spoolfile", "donothing") > $userA_tmpdir/spoolfile
+mv -f $userA_tmpdir/spoolfile /var/spool/asterisk/outgoing/
+sleep 1
+verify_call($userA_tmpdir, 3)
+
+# Enough time for 3 retries
+sleep 12
+
+echo " >>> Spooling second file"
+create_spool("Local/answer at spoolfile", "donothing") > $userA_tmpdir/spoolfile
+mv -f $userA_tmpdir/spoolfile /var/spool/asterisk/outgoing/
+sleep 1
+verify_call($userA_tmpdir, 3)
+
+sleep 5
+
+# Count before cleanup, because cleanup removes the log
+count=`grep -c 'No such file or directory, deleting' $userA_tmpdir/messages`
+
+cleanup
+
+if test "$count" = "0"; then
+	echo " *** Success!"
+	exit 0
+else
+	echo " *** Failed:  found the error message $count times"
+	exit 1
+fi
+

Propchange: asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/run-test
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/run-test
------------------------------------------------------------------------------
    svn:executable = *

Propchange: asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/run-test
------------------------------------------------------------------------------
    svn:keywords = 'Date Author Id Revision Yoyo'

Propchange: asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/run-test
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/test-config.yaml?view=auto&rev=812
==============================================================================
--- asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/test-config.yaml (added)
+++ asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/test-config.yaml Mon Oct 25 17:37:59 2010
@@ -1,0 +1,7 @@
+testinfo:
+    summary:     'Test Call Spools'
+    description: |
+        'This test verifies that calls queued via the spooler do not cause warning messages about a file not existing.'
+
+properties:
+    minversion: '1.8'

Propchange: asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = 'Date Author Id Revision Yoyo'

Propchange: asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/userA/extensions.conf (from r811, asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userA/extensions.conf)
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/userA/extensions.conf?view=diff&rev=812&p1=asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userA/extensions.conf&r1=811&p2=asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/userA/extensions.conf&r2=812
==============================================================================
--- asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userA/extensions.conf (original)
+++ asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/userA/extensions.conf Mon Oct 25 17:37:59 2010
@@ -3,12 +3,12 @@
 writeprotect=no
 lastaction=""
 
-[parking]
+[spoolfiles]
 ; User A starts out by calling user B, with inband DTMF activated for transfer
-exten => callb,1,Dial(IAX2/userc/userb at parking)
-exten => callb,n,Hangup
+exten => donothing,1,Answer
+exten => donothing,n,Wait(1)
+exten => donothing,n,Hangup
 
-; What channel A will be doing
-exten => wait,1,Answer()
-exten => wait,n,Wait(100)
+exten => answer,1,Dial(IAX2/userb/${EXTEN}@spoolfiles)
+exten => noanswer,1,Dial(IAX2/userb/${EXTEN}@spoolfiles)
 

Copied: asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/userA/iax.conf (from r811, asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userA/iax.conf)
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/userA/iax.conf?view=diff&rev=812&p1=asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userA/iax.conf&r1=811&p2=asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/userA/iax.conf&r2=812
==============================================================================
--- asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userA/iax.conf (original)
+++ asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/userA/iax.conf Mon Oct 25 17:37:59 2010
@@ -7,11 +7,11 @@
 jitterbuffer=no
 forcejitterbuffer=no
 
-[userc]
+[userb]
 type=friend
 username=usera
 host=127.0.0.1
-port=4573
-context=parking
+port=4572
+context=spoolfiles
 transfer=no
 

Copied: asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/userB/extensions.conf (from r811, asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userC/extensions.conf)
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/userB/extensions.conf?view=diff&rev=812&p1=asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userC/extensions.conf&r1=811&p2=asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/userB/extensions.conf&r2=812
==============================================================================
--- asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userC/extensions.conf (original)
+++ asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/userB/extensions.conf Mon Oct 25 17:37:59 2010
@@ -3,12 +3,10 @@
 writeprotect=no
 lastaction=""
 
-[parking]
-include => parkedcalls
+[spoolfiles]
+exten => answer,1,Answer
+exten => answer,n,Wait(1)
+exten => answer,n,Hangup
 
-; User A starts out by calling user B, with inband DTMF activated for transfer
-exten => userb,1,Dial(IAX2/userb/userb at parking,,t)
-exten => userb,n,Hangup
+exten => noanswer,1,Wait(100)
 
-; When user B calls in, we will go directly to the parkedcalls context, so nothing else is needed here.
-

Copied: asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/userB/iax.conf (from r811, asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userC/iax.conf)
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/userB/iax.conf?view=diff&rev=812&p1=asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userC/iax.conf&r1=811&p2=asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/userB/iax.conf&r2=812
==============================================================================
--- asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userC/iax.conf (original)
+++ asterisk/team/tilghman/callparking_retrieval/tests/pbx/call-files2/userB/iax.conf Mon Oct 25 17:37:59 2010
@@ -1,5 +1,5 @@
 [general]
-bindport=4573
+bindport=4572
 bindaddr=127.0.0.1
 transfer=no
 disallow=all
@@ -9,17 +9,9 @@
 
 [usera]
 type=friend
-username=userc
+username=userb
 host=127.0.0.1
 port=4571
-context=parking
+context=spoolfiles
 transfer=no
 
-[userb]
-type=friend
-username=userc
-host=127.0.0.1
-port=4572
-context=parking
-transfer=no
-




More information about the asterisk-commits mailing list