[asterisk-commits] tilghman: branch tilghman/callparking_retrieval r806 - in /asterisk/team/tilg...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Oct 19 19:32:11 CDT 2010
Author: tilghman
Date: Tue Oct 19 19:32:08 2010
New Revision: 806
URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=806
Log:
Getting closer to working...
Added:
asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userC/
asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userC/extensions.conf (with props)
asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userC/iax.conf (with props)
Modified:
asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/run-test
asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userA/extensions.conf
asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userA/iax.conf
asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userB/extensions.conf
asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userB/iax.conf
Modified: asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/run-test?view=diff&rev=806&r1=805&r2=806
==============================================================================
--- asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/run-test (original)
+++ asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/run-test Tue Oct 19 19:32:08 2010
@@ -1,10 +1,11 @@
-#!/bin/sh
+#!/bin/bash
set +e
echo " >>> Starting callparking_retrieval test"
testdir=${0%%run-test}
+ASTERISK=/usr/sbin/asterisk
case `uname -s` in
solaris*|sunos*)
@@ -33,29 +34,24 @@
esac
cleanup() {
- return
if test "x$userA_tmpdir" = "x"; then : ; else
- /usr/sbin/asterisk -C $userA_tmpdir/asterisk.conf -rx "core stop now" >/dev/null 2>&1
+ $ASTERISK -C $userA_tmpdir/asterisk.conf -rx "core stop now" >/dev/null 2>&1
fi
if test "x$userB_tmpdir" = "x"; then : ; else
- /usr/sbin/asterisk -C $userB_tmpdir/asterisk.conf -rx "core stop now" >/dev/null 2>&1
+ $ASTERISK -C $userB_tmpdir/asterisk.conf -rx "core stop now" >/dev/null 2>&1
fi
- rm -rf /tmp/callparking_retrieval
+ if test "x$userC_tmpdir" = "x"; then : ; else
+ $ASTERISK -C $userC_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 $userC_tmpdir
set -e
}
-show_channels() {
- echo " * Channels on A:"
- /usr/sbin/asterisk -C $userA_tmpdir/asterisk.conf -rx "core show channels"
- echo " * Channels on B:"
- /usr/sbin/asterisk -C $userB_tmpdir/asterisk.conf -rx "core show channels"
-}
-
-for user in userA userB; do
+for user in userA userB userC; do
echo " >>> Creating configuration directory for $user"
eval "${user}_tmpdir=`mktemp -t -d callparking_retrieval_$user.XXXXXX`"
# Shortcut for referral within this loop only
@@ -63,7 +59,7 @@
if test "$conf" = ""; then
echo " *** Unable to create temporary directory for $user"
- cleanup()
+ cleanup
exit 1
fi
@@ -81,72 +77,91 @@
# Verify that files got created properly
if test -s $conf/asterisk.conf ; then : ; else
- cleanup()
echo " *** Unable to create test configuration files in $conf"
+ cleanup
exit 1
fi
echo "Starting Asterisk for $user"
- /usr/sbin/asterisk -g -C $conf/asterisk.conf
+ $ASTERISK -g -C $conf/asterisk.conf
sleep 1
# Asterisk is running, right?
if test `$PS | grep $conf[/] | wc -l` = "0"; then
- cleanup()
echo " *** Unable to start asterisk for $user"
+ cleanup
exit 1
fi
done
echo " >>> User A is calling user B, who will park the call."
-/usr/sbin/asterisk -C $userA_tmpdir/asterisk.conf -rx "$ORIGINATE Local/wait at parking extension callb at parking"
+$ASTERISK -C $userA_tmpdir/asterisk.conf -rx "$ORIGINATE Local/wait at parking extension callb at parking" &
sleep 2
# Verify that the call is up
-count=`/usr/sbin/asterisk -C $userA_tmpdir/asterisk.conf -rx "core show channels" | wc -l`
-show_channels()
-/usr/sbin/asterisk -C $userA_tmpdir/asterisk.conf -rx "core show channels"
-if test $count != $(($CSC_HEADERS+2)); then # 2 = channel A linked to B + channel B linked to A
- cleanup()
+count=`$ASTERISK -C $userA_tmpdir/asterisk.conf -rx "core show channels" | wc -l`
+echo "====="
+$ASTERISK -C $userA_tmpdir/asterisk.conf -rx "core show channels"
+echo "-----"
+$ASTERISK -C $userB_tmpdir/asterisk.conf -rx "core show channels"
+echo "-----"
+$ASTERISK -C $userC_tmpdir/asterisk.conf -rx "core show channels"
+if test $count != $(($CSC_HEADERS+3)); then # 3 = 2 sides of Local channel plus outgoing to B
echo " *** Call generation from user A to user B failed: $count"
+ cleanup
exit 1
fi
-sleep 8
+sleep 3
-# Verify that the call is up
-count=`/usr/sbin/asterisk -C $userA_tmpdir/asterisk.conf -rx "core show channels" | wc -l`
-show_channels()
+# Verify that the call is up on our bridge server
+count=`$ASTERISK -C $userC_tmpdir/asterisk.conf -rx "core show channels" | wc -l`
+echo "====="
+$ASTERISK -C $userA_tmpdir/asterisk.conf -rx "core show channels"
+echo "-----"
+$ASTERISK -C $userB_tmpdir/asterisk.conf -rx "core show channels"
+echo "-----"
+$ASTERISK -C $userC_tmpdir/asterisk.conf -rx "core show channels"
if test $count != $(($CSC_HEADERS+1)); then
- cleanup()
echo " *** User B failed to park the call from user A: $count"
+ cleanup
exit 1
fi
echo " >>> User B is retrieving user A from parking, then will attempt to repark it."
-/usr/sbin/asterisk -C $userB_tmpdir/asterisk.conf -rx "$ORIGINATE IAX2/usera/701 at parking extension parka at parking"
+$ASTERISK -C $userB_tmpdir/asterisk.conf -rx "$ORIGINATE IAX2/userc/701 at parking extension parka at parking" &
sleep 2
# Verify that the call is up
-count=`/usr/sbin/asterisk -C $userA_tmpdir/asterisk.conf -rx "core show channels" | wc -l`
-show_channels()
+count=`$ASTERISK -C $userC_tmpdir/asterisk.conf -rx "core show channels" | wc -l`
+echo "====="
+$ASTERISK -C $userA_tmpdir/asterisk.conf -rx "core show channels"
+echo "-----"
+$ASTERISK -C $userB_tmpdir/asterisk.conf -rx "core show channels"
+echo "-----"
+$ASTERISK -C $userC_tmpdir/asterisk.conf -rx "core show channels"
if test $count != $(($CSC_HEADERS+2)); then # 2 = channel A linked to B + channel B linked to A
- cleanup()
echo " *** User B failed to retrieve the call from parking: $count"
+ cleanup
exit 1
fi
-sleep 8
+sleep 3
-a_parked=`/usr/sbin/asterisk -C $userA_tmpdir/asterisk.conf -rx "core show channels" | wc -l`
-show_channels()
+a_parked=`$ASTERISK -C $userC_tmpdir/asterisk.conf -rx "core show channels" | wc -l`
+echo "====="
+$ASTERISK -C $userA_tmpdir/asterisk.conf -rx "core show channels"
+echo "-----"
+$ASTERISK -C $userB_tmpdir/asterisk.conf -rx "core show channels"
+echo "-----"
+$ASTERISK -C $userC_tmpdir/asterisk.conf -rx "core show channels"
if test $a_parked != $(($CSC_HEADERS+1)); then
echo " *** Failed. When user B hung up, user A was not parked and thus hungup as well: $count."
- cleanup()
+ cleanup
exit 1
fi
-#cleanup()
+echo "Success!"
-echo "Success!"
+cleanup
exit 0
Modified: asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userA/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userA/extensions.conf?view=diff&rev=806&r1=805&r2=806
==============================================================================
--- asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userA/extensions.conf (original)
+++ asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userA/extensions.conf Tue Oct 19 19:32:08 2010
@@ -4,12 +4,11 @@
lastaction=""
[parking]
-include => parkedcalls
+; 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
-; User A starts out by calling user B, with inband DTMF activated for transfer
-exten => callb,1,Dial(IAX2/userb/userb at parking,,t)
; What channel A will be doing
-exten => wait,1,Wait(100)
+exten => wait,1,Answer()
+exten => wait,n,Wait(100)
-; When user B calls in, we will go directly to the parkedcalls context, so nothing else is needed here.
-
Modified: asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userA/iax.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userA/iax.conf?view=diff&rev=806&r1=805&r2=806
==============================================================================
--- asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userA/iax.conf (original)
+++ asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userA/iax.conf Tue Oct 19 19:32:08 2010
@@ -1,14 +1,17 @@
[general]
bindport=4571
bindaddr=127.0.0.1
-transfer=yes
+transfer=no
disallow=all
allow=ulaw
jitterbuffer=no
forcejitterbuffer=no
-[userb]
+[userc]
type=friend
+username=usera
host=127.0.0.1
-port=4572
+port=4573
context=parking
+transfer=no
+
Modified: asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userB/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userB/extensions.conf?view=diff&rev=806&r1=805&r2=806
==============================================================================
--- asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userB/extensions.conf (original)
+++ asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userB/extensions.conf Tue Oct 19 19:32:08 2010
@@ -1,14 +1,16 @@
+
+
[parking]
; When user A calls user B, user B will attempt to callpark user A.
-exten => callb,1,Answer
-exten => callb,n(park),Wait(1)
-exten => callb,n,SendDTMF(#)
-exten => callb,n,Wait(3)
-exten => callb,n,SendDTMF(700)
-exten => callb,n,Wait(1)
-exten => callb,n,Hangup
+exten => userb,1,Answer
+exten => userb,n(park),Wait(1)
+exten => userb,n,SendDTMF(#)
+exten => userb,n,Wait(1)
+exten => userb,n,SendDTMF(700)
+exten => userb,n,Wait(1)
+exten => userb,n,Hangup
; After retrieving the parked call, try parking it again
-exten => parka,1,Goto(callb,park)
+exten => parka,1,Goto(userb,park)
Modified: asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userB/iax.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userB/iax.conf?view=diff&rev=806&r1=805&r2=806
==============================================================================
--- asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userB/iax.conf (original)
+++ asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userB/iax.conf Tue Oct 19 19:32:08 2010
@@ -1,15 +1,17 @@
[general]
bindport=4572
bindaddr=127.0.0.1
-transfer=yes
+transfer=no
disallow=all
allow=ulaw
jitterbuffer=no
forcejitterbuffer=no
-[usera]
+[userc]
type=friend
+username=userb
host=127.0.0.1
-port=4571
+port=4573
context=parking
+transfer=no
Added: asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userC/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userC/extensions.conf?view=auto&rev=806
==============================================================================
--- asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userC/extensions.conf (added)
+++ asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userC/extensions.conf Tue Oct 19 19:32:08 2010
@@ -1,0 +1,14 @@
+[general]
+static=yes
+writeprotect=no
+lastaction=""
+
+[parking]
+include => parkedcalls
+
+; 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
+
+; When user B calls in, we will go directly to the parkedcalls context, so nothing else is needed here.
+
Propchange: asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userC/extensions.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userC/extensions.conf
------------------------------------------------------------------------------
svn:keywords = 'Date Author Id Revision Yoyo'
Propchange: asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userC/extensions.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userC/iax.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userC/iax.conf?view=auto&rev=806
==============================================================================
--- asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userC/iax.conf (added)
+++ asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userC/iax.conf Tue Oct 19 19:32:08 2010
@@ -1,0 +1,25 @@
+[general]
+bindport=4573
+bindaddr=127.0.0.1
+transfer=no
+disallow=all
+allow=ulaw
+jitterbuffer=no
+forcejitterbuffer=no
+
+[usera]
+type=friend
+username=userc
+host=127.0.0.1
+port=4571
+context=parking
+transfer=no
+
+[userb]
+type=friend
+username=userc
+host=127.0.0.1
+port=4572
+context=parking
+transfer=no
+
Propchange: asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userC/iax.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userC/iax.conf
------------------------------------------------------------------------------
svn:keywords = 'Date Author Id Revision Yoyo'
Propchange: asterisk/team/tilghman/callparking_retrieval/tests/callparking_retrieval/userC/iax.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
More information about the asterisk-commits
mailing list