Skip to content

Commit

Permalink
app_confbridge: Tests for user answer_channel
Browse files Browse the repository at this point in the history
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
InterLinked1 committed May 28, 2021
1 parent 6f93ce2 commit 7cf20a2
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 0 deletions.
@@ -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
@@ -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 tests/apps/confbridge/confbridge_noanswer/test-config.yaml
@@ -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'
1 change: 1 addition & 0 deletions tests/apps/confbridge/tests.yaml
Expand Up @@ -4,6 +4,7 @@ tests:
- test: 'confbridge_end_marked'
- test: 'confbridge_marked'
- test: 'confbridge_marked_unmarked'
- test: 'confbridge_noanswer'
- test: 'confbridge_nominal'
- test: 'confbridge_recording'
- test: 'confbridge_result'
Expand Down

0 comments on commit 7cf20a2

Please sign in to comment.