[asterisk-commits] rmudgett: branch rmudgett/parking r2504 - in /asterisk/team/rmudgett/parking/...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Oct 4 16:35:09 CDT 2011
Author: rmudgett
Date: Tue Oct 4 16:35:05 2011
New Revision: 2504
URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=2504
Log:
Update callparking test to do DTMF one-step, blind xfer, atxfer parking.
* Also tests features findslot=next option.
Modified:
asterisk/team/rmudgett/parking/tests/callparking/configs/ast1/extensions.conf
asterisk/team/rmudgett/parking/tests/callparking/configs/ast1/features.conf
asterisk/team/rmudgett/parking/tests/callparking/configs/ast2/extensions.conf
asterisk/team/rmudgett/parking/tests/callparking/run-test
asterisk/team/rmudgett/parking/tests/callparking/test-config.yaml
Modified: asterisk/team/rmudgett/parking/tests/callparking/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/rmudgett/parking/tests/callparking/configs/ast1/extensions.conf?view=diff&rev=2504&r1=2503&r2=2504
==============================================================================
--- asterisk/team/rmudgett/parking/tests/callparking/configs/ast1/extensions.conf (original)
+++ asterisk/team/rmudgett/parking/tests/callparking/configs/ast1/extensions.conf Tue Oct 4 16:35:05 2011
@@ -4,15 +4,30 @@
lastaction=""
[ast2]
-exten => 9876,1,Dial(IAX2/ast2/${EXTEN},120,rtT)
+exten => 9876,1,NoOp(Initiate call to be parked)
+exten => 9876,n,Dial(IAX2/ast2/${EXTEN},120,rkt)
exten => 9876,n,Hangup()
-exten => 101,1,Answer()
-exten => 101,n,SendDTMF(1w2w3w4w)
+exten => 101,1,NoOp(Request DTMF one-step-parking method)
+exten => 101,n,Answer()
+exten => 101,n,SendDTMF(1234)
exten => 101,n(restart),Background(demo-congrats)
exten => 101,n,Goto(restart)
-exten => 5432,1,SendDTMF(3w4w5w6w)
+exten => 102,1,NoOp(Request DTMF blind transfer method)
+exten => 102,n,Answer()
+exten => 102,n,SendDTMF(1235)
+exten => 102,n(restart),Background(demo-congrats)
+exten => 102,n,Goto(restart)
+
+exten => 103,1,NoOp(Request DTMF attended transfer method)
+exten => 103,n,Answer()
+exten => 103,n,SendDTMF(1236)
+exten => 103,n(restart),Background(demo-congrats)
+exten => 103,n,Goto(restart)
+
+exten => 5432,1,NoOp(Ack parking retrieval)
+exten => 5432,n,SendDTMF(3456)
exten => 5432,n,UserEvent(ast1, status: SUCCESS)
exten => 5432,n,Playback(demo-congrats)
exten => 5432,n,Hangup()
Modified: asterisk/team/rmudgett/parking/tests/callparking/configs/ast1/features.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/rmudgett/parking/tests/callparking/configs/ast1/features.conf?view=diff&rev=2504&r1=2503&r2=2504
==============================================================================
--- asterisk/team/rmudgett/parking/tests/callparking/configs/ast1/features.conf (original)
+++ asterisk/team/rmudgett/parking/tests/callparking/configs/ast1/features.conf Tue Oct 4 16:35:05 2011
@@ -3,3 +3,10 @@
parkpos => 701-720
context => parkedcalls
parkingtime => 60
+findslot => next ; Continue to the 'next' free parking space.
+
+[featuremap]
+parkcall => #72 ; Park call (one step parking) -- Make sure to set the K and/or k option in the Dial() app call!
+blindxfer => #1 ; Blind transfer (default is #) -- Make sure to set the T and/or t option in the Dial() or Queue() app call!
+atxfer => *2 ; Attended transfer -- Make sure to set the T and/or t option in the Dial() or Queue() app call!
+
Modified: asterisk/team/rmudgett/parking/tests/callparking/configs/ast2/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/rmudgett/parking/tests/callparking/configs/ast2/extensions.conf?view=diff&rev=2504&r1=2503&r2=2504
==============================================================================
--- asterisk/team/rmudgett/parking/tests/callparking/configs/ast2/extensions.conf (original)
+++ asterisk/team/rmudgett/parking/tests/callparking/configs/ast2/extensions.conf Tue Oct 4 16:35:05 2011
@@ -3,21 +3,34 @@
writeprotect=no
[parkingAB]
-exten => 9876,1,Answer()
+exten => 9876,1,NoOp(Answer call to be parked)
+exten => 9876,n,Answer()
exten => 9876,n,Background(demo-congrats)
exten => 9876,n,Hangup()
-exten => 1234,1,SendDTMF(#)
-exten => 1234,n,SendDTMF(7w0w0)
+exten => 1234,1,NoOp(Initiate DTMF one-step-parking)
+exten => 1234,n,SendDTMF(#72w)
exten => 1234,n,Hangup()
+exten => 1235,1,NoOp(Initiate DTMF blind transfer)
+exten => 1235,n,SendDTMF(#1w)
+exten => 1235,n,SendDTMF(700w)
+exten => 1235,n,Hangup()
+
+exten => 1236,1,NoOp(Initiate DTMF attended transfer)
+exten => 1236,n,SendDTMF(*2w)
+exten => 1236,n,SendDTMF(700w)
+exten => 1236,n,Hangup()
+
[ast1]
-exten => s,1,Answer()
-exten => s,n,SendDTMF(5w4w3w2)
-exten => s,n,Background(demo-congrats)
-exten => s,n,UserEvent(ast2, status: FAILURE)
-exten => s,n,Hangup()
+exten => retrieve,1,NoOp(Parked call retrieved)
+exten => retrieve,n,Answer()
+exten => retrieve,n,SendDTMF(5432)
+exten => retrieve,n,Background(demo-congrats)
+exten => retrieve,n,UserEvent(ast2, status: FAILURE)
+exten => retrieve,n,Hangup()
-exten => 3456,1,UserEvent(ast2, status: SUCCESS)
+exten => 3456,1,NoOp(Parking retrieval voice path open both ways)
+exten => 3456,n,UserEvent(ast2, status: SUCCESS)
exten => 3456,n,Playback(demo-congrats)
exten => 3456,n,Hangup()
Modified: asterisk/team/rmudgett/parking/tests/callparking/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/rmudgett/parking/tests/callparking/run-test?view=diff&rev=2504&r1=2503&r2=2504
==============================================================================
--- asterisk/team/rmudgett/parking/tests/callparking/run-test (original)
+++ asterisk/team/rmudgett/parking/tests/callparking/run-test Tue Oct 4 16:35:05 2011
@@ -22,6 +22,12 @@
TestCase.__init__(self)
self.ami_count = 0
+
+ # Initial parked call subtest.
+ self.expected_space = 701
+ self.request_exten = 101
+
+ # Clear parked call subtest completion stage flags.
self.got_AMI_UnParkedCall = False
self.ast1_event = False
self.ast2_event = False
@@ -30,21 +36,53 @@
self.create_asterisk(2)
def check_result(self):
- if self.got_AMI_UnParkedCall is True and self.ast1_event is True and self.ast2_event is True:
- self.passed = True
- self.stop_reactor()
+ if not self.got_AMI_UnParkedCall:
+ return
+ if not self.ast1_event:
+ return
+ if not self.ast2_event:
+ return
+
+ # Parked call subtest completed successfully.
+ # Clear parked call subtest completion stage flags.
+ self.got_AMI_UnParkedCall = False
+ self.ast1_event = False
+ self.ast2_event = False
+
+ if self.request_exten == 101:
+ # Start next parked call subtest.
+ self.expected_space = 702
+ self.request_exten = 102
+ self.initate_call_to_park()
+ return
+
+ if self.request_exten == 102:
+ # Start next parked call subtest.
+ self.expected_space = 703
+ self.request_exten = 103
+ self.initate_call_to_park()
+ return
+
+ # All parked call subtests completed successfully.
+ self.passed = True
+ self.stop_reactor()
+
+ # Initiate test call to park.
+ def initate_call_to_park(self):
+ logger.info("Initiating test call for " + str(self.request_exten))
+ self.ast[0].cli_originate("Local/9876 at ast2/n extension " + str(self.request_exten) + "@ast2")
# Initiate a call to retrieve the parked call.
def get_parkedcall(self):
- logger.info("Fetching parked call")
- self.ast[1].cli_originate("IAX2/ast1/701 extension s at ast1")
+ logger.info("Fetching parked call at " + str(self.expected_space))
+ self.ast[1].cli_originate("IAX2/ast1/" + str(self.expected_space) + " extension retrieve at ast1")
# Called when got UnParkedCall AMI event
def ast1_unparkedcall(self, ami, event):
exten = event.get("exten").lower()
- logger.info("Parked call retrieved from exten:" + str(exten))
- if exten != "701":
- logger.info("Call not retrieved from expected space")
+ logger.info("Parked call retrieved from exten: " + str(exten))
+ if exten != str(self.expected_space):
+ logger.info("Call not retrieved from expected space " + str(self.expected_space))
self.stop_reactor()
return
@@ -54,9 +92,9 @@
# Called when got ParkedCall AMI event
def ast1_parkedcall(self, ami, event):
exten = event.get("exten").lower()
- logger.info("Call parked at exten:" + str(exten))
- if exten != "701":
- logger.info("Call not parked in expected space")
+ logger.info("Call parked at exten: " + str(exten))
+ if exten != str(self.expected_space):
+ logger.info("Call not parked in expected space " + str(self.expected_space))
self.stop_reactor()
return
@@ -65,7 +103,7 @@
# Called when got UserEvent AMI event from Ast2
def ast2_userevent(self, ami, event):
status = event.get("status")
- logger.info("ast2_userevent status:" + str(status))
+ logger.info("ast2_userevent status: " + str(status))
if status != "SUCCESS":
self.stop_reactor()
return
@@ -76,7 +114,7 @@
# Called when got UserEvent AMI event from Ast1
def ast1_userevent(self, ami, event):
status = event.get("status")
- logger.info("ast1_userevent status:" + str(status))
+ logger.info("ast1_userevent status: " + str(status))
if status != "SUCCESS":
self.stop_reactor()
return
@@ -97,8 +135,7 @@
# Initiate test when both AMI connections are established.
self.ami_count += 1
if self.ami_count == 2:
- logger.info("Initiating test call")
- self.ast[0].cli_originate("Local/9876 at ast2/n extension 101 at ast2")
+ self.initate_call_to_park()
# This is called when the reactor has started running.
def run(self):
Modified: asterisk/team/rmudgett/parking/tests/callparking/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/rmudgett/parking/tests/callparking/test-config.yaml?view=diff&rev=2504&r1=2503&r2=2504
==============================================================================
--- asterisk/team/rmudgett/parking/tests/callparking/test-config.yaml (original)
+++ asterisk/team/rmudgett/parking/tests/callparking/test-config.yaml Tue Oct 4 16:35:05 2011
@@ -1,10 +1,10 @@
testinfo:
summary: 'Test Call Parking'
description: |
- 'This test verifies the Call Parking routine used in the feature code.'
+ 'This test verifies Call Parking by DTMF one-step, DTMF blind xfer, DTMF atxfer. Also tests features findslot=next option.'
properties:
- minversion: '1.6.2'
+ minversion: '1.8'
dependencies:
- python : 'twisted'
- python : 'starpy'
More information about the asterisk-commits
mailing list