Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
app_confbridge: Tests for user answer_channel
This tests the operation of the new answer_channel user option and ensures that the default behavior has not changed. ASTERISK-29440 Change-Id: Ib150939cd806c842c49dbc4be5b56d0fb5e962d4
- Loading branch information
1 parent
6f93ce2
commit 7cf20a2
Showing
4 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
tests/apps/confbridge/confbridge_noanswer/configs/ast1/confbridge.conf
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,16 @@ | ||
[user_noanswer] | ||
type=user | ||
answer_channel=no | ||
timeout=5 | ||
|
||
[user_answer] | ||
type=user | ||
answer_channel=yes | ||
timeout=5 | ||
|
||
[default_user] | ||
type=user | ||
timeout=5 | ||
|
||
[default_bridge] | ||
type=bridge |
25 changes: 25 additions & 0 deletions
25
tests/apps/confbridge/confbridge_noanswer/configs/ast1/extensions.conf
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,25 @@ | ||
[default] | ||
exten => noanswer,1,Answer() | ||
same => n,Dial(Local/noanswer@conf/n,4,g) | ||
same => n,GotoIf($["${DIALSTATUS}"="NOANSWER"]?pass,1:fail,1) | ||
exten => answer,1,Answer() | ||
same => n,Dial(Local/answer@conf/n,4,g) | ||
same => n,GotoIf($["${DIALSTATUS}"="ANSWER"]?pass,1:fail,1) | ||
exten => default,1,Answer() | ||
same => n,Dial(Local/default@conf/n,4,g) | ||
same => n,GotoIf($["${DIALSTATUS}"="ANSWER"]?pass,1:fail,1) | ||
exten => fail,1,UserEvent(ConfBridgeNoAnswer,Result: Fail,Reason: ${DIALSTATUS}) | ||
same => n,Hangup() | ||
exten => pass,1,UserEvent(ConfBridgeNoAnswer,Result: Pass) | ||
same => n,Hangup() | ||
|
||
[conf] | ||
exten => noanswer,1,Progress() | ||
same => n,ConfBridge(test,,user_noanswer) | ||
same => n,Hangup() | ||
exten => answer,1,Progress() | ||
same => n,ConfBridge(test,,user_answer) | ||
same => n,Hangup() | ||
exten => default,1,Progress() | ||
same => n,ConfBridge(test) | ||
same => n,Hangup() |
72 changes: 72 additions & 0 deletions
72
tests/apps/confbridge/confbridge_noanswer/test-config.yaml
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,72 @@ | ||
testinfo: | ||
summary: 'Ensure that Confbridge user no answer option works as expected' | ||
description: | | ||
'This test configures ConfBridge user profiles with all combinations of | ||
answer_channel options. We expect that a call to noanswer will not | ||
be answered and calls to answer and default will be answered. We also | ||
test that the default behavior remains unchanged.' | ||
test-modules: | ||
test-object: | ||
config-section: test-object-config | ||
typename: 'test_case.TestCaseModule' | ||
modules: | ||
- | ||
config-section: noanswer-originator | ||
typename: 'pluggable_modules.Originator' | ||
- | ||
config-section: answer-originator | ||
typename: 'pluggable_modules.Originator' | ||
- | ||
config-section: default-originator | ||
typename: 'pluggable_modules.Originator' | ||
- | ||
config-section: hangup-monitor | ||
typename: 'pluggable_modules.HangupMonitor' | ||
- | ||
config-section: ami-config | ||
typename: 'ami.AMIEventModule' | ||
|
||
test-object-config: | ||
connect-ami: True | ||
|
||
noanswer-originator: | ||
channel: 'Local/noanswer@default' | ||
application: 'Echo' | ||
trigger: 'ami_connect' | ||
|
||
answer-originator: | ||
channel: 'Local/answer@default' | ||
application: 'Echo' | ||
trigger: 'ami_connect' | ||
|
||
default-originator: | ||
channel: 'Local/default@default' | ||
application: 'Echo' | ||
trigger: 'ami_connect' | ||
|
||
hangup-monitor: | ||
ids: '0' | ||
|
||
ami-config: | ||
- | ||
type: 'headermatch' | ||
conditions: | ||
match: | ||
Event: 'UserEvent' | ||
UserEvent: 'ConfBridgeNoAnswer' | ||
requirements: | ||
match: | ||
Result: 'Pass' | ||
count: 3 | ||
|
||
|
||
properties: | ||
tags: | ||
- confbridge | ||
- apps | ||
dependencies: | ||
- python: 'twisted' | ||
- python: 'starpy' | ||
- asterisk: 'app_confbridge' | ||
- asterisk: 'app_userevent' |
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