Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds tests for SendSF, ReceiveSF, and SF dial integration. ASTERISK-29802 Change-Id: Ieacd700811b26d336e9ce8422a7785547fd40c6f
- Loading branch information
1 parent
db40fcc
commit 8a79a6e
Showing
3 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
|
||
[default] | ||
exten => s,1,Answer() | ||
same => n,Set(GLOBAL(sendsf1)=111111) | ||
same => n,Set(GLOBAL(sendsf2)=1234567890) | ||
same => n,Set(GLOBAL(sendsf3)=4652544465) | ||
same => n,Set(GLOBAL(sendsf4)=996512350) | ||
same => n,Set(GLOBAL(sendsf5)=10104345) | ||
same => n,Set(GLOBAL(sendsf6)=056863456) | ||
same => n,Set(GLOBAL(sendsf7)=723503763) | ||
same => n,Set(GLOBAL(sendsf8)=567565967) | ||
same => n,Set(GLOBAL(sendsf9)=6565546) | ||
same => n,Set(i=0) | ||
same => n,While($[${INC(i)}<=8]) | ||
same => n,Originate(Local/${i}@send-sf,exten,receive-sf,${i},1,,a) | ||
same => n,EndWhile() | ||
same => n,Dial(Local/9@receive-sf,,D(:::::${sendsf9})) | ||
same => n,Hangup() | ||
|
||
[nothing] | ||
exten => 0,1,Answer() | ||
same => n,Wait(15) ; enough time for sendsf9 to send. must be greater than ReceiveSF timeout. | ||
same => n,Hangup() | ||
|
||
[send-sf] | ||
exten => _X!,1,Answer(0.5) | ||
same => n,SendSF(${sendsf${EXTEN}}) | ||
same => n,Wait(44) ; needed so ReceiveSF has time to finish. | ||
same => n,Hangup() | ||
|
||
[receive-sf] | ||
exten => _X!,1,Answer() | ||
same => n,ReceiveSF(digits,${LEN(${sendsf${EXTEN}})}) | ||
same => n,GotoIf($["${digits}"="${sendsf${EXTEN}}"]?success,1:fail,1) | ||
exten => 9,1,Progress() | ||
same => n,ReceiveSF(digits,,10) | ||
same => n,GotoIf($["${digits}"="${sendsf${EXTEN}}"]?success,1:fail,1) | ||
exten => success,1,Answer(1) | ||
same => n,UserEvent(ReceiveSFSuccess,Result: Pass) | ||
same => n,Hangup() | ||
exten => fail,1,Answer(1) | ||
same => n,UserEvent(ReceiveSFSuccess,Result: Fail ${RECEIVESFSTATUS} ${digits},Reason: ${digits}) | ||
same => n,Hangup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
testinfo: | ||
summary: 'Ensure that app_sf module functions correctly.' | ||
description: | | ||
'This tests the SendSF and ReceiveSF applications as | ||
well as Dial D option work correctly.' | ||
test-modules: | ||
test-object: | ||
config-section: test-object-config | ||
typename: 'test_case.TestCaseModule' | ||
modules: | ||
- | ||
config-section: caller-originator | ||
typename: 'pluggable_modules.Originator' | ||
- | ||
config-section: hangup-monitor | ||
typename: 'pluggable_modules.HangupMonitor' | ||
- | ||
config-section: ami-config | ||
typename: 'pluggable_modules.EventActionModule' | ||
|
||
test-object-config: | ||
connect-ami: True | ||
|
||
caller-originator: | ||
channel: 'Local/s@default' | ||
context: 'nothing' | ||
exten: '0' | ||
priority: '1' | ||
trigger: 'ami_connect' | ||
|
||
hangup-monitor: | ||
ids: '0' | ||
|
||
ami-config: | ||
- | ||
ami-events: | ||
conditions: | ||
match: | ||
Event: 'UserEvent' | ||
UserEvent: 'ReceiveSFSuccess' | ||
requirements: | ||
match: | ||
Result: 'Pass' | ||
count: 9 | ||
stop_test: | ||
|
||
properties: | ||
tags: | ||
- dial | ||
- apps | ||
dependencies: | ||
- python: 'twisted' | ||
- python: 'starpy' | ||
- asterisk: 'app_dial' | ||
- asterisk: 'app_userevent' | ||
- asterisk: 'app_originate' | ||
- asterisk: 'app_sf' | ||
- asterisk: 'pbx_config' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,5 @@ tests: | |
- test: 'waitdigit' | ||
- dir: 'sendtext' | ||
- test: 'mf' | ||
- test: 'sf' | ||
- test: 'read' |